/* Alert Manager dashboard: Apple-style light and dark themes */
:root, [data-theme="light"] {
  --bg: #F5F5F7; --card: #FFFFFF; --field: #F5F5F7; --text: #1D1D1F; --text2: #424245; --text3: #6E6E73;
  --hair: rgba(0,0,0,0.07); --header: rgba(255,255,255,0.72); --headerHair: rgba(0,0,0,0.08);
  --seg: rgba(118,118,128,0.12); --segOn: #FFFFFF; --segShadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04);
  --link: #0066CC; --linkHover: #004499; --btn: #0071E3; --btn2: rgba(0,0,0,0.05);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
  --blueBg: rgba(0,113,227,0.10); --selFlash: rgba(0,113,227,0.20); --heroShade: 0 1px 2px rgba(0,0,0,0.08), 0 3px 16px rgba(0,0,0,0.09); --blueTx: #0058B0; --orBg: rgba(255,149,0,0.16); --orTx: #A04100;
  --grayBg: rgba(118,118,128,0.14); --grayTx: #48484A; --greenBg: rgba(52,199,89,0.16); --greenTx: #1B7A35;
  --redBg: rgba(255,59,48,0.12); --redTx: #C4161C; --dotOk: #34C759; --dotWarn: #FF9500; --dotBad: #FF3B30;
  --switchOff: #E9E9EB; --switchOn: #34C759; --bubble: #E9E9EB; --subrow: rgba(118,118,128,0.06);
  --focus: rgba(0,113,227,0.28); color-scheme: light;
}
[data-theme="dark"] {
  --bg: #000000; --card: #1C1C1E; --field: #2C2C2E; --text: #F5F5F7; --text2: #C7C7CC; --text3: #98989D;
  --hair: rgba(255,255,255,0.10); --header: rgba(28,28,30,0.72); --headerHair: rgba(255,255,255,0.10);
  --seg: rgba(118,118,128,0.24); --segOn: #636366; --segShadow: 0 3px 8px rgba(0,0,0,0.3);
  --link: #2997FF; --linkHover: #6CB4FF; --btn: #0071E3; --btn2: rgba(255,255,255,0.12);
  --shadow: 0 0 0 1px rgba(255,255,255,0.07), 0 4px 16px rgba(0,0,0,0.5);
  --blueBg: rgba(10,132,255,0.22); --selFlash: rgba(100,181,255,0.34); --heroShade: 0 1px 2px rgba(0,0,0,0.4), 0 2px 18px rgba(142,142,147,0.20); --blueTx: #64B5FF; --orBg: rgba(255,159,10,0.22); --orTx: #FFB340;
  --grayBg: rgba(118,118,128,0.32); --grayTx: #D1D1D6; --greenBg: rgba(48,209,88,0.22); --greenTx: #5EE07A;
  --redBg: rgba(255,69,58,0.24); --redTx: #FF6961; --dotOk: #30D158; --dotWarn: #FF9F0A; --dotBad: #FF453A;
  --switchOff: #3A3A3C; --switchOn: #30D158; --bubble: #3A3A3C; --subrow: rgba(118,118,128,0.12);
  --focus: rgba(10,132,255,0.45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Desktop mouse/trackpad: the app draws its own snap-back (app.js), so the browser's bounce is turned off to avoid a double bounce. */
@media (hover: hover) and (pointer: fine) { html, body { overscroll-behavior-y: none; } }
/* Phones and tablets: 16 px inputs stop iOS from zooming the page when a field is tapped (and leaving it zoomed).
   The page doesn't pinch-zoom; only the scanner table does (app.js installTableZoom). */
@media (pointer: coarse) {
  html, body { overflow-x: clip; }      /* nothing can widen the page past the screen */
  body { touch-action: pan-x pan-y; }   /* scroll only: no pinch or double-tap zoom on the page */
  input, select, textarea { font-size: 16px !important; }
}
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--linkHover); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text3); }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

