/* trader.dfive.us — phone-first, dark navy, numbers first.

   Green is up, red is down, and each strategy has its own colour that carries
   from the card to the chart to the table. Everything else stays quiet. */

:root {
  --bg: #0b1020;
  --bg-2: #111a33;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --ink: #eef2ff;
  --ink-2: #aeb7d6;
  --ink-3: #7681a6;
  --up: #34d399;
  --down: #f87171;
  --warn: #fbbf24;
  --info: #60a5fa;
  --radius: 18px;
  --radius-s: 12px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(900px 500px at 10% -10%, rgba(96,165,250,.14), transparent 60%),
                    radial-gradient(700px 400px at 100% 0%, rgba(52,211,153,.10), transparent 60%);
  background-attachment: fixed;
  color: var(--ink); font: 16px/1.45 var(--font); overscroll-behavior-y: none; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--info); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tiny { font-size: 12.5px; }
.small { font-size: 14px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-2); }
.warn { color: var(--warn); }
.bad { color: var(--down); }

body.signing-in { background: #f5f2ec; background-image: none; }
body.signing-in #app { padding: 0; max-width: none; }

#app { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(40px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand-name span { color: var(--ink-3); font-weight: 600; }
.spacer { flex: 1; }
.who { color: var(--ink-3); font-size: 13px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.tabs { display: grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; color: var(--ink-2); min-height: 40px; border-radius: 10px; font-weight: 650; font-size: 14.5px; }
.tabs button.is-on { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.eyebrow { color: var(--ink-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.h-mid { font-size: 18px; }
.big { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.mid { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hero { background: var(--bg-2); }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.vs { text-align: right; }
.banner { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.4); font-weight: 650; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.grid2 .card { margin-bottom: 0; }
.strat { border-top: 3px solid var(--c); }
.strat-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.strat-name i, .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.strat .big { margin: 6px 0 4px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }

/* buttons */
.btn { min-height: var(--tap); padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink);
       font-weight: 650; font-size: 15.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--up); color: #062016; border-color: transparent; font-weight: 800; }
.btn-danger { color: var(--down); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; white-space: nowrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.chart .zero { stroke: rgba(255,255,255,.28); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.lg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg b { font-variant-numeric: tabular-nums; }

/* tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }

/* decisions */
.tk { border-left: 3px solid var(--c); }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { color: var(--up); background: rgba(52,211,153,.12); }
.badge.warn { color: #0b1020; background: var(--warn); }
.badge.info { color: var(--info); background: rgba(96,165,250,.14); }
.badge.bad { color: var(--down); background: rgba(248,113,113,.12); }
.order { font-weight: 700; margin-top: 8px; }
.reason { margin-top: 6px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.sources { margin-top: 10px; font-size: 13.5px; }
.sources summary { cursor: pointer; color: var(--ink-3); font-weight: 650; }
.sources ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }
.sources li { margin: 4px 0; overflow-wrap: anywhere; }

/* rules */
.rules h3 { font-size: 15px; margin: 16px 0 6px; color: var(--ink); }
.rules ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.rules li { margin: 4px 0; }

/* sheet + toast + misc */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-body { position: relative; width: 100%; max-width: 720px; margin: 0 auto; max-height: 88dvh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 12px 16px calc(24px + var(--safe-b)); }
.sheet-grip { display: block; width: 44px; height: 5px; border-radius: 999px; border: 0; background: var(--line-2); margin: 2px auto 14px; padding: 0; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--card-2); color: var(--ink-2); font-size: 16px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 60; background: #1a2340; color: var(--ink); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 14px; font-weight: 650; font-size: 14.5px; max-width: 92vw; }
.toast.is-bad { border-color: var(--down); }
.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.empty .big { display: block; font-size: 34px; margin-bottom: 6px; }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--up); animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
