:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222221;
  --surface-3: #2a2a28;
  --border: rgba(255, 255, 255, 0.10);
  --grid: #2c2c2a;
  --axis: #383835;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --muted: #898781;
  --blue: #3987e5;
  --orange: #d95926;
  --up: #0ca30c;
  --down: #d03b3b;
  --warn: #fab219;
  --serious: #ec835a;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 4px 10px 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--blue); display: grid; place-items: center; font-size: 13px; color: #fff; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; font-size: 12px; color: var(--muted); }
.conn { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--up); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--down); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--text); }

main { padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.banner { border: 1px solid var(--border); border-left: 3px solid var(--warn); background: rgba(250, 178, 25, 0.08); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.bad { border-left-color: var(--down); background: rgba(208, 59, 59, 0.10); }
.banner strong { white-space: nowrap; }

.grid { display: grid; gap: 14px; }
.g-dash { grid-template-columns: repeat(12, 1fr); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card h2 .right { display: flex; gap: 6px; align-items: center; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.badge.sim { color: var(--text-2); border-color: var(--border); background: transparent; font-weight: 500; }
.badge.sim::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); opacity: 0.8; }
.badge.exp { color: #b9b3f5; border-color: rgba(144, 133, 233, 0.45); background: rgba(144, 133, 233, 0.10); }
.badge.stale { color: var(--serious); border-color: rgba(236, 131, 90, 0.5); background: rgba(236, 131, 90, 0.10); }
.badge.live { color: #7fd77f; border-color: rgba(12, 163, 12, 0.5); background: rgba(12, 163, 12, 0.10); }
.badge.bad { color: #f08a8a; border-color: rgba(208, 59, 59, 0.5); background: rgba(208, 59, 59, 0.10); }

/* hero */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.countdown { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.progress { position: relative; height: 8px; background: var(--surface-3); border-radius: 999px; margin-top: 14px; }
.progress .fill { position: absolute; inset: 0 auto 0 0; background: var(--blue); border-radius: 999px; transition: width .25s linear; }
.progress .tick { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--axis); border-radius: 1px; }
.progress .tick.done { background: var(--text-2); }
.ticks-labels { position: relative; height: 16px; margin-top: 6px; font-size: 10px; color: var(--muted); }
.ticks-labels span { position: absolute; transform: translateX(-50%); }

.call { display: flex; align-items: center; gap: 14px; }
.call-dir { white-space: nowrap; font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.call-dir.up { color: var(--up); } .call-dir.down { color: var(--down); }
.probbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 14px 0 6px; background: var(--surface); }
.probbar .u { background: var(--up); } .probbar .d { background: var(--down); }
.probrow { display: flex; justify-content: space-between; font-size: 13px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--up); } .delta-down { color: var(--down); }

.rec { border-radius: 8px; padding: 12px; background: var(--surface-2); border: 1px dashed rgba(250, 178, 25, 0.35); }
.rec-main { font-size: 20px; font-weight: 700; }

.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 240px; }
.chart-box.xs { height: 200px; }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--grid); }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); position: sticky; top: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
.ok-mark { color: var(--up); font-weight: 700; } .no-mark { color: var(--down); font-weight: 700; }
.dirtag { font-weight: 700; } .dirtag.up { color: var(--up); } .dirtag.down { color: var(--down); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.tile .label { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tile .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -0.01em; }
.tile .sub { color: var(--text-2); font-size: 12px; margin-top: 2px; }

/* forms */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=password], input[type=datetime-local], select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 36px; color: var(--text);
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn { background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; min-height: 36px; cursor: pointer; font-weight: 600; }
.btn:hover { background: #33332f; }
.btn.primary { background: var(--blue); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #2a78d6; }
.btn.danger { color: #f08a8a; border-color: rgba(208, 59, 59, 0.5); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 600; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; }
.settings-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.settings-grid .check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.settings-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.form-msg { font-size: 13px; }
.form-msg.ok { color: #7fd77f; } .form-msg.err { color: #f08a8a; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.news-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.news-item:last-child { border-bottom: 0; }
.news-title { font-weight: 600; color: var(--text); }
.news-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sent { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px) !important; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 20px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }

/* mobile */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .span-3 { grid-column: span 6; } .span-4 { grid-column: span 6; } .span-5, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 14px 14px 90px; }
  .g-dash > * { grid-column: span 12 !important; }
  .hero { grid-template-columns: 1fr; gap: 10px; }
  .countdown { font-size: 38px; }
  .chart-box { height: 260px; }
  .tabbar { display: grid; grid-template-columns: repeat(7, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); padding: 4px 0; }
  .tabbar a.active { color: var(--text); }
  .tabbar svg { width: 20px; height: 20px; }
  .mobile-top { display: flex !important; }
  .page-head h1 { font-size: 19px; }
  .filters .field { flex: 1 1 140px; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* early accuracy */
.section-head { margin: 26px 0 12px; }
.section-head:first-of-type { margin-top: 6px; }
.section-head h2 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--muted); max-width: 900px; }
.tile.main { border-color: rgba(57, 135, 229, 0.55); }
.early-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 12px 0 6px; }
.early-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 12px; line-height: 1.25; }
.early-chip .m { color: var(--muted); font-size: 11px; display: block; }
.early-chip.up b { color: var(--up); } .early-chip.down b { color: var(--down); }
.early-chip.missing { border-style: dashed; color: var(--serious); }
.early-chip.upcoming { opacity: 0.5; }
table.strip td { text-align: center; font-size: 12px; padding: 6px 6px; }
table.strip td:first-child { text-align: left; }
table.strip th { text-align: center; } table.strip th:first-child { text-align: left; }
.cell-up { color: var(--up); font-weight: 700; } .cell-down { color: var(--down); font-weight: 700; }
.cell-miss { color: var(--serious); }
.chrono-row { padding: 10px 0; border-bottom: 1px solid var(--grid); }
.chrono-row:last-child { border-bottom: 0; }
select#cal-minute { min-height: 30px; padding: 4px 8px; font-size: 12px; }