#alertsBody, #healthBody, #histBody { display: flex; flex-direction: column; gap: 24px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--header); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--headerHair); padding: 12px 28px; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; font-size: 13px; color: var(--text2); }
.brand { font-weight: 600; font-size: 25.5px; color: var(--text); margin-right: 10px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.brand-icon { width: 39px; height: 39px; flex: none; border-radius: 9px; margin-right: -1px; box-shadow: 0 0 0 0.5px var(--hair); }
.brand .by { display: flex; flex-direction: column; font-size: 11.25px; font-weight: 600; line-height: 1.05; color: var(--text3); letter-spacing: .01em; padding-left: 10px; border-left: 1px solid var(--hair); }
.brand .by span:last-child { padding-left: 12px; position: relative; }
.brand .by .tiny { position: absolute; left: -3px; bottom: 1px; font-size: 7.3px; font-weight: 500; font-style: normal; letter-spacing: 0; }
.login-card .brand { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; gap: 12px; margin: 0; }
.login-card .brand .by { font-size: 12px; padding-left: 12px; }
.login-card .brand .by span:last-child { padding-left: 14px; }
.login-card .brand .by .tiny { font-size: 8px; left: -4px; }
.stat { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dotOk); flex: none; }
.dot.warn { background: var(--dotWarn); } .dot.bad { background: var(--dotBad); } .dot.off { background: var(--text3); }
.badge-dry { padding: 3px 10px; border-radius: 980px; background: var(--orBg); color: var(--orTx); font-weight: 600; font-size: 12px; }
.topbar .right { margin-left: auto; }
.topstats { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 22px; }

/* page */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 28px 60px; display: flex; flex-direction: column; gap: 24px; outline: none; }
.titlebar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.022em; }
h2.section { margin: 8px 0 -12px 4px; font-size: 13px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.01em; }
.back { font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--seg); border-radius: 9px; padding: 2px; }
.seg > a, .seg > button { border: 0; background: transparent; padding: 6px 20px; border-radius: 7px; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; min-height: 30px; display: inline-flex; align-items: center; }
.seg > .on { background: var(--segOn); box-shadow: var(--segShadow); font-weight: 600; }
.seg > button:disabled { opacity: 0.4; cursor: default; }
/* Bots tab: its own pill, butted right up against the section tabs (no gap) */
.titlebar > .seg-bots { margin-left: -16px; }
.seg-bots > a { gap: 7px; color: var(--text2); padding: 6px 16px; }
.seg-bots .robot { color: var(--text3); flex: none; filter: grayscale(1); }
.seg-bots > .on .robot { color: var(--text2); }
.bots-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 320px; color: var(--text3); }
.bots-soon .robot { color: var(--text3); opacity: .55; }
.bots-soon p { margin: 0; font-size: 15px; color: var(--text3); }

