:root {
  --blue: #006BB6; --red: #ED174C; --navy: #002B5C;
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef1f6; --line: #dfe4ec;
  --text: #0f1a2b; --muted: #5d6a7e; --accent: var(--blue); --accent-ink: #fff;
  --good: #0f8a4b; --bad: #d1263f; --warn-bg: #fff3e6; --warn-ink: #8a4b00; --info-bg: #eaf3fb; --info-ink: #0b4f86;
  --c-going: #0f8a4b; --c-selling: #d97706; --c-listed: #7c3aed; --c-sold: #006BB6; --c-undecided: #8a94a6;
  --p1: #006BB6; --p2: #ED174C; --guest: #6b7280;
  --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", Inter, system-ui, sans-serif;
  --nav-h: 64px; --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111e; --surface: #121c2d; --surface-2: #19253a; --line: #24324a;
    --text: #e8edf5; --muted: #93a0b5; --accent: #3d9be0;
    --good: #34c77b; --bad: #ff5c75; --warn-bg: #3a2810; --warn-ink: #ffc27a; --info-bg: #0f2a44; --info-ink: #9fd0ff;
    --c-going: #34c77b; --c-selling: #f59e0b; --c-listed: #a78bfa; --c-sold: #3d9be0; --c-undecided: #7c879a;
    --p1: #3d9be0; --p2: #ff5c75; --guest: #9aa3b2;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111e; --surface: #121c2d; --surface-2: #19253a; --line: #24324a;
  --text: #e8edf5; --muted: #93a0b5; --accent: #3d9be0;
  --good: #34c77b; --bad: #ff5c75; --warn-bg: #3a2810; --warn-ink: #ffc27a; --info-bg: #0f2a44; --info-ink: #9fd0ff;
  --c-going: #34c77b; --c-selling: #f59e0b; --c-listed: #a78bfa; --c-sold: #3d9be0; --c-undecided: #7c879a;
  --p1: #3d9be0; --p2: #ff5c75; --guest: #9aa3b2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body.drawer-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-align: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: .01em; line-height: 1.1; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 10px; }
h4 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); } .bad { color: var(--bad); }
.r { text-align: right; justify-content: flex-end; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* ---------- Layout */
.topbar { position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--muted); font-weight: 600; font-size: 15px; margin-left: 4px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: inset 0 -4px 0 var(--red); }
.brand-mark.big { width: 72px; height: 72px; font-size: 38px; border-radius: 20px; box-shadow: inset 0 -8px 0 var(--red); margin: 0 auto 16px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; overflow: hidden; border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.demo-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); }
.sync { font-size: 12px; color: var(--muted); }