/* market + positions */
.mkt-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.mkt-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.book-details { margin-top: 10px; }
.book-details summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.book-grid table td, .book-grid table th { padding: 3px 6px; font-size: 11px; }
.open-form { display: flex; flex-direction: column; gap: 10px; }
.side-seg { width: 100%; }
.side-seg button { flex: 1; }
.side-seg button[data-side="UP"].on { color: var(--up); }
.side-seg button[data-side="DOWN"].on { color: var(--down); }
.preview-box { margin-top: 12px; background: var(--surface-2); border: 1px dashed rgba(250,178,25,0.35); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.preview-box .kv { font-size: 12px; }
.warn-text { color: var(--warn); font-size: 12px; margin-top: 6px; }
.status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.status-open { color: #7fd77f; } .status-exiting { color: var(--warn); } .status-closed, .status-settled { color: var(--text-2); } .status-void { color: var(--muted); }
.pos-sub { font-size: 11px; color: var(--muted); }

.pos-cards { display: none; }
.pos-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.pos-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pos-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
@media (max-width: 760px) { .pos-cards { display: block; } .pos-table { display: none; } }

/* Prediction History rounds */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
table.rounds tr.round-row { cursor: pointer; }
table.rounds tr.round-row:hover td, table.rounds tr.round-row:focus td { background: rgba(255, 255, 255, 0.03); }
table.rounds tr.round-row:focus { outline: none; }
table.rounds tr.round-row:focus-visible td:first-child { box-shadow: inset 2px 0 0 var(--blue); }
table.rounds .caret { display: inline-block; width: 12px; color: var(--muted); }
table.rounds tr.round-detail > td { background: rgba(0, 0, 0, 0.18); padding: 12px 14px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cp-chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); }
.cp-chip.missing { border-style: dashed; color: var(--muted); }
table.compact td, table.compact th { padding: 5px 8px; font-size: 12.5px; }
table.compact tr.m5 td { background: rgba(57, 135, 229, 0.14); }
#h-tiles .tile .value { font-size: 24px; }
table.rounds td:last-child { white-space: normal; min-width: 150px; }
table.rounds tr.round-detail > td { white-space: normal; }
@media (max-width: 640px) {
  #h-tiles { grid-template-columns: repeat(2, 1fr); }
  .table-wrap:has(> table.rounds) { overflow-x: visible; }
  table.rounds thead { display: none; }
  table.rounds, table.rounds tbody { display: block; }
  table.rounds tr.round-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  table.rounds tr.round-row td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; text-align: left; }
  table.rounds tr.round-row td:first-child { grid-column: 1 / -1; }
  table.rounds tr.round-row td { background: none !important; }
  table.rounds tr.round-row[aria-expanded="true"], table.rounds tr.round-row:hover { background: rgba(255, 255, 255, 0.03); }
  table.rounds tr.round-row td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
  table.rounds tr.round-detail { display: block; }
  table.rounds tr.round-detail.hidden { display: none; }
  table.rounds tr.round-detail > td { display: block; }
  #h-tiles .tile.main { grid-column: span 2; }
}