/* buttons */
.btn { border: 0; border-radius: 980px; padding: 10px 20px; font-size: 15px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.btn.primary { background: var(--btn); color: #FFFFFF; }
.btn.primary:hover { color: #FFFFFF; filter: brightness(1.08); }
.btn.secondary { background: var(--btn2); color: var(--text); }
.btn.tint { background: var(--blueBg); color: var(--blueTx); }
.btn.small { padding: 7px 16px; font-size: 13px; min-height: 32px; }
.btn.danger { background: var(--redBg); color: var(--redTx); }
.btn.danger:hover { filter: brightness(0.97); }
.stopped { padding: 48px 24px; text-align: center; }
.stopped h1 { margin: 0 0 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link-btn { border: 0; background: transparent; color: var(--link); cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 13px; min-height: 32px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px 8px; border-radius: 8px; min-height: 32px; display: inline-flex; align-items: center; color: var(--text3); }
.ml-auto { margin-left: auto; }

/* cards */
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats .card { padding: 18px 20px; }
.stats .label { font-size: 13px; color: var(--text3); font-weight: 500; }
.stats .value { font-size: 32px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* tables */
.table-card { overflow-x: auto; padding: 6px 0; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text3); font-size: 12px; font-weight: 600; padding: 12px 16px; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--hair); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; }
tr.sub td { background: var(--subrow); color: var(--text2); font-size: 13px; padding-top: 9px; padding-bottom: 9px; border-top: 0; }
td.sym { font-weight: 600; }
.actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.expander { border: 0; background: transparent; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; margin-left: -8px; border-radius: 8px; color: var(--text); }
.expander svg { transition: transform .2s; }
.expander[aria-expanded="true"] svg { transform: rotate(90deg); }
.empty { padding: 40px 20px; text-align: center; color: var(--text3); }
.note { font-size: 12px; color: var(--text3); padding: 0 4px; line-height: 1.45; }

/* pills */
.pill { display: inline-block; padding: 4px 11px; border-radius: 980px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.blue { background: var(--blueBg); color: var(--blueTx); } .pill.orange { background: var(--orBg); color: var(--orTx); }
.pill.gray { background: var(--grayBg); color: var(--grayTx); } .pill.green { background: var(--greenBg); color: var(--greenTx); }
.pill.red { background: var(--redBg); color: var(--redTx); }

/* forms */
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-half { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.block { padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--text2); }
.input, select.input { border: 0; background: var(--field); border-radius: 10px; padding: 11px 14px; font-size: 17px; min-height: 44px; color: var(--text); width: 100%; }
.input.narrow { max-width: 320px; }
.help { font-size: 12px; color: var(--text3); }
.warn-text { font-size: 13px; color: var(--orTx); font-weight: 600; }
.error-text { font-size: 14px; color: var(--redTx); font-weight: 600; }
.row2 { display: flex; flex-wrap: wrap; gap: 16px; } .row2 > * { flex: 1 1 220px; }

/* grouped list rows (Settings style) */
.list { padding: 0 24px; }
.lrow { display: flex; justify-content: space-between; align-items: center; min-height: 52px; font-size: 15px; gap: 16px; }
.lrow + .lrow { border-top: 1px solid var(--hair); }
.lrow .hint { display: block; font-size: 12px; color: var(--text3); }
.lrow.indent { padding-left: 20px; }
.lrow input.inline, .lrow select.inline { border: 0; background: transparent; text-align: right; color: var(--text3); font-size: 15px; min-height: 44px; border-radius: 8px; padding: 0 6px; max-width: 220px; }
.lrow input.inline[type="number"] { width: 110px; }
@media (max-width: 480px) { .lrow > label, .lrow > span:first-child { min-width: 0; } .lrow input.inline, .lrow select.inline { min-width: 0; max-width: 58vw !important; width: auto !important; flex: 0 1 auto; } }
.lrow .ro { color: var(--text3); font-size: 14px; text-align: right; }
.lrow .err { color: var(--redTx); font-size: 12px; display: block; }

/* consent */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0; font-size: 15px; line-height: 1.45; cursor: pointer; }
.consent .hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text3); line-height: 1.5; }
.cb { width: 20px; height: 20px; accent-color: var(--btn); margin: 2px 0 0; flex: none; cursor: pointer; }
.phone-block { padding: 4px 0 18px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--hair); padding-top: 16px; }
.phone-label { font-size: 13px; font-weight: 600; color: var(--text2); }
.phone-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.phone-field { flex: 1 1 240px; min-width: 0; font-size: 17px; padding: 11px 14px; min-height: 46px; border-radius: 10px; border: 1.5px solid var(--text3); background: var(--card); color: var(--text); font-variant-numeric: tabular-nums; }
.phone-field:focus { border-color: var(--btn); outline: none; box-shadow: 0 0 0 4px var(--focus); }
.phone-field:disabled { background: var(--field); border-style: dashed; border-color: var(--hair); color: var(--text3); cursor: not-allowed; }
.phone-field::placeholder { color: var(--text3); }
.consent-status { font-size: 12px; color: var(--text3); }
.consent-status.ok { color: var(--greenTx); } .consent-status.bad { color: var(--orTx); }