.content { padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.sidenav { display: none; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a, .sidenav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: 1; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a:hover, .sidenav a:hover { text-decoration: none; color: var(--text); }
.tabbar a.active, .sidenav a.active { color: var(--accent); }
.tabbar svg, .sidenav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; position: fixed; top: var(--top-h); left: 0; bottom: 0; width: 200px; padding: 20px 12px; border-right: 1px solid var(--line); }
  .sidenav a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-radius: 10px; font-size: 15px; }
  .sidenav a.active { background: var(--surface-2); }
  .content { margin-left: 200px; padding: 28px 32px 48px; max-width: none; }
  .content > * { max-width: 1100px; width: 100%; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pad { padding: 16px; }

/* ---------- Buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; width: 100%; min-height: 48px; font-size: 16px; }
.link { color: var(--accent); font-weight: 600; }
.link.danger { color: var(--bad); margin-top: 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; }
.list-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.small button { padding: 5px 10px; font-size: 13px; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; text-align: center; padding: 10px 6px; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .filters { flex-wrap: wrap; margin: 0; padding: 0; } }
.filters button { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.filters button.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.pill.ghost { background: none; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 6px 0; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.interest { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; }

/* ---------- Chips, people, logos */
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.chip-going { --c: var(--c-going); } .chip-selling { --c: var(--c-selling); } .chip-listed { --c: var(--c-listed); } .chip-sold { --c: var(--c-sold); } .chip-undecided { --c: var(--c-undecided); }
.person { display: inline-flex; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; margin: 0 4px 0 0; white-space: nowrap; }
.person.p1 { background: var(--p1); } .person.p2 { background: var(--p2); } .person.guest { background: var(--guest); }
.logo { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--team) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--team) 25%, transparent); overflow: hidden; vertical-align: middle; }
.logo img { position: absolute; inset: 12%; width: 76%; height: 76%; object-fit: contain; }
.logo b { font-family: var(--display); font-size: 11px; color: var(--team); }
.logo img + b { visibility: hidden; }
.int { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; border: 1.5px dashed var(--line); color: var(--muted); margin-right: 3px; }
.int.yes.p1 { background: var(--p1); border: 0; color: #fff; } .int.yes.p2 { background: var(--p2); border: 0; color: #fff; }
.trend { font-size: 12px; font-weight: 700; white-space: nowrap; margin-left: 4px; }
.trend.up { color: var(--good); } .trend.down { color: var(--bad); } .trend.flat { color: var(--muted); }
.spark { vertical-align: middle; margin-left: 6px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.6; } .spark circle { fill: var(--accent); }

/* ---------- Home */
.hero { cursor: pointer; background: linear-gradient(135deg, var(--navy), var(--blue) 70%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 28px solid rgba(255,255,255,.06); }
.hero .eyebrow, .hero .label, .hero p, .hero .muted { color: rgba(255,255,255,.75); }
.hero h1 { font-size: 34px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.hero .chip { background: rgba(255,255,255,.18); color: #fff; }
.hero-main { display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; }
.vs { display: flex; align-items: center; gap: 14px; min-width: 0; }
.vs h1, .vs h2 { overflow-wrap: anywhere; }
.hero .logo { background: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-stats .val { font-weight: 700; font-size: 16px; }
.hero-stats .val.big { font-family: var(--display); font-size: 28px; }
.hero .trend.up { color: #7dffb6; } .hero .trend.down { color: #ffb3c0; }
.countdown { display: flex; gap: 14px; margin-top: 16px; font-size: 12px; color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.countdown b { font-family: var(--display); font-size: 24px; color: #fff; margin-right: 2px; }
@media (min-width: 760px) { .hero-main { flex-direction: row; justify-content: space-between; align-items: center; } .hero-stats { min-width: 420px; } }
@media (max-width: 420px) { .hero h1 { font-size: 27px; } .hero-stats .val.big { font-size: 24px; } }

.stat-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); box-shadow: var(--shadow); }
@media (max-width: 560px) { .stat-row { grid-template-columns: 1fr 1fr; } .stat-row > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.stat .n { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
button.stat:hover { border-color: var(--accent); }

.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.info { background: var(--info-bg); color: var(--info-ink); }
.mine { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; font-size: 14px; }
.mine .label { width: 100%; }
.mini-list, .activity { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mini-list li:last-child { border: 0; }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-right { flex: none; }
.more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 14px; }
.activity li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.activity li .muted { margin-left: auto; }
.meter { position: relative; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 4px 0 10px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.meter-fill.planned { background: color-mix(in srgb, var(--c-selling) 45%, transparent); }
.meter-fill.planned.over { background: repeating-linear-gradient(45deg, var(--bad), var(--bad) 6px, color-mix(in srgb, var(--bad) 60%, transparent) 6px, color-mix(in srgb, var(--bad) 60%, transparent) 12px); }
.meter-fill.done { background: var(--c-sold); }

/* ---------- Games list */
.game-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gl-head, .game-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.6fr) 70px 110px 80px; gap: 12px; align-items: center; padding: 10px 16px; }
.gl-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.game-row { width: 100%; border-bottom: 1px solid var(--line); }
.game-row:last-child { border: 0; }
.game-row:hover { background: var(--surface-2); }
.game-row.past { opacity: .55; }
.gr-game { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gr-game > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.gr-game b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-plan { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.gr-low, .gr-est { display: flex; align-items: center; flex-direction: row; }
.gr-est { flex-direction: column; align-items: flex-end; }
@media (max-width: 760px) {
  .gl-head { display: none; }
  .game-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "game est" "plan int"; row-gap: 6px; padding: 12px 14px; }
  .game-row .gr-game { grid-area: game; } .game-row .gr-est { grid-area: est; } .game-row .gr-plan { grid-area: plan; } .game-row .gr-int { grid-area: int; text-align: right; }
  .gr-low { display: none; }
  .hide-sm { display: none !important; }
}

/* ---------- Calendar */
.months { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.month h3 { color: var(--text); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); position: relative; }
.cal-day.today { outline: 2px solid var(--accent); }
.cal-day.has { background: color-mix(in srgb, var(--team) 14%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--team) 30%, transparent); }
.cal-day.has .ab { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--team); line-height: 1; }
.cal-day .dn { font-size: 10px; line-height: 1; margin-bottom: 2px; }
.cal-day .dot, .cal-legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-day .dot { position: absolute; top: 4px; right: 4px; }
.cal-day.going .dot, .dot.going { background: var(--c-going); } .cal-day.selling .dot, .dot.selling { background: var(--c-selling); }
.cal-day.listed .dot, .dot.listed { background: var(--c-listed); } .cal-day.sold .dot, .dot.sold { background: var(--c-sold); }
.cal-day.undecided .dot, .dot.undecided { background: var(--c-undecided); }
.cal-day.dim { opacity: .3; } .cal-day.past { filter: grayscale(.7); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-day.has .ab, :root:not([data-theme="light"]) .logo b { filter: brightness(1.8) saturate(.8); } }

/* ---------- Market */
.big-num { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1.1; }
.mkt-list { display: flex; flex-direction: column; margin-top: 8px; }
.mkt-row { display: grid; grid-template-columns: minmax(110px, 1.3fr) minmax(60px, 2fr) 60px 56px 56px 64px 80px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); width: 100%; }
.mkt-row:hover { background: var(--surface-2); }
.bar-wrap { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 999px; background: var(--c-undecided); }
.bar.going { background: var(--c-going); } .bar.selling { background: var(--c-selling); } .bar.listed { background: var(--c-listed); } .bar.sold { background: var(--c-sold); }
.mkt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
@media (max-width: 760px) { .mkt-row { grid-template-columns: minmax(0, 1fr) 60px 56px 76px; gap: 8px; } }
.mkt-row .gr-game span { white-space: nowrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.tbl th.r { text-align: right; }
.tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r { text-align: right; }
.tbl tr[data-open] { cursor: pointer; }
.tbl tr[data-open]:hover td { background: var(--surface-2); }
.price-tbl th { text-transform: none; letter-spacing: 0; }

/* ---------- Split */
.settle { text-align: center; padding: 24px; }
.settle-line { font-size: 18px; }
.settle .big-num { display: inline-block; margin: 0 6px; color: var(--accent); }
.person-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; border-top: 5px solid var(--pc); box-shadow: var(--shadow); }
.person-card.p1 { --pc: var(--p1); } .person-card.p2 { --pc: var(--p2); }
.person-card h3 { color: var(--pc); font-size: 22px; text-transform: none; }
.person-card dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
.person-card dt { color: var(--muted); } .person-card dd { margin: 0; text-align: right; font-weight: 600; }

/* ---------- Drawer */
.scrim { position: fixed; inset: 0; background: rgba(5,10,20,.5); z-index: 40; animation: fade .15s ease; }
.drawer { position: fixed; z-index: 41; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; inset: 0; animation: up .22s cubic-bezier(.2,.8,.2,1); outline: none; }
@media (min-width: 900px) { .drawer { inset: 0 0 0 auto; width: min(620px, 100vw); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: slide .22s cubic-bezier(.2,.8,.2,1); } }
@media (max-width: 899px) { .drawer { top: 0; padding-top: env(safe-area-inset-top); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.d-head { position: relative; padding: 18px 16px 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--team) 22%, var(--surface)), var(--surface)); border-bottom: 1px solid var(--line); }
.d-head h2 { font-size: 30px; font-weight: 800; margin: 2px 0; }
.d-head .close { position: absolute; top: 14px; right: 14px; }
.d-head .vs { padding-right: 44px; }
.d-status { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.d-body { padding: 4px 16px calc(32px + env(safe-area-inset-bottom)); }
.d-body > section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
@media (min-width: 520px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kpis .val { font-weight: 700; font-size: 17px; }
.kpis .muted, .kpis .label { display: block; }
.kpis .val.big { font-family: var(--display); font-size: 26px; display: block; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .low-line { fill: none; stroke: var(--muted); stroke-width: 2; }
.chart .est-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .sold-dot { fill: var(--c-sold); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.k-low { background: var(--muted); } .k-est { background: var(--accent); } .k-sold { background: var(--c-sold); height: 8px !important; width: 8px !important; border-radius: 50% !important; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.links a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.foot { margin-top: 12px; }

/* ---------- Sign-in, loading, toast */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--blue) 30%, transparent), transparent 60%), radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--red) 22%, transparent), transparent 55%), var(--bg); }
.signin-card { width: 100%; max-width: 380px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.signin-card h1 { font-size: 40px; }
.error-text { color: var(--bad); font-size: 14px; }
.card.error { border-color: var(--bad); }
.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 0; color: var(--muted); }
.ball { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a4d, #d9560b); animation: bounce .6s ease-in-out infinite alternate; }
@keyframes bounce { to { transform: translateY(-18px); } }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.tappable { pointer-events: auto; cursor: pointer; }
@media (min-width: 900px) { #toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
