/* PipNorth — design tokens, layout, components. Dark and light themes; five accents. */
:root {
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --border: #e3e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --pos: #059669;
  --pos-bg: #d1fae5;
  --neg: #dc2626;
  --neg-bg: #fee2e2;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.04);
  --grid: rgba(100,116,139,.15);
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --panel: #111a2c;
  --panel-2: #0e1626;
  --border: #1e2a40;
  --text: #e6ebf5;
  --muted: #8b98b0;
  --faint: #5d6a82;
  --pos: #22c55e;
  --pos-bg: rgba(34,197,94,.14);
  --neg: #f43f5e;
  --neg-bg: rgba(244,63,94,.14);
  --warn: #f59e0b;
  --warn-bg: rgba(245,158,11,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --grid: rgba(139,152,176,.12);
}
:root[data-accent="blue"]    { --accent: #3b82f6; --accent-2: #2563eb; }
:root[data-accent="emerald"] { --accent: #10b981; --accent-2: #059669; }
:root[data-accent="violet"]  { --accent: #8b5cf6; --accent-2: #7c3aed; }
:root[data-accent="amber"]   { --accent: #f59e0b; --accent-2: #d97706; }
:root[data-accent="rose"]    { --accent: #f43f5e; --accent-2: #e11d48; }
:root[data-accent="cyan"]    { --accent: #06b6d4; --accent-2: #0891b2; }
:root { --accent-bg: color-mix(in srgb, var(--accent) 14%, transparent); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
svg { width: 18px; height: 18px; flex: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn-text { color: var(--warn); }
.hidden, [hidden] { display: none !important; }
.pad { padding: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--panel); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
.sidebar nav a:hover { background: var(--panel-2); color: var(--text); }
.sidebar nav a.active { background: var(--accent-bg); color: var(--accent); }
.sidebar nav a .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.engine-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); }
.engine-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.engine-pill.ok i { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-bg); }
.engine-pill.bad i { background: var(--neg); box-shadow: 0 0 0 3px var(--neg-bg); }
.engine-pill.warn i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.page-title { font-size: 18px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.only-mobile, .only-mobile-flex { display: none !important; }
.sidebar-scrim { display: none; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-buy { background: var(--pos); border-color: var(--pos); color: #fff; }
.btn-sell { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--neg); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; list-style: none; }
.icon-btn:hover { color: var(--text); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; min-height: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 2px; width: 46px; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin: 0; padding: 6px 2px; cursor: pointer; font-weight: 400; }
.field { margin-bottom: 14px; }
.field-hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg a, .seg button { padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.seg a.active, .seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* dropdowns */
.dropdown { position: relative; }
.dropdown > summary { cursor: pointer; }
.dropdown .chev { width: 14px; height: 14px; opacity: .6; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 8px; z-index: 50; }
.dropdown-menu > a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.dropdown-menu > a:hover { background: var(--panel-2); }
.dropdown-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 4px 4px; font-weight: 600; }
.dropdown-actions { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; display: flex; justify-content: flex-end; }
.acc-filter summary span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.scope-seg a.scope-live.active { color: var(--pos); }
.scope-seg a.scope-sample.active { color: #8b5cf6; }
.sample-banner { display: flex; align-items: center; gap: 10px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-badge { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--neg); }
.notif-menu { width: 360px; padding: 0; }
.notif-menu .dropdown-head { padding: 12px 14px 8px; text-transform: none; font-size: 13px; color: var(--text); letter-spacing: 0; }
.notif-list { max-height: 380px; overflow: auto; border-top: 1px solid var(--border); }
.notif { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--panel-2); }
.notif.unread { border-left: 3px solid var(--accent); }
.notif b { display: block; font-weight: 500; font-size: 13px; }
.notif span { font-size: 12px; color: var(--muted); }
.notif-push { padding: 10px 14px; font-size: 12px; }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; font-style: normal; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip-buy, .chip-pos { background: var(--pos-bg); color: var(--pos); border-color: transparent; }
.chip-sell, .chip-neg { background: var(--neg-bg); color: var(--neg); border-color: transparent; }
.chip-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip-accent { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

/* alerts & toasts */
.alert { margin: 16px 24px 0; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13px; }
.content .alert { margin: 0; }
.alert-success { background: var(--pos-bg); border-color: transparent; color: var(--pos); }
.alert-error { background: var(--neg-bg); border-color: transparent; color: var(--neg); }
.alert-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.alert-info { background: var(--accent-bg); border-color: transparent; color: var(--accent); }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 11px 14px; border-radius: var(--radius-sm); max-width: 360px; font-size: 13px; animation: toastIn .2s ease; }
.toast.error { border-left-color: var(--neg); }
.toast.success { border-left-color: var(--pos); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- cards */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 8px 0 0; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 180px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 22px; font-weight: 600; font-family: var(--mono); letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat.hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.stat.hero .k, .stat.hero .s { color: rgba(255,255,255,.8); }
.meter { height: 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.pos i { background: var(--pos); }
.meter.neg i { background: var(--neg); }
.meter.warn i { background: var(--warn); }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; }
.tbl th.num { text-align: right; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 16px; align-items: center; }

/* filters bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 130px; }
.filters .field.wide { min-width: 200px; }

/* ---------------------------------------------------------------- opportunities */
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.opp { display: flex; flex-direction: column; }
.opp.highlight { outline: 2px solid var(--accent); }
.opp-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.opp-sym { font-size: 17px; font-weight: 700; }
.opp-dir { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.opp-dir.buy { background: var(--pos-bg); color: var(--pos); }
.opp-dir.sell { background: var(--neg-bg); color: var(--neg); }
.opp-score { margin-left: auto; text-align: right; }
.score-ring { --p: 50; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--panel-2) 0); display: grid; place-items: center; }
.score-ring b { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 13px; font-family: var(--mono); }
.opp-chart { height: 200px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.opp-levels { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.opp-levels div { padding: 9px 12px; border-right: 1px solid var(--border); }
.opp-levels div:last-child { border-right: 0; }
.opp-levels small { display: block; color: var(--muted); font-size: 11px; }
.opp-levels b { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.opp-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ai-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.ai-box .ai-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.ai-box .ai-head svg { width: 14px; height: 14px; color: var(--accent); }
.ai-box ul { margin: 6px 0 0; padding-left: 18px; }
.ai-box li { margin: 2px 0; }
.verdict-take { color: var(--pos); }
.verdict-caution { color: var(--warn); }
.verdict-avoid { color: var(--neg); }
.opp-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.opp-actions .btn { flex: 1; }
.opp-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.opp.done { opacity: .7; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; width: min(520px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-card.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.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-family: var(--mono); }
.violation { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 6px; }
.violation.block { background: var(--neg-bg); color: var(--neg); }
.violation.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(110px, .9fr); gap: 6px; }
.cal-h { font-size: 12px; color: var(--muted); font-weight: 500; text-align: center; padding: 4px 0; }
.cal-d { min-height: 92px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--panel); padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.cal-d.out { opacity: .35; }
.cal-d.today { outline: 2px solid var(--accent); }
.cal-d .dn { color: var(--muted); font-weight: 500; }
.cal-d .pnl { font-family: var(--mono); font-weight: 600; font-size: 14px; margin-top: auto; }
.cal-d.win { background: var(--pos-bg); border-color: transparent; }
.cal-d.win .pnl { color: var(--pos); }
.cal-d.loss { background: var(--neg-bg); border-color: transparent; }
.cal-d.loss .pnl { color: var(--neg); }
.cal-w { border-radius: var(--radius-sm); background: var(--panel-2); border: 1px dashed var(--border); padding: 7px 9px; font-size: 12px; display: flex; flex-direction: column; justify-content: center; }
.cal-w .pnl { font-family: var(--mono); font-weight: 600; font-size: 14px; }

/* heat cells */
.heat { display: grid; grid-template-columns: 60px repeat(24, minmax(18px, 1fr)); gap: 2px; font-size: 10px; }
.heat div { height: 22px; border-radius: 3px; display: grid; place-items: center; color: var(--muted); }

/* journal detail */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/10; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb form { position: absolute; top: 6px; right: 6px; }
.thumb .btn { height: 26px; padding: 0 7px; background: rgba(0,0,0,.6); color: #fff; border: 0; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-bg); }
.stars { display: inline-flex; gap: 2px; }
.stars label { margin: 0; cursor: pointer; font-size: 20px; color: var(--faint); }
.stars input { display: none; }
.stars label.on { color: #f59e0b; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 95; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; }

/* widgets */
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.w { grid-column: span 6; }
.w-12 { grid-column: span 12; }
.w-8 { grid-column: span 8; }
.w-4 { grid-column: span 4; }
.w-6 { grid-column: span 6; }
.w.dragging { opacity: .4; }
.w .w-handle { cursor: grab; color: var(--faint); display: none; }
.editing .w .w-handle { display: inline-flex; }
.editing .w { outline: 2px dashed var(--border); outline-offset: 4px; }
.widget-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.impact { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.impact.High { background: var(--neg); }
.impact.Medium { background: var(--warn); }
.impact.Low { background: var(--faint); }
.impact.Holiday { background: var(--accent); }
.ticker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tick { padding: 12px 14px; }
.tick .sym { font-weight: 600; }
.tick .px { font-family: var(--mono); font-size: 17px; }
.bias-bar { display: flex; gap: 4px; }
.bias-bar span { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.b-up { background: var(--pos-bg); color: var(--pos); }
.b-down { background: var(--neg-bg); color: var(--neg); }
.b-flat { background: var(--panel-2); color: var(--muted); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-bg), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); padding: 28px; }
.auth-card .brand { padding: 0 0 18px; justify-content: center; }
.code { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 12px; word-break: break-all; }
pre.code { padding: 12px; white-space: pre-wrap; display: block; }
.log { font-family: var(--mono); font-size: 12px; max-height: 420px; overflow: auto; }
.log div { padding: 3px 14px; border-bottom: 1px solid var(--border); white-space: pre-wrap; }
.log .error { color: var(--neg); }
.log .warn { color: var(--warn); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-4 { grid-column: span 6; }
  .w-8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-grid !important; }
  .only-mobile-flex { display: flex !important; }
  .scope-seg { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .sidebar-scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .content { padding: 16px 16px 90px; }
  .alert { margin: 12px 16px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .w, .w-4, .w-6, .w-8, .w-12 { grid-column: span 12; }
  .opp-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 18px; }
  .page-title { font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar { gap: 8px; }
  .topbar-actions { gap: 6px; margin-left: 0; }
  #themeBtn { display: none; }
  .row-between { flex-wrap: wrap; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg a, .seg button { white-space: nowrap; }
  .main { overflow-x: hidden; }
  .acc-filter summary span { max-width: 90px; }
  .acc-filter summary > svg:first-child { display: none; }
  .bottom-nav { display: flex !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--border); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); padding: 4px 8px; position: relative; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav .badge { position: absolute; top: -2px; right: 0; min-width: 16px; height: 16px; font-size: 10px; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal-w { display: none; }
  .cal-d { min-height: 58px; padding: 4px 5px; }
  .cal-d .pnl { font-size: 11px; }
  .cal-d .cnt { display: none; }
  .notif-menu { width: calc(100vw - 32px); right: -60px; }
  .opp-levels { grid-template-columns: repeat(2, 1fr); }
  .opp-levels div:nth-child(2) { border-right: 0; }
  .opp-levels div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .toast-wrap { left: 16px; right: 16px; bottom: 80px; }
}