/* switch */
.sw { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--switchOff); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: left .2s; }
.sw:checked { background: var(--switchOn); } .sw:checked::after { left: 20px; }
.sw:disabled { opacity: 0.5; cursor: default; }

/* stepper */
.stepper { display: inline-flex; align-items: center; background: var(--field); border-radius: 10px; padding: 3px; }
.stepper button { border: 0; background: transparent; width: 42px; height: 36px; font-size: 20px; cursor: pointer; border-radius: 8px; color: var(--text); }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper .val { min-width: 64px; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ladder preview */
.levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.levels .box { background: var(--field); border-radius: 12px; padding: 12px 14px; }
.levels .head { font-size: 12px; font-weight: 600; color: var(--text3); margin-bottom: 6px; }
.levels .lv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; font-variant-numeric: tabular-nums; }

/* preview panel */
.preview { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.preview h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.cap { font-size: 12px; font-weight: 600; color: var(--text3); }
.bubble { background: var(--bubble); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 15px; line-height: 1.35; max-width: 92%; white-space: pre-line; }
.say { background: var(--field); border-radius: 12px; padding: 12px 14px; font-size: 15px; color: var(--text2); line-height: 1.35; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip { border: 0; background: var(--card); border-radius: 980px; padding: 8px 16px; min-height: 36px; font-size: 13px; font-weight: 500; color: var(--text); box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(0,0,0,0.06); }

/* health */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
.hcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.hcard h2 { margin: 0; font-size: 15px; font-weight: 600; }
.hcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-top: 1px solid var(--hair); padding-top: 8px; }
.kv span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.banner { border-radius: 14px; padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.banner.warn { background: var(--orBg); color: var(--orTx); }
.banner.bad { background: var(--redBg); color: var(--redTx); }
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }

/* legal links */
.legal-footer { max-width: 1240px; margin: -36px auto 0; padding: 0 28px 32px; font-size: 12px; color: var(--text3); display: flex; gap: 14px; flex-wrap: wrap; }
.legal-links { font-size: 12px; color: var(--text3); padding: 0 0 14px 32px; margin-top: -6px; }
.legal-links a, .legal-footer a { color: var(--link); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 980px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--dotBad); color: #FFFFFF; }

/* sign-in page */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 380px; padding: 24px; }
.login-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 32px 32px; text-align: center; }
.login-card h1 { font-size: 28px; }
.login-card p { margin: -6px 0 8px; }
.login-icon img { display: block; border-radius: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 10px 28px rgba(0,0,0,.14); }
.login-field { width: 100%; flex: none; }
.login-field[hidden] { display: none; }
.login-btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-card .error-text { min-height: 20px; }

/* ===================================================================== Dashboard (scanner) */
.page.wide { max-width: 1760px; }
.search { position: relative; display: inline-flex; }
.search input { font: inherit; font-size: 14px; width: 220px; min-height: 34px; padding: 6px 12px 6px 30px; border: 0; border-radius: 9px; background: var(--seg); color: var(--text); outline: none; }
.search input:focus-visible { box-shadow: 0 0 0 3px var(--blueBg); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; stroke: var(--text3); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 -8px; }
.hero h2 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; text-shadow: var(--heroShade); }
.hero p { margin: 4px 0 0; color: var(--text3); font-size: 16px; }
.hero-side { display: flex; align-items: center; gap: 12px; }
.hero .meta { color: var(--text3); font-size: 13px; }
.mkt-pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border-radius: 980px; background: var(--seg); font-size: 19.5px; font-weight: 500; color: var(--text2); }
.mkt-pill .led { width: 12px; height: 12px; border-radius: 50%; background: var(--dotBad); }
.mkt-pill.open { background: var(--greenBg); color: var(--greenTx); }
.mkt-pill.open .led { background: var(--dotOk); box-shadow: 0 0 0 4.5px var(--greenBg); }
.mkt-pill.ext { background: var(--orBg); color: var(--orTx); }
.mkt-pill.ext .led { background: var(--dotWarn); }

