/* Tickbook. Layout: trading-desk shell. Left rail of sections on desktop, bottom tab bar on phones. Black and blue, dark by default. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --raised: #FAFBFC;
  --sunk: #EEF1F5;
  --ink: #0A0D12;
  --ink-2: #3B4350;
  --muted: #6B7380;
  --line: #E4E8EE;
  --line-2: #CDD4DE;
  --accent: #1D4ED8;
  --accent-btn: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E7EEFF;
  --glow: rgba(29, 78, 216, .10);
  --gain: #11795A;
  --loss: #C23B32;
  --warn: #9A6A00;
  --news: #C8371F;
  --live: #E5383B;
  --scrim: rgba(10, 13, 18, .45);
  --shadow-sm: 0 1px 2px rgba(10, 13, 18, .05), 0 1px 1px rgba(10, 13, 18, .03);
  --shadow: 0 24px 60px rgba(10, 13, 18, .22);

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --t-2xs: .6875rem; --t-xs: .75rem; --t-sm: .8125rem; --t-md: .9375rem; --t-lg: 1.125rem; --t-xl: 1.625rem; --t-2xl: 2.5rem;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05070A; --surface: #0B0F15; --raised: #10151C; --sunk: #151B23; --ink: #EEF1F5; --ink-2: #A9B3C1; --muted: #7A8494;
    --line: #1A212B; --line-2: #283140; --accent: #5B8DFF; --accent-btn: #2D5FEF; --accent-ink: #FFFFFF; --accent-soft: #0F1B36; --glow: rgba(61, 111, 248, .20);
    --gain: #2FA97A; --loss: #E0574B; --warn: #E2B64A; --news: #F26B4F; --live: #FF4D50;
    --scrim: rgba(0, 0, 0, .65); --shadow-sm: none; --shadow: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #05070A; --surface: #0B0F15; --raised: #10151C; --sunk: #151B23; --ink: #EEF1F5; --ink-2: #A9B3C1; --muted: #7A8494;
  --line: #1A212B; --line-2: #283140; --accent: #5B8DFF; --accent-btn: #2D5FEF; --accent-ink: #FFFFFF; --accent-soft: #0F1B36; --glow: rgba(61, 111, 248, .20);
  --gain: #2FA97A; --loss: #E0574B; --warn: #E2B64A; --news: #F26B4F; --live: #FF4D50;
  --scrim: rgba(0, 0, 0, .65); --shadow-sm: none; --shadow: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }

[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: var(--t-md); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--gain); }
.neg { color: var(--loss); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: calc(22px + env(safe-area-inset-top, 0px)) 14px 18px max(14px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-family: var(--f-display); font-weight: 800; font-stretch: 120%; font-size: 1.1875rem; letter-spacing: -.02em; }
.brand-mark { display: grid; gap: 2.5px; width: 18px; }
.brand-mark i { display: block; height: 3px; border-radius: 2px; background: var(--ink); }
.brand-mark i:nth-child(1) { width: 55%; margin-left: auto; }
.brand-mark i:nth-child(2) { width: 100%; background: var(--accent); }
.brand-mark i:nth-child(3) { width: 78%; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--t-sm); }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
.nav a[aria-current="page"] svg { color: var(--accent); }
.nav .count { margin-left: auto; font-family: var(--f-mono); font-size: var(--t-2xs); color: var(--muted); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; }
.status { font-size: var(--t-xs); color: var(--muted); display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); margin-top: 5px; flex: none; }
.status[data-mode="cloud"]::before { background: var(--gain); box-shadow: 0 0 0 3px color-mix(in oklab, var(--gain) 20%, transparent); }
.status[data-mode="local"]::before { background: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.pagehead { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--live-h, 0px)); z-index: 6; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.pagehead.scrolled { border-bottom-color: var(--line); }
.pagehead .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 18px 14px; }
.pagehead .mbrand { display: none; }
.pagehead .titles { min-width: 0; flex: 1 1 260px; }
.pagehead h1 { font-size: var(--t-xl); font-weight: 800; font-stretch: 110%; line-height: 1.15; }
.pagehead .sub { color: var(--muted); font-size: var(--t-sm); margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gutter { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
.content { padding-block: 6px 72px; display: grid; gap: 20px; max-width: 1280px; width: 100%; }
.view { display: grid; gap: 20px; min-width: 0; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; z-index: 15; flex-direction: row; gap: 0; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand, .rail-foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: var(--t-2xs); text-align: center; }
  .nav .count { display: none; }
  .gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .pagehead { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pagehead .mbrand { display: flex; width: 100%; justify-content: space-between; align-items: center; }
  .pagehead .inner { padding-block: 12px 12px; }
  .pagehead h1 { font-size: 1.375rem; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); padding: 7px 13px; min-height: 36px; font-size: var(--t-sm); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent-btn); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--loss); }
.btn.danger.armed { background: var(--loss); border-color: var(--loss); color: #fff; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: var(--t-xs); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; padding: 0; }
.kbd { font-family: var(--f-mono); font-size: .66rem; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .7; }
@media (max-width: 560px) { .btn .lbl-wide { display: none; } .kbd { display: none; } }

.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field > span, .field > legend { font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 7px 10px; font-size: var(--t-sm); min-height: 38px;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, var(--line-2) 60%, var(--ink-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
input.price { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--loss); }
input.filled, select.filled { border-color: var(--accent); background: var(--accent-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.filters .field { min-width: 150px; flex: 0 1 190px; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 16px 18px 0; }
.panel-head h2 { font-size: var(--t-md); font-weight: 700; font-stretch: 105%; }
.panel-head .aside { font-size: var(--t-xs); color: var(--muted); }
.panel-body { padding: 12px 18px 18px; min-width: 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-radius: var(--r); font-size: var(--t-sm); color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); }
.banner.risk { border: 1px solid color-mix(in oklab, var(--loss) 45%, var(--line)); background: color-mix(in oklab, var(--loss) 7%, var(--surface)); color: var(--ink); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: 1.55fr repeat(3, minmax(0, 1fr)); overflow: hidden; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 3px; align-content: start; min-width: 0; }
.kpi:nth-child(2), .kpi:nth-child(3), .kpi:nth-child(4) { border-top: 0; }
.kpi.hero { grid-row: span 2; border: 0; align-content: space-between; gap: 14px; background: linear-gradient(160deg, var(--accent-soft), transparent 70%); }
.kpi .value { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: var(--t-lg); font-weight: 600; letter-spacing: -.01em; }
.kpi .value > span { white-space: nowrap; }
.kpi.hero .value { font-family: var(--f-display); font-stretch: 100%; font-variant-numeric: tabular-nums; font-size: var(--t-2xl); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.kpi .sub { font-size: var(--t-xs); color: var(--muted); }
.kpi .split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi svg.spark { width: 100%; height: 56px; display: block; }
.ring { width: 46px; height: 46px; flex: none; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.hero { grid-column: span 2; grid-row: auto; }
  .kpi { border-top: 1px solid var(--line) !important; }
  .kpi:nth-child(even) { border-left: 0; }
  .kpi.hero .value { font-size: 2rem; }
}

/* ---------- Chart ---------- */
.chart-wrap { position: relative; min-width: 0; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap svg text { font-family: var(--f-mono); font-size: 11px; fill: var(--muted); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 7px 10px; font-size: var(--t-xs); box-shadow: var(--shadow); white-space: nowrap; z-index: 2; color: var(--ink-2); }
.tip strong { display: block; font-family: var(--f-mono); font-size: var(--t-sm); }

/* ---------- Calendar ---------- */

/* ---------- Tables ---------- */
.grid-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .grid-2col { grid-template-columns: minmax(0, 1fr); } }
.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-weight: 600; font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { position: relative; height: 8px; min-width: 70px; }
.bar::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--line-2); }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar i.pos { background: var(--gain); left: calc(50% + 2px); }
.bar i.neg { background: var(--loss); right: calc(50% + 2px); }
@media (max-width: 560px) { .barcol { display: none; } }

