:root {
  --bg: #07090f; --panel: #0e131d; --panel2: #121927; --line: #1f2939; --text: #e8edf5; --muted: #8a96a8;
  --dim: #5d6879; --blue: #3b8beb; --red: #f04452; --gold: #e9b93a; --green: #2fc58a; --teal: #2bc4c4;
  --amber: #f0a43a; --violet: #a78bfa; --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: var(--blue); }
kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* brand */
.brand-chip { background: #fff; border-radius: 12px; padding: 10px 14px; display: inline-flex; align-items: center; }
.brand-chip img { height: 44px; width: auto; display: block; }
.brand-chip.small { padding: 5px 8px; border-radius: 10px; }
.brand-chip.small img { height: 30px; }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; position: sticky; top: 0; background: rgba(7, 9, 15, .94); backdrop-filter: blur(8px); z-index: 5; }
.top-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-title h1 { font-size: 19px; }
.top-title p { margin: 0; color: var(--muted); font-size: 12.5px; }
.periods { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 4px; margin: 0 auto; flex-wrap: wrap; }
.periods button { background: none; border: 0; color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 13.5px; white-space: nowrap; }
.periods button:hover { color: var(--text); }
.periods button[aria-pressed="true"] { background: var(--gold); color: #1b1404; font-weight: 600; }
.periods select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 8px; font: inherit; font-size: 13px; }
.top-actions { display: flex; gap: 8px; }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: #33435c; }
.btn.ghost { background: none; color: var(--muted); font-weight: 500; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.busy .spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.custom-row { display: flex; gap: 12px; align-items: center; padding: 10px 24px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; color: var(--muted); }
.custom-row input { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; margin-left: 6px; }
.subbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px 0; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 12px;
  padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--blue); background: #0f2038; }
.tabs button .tag { font-size: 10.5px; color: var(--gold); margin-left: 6px; font-weight: 700; letter-spacing: .04em; }
.updated { margin-left: auto; color: var(--muted); font-size: 12.5px; text-align: right; }
.main { padding: 18px 24px 40px; display: grid; gap: 18px; max-width: 1500px; margin: 0 auto; }
.loading { color: var(--muted); }
.notice { background: #1b1607; border: 1px solid #4a3a10; color: #f3dc9b; border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.notice.info { background: #0c1a2c; border-color: #1d3c63; color: #b9d5f5; }
.error { background: #2a0c10; border: 1px solid #5c1a22; color: #ffc1c7; border-radius: 12px; padding: 12px 14px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 138px;
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.tile .sub { color: var(--muted); font-size: 12.5px; }
.tile .chips { display: grid; gap: 4px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.tile .chip { display: flex; justify-content: space-between; font-size: 12px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }
.tile .chip b { font-variant-numeric: tabular-nums; }
.tone-green { border-color: #13402f; background: linear-gradient(180deg, #0b1d17, var(--panel)); }
.tone-green .value { color: var(--green); }
.tone-teal { border-color: #124142; background: linear-gradient(180deg, #0a1c1d, var(--panel)); }
.tone-teal .value { color: var(--teal); }
.tone-amber { border-color: #4a3410; background: linear-gradient(180deg, #1c150a, var(--panel)); }
.tone-amber .value { color: var(--amber); }
.tone-red { border-color: #4d1620; background: linear-gradient(180deg, #1d0b10, var(--panel)); }
.tone-red .value { color: var(--red); }
.tone-gold { border-color: #4b3c12; background: linear-gradient(180deg, #1c170a, var(--panel)); }
.tone-gold .value { color: var(--gold); }
.tone-blue { border-color: #183457; background: linear-gradient(180deg, #0b1626, var(--panel)); }
.tone-blue .value { color: var(--blue); }
.tone-violet { border-color: #2f2556; background: linear-gradient(180deg, #120f22, var(--panel)); }
.tone-violet .value { color: var(--violet); }
.tile.soon { border-style: dashed; background: var(--panel); }
.tile.soon .value { font-size: 15px; color: var(--muted); font-weight: 700; margin-top: 8px; }
.custom-row[hidden] { display: none; }
.soon-badge { align-self: flex-start; order: -1; margin-bottom: 4px; font-size: 10px; letter-spacing: .06em; font-weight: 800;
  color: var(--gold); border: 1px solid #4b3c12; border-radius: 999px; padding: 2px 7px; }
.bar { height: 6px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar.red > i { background: var(--red); } .bar.green > i { background: var(--green); } .bar.gold > i { background: var(--gold); }

/* panels + tables */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.panel .psub { color: var(--muted); font-size: 12.5px; margin: 4px 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tr.total td { color: var(--muted); font-weight: 700; border-top: 1px solid var(--line); }
td.soon-cell { color: var(--dim); }
th.soon-col { color: var(--dim); }
.status { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.s-on_track { color: var(--green); } .s-close { color: var(--gold); } .s-behind { color: var(--red); } .s-early { color: var(--muted); }
.rank1 td:first-child, .rank1 td:nth-child(2) { color: var(--gold); font-weight: 800; }
.medal { font-weight: 800; color: var(--gold); }
.fix { color: #cfd8e6; }
.na { color: var(--muted); font-size: 12.5px; }
.lead { font-size: 15px; color: #cfd8e6; }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fstep { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.fstep .k { color: var(--muted); font-size: 12px; }
.fstep .v { font-size: 22px; font-weight: 800; margin-top: 2px; }
.fstep .g { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fstep .rate { color: var(--gold); font-size: 12px; font-weight: 700; margin-top: 6px; }
.fstep.soon { border-style: dashed; }

/* swings */
.swing { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.swing:last-child { border-bottom: 0; }
.swing .who { font-weight: 600; } .swing .why { color: var(--muted); font-size: 12px; }
.swing .amt { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); } .pos { color: var(--green); }
.swing-h { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 2px; }

/* chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .ax { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .barv { fill: var(--blue); }
.chart .barv.cur { fill: #2a5d9c; }
.chart .goal { stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.chart .lbl { fill: var(--text); font-size: 11px; font-weight: 700; }
.legend { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* found money */
.fm-rule { border-top: 1px solid var(--line); padding: 12px 0; }
.fm-rule:first-of-type { border-top: 0; }
.fm-rule h3 { font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.fm-rule h3 .cnt { color: var(--gold); font-variant-numeric: tabular-nums; }
.fm-rule p { margin: 4px 0; color: #cfd8e6; }
.fm-rule ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.fm-rule li { margin: 3px 0; }

/* coming soon list */
.missing li { margin: 8px 0; }
.missing b { color: var(--text); }
.foot { color: var(--dim); font-size: 12px; padding: 0 24px 30px; max-width: 1500px; margin: 0 auto; }

/* gate */
.gate-body { display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate { width: 100%; max-width: 440px; text-align: center; }
.gate-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; }
.gate-card h1 { font-size: 22px; margin: 18px 0 10px; }
.gate-card p { color: #cfd8e6; }
.gate-card form { margin: 16px 0 6px; }
.gate-card .btn { justify-content: center; }
.gate-note { color: var(--muted) !important; font-size: 12.5px; }
.gate-foot { color: var(--dim); font-size: 12px; margin-top: 14px; }

@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .top { padding: 10px 16px; gap: 10px; }
  .periods { order: 3; width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
  .top-actions { margin-left: auto; }
  .top-title p { display: none; }
  .subbar, .custom-row { padding-left: 16px; padding-right: 16px; }
  .main { padding: 14px 16px 32px; }
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; min-height: 120px; }
  .tile .value { font-size: 26px; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .updated { margin-left: 0; text-align: left; width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .tabs button { white-space: nowrap; }
  .foot { padding: 0 16px 24px; }
}
