/* ==========================================================================
   Pageera design system — the only stylesheet.
   1. Tokens (colours, type, spacing)   5. Components
   2. Base                              6. Stock and option specifics
   3. Layout (bar, menus, footer)       7. Utilities
   4. Page blocks (hero, sections)      8. Small screens
   Change a colour in ONE place: the tokens below.
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------------ */
:root {
  --ink:        #0F172A;   /* main text */
  --ink-2:      #334155;   /* secondary text */
  --muted:      #475569;   /* quiet text (passes 4.5:1 on white) */
  --faint:      #64748B;   /* captions on white only */
  --line:       #E2E8F0;   /* borders */
  --line-2:     #CBD5E1;   /* input borders */
  --bg:         #F7F8FA;   /* page */
  --surface:    #FFFFFF;   /* cards, bars */
  --hover:      #F1F5F9;

  --stk:        #0F766E;   /* Stocks side */
  --stk-dark:   #115E59;
  --stk-soft:   #F0FDFA;
  --stk-edge:   #99F6E4;
  --opt:        #4338CA;   /* Options side */
  --opt-dark:   #3730A3;
  --opt-soft:   #EEF2FF;
  --opt-edge:   #C7D2FE;

  --good:       #15803D;   --good-soft: #F0FDF4;
  --gold:       #A16207;   --gold-soft: #FEFCE8;
  --warn:       #C2410C;   --warn-soft: #FFF7ED;
  --bad:        #B91C1C;   --bad-soft:  #FEF2F2;
  --info:       #1D4ED8;   --info-soft: #EFF6FF;

  --font:       Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head:  "Space Grotesk", Inter, system-ui, sans-serif;
  --mono:       ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-xs: 12px; --fs-sm: 13.5px; --fs: 15px; --fs-md: 17px; --fs-lg: 20px;
  --fs-xl: 26px; --fs-2xl: 34px; --fs-3xl: 48px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --shadow: 0 12px 32px rgba(15, 23, 42, .12);
  --wrap: 1200px;
}

/* 2. Base -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.6 var(--font);
       -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 var(--s3); color: var(--ink); }
h1 { font-size: var(--fs-3xl); font-weight: 700; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0 0 var(--s4); }
a { color: var(--stk); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: .92em; background: var(--hover); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid #93C5FD; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* 3. Layout ------------------------------------------------------------------ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar .wrap { min-height: 60px; display: flex; align-items: center; gap: var(--s5); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 21px/1 var(--font-head); color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.mainnav { display: flex; gap: 2px; align-items: center; }
.navlink, .dd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-sm);
         font: 600 var(--fs) var(--font); color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.navlink:hover, .dd-btn:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.dd.stocks.on  .dd-btn { background: var(--stk-soft); color: var(--stk); }
.dd.options.on .dd-btn { background: var(--opt-soft); color: var(--opt); }
.dd-caret { transition: transform .15s; }

/* Dropdown: opens on hover (mouse), on click/tap, and on keyboard focus */
.dd { position: relative; }
.dd-menu { display: none; position: absolute; top: calc(100% + 8px); left: -12px; width: 620px; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s4); z-index: 70; }
.dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }   /* hover bridge */
.dd.open .dd-menu { display: block; }
.dd.open .dd-caret { transform: rotate(180deg); }
@media (hover: hover) and (min-width: 721px) {
  .dd:hover .dd-menu, .dd:focus-within .dd-menu { display: block; }
  .dd:hover .dd-caret { transform: rotate(180deg); }
}
.dd-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.dd-head a { font-size: var(--fs-sm); font-weight: 600; }
.dd.stocks .dd-head a { color: var(--stk); } .dd.options .dd-head a { color: var(--opt); }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dd-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--r); color: var(--ink); }
.dd-item:hover, .dd-item.here { background: var(--hover); text-decoration: none; }
.dd-item .ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.dd.stocks  .dd-item .ic { background: var(--stk-soft); color: var(--stk); }
.dd.options .dd-item .ic { background: var(--opt-soft); color: var(--opt); }
.dd-item .nm { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.dd-item .ds { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.inline-out { display: inline-flex; margin: 0; }
.topsearch { position: relative; }
.topsearch input { width: 240px; height: 40px; padding: 0 14px; font: inherit; font-size: var(--fs-sm);
                   border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.topsearch input:focus { outline: none; border-color: var(--stk); box-shadow: 0 0 0 3px var(--stk-soft); }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; color: var(--ink); }
.menu-btn:hover { background: var(--hover); }

main { display: block; min-height: 60vh; }
.page { padding-top: var(--s7); padding-bottom: var(--s8); }
.page-head { margin-bottom: var(--s6); }
.page-head p { color: var(--muted); font-size: var(--fs-md); max-width: 720px; }
.page-head.center p { margin-left: auto; margin-right: auto; }

.footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: var(--s8); }
.footer .wrap { padding-top: var(--s6); padding-bottom: var(--s6); display: grid;
                grid-template-columns: 2fr repeat(3, 1fr); gap: var(--s5); font-size: var(--fs-sm); }
.footer h4 { font-family: var(--font); font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s2); }
.footer a { display: block; color: var(--muted); line-height: 2; }
.footer .about { color: var(--muted); max-width: 340px; }
.footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: var(--s4); color: var(--faint); font-size: var(--fs-xs); }

/* 4. Page blocks -------------------------------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 72px; padding-bottom: var(--s8); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s4); }
.hero h1 { max-width: 840px; margin: 0; }
.hero .lead { margin: 0; font-size: 18px; color: var(--muted); max-width: 640px; }
.eyebrow { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow.stocks { color: var(--stk); } .eyebrow.options { color: var(--opt); }

.bigsearch { width: 100%; max-width: 640px; margin-top: var(--s3); position: relative; }
.bigsearch form { display: flex; gap: var(--s2); flex-wrap: wrap; }
.bigsearch input { flex: 1 1 320px; height: 54px; padding: 0 18px; font: inherit; font-size: 16px;
                   border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.bigsearch input:focus { outline: none; border-color: var(--stk); box-shadow: 0 0 0 4px var(--stk-soft); }

.section { padding-top: var(--s7); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.section-head h2 { margin: var(--s2) 0 0; }
.section-head .more { font-weight: 600; }
.section-head .more.stocks { color: var(--stk); } .section-head .more.options { color: var(--opt); }

/* 5. Components --------------------------------------------------------------- */

/* Buttons: .btn + one of primary | stocks | options | ghost | light | danger;  .sm / .lg sizes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 20px;
       font: 600 var(--fs)/1 var(--font); border-radius: var(--r); border: 1.5px solid transparent; cursor: pointer;
       text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--ink); color: #fff; }       .btn.primary:hover { background: #1E293B; }
.btn.stocks  { background: var(--stk); color: #fff; }       .btn.stocks:hover  { background: var(--stk-dark); }
.btn.options { background: var(--opt); color: #fff; }       .btn.options:hover { background: var(--opt-dark); }
.btn.ghost   { background: var(--surface); color: var(--ink); border-color: var(--line-2); }  .btn.ghost:hover { background: var(--hover); }
.btn.light   { background: #fff; color: var(--ink); }
.btn.outline-light { border-color: #475569; color: #fff; } .btn.outline-light:hover { border-color: #fff; }
.btn.danger  { background: var(--bad); color: #fff; }
.btn.link    { background: none; color: var(--stk); padding: 0; min-height: 0; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 16px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.card h3 { margin-bottom: var(--s2); }
.card.pad-lg { padding: var(--s6); }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

/* Tool cards (home + hubs) */
.tool { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r-lg); min-height: 136px; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool:hover { text-decoration: none; transform: translateY(-2px); }
.tool.stocks:hover  { border-color: #5EEAD4; }
.tool.options:hover { border-color: #A5B4FC; }
.tool .ic { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.tool.stocks  .ic { background: var(--stk-soft); color: var(--stk); }
.tool.options .ic { background: var(--opt-soft); color: var(--opt); }
.tool .nm { font-size: var(--fs-md); font-weight: 600; }
.tool .ds { font-size: 14px; line-height: 1.5; color: var(--muted); }
.tool .soon { align-self: flex-start; }

/* Tables: wrap wide tables in .table-wrap so they scroll sideways on phones */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
            color: var(--muted); background: #F8FAFC; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFC; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th a { color: inherit; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 16px; font: 600 var(--fs-sm) var(--font); color: var(--muted); background: none; border: 0;
        border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--ink); border-bottom-color: var(--ink); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field label { font-weight: 600; font-size: var(--fs-sm); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; font: inherit; color: var(--ink);
       background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--stk); box-shadow: 0 0 0 3px var(--stk-soft); }
.field .help  { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-xs); color: var(--bad); font-weight: 600; }
.field.has-error .input { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--stk); }
.form-row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }

/* Chips and badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-full);
        font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.chip:hover { text-decoration: none; }
.chip.stocks  { background: var(--stk-soft); color: var(--stk); border-color: var(--stk-edge); }
.chip.options { background: var(--opt-soft); color: var(--opt); border-color: var(--opt-edge); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-full); font-size: var(--fs-xs);
         font-weight: 700; line-height: 1.6; background: var(--hover); color: var(--ink-2); }
.badge.stocks  { background: var(--stk-soft); color: var(--stk); }
.badge.options { background: var(--opt-soft); color: var(--opt); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad  { background: var(--bad-soft);  color: var(--bad); }

/* Score badge: <span class="score s-high">78</span>  bands: high 70+, mid 50-69, low 35-49, poor <35 */
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 32px; padding: 0 10px;
         border-radius: var(--r-sm); font: 700 15px/1 var(--font); font-variant-numeric: tabular-nums; }
.score.lg { min-width: 72px; height: 56px; font-size: 26px; border-radius: var(--r); }
.score.s-high { background: var(--good-soft); color: var(--good); }
.score.s-mid  { background: var(--gold-soft); color: var(--gold); }
.score.s-low  { background: var(--warn-soft); color: var(--warn); }
.score.s-poor { background: var(--bad-soft);  color: var(--bad); }
.score.s-none { background: var(--hover);     color: var(--faint); }

/* Messages: .notice + ok | info | warn | err */
.notice { display: flex; gap: var(--s3); padding: 14px 16px; border-radius: var(--r); font-size: var(--fs-sm); border: 1px solid; margin-bottom: var(--s4); }
.notice.ok   { background: var(--good-soft); border-color: #BBF7D0; color: #14532D; }
.notice.info { background: var(--info-soft); border-color: #BFDBFE; color: #1E3A8A; }
.notice.warn { background: var(--warn-soft); border-color: #FED7AA; color: #7C2D12; }
.notice.err  { background: var(--bad-soft);  border-color: #FECACA; color: #7F1D1D; }

/* Empty state */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty h3 { color: var(--ink); }

/* Pagination */
.pager { display: flex; gap: 4px; justify-content: center; margin-top: var(--s5); flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
        border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); }
.pager a:hover { background: var(--hover); text-decoration: none; }
.pager .on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .gap { border: 0; background: none; }

/* Modal: a native <dialog class="modal"> */
.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow); color: var(--ink); }
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.modal .modal-head h3 { margin: 0; }
.modal .modal-body { padding: var(--s5); }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--line); }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* Search suggestions (top bar and home) */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line);
           border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; z-index: 60; text-align: left; min-width: 280px; }
.suggest[hidden] { display: none; }
.suggest a { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px 14px; color: var(--ink); border-top: 1px solid var(--hover); }
.suggest a:first-child { border-top: 0; }
.suggest a:hover, .suggest a.active { background: var(--stk-soft); text-decoration: none; }
.suggest .sym { font-weight: 700; }
.suggest .co { color: var(--muted); font-size: var(--fs-sm); }
.suggest .none { padding: 12px 14px; color: var(--muted); font-size: var(--fs-sm); }

/* Plans */
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.plan { display: flex; flex-direction: column; gap: var(--s3); }
.plan .price { font: 700 var(--fs-2xl)/1 var(--font-head); }
.plan .price small { font: 500 var(--fs-sm) var(--font); color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: var(--fs-sm); }
.plan .btn { margin-top: auto; }

/* Dark call-to-action band */
.band { background: var(--ink); color: #fff; border-radius: var(--r-xl); padding: var(--s6) 40px; display: flex; gap: var(--s6);
        align-items: center; justify-content: space-between; flex-wrap: wrap; }
.band h2 { color: #fff; font-size: 30px; margin: 0; }
.band p { margin: 10px 0 0; color: var(--line-2); max-width: 620px; }
.band .actions { display: flex; gap: var(--s3); flex-wrap: wrap; }

/* Learn cards */
.learn-card { display: flex; flex-direction: column; gap: 10px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); }
.learn-card:hover { text-decoration: none; border-color: var(--line-2); }
.learn-card .t { font: 700 24px/1.2 var(--font-head); }
.learn-card .d { color: var(--muted); }

/* 6. Stock and option specifics -------------------------------------------- */
.pos { color: var(--good); } .neg { color: var(--bad); } .mid { color: var(--gold); }
.score.sm { min-width: 36px; height: 26px; font-size: 13px; padding: 0 8px; }
.score.xl { min-width: 96px; height: 80px; font-size: 40px; border-radius: var(--r-lg); font-family: var(--font-head); }

.stock-page { padding-top: var(--s6); padding-bottom: var(--s7); }
.stock-head { display: grid; grid-template-columns: 1fr auto; gap: var(--s5); padding: var(--s6); }
.stock-head h1 { font-size: 36px; margin: var(--s3) 0 var(--s1); }
.stock-head .sym { font: 600 var(--fs-md) var(--font); color: var(--muted); background: var(--hover); padding: 3px 10px; border-radius: var(--r-sm); vertical-align: middle; }
.stock-head .industry { margin: 0 0 var(--s2); color: var(--ink-2); }
.stock-head .meta { margin: 0; }
.stock-score { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.watch.on { background: var(--stk-soft); color: var(--stk); border-color: var(--stk-edge); }
.trio { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; border-top: 1px solid var(--line); padding-top: var(--s4); }
.trio-cell { display: flex; align-items: center; gap: var(--s2); }
.trio-link { margin-left: auto; font-weight: 600; }

.jump { position: sticky; top: 60px; z-index: 40; display: flex; flex-wrap: wrap; gap: 2px; background: var(--bg);
        padding: var(--s3) 0; margin: var(--s4) 0 var(--s2); border-bottom: 1px solid var(--line); }
.jump::-webkit-scrollbar { display: none; }
.jump a { padding: 7px 14px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.jump a:hover { background: var(--surface); text-decoration: none; }
.stock-section { padding-top: var(--s6); scroll-margin-top: 120px; }
.stock-section > h2 { font-size: var(--fs-xl); margin-bottom: var(--s4); }
.stock-section h3 { margin-top: var(--s5); }
.stock-section .card h3:first-child, .stock-section h2 + h3 { margin-top: 0; }
.stock-section h4 { font-family: var(--font); font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 var(--s2); }

.verdict { background: var(--stk-soft); border: 1px solid var(--stk-edge); border-radius: var(--r-lg); padding: var(--s5); font-size: var(--fs-md); line-height: 1.65; color: #134E4A; }
details.more summary { cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more .more-link { color: var(--stk); font-weight: 600; white-space: nowrap; }
details.more[open] .lead-text, details.more[open] .more-link { display: none; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--s3); }
.check-item { display: flex; gap: var(--s3); align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.check-item div { display: flex; flex-direction: column; gap: 2px; }
.check-item .mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.check-item.good .mark { background: var(--good-soft); color: var(--good); }
.check-item.ok   .mark { background: var(--gold-soft); color: var(--gold); }
.check-item.bad  .mark { background: var(--bad-soft);  color: var(--bad); }
.check-item.none .mark { background: var(--hover);     color: var(--faint); }

.range { position: relative; height: 10px; border-radius: var(--r-full); background: linear-gradient(90deg, #FECACA, #FEF08A, #BBF7D0); margin: var(--s4) 0 var(--s2); }
.range-dot { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transform: translate(-50%, -50%); }
.range-labels { display: flex; justify-content: space-between; }
.stage { font-size: var(--fs-sm); padding: 4px 12px; }
.change-list { margin: var(--s3) 0 0; padding-left: 0; list-style: none; font-size: 14px; }
.change-list li { padding: 4px 0; }

.chart { width: 100%; height: auto; display: block; }
.trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: var(--s3); }
.trend { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.trend b { font-size: var(--fs-md); }
.trend.up b { color: var(--good); } .trend.down b { color: var(--bad); } .trend.flat b { color: var(--gold); }
.pillar-index { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0; }
.pillar-index a { display: inline-flex; align-items: center; gap: var(--s2); padding: 6px 6px 6px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-full); font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.pillar-index a:hover { border-color: var(--line-2); text-decoration: none; }
.pillar { margin-top: var(--s4); scroll-margin-top: 120px; }
.pillar-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.meter-bar { height: 8px; border-radius: var(--r-full); background: var(--hover); margin: var(--s4) 0; overflow: hidden; }
.meter-bar span { display: block; height: 100%; border-radius: inherit; }
.meter-bar .s-high { background: var(--good); } .meter-bar .s-mid { background: #CA8A04; } .meter-bar .s-low { background: var(--warn); } .meter-bar .s-poor { background: var(--bad); }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: var(--s3); margin-top: var(--s4); }
.metric { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #F8FAFC; border-radius: var(--r); }
.metric b { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.kv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: var(--s3); }
.kv { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #F8FAFC; border-radius: var(--r); }
.stars { color: #CA8A04; letter-spacing: 2px; } .stars span { color: var(--line-2); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(64px, 160px) minmax(0, 1fr) auto; gap: var(--s3); align-items: center; font-size: var(--fs-sm); }
.bar-label { color: var(--ink-2); }
.bar-track { height: 12px; background: var(--hover); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--stk); }
.bar-fill.options { background: var(--opt); } .bar-fill.good { background: var(--good); } .bar-fill.neutral { background: #64748B; }
.bar-fill.muted { background: var(--line-2); } .bar-fill.neg { background: var(--bad); }
.bar-val { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; } .bar-val.neg { color: var(--bad); }
.plain-list { margin: 0; padding-left: 18px; } .plain-list li { margin: 6px 0; }
.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--s4); }
.explain > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.explain p { margin: 0; color: var(--ink-2); }
.table tr.me td { background: var(--stk-soft); }
.news { display: grid; gap: var(--s3); }
.news-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4) var(--s5); }
.news-item h3 { font-family: var(--font); font-size: var(--fs); margin: 0 0 var(--s2); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; margin-bottom: var(--s2); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: var(--s3) 0 0; color: var(--ink-2); }
.paywall h2 { font-size: var(--fs-xl); }
.meter { text-align: center; font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s6); }
.disclaimer { font-size: var(--fs-xs); color: var(--faint); text-align: center; max-width: 720px; margin: var(--s4) auto 0; }

/* 7. Utilities ---------------------------------------------------------------- */
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s2); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: var(--s4); }

/* 8. Small screens ------------------------------------------------------------ */
@media (max-width: 900px) {
  .topsearch input { width: 180px; }
  .footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --fs-3xl: 34px; --fs-2xl: 26px; }
  .wrap { padding: 0 var(--s4); }
  .topbar .wrap { gap: var(--s2); }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
  .mainnav, .topbar-right { display: none; }
  .topbar.open .mainnav, .topbar.open .topbar-right { display: flex; }
  .topbar.open .wrap { flex-wrap: wrap; padding-bottom: var(--s3); }
  .topbar.open .mainnav { order: 3; width: 100%; flex-direction: column; align-items: stretch; }
  .dd-btn, .navlink { width: 100%; justify-content: space-between; padding: 12px; }
  .dd-menu { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 8px; }
  .dd-menu::before, .dd-head { display: none; }
  .dd-grid { grid-template-columns: minmax(0, 1fr); }
  .dd-item { align-items: center; }
  .dd-item .ds { display: none; }
  .topbar.open .topbar-right { order: 4; width: 100%; margin-left: 0; flex-wrap: wrap; }
  .topbar.open .topsearch, .topbar.open .topsearch input { width: 100%; }
  .hero .wrap { padding-top: 44px; padding-bottom: 40px; }
  .hero .lead { font-size: 16px; }
  .bigsearch .btn { width: 100%; }
  .page { padding-top: var(--s6); padding-bottom: var(--s7); }
  .band { padding: 28px; }
  .footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .stock-head { grid-template-columns: minmax(0, 1fr); padding: var(--s5); }
  .stock-head h1 { font-size: 28px; }
  .stock-score { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
  .trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
  .trio-cell { flex-direction: column; align-items: flex-start; gap: 4px; }
  .trio-link { grid-column: 1 / -1; margin-left: 0; }
  /* phones: every section link visible as a small button, wrapping onto rows (not pinned) */
  .jump { position: static; gap: 6px; border-bottom: 0; padding: 0; }
  .jump a { padding: 6px 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: var(--fs-xs); }
  .bar-row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: var(--s2); }
  .bar-val { min-width: 0; }
}

/* ── Accounts (phase 2) ─────────────────────────────────────────────────── */
.btn.block { display: flex; width: 100%; }
.auth-card { max-width: 440px; margin: 0 auto; }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--s2); }
.auth-card .check { font-size: var(--fs-sm); }
.auth-icon { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 14px; display: grid; place-items: center;
             background: var(--stk-soft); color: var(--stk); }