.trades-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; justify-content: space-between; }
.trades-tools .left { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; flex: 1 1 320px; }
.trades-tools .left .field { flex: 1 1 200px; max-width: 320px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: var(--t-xs); background: var(--surface); font-weight: 600; min-height: 32px; }
.chip button { border: 0; background: var(--sunk); border-radius: 50%; width: 22px; height: 22px; cursor: pointer; line-height: 1; }
.tlist tbody tr[data-id] { cursor: pointer; }
.tlist tbody tr[data-id]:hover td { background: var(--raised); }
.tlist td { white-space: nowrap; }
.tlist td.setup { white-space: normal; min-width: 130px; color: var(--ink-2); }
.tlist td.thumb { width: 52px; padding-right: 0; }
.tlist .thumb img { width: 44px; height: 30px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; background: var(--sunk); }
.tlist .thumb .more { font-size: var(--t-2xs); color: var(--muted); }
.side { display: inline-block; font-size: var(--t-2xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; }
.side.long { color: var(--gain); background: color-mix(in oklab, var(--gain) 12%, transparent); }
.side.short { color: var(--loss); background: color-mix(in oklab, var(--loss) 12%, transparent); }
.grade { font-family: var(--f-display); font-weight: 800; }
.tag { display: inline-block; font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 6px; font-weight: 600; }
.acct-tag { font-size: var(--t-xs); color: var(--ink-2); }
.day-head td { background: var(--raised); font-size: var(--t-xs); color: var(--ink-2); font-weight: 700; padding-block: 7px; }

/* ---------- Empty ---------- */
.empty { display: grid; gap: 32px; padding: 36px; align-items: center; }
.empty .copy { display: grid; gap: 16px; justify-items: start; }
.empty h2 { font-size: 1.75rem; font-weight: 800; font-stretch: 112%; line-height: 1.1; }
.empty p { color: var(--ink-2); max-width: 54ch; }
.empty .row { display: flex; flex-wrap: wrap; gap: 10px; }
.ticket-demo { font-family: var(--f-mono); font-size: var(--t-sm); border-radius: var(--r); padding: 16px 18px; background: var(--sunk); display: grid; gap: 6px; color: var(--ink-2); }
.ticket-demo .head { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-weight: 600; }
.ticket-demo .rule { border-top: 1px dashed var(--line-2); margin: 4px 0; }
@media (max-width: 760px) { .empty { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; } }

/* ---------- Accounts ---------- */
.prop-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prop-sum > div { padding: 16px 18px; border-left: 1px solid var(--line); display: grid; gap: 3px; min-width: 0; }
.prop-sum > div:first-child { border-left: 0; }
.prop-sum .value { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: var(--t-lg); font-weight: 600; }
.prop-sum .sub { font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 760px) { .prop-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prop-sum > div:nth-child(3) { border-left: 0; } .prop-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.acct { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 14px; align-content: start; box-shadow: var(--shadow-sm); min-width: 0; }
.acct.breached { border-color: color-mix(in oklab, var(--loss) 50%, var(--line)); }
.acct-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acct-top .firm { font-size: var(--t-xs); color: var(--muted); font-weight: 600; }
.acct-top h3 { font-size: var(--t-lg); font-weight: 800; font-stretch: 108%; overflow-wrap: anywhere; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: var(--t-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.badge.eval { background: var(--accent-soft); color: var(--accent); }
.badge.funded { background: color-mix(in oklab, var(--gain) 14%, transparent); color: var(--gain); }
.badge.bad { background: color-mix(in oklab, var(--loss) 14%, transparent); color: var(--loss); }
.badge.good { background: color-mix(in oklab, var(--gain) 14%, transparent); color: var(--gain); }
.bal { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.bal .big { font-family: var(--f-display); font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; display: block; }
.bal .right { text-align: right; }
.bal .pl { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; display: block; }
.meter { display: grid; gap: 5px; }
.meter .row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--t-xs); color: var(--ink-2); }
.meter .row b { font-weight: 600; color: var(--ink); }
.meter .row .mono { font-size: var(--t-xs); white-space: nowrap; }
.track { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 999px; background: var(--ink-2); }
.track i.safe { background: var(--gain); }
.track i.watch { background: var(--warn); }
.track i.risk { background: var(--loss); }
.track i.prog { background: var(--accent); }
.state { font-weight: 700; }
.state.safe { color: var(--gain); }
.state.watch { color: var(--warn); }
.state.risk { color: var(--loss); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 1px; min-width: 0; }
.facts dt { font-size: var(--t-2xs); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.facts dd { margin: 0; font-family: var(--f-mono); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.acct-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-empty { display: grid; gap: 12px; justify-items: start; padding: 28px; }
.acct-empty h2 { font-size: var(--t-lg); font-weight: 800; }
.acct-empty p { color: var(--ink-2); max-width: 60ch; font-size: var(--t-sm); }

/* ---------- Contracts ---------- */
.contracts td input { max-width: 110px; text-align: right; font-family: var(--f-mono); min-height: 32px; padding: 4px 8px; }
.group-row td { background: var(--raised); font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.add-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
@media (max-width: 700px) { .add-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.prose { max-width: 68ch; color: var(--ink-2); font-size: var(--t-sm); }
.import { border: 1px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; background: var(--surface); }
.import p { font-size: var(--t-sm); }

/* ---------- Drawers ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--surface); z-index: 21; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 14px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--t-lg); font-weight: 800; font-stretch: 108%; }
.drawer-body { overflow-y: auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 28px 22px; display: grid; gap: 16px; align-content: start; flex: 1; }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--raised); }
.drawer-foot .spacer { flex: 1; }
.form-error { flex-basis: 100%; color: var(--loss); font-size: var(--t-sm); }
.form-error:empty { display: none; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.payout-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.payout-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--t-sm); }
.section-title { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-family: var(--f-body); font-weight: 700; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 15px; font-size: var(--t-sm); font-weight: 600; border-left: 1px solid var(--line-2); color: var(--ink-2); min-width: 44px; text-align: center; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--surface); }
.seg.side-seg span { min-width: 84px; }
.seg.side-seg input[value="long"]:checked + span { background: var(--gain); color: #fff; }
.seg.side-seg input[value="short"]:checked + span { background: var(--loss); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggles label { position: relative; }
.toggles input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggles span { display: block; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; font-size: var(--t-xs); color: var(--ink-2); font-weight: 500; }
.toggles input:checked + span { border-color: var(--loss); color: var(--loss); background: color-mix(in oklab, var(--loss) 10%, var(--surface)); }
.toggles.copy input:checked + span { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.toggles input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.ticket { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: var(--t-sm); background: var(--sunk); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; }
.ticket .line { display: flex; justify-content: space-between; gap: 12px; }
.ticket .line .k { color: var(--muted); }
.ticket .big { font-size: var(--t-lg); font-weight: 600; }
.ticket .rule { border-top: 1px dashed var(--line-2); margin: 5px 0; }
.ticket.idle { color: var(--muted); font-family: var(--f-body); }

/* Screenshot reader + gallery */
.reader { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; background: var(--raised); }
.reader.busy { border-style: solid; border-color: var(--accent); }
.reader .rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reader .rhead p { font-size: var(--t-sm); color: var(--ink-2); flex: 1 1 240px; }
.reader .rhead b { color: var(--ink); }
.scanbar { height: 3px; border-radius: 3px; background: var(--sunk); overflow: hidden; position: relative; }
.scanbar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--accent); border-radius: 3px; animation: scan 1.2s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateX(0); } to { transform: translateX(185%); } }
.found { display: grid; gap: 6px; }
.found label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: var(--t-sm); cursor: pointer; }
.found .mono { font-size: var(--t-xs); color: var(--ink-2); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.shot { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--sunk); max-width: 100%; }
.shot button.open { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.shot button.open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .62); color: #fff; cursor: pointer; line-height: 1; font-size: 15px; }
.shot .up { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in oklab, var(--surface) 70%, transparent); font-size: var(--t-xs); font-weight: 600; }
.addshot { aspect-ratio: 4 / 3; border: 1px dashed var(--line-2); border-radius: var(--r-sm); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: var(--t-xs); font-weight: 600; cursor: pointer; background: var(--surface); text-align: center; padding: 6px; max-width: 100%; }
.addshot:hover { border-color: var(--accent); color: var(--ink); }
.dropping .drawer-body { outline: 2px dashed var(--accent); outline-offset: -8px; }

.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(6, 8, 10, .92); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: calc(12px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); color: #fff; }
.lightbox .lb-top { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-sm); }
.lightbox .lb-stage { display: grid; min-height: 0; padding: 12px 0; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; display: block; min-height: 0; }
.lightbox .lb-nav { display: flex; justify-content: center; gap: 10px; }
.lightbox button { background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: var(--r-sm); min-height: 38px; padding: 0 14px; cursor: pointer; font-weight: 600; }

.toast-zone { position: fixed; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; z-index: 40; pointer-events: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (max-width: 900px) { .toast-zone { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
.toast { background: var(--ink); color: var(--surface); padding: 10px 15px; border-radius: var(--r); font-size: var(--t-sm); box-shadow: var(--shadow); max-width: 520px; font-weight: 500; }
.toast.error { background: var(--loss); color: #fff; }

/* ---------- Fills (scaling in and out) ---------- */
.mode-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 36px; }
.switch input { width: 34px; height: 20px; appearance: none; -webkit-appearance: none; background: var(--line-2); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.fills-block { display: grid; gap: 6px; }
.fills-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fills-head > span { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.fill-cols, .fill { display: grid; grid-template-columns: 74px minmax(0, 1fr) 104px 30px; gap: 6px; align-items: center; }
.fill-cols span { font-size: var(--t-2xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fill input { min-height: 34px; padding: 5px 8px; }
.fill .rm-fill { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; font-size: 16px; }
.fill .rm-fill:hover { background: var(--sunk); color: var(--loss); }
.fills-sum { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); }
.fills-sum.bad { color: var(--loss); }
.ticket .fillline { font-size: var(--t-xs); }
.news-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-sm); padding: 9px 12px; border-radius: var(--r-sm); background: color-mix(in oklab, var(--news) 9%, var(--surface)); border: 1px solid color-mix(in oklab, var(--news) 30%, var(--line)); color: var(--ink); }
.news-note svg { width: 16px; height: 16px; fill: var(--news); flex: none; margin-top: 2px; }

/* ---------- Full P&L calendar ---------- */
.cal-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; justify-content: space-between; }
.cal-tools .left { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav h3 { font-size: var(--t-md); font-weight: 800; font-stretch: 110%; min-width: 9em; text-align: center; }
.bigcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(92px, 1fr); gap: 6px; }
.bigcal .dow { font-size: var(--t-2xs); color: var(--muted); padding: 0 4px 2px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.bday { min-height: 122px; border-radius: 10px; padding: 8px 9px; display: flex; flex-direction: column; gap: 3px; background: var(--sunk); border: 1px solid transparent; text-align: left; cursor: pointer; color: var(--ink); font: inherit; min-width: 0; }
.bday:hover { border-color: var(--ink-2); }
.bday.blank { background: transparent; cursor: default; }
.bday.today { border-color: var(--accent); }
.bday.sel { box-shadow: 0 0 0 2px var(--ink); }
.bday .top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.bday .d { font-size: var(--t-xs); color: var(--muted); font-weight: 700; }
.bday .p { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bday .p-short, .bday .ndot { display: none; }
.bday .n { font-size: var(--t-2xs); color: var(--ink-2); }
.chips { margin-top: auto; display: grid; gap: 3px; min-width: 0; }
.nchip { display: flex; align-items: center; gap: 4px; font-size: .6875rem; font-weight: 600; color: var(--news); background: color-mix(in oklab, var(--news) 10%, var(--surface)); border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nchip svg, .ndot svg, .fold { width: 11px; height: 11px; fill: var(--news); flex: none; }
.bweek { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; align-content: space-between; font-size: var(--t-xs); min-height: 122px; }
.bweek .p { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-md); }
.day .fold { position: absolute; top: 6px; right: 6px; }
.day { position: relative; }
@media (max-width: 760px) {
  .bigcal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .bigcal .wk { display: none; }
  .bday { min-height: 62px; padding: 5px 4px; border-radius: 7px; }
  .bday .n, .bday .chips, .bday .p-long { display: none; }
  .bday .p-short { display: block; font-size: .7rem; }
  .bday .ndot { display: inline-flex; }
}
.daydetail { display: grid; gap: 14px; }
.newslist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.newslist li { display: grid; grid-template-columns: auto 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--t-sm); padding: 7px 10px; border-radius: var(--r-sm); background: var(--raised); border: 1px solid var(--line); }
.newslist .tm { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }
.newslist .src { font-size: var(--t-2xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mini td, .mini th { padding: 6px 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.ev-add { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.ev-title { font-size: var(--t-xs); font-weight: 700; color: var(--ink); }
.ev-add .ev-title { grid-column: 1 / -1; font-size: var(--t-xs); font-weight: 700; color: var(--ink); }
.ev-add .ev-line { grid-column: 1 / -1; display: flex; gap: 8px; align-items: end; min-width: 0; }
.ev-add .ev-line .field { flex: 1; }
.ev-add .ev-line .btn { min-height: 38px; }
.url-box { font-family: var(--f-mono); font-size: var(--t-xs); background: var(--sunk); padding: 6px 9px; border-radius: var(--r-sm); user-select: all; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
  @keyframes slide { from { transform: translateX(32px); opacity: .5; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .scanbar::after { animation: none; width: 100%; opacity: .5; } }

/* ---------- Sign-in screen ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-size: var(--t-sm); }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-pitch { background: var(--surface); border-right: 1px solid var(--line); padding: 48px max(40px, env(safe-area-inset-left, 0px)) 48px max(40px, env(safe-area-inset-left, 0px)); display: grid; align-content: center; gap: 28px; position: relative; overflow: hidden; }
.auth-pitch::after { content: ""; position: absolute; inset: auto -20% -40% auto; width: 70%; aspect-ratio: 1; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; }
.auth-pitch > * { position: relative; z-index: 1; max-width: 520px; }
.auth-pitch h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; font-stretch: 112%; line-height: 1.05; letter-spacing: -.02em; }
.auth-pitch .lede { color: var(--ink-2); font-size: var(--t-lg); max-width: 44ch; }
.pitch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pitch-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: var(--t-md); color: var(--ink-2); }
.pitch-list li::before { content: ""; width: 10px; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--accent); }
.auth-main { display: grid; place-items: center; padding: 40px max(24px, env(safe-area-inset-right, 0px)) 40px 24px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card h2 { font-size: var(--t-xl); font-weight: 800; font-stretch: 110%; }
.auth-card .sub { color: var(--ink-2); font-size: var(--t-sm); margin-top: -6px; }
.auth-card input { min-height: 42px; font-size: var(--t-md); }
.auth-card .btn.primary { min-height: 44px; font-size: var(--t-md); }
.auth-ok { color: var(--gain); font-size: var(--t-sm); }
.auth-ok:empty { display: none; }
.auth-links { display: grid; gap: 6px; justify-items: start; padding-top: 4px; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: var(--t-sm); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.auth-foot { font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-pitch { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); gap: 16px; }
  .auth-pitch .ticket-demo, .pitch-list { display: none; }
  .auth-pitch .lede { font-size: var(--t-md); }
  .auth-main { place-items: start center; padding-top: 28px; }
}
.who { display: grid; gap: 4px; font-size: var(--t-xs); color: var(--ink-2); overflow-wrap: anywhere; }
.who .btn { justify-self: start; padding-left: 0; }
.boot-box { max-width: 560px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; color: var(--ink-2); font-size: var(--t-md); line-height: 1.55; text-align: left; }
.boot-box h1 { font-size: var(--t-xl); color: var(--ink); font-weight: 800; font-stretch: 110%; }
.boot-box ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.boot-box code { font-family: var(--f-mono); font-size: .85em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.boot-detail { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.boot-ver { display: block; text-align: center; font-size: var(--t-xs); color: var(--muted); opacity: .8; margin-top: 4px; }

/* Dates and times read as numbers */
input[type="date"], input[type="time"] { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: var(--t-sm); min-width: 0; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

/* ---------- Dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 12px; align-content: space-between; min-width: 0; position: relative; transition: border-color .15s ease, transform .15s ease; box-shadow: var(--shadow-sm); }
.stat:hover { border-color: var(--line-2); }
.stat.hero { background: radial-gradient(130% 150% at 0% 0%, var(--glow), transparent 62%), var(--surface); }
.stat .top { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; }
.stat .vis { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.stat .val { font-family: var(--f-display); font-weight: 800; font-size: 1.75rem; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.hero .val { font-size: 2rem; }
.stat .help { font-size: var(--t-xs); color: var(--muted); line-height: 1.4; }
.stat .help b { color: var(--ink-2); font-weight: 600; }
.gauge { width: 76px; height: 44px; flex: none; }
.ring2 { width: 48px; height: 48px; flex: none; }
.wlbar { display: grid; gap: 5px; min-width: 0; flex: 1; max-width: 120px; }
.wlbar i { display: block; height: 6px; border-radius: 3px; }
.wlbar i.w { background: var(--gain); }
.wlbar i.l { background: var(--loss); }
.stat .spark { width: 100%; height: 34px; display: block; }
@media (max-width: 1180px) { .stat-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } .stat { grid-column: span 2; } .stat:nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 620px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat, .stat:nth-child(n+4) { grid-column: span 1; } .stat.hero { grid-column: span 2; } .stat .val { font-size: 1.4rem; } .gauge { width: 60px; height: 36px; } }

.info { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 700 10px/1 var(--f-body); cursor: help; display: inline-grid; place-items: center; padding: 0; flex: none; }
.info:hover, .info:focus-visible { color: var(--ink); border-color: var(--ink-2); }
.info::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: 240px; background: var(--ink); color: var(--surface); font: 500 var(--t-xs)/1.45 var(--f-body); text-align: left; padding: 9px 11px; border-radius: 8px; box-shadow: var(--shadow); display: none; z-index: 8; white-space: normal; max-width: calc(100vw - 40px); }
.info.start::after { left: -8px; transform: none; }
.info.end::after { left: auto; right: -8px; transform: none; }
.info:hover::after, .info:focus-visible::after { display: block; }

.mini-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mini-row > div { padding: 14px 16px; border-left: 1px solid var(--line); display: grid; gap: 4px; min-width: 0; }
.mini-row > div:first-child { border-left: 0; }
.mini-row .top { display: flex; align-items: center; gap: 6px; font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.mini-row .v { font-family: var(--f-mono); font-weight: 600; font-size: var(--t-md); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 980px) { .mini-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mini-row > div:nth-child(4) { border-left: 0; } .mini-row > div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 520px) { .mini-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini-row > div { border-left: 0 !important; border-top: 1px solid var(--line); } .mini-row > div:nth-child(even) { border-left: 1px solid var(--line) !important; } .mini-row > div:nth-child(-n+2) { border-top: 0; } }

.chart-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .chart-row, .split-row { grid-template-columns: minmax(0, 1fr); } }
.panel-head .linkish { font-size: var(--t-xs); }
.recent td { padding: 9px 8px; }
.recent tr[data-id] { cursor: pointer; }
.recent tr[data-id]:hover td { background: var(--raised); }
.recent .when { color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }

.gs { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--line)); background: radial-gradient(120% 160% at 100% 0%, var(--glow), transparent 60%), var(--surface); }
.gs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.gs-head h2 { font-size: var(--t-lg); font-weight: 800; font-stretch: 108%; }
.gs-head p { color: var(--ink-2); font-size: var(--t-sm); }
.gs-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1180px) { .gs-steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); } }
.gs-step { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line); }
.gs-step .t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: var(--t-sm); }
.gs-step .t i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-size: 11px; flex: none; }
.gs-step.done .t i { background: var(--gain); border-color: var(--gain); color: #fff; }
.gs-step.done .t { color: var(--ink-2); }
.gs-step p { font-size: var(--t-xs); color: var(--muted); line-height: 1.45; }
.gs-step .btn { justify-self: start; margin-top: 2px; }

@media (prefers-reduced-motion: no-preference) {
  #dash.enter > * { animation: rise .35s ease both; }
  #dash.enter > *:nth-child(2) { animation-delay: .03s; } #dash.enter > *:nth-child(3) { animation-delay: .06s; } #dash.enter > *:nth-child(4) { animation-delay: .09s; } #dash.enter > *:nth-child(5) { animation-delay: .12s; } #dash.enter > *:nth-child(6) { animation-delay: .15s; }
  @keyframes rise { from { transform: translateY(6px); opacity: .55; } to { transform: none; opacity: 1; } }
  .stat:hover { transform: translateY(-1px); }
}

/* ---------- Live alerts ---------- */
.live-banner { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: color-mix(in oklab, var(--live) 16%, var(--surface)); border-bottom: 1px solid color-mix(in oklab, var(--live) 45%, var(--line)); color: var(--ink); font-size: var(--t-sm); }
.live-banner.soon { background: color-mix(in oklab, var(--accent) 14%, var(--surface)); border-bottom-color: color-mix(in oklab, var(--accent) 40%, var(--line)); }
.live-banner .tag-live { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: var(--t-2xs); letter-spacing: .1em; color: var(--live); text-transform: uppercase; }
.live-banner.soon .tag-live { color: var(--accent); }
.live-banner .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
.live-banner .msg { flex: 1 1 260px; min-width: 0; }
.live-banner .msg b { font-weight: 700; }
.live-banner .msg span { color: var(--ink-2); }
.live-banner .x { border: 0; background: transparent; color: var(--ink-2); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; }
.live-banner .x:hover { background: color-mix(in oklab, var(--ink) 8%, transparent); }
@media (prefers-reduced-motion: no-preference) { .live-banner:not(.soon) .dot { animation: pulse 1.6s ease-out infinite; } @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } } }
.alert-box { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.theme-toggle { justify-self: start; }

/* Calendar, day detail and news on the dashboard */
.dash-cal { display: grid; gap: 20px; }
.cal-head { flex-wrap: wrap; gap: 10px 16px; }
.cal-head .month-nav { margin-right: auto; }
.cal-panel .prop-sum { border-bottom: 1px solid var(--line); }
.dash-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-stack { display: grid; gap: 16px; }
@media (max-width: 1100px) { .dash-lower { grid-template-columns: minmax(0, 1fr); } }
#cal-panel, #news-panel, #day-panel { scroll-margin-top: calc(var(--live-h, 0px) + 84px); }
