/* Finance Watch: a calm, terminal-inspired look. Dense data, tabular numbers, one accent color.
   Tokens first; components below are grouped by where they appear. */
:root {
  --bg: #07090d; --bg2: #0c1017; --panel: #11161f; --panel2: #161c27; --line: #1f2733; --line2: #2b3544;
  --text: #e9edf3; --text2: #b8c1cf; --muted: #7d889a; --faint: #4b5566;
  --accent: #ffa21f; --accent2: #ffc266; --accent-ink: #1b1100; --link: #64b5ff;
  --up: #2bd47d; --down: #ff5d62; --flat: #8a94a6; --gold: #f2c14e; --hold: #8a94a6;
  --s1: #ffa21f; --s2: #64b5ff; --s3: #2bd47d; --s4: #c08cff; --s5: #ff7ab6; --s6: #4fd1c5; --s7: #f2c14e; --s8: #9aa5b8;
  --heat0: #1a212c; --track: #1e2632; --grid: rgba(255, 255, 255, .06); --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --r: 14px; --r2: 10px; --gut: 14px; --tabh: 64px;
  /* One scale for corners, shadows and glows: every card, bar and chart uses these. */
  --r-xs: 6px; --r-sm: var(--r2); --r-lg: 18px; --r-pill: 999px;
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .35); --shadow-modal: 0 30px 80px rgba(0, 0, 0, .55);
  --glow-soft: 0 0 14px color-mix(in srgb, var(--s2) 14%, transparent); --glow-strong: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent);
  /* Bars (every bar, meter and column): a bright edge in the bar's own color, a glow, and 3D faces. */
  --bar-edge: 55%; --bar-glow: 45%;
  --edge-a: .45; /* the neon line along the top of cards */
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --bg2: #eceef2; --panel: #ffffff; --panel2: #f6f7f9; --line: #e3e6eb; --line2: #d3d8df;
  --text: #0e1420; --text2: #364152; --muted: #677285; --faint: #a3abb8; --accent: #e07800; --accent2: #b45f00; --accent-ink: #fff; --link: #0a66c2;
  --up: #0a9a55; --down: #d93b41; --flat: #6b7585; --gold: #b7860b; --hold: #8a94a6;
  --s1: #e07800; --s2: #2a7de1; --s3: #0a9a55; --s4: #8b5cf6; --s5: #db2777; --s6: #0d9488; --s7: #b7860b; --s8: #6b7585;
  --heat0: #e7eaef; --track: #e6e9ee; --grid: rgba(0, 0, 0, .06); --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .06);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, .14); --shadow-modal: 0 30px 80px rgba(16, 24, 40, .25); --bar-edge: 70%; --bar-glow: 25%; --edge-a: .25;
  color-scheme: light;
}
/* Before the app sets data-theme (theme "system"), the light palette follows the OS. Same values as above. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7; --bg2: #eceef2; --panel: #ffffff; --panel2: #f6f7f9; --line: #e3e6eb; --line2: #d3d8df;
    --text: #0e1420; --text2: #364152; --muted: #677285; --faint: #a3abb8; --accent: #e07800; --accent2: #b45f00; --accent-ink: #fff; --link: #0a66c2;
    --up: #0a9a55; --down: #d93b41; --flat: #6b7585; --gold: #b7860b; --hold: #8a94a6;
    --s1: #e07800; --s2: #2a7de1; --s3: #0a9a55; --s4: #8b5cf6; --s5: #db2777; --s6: #0d9488; --s7: #b7860b; --s8: #6b7585;
    --heat0: #e7eaef; --track: #e6e9ee; --grid: rgba(0, 0, 0, .06); --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .06);
    --shadow-pop: 0 8px 24px rgba(16, 24, 40, .14); --shadow-modal: 0 30px 80px rgba(16, 24, 40, .25); --bar-edge: 70%; --bar-glow: 25%; --edge-a: .25;
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); font-variant-numeric: tabular-nums; overscroll-behavior-y: none; min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0 0 8px; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--flat); } .acc { color: var(--accent); }
.mono { font-family: var(--mono); letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell */
main { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 6px) var(--gut) calc(var(--tabh) + env(safe-area-inset-bottom) + 28px); }
.top { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.top-l { flex: 1; min-width: 0; }
#acct { background: none; border: 0; padding: 0; font-weight: 700; font-size: 15px; color: var(--text); display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acct::after { content: '▾'; color: var(--muted); font-size: 12px; }
#fresh { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fresh.offline { color: var(--gold); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text2); display: grid; place-items: center; font-size: 17px; flex: none; position: relative; }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#ptr { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 50%; margin-left: -16px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; opacity: 0; z-index: 30; color: var(--accent); }
.root-t { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 12px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .tw { display: flex; width: 100%; max-width: 760px; }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
nav.tabs a svg { width: 23px; height: 23px; }
nav.tabs a.active { color: var(--accent); }

/* pushed pages */
#pages .page { position: fixed; inset: 0; z-index: 50; background: var(--bg); transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
#pages .page.in { transform: none; box-shadow: -12px 0 32px rgba(0, 0, 0, .35); }
#pages .page.under { transform: translateX(-22%); }
#pages .page.out { transform: translateX(100%); }
.page-h { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 6px) 10px 6px; flex: none; max-width: 780px; width: 100%; margin: 0 auto; }
.page-h .back { display: flex; align-items: center; gap: 2px; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 4px; }
.page-t { flex: 1; text-align: center; font-weight: 700; opacity: 0; transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-t.show { opacity: 1; }
.page-a { min-width: 60px; display: flex; justify-content: flex-end; }
.page-c { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.page-c > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.page-lt { font-size: 24px; font-weight: 800; letter-spacing: -.02em; padding: 2px var(--gut) 2px; }
.page-lt:empty { display: none; }
.page-st { color: var(--muted); padding: 0 var(--gut) 8px; font-size: 13.5px; }
.page-body { padding: 4px var(--gut) calc(env(safe-area-inset-bottom) + 96px); }

/* ---------- panels & sections */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; box-shadow: var(--shadow); }
.panel.tight { padding: 10px 12px; }
a.panel { display: block; color: var(--text); }
.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.ph h3, .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ph a, .ph button.link { font-size: 13px; font-weight: 600; background: none; border: 0; color: var(--link); padding: 0; white-space: nowrap; }
.ph { flex-wrap: wrap; }
.ph h3 { flex: none; }
.ph .sub { flex: 1 1 220px; text-align: right; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.foot { color: var(--faint); font-size: 11.5px; text-align: center; margin: 18px 0 0; }

/* hero numbers */
.hero { padding: 2px 2px 10px; }
.hero .k { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.hero .v { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 2px 0 4px; }
.hero .c { font-size: 15px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero .c .muted { font-weight: 500; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.pill.up { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); border-color: transparent; }
.pill.down { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); border-color: transparent; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 420px) { .tiles.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .tiles.t3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles + :is(.panel, .dcols, .board, .hero) { margin-top: 12px; }
@media (min-width: 1100px) { .tiles + :is(.panel, .dcols, .board, .hero) { margin-top: 16px; } }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 11px; min-width: 0; color: var(--text); display: block; }
a.tile:active { background: var(--track); }
.tile .k { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
/* With an ⓘ: the label text clips on its own and the ⓘ always stays visible at the top right. */
.tile .k:has(.info-i) { display: flex; align-items: flex-start; gap: 4px; overflow: visible; }
.tile .k .kt { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.tile .k .info-i { margin: 0 -2px 0 auto; }
.tile .v { font-size: 17px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-top: 1px; }
.tile .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* key/value grid (quick data) */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; font-size: 13.5px; }
.kv > div span { color: var(--muted); white-space: nowrap; flex: none; }
.kv > div b { font-weight: 650; white-space: nowrap; text-align: right; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kv.one { grid-template-columns: 1fr; }
@media (max-width: 360px) { .kv { grid-template-columns: 1fr; } }

/* list rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--text); min-width: 0; }
.rows > .row:last-child { border-bottom: 0; }
a.row:active { background: var(--panel2); }
.row .m { flex: 1; min-width: 0; }
.row .m b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; flex: none; }
.row .r b { display: block; font-weight: 650; white-space: nowrap; }
.row .r small { display: block; color: var(--muted); white-space: nowrap; }
.row .chev { color: var(--faint); font-size: 18px; flex: none; }
.row.wrap .m small, .row.wrap .m b { white-space: normal; }
.tsym { font-family: var(--mono); font-weight: 800 !important; letter-spacing: -.01em; }
.sym { font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 4px 6px; border-radius: 7px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); flex: none; min-width: 54px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; }
.spk { width: 60px; height: 26px; flex: none; }
.spk svg { width: 100%; height: 100%; display: block; }
@media (max-width: 360px) { .spk { display: none; } }

/* grade badges */
.grade { --g: var(--hold); display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 6px; border-radius: 8px; font-weight: 800; font-size: 13.5px; color: var(--g); background: color-mix(in srgb, var(--g) 14%, transparent); border: 1px solid color-mix(in srgb, var(--g) 42%, transparent); flex: none; font-family: var(--mono); letter-spacing: -.02em; }
.grade.sig { border-style: dashed; }
.grade.na { --g: var(--faint); font-weight: 600; font-size: 10.5px; }
.grade.lg { min-width: 76px; height: 76px; border-radius: var(--r-lg); font-size: 36px; }
.grade.md { min-width: 48px; height: 40px; border-radius: 11px; font-size: 19px; }
.gscale { display: flex; gap: 2px; margin: 10px 0 4px; }
.gscale span { flex: 1; text-align: center; font-size: 10px; font-weight: 700; color: var(--faint); padding: 4px 0; border-radius: 4px; background: var(--track); font-family: var(--mono); }
.gscale span.on { color: var(--accent-ink); background: var(--g); }
.pillar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pillar:last-child { border-bottom: 0; }
.pillar b { font-weight: 650; font-size: 14px; }
.pillar small { grid-column: 1 / -1; color: var(--muted); }
.pillar .eff { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* stacked counts bar (buy / hold / sell): drawn with the other bars (see "Bars" below) */
.stack-l { display: flex; justify-content: space-between; font-size: 12px; margin-top: 5px; color: var(--muted); }
.stack-l b { color: var(--text); }

/* range (52-week / target) */
.range { position: relative; height: 26px; margin: 4px 0; }
.range .t, .range .f { position: absolute; top: 10px; height: 6px; }
.range .t { left: 0; right: 0; }
.range .mk { position: absolute; top: 4px; width: 3px; height: 18px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.range .mk.acc { background: var(--accent); }
.range-l { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 8px; }

/* chips, segmented controls, buttons */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipsx { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); }
.chipsx::-webkit-scrollbar { display: none; }
/* Inside a panel the row scrolls to the panel's edge, not the page's; on desktop the chips simply wrap. */
.panel .chipsx { margin: 0 -14px; padding: 0 14px; }
@media (min-width: 1100px) { .chipsx, .panel .chipsx { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--text2); white-space: nowrap; }
button.chip { cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; border: 0; background: none; padding: 6px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.seg.sm button { padding: 4px 8px; font-size: 11.5px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.toolbar .seg { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-weight: 650; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tog-btn { border: 1px solid var(--line); background: var(--panel2); color: var(--muted); border-radius: 8px; padding: 5px 8px; font-size: 11.5px; font-weight: 700; }
.tog-btn.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; font-size: 13.5px; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field span { color: var(--text2); }
select, input[type=text], input[type=search], input[type=number] { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font-size: 16px; max-width: 100%; }
input.num { width: 64px; padding: 3px 6px; font-size: 14px; }
.search { position: relative; }
.search input { width: 100%; padding: 11px 12px 11px 36px; border-radius: 12px; }
.search::before { content: '⌕'; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; pointer-events: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.switch-row > span { min-width: 0; }
.switch-row small { display: block; color: var(--muted); }
.tog { position: relative; width: 46px; height: 28px; flex: none; }
.tog input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.tog i { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--track); transition: background .2s; }
.tog i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.tog input:checked + i { background: var(--up); }
.tog input:checked + i::after { transform: translateX(18px); }

/* callouts, empty, skeleton, notes */
.callout { border-radius: var(--r2); padding: 10px 12px; font-size: 13.5px; margin: 0 0 12px; background: var(--panel2); border: 1px solid var(--line); color: var(--text2); }
.callout.warn { border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 8%, var(--panel)); }
.callout.demo { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.loading { display: grid; place-items: center; gap: 10px; padding: 80px 0; color: var(--muted); }
.note { display: block; padding: 10px 12px; border-radius: var(--r2); background: var(--panel2); border: 1px solid var(--line); margin: 0 0 8px; color: var(--text2); font-size: 13.5px; border-left: 3px solid var(--muted); }
.note.warn { border-left-color: var(--gold); } .note.bad { border-left-color: var(--down); } .note.good { border-left-color: var(--up); } .note.info { border-left-color: var(--link); }
.note b { color: var(--text); }
.note .ideas { display: flex; flex-direction: column; margin-top: 6px; }
.src-line { font-size: 11px; color: var(--faint); margin-top: 8px; }
.src-line a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line2); }
details.more > summary { list-style: none; cursor: pointer; color: var(--link); font-weight: 600; font-size: 13.5px; padding: 8px 0 2px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ' ▾'; }
details.more[open] > summary::after { content: ' ▴'; }

/* ---------- charts */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart text { font-size: 10.5px; fill: var(--muted); font-family: inherit; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--line2); stroke-width: 1; }
.chart .ref { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1; }
.chart .reft { fill: var(--muted); font-size: 10px; }
.chart .cur { stroke: var(--text2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .curdot { stroke: var(--panel); stroke-width: 2; }
.chart .lastbg { fill: var(--accent); }
.chart .lastt { fill: var(--accent-ink); font-weight: 700; font-size: 10.5px; }
.chart .mk.buy { fill: var(--up); } .chart .mk.sell { fill: var(--down); } .chart .mk.dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .mkl { stroke: var(--muted); }
.chart .hl { fill: var(--grid); }
.chart-empty { display: grid; place-items: center; height: 160px; color: var(--muted); font-size: 13px; text-align: center; padding: 0 20px; }
.tip { position: absolute; top: -6px; transform: translateY(-100%); pointer-events: none; background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); z-index: 3; }
.tip .sw, .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i.dash { height: 2px; vertical-align: 3px; }
.readout { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); min-height: 18px; margin: 0 0 4px; }
.readout b { color: var(--text); font-weight: 650; }

/* treemap */
.tmap { position: relative; width: 100%; border-radius: var(--r2); overflow: hidden; }
.tm { position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); border-radius: 4px; overflow: hidden; text-align: center; padding: 2px; }
:root[data-theme="light"] .tm { color: #0e1420; text-shadow: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tm { color: #0e1420; text-shadow: none; } }
.tm b { font-family: var(--mono); font-size: 12px; font-weight: 800; }
.tm.huge b { font-size: 15px; }
.tm small { font-size: 11px; opacity: .92; font-weight: 600; }
.heatgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 4px; }
.heatgrid a { border-radius: 7px; padding: 8px 6px; color: var(--text); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.heatgrid b { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heatgrid small { font-size: 12px; font-weight: 650; opacity: .9; }
.heat-leg { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.heat-leg i { flex: 1; height: 5px; border-radius: 4px; background: linear-gradient(90deg, var(--down), var(--heat0), var(--up)); }

/* donut and pie (viz.js donut): filled slices with a bright edge over a blurred copy for the glow */
.dnwrap { display: flex; align-items: center; gap: 16px; }
.donut { position: relative; flex: none; }
.dn-box { position: relative; }
.donut svg { display: block; width: 100%; height: 100%; overflow: visible; transform: scale(.9) rotate(-12deg); opacity: 0; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s; }
.donut.in svg { transform: none; opacity: 1; }
.donut .dn-glow { opacity: .65; pointer-events: none; transition: opacity .25s; }
.donut.focus .dn-glow { opacity: .3; }
.donut .dn-top .dn-s { stroke: color-mix(in srgb, var(--c) var(--bar-edge), #fff); stroke-width: 1; stroke-opacity: .9; stroke-linejoin: round; cursor: pointer; transition: opacity .2s, transform .2s cubic-bezier(.2, .8, .2, 1); }
.donut.focus .dn-top .dn-s:not(.on) { opacity: .4; }
.donut .dn-top .dn-s.on { transform: translate(var(--dx), var(--dy)); }
.dn-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dn-c b { font-size: 18px; } .dn-c small { display: block; max-width: 90px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Pies show the hovered slice in a fixed line under them (no pop-up over the chart). */
.dn-cap { height: 20px; margin-top: 6px; display: flex; justify-content: center; align-items: baseline; gap: 6px; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.dn-cap b { font-family: var(--mono); } .dn-cap small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dn-leg { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.dn-li { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); min-width: 0; }
.dn-li i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dn-li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); }
.dn-li b { font-weight: 650; }
@media (max-width: 460px) { .dnwrap { flex-direction: column; align-items: stretch; } .dnwrap .donut { align-self: center; } }

/* horizontal % bars (ui.js hbars): the bars themselves are drawn in "Bars" below */
.hb { display: flex; flex-direction: column; gap: 10px; }
.hb-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; color: var(--text); font-size: 13px; }
.hb-r .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); }
.hb-r .l small { color: var(--muted); }
.hb-r .v { font-weight: 650; }
.hb-t { grid-column: 1 / -1; position: relative; height: 10px; margin-top: 6px; }
.hb-t em { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--text2); border-radius: 1px; z-index: 1; }

/* rating history columns */
.rhist { display: flex; gap: 4px; align-items: flex-end; }
.rh-c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.rh-bar { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; }
.rh-bar i { display: block; width: 100%; }
.rh-c small { font-size: 10px; color: var(--muted); }
.rh-c b { font-size: 10.5px; color: var(--text2); font-weight: 600; }

/* sentiment bar */
.sbar .sb-t { position: relative; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--down), var(--heat0) 50%, var(--up)); }
.sbar .sb-t i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 3px; background: var(--text); transform: translateX(-50%); }
.sbar .sb-l { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- ticker page */
.tk-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 8px; }
.tk-head .logo { width: 42px; height: 42px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-family: var(--mono); font-weight: 800; color: var(--accent); font-size: 12px; overflow: hidden; }
.tk-head .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tk-id { flex: 1; min-width: 0; }
.tk-id h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.tk-id p { margin: 1px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.tk-chg { font-size: 14.5px; font-weight: 700; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-chg .muted { font-weight: 500; font-size: 12.5px; }
.chart-ctl { display: flex; gap: 6px; align-items: center; margin: 10px 0 6px; flex-wrap: wrap; }
.chart-ctl .seg { flex: 1 1 250px; min-width: 0; }
.chart-ctl .opts { display: flex; gap: 4px; flex: none; }
.gcard { display: flex; gap: 14px; align-items: center; color: var(--text); }
.gcard .gw { flex: 1; min-width: 0; }
.gcard .gw b { display: block; font-size: 17px; font-weight: 750; }
.gcard .gw small { display: block; color: var(--muted); }
.news-i { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.news-i:last-child { border-bottom: 0; }
.news-i b { display: block; font-weight: 650; font-size: 14.5px; line-height: 1.35; }
.news-i small { display: flex; flex-wrap: wrap; gap: 0 8px; color: var(--muted); margin-top: 3px; align-items: center; }
.news-i .tone { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--faint); }
.news-i .tone.up { background: var(--up); } .news-i .tone.down { background: var(--down); }
.news-i p { color: var(--text2); font-size: 13px; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); color: var(--text2); }
.tag.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: right; font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }
.idx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .idx { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.prose p { color: var(--text2); font-size: 14px; }
.learn h2 { font-size: 18px; margin: 4px 0 8px; } .learn p { color: var(--text2); }

/* ---------- AI assistant */
.ai-fab { position: fixed; right: max(16px, calc((100vw - 760px) / 2 + 16px)); bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 14px); z-index: 45; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transition: transform .2s; }
.ai-fab svg { width: 24px; height: 24px; }
.ai-fab:active { transform: scale(.94); }
body.has-page .ai-fab { bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 60; }
body.sheet-open .ai-fab { display: none; }
.ai-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 700; font-size: 13px; }
.ai-btn:disabled { opacity: .6; }
.ai-out { margin-top: 10px; padding: 12px 13px; border-radius: var(--r2); background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; color: var(--text2); }
.ai-out p, .ai-msg p { margin: 0 0 8px; } .ai-out ul, .ai-msg ul { margin: 0 0 8px; padding-left: 18px; } .ai-out li, .ai-msg li { margin: 3px 0; }
.ai-out b, .ai-msg b { color: var(--text); }
.ai-foot { font-size: 11px; color: var(--muted); margin-top: 4px; }
.ai-dots { display: inline-flex; gap: 5px; padding: 4px 0; } .ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aidot 1s ease-in-out infinite; } .ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aidot { 50% { opacity: .25; transform: translateY(-3px); } }
.ai-ctx { font-size: 12px; color: var(--muted); margin: -2px 0 10px; }
.ai-ctx b { color: var(--accent); }
.ai-chat { display: flex; flex-direction: column; gap: 10px; max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; }
.ai-msg { max-width: 90%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text2); }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; } .ai-sugg .chip { white-space: normal; text-align: left; }
.ai-form { display: flex; gap: 8px; margin-top: 12px; } .ai-form input { flex: 1; min-width: 0; border-radius: var(--r-pill); padding: 10px 14px; }
.ai-form .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; flex: none; }