/* Paper trading card */
.btn.sm { min-height: 30px; padding: 4px 12px; font-size: 12.5px; white-space: nowrap; flex: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pt-head h2 { margin: 0; justify-content: flex-start; }
.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; background: var(--surface-2); border-radius: 10px; }
.pt-stat { padding: 12px 14px; min-width: 0; }
.pt-stat + .pt-stat { box-shadow: inset 1px 0 0 var(--border); }
.pt-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pt-value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-status { font-size: 16px; display: flex; align-items: center; gap: 7px; }
.pt-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; overflow-wrap: anywhere; }
.pt-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.pt-dot.on { background: var(--up); } .pt-dot.warn { background: var(--warn); } .pt-dot.idle { background: var(--blue); } .pt-dot.off { background: var(--muted); }
.pt-card .table-wrap { border: 0; }
.pt-card table th { background: transparent; border-bottom: 1px solid var(--border); }
.pt-card .note { margin-top: 10px; }
@media (max-width: 900px) {
  .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-stat:nth-child(3) { box-shadow: inset 0 1px 0 var(--border); }
  .pt-stat:nth-child(4) { box-shadow: inset 1px 0 0 var(--border), inset 0 1px 0 var(--border); }
}
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 400px; width: calc(100% - 32px); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.dialog h3 { margin: 0 0 8px; font-size: 16px; }
.dialog p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px); background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(208, 59, 59, 0.6); }
.th-sub { font-weight: 400; font-size: 10.5px; color: var(--muted); margin-left: 3px; }

/* Hypothetical follow-every-pick summary */
.hyp-card { margin: 4px 0 16px; }
.hyp-card .pt-stats { margin-bottom: 10px; }
.hyp-flag { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; line-height: 1.45; }
.hyp-flag.bad { color: #f2b0b0; background: rgba(208, 59, 59, 0.10); }
.hyp-card .note { margin: 4px 0 0; line-height: 1.5; }
.hyp-card .pt-head { flex-wrap: wrap; }
#hyp-period button { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }

/* Unit size / bankroll controls */
.hyp-config { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: -4px 0 12px; }
.hyp-config label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.in-money { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding-left: 10px; }
.in-money > span { color: var(--muted); }
.in-money input[type=number] { border: 0; background: transparent; width: 110px; min-height: 34px; padding: 6px 10px 6px 4px; }
.in-money:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.in-money input:focus-visible { outline: none; }
.hyp-config .btn { min-height: 36px; }
.hyp-card .pt-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .hyp-card .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hyp-card .pt-stat { box-shadow: none !important; border-top: 1px solid var(--border); }
  .hyp-card .pt-stat:first-child { grid-column: 1 / -1; border-top: 0; }
  .hyp-card .pt-stat:nth-child(even) { border-right: 1px solid var(--border); }
}