.google-btn { gap: 10px; margin-top: var(--s4); }
.or { display: flex; align-items: center; gap: var(--s3); margin: var(--s5, 20px) 0; color: var(--muted); font-size: var(--fs-xs); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5, 20px); }
.account-grid h2 { font-size: var(--fs-lg); margin-bottom: var(--s4); }
.account-grid .check { margin-bottom: var(--s3); }
@media (max-width: 760px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
.pro-card .price { font: 700 40px/1.1 var(--font-head); margin: var(--s2) 0 var(--s4); }
.pro-card .price small { font: 500 var(--fs-sm) var(--font); color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0 0 var(--s5); }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--good-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; }
[hidden] { display: none !important; }

/* ── Admin (phase 2) ─────────────────────────────────────────────────────── */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.admin-tabs a { padding: 10px 14px; font-weight: 600; font-size: var(--fs-sm); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.admin-tabs a:hover { color: var(--ink); text-decoration: none; }
.admin-tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.admin-h { font-size: var(--fs-lg); margin: var(--s6) 0 var(--s3); }
.admin-filter { gap: var(--s2); margin-bottom: var(--s4); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.stat { padding: var(--s4) var(--s5); }
.stat-v { font: 700 28px/1.2 var(--font-head); margin: 4px 0; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; font-size: var(--fs-sm); }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
.btn.ghost.red-text { color: var(--bad); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stat-grid, .settings-grid, .facts { grid-template-columns: minmax(0, 1fr); } }

/* ── Phone safety net: nothing may push the page wider than the screen ──── */
body { overflow-wrap: break-word; }
h1, h2, h3, .facts dd, .table td a { overflow-wrap: anywhere; }
.grid > *, .plans > *, .checklist > *, .trends > *, .metrics > *, .kv-cards > *, .explain > *,
.account-grid > *, .stat-grid > *, .settings-grid > *, .form-row > *, .stock-head > *, .bar-row > * { min-width: 0; }
.card, .table-wrap, .notice { max-width: 100%; }
img, svg, video { max-width: 100%; }
@media (max-width: 760px) {
  /* 16px stops iPhones zooming the page when a box is tapped */
  .input, .select, .textarea, .topsearch input, .bigsearch input, input[type=search] { font-size: 16px; }
  .account-grid .card.pad-lg { padding: var(--s5) var(--s4); }
  .table th, .table td { padding: 10px 12px; }
  .admin-filter .input, .admin-filter .select { max-width: none !important; flex: 1 1 100%; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* ── Screener (phase 3) ───────────────────────────────────────────────────── */
.screener { display: grid; gap: var(--s4); }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.filters > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.filters > summary::-webkit-details-marker { display: none; }
.filters[open] > summary svg { transform: rotate(180deg); }
.filter-form { padding: 0 16px 16px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 0 var(--s3); }
.filter-flags { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.filter-flags .check { margin: 0; }
.filter-form .field { margin-bottom: var(--s3); }
.filter-form .field label { font-size: var(--fs-xs); }
.filter-form .input, .filter-form .select { min-height: 40px; padding: 8px 12px; }
.more-filters { border-top: 1px solid var(--line); margin-top: var(--s2); }
.more-filters summary { display: flex; align-items: center; gap: 8px; padding: var(--s3) 0; font-weight: 700; font-size: var(--fs-sm); cursor: pointer; list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters summary svg { margin-left: auto; }
.more-filters[open] > summary svg { transform: rotate(180deg); }
.pro-filters { border: 0; margin: 0; padding: 0; min-width: 0; }
.pro-filters[disabled] .field, .pro-filters[disabled] .check { opacity: .55; }
.filter-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.result-bar strong { margin-right: auto; }
.sort-form { display: flex; align-items: center; gap: var(--s2); }
.select.sm { min-height: 36px; padding: 6px 30px 6px 10px; width: auto; font-size: var(--fs-sm); }
.screener-table th a { color: inherit; white-space: nowrap; }
.screener-table th.sorted { color: var(--stk); }
.screener-table td.co { min-width: 180px; }
.screener-table td.co a { font-weight: 600; color: var(--ink); }
.pill-num { display: inline-block; min-width: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill-num.s-high { color: var(--good); } .pill-num.s-mid { color: #A16207; } .pill-num.s-low { color: #C2410C; } .pill-num.s-poor { color: var(--bad); }
.screens { margin-top: var(--s7); }
.screens > h2 { font-size: var(--fs-xl, 24px); margin-bottom: var(--s2); }
.screen-groups { columns: 3 240px; column-gap: var(--s5); margin-top: var(--s4); }
.screen-group { break-inside: avoid; margin-bottom: var(--s5); }
.screen-group h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--s2); }
.screen-group ul { list-style: none; margin: 0; padding: 0; }
.screen-group li a { display: block; padding: 6px 0; color: var(--ink); font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
.screen-group li a:hover, .screen-group li a.on { color: var(--stk); text-decoration: none; }
.screen-group li a.on { font-weight: 700; }
@media (max-width: 900px) {
  .screener-table td.co { min-width: 0; }
  .select.sm { font-size: 16px; }
}
.screener-table th, .screener-table td { padding: 12px 10px; }
.screener-table th:first-child, .screener-table td:first-child { padding-left: 16px; }

/* ── Compare (phase 3) — 8 company colours, used for dots and bars ───────── */
.c0 { --c: #0F766E; } .c1 { --c: #4338CA; } .c2 { --c: #C2410C; } .c3 { --c: #A21CAF; }
.c4 { --c: #0369A1; } .c5 { --c: #4D7C0F; } .c6 { --c: #B91C1C; } .c7 { --c: #475569; }
.compare-bar { padding: var(--s4); margin-bottom: var(--s5); display: grid; gap: var(--s3); }
.compare-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cmp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid var(--line-2); border-radius: var(--r-full); font-size: var(--fs-sm); max-width: 100%; }
.cmp-chip i, .cmp-card .who i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cmp-chip a { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-chip a.x { color: var(--muted); font-weight: 400; padding: 0 6px; }
.cmp-chip a.x:hover { color: var(--bad); text-decoration: none; }
.compare-add { display: flex; gap: var(--s2); position: relative; max-width: 520px; }
.compare-add input[type=search] { flex: 1; width: auto; }
.compare-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: var(--s4); }
.cmp-card { padding: var(--s5); }
.cmp-card h2 { font-size: var(--fs-md); margin-bottom: 2px; }
.cmp-card ul { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 8px; }
.cmp-card li { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--s2); align-items: center; font-size: var(--fs-sm); padding: 2px 6px; border-radius: var(--r-sm); }
.cmp-card li.best { background: var(--stk-soft); }
.cmp-card li.best .val { font-weight: 700; }
.cmp-card .who { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.cmp-card .who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-wide { grid-column: 1 / -1; }
.cmp-wide .table th:first-child { color: var(--muted); }
.cmp-card .track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.cmp-card .fill { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.cmp-card .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 40px; }
.cmp-best { margin: var(--s2) 0 0; }
.cmp-card .table th { text-transform: none; letter-spacing: 0; font-size: var(--fs-xs); white-space: nowrap; }
.cmp-pop { display: grid; gap: 4px; color: var(--ink); }
.cmp-pop:hover { text-decoration: none; border-color: var(--stk); }
@media (max-width: 560px) { .cmp-card li { grid-template-columns: 96px minmax(0, 1fr) auto; } }

/* ── Movers (phase 3) ─────────────────────────────────────────────────────── */
.movers { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.m-head { font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; margin-bottom: var(--s2); }
.m-head::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.m-head.up::before { background: var(--good); } .m-head.down::before { background: var(--bad); }
.mover-list { list-style: none; margin: 0; padding: 0; }
.mover-list li a { display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; gap: var(--s3); align-items: center; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); }
.mover-list li a:hover { text-decoration: none; background: var(--hover); }
.m-name { display: grid; min-width: 0; } .m-name strong { font-size: var(--fs-sm); }
.m-score { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.m-diff { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.m-diff.up { color: var(--good); } .m-diff.down { color: var(--bad); }
@media (max-width: 760px) { .movers { grid-template-columns: minmax(0, 1fr); } }

/* ── Companies, sectors (phase 3) ─────────────────────────────────────────── */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--s4) 0 var(--s5); }
.letters a, .letters span { min-width: 36px; height: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); font-weight: 600; font-size: var(--fs-sm); }
.letters a { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.letters a:hover { text-decoration: none; border-color: var(--stk); color: var(--stk); }
.letters a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.letters span { color: var(--line-2); }
.co-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 0 var(--s5); }
.co-list li a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.co-list li a:hover { text-decoration: none; background: var(--hover); }
.co-n { display: grid; min-width: 0; } .co-n strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--s4); }
.sector-card { display: grid; gap: 6px; color: var(--ink); }
.sector-card:hover { text-decoration: none; border-color: var(--stk); }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sc-top h2 { font-size: var(--fs-md); }
.sc-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sc-bar span { display: block; height: 100%; background: var(--good); }
.sector-card p { margin: 0; }
.ink { color: var(--ink); }
.sector-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.bar-track.has-mark { position: relative; overflow: visible; }
.bar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
@media (max-width: 760px) { .sector-head { grid-template-columns: minmax(0, 1fr); } }
.spark { display: block; overflow: visible; }
.spark polyline { fill: none; stroke: var(--stk); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.watch-table td.co a { font-weight: 600; color: var(--ink); }

/* ── Portfolio (phase 3) ──────────────────────────────────────────────────── */
.pf-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.pf-form textarea { font-family: ui-monospace, Menlo, Consolas, monospace; }
#report { display: grid; gap: var(--s4); align-content: start; }
.pf-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s4); }
.pf-score { display: grid; justify-items: start; gap: 8px; }
.pf-bands { display: grid; gap: 10px; align-content: center; }
.pf-band { display: grid; grid-template-columns: 130px minmax(0, 1fr) 28px; gap: var(--s3); align-items: center; }
.pf-band strong { text-align: right; }
.pf-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: var(--fs-sm); }
.pf-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.pf-cols .admin-h, #report > .admin-h { margin-bottom: var(--s3); }
#report > .admin-h { margin-top: var(--s2); }
@media (max-width: 900px) { .pf-layout, .pf-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .pf-top { grid-template-columns: minmax(0, 1fr); } .pf-band { grid-template-columns: 110px minmax(0, 1fr) 24px; } }
.sc-bar.s-mid span { background: #CA8A04; } .sc-bar.s-low span { background: #EA580C; } .sc-bar.s-poor span { background: var(--bad); }
.hub-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); margin-top: var(--s6); }
.hub-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.hub-h h2 { font-size: var(--fs-lg); }
.chips-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 760px) { .hub-cols { grid-template-columns: minmax(0, 1fr); } }
form.bigsearch { display: flex; gap: var(--s2); flex-wrap: wrap; }
form.bigsearch .btn { height: 54px; }
.compare-bar > * { min-width: 0; }
.compare-add input[type=search] { min-width: 0; }

/* ── Ad spaces: 300×600 left + right from 1200px, right only 980–1199px, one box under the content below 980px ── */
.ad-rail { display: none; }
.ad-box { width: 300px; min-height: 600px; margin: 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-empty { width: 300px; height: 600px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-2);
            border-radius: var(--r-md); color: var(--muted); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; background: var(--surface); }
.ad-under { margin-top: var(--s7); }
.ad-under .ad-box { min-height: 250px; max-width: 100%; }
.ad-under .ad-empty { width: 300px; height: 250px; max-width: 100%; }
@media (min-width: 980px) and (max-width: 1199px) {
  /* laptops: one ad space, on the right */
  .with-ads .shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s4); margin: 0 auto; padding: 0 var(--s4); align-items: start; }
  .with-ads .shell > main { grid-column: 1; grid-row: 1; min-width: 0; }
  .with-ads .ad-rail-right { display: block; grid-column: 2; grid-row: 1; position: sticky; top: 76px; margin-top: var(--s6); }
  .with-ads main .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .with-ads .ad-under { display: none; }
}
@media (min-width: 1200px) {
  .with-ads .shell { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: var(--s4);
                     max-width: calc(var(--wrap) + 632px); margin: 0 auto; padding: 0 var(--s4); align-items: start; }
  .with-ads .shell > main { grid-column: 2; grid-row: 1; min-width: 0; }
  .with-ads .ad-rail { display: block; grid-row: 1; position: sticky; top: 76px; margin-top: var(--s6); }
  .with-ads .ad-rail-left { grid-column: 1; } .with-ads .ad-rail-right { grid-column: 3; }
  .with-ads main .wrap { max-width: none; padding-left: 0; padding-right: 0; }
  .with-ads .topbar .wrap, .with-ads .footer .wrap { max-width: calc(var(--wrap) + 632px); }
  .with-ads .ad-under { display: none; }
}
.code-area { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* Long lists inside a full-width card read better in two columns on wide screens */
@media (min-width: 900px) { .hub-cols .co-list, .pf-cols .co-list, .mover-list { columns: 2; column-gap: var(--s6); display: block; }
  .hub-cols .co-list li, .pf-cols .co-list li, .mover-list li { break-inside: avoid; } }
.pf-form textarea { max-width: 560px; }
.ad-rail { position: relative; }

/* ── Screener landing: ready-made screens as cards ───────────────────────── */
.sg-h { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: var(--s6) 0 var(--s3); font-family: var(--font); }
.screen-cards .sg-h:first-child { margin-top: 0; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: var(--s3); }
.screen-card { display: grid; gap: 6px; align-content: start; color: var(--ink); padding: var(--s4); }
.screen-card:hover { text-decoration: none; border-color: var(--stk); box-shadow: var(--shadow-sm, 0 1px 3px rgba(15,23,42,.08)); }
.screen-card .sc-count { margin-top: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--stk); }
.build-h { font-size: var(--fs-lg); text-transform: none; letter-spacing: 0; color: var(--ink); font-family: var(--font-head); margin-top: var(--s7); }
.cf-card { border-color: var(--stk); background: linear-gradient(0deg, var(--surface), var(--stk-soft)); margin-bottom: var(--s6); }
.cf-top { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
.fg-h { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--font); margin: var(--s4) 0 var(--s2); }
.filter-form .fg-h:first-child { margin-top: 0; }
.tool .nm .badge { vertical-align: middle; margin-left: 4px; }