/* ---------- sheets & toasts */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 760px; margin: 0 auto; max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.in .sheet { transform: none; } .sheet-wrap.in .sheet-bg { opacity: 1; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line2); margin: 8px auto 0; flex: none; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 6px; flex: none; }
.sheet-h h3 { font-size: 17px; }
.x-btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--panel2); color: var(--muted); }
.sheet-c { overflow-y: auto; padding: 6px 16px 18px; -webkit-overflow-scrolling: touch; }
.picks { display: flex; flex-direction: column; gap: 6px; }
.pick { text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel2); }
.pick.on { border-color: var(--accent); }
.pick b { display: block; } .pick small { color: var(--muted); }
.checks { display: flex; flex-direction: column; }
.checks label { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.checks label span { flex: 1; min-width: 0; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 80px); transform: translate(-50%, 20px); opacity: 0; transition: all .25s; z-index: 100; background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600; max-width: 88vw; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r2); background: var(--panel); border: 1px solid var(--line); margin: 0 0 12px; font-size: 13px; }
.banner p { flex: 1; margin: 0; }
.banner .x { background: none; border: 0; color: var(--muted); }
.steps { padding-left: 20px; margin: 0; } .steps li { margin: 6px 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--panel2); padding: 1px 5px; border-radius: 5px; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.sdot.ok { background: var(--up); } .sdot.warn { background: var(--gold); } .sdot.bad { background: var(--down); } .sdot.off { background: transparent; border: 1.5px solid var(--muted); }
a.re-btn { text-decoration: none; }
.srow { padding: 9px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.srow small { display: block; color: var(--muted); margin-top: 2px; }
.re-btn { float: right; margin-left: 8px; padding: 3px 9px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: transparent; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 8px; cursor: pointer; }
.re-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.re-btn:disabled { opacity: .5; cursor: progress; }
.subsrc { margin: 8px 0 2px 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.subsrc .srow { padding: 7px 0; }
.warn-t { color: var(--gold); }
/* "✓ BLS" / "✓ 4 sources": a figure confirmed by an independent source */
.ok-t { display: inline-block; margin-left: 4px; font: 700 10.5px/1.4 var(--sans); color: var(--up); letter-spacing: .02em; vertical-align: 1px; white-space: nowrap; }
.bad-t { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--down); }
.ai-check { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.ai-check b { color: var(--up); font-weight: 700; }
.topic { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-left: 4px; }
.tag.ai { border-style: dashed; }
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }

/* ---------- desktop: sidebar navigation, wide canvas, two-column dashboards */
nav.tabs .brand { display: none; }
@media (min-width: 1100px) {
  :root { --side: 228px; --gut: 28px; }
  body { font-size: 14.5px; }
  nav.tabs { top: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line); padding: 18px 12px; background: var(--bg2); backdrop-filter: none; -webkit-backdrop-filter: none; }
  nav.tabs .tw { flex-direction: column; gap: 4px; max-width: none; }
  nav.tabs .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; letter-spacing: -.01em; font-size: 16px; color: var(--text); }
  nav.tabs .brand img { border-radius: 8px; }
  nav.tabs a { flex: none; flex-direction: row; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--text2); }
  nav.tabs a svg { width: 20px; height: 20px; }
  nav.tabs a:hover { background: var(--panel); color: var(--text); }
  nav.tabs a.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
  main { margin-left: var(--side); max-width: none; padding: 18px var(--gut) 60px; }
  main > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
  .root-t { font-size: 30px; }
  .hero .v { font-size: 46px; }
  #pages .page { left: var(--side); }
  #pages .page.in { box-shadow: -1px 0 0 var(--line); }
  #pages .page.under { transform: none; }
  .page-h { max-width: 1336px; padding: 12px var(--gut) 6px; }
  .page-c > * { max-width: 1280px; }
  .page-lt { padding: 2px var(--gut); font-size: 28px; }
  .page-st { padding: 0 var(--gut) 10px; }
  .page-body { padding: 4px var(--gut) 60px; }
  .page-body:not(.has-cols) { max-width: 920px; }
  .dcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
  .dcols .panel { margin-bottom: 16px; }
  .tk-price { font-size: 42px; }
  .tk-chartbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 14px 4px; margin-bottom: 16px; box-shadow: var(--shadow); }
  .tk-chartbox .chart-ctl { margin-top: 8px; }
  .tiles.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .idx { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  a.row:hover, a.tile:hover, .news-i:hover { background: var(--panel2); }
  a.row, .news-i { border-radius: 8px; }
  .grade[data-go]:hover { filter: brightness(1.25); cursor: pointer; }
  .ai-fab { right: 28px; bottom: 28px; }
  body.has-page .ai-fab { bottom: 28px; }
  .toast { bottom: 40px; left: calc(50% + var(--side) / 2); }
  .sheet { max-width: 640px; bottom: auto; top: 50%; border-radius: var(--r-lg); border-bottom: 1px solid var(--line); transform: translateY(-40%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; max-height: 84vh; padding-bottom: 0; }
  .sheet-wrap.in .sheet { transform: translateY(-50%); opacity: 1; }
  .sheet .grab { display: none; }
  #ptr { display: none; }
}
@media (min-width: 1500px) { .dcols { grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1fr); } }

