/* Trading Team v2: calm, legible, dark by default (light via prefers-color-scheme). */
:root {
  --bg: #0d1117;
  --surface: #151b23;
  --surface-2: #1b222c;
  --surface-3: #232c38;
  --border: #2a3441;
  --border-soft: #212a35;
  --grid: #1c232d;
  --text: #e6ebf2;
  --muted: #95a1b2;
  --faint: #6b7686;
  --blue: #6ea8fe;
  --green: #3fca7f;
  --amber: #e9b44c;
  --red: #f0646c;
  --violet: #b08cff;
  --blue-bg: rgba(110, 168, 254, 0.12);
  --green-bg: rgba(63, 202, 127, 0.12);
  --amber-bg: rgba(233, 180, 76, 0.13);
  --red-bg: rgba(240, 100, 108, 0.13);
  --violet-bg: rgba(176, 140, 255, 0.13);
  --neutral-bg: rgba(149, 161, 178, 0.12);
  --focus: #9cc3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
  --topbar-h: 60px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fa; --surface: #ffffff; --surface-2: #f3f5f8; --surface-3: #e9edf2; --border: #d9dfe7; --border-soft: #e6eaf0;
    --grid: #eef1f5; --text: #17202b; --muted: #5a6676; --faint: #8592a3;
    --blue: #2f6fd6; --green: #18925a; --amber: #b07800; --red: #d33c45; --violet: #7a4fd6;
    --blue-bg: rgba(47, 111, 214, 0.1); --green-bg: rgba(24, 146, 90, 0.1); --amber-bg: rgba(176, 120, 0, 0.11);
    --red-bg: rgba(211, 60, 69, 0.1); --violet-bg: rgba(122, 79, 214, 0.1); --neutral-bg: rgba(90, 102, 118, 0.1);
    --focus: #2f6fd6; --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 18px rgba(16, 24, 40, 0.06);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, pre { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { background: var(--surface-3); padding: 0.1em 0.4em; border-radius: 5px; overflow-wrap: anywhere; }
b, strong { font-weight: 600; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
.num, table, .stat-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.cap { text-transform: capitalize; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.spacer { flex: 1 1 auto; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 10px; }

.icon { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }
.icon-sm { width: 0.95em; height: 0.95em; display: inline-block; vertical-align: -0.12em; }

/* ---------- top bar & nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border-soft);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.nav { flex: 1; min-width: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav-link .icon { width: 1.05em; height: 1.05em; }
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-3); }

.switch { display: inline-flex; align-items: center; gap: 9px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px 6px 7px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.switch:hover { color: var(--text); border-color: var(--faint); }
.switch-track { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.2s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] .switch-track { background: var(--blue); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(14px); background: #fff; }
.switch-label { font-size: 0.9rem; font-weight: 500; }

.tabbar { display: none; }

/* ---------- page ---------- */
main { flex: 1; outline: none; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 56px; }
.view { display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 380px; }
.page-title { font-size: 1.85rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title-name { font-size: 1.05rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.page-lead { color: var(--muted); margin-top: 6px; font-size: 1.02rem; max-width: 68ch; }
.eyebrow { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 6px; }
.lead-text { font-size: 1.02rem; line-height: 1.6; }
.crumbs { margin-bottom: -6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.back:hover { color: var(--text); }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 60px 0; justify-content: center; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 22px 20px 34px; color: var(--faint); font-size: 0.82rem; border-top: 1px solid var(--border-soft); display: grid; gap: 4px; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card-quiet { background: var(--surface-2); box-shadow: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head > div { min-width: 0; }
.card-title { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); font-size: 0.9rem; margin-top: 3px; }
.sub-h { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; margin-top: 4px; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.015em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.tone-border-red { border-color: color-mix(in srgb, var(--red) 55%, transparent) !important; }

/* ---------- explain mode ---------- */
.explain { display: none; gap: 10px; align-items: flex-start; background: var(--blue-bg); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); color: var(--text); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 0.9rem; line-height: 1.55; }
.explain-on .explain { display: flex; }
.explain-icon { color: var(--blue); margin-top: 2px; }
.explain p { min-width: 0; }

.term { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: help; text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-align: inherit; }
.term:hover, .term[aria-expanded="true"] { color: var(--blue); text-decoration-color: var(--blue); }
.term-pop { position: absolute; z-index: 80; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); font-size: 0.88rem; line-height: 1.5; text-transform: none; letter-spacing: 0; font-weight: 400; }
.term-pop strong { display: block; margin-bottom: 4px; font-size: 0.92rem; }
.term-pop[hidden] { display: none; }

/* ---------- badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: 0.01em; line-height: 1.45; text-transform: none; }
.tone-neutral { background: var(--neutral-bg); color: var(--muted); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-text-green { color: var(--green); } .tone-text-amber { color: var(--amber); } .tone-text-red { color: var(--red); } .tone-text-neutral { color: var(--muted); }
.tone-bg-green { background: var(--green); } .tone-bg-amber { background: var(--amber); } .tone-bg-red { background: var(--red); }
.tone-bg-blue { background: var(--blue); } .tone-bg-muted { background: var(--faint); }
.state-pill { font-size: 0.8rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.fresh { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.fresh.tone-ok .icon { color: var(--green); }
.fresh.tone-red { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.fresh.tone-amber { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; color: var(--text); }
.callout .icon { margin-top: 2px; }
.callout.tone-amber .icon { color: var(--amber); } .callout.tone-red .icon { color: var(--red); } .callout.tone-green .icon { color: var(--green); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 550; font-size: 0.92rem; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: var(--surface-3); border-color: var(--faint); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #0b1220; }
.btn-primary:hover { background: color-mix(in srgb, var(--blue) 86%, #fff); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn.copied { border-color: var(--green); color: var(--green); }
@media (prefers-color-scheme: light) { .btn-primary { color: #fff; } }

.input { font: inherit; font-size: 1rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-height: 42px; width: 100%; min-width: 0; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.select { width: auto; padding-right: 30px; }
.label { display: block; font-size: 0.84rem; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.field { display: flex; flex-direction: column; min-width: 0; flex: 1 1 120px; }
.field output { min-height: 42px; display: flex; align-items: center; font-weight: 600; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-error { color: var(--red); font-size: 0.9rem; min-height: 1.3em; }
.form-msg { color: var(--muted); font-size: 0.88rem; min-height: 0; }
.form-msg:empty { display: none; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: none; padding: 6px 13px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 550; font-size: 0.88rem; min-height: 34px; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.seg-lg .seg-btn { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 18px; min-width: 120px; }
.seg-lg .seg-btn small { color: var(--muted); font-weight: 400; }
.seg-lg .seg-btn[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--blue); }

/* ---------- login ---------- */
.login { display: grid; place-items: center; min-height: 60vh; }
.login-card { width: min(420px, 100%); gap: 12px; padding: 32px; }
.login-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

/* ---------- stat tiles ---------- */
.stat { min-width: 0; }
.stat-label { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.stat-value { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; overflow-wrap: anywhere; }
.stat-sub { color: var(--faint); font-size: 0.78rem; margin-top: 1px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 18px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.acct-strip { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 16px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 20px; }
.acct-strip .stat-value { font-size: 1.15rem; }
.acct-name { font-size: 1rem !important; font-weight: 600 !important; }

/* ---------- Today: action list ---------- */
.action-card { border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--border-soft)); background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 7%, var(--surface)) 0%, var(--surface) 70%); padding: 26px; }
.action-card .card-title { font-size: 1.35rem; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: s; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 14px 4px; border-top: 1px solid var(--border-soft); }
.step:first-child { border-top: 0; }
.step-num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.98rem; background: var(--surface-3); color: var(--text); }
.step-red .step-num { background: var(--red); color: #fff; }
.step-blue .step-num { background: var(--blue); color: #0b1220; }
.step-green .step-num { background: var(--green); color: #07140d; }
.step-amber .step-num { background: var(--amber); color: #1d1300; }
.step-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.step-title { font-size: 1.1rem; font-weight: 650; line-height: 1.4; letter-spacing: -0.005em; }
.step-sub { color: var(--muted); }
.step.is-done .step-num { background: var(--green); color: #07140d; }
.step.is-done .step-title { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.step-orders { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.step-orders li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 9px; padding: 8px 12px; }
.step-link { font-size: 0.9rem; width: fit-content; }

/* regime */
.regime-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.regime-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; padding: 6px 14px; border-radius: 999px; }
.regime-pill.sm { font-size: 0.8rem; padding: 3px 10px; font-weight: 600; }
.regime-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.regime-explain { font-size: 1rem; }
.spy-rows { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.spy-row { display: grid; grid-template-columns: 1fr auto 96px; gap: 12px; padding: 10px 14px; align-items: center; border-top: 1px solid var(--border-soft); }
.spy-row:first-child { border-top: 0; }
.rel { font-size: 0.8rem; font-weight: 600; text-align: right; }

/* risk */
.risk-band { display: flex; flex-direction: column; gap: 4px; }
.big-num { font-size: 1.5rem; margin-left: 4px; }
.band-text { color: var(--muted); font-size: 0.92rem; }
.ladder { padding: 26px 0 4px; }
.ladder-track { position: relative; height: 26px; border-radius: 7px; overflow: visible; background: var(--surface-3); }
.ladder-seg { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: rgba(0, 0, 0, 0.72); overflow: hidden; white-space: nowrap; }
.ladder-seg:first-child { border-radius: 7px 0 0 7px; }
.ladder-seg:last-of-type { border-radius: 0 7px 7px 0; }
.seg-halt { background: color-mix(in srgb, var(--red) 75%, var(--surface)); }
.seg-quarter { background: color-mix(in srgb, var(--amber) 55%, var(--red)); }
.seg-half { background: color-mix(in srgb, var(--amber) 85%, var(--surface)); }
.seg-full { background: color-mix(in srgb, var(--green) 85%, var(--surface)); }
.seg-coast { background: color-mix(in srgb, var(--blue) 80%, var(--surface)); }
.ladder-target { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }
.ladder-marker { position: absolute; top: -24px; bottom: -6px; width: 0; }
.ladder-marker::before { content: ""; position: absolute; left: -1.5px; top: 18px; bottom: 0; width: 3px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface); }
.ladder-marker span { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.75rem; font-weight: 700; background: var(--text); color: var(--bg); padding: 0 6px; border-radius: 5px; white-space: nowrap; }
.ladder-ticks { position: relative; height: 20px; margin-top: 6px; font-size: 0.72rem; color: var(--muted); }
.ladder-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ladder-ticks .tick-target { color: var(--text); font-weight: 600; }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.meter-label { font-size: 0.86rem; color: var(--muted); }
.meter-val { font-size: 0.86rem; font-weight: 600; }
.meter-track { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter-fill { height: 100%; border-radius: 99px; min-width: 2px; }
.meter-sub { font-size: 0.76rem; margin-top: 4px; }

/* tickets & positions */
.tickets { display: flex; flex-direction: column; gap: 16px; }
.ticket, .position { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ticket { border-left: 4px solid var(--blue); }
.ticket.is-placed { border-left-color: var(--green); }
.ticket.is-skipped { border-left-color: var(--faint); opacity: 0.85; }
.ticket.is-gapskip { border-left-color: var(--amber); }
.position { border-left: 4px solid var(--faint); }
.tone-edge-green { border-left-color: var(--green) !important; }
.tone-edge-red { border-left-color: var(--red) !important; }
.tone-edge-amber { border-left-color: var(--amber) !important; }
.tone-edge-blue { border-left-color: var(--blue) !important; }
.tone-edge-violet { border-left-color: var(--violet) !important; }
.position.is-done { opacity: 0.8; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ticket-title h3 { font-size: 1.4rem; font-weight: 750; letter-spacing: -0.01em; }
.ticker-link { color: var(--text); }
.ticket-why { font-size: 1rem; line-height: 1.6; }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.kv { min-width: 0; }
.kv dt { color: var(--muted); font-size: 0.8rem; }
.kv dd { margin: 2px 0 0; font-weight: 650; font-size: 1.02rem; overflow-wrap: anywhere; }
.kv dd small { display: block; font-weight: 400; color: var(--faint); font-size: 0.78rem; }
.exit-text { font-weight: 500; font-size: 0.9rem; line-height: 1.4; display: block; }
.expect { display: flex; gap: 6px; align-items: baseline; }
.r-now { font-size: 1.35rem; font-weight: 750; text-align: right; line-height: 1.1; }
.r-now small { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.ticket-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ai-note { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 11px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 0.93rem; }
.ai-head { display: flex; gap: 8px; align-items: center; }
.ai-tag { font-size: 0.78rem; font-weight: 600; color: var(--violet); text-transform: uppercase; letter-spacing: 0.06em; }

details.howto { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }
details.howto > summary { cursor: pointer; padding: 11px 14px; font-weight: 550; font-size: 0.93rem; list-style: none; display: flex; align-items: center; gap: 8px; border-radius: var(--radius-sm); }
details > summary::-webkit-details-marker { display: none; }
details .caret { transition: transform 0.15s; transform: rotate(-90deg); width: 0.95em; height: 0.95em; color: var(--muted); }
details[open] > summary .caret { transform: none; }
details.howto > *:not(summary) { margin: 0 14px 14px; }
.steps-small { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps-small li { padding-left: 4px; }
.steps-small.numbered > li > p { margin-bottom: 6px; }
.fill-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.fill-form .form-row { width: 100%; }

.not-taken { padding: 0; gap: 0; }
.not-taken > summary { padding: 18px 22px; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
.not-taken > *:not(summary) { margin: 0 22px 18px; }
.blocked-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.blocked-list li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.blocked-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }

.empty { display: flex; gap: 14px; align-items: flex-start; padding: 6px 2px; }
.empty-icon { color: var(--faint); width: 22px; height: 22px; margin-top: 1px; }
.empty-title { font-weight: 600; }
.empty-body { color: var(--muted); margin-top: 3px; max-width: 70ch; }
.empty > div > * + * { margin-top: 8px; }

/* ---------- Stocks ---------- */
.toolbar-card { padding: 14px 18px; gap: 10px; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toolbar-text { flex: 1 1 260px; }
.sort-label { display: flex; align-items: center; gap: 8px; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.stock-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; color: var(--text); box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; min-width: 0; }
.stock-card:hover { text-decoration: none; border-color: var(--border); transform: translateY(-1px); }
.stock-card.has-signal { border-color: color-mix(in srgb, var(--green) 50%, var(--border-soft)); }
.stock-card.is-empty { box-shadow: none; background: var(--surface-2); }
.sc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.sc-name { min-width: 0; display: flex; flex-direction: column; }
.sc-name h3 { font-size: 1.18rem; font-weight: 750; }
.sc-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.price { font-weight: 650; font-size: 1.05rem; }
.sc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bar { position: relative; height: 7px; background: var(--surface-3); border-radius: 99px; margin-top: 6px; }
.bar-fill { height: 100%; border-radius: 99px; }
.bar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--faint); opacity: 0.7; }
.sc-foot { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.sc-open { color: var(--blue); display: inline-flex; align-items: center; gap: 5px; }
.sc-summary { line-height: 1.45; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 999px; padding: 3px 4px 3px 12px; font-weight: 600; font-size: 0.9rem; }
.chip-x { border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.chip-x:hover { background: var(--red-bg); color: var(--red); }
.add-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.add-row .input { width: 160px; text-transform: uppercase; }

/* ---------- Stock detail ---------- */
.stock-head { align-items: flex-end; }
.stock-quote { text-align: right; }
.quote-price { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stock-status { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.chart-card { padding-bottom: 16px; }
.chart { height: 440px; width: 100%; min-width: 0; position: relative; border-radius: 8px; overflow: hidden; }
.chart-short { height: 320px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.82rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
.lg-50::before { background: var(--amber); } .lg-200::before { background: var(--violet); } .lg-5::before { background: var(--blue); height: 2px; }
.lg-entry::before { background: repeating-linear-gradient(90deg, var(--blue) 0 4px, transparent 4px 7px); }
.lg-stop::before { background: repeating-linear-gradient(90deg, var(--red) 0 4px, transparent 4px 7px); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ck { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ck-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ck-icon .icon { width: 15px; height: 15px; }
.ck-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ck-q { font-weight: 550; line-height: 1.45; }
.ck-q .badge { margin-left: 2px; vertical-align: 1px; }
.ck-d { font-size: 0.88rem; }
.ck-status { font-weight: 650; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--border-soft); vertical-align: top; }
.table thead th { border-top: 0; color: var(--muted); font-weight: 550; font-size: 0.8rem; background: var(--surface-2); white-space: nowrap; }
.table tbody th { font-weight: 600; }
.table .r { text-align: right; }
.target-bar { padding: 8px 6px 0; }
.tb-track { position: relative; height: 10px; background: var(--surface-3); border-radius: 99px; margin: 12px 0 8px; }
.tb-range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--blue) 45%, transparent); border-radius: 99px; }
.tb-mean { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--blue); border-radius: 2px; }
.tb-price { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--surface); }
.tb-labels { position: relative; height: 18px; font-size: 0.75rem; color: var(--muted); }
.tb-labels span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.tb-labels span:first-child { transform: none; }
.tb-labels span:last-child { transform: translateX(-100%); }
.tb-labels .tb-l-mean { color: var(--blue); top: -36px; font-weight: 600; transform: translateX(-50%) !important; }
.tb-note { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text); display: inline-block; }
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.news li { padding: 11px 0; border-top: 1px solid var(--border-soft); }
.news li:first-child { border-top: 0; padding-top: 0; }
.news-link { color: var(--text); font-weight: 550; line-height: 1.45; }
.news-link .icon { display: inline-block; margin-left: 5px; color: var(--muted); vertical-align: -0.1em; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.88rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.about { color: var(--muted); line-height: 1.6; font-size: 0.93rem; }

/* ---------- Backtest ---------- */
.headline-card { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 7%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--green) 30%, var(--border-soft)); }
.headline { font-size: 1.3rem; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; max-width: 60ch; }
.caveats { border-color: color-mix(in srgb, var(--amber) 45%, var(--border-soft)); background: color-mix(in srgb, var(--amber) 6%, var(--surface)); }
.caveats .card-title .icon { color: var(--amber); }
.caveats ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.defs h3 { font-size: 1rem; margin-bottom: 6px; }
.defs p { color: var(--muted); font-size: 0.92rem; }
.uni-desc { margin-top: -6px; }
.rules-table .grp { text-align: center; border-left: 1px solid var(--border-soft); }
.rules-table .oos { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.rules-table thead .oos { background: color-mix(in srgb, var(--blue) 9%, var(--surface-2)); }
.row-live { background: color-mix(in srgb, var(--blue) 6%, transparent); }
.live-tag { margin-left: 8px; }
.byyear { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.yr-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.yr-list li { display: grid; grid-template-columns: 44px 1fr 62px; gap: 10px; align-items: center; font-size: 0.85rem; }
.yr-bar { position: relative; height: 12px; background: var(--surface-2); border-radius: 3px; }
.yr-bar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--faint); }
.yr-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.yr-v { text-align: right; }

/* ---------- Learn ---------- */
.toc { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; padding: 14px 18px; }
.toc a { font-weight: 550; font-size: 0.92rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.flow li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; position: relative; }
.flow p { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.flow-n { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.timeline li:first-child { border-top: 0; }
.tl-time { font-weight: 700; font-size: 1.05rem; color: var(--blue); }
.timeline p { color: var(--muted); font-size: 0.92rem; }
.rule-card .facts { gap: 10px 16px; }
.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.glossary { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 0; margin: 0; }
.glossary dt, .glossary dd { padding: 11px 0; border-top: 1px solid var(--border-soft); margin: 0; }
.glossary dt { font-weight: 650; padding-right: 16px; }
.glossary dd { color: var(--muted); }
.glossary dt:first-of-type, .glossary dt:first-of-type + dd { border-top: 0; }

/* ---------- History ---------- */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hist-row { display: grid; grid-template-columns: 180px 110px minmax(0, 1fr) 20px; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px 18px; color: var(--text); }
.hist-row:hover { text-decoration: none; border-color: var(--border); }
.hist-date { display: flex; flex-direction: column; }
.hist-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-go { color: var(--muted); }

/* ---------- Connect ---------- */
.code { position: relative; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 8px; padding: 6px 6px 6px 14px; min-width: 0; }
.code pre { margin: 0; flex: 1; min-width: 0; padding: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.86rem; line-height: 1.55; }
.copy-btn { flex: none; min-height: 34px; padding: 5px 11px; font-size: 0.84rem; }
.tool-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tool-list li { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.tool-list li span { color: var(--muted); }
.tool-list code { width: fit-content; }
.questions { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-btn { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 13px; cursor: pointer; font-size: 0.92rem; }
.q-btn:hover { border-color: var(--border); }
.q-btn .icon { color: var(--muted); }
.cmds { display: flex; flex-direction: column; gap: 12px; }
.cmd-row { display: flex; flex-direction: column; gap: 4px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.92rem; animation: toast-in 0.2s ease-out; }
.toast.tone-green { border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.toast.tone-red { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.toast.tone-amber { border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .nav-link span { display: none; }
  .nav-link { padding: 9px 11px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .grid-2, .grid-wide-left, .byyear { grid-template-columns: minmax(0, 1fr); }
  .acct-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hist-what { grid-column: 1 / -1; }
  .hist-go { display: none; }
}
@media (max-width: 680px) {
  :root { --topbar-h: 54px; }
  body { font-size: 15px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .nav { display: none; }
  .topbar-inner { padding: 0 16px; justify-content: space-between; }
  .tabbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border-soft); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
  .tab-link { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; color: var(--muted); font-size: 0.68rem; font-weight: 550; }
  .tab-link .icon { width: 22px; height: 22px; }
  .tab-link:hover { text-decoration: none; }
  .tab-link[aria-current="page"] { color: var(--blue); }
  .page { padding: 20px 14px 40px; }
  .view { gap: 16px; }
  .page-title { font-size: 1.55rem; }
  .card { padding: 18px 16px; }
  .action-card { padding: 20px 16px; }
  .step { gap: 12px; padding: 12px 0; }
  .step-num { width: 30px; height: 30px; font-size: 0.9rem; }
  .step-title { font-size: 1.02rem; }
  .ticket, .position { padding: 16px; }
  .ticket-title h3 { font-size: 1.25rem; }
  .ticket-actions .btn { flex: 1 1 auto; }
  .ticket-actions .spacer { display: none; }
  .kv-grid { padding: 12px; gap: 12px 14px; }
  .meters { grid-template-columns: minmax(0, 1fr); }
  .stat-grid-3, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-strip { padding: 14px 16px; gap: 12px 14px; }
  .acct-strip > .stat:first-child { grid-column: 1 / -1; }
  .stock-grid { grid-template-columns: minmax(0, 1fr); }
  .chart { height: 340px; }
  .chart-short { height: 260px; }
  .stock-quote { text-align: left; }
  .quote-price { font-size: 1.7rem; }
  .spy-row { grid-template-columns: 1fr auto 80px; padding: 9px 12px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .glossary { grid-template-columns: minmax(0, 1fr); }
  .glossary dd { border-top: 0; padding-top: 0; }
  .seg-lg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .seg-lg .seg-btn { min-width: 0; padding: 9px 10px; }
  .headline { font-size: 1.12rem; }
  .ladder-seg span { display: none; }
  .switch { padding: 5px 10px 5px 6px; }
  .not-taken > summary { padding: 16px; }
  .not-taken > *:not(summary) { margin: 0 16px 16px; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .yr-list li { grid-template-columns: 40px 1fr 56px; }
}
@media (max-width: 380px) {
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- order ticket: the four questions ---------- */
.q { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-head h4 { margin: 0; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
.q-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--blue-bg); color: var(--blue); flex: none; }
.q-ok .q-num { background: var(--green-bg); color: var(--green); }
.q-big { font-size: 1.08rem; line-height: 1.5; }
.kv-big { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.01em; }
.q-how .kv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.calc-row { display: grid; grid-template-columns: minmax(120px, 1fr) repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.calc-val { font-weight: 700; font-size: 1.08rem; }
.record { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 0.92rem; }
.record .icon { color: var(--blue); }
.facts-tight { gap: 6px 16px; font-size: 0.93rem; }
.ok-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ok-list li { display: flex; gap: 10px; align-items: flex-start; }
.ok-list p { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.ok-tick { width: 22px; height: 22px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; flex: none; margin-top: 1px; }
.ok-tick .icon { width: 13px; height: 13px; }

/* ---------- watch: what would make the bot buy ---------- */
.watch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.watch-rule { background: var(--surface-2); border-radius: var(--radius-sm); border-left: 4px solid var(--faint); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.watch-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.watch-price { font-weight: 700; font-size: 1.05rem; }
.needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.needs li { display: flex; gap: 9px; align-items: flex-start; font-size: 0.92rem; }
.needs li.unmet { color: var(--muted); }
.need-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.need-icon .icon { width: 12px; height: 12px; }
.watch-mini { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.84rem; }
.watch-mini li { display: grid; grid-template-columns: 74px 1fr auto auto; gap: 8px; align-items: baseline; }
.wm-rule { font-weight: 600; }
.wm-rule.momentum { color: var(--blue); } .wm-rule.dipbuy { color: var(--violet); }
.wm-met { font-size: 0.78rem; }
.sc-watch { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.lg-mtrig::before { background: repeating-linear-gradient(90deg, var(--green) 0 4px, transparent 4px 7px); }
.lg-dtrig::before { background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 7px); }
.closest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.closest-row { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text); }
.closest-row:hover { text-decoration: none; background: var(--surface-3); }
.closest-name, .closest-num { display: flex; flex-direction: column; min-width: 0; }
.loading.small { padding: 10px 0; justify-content: flex-start; }
@media (max-width: 860px) {
  .watch, .ok-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .q-how .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-how .kv-grid .kv:first-child { grid-column: 1 / -1; }
  .calc-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-row .field:first-child { grid-column: 1 / -1; }
  .closest-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
}
.ladder-target span { position: absolute; bottom: calc(100% + 4px); right: -6px; font-size: 0.72rem; font-weight: 650; color: var(--text); white-space: nowrap; }
.step-orders li { display: block; line-height: 1.5; }
.step-orders li .badge { margin-left: 6px; }
.m-cards { display: none; }
.m-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.m-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.m-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.m-table th, .m-table td { padding: 5px 4px; text-align: left; border-top: 1px solid var(--border-soft); font-weight: 400; }
.m-table thead th { border-top: 0; color: var(--muted); font-size: 0.78rem; }
.m-table tbody th { color: var(--muted); }
.m-table .r { text-align: right; }
.m-table td.oos { font-weight: 650; }
.m-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.m-stats > div { display: flex; flex-direction: column; }
@media (max-width: 680px) {
  .m-cards { display: flex; flex-direction: column; gap: 10px; }
  .m-cards ~ .table-wrap, .table-wrap:has(+ .m-cards) { display: none; }
}

/* Connect page: connected Claude apps, one compact row each */
.oauth-apps ul { list-style: none; padding: 0; margin: 0; }
.oauth-apps li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border, rgba(127,127,127,.2)); }
.oauth-apps li:first-child { border-top: 0; }
.oauth-apps li > span { flex: 1 1 220px; }
.oauth-apps li > button { flex: 0 0 auto; width: auto; }

/* Today: switch between trading accounts */
.acct-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.acct-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; min-width: 0;
  border-radius: 10px; border: 1px solid var(--border, rgba(127,127,127,.25)); background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.acct-tab:hover { border-color: var(--text-3, rgba(127,127,127,.6)); }
.acct-tab.on { border-color: var(--accent, #4c8dff); box-shadow: inset 0 0 0 1px var(--accent, #4c8dff); }
.acct-tab:focus-visible { outline: 2px solid var(--accent, #4c8dff); outline-offset: 2px; }
.acct-tab-name { font-weight: 600; }
.acct-tab-sub { font-size: .85em; opacity: .75; font-variant-numeric: tabular-nums; }

/* Lab profile */
.lab-pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; background: rgba(124, 92, 255, .16); color: #7c5cff; vertical-align: middle; }
.lab-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.lab-box .lab-pill { margin-left: 0; flex: none; }
.lab-box p { margin: .25rem 0 0; }
.profile-list { display: grid; gap: 14px; }
.profile-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.profile-row > div:first-child { min-width: 0; }
.profile-row p { margin: 2px 0 0; }

/* live quotes */
.live-tag { margin-left: auto; font-size: .85em; opacity: .8; font-variant-numeric: tabular-nums; }
.live-line { margin: .2rem 0 .6rem; font-variant-numeric: tabular-nums; }
.live-line:empty { display: none; }

/* ---------- pattern alerts ---------- */
.patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.pattern { background: var(--surface); border: 1px solid var(--border-soft); border-left: 4px solid var(--violet); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pattern-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pattern-top .badges { margin-left: auto; gap: 6px; }
.pattern-img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); background: #0f1419; }
.pattern-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.pattern-levels dt { color: var(--muted); font-size: 0.78rem; }
.pattern-levels dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .pattern { padding: 14px; }
  .pattern-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-top .badges { margin-left: 0; }
}