/* ── Peer cards on the stock page ─────────────────────────────────────────── */
.peer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: var(--s3); }
.peer-card { display: grid; gap: 4px; align-content: start; padding: var(--s4); color: var(--ink); }
.peer-card:hover { text-decoration: none; border-color: var(--stk); }
.peer-card.me { border: 2px solid var(--stk); background: var(--stk-soft); }
.peer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.peer-rank { font-weight: 700; color: var(--muted); font-size: var(--fs-sm); }
.peer-name { font-size: var(--fs-sm); line-height: 1.3; }
.peer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line);
              font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.peer-stats em { display: block; font-style: normal; font-weight: 500; color: var(--muted); font-size: 11px; }
.cmp-pop-list { display: grid; gap: 4px; margin: 4px 0; }
.cmp-pop-list > span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-sm); }
.cmp-pop-list i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.cmp-pop .sc-count { font-size: var(--fs-sm); font-weight: 600; color: var(--stk); }

/* ── Watchlist cards ─────────────────────────────────────────────────────── */
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: var(--s3); }
.watch-card { display: grid; gap: var(--s3); padding: var(--s4); align-content: start; }
.wc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.wc-name { display: grid; gap: 2px; min-width: 0; }
.wc-name a { font-weight: 700; color: var(--ink); }
.wc-trend { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.wc-change { white-space: nowrap; }
.wc-pillars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align: center; padding: var(--s2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wc-pillars em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.wc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

/* ── Options: strategy builder (phase 4) ─────────────────────────────────── */
.sc-count.options { color: var(--opt); }
.fno-list { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.fno-list a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.fno-list a:hover { text-decoration: none; background: var(--hover); color: var(--opt); }
.builder .chips-row { margin-top: var(--s3); }
.builder .chip strong { margin-left: 4px; }
.b-sec { margin-top: var(--s5); }
.b-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.b-head h2 { font-size: var(--fs-md); } .b-head h3 { font-size: var(--fs-sm); }
.b-title { font-size: var(--fs-lg); margin: var(--s6) 0 var(--s3); }
.leg { position: relative; border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: var(--r-md); padding: var(--s3) 52px var(--s3) var(--s3); margin-top: var(--s3); background: var(--surface); }
.leg.sell { border-left-color: var(--bad); }
.leg-grid { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; }
.leg-grid .field { flex: 1 1 130px; min-width: 0; }
.leg-grid .field.qty { flex: 0 0 76px; } .leg-grid .field.prem { flex: 0 1 100px; }
.leg-grid .field { margin: 0; display: grid; gap: 4px; }
.leg-grid .field > span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.leg-grid .select, .leg-grid .input { min-height: 40px; padding: 6px 10px; }
.leg-grid .prem strong { font-size: var(--fs-md); padding: 8px 0; font-variant-numeric: tabular-nums; }
.tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; margin-left: 4px; vertical-align: middle; }
.tag.live { background: var(--good-soft); color: var(--good); } .tag.est { background: #FEF3C7; color: #92400E; }
.leg-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); cursor: pointer; color: var(--muted); }
.leg-x:hover { color: var(--bad); border-color: var(--bad); }
.leg-greeks { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-xs); color: var(--ink-2); margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.leg-greeks .muted { margin-left: auto; }
.leg-empty { margin: var(--s3) 0 0; }
.b-metrics, .b-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: var(--s3); }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); display: grid; gap: 4px; align-content: start; }
.metric > span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.metric strong { font: 700 var(--fs-lg)/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.metric strong small { display: block; font: 500 var(--fs-xs) var(--font); color: var(--muted); }
.metric strong.pos, .pos { color: var(--good); } .metric strong.neg, .neg { color: var(--bad); }
.b-chart-card { margin-top: var(--s4); }
.payoff { position: relative; width: 100%; }
.payoff svg { display: block; touch-action: pan-y; }
.payoff text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.payoff .g { stroke: var(--line); } .payoff .z { stroke: var(--ink-2); stroke-width: 1; }
.payoff .ap { fill: #16A34A; fill-opacity: .14; } .payoff .al { fill: #DC2626; fill-opacity: .12; }
.payoff .ln { fill: none; stroke: var(--opt); stroke-width: 2.4; stroke-linejoin: round; }
.payoff .spot { stroke: var(--ink-2); stroke-dasharray: 4 4; } .payoff .spot-t { fill: var(--ink-2); font-weight: 600; }
.payoff .be { fill: #fff; stroke: var(--opt); stroke-width: 2; }
.payoff .hv { stroke: var(--muted); stroke-width: 1; } .payoff .hd { fill: var(--opt); }
.payoff-tip { position: absolute; top: 8px; background: var(--ink); color: #fff; font-size: var(--fs-xs); padding: 6px 10px; border-radius: var(--r-sm); pointer-events: none; white-space: nowrap; }
.payoff-tip .pos { color: #86EFAC; } .payoff-tip .neg { color: #FCA5A5; }
.pl-badge { font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 99px; background: var(--good-soft); white-space: nowrap; }
.pl-badge.neg { background: #FEE2E2; }
.leg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.leg-list li { padding-left: 10px; border-left: 3px solid var(--good); } .leg-list li.sell { border-left-color: var(--bad); }
/* Legs table (strategy page, saved strategies): a table on wide screens, one card per leg on phones */
.legs-table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin: var(--s3) 0; }
.legs-table .table th { white-space: nowrap; }
.legs-table .table td { white-space: nowrap; }
.legs-table tfoot td { background: var(--hover); font-weight: 600; border-bottom: 0; }
.side-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.side-tag.buy { background: #EAF1F8; color: #2D5A8A; } .side-tag.sell { background: #F6ECEC; color: #8A2D2D; }
@media (max-width: 720px) {
  .legs-table { border: 0; overflow: visible; }
  .legs-table .table thead { display: none; }
  .legs-table .table, .legs-table tbody, .legs-table tfoot { display: block; }
  .legs-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; margin-bottom: 10px;
                         border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .legs-table tbody td { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border: 0; text-align: right; }
  .legs-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; }
  .legs-table tfoot tr { display: flex; justify-content: space-between; padding: 12px; border-radius: var(--r); background: var(--hover); }
  .legs-table tfoot td { padding: 0; background: none; }
  .legs-table tfoot td:not(:first-child):not(.num) { display: none; }
}
@media (max-width: 900px) { .leg-greeks .muted { margin-left: 0; width: 100%; } }
.eyebrow a { color: inherit; }

/* ── Options: scanner, strategy page, screener (phase 4b) ─────────────── */
.h3 { font-size: var(--fs-lg); font-weight: 600; } .h4 { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 var(--s2); }
.field > .label { font-weight: 600; font-size: var(--fs-sm); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.idx-tabs { margin-bottom: var(--s4); }
.mkt-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; padding: 12px 16px; margin-bottom: var(--s4); font-size: var(--fs-sm); }
.mkt-strip em { font-style: normal; color: var(--muted); margin-right: 2px; }
.mkt-strip b { font-variant-numeric: tabular-nums; }
.mkt-strip .mkt-age { margin-left: auto; }
.scan-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.scan-filters .select { width: auto; min-width: 180px; flex: 0 1 220px; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s6); }
.scan-card { display: grid; gap: var(--s3); padding: var(--s4); align-content: start; min-width: 0; }
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); flex-wrap: wrap; }
.sc-name { font-weight: 700; color: var(--ink); }
.sc-views { display: flex; gap: 4px; flex-wrap: wrap; }
.view-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--hover); color: var(--ink-2); }
.view-tag.bullish { background: var(--good-soft); color: var(--good); } .view-tag.bearish { background: var(--bad-soft); color: var(--bad); }
.view-tag.volatile { background: var(--warn-soft); color: var(--warn); } .view-tag.neutral { background: var(--info-soft); color: #1E40AF; }
.sc-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s3); }
.sc-nums div { display: grid; gap: 1px; }
.sc-nums em { font-style: normal; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.sc-nums b { font-variant-numeric: tabular-nums; font-size: var(--fs-md); }
.sc-legs { margin: 0; } .sc-more { justify-self: start; }
.scan-card.locked { background: #FAFAFB; }
.blur { filter: blur(5px); user-select: none; }
.prose-block { max-width: 760px; margin-top: var(--s6); } .prose-block h2 { font-size: var(--fs-xl); }
.strat-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.strat-tools .bigsearch { flex: 1 1 380px; margin-top: 0; } .strat-tools .bigsearch input, .strat-tools .bigsearch .btn { height: 46px; }
.inline-form { display: flex; gap: var(--s2); } .inline-form .select { width: auto; }
.page section.card { margin-bottom: var(--s4); }
.leg-list.big { gap: var(--s2); margin-bottom: var(--s3); } .leg-list.big li { display: grid; gap: 2px; padding: 4px 0 4px 12px; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--s3); }
.levels p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lvl { font-weight: 700; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 99px; font-size: var(--fs-sm); }
.lvl em { font-style: normal; font-weight: 500; font-size: var(--fs-xs); opacity: .8; }
.lvl.good { background: var(--good-soft); color: var(--good); } .lvl.bad { background: var(--bad-soft); color: var(--bad); }
.presets { margin-bottom: var(--s3); }
.opt-filters { padding: 0; margin-bottom: var(--s4); }
.opt-filters > summary { padding: 14px 18px; font-weight: 700; cursor: pointer; }
.opt-filters > form { padding: 0 18px 18px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--s3); }
.opt-card { padding: 12px 14px; display: grid; gap: 8px; min-width: 0; border-left: 4px solid var(--good); }
.opt-card.put { border-left-color: var(--bad); } .opt-card.itm { background: #FFFBEB; }
.oc-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.oc-type { font-size: var(--fs-xs); color: var(--muted); }
.oc-ltp { font-variant-numeric: tabular-nums; font-weight: 600; }
.oc-nums { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: space-between; gap: 4px 10px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.oc-nums em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.oc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.chain-card { padding: var(--s3); }
.chain { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.chain th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.chain td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--line); position: relative; white-space: nowrap; }
.chain .k { text-align: center; font-weight: 700; background: #F8FAFC; }
.chain td.itm { background: #FFFBEB; }
.chain tr.atm td { border-top: 2px solid var(--opt); border-bottom: 2px solid var(--opt); }
.chain .ch-side { text-align: center; font-size: var(--fs-sm); } .ch-side.call { color: var(--good); } .ch-side.put { color: var(--bad); }
.oibar { position: absolute; top: 4px; bottom: 4px; right: 0; opacity: .14; border-radius: 2px; }
.oibar.call { background: var(--good); } .oibar.put { background: var(--bad); }
.payoff .bar-call { fill: #16A34A; fill-opacity: .7; } .payoff .bar-put { fill: #DC2626; fill-opacity: .7; }
.payoff .bar-pos { fill: #16A34A; fill-opacity: .7; } .payoff .bar-neg { fill: #DC2626; fill-opacity: .7; }
.payoff .ln-call { fill: none; stroke: #16A34A; stroke-width: 2; } .payoff .ln-put { fill: none; stroke: #DC2626; stroke-width: 2; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.key.call { background: #16A34A; } .key.put { background: #DC2626; }
@media (max-width: 640px) {
  .mkt-strip .mkt-age { margin-left: 0; width: 100%; }
  .chain td, .chain th { padding: 5px 4px; } .chain { font-size: 12.5px; }
  .oc-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-filters .select { flex: 1 1 100%; }
}
.scan-locked { display: grid; gap: var(--s3); padding: var(--s4); margin-bottom: var(--s3); background: #FAFAFB; }
.scan-locked ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); }
.scan-locked li { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.scan-locked .btn { justify-self: start; }

/* ── Options: market breadth, FII/DII, events (phase 4c) ──────────────── */
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.row-between h2 { margin: 0; }
.mkt-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); }
.mkt-hero > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.mkt-hero .xs { width: 100%; }
.mkt-price { font: 700 32px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.mkt-chg { font-weight: 700; font-variant-numeric: tabular-nums; }
.breadth-nums, .stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.breadth-nums div, .stat-cards .card { display: grid; gap: 2px; }
.breadth-nums em, .stat-cards em { font-style: normal; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.breadth-nums b { font: 700 26px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.stat-cards { margin-bottom: var(--s4); } .stat-cards .card { padding: var(--s4); }
.stat-cards b { font: 700 24px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.ad-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--hover); }
.ad-bar .up { background: var(--good); } .ad-bar .down { background: var(--bad); }
.metric small.tone-up { color: var(--good); font-weight: 700; } .metric small.tone-down { color: var(--bad); font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s2); }
.two-col .card { padding: var(--s4); }
.bu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.bu-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.mover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: var(--s2); margin-bottom: var(--s2); }
.mover { padding: 10px 14px; display: flex; justify-content: space-between; gap: var(--s3); align-items: center; border-left: 4px solid var(--line); min-width: 0; }
.mover.up { border-left-color: var(--good); } .mover.down { border-left-color: var(--bad); }
.mv-name { display: grid; min-width: 0; } .mv-name .xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-name a, .mv-name strong { font-weight: 700; color: var(--ink); }
.mv-nums { display: grid; text-align: right; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.fo-grid .card { padding: var(--s4); }
.kv3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.kv3 em { display: block; font-style: normal; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.fd-list { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.fd-row { display: grid; grid-template-columns: 150px repeat(auto-fit, minmax(0, 1fr)); gap: var(--s2) var(--s4); align-items: center; padding: 12px 16px; }
.fd-date { display: grid; }
.fd-side { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.fd-side em { font-style: normal; font-weight: 700; font-size: var(--fs-xs); color: var(--muted); width: 28px; }
.fd-side span { color: var(--ink-2); }
.ev-month { margin: var(--s5) 0 var(--s3); }
.ev-list { display: grid; gap: var(--s2); }
.ev-card { display: flex; gap: var(--s4); padding: 12px 16px; align-items: flex-start; border-left: 4px solid var(--line); }
.ev-card.today { background: #FFFBEB; }
.ev-expiry { border-left-color: var(--opt); } .ev-holiday { border-left-color: var(--warn); }
.ev-rbi, .ev-budget, .ev-fed { border-left-color: var(--bad); }
.ev-date { display: grid; text-align: center; min-width: 40px; }
.ev-date b { font: 700 22px/1 var(--font-head); } .ev-date span { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; }
.ev-body { display: grid; gap: 4px; min-width: 0; flex: 1; } .ev-body p { margin: 0; }
.ev-top { display: flex; justify-content: space-between; gap: var(--s2); align-items: flex-start; flex-wrap: wrap; }
.ev-top a { color: var(--ink); }
.badge.imp-high { background: var(--bad-soft); color: var(--bad); } .badge.imp-medium { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 700px) {
  .fd-row { grid-template-columns: 1fr; }
  .mkt-price { font-size: 26px; }
}

/* ── Margin Check and Price Alerts (phase 4d) ─────────────────────────── */
.margin-form { margin-bottom: var(--s4); }
.mleg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.mleg .select { width: auto; min-width: 96px; }
.mleg-n { width: 24px; height: 24px; border-radius: 99px; background: var(--opt-soft); color: var(--opt); font-weight: 700; font-size: var(--fs-xs); display: grid; place-items: center; }
.mleg-lots { display: flex; align-items: center; gap: 6px; } .mleg-lots .input { width: 76px; }
.mleg-ltp { margin-left: auto; }
.alert-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: start; }
.alert-form .field:last-child { padding-top: 26px; }   /* button lines up with the boxes (they have a label above) */
.alert-form #a-now:empty { display: none; }
.alert-form .field { margin-bottom: 0; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--s3); }
.alert-card { padding: var(--s4); display: grid; gap: 4px; }
.alert-card p { margin: 0; } .alert-card.done { background: #FAFAFB; }
.ac-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.ac-rule b { font: 700 var(--fs-lg) var(--font-head); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .alert-form { grid-template-columns: 1fr 1fr; } .alert-form .field:first-child { grid-column: 1 / -1; } .alert-form .field:last-child { padding-top: 0; }
  .mleg .select { flex: 1 1 40%; } .mleg-ltp { margin-left: 0; }
}

/* ── Learn (phase 5a) ─────────────────────────────────────────────────── */
.learn-sec { margin-bottom: var(--s6); scroll-margin-top: 90px; }
.learn-group { margin: var(--s4) 0 var(--s5); scroll-margin-top: 90px; }
.learn-group h2 { margin-bottom: 2px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--s3); margin-top: var(--s3); }
.learn-item { display: grid; gap: 4px; padding: var(--s4); color: var(--ink); align-content: start; }
.learn-item:hover { text-decoration: none; border-color: var(--line-2); }
.learn-article { max-width: 780px; }
.learn-article .page-head p { font-size: var(--fs-md); }
.learn-article .page-head .chips-row { margin: var(--s2) 0 var(--s3); }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: var(--fs-xl); margin: var(--s6) 0 var(--s3); color: var(--ink); }
.prose h3 { font-size: var(--fs-md); margin: 0 0 var(--s2); color: var(--ink); }
.prose p { margin: 0 0 var(--s3); }
.prose ul, .prose ol { margin: 0 0 var(--s4); padding-left: 1.3em; } .prose li { margin-bottom: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose .formula { font: 600 15px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #F8FAFC; border: 1px solid var(--line); border-left: 4px solid var(--stk); border-radius: var(--r); padding: 12px 16px; margin: 0 0 var(--s3); overflow-x: auto; color: var(--ink); }
.prose .example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4) var(--s5); margin: 0 0 var(--s3); }
.prose .example p:last-child { margin-bottom: 0; }
.prose .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: var(--s2); margin: 0 0 var(--s4); }
.prose .facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.prose .facts dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.prose .facts dd { margin: 2px 0 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.prose .facts dd.pos { color: var(--good); } .prose .facts dd.neg { color: var(--bad); }
.prose .facts dd .muted { font-weight: 400; font-size: var(--fs-xs); }
.prose .weights { display: grid; gap: 4px; margin: 0 0 var(--s3); }
.prose .weight { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.prose .table-wrap { margin: 0 0 var(--s4); font-size: var(--fs-sm); }
.prose .payoff { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); margin: 0 0 var(--s2); }
.learn-article .faq { margin-top: var(--s6); } .learn-article .faq h2 { font-size: var(--fs-xl); }
.learn-cta { display: grid; gap: var(--s2); margin: var(--s5) 0; background: #FAFAFF; }
.learn-cta p { margin: 0; }
.learn-more { margin-top: var(--s5); }
.learn-sec .learn-item { padding: 12px 14px; gap: 2px; }
.learn-sec .learn-item .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── About, legal, methodology, contact (phase 5b) ────────────────────── */
.narrow-page { max-width: 860px; }
.narrow-page .stat-cards { margin: var(--s4) 0 var(--s5); }
.prose code { font-size: .9em; background: #F1F5F9; padding: 1px 6px; border-radius: 4px; }
.prose small { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.prose .glossary { display: grid; gap: var(--s2); margin: 0 0 var(--s4); }
.prose .glossary > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; }
.prose .glossary dt { font-weight: 700; color: var(--ink); }
.prose .glossary dd { margin: 4px 0 0; font-size: var(--fs-sm); }
.method h2, .method h3 { scroll-margin-top: 90px; }

/* Admin settings: one card per group, save bar stays in view */
.settings-cards { display: grid; gap: var(--s4); max-width: 900px; }
.settings-card { padding: var(--s5); scroll-margin-top: 90px; }
.settings-card .sc-head { margin-bottom: var(--s4); } .settings-card .sc-head p { margin: 2px 0 0; }
.settings-card .settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 0 var(--s4); }
.settings-save { position: sticky; bottom: 0; padding: var(--s3) 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* Saved strategies: grand total on top, then one full-width card per strategy */
.saved-total { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.saved-total > div { display: flex; flex-direction: column; gap: 2px; }
.saved-total strong { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.saved-list { display: grid; gap: var(--s4); margin-bottom: var(--s4); }
.saved-card .sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s3); }
.saved-card .metrics { margin-bottom: 0; }
@media (max-width: 720px) { .saved-card .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Admin: activity day bars, email form */
.day-bars { padding: var(--s3) var(--s4); display: grid; gap: 4px; }
.day-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 90px 82px; gap: var(--s3); align-items: center; }
.day-bar { height: 10px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.day-bar i { display: block; height: 100%; background: var(--stk); border-radius: 99px; }
@media (max-width: 560px) { .day-row { grid-template-columns: 80px minmax(0, 1fr) 70px; } .day-row > :last-child { display: none; } }
.mail-form { display: grid; gap: var(--s3); max-width: 760px; }
.mail-form .field { margin: 0; }
.mail-preview { border-top: 1px solid var(--line); padding-top: var(--s4); }
.mail-preview-box { background: #F7F8FA; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); font-size: 15px; line-height: 1.6; }
.mail-send { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
/* Admin: catalog */
.cat-list { display: grid; gap: var(--s2); }
.cat-item { padding: 0; }
.cat-item summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; list-style: none; }
.cat-item summary::-webkit-details-marker { display: none; }
.cat-item[open] summary { border-bottom: 1px solid var(--line); }
.cat-item.off summary strong, .cat-row.off .cat-name strong { color: var(--muted); }
.cat-form { display: grid; gap: var(--s3); padding: var(--s4); }
.cat-form .field { margin: 0; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.cat-name { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-num { display: flex; flex-direction: column; gap: 2px; width: 110px; }
.cat-num .input { min-height: 38px; padding: 6px 10px; }

/* Options home: Markets today (GIFT NIFTY + world indices / currencies / commodities) */
.mkt-today { margin-bottom: var(--s5); }
.mkt-today .row-between { margin-bottom: var(--s3); }
.gift-card { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5);
             border-left: 4px solid var(--good); margin-bottom: var(--s3); }
.gift-card.down { border-left-color: var(--bad); }
.gift-card > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.gift-price { font: 700 30px/1.15 var(--font-head); font-variant-numeric: tabular-nums; }
.gift-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 420px; text-align: right; }
.gift-side .mt-chg { font-size: 18px; }
.mt-tab-row { display: flex; gap: 4px; margin-bottom: var(--s2); flex-wrap: wrap; }
.mt-tab { padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); font: 600 14px var(--font); color: var(--ink-2); cursor: pointer; }
.mt-tab.on { background: var(--opt); border-color: var(--opt); color: #fff; }
.mt-panel { padding: var(--s2) var(--s4); }
.mt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 170px; gap: var(--s3); align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mt-row:last-of-type { border-bottom: 0; }
.mt-name, .mt-price { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-price { align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.mt-chg { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mt-chg small { font-weight: 600; }
.mt-note { margin: var(--s2) 0; }
@media (max-width: 560px) {
  .mt-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mt-row .mt-chg { grid-column: 2; font-size: 13px; }
  .gift-side { align-items: flex-start; text-align: left; }
}
/* Sector page: score history */
.sector-hist { margin-top: var(--s5); }
.split-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--hover); }
.split-bar span { display: block; height: 100%; }
.split-bar .up, .split-legend i.up { background: var(--good); }
.split-bar .same, .split-legend i.same { background: var(--line-2); }
.split-bar .down, .split-legend i.down { background: var(--bad); }
.split-legend { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s2); }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sh-movers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); margin-top: var(--s4); }
.sh-mover { display: flex; justify-content: space-between; gap: var(--s3); padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.sh-mover:hover { text-decoration: none; } .sh-mover:hover strong:first-child { color: var(--stk); }

/* Pro: risk notice before paying */
.risk-modal { width: min(640px, calc(100% - 24px)); }
.risk-body { max-height: min(62vh, 560px); overflow-y: auto; font-size: 14.5px; line-height: 1.55; }
.risk-lead { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); background: #FEF3C7; border: 1px solid #FCD34D; border-radius: var(--r); color: #78350F; }
.risk-list { margin: 0 0 var(--s4); padding-left: 1.1em; display: grid; gap: var(--s2); }
.risk-check { align-items: flex-start; padding: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--hover); font-size: 14px; }
.risk-check input { margin-top: 3px; flex: none; }
.risk-modal .modal-foot { flex-wrap: wrap; }
@media (max-width: 480px) { .risk-modal .modal-foot .btn { flex: 1 1 100%; } }

/* ── Admin: Prediction (private) ── */
.pred-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); margin-bottom: var(--s3); }
.pred-bar-r { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.pred-budget { display: flex; gap: 6px; align-items: center; margin: 0; }
.pred-budget .input { width: 110px; min-height: 34px; padding: 4px 10px; }
.pred-best { margin-bottom: var(--s4); border-left: 5px solid var(--line-2); }
.pred-best.up { border-left-color: var(--good); } .pred-best.down { border-left-color: var(--bad); }
.pb-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s2); }
.pb-title { margin: 0; font-size: 22px; }
.pb-dir { font-size: 18px; } .pred-best.up .pb-dir { color: var(--good); } .pred-best.down .pb-dir { color: var(--bad); }
.pb-conf { display: flex; flex-direction: column; align-items: flex-end; } .pb-conf strong { font-size: 30px; line-height: 1; }
.pred-tabs .mt-tab-row { margin-bottom: var(--s3); }
.tab-dir { font-size: 12px; } .tab-dir.up { color: var(--good); } .tab-dir.down { color: var(--bad); } .tab-dir.side { color: var(--muted); }
.mt-tab.on .tab-dir { color: #fff; }
.mt-tab.changed { box-shadow: 0 0 0 3px #FCD34D; }
.pred-panel > * + * { margin-top: var(--s3); }
.pred-card { border-top: 5px solid var(--line-2); }
.pred-card.up { border-top-color: var(--good); } .pred-card.down { border-top-color: var(--bad); }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; }
.pc-dir { font: 800 28px/1.1 var(--font-head); }
.pred-card.up .pc-dir { color: var(--good); } .pred-card.down .pc-dir { color: var(--bad); } .pred-card.side .pc-dir { color: var(--muted); }
.pc-conf { min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.conf-bar { height: 10px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.conf-bar i { display: block; height: 100%; border-radius: 99px; background: var(--good); } .conf-bar i.low { background: #F59E0B; }
.pc-levels { margin: var(--s3) 0 0; }
.pc-why { margin: var(--s3) 0 0; padding-left: 1.1em; display: grid; gap: 2px; font-size: 14.5px; }
.pc-wrong { margin: var(--s3) 0 0; padding: var(--s2) var(--s3); background: #FEF2F2; border-radius: var(--r-sm); font-size: 14px; color: #7F1D1D; }
.pred-cmp tr.best td { background: #ECFDF5; font-weight: 600; }
.pred-cmp tr.over td { color: var(--muted); }
.pred-chart { padding: var(--s3) var(--s4); }
.pchart { width: 100%; height: 300px; display: block; margin-top: var(--s2); }
.pc-grid { stroke: #EEF0F3; stroke-width: 1; }
.pc-ax { font-size: 11px; fill: #64748B; }
.pc-up { stroke: #16A34A; fill: #16A34A; } .pc-dn { stroke: #DC2626; fill: #DC2626; }
.pc-e9 { fill: none; stroke: #2563EB; stroke-width: 1.6; } .pc-e20 { fill: none; stroke: #F59E0B; stroke-width: 1.6; }
.pc-vw { fill: none; stroke: #9333EA; stroke-width: 1.6; stroke-dasharray: 5 3; }
.pc-stu { fill: none; stroke: #16A34A; stroke-width: 2; stroke-dasharray: 2 2; } .pc-std { fill: none; stroke: #DC2626; stroke-width: 2; stroke-dasharray: 2 2; }
.pc-now { stroke: #0F172A; stroke-width: 1; stroke-dasharray: 3 3; } .pc-now-bg { fill: #0F172A; }
.pc-tgt { stroke: #16A34A; stroke-width: 1.4; stroke-dasharray: 6 4; } .pc-tgt-bg { fill: #16A34A; }
.pc-stp { stroke: #DC2626; stroke-width: 1.4; stroke-dasharray: 6 4; } .pc-stp-bg { fill: #DC2626; }
.pc-lab { font-size: 11px; fill: #fff; font-weight: 700; }
.pc-legend { margin: 4px 0 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.pc-legend i { display: inline-block; width: 16px; height: 3px; margin-right: 4px; vertical-align: middle; }
.lg-e9 { background: #2563EB; } .lg-e20 { background: #F59E0B; } .lg-vw { background: repeating-linear-gradient(90deg, #9333EA 0 5px, transparent 5px 8px); } .lg-st { background: repeating-linear-gradient(90deg, #16A34A 0 3px, #DC2626 3px 6px); }
.lg-tgt { background: #16A34A; } .lg-stp { background: #DC2626; }
.up-text { color: var(--good); } .down-text { color: var(--bad); } .side-text { color: var(--muted); }
.pred-reads summary { cursor: pointer; padding: var(--s2) 0; }
.pred-notes { margin-top: var(--s5); background: #FFFBEB; border-color: #FCD34D; }
@media (max-width: 560px) { .pchart { height: 220px; } .pc-dir { font-size: 24px; } .pc-conf { min-width: 0; width: 100%; } }
@media (max-width: 720px) { .pred .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* prediction: rule-set switch and today's head-to-head */
.pred-sets { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; margin: var(--s3) 0; }
.pred-sets .seg { display: flex; gap: 6px; flex-wrap: wrap; }
.pred-vs { display: flex; flex-wrap: wrap; gap: 4px var(--s3); align-items: baseline; }
.pred-vs-i { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line, #e5e7eb); }
.pred-vs-i.on { border-color: currentColor; }

/* options: premium check */
.prem-form { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s3); }
.prem-form .field { flex: 1 1 150px; margin: 0; }
.prem-verdict { border-left: 5px solid var(--line); }
.prem-verdict.v-cheap { border-left-color: var(--good); } .prem-verdict.v-expensive { border-left-color: var(--warn); } .prem-verdict.v-fair { border-left-color: #94A3B8; }
.prem-head { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: center; }
.prem-meter { flex: 0 1 260px; min-width: 200px; }
.pm-bar { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--good) 0%, #CBD5E1 50%, var(--warn) 100%); }
.pm-bar i { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink, #0F172A); }
.pm-lab { display: flex; justify-content: space-between; margin-top: 4px; }
.prem-checks { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s2); }
.prem-checks li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.prem-checks .badge { min-width: 76px; text-align: center; }
.prem-table td, .prem-table th { text-align: center; } .prem-table td.num, .prem-table th.num { text-align: right; }
.prem-table tr.atm td { background: #F8FAFC; } .prem-table tr.sel td { background: #EEF2FF; }
.prem-table a.badge { text-decoration: none; }
.prem-table { overflow-x: auto; } .prem-table table { min-width: 470px; } .prem-table .badge { white-space: nowrap; }
.prem-events { margin-top: var(--s4); padding: var(--s3) var(--s4); background: #FFFBEB; border: 1px solid #FDE68A; border-radius: var(--r-md); }
.prem-events ul { margin: 6px 0; padding-left: 18px; } .prem-events li { margin: 2px 0; }
.pred-hist-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; margin: var(--s5) 0 var(--s3); }
.pred-day { display: flex; gap: 6px; align-items: center; } .pred-day .select { width: auto; min-width: 140px; }
.pred-month { margin-top: var(--s4); } .pred-month tr.sel td { background: #EEF2FF; }

/* options: option chain page */
.chain-tools { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin: var(--s3) 0; }
.chain-tools .field { margin: 0; flex: 0 1 200px; } .chain-links { margin-left: auto; align-self: center; }
.chain-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
@media (max-width: 640px) { .chain-cards { grid-template-columns: 1fr 1fr; gap: var(--s2); } .chain-cards .stat { padding: var(--s3); } .chain-cards .small-v { font-size: .95rem; } .chain-links { margin-left: 0; } }
.chain-cards .small-v { font-size: var(--fs-md, 1.05rem); }
.chain-full td, .chain-full th { white-space: nowrap; }
.chain-az { columns: 4 170px; column-gap: var(--s5); font-size: var(--fs-sm); } .chain-az a { display: block; padding: 3px 0; }
.only-sm { display: none; } @media (max-width: 560px) { tr.only-sm { display: table-row; } }

/* calculators */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s4); align-items: start; margin-bottom: var(--s6); }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.calc-form { display: grid; gap: var(--s3); }
.calc-field { margin: 0; border: 0; padding: 0; min-width: 0; }
.calc-in { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: #fff; overflow: hidden; }
.calc-in:focus-within { border-color: var(--ink, #0F172A); }
.calc-in .input { border: 0; border-radius: 0; flex: 1; min-width: 0; box-shadow: none; }
.calc-pre, .calc-suf { display: flex; align-items: center; padding: 0 10px; background: #F8FAFC; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.calc-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-seg label { cursor: pointer; } .calc-seg input { position: absolute; opacity: 0; pointer-events: none; }
.calc-seg span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; font-size: var(--fs-sm); font-weight: 600; background: #fff; }
.calc-seg input:checked + span { background: var(--ink, #0F172A); border-color: var(--ink, #0F172A); color: #fff; }
.calc-seg input:focus-visible + span { outline: 2px solid var(--ink, #0F172A); outline-offset: 2px; }
.calc-out { position: sticky; top: 76px; }
@media (max-width: 860px) { .calc-out { position: static; } }
.calc-main { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
.calc-main strong { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 2rem; line-height: 1.15; }
.calc-rows { margin: 0; display: grid; gap: 6px; }
.calc-rows div { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); }
.calc-rows dt { color: var(--muted); } .calc-rows dd { margin: 0; text-align: right; font-weight: 600; }
.calc-rows .pos dd { color: var(--good); } .calc-rows .neg dd { color: var(--bad, #DC2626); }
.calc-note { margin: var(--s3) 0 0; padding: var(--s2) var(--s3); background: #F8FAFC; border-radius: 8px; }
.calc-chart { margin-top: var(--s4); } .calc-chart svg { width: 100%; height: auto; display: block; }
.cg-grid { stroke: #E2E8F0; stroke-width: 1; } .cg-a { fill: #94A3B8; } .cg-b { fill: #16A34A; opacity: .85; }
.cg-t { font-size: 11px; fill: #64748B; text-anchor: middle; }
.key.cg-a-key { background: #94A3B8; } .key.cg-b-key { background: #16A34A; }
.calc-table { margin-top: var(--s4); } .calc-table tr.atm td { background: #F8FAFC; font-weight: 600; }
.calc-share { margin: var(--s3) 0 0; }
.calc-formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: #F8FAFC; padding: var(--s3); border-radius: 8px; }
.calc-more { margin-top: var(--s6); }

/* stocks: market movers */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--s4); margin-top: var(--s3); }
.mm-card h2 a { color: inherit; text-decoration: none; }
.mm-list { list-style: none; padding: 0; margin: 0 0 var(--s3); }
.mm-list li a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.mm-list li:last-child a { border-bottom: 0; }
.mm-name { display: flex; flex-direction: column; min-width: 0; } .mm-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-fig { text-align: right; font-size: var(--fs-sm); white-space: nowrap; }
.mm-table td { vertical-align: middle; } .mm-wrap { background: #fff; border-radius: var(--r-lg, 14px); border: 1px solid var(--line); }
@media (max-width: 560px) { .mm-table th, .mm-table td { padding-left: 6px; padding-right: 6px; } .mm-table td:nth-child(2) strong { font-size: .9rem; } .mm-table .score { transform: scale(.9); } }

/* calculators: tab bar */
.calc-head { margin-bottom: var(--s3); }
.calc-tabs { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: 0 0 var(--s4); padding: var(--s3) var(--s4); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg, 14px); }
.calc-tabgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.calc-tablabel { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.calc-tab { padding: 6px 12px; border-radius: 99px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink, #0F172A); text-decoration: none; border: 1px solid transparent; }
.calc-tab:hover { background: #F1F5F9; }
.calc-tab.on { background: var(--ink, #0F172A); color: #fff; }
@media (max-width: 640px) {
  .calc-tabs { position: relative; flex-wrap: nowrap; overflow-x: auto; gap: var(--s2); padding: var(--s2) var(--s3); -webkit-overflow-scrolling: touch; }
  .calc-tabgroup { flex-wrap: nowrap; } .calc-tab { white-space: nowrap; }
}