/* fold-out cards (About, Price Alerts) */
.fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 20px; cursor: pointer; min-height: 52px; font-size: 15px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary svg { margin-left: auto; color: var(--text3); transition: transform .2s; flex: none; }
.fold[open] > summary svg { transform: rotate(90deg); }
.fold > summary:focus-visible { outline: 3px solid var(--blueBg); outline-offset: -3px; border-radius: 18px; }
.fold-title { font-weight: 600; }
.fold-sum { color: var(--text3); font-size: 13px; }
.fold-body { border-top: 1px solid var(--hair); padding: 6px 20px 16px; }
.welcome .fold-body p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--text2); max-width: 900px; }
.welcome .fold-body .links { font-size: 13px; color: var(--text3); }
.alerts-card .fold-body { padding: 0 8px 4px; }
.arow { display: grid; grid-template-columns: 80px 1fr auto auto 14px; gap: 16px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.arow + .arow { border-top: 1px solid var(--hair); }
.arow:hover { background: var(--seg); }
.arow .sym { font-weight: 600; }
.arow svg { color: var(--text3); }
.fold-foot { display: flex; justify-content: space-between; padding: 10px 12px 8px; font-size: 13px; border-top: 1px solid var(--hair); }
.note.pad { padding: 14px 12px; }

/* scanner table */
.table-zoom-card { position: relative; }
.zoom-reset { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 15; border: 0; border-radius: 980px; padding: 10px 18px; font: 600 14px/1 inherit; font-family: inherit; background: var(--text); color: var(--bg); box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; }
.zoom-reset[hidden] { display: none; }
.table-wrap { position: relative; overflow-x: auto; border-radius: 18px; overscroll-behavior-x: contain; }
table.dash { table-layout: fixed; border-collapse: separate; border-spacing: 0; }   /* width set from the column list (app.js): 1,704 px */
table.dash th, table.dash td { overflow: hidden; text-overflow: ellipsis; }
/* # and Ticker stay put while the table scrolls sideways. Sticky cells are opaque, so row tints and
   flashes are painted on them with an inset shadow instead of a see-through background. */
table.dash .stick { position: sticky; z-index: 2; background-color: var(--card); }
table.dash th.stick { z-index: 3; }
table.dash .s1 { left: 0; }
table.dash .s2 { left: 44px; overflow: visible; }
table.dash .s2::after { content: ""; position: absolute; top: 0; bottom: 0; right: -10px; width: 10px; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(to right, rgba(0,0,0,0.12), transparent); }
[data-theme="dark"] table.dash .s2::after { background: linear-gradient(to right, rgba(0,0,0,0.55), transparent); }
.table-wrap.scrolled table.dash .s2::after { opacity: 1; }
table.dash tbody tr:hover td.stick { box-shadow: inset 0 0 0 100vmax var(--blueBg); }
@keyframes flashUpS { from { box-shadow: inset 0 0 0 100vmax var(--greenBg); } to { box-shadow: inset 0 0 0 100vmax transparent; } }
@keyframes flashDownS { from { box-shadow: inset 0 0 0 100vmax var(--redBg); } to { box-shadow: inset 0 0 0 100vmax transparent; } }
@keyframes selFadeS { from { box-shadow: inset 0 0 0 100vmax var(--selFlash); } to { box-shadow: inset 0 0 0 100vmax transparent; } }
table.dash th { position: sticky; top: 0; background: var(--card); padding: 12px 8px 10px; border-bottom: 1px solid var(--hair); vertical-align: bottom; }
table.dash th.r { text-align: right; }
table.dash th.c, table.dash td.bs { text-align: center; }
table.dash td.bs .bar { margin-left: auto; margin-right: auto; }
table.dash th button { all: unset; cursor: pointer; display: inline-block; color: inherit; font: inherit; }
table.dash th button:hover { color: var(--text); }
table.dash th button:focus-visible { outline: 2px solid var(--blueTx); outline-offset: 2px; border-radius: 4px; }
table.dash th small { display: block; font-weight: 400; font-size: 11px; color: var(--text3); margin-top: 2px; }
table.dash th .arrow { color: var(--blueTx); margin-left: 4px; font-size: 10px; }
table.dash td { padding: 11px 8px; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; border-top: 0; border-bottom: 1px solid var(--hair); }
table.dash tbody tr:last-child td { border-bottom: 0; }
table.dash tbody tr { cursor: pointer; transition: background .15s; }
table.dash tbody tr:hover { background: var(--blueBg); }
/* A newly chosen news ticker lights up a few shades lighter, then fades back to match the other rows over 3 s; the thin edge marker stays. */
@keyframes selFade { from { background: var(--selFlash); } to { background: transparent; } }
table.dash tbody tr.sel-flash td { animation: selFade 3s ease-out var(--sfd, 0ms) both; }
table.dash tbody tr.sel td:first-child::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blueTx); }
table.dash tbody tr:focus-visible { outline: 2px solid var(--blueTx); outline-offset: -2px; }
table.dash td.num { text-align: right; }
table.dash td.ticker { font-weight: 600; font-size: 15px; padding-left: 6px; padding-right: 4px; }
table.dash th.s2 { padding-left: 6px; padding-right: 4px; }
table.dash td.price { font-weight: 600; }
table.dash td.muted, .muted { color: var(--text3); }
table.dash td.liq { font-size: 12px; line-height: 1.45; color: var(--text3); }
table.dash td.liq strong { color: var(--text); font-weight: 600; }
table.dash td.cap { font-weight: 600; }
table.dash td.ticker .tcell { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.bar.none i, .bar.none b { background: transparent; }
.sep { color: var(--text3); margin: 0 5px; }
.pos { color: var(--greenTx); } .neg { color: var(--redTx); }
.chg { display: inline-block; padding: 3px 9px; border-radius: 980px; font-weight: 600; font-size: 13px; }
.chg.up { background: var(--greenBg); color: var(--greenTx); }
.chg.down { background: var(--redBg); color: var(--redTx); }
.chg.flat { background: var(--grayBg); color: var(--grayTx); }
.bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 5px; background: var(--seg); width: 110px; }
.bar i { display: block; background: var(--dotOk); } .bar b { display: block; background: var(--dotBad); flex: 1; }
.lamp { display: inline-block; width: 11.7px; height: 11.7px; border-radius: 50%; vertical-align: 0; margin-left: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.lamp.green { background: var(--dotOk); } .lamp.red { background: var(--dotBad); } .lamp.yellow { background: #FFCC00; }
.lamp.blue { background: #007AFF; } .lamp.white { background: #FFFFFF; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
[data-theme="dark"] .lamp.white { background: #D1D1D6; }
.mv { font-size: 18px; line-height: 1; margin-left: 3px; vertical-align: -1px; }
.mv.up { color: var(--greenTx); } .mv.down { color: var(--redTx); }
@keyframes flashUp { from { background: var(--greenBg); } to { background: transparent; } }
@keyframes flashDown { from { background: var(--redBg); } to { background: transparent; } }
tr.mv-up td { animation: flashUp 3s ease-out var(--mvd, 0ms) both; } tr.mv-down td { animation: flashDown 3s ease-out var(--mvd, 0ms) both; }
@media (prefers-reduced-motion: reduce) { tr.mv-up td, tr.mv-down td, tr.sel-flash td { animation: none; } }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text3); }
.bell:hover { background: var(--seg); color: var(--blueTx); }
.bell.on { color: var(--blueTx); }
.bell .n { position: absolute; top: 1px; right: 0; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--blueTx); color: #fff; font-size: 9px; font-weight: 700; line-height: 14px; }

/* news */
.dash-h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 -10px; }
.news-body { display: grid; grid-template-columns: 200px 1fr; min-height: 300px; overflow: hidden; }
.tick-list { position: relative; border-right: 1px solid var(--hair); max-height: 560px; overflow: auto; padding: 8px; }
.tick-list button { position: relative; display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; font: 500 14px inherit; font-family: inherit; color: var(--text); padding: 8px 12px; border: 0; border-radius: 8px; background: none; cursor: pointer; min-height: 36px; }
.tick-list button:hover { background: var(--seg); }
.tick-list button.has::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blueTx); }
.tick-list button.active { color: var(--blueTx); font-weight: 600; box-shadow: inset 3px 0 0 var(--blueTx); }
.tick-list button.sel-flash { animation: selFade 3s ease-out var(--sfd, 0ms) both; }
@media (prefers-reduced-motion: reduce) { .tick-list button.sel-flash { animation: none; } }
.article { padding: 26px 34px; font-size: 15px; line-height: 1.6; max-width: 860px; min-width: 0; }
.art-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.article h3 { margin: 0 0 2px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.article .sub { color: var(--text3); font-size: 15px; }
.article .heads { margin: 0 0 12px; padding-left: 18px; font-weight: 500; }
.article .summary { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.article .empty-a { color: var(--text3); }
.article .src { margin-top: 18px; font-size: 12px; color: var(--text3); }
.article .src a { display: inline-block; background: var(--seg); color: var(--text2); border-radius: 980px; padding: 3px 10px; margin: 2px 6px 2px 0; text-decoration: none; }
.article .src a:hover { color: var(--blueTx); }
.article .disclaimer { padding: 0; margin-top: 16px; }
@media (max-width: 760px) {
  .news-body { grid-template-columns: 1fr; }
  .tick-list { border-right: 0; border-bottom: 1px solid var(--hair); display: flex; flex-wrap: nowrap; overflow-x: auto; max-height: none; }
  .tick-list button { width: auto; flex: none; }
  .article { padding: 20px; }
  .search input { width: 160px; }
  .arow { grid-template-columns: 64px 1fr auto 14px; } .arow > :nth-child(4) { display: none; }
}

/* About page */
.about-card { padding: 22px 24px 18px; }
.about-card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.about-card p { margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--text2); max-width: 860px; }
a.linkrow { color: var(--text); text-decoration: none; }
a.linkrow:hover span:first-child { color: var(--blueTx); }
a.linkrow .hint { overflow-wrap: anywhere; }
/* sticky-cell versions of the row flashes (keep these after the ordinary ones) */
table.dash tbody tr.mv-up td.stick { animation-name: flashUpS; }
table.dash tbody tr.mv-down td.stick { animation-name: flashDownS; }
table.dash tbody tr.sel-flash td.stick { animation-name: selFadeS; }
@media (prefers-reduced-motion: reduce) { table.dash tbody tr.mv-up td.stick, table.dash tbody tr.mv-down td.stick, table.dash tbody tr.sel-flash td.stick { animation: none; } }
/* tile-style row slide (app.js slideRows): cells glide from their old row position to the new one */
table.dash tbody.sliding td { transition: transform .7s cubic-bezier(.2,.8,.2,1); }
table.dash tbody tr.slide-in td { animation: rowIn .7s ease-out both; }
table.dash tbody tr.slide-up td, table.dash tbody tr.slide-down td { position: relative; background-color: var(--card); }
table.dash tbody tr.slide-down td { z-index: 4; } table.dash tbody tr.slide-down td.stick { z-index: 5; }
table.dash tbody tr.slide-up td { z-index: 6; } table.dash tbody tr.slide-up td.stick { z-index: 7; }
table.dash tbody tr.slide-up td.stick, table.dash tbody tr.slide-down td.stick { position: sticky; }
table.dash tbody tr.slide-up.mv-up td, table.dash tbody tr.slide-down.mv-up td { animation-name: flashUpS; }
table.dash tbody tr.slide-up.mv-down td, table.dash tbody tr.slide-down.mv-down td { animation-name: flashDownS; }
table.dash tbody tr.slide-up.sel-flash td, table.dash tbody tr.slide-down.sel-flash td { animation-name: selFadeS; }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { table.dash tbody.sliding td { transition: none; } table.dash tbody tr.slide-in td { animation: none; } }
@media (max-width: 760px) { .titlebar > .seg-bots { margin-left: 0; } }