/* ---------- desktop board (ui.js columns): full-width strip + as many columns as fit, cards draggable by ⠿ */
.grip { display: none; }
/* Detail layers (data-depth) only appear when the desktop board has room for them, or in full-screen view. */
[data-depth] { display: none; }
.focus-c [data-depth] { display: block; }
.focus-c .tiles[data-depth] { display: grid; }
@media (min-width: 1100px) {
  /* Screens laid out as a board use the whole monitor width. */
  main > .has-cols, .page:has(.page-body.has-cols) .page-h, .page:has(.page-body.has-cols) .page-c > *, .page-body.has-cols { max-width: none; }
  .board { margin-top: 4px; }
  .board-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 11.5px; color: var(--muted); margin: 0 2px 8px; min-height: 18px; opacity: .55; transition: opacity .2s; }
  .board:hover .board-bar, body.board-dragging .board-bar { opacity: 1; }
  .board-bar b { font-weight: 700; color: var(--text2); }
  .board-reset { background: none; border: 1px solid var(--line2); color: var(--text2); border-radius: 8px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .board-reset:hover { color: var(--accent); border-color: var(--accent); }
  .board-wide { display: flex; flex-direction: column; gap: 16px; }
  .board-wide:not(:empty) { margin-bottom: 16px; }
  .board-cols { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 16px; align-items: start; }
  .board-col { display: flex; flex-direction: column; gap: 16px; min-height: 60px; min-width: 0; }
  .board-wide > .card, .board-col > .card { margin: 0 !important; }
  .card { position: relative; }
  .card .grip { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; margin: -2px 6px -2px -6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: grab; opacity: 0; transition: opacity .15s, background .15s; touch-action: none; }
  .card:hover .grip, .card .grip:focus-visible { opacity: .9; }
  .card .grip:hover { background: var(--panel2); color: var(--text); }
  .card .grip:active { cursor: grabbing; }
  .card-float > .grip { position: absolute; top: 8px; right: 8px; margin: 0; z-index: 2; }
  .card.dragging { box-shadow: 0 18px 48px rgba(0, 0, 0, .45), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); transform: rotate(.5deg); opacity: .96; max-height: 70vh; overflow: hidden; }
  .board-ph { border: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 6%, transparent); }
  body.board-dragging { user-select: none; cursor: grabbing; }
  /* While dragging, empty drop zones show where they are. */
  body.board-dragging .board-wide { min-height: 46px; border-radius: var(--r); outline: 1px dashed var(--line2); outline-offset: 2px; }
  body.board-dragging .board-wide:empty::before { content: 'Drop here for full width'; display: flex; align-items: center; justify-content: center; height: 46px; font-size: 12px; color: var(--muted); }
  body.board-dragging .board-col:empty { outline: 1px dashed var(--line2); border-radius: var(--r); }
  .card .focus-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; margin: -2px -4px -2px 6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 14px; line-height: 1; cursor: zoom-in; opacity: 0; transition: opacity .15s, background .15s; order: 3; }
  .card:hover .focus-btn, .card .focus-btn:focus-visible { opacity: .9; }
  .card .focus-btn:hover { background: var(--panel2); color: var(--accent); }
  .card-float > .focus-btn { position: absolute; top: 8px; right: 34px; z-index: 2; }
  /* Detail layers revealed by fit() when a card has room (data-d = deepest level shown). */
  .card[data-d="1"] [data-depth="1"], .card[data-d="2"] :is([data-depth="1"], [data-depth="2"]), .card[data-d="3"] [data-depth] { display: block; }
  .card[data-d] .tiles[data-depth] { display: grid; }
  /* Elastic lists sized by fit(): clipped ones fade out with a "Show all" button. */
  .card.clipped { overflow: hidden; }
  .card.clipped::after { content: ''; position: absolute; left: 1px; right: 1px; bottom: 1px; height: 64px; border-radius: 0 0 var(--r) var(--r); background: linear-gradient(to bottom, transparent, var(--panel) 70%); pointer-events: none; }
  .card-more { display: none; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line2); background: var(--panel2); color: var(--text2); font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .card-more:hover { color: var(--accent); border-color: var(--accent); }
  .card.clipped > .card-more, .card.expanded > .card-more { display: block; }
  .card.expanded { padding-bottom: 40px; }
  .card.expanded > .card-more::before { content: 'Show less'; }
  .card.expanded > .card-more { font-size: 0; }
  .card.expanded > .card-more::before { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media (forced-colors: active) { .wbar i, .hb-t i, .stack i, .tm { forced-color-adjust: none; } }

/* ---- Money */
.root-sub { margin: -6px 0 14px; color: var(--text2); font-size: 13.5px; }
.root-sub a { color: var(--accent); }
nav.tabs a.side-only { display: none; }
body[data-root="settings"] .gear { color: var(--accent); border-color: var(--accent); }
.nw-leg { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text2); }
.nw-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.nw-leg b { color: var(--text); font-weight: 700; }
.lead { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.pace { position: relative; height: 10px; margin: 8px 0 26px; }
.pace i { position: absolute; left: 0; top: 0; bottom: 0; }
.pace em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 1px; }
.pace span { position: absolute; top: 16px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; border-left: 1px dashed var(--muted); padding-left: 4px; }
.mlogo { width: 30px; height: 30px; border-radius: 8px; flex: none; object-fit: cover; background: var(--panel2, var(--line)); }
.mlogo.mph { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }

/* ---- Intelligence feed */
.intel { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.intel:last-child { border-bottom: 0; }
.intel .ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 14px; background: var(--panel2, var(--line)); }
.intel .ic.up { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }
.intel .ic.down { background: color-mix(in srgb, var(--down) 18%, transparent); color: var(--down); }
.intel .ic.warn { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.intel .m { flex: 1; min-width: 0; }
.intel .m > b { display: block; font-size: 14px; line-height: 1.3; }
.intel .m small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.intel .m p { margin: 4px 0 0; font-size: 12.5px; color: var(--text2); line-height: 1.4; }
.intel .tag { font: 700 10.5px/1 var(--mono); padding: 3px 6px; border-radius: 5px; background: var(--line); color: var(--text2); margin-right: 6px; letter-spacing: .02em; }
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 14px; }
.guide a { display: block; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: inherit; }
.guide a b { display: block; font-size: 13.5px; }
.guide a small { color: var(--muted); font-size: 11.5px; line-height: 1.35; display: block; margin-top: 2px; }
.guide a:hover { border-color: var(--accent); }
.gauge { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.gauge > div { padding: 10px; border-radius: 12px; background: var(--panel2, var(--line)); }
.gauge .k { font-size: 11.5px; color: var(--muted); }
.gauge .v { font: 800 18px/1.2 var(--mono); margin: 2px 0; }
.gauge .s { font-size: 11.5px; color: var(--text2); }
@media (min-width: 1100px) { nav.tabs a.side-only { display: flex; margin-top: auto; } .top .gear { display: none; } nav.tabs .tw { height: 100%; } }
@media (max-width: 600px) { .ph .sub { text-align: left; flex-basis: 100%; } }

.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; flex-wrap: wrap; }
.list-tools:only-child, .list-tools > .mpick:only-child { margin-left: auto; }
.mpick { font-size: 12.5px; padding: 5px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.cash-total { font: 800 24px/1.2 var(--mono); margin: 0 0 6px; }
.chart-sel { font-size: 12.5px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }

/* ---- Ticker page: folding sections */
details.panel.fold > summary { list-style: none; cursor: pointer; margin: 0; align-items: center; -webkit-tap-highlight-color: transparent; }
details.panel.fold > summary::-webkit-details-marker { display: none; }
details.panel.fold > summary::after { content: '›'; flex: none; margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 20px; line-height: 1; transform: rotate(90deg); transition: transform .15s; }
details.panel.fold[open] > summary { margin-bottom: 10px; }
details.panel.fold[open] > summary::after { transform: rotate(-90deg); }
details.panel.fold > summary .sub { flex: 1 1 auto; text-align: right; }
@media (max-width: 600px) { details.panel.fold > summary .sub { flex: 1 1 auto; flex-basis: auto; text-align: right; } }
details.panel.fold:not([open]) { padding-top: 12px; padding-bottom: 12px; }
/* Quick look: a few key facts under a folded section's title; the full section replaces it when opened. */
details.panel.fold > summary:has(.glance) { flex-wrap: wrap; }
details.panel.fold > summary::after { order: 1; }
details.panel.fold > summary .glance { order: 2; flex: 1 0 100%; min-width: 0; margin-top: 10px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
details.panel.fold[open] > summary .glance { display: none; }
.glance .gl-st { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.glance .gl-st > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; min-width: 0; }
.glance .gl-st span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance .gl-st b { display: block; font: 700 14px/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance .gl-ln { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--text2); }
.glance .gl-ln:first-child { margin-top: 0; }
.glance .gl-ln b { color: var(--text); }
.glance .gl-more { display: block; margin-top: 8px; font-size: 12px; color: var(--accent); }

.glance .gl-src, .gl-src { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.ph .glance a { white-space: normal; font-size: inherit; font-weight: inherit; }
.gl-src a { color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); text-underline-offset: 2px; }
.gl-src a:hover { color: var(--accent); }
.one-liner { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--text); }
.one-liner b { font-family: var(--mono); color: var(--accent); }

/* News: tickers named in a story with today's move */
.tag.tkb { cursor: pointer; font-family: var(--mono); font-weight: 700; }
.tag.tkb i { font-style: normal; font-weight: 600; margin-left: 2px; }
.tag.tkb:hover { border-color: var(--accent); }

/* Grade sources button + sheet */
.src-btn { display: block; width: 100%; margin: 12px 0 2px; padding: 9px 12px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 10px; cursor: pointer; }
.src-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.srcs h4 { margin: 16px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.srcs .srow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.srcs .srow:last-child { border-bottom: 0; }
.srcs .srow p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--text2); }
.srcs .slinks { font-size: 12.5px; }

