    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg: #0d1117;
      --surface: #161b22;
      --surface2: #1f2937;
      --border: #30363d;
      --text: #e6edf3;
      --muted: #8b949e;
      --green: #3fb950;
      --yellow: #d29922;
      --red: #f85149;
      --blue: #58a6ff;
      --btn: #238636;
      --btn-hover: #2ea043;
      --btn-stop: #6e3535;
      --btn-stop-hover: #8a3a3a;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      font-size: 13px;
      line-height: 1.5;
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    header {
      padding: 12px 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
    header h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
    header .sub { color: var(--muted); font-size: 12px; }
    header .auth-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
    header .auth-user { font-size: 12px; color: var(--muted); }
    header .btn-auth {
      font-size: 12px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
      border: 1px solid var(--border); background: var(--surface2); color: var(--text);
    }
    header .btn-auth:hover { background: var(--border); }
    header .btn-logout { background: transparent; border-color: transparent; color: var(--muted); }
    header .btn-logout:hover { color: var(--red); background: transparent; }

    /* ── Auth Modal ── */
    .auth-overlay {
      display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
      z-index: 1000; align-items: center; justify-content: center;
    }
    .auth-overlay.open { display: flex; }
    .auth-box {
      background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
      padding: 28px 32px; width: 340px; max-width: 95vw;
    }
    .auth-box h2 { font-size: 15px; margin-bottom: 18px; }
    .auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
    .auth-tab {
      padding: 6px 16px; cursor: pointer; font-size: 13px; color: var(--muted);
      border-bottom: 2px solid transparent; margin-bottom: -1px;
    }
    .auth-tab.active { color: var(--text); border-bottom-color: var(--blue); }
    .auth-field { margin-bottom: 14px; }
    .auth-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
    .auth-field input {
      width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 13px;
    }
    .auth-field input:focus { outline: none; border-color: var(--blue); }
    .auth-submit {
      width: 100%; padding: 9px; background: var(--btn); color: #fff; border: none;
      border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px;
    }
    .auth-submit:hover { background: var(--btn-hover); }
    .auth-error { font-size: 12px; color: var(--red); margin-top: 10px; min-height: 16px; }
    .auth-pane { display: none; }
    .auth-pane.active { display: block; }

    .layout {
      display: grid;
      grid-template-columns: 1fr; /* sidebar removed — scan setup lives inside the Scanner tab */
      flex: 1;
      overflow: hidden;
    }

    /* ── Scan setup card (replaces the old left sidebar) ── */
    .scan-setup {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 10px; margin-bottom: 14px; overflow: hidden;
    }
    .scan-setup-bar {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px;
    }
    .scan-chevron {
      background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
      color: var(--muted); font-size: 13px; padding: 5px 9px; cursor: pointer; flex-shrink: 0;
    }
    .scan-chevron:hover { color: var(--text); border-color: var(--blue); }
    .scan-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; cursor: pointer; min-width: 0; }
    .chip {
      font-size: 11px; color: var(--muted); background: var(--surface2);
      border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
    }
    .scan-setup:not(.collapsed) .scan-chips .chip { border-color: var(--blue); color: var(--text); }
    .scan-setup-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
    .scan-setup-actions input[type="text"] {
      width: 110px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 6px; color: var(--text); font-size: 12px; text-transform: uppercase;
    }
    .scan-setup-body {
      display: grid; grid-template-columns: minmax(420px, 1.1fr) 1fr; gap: 24px;
      padding: 4px 16px 14px; border-top: 1px solid var(--border);
      max-height: 480px; overflow-y: auto;
    }
    .scan-setup.collapsed .scan-setup-body { display: none; }
    .setup-col { min-width: 0; }
    /* Filters lay out as a 2-col grid of fields so nothing clips */
    .setup-col:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; align-content: start; }
    .setup-col:first-child > .section-label { grid-column: 1 / -1; }
    .setup-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

    /* ── Top picks band ── */
    .top-picks {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
      gap: 10px; margin-bottom: 14px;
    }
    .pick-card {
      background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
      padding: 12px 14px; cursor: pointer; transition: border-color 0.15s;
    }
    .pick-card:hover { border-color: var(--blue); }
    .pick-head { display: flex; justify-content: space-between; align-items: baseline; }
    .pick-ticker { font-size: 16px; font-weight: 700; }
    .pick-edge { display: flex; align-items: baseline; gap: 5px; }
    .pick-edge-label { font-size: 9px; color: var(--muted); letter-spacing: 0.5px; }
    .pick-edge strong { font-size: 16px; }
    .pick-sub { font-size: 11px; color: var(--muted); margin: 2px 0 8px; }
    .meter {
      display: block; height: 6px; border-radius: 3px;
      background: rgba(88, 166, 255, 0.16); overflow: hidden; margin-bottom: 10px;
    }
    .meter-fill { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
    .pick-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 600; }
    .pick-stats em {
      display: block; font-style: normal; font-size: 9px; font-weight: 500;
      color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px;
    }

    /* ── In-table micro-visuals ── */
    .edge-cell { display: flex; align-items: center; gap: 7px; }
    .cellbar {
      display: inline-block; width: 44px; height: 5px; border-radius: 3px;
      background: rgba(88, 166, 255, 0.16); overflow: hidden; flex-shrink: 0;
    }
    .cellbar-fill { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
    .strike-cell { display: inline-block; }
    .cushion {
      display: block; width: 54px; height: 4px; border-radius: 2px; margin-top: 3px;
      background: var(--surface2); overflow: hidden;
    }
    .cushion-fill { display: block; height: 100%; border-radius: 2px; background: var(--green); }
    .cushion-fill.neg { background: var(--red); }

    /* ── Sidebar ── */
    .sidebar {
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }
    .sidebar-body { padding: 16px; }

    .section-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--muted);
      margin-bottom: 10px;
    }

    .field { margin-bottom: 10px; }
    .field-label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
      font-size: 12px;
      color: var(--muted);
    }
    .field-label .val { color: var(--blue); font-family: ui-monospace, monospace; font-size: 11px; }

    input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      padding: 6px 9px;
      font-size: 12px;
      font-family: inherit;
      outline: none;
    }
    input:focus, select:focus, textarea:focus { border-color: var(--blue); }
    input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
    textarea { resize: vertical; min-height: 72px; font-family: ui-monospace, monospace; font-size: 11px; }

    .check-row {
      display: flex; align-items: center; gap: 7px;
      font-size: 12px; color: var(--muted); cursor: pointer; margin-bottom: 8px;
    }
    .check-row input { width: auto; accent-color: var(--blue); cursor: pointer; }

    .radio-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
    .radio-row { display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
    .radio-row input { width: auto; accent-color: var(--blue); cursor: pointer; }
    .inline-row { display: flex; gap: 8px; align-items: center; }
    .inline-row .grow { flex: 1; }

    #customTickersWrap { margin-top: 2px; }
    #customTickersWrap textarea {
      width: 100%; min-height: 44px; resize: vertical;
      background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
      color: var(--text); font-size: 12px; padding: 7px 10px;
      font-family: ui-monospace, monospace;
    }
    hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

    .btn-scan {
      padding: 8px 22px; border: none; border-radius: 6px;
      font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
      background: var(--btn); color: #fff;
    }
    .btn-scan:hover:not(:disabled) { background: var(--btn-hover); }
    .btn-scan:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
    .btn-scan.stop { background: var(--btn-stop); }
    .btn-scan.stop:hover { background: var(--btn-stop-hover); }

    /* ── Tabs ── */
    .tabs {
      display: flex;
      border-bottom: 1px solid var(--border);
      padding: 0 16px;
      flex-shrink: 0;
      background: var(--bg);
    }
    .tab-btn {
      padding: 10px 14px; font-size: 13px; font-weight: 500;
      cursor: pointer; border: none; background: none; color: var(--muted);
      border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s;
    }
    .tab-btn:hover { color: var(--text); }
    .tab-btn.active { color: var(--text); border-bottom-color: var(--blue); }
    .tab-badge {
      display: inline-block; background: var(--surface2); color: var(--muted);
      font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; margin-left: 5px;
    }
    .tab-btn.active .tab-badge { background: var(--blue); color: #fff; }

    /* ── Sub-tabs (panes within a tab group) ── */
    .subtabs {
      display: flex; gap: 6px; padding: 8px 16px 0;
      flex-shrink: 0; background: var(--bg);
    }
    .subtab-btn {
      padding: 4px 12px; font-size: 12px; font-weight: 500;
      cursor: pointer; color: var(--muted);
      background: var(--surface2); border: 1px solid var(--border); border-radius: 999px;
      transition: color 0.15s, background 0.15s;
    }
    .subtab-btn:hover { color: var(--text); }
    .subtab-btn.active { color: #fff; background: var(--blue); border-color: var(--blue); }
    .subtab-btn.active .tab-badge { background: rgba(255,255,255,0.25); color: #fff; }

    /* ── Dashboard strip ── */
    .dash-strip {
      display: flex; gap: 10px; padding: 10px 16px;
      border-bottom: 1px solid var(--border); background: var(--bg);
      flex-shrink: 0; overflow-x: auto;
    }
    .dash-cell {
      display: flex; flex-direction: column; gap: 2px; min-width: 108px;
      padding: 6px 12px; background: var(--surface); border: 1px solid var(--border);
      border-radius: 8px; white-space: nowrap;
    }
    .dash-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
    .dash-val { font-size: 15px; font-weight: 700; color: var(--text); }
    .dash-val.g { color: var(--green); }
    .dash-val.r { color: var(--red); }
    .dash-clickable { cursor: pointer; }
    .dash-clickable:hover { border-color: var(--blue); }

    /* ── Wheel campaign stage chips ── */
    .stage-chip {
      display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
      padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border);
    }
    .stage-put     { color: var(--blue);  border-color: var(--blue);  background: rgba(88,166,255,0.08); }
    .stage-shares  { color: var(--yellow, #d29922); border-color: var(--yellow, #d29922); background: rgba(210,153,34,0.08); }
    .stage-covered { color: var(--green); border-color: var(--green); background: rgba(63,185,80,0.08); }

    /* ── Roll candidate suggestions (put + CC roll modals) ── */
    .roll-suggest { margin: 4px 0 10px; max-height: 220px; overflow-y: auto; }
    .roll-suggest-head { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
    .roll-suggest-loading { font-size: 11px; color: var(--muted); padding: 6px 0; }
    .roll-cand {
      display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
      padding: 6px 10px; margin-bottom: 4px; cursor: pointer;
      background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
      color: var(--text); font-size: 12px;
    }
    .roll-cand:hover { border-color: var(--blue); }
    .roll-cand-main { font-weight: 600; }
    .roll-cand-sub { font-size: 11px; color: var(--muted); }
    .roll-net { font-size: 12px; margin: 10px 0 2px; min-height: 16px; }

    /* ── Scanner column density: hide secondary metrics until expanded ── */
    #tableWrap.cols-essential th.col-x,
    #tableWrap.cols-essential td.col-x { display: none; }

    /* ── Main pane ── */
    .main { display: flex; flex-direction: column; overflow: hidden; }
    .main-body { padding: 16px; flex: 1; overflow-y: auto; }

    /* ── Learn tab ── */
    #tab-learn { padding: 0; }
    .learn-shell { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
    .learn-nav {
      border-right: 1px solid var(--border);
      padding: 20px 12px; overflow-y: auto;
      background: var(--surface);
    }
    .learn-nav-title {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.08em; color: var(--muted); padding: 0 10px; margin-bottom: 10px;
    }
    .learn-nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 9px 12px; border-radius: 6px; cursor: pointer;
      font-size: 13px; color: var(--muted); margin-bottom: 2px;
      transition: background 0.12s, color 0.12s;
    }
    .learn-nav-item:hover { background: var(--surface2); color: var(--text); }
    .learn-nav-item.active { background: var(--surface2); color: var(--text); font-weight: 600; }
    .learn-nav-item .emoji { font-size: 16px; width: 20px; text-align: center; }
    .learn-content { overflow-y: auto; padding: 32px 48px; }
    .learn-pane { display: none; max-width: 940px; }
    .learn-pane.active { display: block; }
    .learn-pane h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
    .learn-pane .lead { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
    .learn-pane h3 {
      font-size: 18px; font-weight: 700; margin-top: 32px; margin-bottom: 12px;
      padding-top: 14px; border-top: 1px solid var(--border);
    }
    .learn-pane h3:first-of-type { padding-top: 0; border-top: none; margin-top: 0; }
    .learn-pane p { font-size: 15px; line-height: 1.7; margin-bottom: 14px; }
    .learn-pane ul, .learn-pane ol { font-size: 15px; line-height: 1.8; padding-left: 22px; margin-bottom: 16px; }
    .learn-pane li { margin-bottom: 6px; }
    .learn-pane strong { color: var(--text); }
    .learn-card {
      background: var(--surface2); border-radius: 10px; padding: 18px 22px; margin: 14px 0;
      font-size: 14px; line-height: 1.7;
    }
    .learn-card-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
    .learn-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
    .learn-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 16px 0; }
    .learn-step {
      display: flex; gap: 18px; padding: 18px 22px; background: var(--surface2);
      border-radius: 10px; margin-bottom: 12px;
    }
    .learn-step-num {
      flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
      background: var(--blue); color: #fff; font-weight: 700; font-size: 16px;
      display: flex; align-items: center; justify-content: center;
    }
    .learn-step-body { flex: 1; }
    .learn-step-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
    .learn-step-desc { font-size: 14px; line-height: 1.6; color: var(--muted); }
    .learn-step-desc strong { color: var(--text); }
    .learn-key { font-family: monospace; background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--green); }
    .learn-good {
      background: #14251a; border: 1px solid #2a4a2a; border-radius: 10px; padding: 16px 20px;
    }
    .learn-bad {
      background: #25171a; border: 1px solid #4a2a2a; border-radius: 10px; padding: 16px 20px;
    }
    .learn-good .learn-card-title { color: var(--green); }
    .learn-bad .learn-card-title { color: var(--red); }
    .learn-good ul, .learn-bad ul { margin: 0; font-size: 13px; line-height: 2; color: var(--muted); }
    .learn-pill {
      display: inline-block; padding: 3px 10px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 999px; font-size: 11px; color: var(--muted); margin-right: 6px;
    }
    .cheat-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
      background: var(--surface2); border-radius: 10px; padding: 20px 22px; margin: 16px 0;
    }
    .cheat-item { font-size: 12px; }
    .cheat-item .cheat-label { color: var(--muted); display: block; margin-bottom: 2px; }
    .cheat-item .cheat-val { font-weight: 700; font-size: 14px; color: var(--text); }
    @media (max-width: 900px) {
      .learn-shell { grid-template-columns: 1fr; }
      .learn-nav { border-right: none; border-bottom: 1px solid var(--border); }
      .learn-content { padding: 20px; }
      .learn-grid-2, .learn-grid-3, .cheat-grid { grid-template-columns: 1fr; }
    }
    /* ── Simulator ── */
    .sim-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 14px; }
    .sim-chain-row { cursor: pointer; transition: background 0.1s; }
    .sim-chain-row:hover { background: rgba(255,255,255,0.05); }
    .sim-chain-row.selected { background: rgba(63,185,80,0.12); outline: 1px solid var(--green); }
    .sim-level-pip { display:inline-block; width:20px; height:20px; border-radius:50%; background:var(--border); font-size:11px; font-weight:700; text-align:center; line-height:20px; margin:0 3px; }
    .sim-level-pip.done { background:var(--green); color:#000; }
    .sim-level-pip.active { background:var(--btn); color:#fff; }
    .sim-outcome-win { border-left:3px solid var(--green); padding:12px 14px; background:rgba(63,185,80,0.06); border-radius:0 8px 8px 0; }
    .sim-outcome-assign { border-left:3px solid var(--yellow); padding:12px 14px; background:rgba(210,153,34,0.06); border-radius:0 8px 8px 0; }
    .sim-outcome-loss { border-left:3px solid var(--red); padding:12px 14px; background:rgba(248,81,73,0.06); border-radius:0 8px 8px 0; }
    /* ── Admin tab ── */
    /* ── Bots tab ── */
    .bot-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; }
    .bot-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
    .bot-card-name { font-size: 17px; font-weight: 700; flex: 1; }
    .bot-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .bot-status-dot.active  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
    .bot-status-dot.paused  { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,.5); }
    .bot-status-dot.stopped { background: #6b7280; }
    .bot-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
    .bot-kpi { background: var(--surface2); border-radius: 8px; padding: 10px 14px; }
    .bot-kpi-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
    .bot-kpi-val { font-size: 18px; font-weight: 700; }
    .bot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .bot-scan-progress { margin: 12px 0 4px; }
    .bot-scan-bar-track { height: 4px; background: rgba(96,165,250,.15); border-radius: 2px; overflow: hidden; }
    .bot-scan-bar-fill { height: 100%; width: 0%; background: #60a5fa; border-radius: 2px; transition: width .4s ease; }
    .bot-scan-bar-fill.running { animation: scan-fill 50s linear forwards; }
    .bot-scan-bar-fill.done { width: 100% !important; animation: none; background: #22c55e; transition: width .3s ease, background .3s ease; }
    .bot-scan-label { font-size: 11px; color: var(--muted); margin-top: 5px; }
    @keyframes scan-fill { from { width: 0% } to { width: 92% } }
    .bot-events { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; max-height: 220px; overflow-y: auto; }
    .bot-event-row { font-size: 12px; display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--surface2); }
    .bot-event-time { color: var(--muted); flex-shrink: 0; width: 135px; }
    .bot-event-type { font-weight: 600; flex-shrink: 0; width: 110px; }
    .bot-event-detail { color: var(--muted); }
    .bot-event-type.trade_opened { color: #22c55e; }
    .bot-event-type.trade_closed { color: #60a5fa; }
    .bot-event-type.halted       { color: #ef4444; }
    .bot-event-type.scan_run       { color: var(--muted); }
    .bot-event-type.scan_triggered { color: #a78bfa; }
    /* bot modal */
    .bot-modal { width: min(860px, 92vw) !important; max-width: min(860px, 92vw) !important; max-height: 90vh; overflow-y: auto; padding: 28px 32px; }
    .bot-modal h3 { font-size: 20px; margin-bottom: 2px; }
    .bot-modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
    .bot-mode-pill { font-size: 11px; background: rgba(96,165,250,.15); color: #60a5fa; border-radius: 10px; padding: 2px 8px; font-weight: 600; }
    /* template pills */
    .bot-templates { display: flex; gap: 8px; margin-bottom: 22px; }
    .bot-tpl-btn { flex: 1; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; transition: all .15s; line-height: 1.3; }
    .bot-tpl-btn:hover { border-color: var(--accent); background: var(--surface); }
    .bot-tpl-btn small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; }
    .bot-tpl-btn.tpl-conservative { border-color: #22c55e55; }
    .bot-tpl-btn.tpl-balanced     { border-color: #60a5fa55; }
    .bot-tpl-btn.tpl-aggressive   { border-color: #f9731655; }
    .bot-tpl-btn.tpl-active { background: var(--surface); border-color: var(--accent) !important; }
    #botUserTemplates { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
    .bot-user-tpl-btn { display:flex; align-items:center; gap:6px; padding:5px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:12px; font-weight:600; cursor:pointer; }
    .bot-user-tpl-btn:hover { border-color:var(--accent); }
    .bot-user-tpl-del { color:var(--muted); background:none; border:none; cursor:pointer; font-size:13px; line-height:1; padding:0; }
    .bot-user-tpl-del:hover { color:var(--red); }
    /* sections */
    .bot-section { margin: 20px 0 12px; display: flex; align-items: center; gap: 10px; }
    .bot-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
    .bot-section-line { flex: 1; height: 1px; background: var(--border); }
    .bot-form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 20px; }
    .bot-form-grid.two-col { grid-template-columns: 1fr 1fr; }
    .bot-form-grid.one-col { grid-template-columns: 1fr; }
    .bot-form-group { display: flex; flex-direction: column; gap: 5px; }
    .bot-form-group label { font-size: 12px; color: var(--text); font-weight: 500; }
    .bot-form-group .bot-hint { font-size: 11px; color: var(--muted); line-height: 1.3; }
    .bot-form-group input, .bot-form-group select { background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; color: var(--text); font-size: 15px; width: 100%; box-sizing: border-box; }
    .bot-form-group input:focus, .bot-form-group select:focus { outline: none; border-color: var(--accent); }
    .admin-shell { padding: 28px 36px; max-width: 1200px; }
    .admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
    .admin-title { font-size: 22px; font-weight: 700; }
    .admin-loading { color: var(--muted); padding: 40px 0; text-align: center; }
    .admin-stat-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 32px;
    }
    .admin-stat {
      background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
      padding: 16px 18px;
    }
    .admin-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
    .admin-stat-val { font-size: 26px; font-weight: 700; }
    .admin-stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
    .admin-stat.green .admin-stat-val { color: var(--green); }
    .admin-stat.red   .admin-stat-val { color: var(--red); }
    .admin-section-title {
      font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
      color: var(--muted); margin: 28px 0 12px;
    }
    .admin-ticker-row {
      display: flex; align-items: center; gap: 10px; padding: 7px 0;
      border-bottom: 1px solid var(--border);
    }
    .admin-ticker-row:last-child { border-bottom: none; }
    .admin-ticker-name { font-weight: 700; width: 60px; }
    .admin-ticker-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
    .admin-ticker-fill { height: 100%; background: var(--blue); border-radius: 999px; }
    .admin-ticker-count { font-size: 12px; color: var(--muted); width: 40px; text-align: right; }
    /* user table */
    .admin-user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .admin-user-table th {
      text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase;
      letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--border);
    }
    .admin-user-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
    .admin-user-table tr:last-child td { border-bottom: none; }
    .admin-user-table tr:hover td { background: var(--surface2); }
    .admin-pnl-pos { color: var(--green); font-weight: 600; }
    .admin-pnl-neg { color: var(--red);   font-weight: 600; }
    .admin-badge {
      display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
    }
    .admin-badge-active { background: rgba(34,197,94,.15); color: #22c55e; }
    .admin-badge-idle   { background: var(--surface2); color: var(--muted); }
    @media (max-width: 768px) {
      .admin-shell { padding: 16px; }
      .admin-user-table th:nth-child(n+5),
      .admin-user-table td:nth-child(n+5) { display: none; }
    }

    .page-tools {
      display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px;
    }
    .guide-btn {
      background: none; border: 1px solid var(--border); border-radius: 999px;
      color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600;
      padding: 6px 12px;
    }
    .guide-btn:hover { color: var(--text); border-color: var(--blue); }
    .quick-scan {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
      padding: 12px; margin-bottom: 14px;
    }
    .quick-scan-title { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
    .quick-scan-sub { font-size: 11px; color: var(--muted); }
    .quick-scan-controls { display: flex; align-items: center; gap: 8px; min-width: 360px; }
    .quick-scan-controls input { width: 120px; text-transform: uppercase; }
    .quick-scan-status { min-width: 130px; font-size: 11px; color: var(--muted); text-align: right; }
    .quick-scan-status.g { color: var(--green); }
    .quick-scan-status.r { color: var(--red); }
    .watch-empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
    @media (max-width: 900px) {
      .quick-scan { align-items: stretch; flex-direction: column; }
      .quick-scan-controls { min-width: 0; flex-wrap: wrap; }
      .quick-scan-status { min-width: 0; text-align: left; }
      .watch-empty-actions { flex-wrap: wrap; }
    }

    /* ── Progress ── */
    #progressWrap { margin-bottom: 16px; }
    .progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
    .progress-track { background: var(--surface2); border-radius: 3px; height: 4px; overflow: hidden; }
    .progress-fill { background: var(--blue); height: 100%; border-radius: 3px; transition: width 0.2s ease; }

    /* ── Alert bars ── */
    .alert-warn {
      background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.25);
      border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; color: var(--red);
    }
    .alert-info {
      background: rgba(88,166,255,0.08); border: 1px solid rgba(88,166,255,0.25);
      border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; color: var(--blue);
    }
    .source-preview {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 14px;
    }
    .source-preview h4 {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .source-preview-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 8px;
    }
    .source-chip {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px 10px;
      background: var(--bg);
    }
    .source-chip strong {
      display: block;
      font-size: 12px;
      margin-bottom: 3px;
    }
    .source-chip span {
      display: block;
      color: var(--muted);
      font-size: 11px;
    }
    /* ── Ticker Basket ── */
    .basket-sources { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
    .source-tile { }
    .source-tile label {
      display: flex; align-items: center; gap: 8px; cursor: pointer;
      padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
      background: var(--bg); transition: border-color 0.12s;
    }
    .source-tile label:hover { border-color: var(--blue); }
    .source-tile input[type="checkbox"] { width: auto; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
    .source-tile-body { flex: 1; min-width: 0; }
    .source-tile-body strong { display: block; font-size: 12px; white-space: nowrap; }
    .source-tile-body span { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .src-count { font-size: 10px; color: var(--blue); font-family: ui-monospace, monospace; flex-shrink: 0; min-width: 28px; text-align: right; }
    .src-count.loading { color: var(--muted); }
    .src-count.err { color: var(--red); }
    .source-tile-section { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 8px 0 4px; }
    .basket-bar {
      background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
      padding: 8px 10px; margin-bottom: 8px;
    }
    .basket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
    .basket-header strong { font-size: 11px; }
    .basket-count-val { color: var(--blue); font-weight: 700; }
    .basket-ticker-chips { display: flex; flex-wrap: wrap; gap: 3px; max-height: 60px; overflow: hidden; font-size: 10px; font-family: ui-monospace, monospace; }
    .basket-ticker-chip { background: var(--surface2); border-radius: 3px; padding: 2px 5px; }
    .basket-empty-hint { color: var(--muted); font-size: 10px; }
    .ape-filter-row { margin: 4px 0 6px 26px; display: none; }
    .watchlist-meta {
      font-size: 11px;
      color: var(--muted);
      margin-top: 6px;
    }
    .watchlist-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin-top: 12px;
    }
    .watchlist-panel {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      padding: 12px;
      min-height: 280px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .watchlist-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      overflow-y: auto;
      max-height: 320px;
    }
    .watchlist-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      background: var(--surface);
    }
    .watchlist-row strong {
      font-size: 12px;
    }
    .watchlist-row span {
      font-size: 11px;
      color: var(--muted);
    }
    .scanner-action-cell {
      display: flex;
      justify-content: flex-end;
      gap: 6px;
    }
    .finder-btn {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }
    .finder-btn:hover {
      color: var(--text);
      border-color: var(--blue);
    }
    .strike-finder-shell {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .strike-finder-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    .strike-finder-summary {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 10px;
    }
    .strike-finder-empty {
      border: 1px dashed var(--border);
      border-radius: 8px;
      padding: 18px 14px;
      text-align: center;
      color: var(--muted);
      font-size: 12px;
    }
    .strike-finder-table tbody tr {
      cursor: pointer;
    }
    .strike-finder-help {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.45;
    }
    .detail-shell {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .detail-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .detail-tab {
      background: none;
      border: 1px solid var(--border);
      border-radius: 999px;
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
      font-weight: 600;
      padding: 6px 12px;
    }
    .detail-tab.active {
      color: var(--text);
      border-color: var(--blue);
      background: rgba(88,166,255,0.12);
    }
    .detail-panel {
      display: none;
    }
    .detail-panel.active {
      display: block;
    }

    /* ── Buzz tab ── */
    .buzz-loading {
      display: flex; align-items: center; justify-content: center;
      gap: 12px; padding: 48px 0; color: var(--muted); font-size: 13px;
    }
    @keyframes buzz-spin { to { transform: rotate(360deg); } }
    .buzz-spinner {
      width: 18px; height: 18px; border-radius: 50%;
      border: 2px solid var(--border); border-top-color: var(--blue);
      animation: buzz-spin 0.7s linear infinite;
    }
    .buzz-error { color: var(--red); font-size: 13px; padding: 24px 0; text-align: center; }

    .buzz-section { margin-bottom: 22px; }
    .buzz-section-title {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px;
    }

    /* sentiment gauge */
    .buzz-gauge-card {
      background: var(--surface2); border-radius: 10px; padding: 16px 18px; margin-bottom: 22px;
    }
    .buzz-gauge-header {
      display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px;
    }
    .buzz-gauge-label { font-size: 14px; font-weight: 700; }
    .buzz-gauge-counts { font-size: 12px; color: var(--muted); }
    .buzz-gauge-bar {
      height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-bottom: 8px;
    }
    .buzz-gauge-fill {
      height: 100%; border-radius: 999px;
      background: linear-gradient(90deg, #3fb950 0%, #3fb950 var(--bull-pct, 50%), #f85149 var(--bull-pct, 50%), #f85149 100%);
      transition: background 0.4s;
    }
    .buzz-gauge-legs {
      display: flex; justify-content: space-between; font-size: 11px;
    }
    .buzz-gauge-bull { color: var(--green); font-weight: 600; }
    .buzz-gauge-bear { color: var(--red);  font-weight: 600; }
    .buzz-gauge-neutral { color: var(--muted); font-size: 11px; font-style: italic; }

    /* message cards */
    .buzz-msg {
      border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
      margin-bottom: 8px; font-size: 13px; line-height: 1.55;
      background: var(--bg);
    }
    .buzz-msg-header {
      display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap;
    }
    .buzz-msg-user { font-weight: 700; font-size: 12px; color: var(--text); }
    .buzz-msg-time { font-size: 11px; color: var(--muted); }
    .buzz-msg-badge {
      font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
      letter-spacing: 0.04em;
    }
    .buzz-badge-bull { background: rgba(63,185,80,0.15);  color: var(--green); }
    .buzz-badge-bear { background: rgba(248,81,73,0.12);  color: var(--red); }
    .buzz-msg-body { color: var(--text); word-break: break-word; }
    .buzz-msg-likes { font-size: 11px; color: var(--muted); margin-top: 6px; }
    .buzz-show-more {
      background: none; border: 1px solid var(--border); border-radius: 6px;
      color: var(--muted); font-size: 12px; cursor: pointer; padding: 6px 14px;
      width: 100%; margin-top: 4px;
    }
    .buzz-show-more:hover { color: var(--text); border-color: var(--blue); }

    /* news */
    .buzz-news-item {
      display: flex; gap: 12px; padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    .buzz-news-item:last-child { border-bottom: none; }
    .buzz-news-thumb {
      width: 56px; height: 40px; border-radius: 5px; object-fit: cover;
      flex-shrink: 0; background: var(--surface2);
    }
    .buzz-news-body { flex: 1; min-width: 0; }
    .buzz-news-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
    .buzz-news-title {
      font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text);
      overflow-wrap: break-word;
    }
    .buzz-news-title a { color: inherit; text-decoration: none; }
    .buzz-news-title a:hover { color: var(--blue); }

    /* filings */
    .buzz-filing-row {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 0; border-bottom: 1px solid var(--border);
      text-decoration: none; color: var(--text);
    }
    .buzz-filing-row:last-child { border-bottom: none; }
    .buzz-filing-row:hover .buzz-filing-title { color: var(--blue); }
    .buzz-filing-form {
      font-size: 10px; font-weight: 700; color: var(--muted);
      background: var(--surface2); border: 1px solid var(--border);
      border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0;
    }
    .buzz-filing-title { flex: 1; font-size: 13px; }
    .buzz-filing-date  { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

    /* insider trades */
    .buzz-insiders { display: flex; flex-direction: column; gap: 8px; }
    .buzz-insider-row {
      display: flex; justify-content: space-between; align-items: flex-start;
      gap: 10px; padding: 10px 12px; border-radius: 8px;
      background: var(--surface2); border: 1px solid var(--border);
      text-decoration: none; color: var(--text);
    }
    .buzz-insider-row:hover { border-color: var(--blue); }
    .buzz-insider-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .buzz-insider-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .buzz-insider-title { font-size: 11px; color: var(--muted); }
    .buzz-insider-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
    .buzz-insider-badge {
      font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    }
    .buzz-insider-buy    { background: rgba(34,197,94,0.15);  color: #22c55e; }
    .buzz-insider-sell   { background: rgba(239,68,68,0.15);  color: #ef4444; }
    .buzz-insider-neutral { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
    .buzz-insider-detail { font-size: 11px; color: var(--text); }
    .buzz-insider-date   { font-size: 10px; color: var(--muted); }
    .buzz-source-error   { font-size: 12px; color: var(--muted); padding: 6px 0; }
    .buzz-source-errors  { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }

    /* social panel */
    .social-reddit-card  { display: flex; align-items: center; gap: 24px; padding: 14px 16px; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; flex-wrap: wrap; }
    .social-reddit-main  { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
    .social-big-num      { font-size: 36px; font-weight: 800; line-height: 1; }
    .social-big-label    { font-size: 11px; color: var(--muted); margin-top: 2px; }
    .social-reddit-stats { display: flex; gap: 24px; }
    .social-stat         { display: flex; flex-direction: column; }
    .social-stat-val     { font-size: 20px; font-weight: 700; }
    .social-stat-label   { font-size: 11px; color: var(--muted); }
    .social-options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
    .social-options-col  { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
    .social-options-col .social-stat-val   { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
    .social-options-col .social-stat-label { font-size: 10px; color: var(--muted); margin-bottom: 4px; }
    @media (max-width: 768px) {
      .social-options-grid { grid-template-columns: repeat(2, 1fr); }
      .social-reddit-stats { gap: 16px; }
    }

    /* watch entry plan */
    .watch-plan-modal { max-width: 520px; }
    .watch-plan-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
    .watch-plan-field { margin-bottom: 10px; }
    .watch-plan-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
    .watch-plan-field textarea {
      width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
      color: var(--text); padding: 8px 10px; font-size: 14px; font-family: inherit; resize: vertical;
    }
    /* readiness cell */
    .watch-plan-cell {
      text-align: left;
      display: flex; flex-direction: column; gap: 4px; cursor: pointer;
      padding: 6px 8px; border-radius: 8px; border: 1px solid transparent;
      transition: border-color 0.15s, background 0.15s; min-width: 160px;
    }
    .watch-plan-cell:hover { border-color: var(--border); background: var(--surface2); }
    .watch-plan-cell-top  { display: flex; align-items: center; gap: 6px; }
    .watch-readiness-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .watch-readiness-dot.ready  { background: #22c55e; box-shadow: 0 0 5px rgba(34,197,94,.5); }
    .watch-readiness-dot.almost { background: #eab308; box-shadow: 0 0 5px rgba(234,179,8,.5); }
    .watch-readiness-dot.wait   { background: #ef4444; box-shadow: 0 0 5px rgba(239,68,68,.5); }
    .watch-readiness-label { font-size: 12px; font-weight: 700; }
    .watch-readiness-label.ready  { color: #22c55e; }
    .watch-readiness-label.almost { color: #eab308; }
    .watch-readiness-label.wait   { color: #ef4444; }
    .watch-plan-hint {
      font-size: 11px; color: var(--muted); line-height: 1.35;
      display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .watch-plan-hint em { font-style: normal; color: var(--text); }
    /* plan modal body */
    .plan-verdict { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
    .plan-section { margin-bottom: 14px; }
    .plan-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
    .plan-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--border); line-height: 1.4; }
    .plan-item:last-child { border-bottom: none; }
    .plan-item-icon { flex-shrink: 0; margin-top: 1px; font-size: 14px; }

    .detail-metrics {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 10px;
    }
    .detail-metric {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      padding: 10px 12px;
    }
    .detail-metric strong {
      display: block;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .detail-metric span {
      font-size: 16px;
      font-weight: 700;
    }
    .detail-payoff-shell {
      background: linear-gradient(180deg, #07081f 0%, #07081a 100%);
      border: 1px solid rgba(128, 144, 255, 0.14);
      border-radius: 12px;
      padding: 14px 14px 16px;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    }
    .detail-payoff-metrics {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 8px;
      align-items: end;
    }
    .detail-payoff-metric {
      min-width: 0;
    }
    .detail-payoff-metric strong {
      display: block;
      color: rgba(245,247,255,0.9);
      font-size: 9px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      margin-bottom: 2px;
    }
    .detail-payoff-metric span {
      display: block;
      font-size: 20px;
      font-weight: 800;
      letter-spacing: -0.03em;
      color: #f5f7ff;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .detail-payoff-metric small {
      display: block;
      color: rgba(198, 205, 221, 0.76);
      font-size: 11px;
      margin-top: 3px;
    }
    .detail-payoff-metric .g { color: #21d06b; }
    .detail-payoff-metric .r { color: #ff5164; }
    .detail-payoff-metric .b { color: #66c6ff; }
    .detail-payoff-legend {
      display: flex;
      gap: 16px;
      align-items: center;
      flex-wrap: wrap;
      color: rgba(232, 236, 248, 0.9);
      font-size: 11px;
      margin: 6px 0 8px;
    }
    .detail-payoff-legend span {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .detail-payoff-legend i {
      display: inline-block;
      width: 18px;
      height: 4px;
      border-radius: 999px;
    }
    .detail-payoff-chart-wrap {
      height: 330px;
      position: relative;
    }
    .detail-payoff-footer {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .detail-payoff-date {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      color: rgba(244, 247, 255, 0.95);
      font-size: 12px;
      font-weight: 700;
    }
    .detail-payoff-date small {
      color: rgba(202, 208, 223, 0.82);
      font-size: 11px;
      font-weight: 600;
    }
    .detail-payoff-cursor-readout {
      position: absolute;
      top: 8px;
      right: 14px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 2px;
      pointer-events: none;
      color: #f5f7ff;
      text-shadow: 0 1px 2px rgba(0,0,0,0.45);
      z-index: 2;
    }
    .detail-payoff-cursor-readout strong {
      font-size: 13px;
      font-weight: 800;
      letter-spacing: -0.02em;
    }
    .detail-payoff-cursor-readout span {
      font-size: 11px;
      color: rgba(226, 231, 245, 0.88);
    }
    .detail-payoff-controls {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px 16px;
      align-items: end;
    }
    .detail-payoff-control strong {
      display: block;
      color: rgba(244, 247, 255, 0.95);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      margin-bottom: 6px;
    }
    .detail-payoff-control-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-bottom: 8px;
      color: rgba(215, 221, 236, 0.86);
      font-size: 11px;
    }
    .detail-payoff-control input[type="range"] {
      width: 100%;
      accent-color: #2fa8ff;
      cursor: pointer;
    }
    .detail-payoff-axis-note {
      color: rgba(192, 199, 216, 0.78);
      font-size: 10px;
      margin-top: 4px;
    }
    .detail-stock-shell {
      background: linear-gradient(180deg, #16181d 0%, #1e1f24 100%);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 12px;
      padding: 12px;
    }
    .detail-stock-meta {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 10px;
      color: rgba(232,236,248,0.9);
      font-size: 11px;
    }
    .detail-stock-chart-wrap {
      height: 360px;
      border-radius: 10px;
      overflow: hidden;
      background:
        linear-gradient(90deg, rgba(255,255,255,0.02) 0, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 100%),
        linear-gradient(180deg, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 100%),
        linear-gradient(180deg, #262328 0%, #222326 100%);
      background-size: 44px 100%, 100% 62px, 100% 100%;
      position: relative;
    }
    .detail-stock-chart-wrap svg {
      width: 100%;
      height: 100%;
      display: block;
    }
    .detail-stock-empty {
      height: 100%;
      display: grid;
      place-items: center;
      color: var(--muted);
      font-size: 12px;
    }
    @media (max-width: 1100px) {
      .detail-payoff-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
      .detail-payoff-controls {
        grid-template-columns: 1fr;
      }
    }
    @media (max-width: 720px) {
      .detail-payoff-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .detail-payoff-chart-wrap {
        height: 270px;
      }
      .detail-stock-chart-wrap {
        height: 290px;
      }
      .strike-finder-grid {
        grid-template-columns: 1fr 1fr;
      }
    }
    .detail-grid {
      display: grid;
      grid-template-columns: 1.4fr 1fr;
      gap: 14px;
    }
    .detail-card {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      padding: 12px;
    }
    .detail-card h4 {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 8px;
    }
    #detailTitle {
      font-size: 12px;
      letter-spacing: -0.01em;
    }
    #detailDesc {
      font-size: 10px;
    }
    .detail-scroll {
      max-height: 76vh;
      overflow-y: auto;
      padding-right: 4px;
    }
    .detail-stat-list {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 12px;
    }
    .detail-stat-list div strong {
      display: block;
      font-size: 10px;
      color: var(--muted);
      text-transform: uppercase;
      margin-bottom: 2px;
    }
    .detail-stat-list div span {
      font-size: 13px;
    }
    .edge-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 8px;
      margin-bottom: 10px;
    }
    .edge-card {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .edge-card strong {
      display: block;
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
    }
    .edge-card .edge-val {
      font-size: 18px;
      font-weight: 700;
      line-height: 1.1;
    }
    .edge-card .edge-insight {
      font-size: 10px;
      color: var(--muted);
      line-height: 1.4;
      margin-top: 2px;
    }
    .edge-card .edge-insight em { color: var(--text); font-style: normal; }
    .plan-section {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      padding: 12px;
    }
    .plan-section h4 {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .plan-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
    }
    .plan-copy {
      display: grid;
      gap: 10px;
    }
    .plan-copy .guide-item {
      margin: 0;
    }
    /* ── Trade Plan ── */
    .tp-levels {
      display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
    }
    .tp-level {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 7px; padding: 8px 12px; min-width: 100px;
    }
    .tp-level .tp-lbl { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
    .tp-level .tp-val { font-size: 14px; font-weight: 700; }
    /* theta progress bar */
    .tp-progress { margin-bottom: 16px; }
    .tp-progress-bar-wrap { position: relative; height: 10px; background: rgba(255,255,255,0.07); border-radius: 99px; margin: 8px 0 4px; overflow: visible; }
    .tp-progress-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4ade80, #facc15); transition: width 0.3s; }
    .tp-progress-marker { position: absolute; top: -3px; width: 2px; height: 16px; background: rgba(255,255,255,0.3); }
    .tp-progress-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); }
    .tp-decision { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; margin-top: 10px; font-size: 12px; font-weight: 600; }
    .tp-decision.hold   { background: rgba(74,222,128,0.08);  border: 1px solid rgba(74,222,128,0.25); }
    .tp-decision.watch  { background: rgba(250,204,21,0.08);  border: 1px solid rgba(250,204,21,0.25); }
    .tp-decision.close  { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.35); }
    .tp-decision .tp-dec-icon { font-size: 18px; }
    .tp-decision .tp-dec-sub  { font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 2px; }
    /* theta clock table */
    .tp-decay table { width: 100%; font-size: 12px; border-collapse: collapse; }
    .tp-decay th { font-size: 10px; color: var(--muted); font-weight: 500; padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--border); }
    .tp-decay th:first-child { text-align: left; }
    .tp-decay td { padding: 5px 8px; text-align: right; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .tp-decay td:first-child { text-align: left; font-weight: 600; }
    .tp-decay tr.tp-target td { background: rgba(74,222,128,0.07); }
    .tp-decay tr.tp-stop   td { background: rgba(248,113,113,0.07); }
    /* risk timeline */
    .tp-risk-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
    .tp-risk-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
    .tp-risk-card h5 { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
    .tp-risk-card .tp-rc-row { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
    .tp-risk-card .tp-rc-lbl { color: var(--muted); }
    /* ── Position action badges ─────────────────────────── */
    .action-stop    { background: rgba(248,113,113,0.18); color: #f87171; border: 1px solid rgba(248,113,113,0.45); border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
    .action-profit  { background: rgba(74,222,128,0.15);  color: #4ade80; border: 1px solid rgba(74,222,128,0.40); border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
    .action-letride { background: rgba(74,222,128,0.10);  color: #86efac; border: 1px solid rgba(74,222,128,0.25); border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
    .action-watch   { background: rgba(250,204,21,0.12);  color: #facc15; border: 1px solid rgba(250,204,21,0.35); border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
    .action-hold    { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border);    border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
    .capture-bar-wrap { display:flex; align-items:center; gap:5px; }
    .capture-bar { flex:1; height:5px; background:rgba(255,255,255,0.07); border-radius:99px; min-width:40px; }
    /* Positions tab — section headers between manual/bot */
    .pos-section-header td { background:var(--surface2); padding:8px 12px !important; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--muted); border-top:1px solid var(--border); border-bottom:1px solid var(--border); cursor:default; }
    .pos-section-header.manual td { color:#60a5fa; }
    .pos-section-header.bot    td { color:#a78bfa; }
    .pos-section-header .pos-section-count { color:var(--text); margin-left:6px; }
    .pos-section-header .pos-section-pnl { float:right; font-weight:700; }
    .capture-bar-fill { height:100%; border-radius:99px; background: linear-gradient(90deg,#4ade80,#facc15); }
    /* ── Manage tab ─────────────────────────────────────── */
    .mgmt-banner { display:flex; align-items:flex-start; gap:14px; padding:14px 16px; border-radius:10px; margin-bottom:14px; overflow:hidden; }
    .mgmt-banner.action-stop    { background:rgba(248,113,113,0.08); border:1px solid rgba(248,113,113,0.35); }
    .mgmt-banner.action-profit  { background:rgba(74,222,128,0.07);  border:1px solid rgba(74,222,128,0.30); }
    .mgmt-banner.action-letride { background:rgba(74,222,128,0.05);  border:1px solid rgba(74,222,128,0.20); }
    .mgmt-banner.action-watch   { background:rgba(250,204,21,0.07);  border:1px solid rgba(250,204,21,0.30); }
    .mgmt-banner.action-hold    { background:rgba(255,255,255,0.03); border:1px solid var(--border); }
    .mgmt-banner-icon { font-size:26px; line-height:1; flex-shrink:0; margin-top:2px; }
    .mgmt-banner-body { flex:1; min-width:0; }
    .mgmt-banner-body h3 { margin:0 0 4px; font-size:15px; font-weight:700; overflow-wrap:break-word; word-break:break-word; }
    .mgmt-banner-body p  { margin:0; font-size:12px; color:var(--muted); line-height:1.5; overflow-wrap:break-word; word-break:break-word; }
    .mgmt-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
    .mgmt-rules { list-style:none; margin:0; padding:0; }
    .mgmt-rules li { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid rgba(255,255,255,0.05); font-size:12px; }
    .mgmt-rules li:last-child { border-bottom:none; }
    .mgmt-rules .rule-lbl { color:var(--muted); font-size:10px; display:block; margin-bottom:2px; }
    .mgmt-rules .rule-val { font-weight:600; }
    .mgmt-rule-status { font-size:10px; font-weight:700; padding:2px 7px; border-radius:4px; flex-shrink:0; margin-left:10px; }
    .mgmt-rule-status.hit   { background:rgba(74,222,128,0.15); color:#4ade80; }
    .mgmt-rule-status.stop  { background:rgba(248,113,113,0.15); color:#f87171; }
    .mgmt-rule-status.clear { background:rgba(255,255,255,0.06); color:var(--muted); }
    .mgmt-levels { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; }
    .mgmt-level  { background:var(--surface); border:1px solid var(--border); border-radius:7px; padding:9px 11px; }
    .mgmt-level .ml-lbl { font-size:9px; text-transform:uppercase; color:var(--muted); margin-bottom:3px; letter-spacing:.04em; }
    .mgmt-level .ml-val { font-size:14px; font-weight:700; }
    .mgmt-level .ml-sub { font-size:10px; color:var(--muted); margin-top:2px; }
    .mgmt-health-bar { height:12px; background:rgba(255,255,255,0.07); border-radius:99px; position:relative; margin:8px 0 4px; overflow:hidden; }
    .mgmt-health-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#4ade80,#facc15); }
    .mgmt-health-marker { position:absolute; top:0; width:2px; height:100%; background:rgba(255,255,255,0.25); }
    .wheel-cc-bar { height:5px; background:rgba(255,255,255,0.07); border-radius:99px; margin:5px 0 2px; overflow:hidden; }
    .wheel-cc-bar-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#4ade80,#facc15); transition:width 0.3s; }
    /* stress table */
    .tp-stress table { width: 100%; font-size: 11px; border-collapse: collapse; }
    .tp-stress th { font-size: 10px; color: var(--muted); font-weight: 500; padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--border); }
    .tp-stress th:first-child, .tp-stress th:nth-child(2) { text-align: left; }
    .tp-stress td { padding: 5px 6px; text-align: right; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .tp-stress td:first-child, .tp-stress td:nth-child(2) { text-align: left; }
    .alert-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px; margin-bottom: 14px;
    }
    .alert-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 8px; padding: 12px;
    }
    .alert-card h4 {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--muted); margin-bottom: 8px;
    }
    .alert-card .alert-count { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
    .alert-card p { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
    .alert-card button {
      background: none; border: 1px solid var(--border); border-radius: 6px;
      color: var(--text); cursor: pointer; font-size: 11px; padding: 5px 9px;
    }
    .alert-card button:hover { border-color: var(--blue); }
    .alert-card.tp { border-color: rgba(63,185,80,0.25); }
    .alert-card.sl { border-color: rgba(248,81,73,0.25); }
    .alert-card.dte { border-color: rgba(210,153,34,0.25); }
    .alert-card.exp { border-color: rgba(88,166,255,0.25); }
    .alert-card.miss { border-color: rgba(139,148,158,0.35); }

    /* ── Stat cards ── */
    .stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
    .stat {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 8px; padding: 9px 16px; min-width: 98px; flex: 0 1 auto;
    }
    .stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
    .stat-val { font-size: 18px; font-weight: 600; margin-top: 2px; }

    /* ── Empty state ── */
    .empty-state { text-align: center; padding: 60px 0; color: var(--muted); }
    .empty-state p { font-size: 14px; }
    .empty-state small { font-size: 12px; margin-top: 6px; display: block; }

    /* ── Table ── */
    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 12px; }
    thead th {
      padding: 7px 10px; text-align: right;
      font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
      color: var(--muted); border-bottom: 1px solid var(--border);
      cursor: pointer; user-select: none; white-space: nowrap;
      position: sticky; top: 0; background: var(--bg);
    }
    thead th:first-child { text-align: left; }
    thead th:hover { color: var(--text); }
    thead th.sorted { color: var(--blue); }
    thead th.no-sort { cursor: default; }
    thead th.no-sort:hover { color: var(--muted); }
    tbody tr { border-bottom: 1px solid rgba(48,54,61,0.5); }
    tbody tr:hover { background: var(--surface); }
    tbody td { padding: 7px 10px; text-align: right; white-space: nowrap; }
    tbody td:first-child { text-align: left; }

    .ticker-cell { display: flex; align-items: center; gap: 6px; font-weight: 600; }

    /* ── Badges ── */
    .badge {
      font-size: 9px; font-weight: 700; padding: 2px 5px;
      border-radius: 3px; text-transform: uppercase; letter-spacing: 0.03em;
    }
    .b-earns  { background: rgba(248,81,73,0.15);  color: var(--red); }
    .b-strong { background: rgba(63,185,80,0.15);  color: var(--green); }
    .b-okay   { background: rgba(210,153,34,0.15); color: var(--yellow); }
    .b-weak   { background: rgba(248,81,73,0.15);  color: var(--red); }
    .b-blue   { background: rgba(88,166,255,0.15); color: var(--blue); }
    .b-muted  { background: rgba(139,148,158,0.15); color: var(--muted); }

    .g { color: var(--green); }
    .y { color: var(--yellow); }
    .r { color: var(--red); }
    .m { color: var(--muted); }

    /* ── Buttons ── */
    .save-btn {
      background: none; border: 1px solid var(--border); border-radius: 4px;
      color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
      padding: 2px 7px; transition: border-color 0.15s, color 0.15s;
    }
    .save-btn:hover { border-color: var(--green); color: var(--green); }

    .icon-btn {
      background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
      color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600;
      padding: 6px 12px; transition: border-color 0.15s;
    }
    .icon-btn:hover { border-color: var(--blue); }
    .icon-btn:disabled { color: var(--muted); cursor: not-allowed; }

    .close-btn {
      background: none; border: 1px solid transparent; border-radius: 4px;
      color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600;
      padding: 2px 7px; transition: border-color 0.15s, color 0.15s;
    }
    .close-btn:hover { border-color: var(--yellow); color: var(--yellow); }

    .del-btn {
      background: none; border: 1px solid transparent; border-radius: 4px;
      color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 7px;
      transition: border-color 0.15s, color 0.15s;
    }
    .del-btn:hover { border-color: var(--red); color: var(--red); }

    /* ── Positions toolbar ── */
    .pos-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
    .stat-divider { border-right: 1px solid var(--border); padding-right: 16px; margin-right: 4px; }

    /* ── History filters ── */
    .hist-filters {
      display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
    }
    .hist-filters input, .hist-filters select {
      width: auto; min-width: 120px; flex: 1;
    }
    .hist-filters input[type="date"] { min-width: 130px; flex: none; }
    .hist-filters .clear-btn {
      background: none; border: 1px solid var(--border); border-radius: 6px;
      color: var(--muted); cursor: pointer; font-size: 12px; padding: 6px 10px; white-space: nowrap;
    }
    .hist-filters .clear-btn:hover { color: var(--text); }

    /* ── Bot vs Manual comparison ── */
    .hist-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .hist-cmp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
    .hist-cmp-card.cmp-manual { border-left: 3px solid #60a5fa; }
    .hist-cmp-card.cmp-bot    { border-left: 3px solid #a78bfa; }
    .hist-cmp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    .hist-cmp-title { font-size: 13px; font-weight: 700; }
    .hist-cmp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .hist-cmp-stat-label { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
    .hist-cmp-stat-val { font-size: 15px; font-weight: 700; }
    .hist-cmp-verdict { margin-top: 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }

    /* ── History mode switcher ── */
    .hist-mode-switcher { display:flex; gap:8px; margin-bottom:14px; padding:6px; background:var(--surface2); border:1px solid var(--border); border-radius:10px; }
    .hist-mode-pill { flex:1; padding:10px 14px; background:transparent; border:none; border-radius:7px; color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
    .hist-mode-pill:hover { color:var(--text); }
    .hist-mode-pill.active { background:var(--surface); color:var(--text); box-shadow:0 1px 2px rgba(0,0,0,0.2); }
    .hist-mode-pill.mode-manual.active   { color:#60a5fa; }
    .hist-mode-pill.mode-bot.active      { color:#a78bfa; }
    .hist-mode-pill.mode-compare.active  { color:#facc15; }

    /* ── Manual mode: Journal feed ── */
    .hist-journal-feed { display:flex; flex-direction:column; gap:14px; margin-top:16px; }
    .hist-journal-month-divider { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; padding:14px 0 6px; border-bottom:1px solid var(--border); margin-bottom:6px; }
    .hist-journal-card { background:var(--surface); border:1px solid var(--border); border-left:3px solid #60a5fa; border-radius:10px; padding:16px 18px; transition:border-color .15s; }
    .hist-journal-card.win  { border-left-color:#4ade80; }
    .hist-journal-card.loss { border-left-color:#f87171; }
    .hist-journal-card.wheel-win  { border-left-color:#a78bfa; }
    .hist-journal-card.wheel-loss { border-left-color:#c084fc; }
    .hist-journal-header { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; gap:10px; flex-wrap:wrap; }
    .hist-journal-title  { font-size:15px; font-weight:700; }
    .hist-journal-date   { font-size:11px; color:var(--muted); }
    .hist-journal-outcome { display:flex; align-items:center; gap:14px; padding:10px 12px; background:var(--surface2); border-radius:8px; margin-bottom:10px; }
    .hist-journal-pnl    { font-size:18px; font-weight:700; }
    .hist-journal-pct    { font-size:13px; color:var(--muted); font-weight:600; }
    .hist-journal-bar    { flex:1; height:6px; background:rgba(255,255,255,0.07); border-radius:99px; overflow:hidden; }
    .hist-journal-bar-fill { height:100%; border-radius:99px; transition:width .3s; }
    .hist-journal-story  { font-size:13px; color:var(--muted); line-height:1.7; margin-bottom:10px; }
    .hist-journal-story strong { color:var(--text); font-weight:600; }
    .hist-journal-tags   { display:flex; flex-wrap:wrap; gap:5px; }
    .hist-journal-empty  { text-align:center; padding:40px 20px; color:var(--muted); font-size:13px; }

    .hist-personal-scorecard { background:linear-gradient(135deg, rgba(96,165,250,0.08), rgba(96,165,250,0.02)); border:1px solid rgba(96,165,250,0.2); border-radius:12px; padding:18px 22px; margin-bottom:16px; }
    .hist-personal-headline { font-size:14px; font-weight:600; color:#60a5fa; margin-bottom:4px; }
    .hist-personal-summary  { font-size:18px; font-weight:700; line-height:1.4; }
    .hist-personal-summary .m { color:var(--muted); font-weight:400; font-size:14px; }

    .hist-lessons-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 18px; margin-bottom:16px; }
    .hist-lesson-item  { padding:10px 0; border-bottom:1px solid var(--border); font-size:13px; line-height:1.7; }
    .hist-lesson-item:last-child { border-bottom:none; }
    .hist-lesson-meta  { font-size:11px; color:var(--muted); margin-bottom:3px; }

    /* ── Bot mode: scorecards + parameter panels ── */
    .hist-bot-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; margin-bottom:16px; }
    .hist-bot-card { background:var(--surface); border:1px solid var(--border); border-left:3px solid #a78bfa; border-radius:10px; padding:14px 18px; }
    .hist-bot-card-name { font-size:14px; font-weight:700; margin-bottom:8px; }
    .hist-bot-card-row  { display:flex; justify-content:space-between; align-items:baseline; padding:4px 0; font-size:12px; }
    .hist-bot-card-row .lbl { color:var(--muted); font-size:11px; }
    .hist-bot-card-row .val { font-weight:600; }

    .hist-param-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; margin-bottom:16px; }
    .hist-param-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 18px; }
    .hist-param-card h4 { margin:0 0 10px; font-size:13px; font-weight:600; }
    .hist-param-row { display:grid; grid-template-columns:80px 1fr 60px; gap:8px; align-items:center; padding:5px 0; font-size:12px; }
    .hist-param-row .lbl { color:var(--muted); font-size:11px; }
    .hist-param-row .barwrap { height:6px; background:rgba(255,255,255,0.06); border-radius:99px; overflow:hidden; }
    .hist-param-row .barfill { height:100%; border-radius:99px; }
    .hist-param-row .stats { font-size:11px; text-align:right; font-weight:600; }
    .hist-param-row.sweet .lbl { color:#4ade80; font-weight:600; }

    .hist-outcome-bar { display:flex; height:32px; border-radius:8px; overflow:hidden; margin:8px 0 12px; background:var(--surface2); }
    .hist-outcome-seg { padding:0 12px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; color:#fff; }
    .hist-outcome-legend { display:flex; flex-wrap:wrap; gap:14px; font-size:11px; color:var(--muted); }
    .hist-outcome-legend-item { display:flex; align-items:center; gap:5px; }
    .hist-outcome-legend-dot { width:8px; height:8px; border-radius:2px; }

    /* ── Weekly Goal Tracker ── */
    .hist-goal-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px 18px; margin-bottom:16px; display:grid; grid-template-columns:1fr 220px; gap:24px; align-items:start; }
    .hist-goal-card.empty { display:flex; justify-content:space-between; align-items:center; gap:14px; }
    .hist-goal-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(48px, 1fr)); gap:5px; min-width:0; margin-top:8px; }
    .hist-goal-box { aspect-ratio:1; border-radius:5px; transition:transform 0.1s; cursor:default; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:#0f1729; padding:2px; text-align:center; line-height:1.1; overflow:hidden; }
    .hist-goal-box:hover { transform:scale(1.15); }
    .hist-goal-box.hit   { background:#4ade80; }
    .hist-goal-box.miss  { background:#f87171; color:#1a0808; }
    .hist-goal-box.empty { background:rgba(255,255,255,0.04); border:1px dashed rgba(255,255,255,0.12); color:rgba(255,255,255,0.25); }
    .hist-goal-box.future{ background:rgba(255,255,255,0.02); border:1px dashed rgba(255,255,255,0.08); }
    .hist-goal-summary { font-size:13px; line-height:1.7; padding-left:18px; border-left:1px solid var(--border); }
    .hist-goal-summary .lbl { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.5px; }
    .hist-goal-summary .val { font-weight:700; font-size:18px; }
    .hist-goal-set-btn { background:none; border:1px solid var(--border); color:var(--muted); border-radius:6px; padding:4px 9px; font-size:11px; font-weight:600; cursor:pointer; }
    .hist-goal-set-btn:hover { color:var(--text); border-color:var(--accent); }

    /* ── Compare mode ── */
    .hist-divergence { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px; }
    .hist-divergence-row { display:grid; grid-template-columns:120px 1fr 1fr; gap:10px; padding:8px 14px; background:var(--surface); border:1px solid var(--border); border-radius:6px; align-items:center; font-size:13px; }
    .hist-divergence-row .lbl { color:var(--muted); font-size:11px; }
    .hist-divergence-row .v   { font-weight:600; }

    /* ── Charts ── */
    .charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
    .chart-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 8px; padding: 14px;
    }
    .chart-card h4 {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--muted); margin-bottom: 12px;
    }
    .chart-card canvas { max-height: 220px; }

    /* ── Breakdown tables ── */
    .breakdown-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
    .breakdown-card {
      background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px;
    }
    .breakdown-card h4 {
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.07em; color: var(--muted); margin-bottom: 10px;
    }
    .breakdown-card table { font-size: 11px; }
    .breakdown-card thead th {
      font-size: 9px; padding: 4px 8px; position: static; background: none;
    }
    .breakdown-card tbody td { padding: 4px 8px; }

    /* ── History growth chart card ── */
    .hist-growth-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
    }
    .hist-growth-header {
      display: flex; align-items: flex-start; justify-content: space-between;
      gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
    }
    .hist-growth-title { font-size: 17px; font-weight: 700; margin: 0 0 3px; letter-spacing: -0.3px; }
    .hist-growth-subtitle { font-size: 12px; color: var(--muted); }
    .hist-tf-pills { display: flex; gap: 4px; flex-wrap: wrap; }
    .hist-tf-btn {
      padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
      background: none; color: var(--muted); font-size: 11px; font-weight: 700;
      cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
      letter-spacing: 0.03em;
    }
    .hist-tf-btn:hover { color: var(--text); border-color: var(--blue); }
    .hist-tf-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
    .hist-growth-kpis {
      display: grid; grid-template-columns: repeat(4, 1fr);
      gap: 0; margin-bottom: 18px;
      border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
    }
    .hist-kpi {
      padding: 14px 16px; border-right: 1px solid var(--border);
    }
    .hist-kpi:last-child { border-right: none; }
    .hist-kpi-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 5px; }
    .hist-kpi-val   { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
    .hist-kpi-sub   { font-size: 11px; color: var(--muted); margin-top: 3px; }
    .hist-growth-chart-wrap { height: 280px; position: relative; }
    .hist-growth-empty {
      display: flex; align-items: center; justify-content: center; height: 280px;
      color: var(--muted); font-size: 13px;
    }
    @media (max-width: 768px) {
      .hist-growth-card { padding: 16px; }
      .hist-growth-kpis { grid-template-columns: 1fr 1fr; }
      .hist-kpi:nth-child(2) { border-right: none; }
      .hist-kpi:nth-child(3) { border-top: 1px solid var(--border); }
      .hist-kpi:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
      .hist-growth-chart-wrap { height: 220px; }
    }

    /* ── Backtest layout ── */
    .backtest-shell {
      display: grid;
      grid-template-columns: 320px minmax(0, 1fr);
      gap: 16px;
      align-items: start;
    }
    .backtest-sidebar {
      position: sticky;
      top: 0;
      display: flex;
      flex-direction: column;
      gap: 14px;
      align-self: start;
    }
    .backtest-content {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .backtest-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
    }
    .backtest-card h4 {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .backtest-filter-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 12px;
    }
    .backtest-filter-grid .full {
      grid-column: 1 / -1;
    }
    .backtest-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .backtest-actions .full {
      grid-column: 1 / -1;
    }
    .backtest-section-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }
    .backtest-section-title h3 {
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
    }
    .backtest-jump {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .backtest-jump button {
      background: none;
      border: 1px solid var(--border);
      border-radius: 999px;
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
      padding: 5px 10px;
    }
    .backtest-jump button:hover {
      color: var(--text);
      border-color: var(--blue);
    }

    /* ── Modal ── */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.65);
      display: flex; align-items: center; justify-content: center; z-index: 100;
    }
    /* Save/track and manual-entry dialogs can be launched from on top of the
       detail modal, so they must stack above it. */
    #saveModal, #manualEntryModal { z-index: 150; }
    .modal {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 10px; padding: 24px; width: 320px; max-width: 90vw;
    }
    .modal h3 { font-size: 15px; margin-bottom: 6px; }
    .modal .modal-desc { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
    .modal .field-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
    .modal .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
    .modal textarea { min-height: 72px; }
    .guide-list {
      display: flex; flex-direction: column; gap: 10px; margin-top: 14px;
      max-height: 50vh; overflow-y: auto;
    }
    .guide-item {
      border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
      background: var(--bg);
    }
    .guide-item strong { display: block; font-size: 12px; margin-bottom: 4px; }
    .guide-item span { font-size: 11px; color: var(--muted); display: block; }
    .modal-actions { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }
    .modal-actions button {
      border: none; border-radius: 6px; cursor: pointer;
      font-size: 13px; font-weight: 600; padding: 7px 16px;
    }
    .btn-cancel { background: var(--surface2); color: var(--muted); }
    .btn-cancel:hover { color: var(--text); }
    .btn-confirm { background: var(--btn); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 7px 16px; }
    .btn-confirm:hover { background: var(--btn-hover); }
    .btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 7px 16px; }
    .btn-secondary:hover { background: var(--surface3,var(--surface2)); }

    .hidden { display: none !important; }

    @media (max-width: 900px) {
      body { overflow: auto; }
      .layout { grid-template-columns: 1fr; }
      .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
      .charts-row, .breakdown-row { grid-template-columns: 1fr; }
      .backtest-shell { grid-template-columns: 1fr; }
      .backtest-sidebar { position: static; }
      .detail-grid { grid-template-columns: 1fr; }
    }

    /* ═══════════════════════════════════════════════════════════════
       Mobile ≤ 768 px — all rules gated here; desktop unaffected
       ═══════════════════════════════════════════════════════════════ */
    #mobileMenuBtn { display: none; }
    #drawerScrim   { display: none; }
    #drawerCloseRow { display: none; }

    @media (max-width: 768px) {
      /* body */
      body { overflow: hidden; height: 100dvh; }

      /* header */
      header { padding: 10px 14px; gap: 8px; }
      header h1 { font-size: 14px; }
      header .sub { display: none; }
      header .auth-user { display: none; }
      #mobileMenuBtn {
        display: flex; align-items: center; justify-content: center;
        order: -1; width: 38px; height: 38px;
        background: none; border: none; color: var(--text);
        font-size: 20px; cursor: pointer; flex-shrink: 0; padding: 0;
      }

      /* layout */
      #appLayout { grid-template-columns: 1fr !important; }

      /* sidebar → off-canvas drawer */
      .sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        width: min(300px, 85vw);
        z-index: 200;
        transform: translateX(-110%);
        transition: transform 0.24s cubic-bezier(.4,0,.2,1);
        border-right: 1px solid var(--border) !important;
        border-bottom: none !important;
        overflow-y: auto;
        display: flex; flex-direction: column;
        padding-top: env(safe-area-inset-top, 0px);
      }
      .sidebar.drawer-open { transform: translateX(0); }

      /* drawer header row */
      #drawerCloseRow {
        display: flex; align-items: center; justify-content: space-between;
        padding: 12px 16px; border-bottom: 1px solid var(--border);
        flex-shrink: 0; background: var(--surface);
      }
      #drawerCloseRow span { font-size: 13px; font-weight: 600; }
      #drawerCloseRow button {
        background: none; border: none; color: var(--muted);
        font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
      }

      /* scrim */
      #drawerScrim {
        display: none; position: fixed; inset: 0;
        z-index: 199; background: rgba(0,0,0,0.55);
      }
      #drawerScrim.open { display: block; }

      /* tab bar: horizontal scroll */
      .tabs, .subtabs {
        overflow-x: auto !important; flex-wrap: nowrap !important;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
      }
      .tabs::-webkit-scrollbar, .subtabs::-webkit-scrollbar { display: none; }
      .subtab-btn { flex: 0 0 auto; white-space: nowrap; }
      .dash-strip { scrollbar-width: none; }
      .dash-strip::-webkit-scrollbar { display: none; }

      /* scan setup card stacks on mobile */
      .scan-setup-bar { flex-wrap: wrap; }
      .scan-setup-actions { width: 100%; }
      .scan-setup-actions input[type="text"] { flex: 1; width: auto; }
      .scan-setup-actions .btn-scan { flex: 1; }
      .scan-setup-body { grid-template-columns: 1fr; max-height: 60vh; }
      .tab-btn {
        flex: 0 0 auto !important; padding: 10px 14px !important;
        font-size: 12px !important; white-space: nowrap;
      }

      /* sticky first column — scanner, watch, positions, wheel, history */
      #tableWrap thead th:first-child,
      #tableWrap tbody td:first-child,
      #watchTableWrap thead th:first-child,
      #watchTableWrap tbody td:first-child,
      #posTableWrap thead th:first-child,
      #posTableWrap tbody td:first-child,
      #wheelTableWrap thead th:first-child,
      #wheelTableWrap tbody td:first-child,
      #histBotMode .table-wrap thead th:first-child,
      #histBotMode .table-wrap tbody td:first-child {
        position: sticky; left: 0; z-index: 2;
        background: var(--bg);
        box-shadow: 2px 0 5px rgba(0,0,0,0.45);
      }
      #tableWrap thead th:first-child,
      #watchTableWrap thead th:first-child,
      #posTableWrap thead th:first-child,
      #wheelTableWrap thead th:first-child,
      #histBotMode .table-wrap thead th:first-child {
        background: var(--surface); z-index: 3;
      }

      /* backtest: stack sidebar above content */
      .backtest-shell { grid-template-columns: 1fr !important; }
      .backtest-sidebar { position: static !important; }

      /* hist layout: single column */
      .hist-param-grid { grid-template-columns: 1fr !important; }
      .breakdown-row { grid-template-columns: 1fr !important; }
      .hist-bot-grid { grid-template-columns: 1fr !important; }

      /* bots tab: collapse KPI grid and form grid */
      .bot-kpis { grid-template-columns: repeat(2, 1fr) !important; }
      .bot-form-grid { grid-template-columns: 1fr !important; }
      .bot-form-grid.two-col { grid-template-columns: 1fr !important; }

      /* modals → bottom sheets */
      .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
      .modal {
        width: 100% !important; max-width: 100% !important;
        max-height: 88vh !important; overflow-y: auto !important;
        border-radius: 14px 14px 0 0 !important;
        padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
        border-left: none; border-right: none; border-bottom: none !important;
      }
      .modal-actions { flex-direction: column !important; }
      .modal-actions button {
        width: 100%; padding: 13px !important; font-size: 15px !important;
      }

      /* auth modal → bottom sheet */
      .auth-overlay { align-items: flex-end !important; padding: 0 !important; }
      .auth-box {
        width: 100% !important; max-width: 100% !important;
        border-radius: 14px 14px 0 0 !important;
        padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
      }

      /* inputs: 16px prevents iOS auto-zoom on focus */
      input[type="text"], input[type="number"],
      input[type="email"], input[type="password"],
      select, textarea { font-size: 16px !important; }

      /* slider thumb */
      input[type="range"] { height: 32px; }
      input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
      input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }

      /* tap targets */
      .btn-scan { padding: 14px !important; font-size: 15px !important; min-height: 48px; }
      .btn-auth, .icon-btn, .guide-btn { min-height: 40px; }

      /* detail / plan mode */
      .detail-grid { grid-template-columns: 1fr !important; }

      /* safe-area: header top */
      header { padding-top: max(10px, env(safe-area-inset-top, 10px)); }
    }

    /* Touch: don't let hover states stick */
    @media (hover: none) {
      tbody tr:hover { background: transparent; }
      .tab-btn:hover { color: var(--muted); border-bottom-color: transparent; }
      .tab-btn.active:hover { color: var(--text); border-bottom-color: var(--blue); }
      .btn-scan:hover:not(:disabled) { background: var(--btn); }
    }

    /* ── Scan card view (mobile default) ─── */
    #viewToggleBtn { display: none; }
    #cardWrap { display: none; }

    @media (max-width: 768px) {
      #viewToggleBtn { display: inline-flex; }
      #cardWrap.active { display: block; padding: 4px 0; }

      .scan-card {
        background: var(--surface); border: 1px solid var(--border);
        border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
      }
      .scan-card:active { background: var(--surface2); }
      .scan-card-top {
        display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
      }
      .scan-card-ticker { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
      .scan-card-edge { font-size: 22px; font-weight: 800; line-height: 1; }
      .scan-card-edge.g { color: var(--green); }
      .scan-card-edge.y { color: var(--yellow); }
      .scan-card-edge.r { color: var(--red); }
      .scan-card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
      .scan-card-grid {
        display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
      }
      .scan-card-stat-label {
        font-size: 10px; color: var(--muted); text-transform: uppercase;
        letter-spacing: 0.05em; margin-bottom: 2px;
      }
      .scan-card-stat-val { font-size: 14px; font-weight: 600; }
      .scan-card-stat-val.g { color: var(--green); }
      .scan-card-stat-val.y { color: var(--yellow); }
      .scan-card-stat-val.r { color: var(--red); }
      .scan-card-actions { display: flex; gap: 8px; margin-top: 2px; }
      .scan-card-actions button {
        flex: 1; padding: 9px; border-radius: 7px; border: 1px solid var(--border);
        background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
      }
      .scan-card-actions .card-save-btn {
        background: var(--btn); color: #fff; border-color: var(--btn);
      }
      .scan-card-earns {
        font-size: 10px; color: var(--yellow); background: rgba(210,153,34,0.12);
        border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
      }
    }