/* Hourly P&L */
.hourly-card { margin: 0 0 16px; }
.hourly-card .pt-head { flex-wrap: wrap; margin-bottom: 10px; }
.hourly-wrap { max-height: 420px; overflow-y: auto; }
table.hourly thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.hourly tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 650; border-top: 1px solid var(--border); }
table.hourly .hr-date { font-weight: 600; }
.hourly-card .note { margin: 10px 0 0; line-height: 1.5; }
@media (max-width: 640px) {
  .hourly-wrap { max-height: none; overflow: visible; }
  table.hourly thead { display: none; }
  table.hourly, table.hourly tbody, table.hourly tfoot { display: block; }
  table.hourly tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  table.hourly td { display: block; padding: 0; border: 0 !important; text-align: left; white-space: normal; position: static !important; background: none !important; }
  table.hourly td:first-child { grid-column: 1 / -1; }
  table.hourly td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-bottom: 1px; }
  table.hourly tfoot tr { background: var(--surface-2); border-radius: 8px; border: 0; }
  table.hourly td.empty { grid-column: 1 / -1; }
}

/* Review / lesson notes */
.review { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.review-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.review-k { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); margin-bottom: 4px; }
.review ul { margin: 0; padding-left: 18px; }
.review li { margin: 2px 0; }
.review-lesson { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.badge.v-variance { color: var(--text-2); }
.badge.v-possible { color: var(--warn); border-color: rgba(250, 178, 25, 0.45); background: rgba(250, 178, 25, 0.08); }
.badge.v-source { color: #9cc4f5; border-color: rgba(58, 137, 230, 0.45); background: rgba(58, 137, 230, 0.10); }
.badge.v-unclear { color: var(--muted); background: transparent; }
@media (max-width: 760px) { .review-cols { grid-template-columns: 1fr; gap: 10px; } }
.review-item { border-bottom: 1px solid var(--grid); }
.review-item > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 2px; cursor: pointer; list-style: none; }
.review-item > summary::-webkit-details-marker { display: none; }
.review-item > summary::before { content: '▸'; color: var(--muted); width: 10px; }
.review-item[open] > summary::before { content: '▾'; }
.review-item .ri-when { font-weight: 600; min-width: 110px; }
.review-item .review { margin: 0 0 12px; }
#learn-reviews .btn { margin-top: 12px; }
.cand { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.gates { list-style: none; margin: 8px 0; padding: 0; }
.gates li { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.gates li > span:first-child { width: 14px; font-weight: 700; }
.gates li.ok > span:first-child { color: var(--up); }
.gates li.no > span:first-child { color: var(--down); }
.span-all { grid-column: 1 / -1; margin: 0; }
td.coef { white-space: normal; min-width: 160px; max-width: 230px; }
#learn-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { #learn-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { #learn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gates li { display: block; position: relative; padding-left: 20px; }
.gates li > span:first-child { position: absolute; left: 0; top: 2px; }
table.hourly tr.more-row td { text-align: center; }
@media (max-width: 640px) { table.hourly tr.more-row { display: block; } table.hourly tr.more-row td { text-align: left; } }

/* Hourly P&L by day */
.hourly-wrap { max-height: none; overflow-y: visible; }
.hourly-card .pt-head .seg button { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
.hourly-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: -4px 0 12px; }
.hourly-custom.hidden { display: none; }
.hourly-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
table.hourly tr.hidden { display: none !important; }
table.hourly tr.day-row { cursor: pointer; }
table.hourly tr.day-row td { background: var(--surface-2); border-top: 1px solid var(--border); }
table.hourly tr.day-row:hover td, table.hourly tr.day-row:focus-visible td { background: var(--surface-3); }
table.hourly tr.day-row:focus { outline: none; }
table.hourly tr.day-row .caret { display: inline-block; width: 12px; color: var(--muted); }
table.hourly tr.day-row .badge { margin-left: 4px; }
table.hourly .hr-indent { padding-left: 20px; color: var(--text-2); }
table.hourly tr.day-row td:first-child .muted.small { padding-left: 16px; }
#hourly-pager.hidden { display: none; }
@media (max-width: 640px) {
  table.hourly tr.day-row { background: var(--surface-2); }
  table.hourly tr.hr-row { padding-left: 24px; }
  table.hourly .hr-indent { padding-left: 0; }
  .hourly-card .pt-head .seg { width: 100%; display: flex; }
  .hourly-card .pt-head .seg button { flex: 1; padding: 4px 4px; }
}
@media (max-width: 900px) {
  .hourly-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hourly-stats .pt-stat { box-shadow: none !important; border-top: 1px solid var(--border); }
  .hourly-stats .pt-stat:nth-child(-n+2) { border-top: 0; }
  .hourly-stats .pt-stat:nth-child(odd) { border-right: 1px solid var(--border); }
}
@media (max-width: 640px) {
  table.hourly tr { grid-template-columns: 1.1fr 0.7fr 0.7fr 1.2fr 1fr; gap: 4px 8px; }
  table.hourly tr.hr-row { padding: 8px 12px 8px 24px; }
  table.hourly td[data-l]::before { font-size: 10.5px; }
  table.hourly td[data-l="Predictions"]::before { content: 'Picks'; }
}

/* Auto-trading */
.auto-status { margin-bottom: 16px; }
.as-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 650; }
.as-pill.bad { color: #f08a8a; } .as-pill.warn { color: var(--warn); }
.as-detail { margin: 6px 0 8px; color: var(--text-2); font-size: 13px; }
.as-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.as-meta strong { color: var(--text); font-weight: 600; }
.auto-form { display: flex; flex-direction: column; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 13.5px; }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; flex: none; cursor: pointer; transition: background .15s; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
input.switch:checked { background: var(--blue); border-color: transparent; }
input.switch:checked::after { transform: translateX(18px); background: #fff; }
.auto-fields .field[hidden] { display: none; }
.tp-note { color: var(--up); margin-top: 2px; }
.venue-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 10px 0; }
.venue-field select { width: 100%; }
.venue-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); margin-left: 4px; vertical-align: 1px; }
.auto-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.auto-fields .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auto-fields .in-money input[type=number] { width: 100%; }
.auto-fields .in-money { width: 100%; }
.in-money .suffix { color: var(--muted); padding-right: 10px; }
.kv-line { font-size: 13px; margin: 4px 0; display: flex; align-items: center; gap: 8px; }
details.setup { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
details.setup summary { cursor: pointer; color: var(--text); font-weight: 600; }
details.setup ol { padding-left: 18px; line-height: 1.55; }
table.auto-table td.st-cell { white-space: normal; min-width: 190px; max-width: 320px; }
details.checks summary { cursor: pointer; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
details.checks .gates { font-size: 11.5px; margin: 4px 0 0; }
@media (max-width: 640px) { .auto-fields { grid-template-columns: 1fr 1fr; } .as-pill { font-size: 16px; } }
table.auto-table td.ar-round .badge { display: none; }
@media (max-width: 640px) {
  .table-wrap:has(> table.auto-table) { overflow-x: visible; }
  table.auto-table thead { display: none; }
  table.auto-table, table.auto-table tbody { display: block; }
  table.auto-table tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  table.auto-table td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; min-width: 0; max-width: none; }
  table.auto-table td.ar-round { grid-column: 1 / -1; font-weight: 600; }
  table.auto-table td.ar-round .badge { display: inline-flex; margin-left: 6px; }
  table.auto-table td.ar-mode { display: none; }
  table.auto-table td.st-cell { grid-column: 2 / -1; }
  table.auto-table td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; font-weight: 400; }
  table.auto-table td.empty { grid-column: 1 / -1; }
}
.conn-verdict { font-weight: 650; font-size: 13.5px; margin: 6px 0 4px; }
.conn-verdict.ok { color: var(--up); } .conn-verdict.no { color: #f08a8a; }
.gates li.strong { font-weight: 600; color: #f2b0b0; }
.debug-log { font-size: 11.5px; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; overflow-wrap: anywhere; }
details.setup table { margin-top: 6px; }

.auto-saved { color: var(--text-2); line-height: 1.5; }
.real-blocked { font-size: 12.5px; color: #f2b0b0; background: rgba(208, 59, 59, 0.10); border-radius: 8px; padding: 8px 12px; margin: 4px 0 10px; }
.real-blocked ul { margin: 4px 0 0; padding-left: 18px; }
.real-ready { font-size: 12.5px; color: #7fd77f; background: rgba(12, 163, 12, 0.10); border-radius: 8px; padding: 8px 12px; margin: 4px 0 10px; }

/* P&L calendar */
.cal-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#cal-mode button { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
.cal-month { font-weight: 650; min-width: 140px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11.5px; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.cal-cell { min-height: 92px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; color: var(--text); font: inherit; min-width: 0; }
.cal-cell.blank { background: transparent; border-color: transparent; cursor: default; }
.cal-cell:hover { border-color: var(--text-2); }
.cal-cell.pos { background: rgba(12, 163, 12, 0.14); border-color: rgba(12, 163, 12, 0.35); }
.cal-cell.neg { background: rgba(208, 59, 59, 0.14); border-color: rgba(208, 59, 59, 0.40); }
.cal-cell.pos .cal-net, .cal-cell.pos .cal-u { color: #7fd77f; }
.cal-cell.neg .cal-net, .cal-cell.neg .cal-u { color: #f08a8a; }
.cal-cell.sel { outline: 2px solid var(--blue); outline-offset: 1px; }
.cal-cell.today .cal-d { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal-d { font-size: 12px; color: var(--text-2); font-weight: 600; align-self: flex-start; }
.cal-net { font-size: 15px; font-weight: 650; margin-top: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-u { font-size: 12px; } .cal-n { font-size: 11px; color: var(--muted); }
#cal-stats { margin-bottom: 14px; }
table.cal-trades tfoot td { font-weight: 650; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .cal-nav { width: 100%; justify-content: space-between; }
  #cal-mode { width: 100%; display: flex; }
  #cal-mode button { flex: 1; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 58px; padding: 4px; border-radius: 7px; }
  .cal-net { font-size: 10.5px; }
  .cal-u, .cal-n { display: none; }
  .cal-dow { font-size: 10px; }
  .table-wrap:has(> table.cal-trades) { overflow-x: visible; }
  table.cal-trades thead { display: none; }
  table.cal-trades, table.cal-trades tbody, table.cal-trades tfoot { display: block; }
  table.cal-trades tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  table.cal-trades td { display: block; padding: 0; border: 0 !important; text-align: left; white-space: normal; }
  table.cal-trades td:first-child { grid-column: 1 / -1; font-weight: 600; }
  table.cal-trades td:empty { display: none; }
  table.cal-trades td[data-l]::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-bottom: 1px; }
}

.cal-short { display: none; }
.cal-cell.pos .cal-short { color: #7fd77f; } .cal-cell.neg .cal-short { color: #f08a8a; }
@media (max-width: 640px) { .cal-net { display: none; } .cal-short { display: block; font-size: 11px; font-weight: 650; margin-top: auto; } }

.pdf-opt { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13.5px; flex-wrap: wrap; }

tr.et-base td:first-child { font-weight: 650; }
tr.et-ad td { background: rgba(144, 133, 233, 0.07); }
#et-card .pt-head { flex-wrap: wrap; }
#et-view button { padding: 4px 10px; font-size: 12.5px; min-height: 30px; }