/* Full-screen view of a card (openFocus in ui.js) */
.focus-btn { display: none; }
.focus-wrap { position: fixed; inset: 0; z-index: 950; }
.focus-bg { position: absolute; inset: 0; background: rgba(2, 4, 8, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.focus { position: absolute; inset: 18px; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line2); box-shadow: var(--shadow-modal), 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); opacity: 0; transform: scale(.985); transition: opacity .2s, transform .2s; overflow: hidden; }
.focus-wrap.in .focus-bg, .focus-wrap.in .focus { opacity: 1; transform: none; }
.focus-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.focus-h h2 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.focus-h .x-btn { margin-left: auto; }
.focus-c { flex: 1; overflow: auto; padding: 18px 20px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
@media (min-width: 1100px) { .focus { left: calc(var(--side) + 18px); } .focus-c:has(.focus-more) { grid-template-columns: minmax(380px, 1fr) minmax(0, 1.6fr); } }
.focus-main > .card { margin: 0 !important; height: auto !important; min-height: 0 !important; }
.focus-main .grip, .focus-main .focus-btn { display: none !important; }
.focus-more { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.focus-more .fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.focus-more .fcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; overflow-x: auto; }
.focus-more .fcard h4 { margin: 0 0 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.focus-more .fcard .fv { font: 750 18px/1.3 var(--mono); }
.focus-more table { width: 100%; border-collapse: collapse; font-size: 13px; }
.focus-more th, .focus-more td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.focus-more th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.focus-more td.n { text-align: right; font-family: var(--mono); }
body.focus-on { overflow: hidden; }
.card.focusable { cursor: zoom-in; }
.card.focusable :is(a, button, input, select, summary, label, [data-k]) { cursor: pointer; }
.card.focusable:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line2)); }
.focus-main .card.focusable { cursor: auto; }
.focus-rel { grid-column: 1 / -1; }
.rel-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.rel-a { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 30px 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.rel-a:hover, .rel-a:focus-visible { border-color: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.rel-a small { color: var(--muted); font-size: 12px; }
.rel-go { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--accent); }

/* A chart opened large (charts.js expandable) */
.chart-xp { cursor: zoom-in; }
.chart-x { position: fixed; inset: 0; z-index: 1000; }
.chart-x-bg { position: absolute; inset: 0; background: rgba(2, 4, 8, .75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
.chart-x-box { position: absolute; inset: 6vh 4vw; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-modal), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); padding: 12px 18px 18px; opacity: 0; transform: scale(.985); transition: opacity .18s, transform .18s; }
.chart-x.in .chart-x-bg, .chart-x.in .chart-x-box { opacity: 1; transform: none; }
.chart-x-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.chart-x-h .x-btn { margin-left: auto; }
.chart-x-r { margin: 0 0 8px; flex-wrap: wrap; }
.chart-x-b { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.chart-x-c { min-height: 0; min-width: 0; position: relative; }
.chart-x-s { overflow-y: auto; min-height: 0; padding-right: 2px; display: flex; flex-direction: column; gap: 12px; }
.chart-x-f { margin-top: 8px; }
.cx-sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.cx-sec h5 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cx-sec p { margin: 0 0 6px; color: var(--text2); }
.cx-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cx-f { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); }
.cx-f:first-of-type { border-top: 0; }
.cx-f > span { color: var(--muted); font-size: 12.5px; }
.cx-f > b { text-align: right; font-family: var(--mono); font-size: 14px; }
.cx-f > small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; text-align: right; }
.cx-src { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 900px) { .chart-x-box { overflow-y: auto; } .chart-x-b { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh auto; } .chart-x-s { overflow: visible; } }
@media (max-width: 700px) { .chart-x-box { inset: 10px; } .chart-x-h .small, .chart-x-f { display: none; } }

/* News: developing stories and story sizes (pages/news.js) */
.story { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.story:first-child { border-top: 0; padding-top: 2px; }
.story-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.story-h b { font-size: 15.5px; }
.story-s { margin: 6px 0 4px; color: var(--text2); line-height: 1.45; }
.story-t summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 4px; }
.story-t .rows { margin-top: 4px; }
.story-t .sym { min-width: 92px; font-size: 11px; }
.sz { flex: none; align-self: flex-start; display: inline-block; padding: 2px 8px; margin-right: 8px; border-radius: var(--r-pill); font: 700 10.5px/1.5 var(--sans); letter-spacing: .05em; text-transform: uppercase; border: 1px solid currentColor; }
.story-h .sz { margin-right: 0; align-self: center; }
.sz.huge { color: var(--down); box-shadow: 0 0 12px color-mix(in srgb, var(--down) 45%, transparent); }
.sz.major { color: var(--gold); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 35%, transparent); }
.sz.big { color: var(--accent); }
.sz.notable, .sz.upd { color: var(--muted); }

/* Connections: tiles that lead to the other screens (pages/links.js) */
.links-strip .tiles .tile { position: relative; }
.links-strip .tile .go { position: absolute; right: 10px; bottom: 8px; color: var(--accent); font-size: 13px; }

/* ⓘ: how a figure is worked out, with sources (initInfo in ui.js, text in lib/info.js) */
.info-i { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 15px; height: 15px; margin: 0 0 0 6px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; color: var(--muted); font: italic 700 10px/1 Georgia, 'Times New Roman', serif; cursor: help; vertical-align: 1px; opacity: .75; transition: opacity .15s, color .15s, border-color .15s; }
.info-i:hover, .info-i:focus-visible { opacity: 1; color: var(--accent); border-color: var(--accent); }
.ph .info-i { margin-right: auto; }
.ph h3 + .info-i + :is(a, .sub) { margin-left: 8px; }
.info-pop { position: fixed; z-index: 1001; width: min(340px, calc(100vw - 16px)); padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); font-size: 12.5px; line-height: 1.5; color: var(--text); animation: tip-in .14s ease-out; }
.info-pop[hidden] { display: none; }
.info-pop b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.info-pop p { margin: 0; }
.info-src { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.info-src a { color: var(--accent); }

/* Hover tips (initTips in ui.js) */
.hovertip { position: fixed; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 9px 11px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); font-size: 12.5px; line-height: 1.45; pointer-events: none; animation: tip-in .14s ease-out; }
.hovertip[hidden] { display: none; }
.hovertip p { margin: 0; }
.hovertip small { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } }

/* Tiles: labels and sub-lines wrap to two lines on narrow screens instead of being cut off. */
@media (max-width: 600px) {
  .tile .k:not(:has(.info-i)), .tile .s, .tile .k .kt { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .tile .v { font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
  .tiles.t4 .tile, .tiles.t3 .tile { padding: 9px 10px; }
}

/* AI summary that leads a page: the answer is the content, the button is a quiet toggle. */
.ai-lead { margin: 4px 0 14px; }
.ai-lead .ai-out { margin-top: 8px; }
.ai-btn.auto { font-size: 12px; padding: 4px 10px; opacity: .85; }
@media (max-width: 460px) { .dnwrap { flex-direction: column; align-items: stretch; } .dnwrap .donut { align-self: center; } }

/* ---- Charts: a little more life */
.chart .gl { stroke-dasharray: 2 5; opacity: .75; }
.chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: fw-draw .8s cubic-bezier(.3,.7,.2,1) forwards; }
.chart .area { animation: fw-fade .9s ease-out both; }
.chart .enddot { stroke: var(--panel); stroke-width: 2; }
.chart .endhalo { opacity: .25; transform-box: fill-box; transform-origin: center; animation: fw-pulse 2.2s ease-out infinite; }
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: fw-grow .55s cubic-bezier(.2,.8,.2,1) both; fill-opacity: .92; }
.chart .bar.neg { transform-origin: 50% 0%; }
.chart text { letter-spacing: .01em; }
@keyframes fw-draw { to { stroke-dashoffset: 0; } }
@keyframes fw-fade { from { opacity: 0; } }
@keyframes fw-grow { from { transform: scaleY(0); } }
@keyframes fw-pulse { 0% { transform: scale(.6); opacity: .45; } 70%, 100% { transform: scale(1.9); opacity: 0; } }

/* Grade confidence meter */
.conf { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.conf-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.conf-h b { font: 800 18px var(--mono); color: var(--text); text-transform: none; letter-spacing: 0; }
.conf-h b small { font: 600 12px var(--sans); color: var(--muted); margin-left: 4px; }
.conf-bar { height: 6px; margin: 9px 0 6px; }
.conf-bar i { --c: var(--gold); height: 100%; }
.conf.high .conf-bar i { --c: var(--up); }
.conf.low .conf-bar i { --c: color-mix(in srgb, var(--down) 70%, var(--gold)); }
.conf > small { color: var(--text2); font-size: 12px; line-height: 1.4; display: block; }

/* 3D + interactive charts */
.chart.tilt svg { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.chart .ln3d { opacity: .2; filter: blur(3px); animation: fw-fade 1s ease-out both; }
.chart .ln { filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)) drop-shadow(0 6px 10px color-mix(in srgb, currentColor 40%, transparent)); }
.chart .curdot { filter: drop-shadow(0 0 6px rgba(255,255,255,.45)); }
.chart .rng { fill: color-mix(in srgb, var(--accent) 8%, transparent); stroke: color-mix(in srgb, var(--accent) 40%, transparent); stroke-dasharray: 3 3; stroke-width: 1; }
.rngchip { position: absolute; top: -6px; z-index: 3; pointer-events: none; padding: 5px 9px; border-radius: 10px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line2); box-shadow: var(--shadow-pop); backdrop-filter: blur(6px); font-size: 12px; white-space: nowrap; display: flex; flex-direction: column; gap: 1px; }
.rngchip small { color: var(--muted); font-size: 11px; }
.rngchip b { font-family: var(--mono); font-size: 13.5px; }
.rngchip b.up { color: var(--up); } .rngchip b.down { color: var(--down); }
/* SVG column bars (charts.js renderBars): bright edge on the front face and a glow in the bar's color, like every bar */
.chart g.bar { transition: translate .18s ease-out, filter .18s; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c) var(--bar-glow), transparent)); }
.chart g.bar .face { stroke: color-mix(in srgb, var(--c) var(--bar-edge), #fff); stroke-width: 1; stroke-opacity: .85; }
.chart g.bar .lit { fill: #fff; fill-opacity: .28; }
.chart g.bar .shade { fill: #000; fill-opacity: .38; }
.chart g.bar .gloss { fill: #fff; fill-opacity: .1; }
.chart g.bar.on { translate: 0 -3px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 60%, transparent)) brightness(1.12); }
@media (prefers-reduced-motion: reduce) { .chart.tilt svg { transform: none; } .chart .ln, .chart .ln3d, .chart .area, .chart .bar { animation: none; stroke-dashoffset: 0; } .donut svg { transform: none; opacity: 1; } }
.rngchip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rngchip span b { font-size: 12.5px; margin-left: 4px; }
.chart.ranging .tip { display: none; }

/* ================================================================ Aurora polish */
/* Brand wordmark */
nav.tabs .brand span { font-size: 19px; font-weight: 800; letter-spacing: .02em; background: linear-gradient(100deg, #7cf7c8 0%, #64b5ff 45%, #c08cff 80%, #7cf7c8 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: aur-shift 9s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(100, 181, 255, .25)); }
nav.tabs .brand img { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 18px rgba(100, 181, 255, .25); }
@keyframes aur-shift { 50% { background-position: 100% 0; } }

/* Splash */
#splash { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: #05070b; overflow: hidden; transition: opacity .6s cubic-bezier(.4,0,.2,1), visibility .6s; }
#splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
#splash.done .sp-in { transform: scale(1.06); }
.sp-aur { position: absolute; inset: -10%; filter: blur(48px); opacity: .42; }
.sp-aur i { position: absolute; width: 95%; height: 16%; border-radius: 50%; mix-blend-mode: screen; animation: aur-drift 7s ease-in-out infinite alternate; }
.sp-aur i:nth-child(1) { left: -5%; top: 22%; background: #1fe0a0; }
.sp-aur i:nth-child(2) { right: -10%; top: 32%; background: #3b82f6; animation-delay: -2.5s; animation-duration: 9s; }
.sp-aur i:nth-child(3) { left: 10%; top: 40%; background: #a855f7; animation-delay: -4s; animation-duration: 11s; opacity: .7; }
@keyframes aur-drift { from { transform: translate(-6%, 4%) rotate(-8deg) scaleX(1); } to { transform: translate(8%, -6%) rotate(10deg) scaleX(1.25); } }
.sp-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: transform .6s cubic-bezier(.4,0,.2,1); animation: sp-in .7s cubic-bezier(.2,.8,.2,1) both; }
.sp-in img { border-radius: var(--r-lg); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 40px rgba(100,181,255,.35), 0 18px 40px rgba(0,0,0,.5); animation: sp-float 3.2s ease-in-out infinite; }
.sp-name { font: 800 34px/1 -apple-system, BlinkMacSystemFont, 'SF Pro Display', Inter, 'Segoe UI', sans-serif; letter-spacing: .32em; margin-right: -.32em; text-transform: uppercase; background: linear-gradient(100deg, #7cf7c8, #64b5ff 45%, #c08cff 80%, #7cf7c8); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: aur-shift 4s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(100,181,255,.35)); }
.sp-bar { width: 132px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 6px; }
.sp-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, #7cf7c8, #64b5ff, transparent); box-shadow: 0 0 10px #64b5ff; animation: sp-load 1.15s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes sp-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes sp-float { 50% { transform: translateY(-4px); } }
@keyframes sp-load { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* Skeleton screens */
.skel { position: relative; overflow: hidden; border-radius: var(--r2); background: var(--panel); border: 1px solid var(--line); animation: none; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--s2) 9%, transparent), color-mix(in srgb, #fff 5%, transparent), transparent); animation: sk-sweep 1.5s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes sk-sweep { to { transform: translateX(100%); } }
.skel-page { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.skel-page .sk-k { width: 90px; height: 12px; border-radius: 6px; }
.skel-page .sk-v { width: 210px; height: 40px; border-radius: 10px; }
.skel-page .sk-c { width: 150px; height: 16px; border-radius: 8px; margin-bottom: 4px; }
.skel-page .sk-chart { height: 150px; border-radius: var(--r); }
.skel-page .sk-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .skel-page .sk-tiles { grid-template-columns: repeat(4, 1fr); } }
.skel-page .sk-tiles .skel { height: 58px; }
.skel-page .sk-panel { height: 170px; border-radius: var(--r); }
.skel-page .sk-panel + .sk-panel { height: 120px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--s2); border-right-color: var(--s3); box-shadow: 0 0 18px color-mix(in srgb, var(--s2) 30%, transparent); animation: spin .9s cubic-bezier(.5,.15,.5,.85) infinite; }

/* Screen reveal: cards rise in one after another */
.enter :is(.hero, .tiles, .panel, .root-t, .skel-page) { animation: fw-rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fw-rise { from { opacity: 0; transform: translateY(12px); } }
details.opening > :not(summary) { animation: fw-open .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fw-open { from { opacity: 0; transform: translateY(-4px); } }
summary { transition: color .2s; }

/* Touch & hover feedback */
.btn, .icon-btn, .tile, .seg button, nav.tabs a, .pick, .row, .hb-r, a.panel, .chip { transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease, transform .15s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.btn:active, .icon-btn:active, .tile:active, .seg button:active, .pick:active, a.panel:active { transform: scale(.97); }
nav.tabs a:active svg { transform: scale(.9); }
nav.tabs a svg { transition: transform .2s cubic-bezier(.2,.8,.2,1), filter .3s; }
nav.tabs a.active svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent)); }
.btn.primary { box-shadow: 0 0 0 0 transparent; }
@media (hover: hover) {
  .btn:hover { border-color: color-mix(in srgb, var(--s2) 40%, var(--line2)); box-shadow: 0 0 14px color-mix(in srgb, var(--s2) 14%, transparent); }
  .btn.primary:hover { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); }
  .icon-btn:hover { color: var(--text); border-color: var(--line2); }
  .tile:hover, a.panel:hover { border-color: color-mix(in srgb, var(--s2) 35%, var(--line)); box-shadow: var(--shadow), 0 0 22px color-mix(in srgb, var(--s2) 9%, transparent); }
  .panel:hover { border-color: color-mix(in srgb, var(--s2) 18%, var(--line)); }
}
/* ================================================================ Cards: one look everywhere
   Panels, tiles, the ticker chart box, quick looks, gauges, confidence and chart side cards share the same surface,
   edge and neon top line, on phones and desktops alike (only the layout changes with the screen). */
.panel, .tile, .tk-chartbox, .conf, .gauge > div, .cx-sec, .focus-more .fcard { position: relative; border: 1px solid var(--line); }
.tk-chartbox { background: var(--panel); border-radius: var(--r); padding: 6px 12px 4px; margin-bottom: 12px; box-shadow: var(--shadow); }
.conf, .gauge > div, .cx-sec { border-radius: var(--r-sm); background: var(--panel2); }
.panel { transition: border-color .3s ease, box-shadow .3s ease; }
/* The thin neon line along the top of every card, inside its border so clipped cards keep it. */
:is(.panel, .tile, .tk-chartbox, .conf, .gauge > div, .cx-sec, .focus-more .fcard)::before { content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--s2) 55%, transparent), color-mix(in srgb, var(--s4) 45%, transparent), transparent); opacity: var(--edge-a); pointer-events: none; transition: opacity .3s; }
:is(.panel, .tile, .tk-chartbox):hover::before { opacity: .9; }
.view, .page-body { transition: opacity .2s; }

/* ================================================================ Bars: one look everywhere
   Every bar, meter and column (hbars, holding weights, buy/hold/sell, ranges, confidence, spending pace, rating
   history, usage) is a small glowing 3D block in its own color --c: a gradient face with a bright edge, a lit top and
   a shaded end, over a track with a faint edge. --d sets the depth of the faces (thinner meters get shallower faces). */
:is(.hb-t, .wbar, .stack, .range .t, .conf-bar, .pace, .rh-bar) { background: var(--track); border-radius: 2px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line2) 70%, transparent); }
.wbar { position: relative; height: 4px; margin-top: 7px; --d: 3px; }
.stack { display: flex; height: 8px; gap: 2px; margin-top: 4px; --d: 3px; }
.range .t { --d: 3px; } .conf-bar { position: relative; --d: 3px; } .pace { --d: 4px; } .hb-t { --d: 5px; }
.rh-bar { --d: 4px; border-radius: 3px; }
:is(.hb-t i, .wbar i, .stack i, .range .f, .conf-bar i, .pace i, .rh-bar i) {
  --c: var(--accent); position: relative; display: block; height: 100%; border-radius: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c), #fff 14%), var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) var(--bar-edge), #fff), 0 0 12px color-mix(in srgb, var(--c) var(--bar-glow), transparent), 0 0 3px color-mix(in srgb, var(--c) 60%, transparent);
  transition: width .8s cubic-bezier(.2, .8, .2, 1), filter .2s;
}
:is(.hb-t i, .wbar i, .conf-bar i) { width: 0; }
.range .f { position: absolute; top: 10px; height: 6px; }
/* The 3D faces: a lit top on every bar, a shaded end on the last segment of each. */
:is(.hb-t i, .wbar i, .stack i, .range .f, .conf-bar i, .pace i)::before { content: ''; position: absolute; left: 0; right: 0; top: calc(-1 * var(--d, 4px)); height: var(--d, 4px); background: color-mix(in srgb, var(--c) 70%, #fff); transform: skewX(-45deg); transform-origin: 0 100%; pointer-events: none; }
:is(.hb-t i, .wbar i, .stack i:last-child, .range .f, .conf-bar i, .pace i)::after { content: ''; position: absolute; left: 100%; top: 0; width: var(--d, 4px); height: 100%; background: color-mix(in srgb, var(--c) 55%, #000); transform: skewY(-45deg); transform-origin: 0 0; pointer-events: none; }
/* Rating history columns stand upright: the lit top and the shaded side belong to the whole column. */
.rh-bar { position: relative; }
.rh-bar::before { content: ''; position: absolute; left: 0; right: 0; top: calc(-1 * var(--d)); height: var(--d); background: color-mix(in srgb, var(--text) 40%, transparent); transform: skewX(-45deg); transform-origin: 0 100%; }
.rh-bar::after { content: ''; position: absolute; left: 100%; top: 0; bottom: 0; width: var(--d); background: rgba(0, 0, 0, .35); transform: skewY(-45deg); transform-origin: 0 0; }
.rh-bar i:first-child { border-radius: 0 0 2px 2px; } .rh-bar i:last-child { border-radius: 2px 2px 0 0; }
@media (hover: hover) { .hb-r:hover .hb-t i { filter: brightness(1.18) saturate(1.1); } .hb-r:hover .l { color: var(--text); } }
/* Gauge arcs glow like the bars. */
.gauge-arc { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) var(--bar-glow), transparent)); }

/* ================================================================ Small shared pieces */
.gap-t { margin-top: 10px; } .gap-b { margin-bottom: 12px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 45%, transparent); }
button.btn-row { background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.mood-h { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mood-lab { font-size: 17px; } .mood-when { margin: 2px 0 0; } .mood-note { margin: 6px 0 0; } .mood-chart { height: 90px; margin-top: 6px; }
/* Data checks chip under Home's total (lib/checks.js) */
.ck-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; border: 1px solid; background: color-mix(in srgb, currentColor 8%, transparent); }
.ck-chip.ok { color: var(--up); } .ck-chip.warn { color: var(--gold); } .ck-chip.fail { color: var(--down); box-shadow: 0 0 12px color-mix(in srgb, var(--down) 35%, transparent); }
/* A notification's page (#/n/<id>) */
.note-body { margin: 0; line-height: 1.5; color: var(--text); }
.note-sum { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .enter :is(.hero, .tiles, .panel, .root-t, .skel-page), details.opening > :not(summary), .sp-aur i, .sp-in img, .sp-name, nav.tabs .brand span { animation: none !important; }
  .skel::after { animation-duration: 3s; }
}