@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff') format('woff'); }
:root {
  color-scheme: dark;
  --bg: #080a09;
  --sidebar: #0b0e0c;
  --card: #111412;
  --elevated: #171b18;
  --border: #2b312d;
  --field-border: #6b746e;
  --hover: #1a1f1c;
  --text: #f5f7f5;
  --text-2: #a5aea8;
  --text-3: #8e9892;
  --accent: #0d8b63;
  --accent-hi: #36c995;
  --accent-deep: #064e3b;
  --accent-soft: rgba(13,139,99,.14);
  --silver: #c8d0cb;
  --on-accent: #ffffff;
  --up: #36c995;
  --up-soft: #0c2219;
  --up-line: #2fbf8c;
  --dn: #f87171;
  --dn-soft: #261212;
  --dn-line: #ef4444;
  --radius: 10px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  /* chart palette, read by QS.col() so charts follow the theme */
  --c-line: #f5f7f5; --c-bench: #8e9892; --c-muted: #a5aea8; --c-tick: #8e9892; --c-grid: #171b18; --c-axis: #2b312d;
  --c-tip-bg: #0b0e0c; --c-tip-border: #2b312d; --c-tip-title: #ffffff; --c-tip-body: #a5aea8; --c-fill: rgba(255,255,255,.05);
  --c-cross: rgba(54,201,149,.45); --c-hl: #36c995; --c-s2: #b4bcb7; --c-s3: #6a736d; --c-s4: #525a55; --c-s5: #d4dad6;
  --c-p1: #f5f7f5; --c-p2: #c8d0cb; --c-p3: #9ba39e; --c-p4: #757d78; --c-p5: #565e59; --c-p6: #3f4642; --c-p7: #2e3431;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f3;
  --sidebar: #fafbfa;
  --card: #ffffff;
  --elevated: #eef2ef;
  --border: #dbe1dd;
  --field-border: #7d8781;
  --hover: #edf1ee;
  --text: #121814;
  --text-2: #46504a;
  --text-3: #5c6660;
  --accent: #0b7a57;
  --accent-hi: #0d8b63;
  --accent-deep: #064e3b;
  --accent-soft: rgba(13,139,99,.10);
  --silver: #5f6a64;
  --on-accent: #ffffff;
  --up: #0a7a52;
  --up-soft: #e3f4ec;
  --up-line: #16a372;
  --dn: #c0272d;
  --dn-soft: #fbe9e9;
  --dn-line: #dc3b3b;
  --c-line: #18201b; --c-bench: #7a857f; --c-muted: #46504a; --c-tick: #66706a; --c-grid: #e9eeea; --c-axis: #d3dad5;
  --c-tip-bg: #121814; --c-tip-border: #121814; --c-tip-title: #ffffff; --c-tip-body: #cdd5d0; --c-fill: rgba(18,24,20,.06);
  --c-cross: rgba(11,122,87,.45); --c-hl: #0b7a57; --c-s2: #4f5a54; --c-s3: #95a09a; --c-s4: #b5bdb8; --c-s5: #2c3530;
  --c-p1: #18201b; --c-p2: #3d4741; --c-p3: #5f6a64; --c-p4: #85908a; --c-p5: #a9b2ad; --c-p6: #c9d0cc; --c-p7: #e2e7e4;
}
/* themed neutrals generated from the original literal colours: dark keeps them (faint emerald tint), light inverts them */
:root {
  --a-rgba00018: rgba(0,0,0,.18);
  --a-rgba00045: rgba(0,0,0,.45);
  --a-rgba0005: rgba(0,0,0,.5);
  --a-rgba0006: rgba(0,0,0,.6);
  --a-rgba0007: rgba(0,0,0,.7);
  --a-rgba00072: rgba(0,0,0,.72);
  --a-rgba1616168: rgba(16,16,16,.8);
  --a-rgba16161686: rgba(16,16,16,.86);
  --a-rgba24424424506: rgba(244,244,245,.06);
  --a-rgba24424424508: rgba(244,244,245,.08);
  --a-rgba24524524525: rgba(245,245,245,.25);
  --a-rgba25525525501: rgba(255,255,255,.01);
  --a-rgba255255255015: rgba(255,255,255,.015);
  --a-rgba25525525502: rgba(255,255,255,.02);
  --a-rgba255255255025: rgba(255,255,255,.025);
  --a-rgba25525525503: rgba(255,255,255,.03);
  --a-rgba255255255035: rgba(255,255,255,.035);
  --a-rgba25525525504: rgba(255,255,255,.04);
  --a-rgba255255255045: rgba(255,255,255,.045);
  --a-rgba25525525505: rgba(255,255,255,.05);
  --a-rgba25525525506: rgba(255,255,255,.06);
  --a-rgba25525525507: rgba(255,255,255,.07);
  --a-rgba25525525508: rgba(255,255,255,.08);
  --a-rgba2552552551: rgba(255,255,255,.1);
  --a-rgba25525525525: rgba(255,255,255,.25);
  --a-rgba25525525535: rgba(255,255,255,.35);
  --a-rgba8887: rgba(8,8,8,.7);
  --a-rgba88882: rgba(8,8,8,.82);
  --a-rgba88888: rgba(8,8,8,.88);
  --a-rgba99925: rgba(9,9,9,.25);
  --a-rgba99992: rgba(9,9,9,.92);
  --g-000000: #000301;
  --g-090909: #090c0a;
  --g-0a0a0a: #0a0d0b;
  --g-0c0c0c: #0c0f0d;
  --g-0e0e0e: #0e110f;
  --g-121212: #121513;
  --g-141414: #141715;
  --g-151515: #151816;
  --g-191919: #191c1a;
  --g-1a1a1a: #1a1d1b;
  --g-1b1b1b: #1b1e1c;
  --g-1c1c1c: #1c1f1d;
  --g-1d1d1d: #1d201e;
  --g-1f1f1f: #1f2220;
  --g-222222: #222523;
  --g-262626: #262927;
  --g-2a2a2a: #2a2d2b;
  --g-333333: #333634;
  --g-3a3a3a: #3a3d3b;
  --g-3d3d3d: #3d403e;
  --g-404040: #404341;
  --g-444444: #444745;
  --g-4a4a4a: #4a4d4b;
  --g-525252: #525553;
  --g-555555: #555856;
  --g-5a5a5a: #5a5d5b;
  --g-5c5c5c: #5c5f5d;
  --g-8a8a8a: #8a8d8b;
  --g-8c8c8c: #8c8f8d;
  --g-a6a6a6: #a6a6a6;
  --g-a8a8a8: #a8a8a8;
  --g-c4c4c4: #c4c4c4;
  --g-cfcfcf: #cfcfcf;
  --g-d0d0d0: #d0d0d0;
  --g-d4d4d4: #d4d4d4;
  --g-d6d6d6: #d6d6d6;
  --g-d8d8d8: #d8d8d8;
  --g-dddddd: #dddddd;
  --g-e2e2e2: #e2e2e2;
  --g-e9e9e9: #e9e9e9;
  --g-f0f0f0: #f0f0f0;
  --g-f4f4f5: #f4f4f5;
  --g-f5f5f5: #f5f5f5;
  --g-f6f6f6: #f6f6f6;
  --g-ffffff: #ffffff;
  --x-1f3b2a: #1c3a2c;
  --x-4a2020: #4a2020;
}
:root[data-theme="light"] {
  --a-rgba00018: rgba(16,24,20,0.054);
  --a-rgba00045: rgba(16,24,20,0.135);
  --a-rgba0005: rgba(16,24,20,0.15);
  --a-rgba0006: rgba(16,24,20,0.18);
  --a-rgba0007: rgba(16,24,20,0.18);
  --a-rgba00072: rgba(16,24,20,0.18);
  --a-rgba1616168: rgba(250,251,250,0.8);
  --a-rgba16161686: rgba(250,251,250,0.86);
  --a-rgba24424424506: rgba(16,24,20,0.036);
  --a-rgba24424424508: rgba(16,24,20,0.048);
  --a-rgba24524524525: rgba(16,24,20,0.15);
  --a-rgba25525525501: rgba(16,24,20,0.006);
  --a-rgba255255255015: rgba(16,24,20,0.009);
  --a-rgba25525525502: rgba(16,24,20,0.012);
  --a-rgba255255255025: rgba(16,24,20,0.015);
  --a-rgba25525525503: rgba(16,24,20,0.018);
  --a-rgba255255255035: rgba(16,24,20,0.021);
  --a-rgba25525525504: rgba(16,24,20,0.024);
  --a-rgba255255255045: rgba(16,24,20,0.027);
  --a-rgba25525525505: rgba(16,24,20,0.03);
  --a-rgba25525525506: rgba(16,24,20,0.036);
  --a-rgba25525525507: rgba(16,24,20,0.042);
  --a-rgba25525525508: rgba(16,24,20,0.048);
  --a-rgba2552552551: rgba(16,24,20,0.06);
  --a-rgba25525525525: rgba(16,24,20,0.15);
  --a-rgba25525525535: rgba(16,24,20,0.21);
  --a-rgba8887: rgba(250,251,250,0.7);
  --a-rgba88882: rgba(250,251,250,0.82);
  --a-rgba88888: rgba(250,251,250,0.88);
  --a-rgba99925: rgba(250,251,250,0.25);
  --a-rgba99992: rgba(250,251,250,0.92);
  --g-000000: #ffffff;
  --g-090909: #f6f7f6;
  --g-0a0a0a: #f5f6f5;
  --g-0c0c0c: #f3f4f3;
  --g-0e0e0e: #f1f2f1;
  --g-121212: #edefee;
  --g-141414: #ebedec;
  --g-151515: #eaeceb;
  --g-191919: #e6e8e7;
  --g-1a1a1a: #e5e7e6;
  --g-1b1b1b: #e4e6e5;
  --g-1c1c1c: #e3e5e4;
  --g-1d1d1d: #e2e4e3;
  --g-1f1f1f: #e0e2e1;
  --g-222222: #dddfde;
  --g-262626: #d9dbda;
  --g-2a2a2a: #d5d7d6;
  --g-333333: #cccecd;
  --g-3a3a3a: #c5c7c6;
  --g-3d3d3d: #c2c4c3;
  --g-404040: #bfc1c0;
  --g-444444: #bbbdbc;
  --g-4a4a4a: #b5b7b6;
  --g-525252: #adafae;
  --g-555555: #aaacab;
  --g-5a5a5a: #a5a7a6;
  --g-5c5c5c: #a3a5a4;
  --g-8a8a8a: #757776;
  --g-8c8c8c: #737574;
  --g-a6a6a6: #595b5a;
  --g-a8a8a8: #575958;
  --g-c4c4c4: #3b3d3c;
  --g-cfcfcf: #303231;
  --g-d0d0d0: #2f3130;
  --g-d4d4d4: #2b2d2c;
  --g-d6d6d6: #292b2a;
  --g-d8d8d8: #272928;
  --g-dddddd: #222423;
  --g-e2e2e2: #1d1f1e;
  --g-e9e9e9: #161817;
  --g-f0f0f0: #0f1110;
  --g-f4f4f5: #0b0d0c;
  --g-f5f5f5: #0a0c0b;
  --g-f6f6f6: #090b0a;
  --g-ffffff: #000201;
  --x-1f3b2a: #b9e5cf;
  --x-4a2020: #f1c4c4;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button { font-family: inherit; color: inherit; }
::selection { background: var(--g-f5f5f5); color: var(--g-090909); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--g-262626); border-radius: 6px; border: 2px solid var(--bg); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 12px;
  position: sticky; top: 0; height: 100vh;
}
.wordmark { font-size: 17px; font-weight: 600; letter-spacing: 0.14em; padding: 4px 10px 22px; display: flex; align-items: center; gap: 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-spacer { flex: 1; }
.nav a {
  text-decoration: none; display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: 8px 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav a svg { width: 16px; height: 16px; flex-shrink: 0; fill: currentColor; stroke: none; }
.nav a svg .d, .tabbar svg .d { opacity: .38; transition: opacity .2s; }
.nav a.active svg .d, .nav a:hover svg .d, .tabbar .active svg .d { opacity: .62; }
.nav a.active svg, .tabbar .active svg { color: var(--accent-hi); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--elevated); color: var(--text); border-color: var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: var(--a-rgba99992); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.search { flex: 1; max-width: 460px; min-width: 0; position: relative; }
.search input {
  width: 100%; background: var(--card); border: 1px solid var(--field-border); border-radius: 6px;
  color: var(--text); font: inherit; padding: 8px 56px 8px 34px; outline: none; text-transform: uppercase;
  transition: border-color .15s;
}
.search input::placeholder { color: var(--text-3); text-transform: none; }
.search input:focus { border-color: var(--g-525252); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; stroke: var(--text-3); fill: none; stroke-width: 1.8; }
.kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--bg); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 0 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.dot.live { background: var(--text); border-color: var(--text); }
.dot.down { background: transparent; border-style: dashed; }

.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; transition: border-color .15s; }
.card:hover { border-color: var(--g-333333); }
.card-title { flex-wrap: wrap; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }
.grid > *, .content, .main { min-width: 0; }
#watchlist, #predTable, #pfTable { overflow-x: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--text); color: var(--g-090909); border: 1px solid var(--text); border-radius: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, opacity .15s, transform .05s;
}
.btn:hover { background: var(--g-ffffff); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--hover); border-color: var(--g-404040); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.icon { padding: 7px 9px; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.spinner { width: 13px; height: 13px; border: 2px solid var(--a-rgba99925); border-top-color: var(--g-090909); border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost .spinner { border-color: var(--a-rgba24524524525); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

input.field, select.field {
  background: var(--bg); border: 1px solid var(--field-border); border-radius: 6px; color: var(--text);
  font: inherit; padding: 8px 12px; outline: none; transition: border-color .15s;
}
::placeholder { color: var(--g-8c8c8c); opacity: 1; }
input.field:focus, select.field:focus { border-color: var(--g-f5f5f5); }
select.field { appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238c8c8c' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input.upper { text-transform: uppercase; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: none; border-right: 1px solid var(--border); padding: 5px 11px; font-size: 12px; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--hover); color: var(--text); }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 14px; height: 14px; border: 1px solid var(--g-525252); border-radius: 3px; background: var(--bg); cursor: pointer; position: relative; }
.toggle input:checked { background: var(--text); border-color: var(--text); }
.toggle input:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid var(--g-090909); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.toggle:hover { color: var(--text); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--g-1a1a1a); font-size: 13px; }
.stat:last-child { border-bottom: none; }
.stat .k { color: var(--text-3); }
.stat .v { font-weight: 500; text-align: right; }
.stat .v.lo { color: var(--text-2); font-weight: 400; }

.chg { font-weight: 500; white-space: nowrap; }
.chg.dn { color: var(--text-2); font-weight: 400; }
.chg.flat { color: var(--text-3); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
td { padding: 11px 10px; border-bottom: 1px solid var(--g-1a1a1a); font-size: 13px; vertical-align: middle; }
th.r, td.r { text-align: right; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; transition: background .12s; }
tbody tr.clickable:hover { background: var(--hover); }
td .sym { font-weight: 600; }
td .nm { color: var(--text-3); font-size: 12px; }
tr.detail td { background: var(--g-0e0e0e); padding: 16px 20px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 3px 9px; border-radius: 4px; border: 1px solid var(--text-3); color: var(--text-2); }
.badge.bull { background: var(--text); color: var(--g-090909); border-color: var(--text); }
.badge.bear { background: transparent; color: var(--text); border: 1px solid var(--text); }
.badge.neut { border-style: dashed; }

.empty { color: var(--text-3); font-size: 13px; padding: 28px 0; text-align: center; }
.err { border: 1px solid var(--g-525252); border-left: 3px solid var(--text); background: var(--card); padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; display: none; }
.err.show { display: block; }
.muted { color: var(--text-3); }
.spark { display: block; }

/* ---------- Dashboard ---------- */
.idx-name { color: var(--text-2); font-size: 13px; }
.idx-price { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 2px; }
.idx-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.brief { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.brief b { color: var(--text); font-weight: 500; }

/* ---------- Analysis ---------- */
.verdict { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.v-ticker { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.v-price { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.v-price strong { font-size: 20px; font-weight: 500; }
.v-right { text-align: right; }
.conf { color: var(--text-3); font-size: 12px; margin-top: 8px; letter-spacing: .04em; }
.bar-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.bar-row .lbl { width: 46px; font-size: 12px; color: var(--text-2); letter-spacing: .04em; }
.bar-row .pct { width: 46px; text-align: right; font-weight: 600; }
.track { flex: 1; height: 6px; background: var(--g-1c1c1c); border-radius: 3px; overflow: hidden; position: relative; }
.fill { height: 100%; width: 0; transition: width .9s cubic-bezier(.16,1,.3,1); border-radius: 3px; }
.fill.up { background: var(--text); }
.fill.dn { background: repeating-linear-gradient(135deg, var(--g-8a8a8a) 0 3px, var(--g-3a3a3a) 3px 6px); }

.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 130px; }
.chart-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.subchart { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--g-1a1a1a); }
.subchart .lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }

.factors { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.factors li { display: flex; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.factors li span.m { font-family: var(--mono); color: var(--text); flex-shrink: 0; width: 12px; }

.score-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.score-row .k { width: 92px; font-size: 12px; color: var(--text-2); }
.score-track { flex: 1; height: 6px; background: var(--g-1c1c1c); border-radius: 3px; position: relative; }
.score-track::before { content: ''; position: absolute; left: 50%; top: -3px; width: 1px; height: 12px; background: var(--g-404040); }
.score-fill { position: absolute; height: 100%; border-radius: 3px; transition: all .9s cubic-bezier(.16,1,.3,1); }
.score-fill.pos { background: var(--text); }
.score-fill.neg { background: repeating-linear-gradient(135deg, var(--g-8a8a8a) 0 3px, var(--g-3a3a3a) 3px 6px); }
.score-row .n { width: 40px; text-align: right; font-size: 12px; font-weight: 500; }

/* ---------- News ---------- */
.news-item { padding: 14px 0; border-bottom: 1px solid var(--g-1a1a1a); }
.news-item:last-child { border-bottom: none; }
.news-item a, .news-item .t { color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; line-height: 1.45; }
.news-item a:hover { text-decoration: underline; text-underline-offset: 3px; }
.news-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.big-num { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; }

/* ---------- Portfolio ---------- */
.alloc { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 8px 0 14px; }
.alloc div { height: 100%; min-width: 3px; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 9px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend .w { margin-left: auto; color: var(--text-2); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.x { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.x:hover { color: var(--text); background: var(--hover); }

.soon { text-align: center; padding: 64px 24px; }
.soon h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.soon p { color: var(--text-3); max-width: 480px; margin: 0 auto; font-size: 13px; }


.screen-layout { display: grid; grid-template-columns: 270px 1fr; gap: 14px; align-items: start; }
.filters { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.filters .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters input.field, .filters select.field { width: 100%; }
.strat { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--g-1a1a1a); font-size: 13px; }
.strat:last-child { border-bottom: none; }
.strat button.name { flex: 1; text-align: left; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 2px 0; }
.strat button.name:hover { color: var(--text); }
.lab-note { font-size: 12px; color: var(--text-3); line-height: 1.7; }
.lab-note li { margin-left: 16px; }
tr.best td { background: var(--g-141414); }
.lg { display: inline-block; width: 22px; height: 0; border-top-width: 2px; border-top-style: solid; vertical-align: middle; margin-right: 8px; }
@media (max-width: 980px) { .screen-layout { grid-template-columns: 1fr; } .filters { position: static; } }

.disclaimer { color: var(--text-3); font-size: 12px; text-align: center; padding: 26px 0 8px; }

@media (max-width: 980px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .g-main, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 56px 1fr; }
  .sidebar { padding: 16px 8px; }
  .nav a span { display: none; }
  .sidebar .wordmark span { font-size: 11px; letter-spacing: .1em; }   /* the narrow rail still fits the word */
  .nav a { justify-content: center; padding: 10px; }
  .wordmark { justify-content: center; padding-left: 0; padding-right: 0; }
  .content { padding: 18px 14px; }
  .topbar { padding: 10px 14px; }
  .g2, .g4 { grid-template-columns: 1fr; }
  .app { overflow-x: hidden; }
  .status span, .wl-txt { display: none; }
}
/* ===================== Multi-page additions ===================== */
a { color: inherit; }
a.wordmark { color: var(--text); text-decoration: none; }
:focus-visible { border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--g-090909); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.top-right a.btn { text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.hide { display: none !important; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.sm-t { font-size: 12px; } .muted-2 { color: var(--text-2); }
.page-head h1 + .sub { max-width: 760px; }
.disclaimer-block { color: var(--text-3); font-size: 12px; line-height: 1.7; border-top: 1px solid var(--border); margin-top: 36px; padding: 18px 0 6px; max-width: 900px; }
.disclaimer-block b { color: var(--text-2); font-weight: 500; }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--g-525252); cursor: pointer; background: none; border: none; font: inherit; padding: 0; }
.link:hover { text-decoration-color: var(--text); }
a.sym, .sym-link { color: var(--text); text-decoration: none; font-weight: 600; }
a.sym:hover, .sym-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* banners & states */
.banner { border: 1px solid var(--border); border-left: 3px solid var(--text-2); background: var(--card); padding: 12px 16px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.banner b { color: var(--text); font-weight: 500; }
.banner.warn { border-left-color: var(--text); }
.banner .row { margin-top: 8px; }
.progress { height: 6px; background: var(--g-1c1c1c); border-radius: 3px; overflow: hidden; margin: 10px 0 6px; }
.progress > i { display: block; height: 100%; background: var(--text); border-radius: 3px; transition: width .4s; }
.skeleton { background: linear-gradient(90deg, var(--g-151515), var(--g-1d1d1d), var(--g-151515)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state { text-align: center; padding: 36px 16px; color: var(--text-3); font-size: 13px; }
.state h3 { color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.state .btn { margin-top: 12px; }

/* chips, pills, tabs */
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--bg); transition: background .12s, border-color .12s; }
a.chip:hover, button.chip:hover { background: var(--hover); border-color: var(--g-525252); }
.chip.on { background: var(--text); color: var(--g-090909); border-color: var(--text); }
.chip.plain { font-weight: 400; color: var(--text-2); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--g-525252); color: var(--text-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 9px 14px; font-size: 13px; color: var(--text-2); cursor: pointer; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs .count { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.sent { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--text-3); color: var(--text-2); white-space: nowrap; }
.sent.pos { background: var(--text); color: var(--g-090909); border-color: var(--text); }
.sent.neg { color: var(--text); border-color: var(--text); }
.sent.mix { border-style: dashed; }
.sent.neu { color: var(--text-3); }

/* news cards */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; }
.news-card:hover { border-color: var(--g-525252); background: var(--g-141414); }
.nc-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-3); }
.nc-pub { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.nc-title { background: none; border: none; text-align: left; font: inherit; font-weight: 500; font-size: 14.5px; line-height: 1.45; color: var(--text); cursor: pointer; padding: 0; }
button.nc-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.nc-sum { font-size: 12.5px; color: var(--text-3); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.nc-foot .grow { flex: 1; }
.bm { background: none; border: 1px solid transparent; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 4px; }
.bm:hover { color: var(--text); background: var(--hover); }
.bm[aria-pressed="true"] { color: var(--text); }

/* modal */
.modal-back { position: fixed; inset: 0; background: var(--a-rgba00072); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--g-333333); border-radius: 10px; width: 100%; max-width: 720px; padding: 22px 24px 20px; box-shadow: 0 20px 60px var(--a-rgba0006); position: relative; min-width: 0; }
.modal h2 { font-size: 20px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; margin: 6px 0 12px; padding-right: 36px; }
.modal .m-close { position: absolute; right: 14px; top: 14px; }
.modal .m-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.modal h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 500; margin: 20px 0 8px; }
.modal p { color: var(--text-2); line-height: 1.7; font-size: 14px; }
.modal .m-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.modal .m-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--g-1a1a1a); }
.modal table td, .modal table th { padding: 8px 8px; }
.impact-note { font-size: 12px; color: var(--text-3); line-height: 1.6; margin-top: 8px; }
body.modal-open { overflow: hidden; }

/* filters bar */
.filterbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.filterbar label, .lbl-f { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.filterbar input.field, .filterbar select.field { width: 100%; }
.filterbar .span2 { grid-column: span 2; }
.bar-split { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* alpha candidate cards */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.cand { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cand:hover { border-color: var(--g-404040); }
.cand-head { display: flex; justify-content: space-between; gap: 12px; }
.cand-head .tk { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.cand-head .tk:hover { text-decoration: underline; text-underline-offset: 3px; }
.cand .nm { color: var(--text-3); font-size: 12.5px; }
.cand .px { text-align: right; font-weight: 500; font-size: 16px; }
.cand .px small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.est { border: 1px solid var(--g-1f1f1f); background: var(--g-0e0e0e); border-radius: 6px; padding: 10px 12px; }
.est .t { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.est .trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.est .trio div { min-width: 0; }
.est .trio .k { font-size: 11px; color: var(--text-3); }
.est .trio .v { font-size: 16px; font-weight: 600; }
.est .range { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.est .insuff { font-size: 12.5px; color: var(--text-2); }
.two-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-box { border: 1px solid var(--g-1f1f1f); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.score-box .k { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.score-box .big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.score-box .big small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.score-box .hint { font-size: 11px; color: var(--text-3); line-height: 1.4; margin-top: 2px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; font-size: 12px; }
.mini-stats .k { color: var(--text-3); display: block; font-size: 11px; }
.reasons { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.reasons h4 { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.reasons ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.reasons li { display: flex; gap: 8px; }
.reasons li::before { content: attr(data-m); font-family: var(--mono); color: var(--text); flex-shrink: 0; width: 10px; }
.cand-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; align-items: center; }
.cand-actions a.btn { text-decoration: none; }
.pct-bar { height: 6px; background: var(--g-1c1c1c); border-radius: 3px; position: relative; margin-top: 6px; }
.pct-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--text); }
.view-tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--text-3); color: var(--text-2); }
.view-tag.out { background: var(--text); color: var(--g-090909); border-color: var(--text); }
.view-tag.under { color: var(--text); border-color: var(--text); }
.cmp-tray { position: sticky; bottom: 12px; z-index: 30; background: var(--g-141414); border: 1px solid var(--g-404040); border-radius: 8px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; box-shadow: 0 8px 30px var(--a-rgba0005); }
.cov { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cov .cell { border: 1px solid var(--g-1f1f1f); border-radius: 6px; padding: 10px 12px; }
.cov .cell .k { font-size: 11px; color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; }
.cov .cell .v { font-size: 20px; font-weight: 600; }
.cov .cell .s { font-size: 11.5px; color: var(--text-3); }
.dec-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 6px 0 0; border-bottom: 1px solid var(--border); position: relative; }
.dec-chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; }
.dec-chart .bar { width: 100%; background: var(--text); border-radius: 3px 3px 0 0; min-height: 1px; }
.dec-chart .bar.neg { background: repeating-linear-gradient(135deg, var(--g-8a8a8a) 0 3px, var(--g-3a3a3a) 3px 6px); }
.dec-labels { display: flex; gap: 6px; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.dec-labels span { flex: 1; text-align: center; }
details.fold { border: 1px solid var(--border); border-radius: 8px; background: var(--card); margin-bottom: 10px; }
details.fold > summary { cursor: pointer; padding: 14px 18px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; color: var(--text-3); font-family: var(--mono); }
details.fold[open] > summary::after { content: '−'; }
details.fold > summary:hover { background: var(--g-141414); border-radius: 8px; }
details.fold .body { padding: 0 18px 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
details.fold .body h4 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 4px; font-weight: 500; }
.learn-cat { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 10px; }
.legend-inline { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.table-wrap { overflow-x: auto; }
tr.sel td { background: var(--g-151515); }
.kpi { border: 1px solid var(--g-1f1f1f); border-radius: 6px; padding: 10px 12px; }
.kpi .k { font-size: 11px; color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; }
.kpi .v { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.kpi .s { font-size: 11.5px; color: var(--text-3); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sim-tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; border: 1px solid var(--text); padding: 2px 8px; border-radius: 4px; }
.bm-sec { color: var(--text-3); }
@media (max-width: 860px) {
  .nav a { padding: 10px; }
  .modal { padding: 18px 16px; }
  .cand-grid { grid-template-columns: 1fr; }
  .filterbar .span2 { grid-column: span 1; }
  .est .trio .v { font-size: 14px; }
  .topbar .top-right .btn.ghost.sm .wl-txt { display: none; }
}

/* ===================== Accounts, legal pages, consent, errors ===================== */
.top-right .acct { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.top-right form { display: inline; }
.flash { margin-bottom: 14px; }
.flash.ok { border-left-color: var(--text); }
.auth-wrap { max-width: 440px; margin: 24px auto 0; }
.auth-wrap.wide { max-width: 640px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card .sub { margin-bottom: 18px; }
.fld { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 14px; }
.fld > div { width: 100%; }
.fld label, .fld .lbl { font-size: 12.5px; font-weight: 500; color: var(--text-2); text-transform: none; letter-spacing: 0; }
.fld input.field { width: 100%; }
.fld .help { font-size: 12px; color: var(--text-3); }
.fld .ferr { font-size: 12.5px; color: var(--text); display: none; }
.fld .ferr::before { content: '\26A0\00a0'; }
.fld.bad .ferr, .fld .ferr.show { display: block; }
.fld.bad input.field { border-color: var(--text); border-width: 1.5px; }
.pw-wrap { position: relative; }
.pw-wrap input.field { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-2); font-size: 12px; padding: 4px 8px; cursor: pointer; border-radius: 4px; }
.pw-toggle:hover { color: var(--text); background: var(--hover); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--g-f5f5f5); flex-shrink: 0; }
.check a { color: var(--text); }
.auth-wrap .btn.block { width: 100%; padding: 10px 16px; font-size: 14px; }
.auth-alt { margin-top: 16px; font-size: 13px; color: var(--text-3); text-align: center; line-height: 1.8; }
.auth-alt a { color: var(--text); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.meter { height: 4px; background: var(--g-1c1c1c); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--text-3); transition: width .2s; }
.meter.s2 i { background: var(--text-2); } .meter.s3 i { background: var(--text); }
.acct-list .stat .v { word-break: break-all; }
.panel-details { border-top: 1px solid var(--border); padding: 14px 0 0; margin-top: 14px; }
.panel-details summary { cursor: pointer; font-size: 13.5px; font-weight: 500; list-style: none; }
.panel-details summary::-webkit-details-marker { display: none; }
.panel-details summary::after { content: '+'; float: right; color: var(--text-3); }
.panel-details[open] summary::after { content: '\2212'; }
.panel-details form { margin-top: 14px; }
.danger-zone { border-color: var(--g-525252); }
.hero-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 18px 22px; margin-bottom: 18px; }
.hero-cta h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.hero-cta p { color: var(--text-2); font-size: 13px; max-width: 620px; line-height: 1.6; }
.hero-cta .btn { padding: 10px 20px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.locked { text-align: center; padding: 22px 14px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.locked .btn { margin-top: 10px; text-decoration: none; }
.legal { max-width: 760px; }
.legal h2 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--text-2); font-size: 14px; line-height: 1.75; margin-bottom: 10px; }
.legal ul { padding-left: 20px; margin-bottom: 10px; }
.legal a { color: var(--text); }
.legal table { margin: 10px 0 16px; }
.legal th, .legal td { font-size: 12.5px; vertical-align: top; }
.legal td { color: var(--text-2); }
.legal-links { margin-top: 10px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.legal-links a, .legal-links button { color: var(--text-2); font-size: 12px; background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-family: inherit; }
.legal-links a:hover, .legal-links button:hover { color: var(--text); }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 640px; margin: 0 auto; background: var(--elevated); border: 1px solid var(--g-5c5c5c); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 10px 40px var(--a-rgba0006); }
.consent[hidden] { display: none; }
.consent p { font-size: 13px; line-height: 1.6; color: var(--text-2); margin-bottom: 12px; }
.consent p a { color: var(--text); }
.consent .row { gap: 8px; }
.err-page { max-width: 520px; margin: 60px auto; text-align: center; }
.err-page .code { font-size: 54px; font-weight: 600; letter-spacing: -0.04em; color: var(--text-3); line-height: 1; margin-bottom: 14px; }
.err-page h1 { margin-bottom: 8px; }
.err-page p { color: var(--text-2); margin-bottom: 18px; line-height: 1.7; }
.err-page .row { justify-content: center; }
.err-page .btn { text-decoration: none; }
@media (max-width: 860px) {
  .top-right .acct { display: none; }
  .hero-cta { padding: 16px; }
  .hero-cta .btn { width: 100%; }
  .auth-wrap { margin-top: 8px; }
  .consent { left: 10px; right: 10px; bottom: 10px; }
  .consent .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

a.btn { text-decoration: none; }
.check, .check span { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* ---- score explanations ---- */
.why { font-size: 13px; }
.why-sum { color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.cbar { display: inline-block; position: relative; width: 70px; height: 8px; margin-left: 8px; vertical-align: middle; background: var(--g-1a1a1a); border-radius: 2px; }
.cbar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--g-555555); }
.cbar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.cbar i.pos { background: var(--text); }
.cbar i.neg { background: var(--g-8c8c8c); }
.why-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.why-list li { display: flex; gap: 8px; color: var(--text-2); line-height: 1.5; }
.why-list li::before { content: attr(data-m); color: var(--text); width: 10px; flex: none; }
.why-warn { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--g-3a3a3a); border-radius: 8px; color: var(--text-2); line-height: 1.6; }
.why-d { margin-top: 10px; border-top: 1px solid var(--g-222222); padding-top: 8px; }
.why-d summary { cursor: pointer; color: var(--text); font-weight: 500; padding: 4px 0; }
.why-help p, .why-limits li { color: var(--text-2); line-height: 1.65; margin: 6px 0; }
.why-limits { padding-left: 18px; }

.big-n { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0; }

/* Portfolio grade + paper game */
.grade { margin-top: 14px; }
.gscore { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.gletter { width: 72px; height: 72px; border-radius: 12px; border: 1.5px solid var(--text); display: grid; place-items: center; font-size: 38px; font-weight: 700; flex: none; }
.gcat { border-top: 1px solid var(--border); }
.gcat > summary { display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; list-style: none; }
.gcat > summary::-webkit-details-marker { display: none; }
.gname { flex: 0 0 190px; font-weight: 500; }
.gbar { flex: 1; height: 6px; background: var(--g-1c1c1c); border-radius: 3px; overflow: hidden; }
.gbar i { display: block; height: 100%; background: var(--text); }
.gpts { flex: 0 0 120px; text-align: right; font-size: 12px; color: var(--text-2); }
.gitems { list-style: none; margin: 0 0 12px; padding: 0 0 0 4px; }
.gitems li { padding: 8px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.gitems li.na { opacity: .75; }
.gitems p { margin: 4px 0 0; color: var(--text-2); }
.gi-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gsug { padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.gsug:first-of-type { border-top: none; }
.gsug h4 { margin: 0 0 6px; font-size: 14px; }
.gsug p { margin: 4px 0; color: var(--text-2); }
.form-col { display: flex; flex-direction: column; gap: 12px; }
.form-col label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.chart-box { position: relative; height: 280px; }
.side-buy { color: var(--text); } .side-sell { color: var(--text-2); }
@media (max-width: 700px) { .gname { flex-basis: 110px; } .gpts { flex-basis: 80px; } .gletter { width: 56px; height: 56px; font-size: 30px; } }
.hz { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.hz-top { display: flex; justify-content: space-between; align-items: flex-start; }

/* Example portfolios */
.sec-h { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 22px 0 10px; }
.why-cell { max-width: 320px; color: var(--text-2); }

/* ===================== VEXA monochrome system =====================
   Black/white/charcoal identity. Green and red only carry market direction.
   Motion: transform/opacity only, 120–320ms UI, longer only for first-load reveals. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .14s ease-in both; }
::view-transition-new(root) { animation: vt-in .22s cubic-bezier(.2,.7,.2,1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

.num, .idx-price, .big, .big-num, .big-n, .kpi .v, .cov .cell .v, td.r { font-variant-numeric: tabular-nums; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.sub { font-size: 13.5px; margin-top: 4px; }

/* shell */
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); }
.wordmark { letter-spacing: .22em; font-weight: 600; }
.nav a { position: relative; font-weight: 500; border: 1px solid transparent; transition: background .18s, color .18s, border-color .18s; }
.nav a::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--text); transform: scaleY(0); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.nav a.active { background: var(--elevated); color: var(--text); border-color: var(--border); }
.nav a.active::before { transform: scaleY(1); }
.topbar { background: var(--a-rgba88882); backdrop-filter: saturate(140%) blur(10px); }
.search input { background: var(--card); border-radius: 8px; transition: border-color .18s, box-shadow .18s; }
.search input:focus { border-color: var(--g-a6a6a6); box-shadow: 0 0 0 3px var(--a-rgba24424424508); }
.dot.live { background: var(--up-line); border-color: var(--up-line); box-shadow: 0 0 0 3px rgba(34,197,94,.15); }

/* cards */
.card { border-radius: var(--radius); background: linear-gradient(180deg, var(--g-121212), var(--card) 40%); }
.card-title { color: var(--text-3); }
a.card, .news-card, .cand, .idx-card, .heat-cell, .kpi { transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s, box-shadow .22s, background .22s; }
.news-card:hover, .cand:hover, .idx-card:hover, a.card:hover { transform: translateY(-2px); border-color: var(--g-3a3a3a); box-shadow: 0 10px 30px var(--a-rgba00045); }
.news-card:active, .cand:active { transform: translateY(0); }

/* controls */
.btn { border-radius: 8px; transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s; }
.btn:hover { background: var(--g-ffffff); box-shadow: 0 0 0 4px var(--a-rgba24424424506); }
.btn:active { transform: scale(.97); }
.btn.ghost:hover { border-color: var(--g-3d3d3d); }
.seg { background: var(--g-0c0c0c); border-color: var(--border); padding: 2px; gap: 2px; border-radius: 8px; }
.seg button { border: none; border-radius: 6px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { font-weight: 600; }
.tabs button { position: relative; transition: color .18s; border-bottom: 2px solid transparent; }
.tabs button::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--text); transform: scaleX(0); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.tabs button[aria-selected="true"] { border-bottom-color: transparent; }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.chip { transition: background .15s, border-color .15s, color .15s; }
details > summary { transition: background .18s; }
details[open] > .body, details[open] > p, .panel-details[open] form { animation: unfold .26s cubic-bezier(.2,.8,.2,1); }
@keyframes unfold { from { opacity: 0; transform: translateY(-4px); } }
.modal-back { animation: fadeIn .18s ease; }
.modal { animation: pop .26s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
select.field, input.field { transition: border-color .18s, box-shadow .18s; }
input.field:focus, select.field:focus { box-shadow: 0 0 0 3px var(--a-rgba24424424508); }
tbody tr { transition: background .15s; }
tbody tr.flash-in td { animation: rowIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rowIn { from { background: var(--g-1d1d1d); } }

/* market direction: the only colour in the interface */
.chg.up { color: var(--up); }
.chg.dn { color: var(--dn); font-weight: 500; }
.badge.bull, .sent.pos, .view-tag.out { background: var(--up-soft); color: var(--up); border-color: var(--x-1f3b2a); }
.badge.bear, .sent.neg, .view-tag.under { background: var(--dn-soft); color: var(--dn); border-color: var(--x-4a2020); }
.fill.up, .score-fill.pos, .cbar i.pos { background: var(--up-line); }
.fill.dn, .score-fill.neg, .cbar i.neg, .dec-chart .bar.neg { background: var(--dn-line); }
.fill, .score-fill, .progress > i, .gbar i, .pct-bar i { transition-duration: .9s; }

/* loading */
.skeleton { background: linear-gradient(90deg, var(--g-121212) 0%, var(--g-1b1b1b) 40%, var(--g-121212) 80%); background-size: 220% 100%; animation: shimmer 1.6s ease-in-out infinite; }

/* entrance: staggered sections on page load */
.page { animation: none; }
.page > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(4) { animation-delay: .12s; } .page > *:nth-child(5) { animation-delay: .16s; }
.page > *:nth-child(6) { animation-delay: .2s; } .page > *:nth-child(n+7) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* dashboard */
.hero-cta { border: 1px solid var(--border); border-radius: 14px; padding: 24px 26px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(90% 140% at 100% 0%, var(--a-rgba25525525507), transparent 60%), var(--g-0e0e0e); }
.hero-cta::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--a-rgba255255255035) 1px, transparent 1px), linear-gradient(90deg, var(--a-rgba255255255035) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, var(--g-000000) 70%); -webkit-mask-image: linear-gradient(90deg, transparent, var(--g-000000) 70%); }
.hero-cta > * { position: relative; z-index: 1; }
.hero-cta h2 { font-size: 19px; }
.dash-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-hello .date { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; display: flex; gap: 10px; align-items: center; }
.idx-name { color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.idx-price { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 6px 0 4px; }
.idx-foot .chg { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12.5px; }
.idx-foot .chg.up { background: var(--up-soft); }
.idx-foot .chg.dn { background: var(--dn-soft); }
.g-dash { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mkt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mkt-head .lvl { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.mkt-head .meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.mkt-box { position: relative; height: 300px; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.heat-cell { border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 66px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: var(--text); }
.heat-cell .s { font-size: 11.5px; color: var(--text-2); line-height: 1.3; }
.heat-cell .p { font-size: 15px; font-weight: 600; }
.heat-cell:hover { border-color: var(--g-4a4a4a); transform: translateY(-1px); }
@media (max-width: 1100px) { .g-dash { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .content { padding: 20px 16px; }
  .kbd { display: none; }
  .search input { padding-right: 10px; }
  .topbar { gap: 8px; }
  .top-right { gap: 6px; }
  .mkt-box { height: 230px; }
}
@media (max-width: 480px) { .top-right a[href="/login"] { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Stock Analysis layout ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px;  }
.toolbar .field { border-color: transparent; background: var(--bg); }
.toolbar .field:focus { background: var(--card); }
.quote-card { margin-bottom: 18px; padding: 24px 26px; }
.quote-card .v-ticker { font-size: 34px; font-weight: 700; }
.quote-card .v-price strong { font-size: 24px; font-weight: 600; }
.quote-strip { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-top: 6px; }
.quote-strip .score-box { padding: 14px 16px; }
.quote-strip .big { font-size: 28px; }
.updown .bar-row { margin-top: 8px; }
.updown .bar-row .lbl { width: 42px; font-size: 11.5px; font-weight: 600; }
.an-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; margin-bottom: 18px; }
.an-main, .an-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.factor-card.up { border-top: 3px solid var(--up-line); }
.factor-card.dn { border-top: 3px solid var(--dn-line); }
.sec-h { font-size: 17px; margin: 8px 0 12px; }

/* ---------- Alpha Finder layout ---------- */
.info-note { background: var(--g-0e0e0e); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.info-note summary { cursor: pointer; list-style: none; }
.info-note summary::-webkit-details-marker { display: none; }
.info-note summary b { color: var(--text); }
.info-note .more { color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; margin-left: 4px; }
.info-note[open] .more { display: none; }
.info-note p { margin-top: 8px; }
.al-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.al-filters { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.al-filters .filterbar { grid-template-columns: 1fr; gap: 12px; }
.al-filters .filterbar .span2 { grid-column: 1 / -1; }
.al-filters .filterbar label { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.al-results .cand-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.al-results .bar-split { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
#covCard .cov .cell { background: var(--card); }

@media (max-width: 1100px) {
  .an-layout { grid-template-columns: 1fr; }

}
@media (max-width: 980px) {
  .al-layout { grid-template-columns: 1fr; }
  .al-filters { position: static; max-height: none; }
  .al-filters .filterbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .quote-strip { grid-template-columns: 1fr; }
  .toolbar { width: 100%; }
  .toolbar .field:first-child { flex: 1; }
  .al-results .cand-grid { grid-template-columns: 1fr; }
}

/* ===================== Chrome identity =====================
   Liquid-metal accents on a deep black stage: polished-silver headings, a machined primary button, glass panels with a
   single top-edge highlight, and one soft key light. Text stays solid where it must be read; chrome is for display type. */
:root {
  --chrome: linear-gradient(180deg, #ffffff 0%, #e4e4e4 30%, #9a9a9a 50%, #f2f2f2 66%, #b9b9b9 100%);
  --glass: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012) 38%, rgba(255,255,255,0));
  --edge: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 0 1px rgba(255,255,255,.015);
}
:root[data-theme="light"] {
  --chrome: linear-gradient(180deg, #0f1411 0%, #2b332e 34%, #5f6a64 52%, #1c221f 70%, #3b4540 100%);
  --glass: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.75));
  --edge: 0 1px 2px rgba(16,24,20,.06), 0 0 0 1px rgba(16,24,20,.02);
}
h1, .chrome-t { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark span { color: var(--text); font-size: 18px; letter-spacing: .3em; }   /* the brand is the word itself */
.card, .news-card, .cand, details.fold, .hz, .kpi, .est, .score-box, .cov .cell { background-image: var(--glass); box-shadow: var(--edge); }
.card { background-color: var(--a-rgba16161686); }
.sidebar { background: linear-gradient(180deg, var(--a-rgba255255255025), transparent 30%), var(--sidebar); }
.topbar { background: var(--a-rgba8887); box-shadow: inset 0 -1px 0 var(--a-rgba25525525504); }
.btn:not(.ghost) { background: linear-gradient(180deg, var(--g-ffffff) 0%, var(--g-e2e2e2) 46%, var(--g-c4c4c4) 54%, var(--g-e9e9e9) 100%); border-color: var(--g-d8d8d8); color: var(--g-0a0a0a);
  box-shadow: inset 0 1px 0 var(--g-ffffff), inset 0 -1px 0 var(--a-rgba00018), 0 1px 2px var(--a-rgba0005); }
.btn:not(.ghost):hover { background: linear-gradient(180deg, var(--g-ffffff) 0%, var(--g-f0f0f0) 46%, var(--g-d6d6d6) 54%, var(--g-f6f6f6) 100%); box-shadow: inset 0 1px 0 var(--g-ffffff), inset 0 -1px 0 var(--a-rgba00018), 0 0 0 4px var(--a-rgba25525525506), 0 6px 18px var(--a-rgba0005); }
.btn.ghost { background: linear-gradient(180deg, var(--a-rgba25525525505), var(--a-rgba25525525501)); box-shadow: inset 0 1px 0 var(--a-rgba25525525506); }
.badge, .sim-tag, .pill { backdrop-filter: none; }
.metal-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--a-rgba25525525535), transparent); border: 0; margin: 18px 0; }
.data-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; background: var(--a-rgba25525525503); }
.data-badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--up-line); }
.data-badge.delayed::before { content: ''; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--text-3); }

/* ===================== Grouped navigation ===================== */
.sidebar { overflow-y: auto; }
.nav { gap: 4px; }
.ngroup { border-radius: 10px; }
.nhead { display: flex; align-items: center; gap: 2px; }
.nav .glink { flex: 1; }
.nav .glink.active { background: var(--elevated); color: var(--text); border-color: var(--border); }
.nav .glink.active::before { transform: scaleY(1); }
.ntoggle { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--text-3); cursor: pointer; transition: background .18s, color .18s; }
.ntoggle:hover { background: var(--hover); color: var(--text); }
.ntoggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.ngroup.open .ntoggle svg { transform: rotate(90deg); }
.nsub { list-style: none; margin-left: 19px; border-left: 1px solid var(--border); max-height: 0; overflow: hidden; transition: max-height .3s cubic-bezier(.2,.8,.2,1), margin .3s; }
.ngroup.open .nsub { max-height: 420px; margin-top: 2px; margin-bottom: 6px; }
.nsub a { display: block; padding: 6px 10px 6px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; color: var(--text-3); text-decoration: none; transition: color .15s, border-color .15s; }
.nsub a:hover { color: var(--text); border-left-color: var(--g-555555); }
.nsub a.active { color: var(--text); font-weight: 500; }
.side-foot { margin-top: 16px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); line-height: 1.5; }
.menu-btn { display: none; flex: none; width: 40px; height: 40px; place-items: center; background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.tabbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--a-rgba0006); backdrop-filter: blur(2px); animation: fadeIn .2s ease; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100%; padding: 18px 14px; transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 60px var(--a-rgba0006); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open { overflow: hidden; }
  .nav a span { display: inline; }
  .sidebar .wordmark span { font-size: 18px; letter-spacing: .3em; }
  .nav a { justify-content: flex-start; padding: 10px 12px; }
  .wordmark { justify-content: flex-start; padding: 4px 10px 20px; }
  .menu-btn { display: grid; }
  .content { padding-bottom: 92px; }
  .tabbar { display: flex; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--a-rgba88888); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; color: var(--text-3); font: 500 11px var(--sans); text-decoration: none; border-radius: 10px; cursor: pointer; transition: color .15s, background .15s; }
  .tabbar svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
  .tabbar .active { color: var(--text); background: var(--a-rgba25525525506); }
  .consent { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .nsub, .ntoggle svg { transition: none; } }

/* movers + hubs */
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.movers .lbl-f { margin-bottom: 6px; }
.mover { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--g-191919); text-decoration: none; color: var(--text); font-size: 13px; }
.mover:last-child { border-bottom: 0; }
.mover .nm { display: block; color: var(--text-3); font-size: 11.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover:hover b { text-decoration: underline; text-underline-offset: 3px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
a.tool { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; text-decoration: none; color: var(--text); }
a.tool .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--a-rgba25525525508), var(--a-rgba25525525501)); box-shadow: inset 0 1px 0 var(--a-rgba2552552551); }
a.tool .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
a.tool b { font-size: 15px; font-weight: 600; }
a.tool p { font-size: 13px; color: var(--text-2); line-height: 1.55; }
a.tool .go { margin-top: auto; font-size: 12.5px; color: var(--text-3); }
a.tool:hover .go { color: var(--text); }
.lookup { display: flex; gap: 8px; max-width: 520px; }
.lookup input { flex: 1; }
.note-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.note-list li { display: flex; gap: 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.note-list li b { color: var(--text); font-weight: 500; }
.soon-tag { flex: none; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border: 1px dashed var(--g-4a4a4a); border-radius: 999px; padding: 2px 8px; color: var(--text-3); height: fit-content; }
@media (max-width: 560px) { .movers { grid-template-columns: 1fr; } }

/* ===================== Academy ===================== */
.ac-dash { display: flex; gap: 28px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.ac-ring { position: relative; width: 132px; height: 132px; flex: none; }
.ac-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ac-ring circle { fill: none; stroke-width: 7; }
.ac-ring .bg { stroke: var(--g-1d1d1d); }
.ac-ring .fg { stroke: url(#none); stroke: var(--g-e9e9e9); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray 1s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 4px var(--a-rgba25525525525)); }
.ac-ring-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ac-ring-n b { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.ac-ring-n span { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.ac-dash-body { flex: 1; min-width: 240px; }
.ac-h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.ac-stats { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.ac-stats .k { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ac-stats b { font-size: 20px; font-weight: 600; }
.ac-save { font-size: 12.5px; color: var(--text-3); margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topic-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.topic-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.topic-list a { color: var(--text); }
.ac-week { margin: 26px 0 8px; }
.ac-week-head { margin-bottom: 12px; }
.ac-wk { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.ac-week-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 4px; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.ac-week-head p { color: var(--text-2); font-size: 13.5px; max-width: 760px; }
.ac-days { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.ac-day { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text);
  background: var(--glass), var(--a-rgba1616168); box-shadow: var(--edge); transition: border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1); min-height: 64px; }
.ac-day:hover { border-color: var(--g-3d3d3d); transform: translateY(-1px); }
.ac-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; border: 1px solid var(--g-333333); color: var(--text-2); }
.ac-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-t b { font-weight: 500; font-size: 13.5px; line-height: 1.35; }
.ac-state { flex: none; font-size: 11.5px; color: var(--text-3); min-width: 34px; text-align: right; }
.ac-day.done .ac-num { background: linear-gradient(180deg, var(--g-ffffff), var(--g-cfcfcf)); color: var(--g-0a0a0a); border-color: var(--g-dddddd); }
.ac-day.done .ac-state { color: var(--up); }
.ac-day.next { border-color: var(--g-5a5a5a); }
.ac-day.next .ac-state { color: var(--text); }

.lesson { max-width: 820px; margin: 0 auto; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.crumbs a { color: var(--text-2); }
.lesson-head { margin-bottom: 18px; }
.lesson-head h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; margin-top: 6px; }
.objectives ul, .takeaways { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.objectives { margin-bottom: 8px; }
.lesson-sec { margin: 26px 0; }
.lesson-sec h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 10px; }
.lesson-sec p, .example p, .challenge p, .exercise p { color: var(--g-cfcfcf); font-size: 15.5px; line-height: 1.75; margin-bottom: 12px; max-width: 72ch; }
.lesson-sec p b, .example p b { color: var(--text); font-weight: 600; }
.example, .challenge, .exercise, .widget, .quiz { margin: 22px 0; }
.example { border-left: 2px solid var(--g-8a8a8a); }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin-bottom: 10px; }
.terms > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--a-rgba25525525502); }
.terms dt { font-weight: 600; font-size: 13.5px; }
.terms dd { color: var(--text-2); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.qq { border: 0; padding: 14px 0; border-top: 1px solid var(--g-1c1c1c); }
.qq:first-child { border-top: 0; }
.qq legend { font-weight: 500; font-size: 15px; line-height: 1.5; display: flex; gap: 10px; margin-bottom: 10px; float: left; width: 100%; }
.qq legend + * { clear: both; }
.qn { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--g-3a3a3a); display: grid; place-items: center; font-size: 12px; color: var(--text-2); }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 6px 0 0 34px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--g-d8d8d8); transition: border-color .15s, background .15s; min-height: 44px; }
.opt:hover { border-color: var(--g-444444); background: var(--a-rgba25525525502); }
.opt input { margin-top: 3px; accent-color: var(--g-f4f4f5); width: 16px; height: 16px; flex: none; }
.opt:has(input:checked) { border-color: var(--g-8a8a8a); background: var(--a-rgba25525525504); }
.opt.is-answer { border-color: #2f6b45; background: var(--up-soft); }
.opt.is-wrong { border-color: #6b2f2f; background: var(--dn-soft); }
.why { margin: 10px 0 0 34px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.qq.ok .why b { color: var(--up); } .qq.bad .why b { color: var(--dn); }
.quiz-actions { margin-top: 16px; }
.quiz-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.qr-score { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.qr-score b { font-size: 28px; font-weight: 600; }
.qr-score span { color: var(--text-3); }
.quiz-result p { color: var(--text-2); margin-bottom: 10px; }
.lesson-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.w-out { margin-top: 14px; font-size: 14px; color: var(--g-d0d0d0); line-height: 1.65; }
.w-out p { margin-bottom: 8px; }
.bars > div, .tbar { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bars i, .tbar i { height: 8px; background: var(--g-1b1b1b); border-radius: 4px; overflow: hidden; display: block; }
.bars b, .tbar b { display: block; height: 100%; background: linear-gradient(90deg, var(--g-8a8a8a), var(--g-f4f4f5)); border-radius: 4px; transition: width .4s; }
.bars b.alt { background: linear-gradient(90deg, var(--g-555555), var(--g-a8a8a8)); }
.tbar .n, .bars > div > span:last-child { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.dots i { width: 14px; height: 14px; border-radius: 3px; background: var(--g-2a2a2a); }
.dots i.hit { background: var(--dn-line); }
input[type=range] { accent-color: var(--g-f4f4f5); width: 100%; margin-top: 8px; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.gl { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--glass), var(--a-rgba1616168); }
.gl dt { font-weight: 600; }
.gl dd { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin-top: 3px; }
@media (max-width: 600px) { .opt, .why { margin-left: 0; } .bars > div, .tbar { grid-template-columns: 1fr 1fr 70px; } .ac-dash { gap: 18px; } }

/* paper challenge */
.nudges { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.nudges li { border: 1px solid var(--border); border-left: 2px solid var(--g-8a8a8a); border-radius: 10px; padding: 12px 14px; background: var(--a-rgba25525525502); }
.nudges b { font-weight: 600; font-size: 13.5px; }
.nudges p { color: var(--text-2); font-size: 13px; line-height: 1.55; margin: 4px 0 6px; }
textarea.field { background: var(--bg); border: 1px solid var(--field-border); border-radius: 8px; color: var(--text); font: inherit; padding: 8px 12px; resize: vertical; width: 100%; outline: none; transition: border-color .18s, box-shadow .18s; }
textarea.field:focus { border-color: var(--g-a6a6a6); box-shadow: 0 0 0 3px var(--a-rgba24424424508); }
.journal { margin-top: 12px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.jentry { border-top: 1px solid var(--g-1c1c1c); padding-top: 10px; }
.jentry p { font-size: 13.5px; color: var(--g-d4d4d4); line-height: 1.6; margin-top: 4px; }
.pp-start p { max-width: 70ch; line-height: 1.65; margin-bottom: 8px; }
.side-buy { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; font-weight: 600; }
.side-sell { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; font-weight: 600; color: var(--text-2); }
.why-basis { font-size: 12.5px; color: var(--text-2); line-height: 1.6; border-left: 2px solid var(--g-4a4a4a); padding-left: 10px; margin-bottom: 12px; }
.why-basis b { color: var(--text); font-weight: 500; }

.sent.kw { border-style: dashed; }
.gl.flash { border-color: var(--g-8a8a8a); } .gl-more p { color: var(--text-2); font-size: 13px; line-height: 1.6; margin-top: 6px; } .gl-more summary { font-size: 12.5px; color: var(--text-3); cursor: pointer; margin-top: 6px; } .gl dd > p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; } .gcat-sec { margin-bottom: 8px; }

/* ===================== Explanations and view mode ===================== */
.info { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 5px; vertical-align: 1px; border-radius: 50%; border: 1px solid var(--g-555555);
  background: transparent; color: var(--text-2); font: italic 600 10.5px/1 Georgia, serif; cursor: pointer; padding: 0; transition: border-color .15s, color .15s, background .15s; }
.info::before { content: ''; position: absolute; width: 36px; height: 36px; margin: -10px; }                 /* larger touch target */
.info { position: relative; }
.info:hover, .info[aria-expanded="true"] { border-color: var(--text); color: var(--text); background: var(--a-rgba25525525506); }
.info-pop { position: absolute; z-index: 95; background: var(--g-121212); border: 1px solid var(--g-333333); border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 18px 50px var(--a-rgba0007);
  font-size: 13px; line-height: 1.55; color: var(--text-2); animation: pop .18s cubic-bezier(.2,.8,.2,1); outline: none; }
.info-pop.sheet { position: fixed; left: 8px; right: 8px; bottom: 8px; max-height: 70vh; overflow-y: auto; z-index: 96; }
.info-pop p { margin-top: 6px; }
.info-pop b { color: var(--text); font-weight: 600; }
.ip-h { font-weight: 600; color: var(--text); font-size: 14px; padding-right: 26px; }
.ip-simple { color: var(--text) !important; }
.ip-x { position: absolute; right: 8px; top: 6px; }
.ip-adv summary { cursor: pointer; margin-top: 8px; color: var(--text-3); }
.ip-links { display: flex; gap: 14px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--g-222222); font-size: 12.5px; }
.mode-seg button { font-size: 12px; padding: 5px 10px; }
.mode-seg button[aria-pressed="true"] { font-weight: 600; }
html[data-mode="beginner"] .adv-only { display: none !important; }
html[data-mode="advanced"] .beg-only { display: none !important; }
@media (max-width: 860px) { .mode-seg button { padding: 5px 8px; font-size: 11.5px; } .top-right .btn.ghost.sm:first-of-type { display: none; } }
@media (max-width: 420px) { .status { display: none; } }

/* ===================== Stock analysis: plain-English layer ===================== */
.glance, #whyCard, #riskCard, #trackCard, #nextCard { margin-bottom: 18px; }
.gl-head { font-size: 17px; line-height: 1.5; color: var(--text); font-weight: 500; max-width: 80ch; }
.gl-points { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14px; line-height: 1.6; max-width: 90ch; }
.gl-meta { margin-top: 12px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ev-col { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--a-rgba255255255015); }
.ev-col h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ev-col.pos h3::before { content: '+'; color: var(--up); font-family: var(--mono); }
.ev-col.neg h3::before { content: '−'; color: var(--dn); font-family: var(--mono); }
.ev-col.mix h3::before { content: '◆'; color: var(--text-2); font-size: 11px; }
.ev-col.miss h3::before { content: '?'; color: var(--text-3); font-family: var(--mono); }
.ev-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ev-col li { font-size: 13px; line-height: 1.5; color: var(--g-d4d4d4); }
.ev-g { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ev-pts { display: inline-block; margin-left: 6px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ev-why { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.risk-list { display: flex; flex-direction: column; gap: 8px; }
details.risk { border: 1px solid var(--border); border-left: 2px solid #8a6a2a; border-radius: 10px; padding: 10px 14px; }
details.risk summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.risk summary::-webkit-details-marker { display: none; }
details.risk summary span { font-size: 13px; color: var(--text-2); }
details.risk p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 8px; }
details.risk p b { color: var(--text); font-weight: 500; }
.next-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.next-list li::before { content: '→ '; color: var(--text-3); }
.adv-hint { margin-bottom: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 1100px) { .ev-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .ev-grid { grid-template-columns: 1fr; } }
.findings { margin-bottom: 14px; }
details.finding { border-top: 1px solid var(--border); padding: 10px 2px; }
details.finding:first-of-type { border-top: 0; }
details.finding summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.finding summary::-webkit-details-marker { display: none; }
details.finding summary span { font-size: 13px; color: var(--text-2); }
details.finding p { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 6px; }
details.finding p b { color: var(--text); font-weight: 500; }
.scr-why { font-size: 13px; color: var(--text-2); line-height: 1.6; border-left: 2px solid var(--g-4a4a4a); padding: 4px 0 4px 12px; margin: 4px 0 14px; } .scr-why b { color: var(--text); font-weight: 500; }
.onboard { margin-bottom: 18px; }
.ob-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ob { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, var(--a-rgba255255255045), var(--a-rgba25525525501)); transition: border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1); }
.ob:hover { border-color: var(--g-4a4a4a); transform: translateY(-2px); }
.ob b { font-size: 15px; font-weight: 600; }
.ob span { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.tryit { margin: 22px 0; }
@media (max-width: 760px) { .ob-grid { grid-template-columns: 1fr; } }

.xp-replay { display: block; background: none; border: 0; padding: 0 0 10px; color: var(--text-2); font: 500 12px var(--sans); cursor: pointer; text-align: left; }
.xp-replay:hover { color: var(--text); }
.side-mode { display: none; margin-top: 14px; align-self: flex-start; }
@media (max-width: 700px) {
  .top-right .mode-seg { display: none; }
  .side-mode { display: inline-flex; }
  .search { min-width: 0; }
}
.side-prefs { display: none; margin-top: 14px; align-items: center; gap: 8px; }
.side-prefs .side-mode { margin-top: 0; }
@media (max-width: 700px) { .side-prefs { display: flex; } .top-right .theme-btn { display: none; } }

/* ===================== Theme toggle ===================== */
.theme-btn { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); cursor: pointer; transition: color .18s, border-color .18s, background .18s; }
.theme-btn:hover { color: var(--accent-hi); border-color: var(--accent); }
.theme-btn svg { grid-area: 1 / 1; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.theme-btn .i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
html[data-theme="light"] .theme-btn .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
html[data-theme="light"] .theme-btn .i-moon { opacity: 1; transform: none; }
/* a short cross-fade while the theme changes; nothing animates on first paint */
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .22s ease, border-color .22s ease, color .22s ease, fill .22s ease, stroke .22s ease !important; }
@media (prefers-reduced-motion: reduce) { html.theme-switching *, .theme-btn svg { transition: none !important; } }

/* ===================== Emerald accent (used sparingly: focus, current place, chosen controls) ===================== */
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
::selection { background: var(--accent-deep); color: #f5f7f5; }
.nav a::before { background: var(--accent-hi); }
.nav a.active { box-shadow: inset 0 0 0 1px var(--accent-soft); }
.nsub a.active { border-left-color: var(--accent-hi); }
.tabs button::after { background: var(--accent-hi); }
.seg button.on, .mode-seg button[aria-pressed="true"] { background: linear-gradient(180deg, #5bdcae, var(--accent-hi)); color: #04130d; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { border-color: #fff; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="range"], input[type="checkbox"], input[type="radio"], progress { accent-color: var(--accent); }
a:not([class]):hover { color: var(--accent-hi); }
.data-badge.live::before { background: var(--accent-hi); box-shadow: 0 0 6px var(--accent-hi); }
body { background: radial-gradient(1100px 520px at 72% -12%, rgba(13,139,99,.07), transparent 62%), radial-gradient(800px 400px at -10% 110%, var(--a-rgba25525525503), transparent 60%), var(--bg); background-attachment: fixed; }

/* light theme: emerald reads darker on white, and the selected control uses the deep green with white text */
:root[data-theme="light"] .seg button.on, :root[data-theme="light"] .mode-seg button[aria-pressed="true"] { background: linear-gradient(180deg, #0d8b63, #0b7a57); color: #fff; }
:root[data-theme="light"] :focus-visible { outline-color: var(--accent); }
:root[data-theme="light"] ::selection { background: #bfe8d6; color: #121814; }
:root[data-theme="light"] .nav a::before, :root[data-theme="light"] .tabs button::after { background: var(--accent); }
:root[data-theme="light"] .nsub a.active { border-left-color: var(--accent); }
:root[data-theme="light"] a:not([class]):hover { color: var(--accent); }
:root[data-theme="light"] body { background: radial-gradient(1100px 520px at 72% -12%, rgba(13,139,99,.06), transparent 62%), var(--bg); }

/* ===================== Account menu (top bar) and sign in / out in the phone menu ===================== */
.acct-menu { position: relative; }
.acct-menu > summary { list-style: none; cursor: pointer; }
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu[open] > summary { border-color: var(--accent); }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 230px; padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); box-shadow: 0 18px 40px var(--a-rgba0006); display: flex; flex-direction: column; }
.acct-who { padding: 8px 10px 10px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.acct-who b { display: block; color: var(--text); font-weight: 500; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.acct-pop a, .acct-pop button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  font: 500 13.5px var(--sans); color: var(--text); text-decoration: none; cursor: pointer; }
.acct-pop a:hover, .acct-pop button:hover, .acct-pop a:focus-visible, .acct-pop button:focus-visible { background: var(--hover); }
.acct-pop form { margin: 0; }
.acct-pop button { color: var(--dn); }
.side-acct { display: none; margin-top: 14px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 12px; flex-direction: column; gap: 8px; }
.side-acct b { font-weight: 500; color: var(--text); overflow-wrap: anywhere; font-size: 13px; }
.side-acct .row { display: flex; gap: 8px; flex-wrap: wrap; }
.side-acct form { margin: 0; }
@media (max-width: 700px) { .side-acct { display: flex; } }

/* ===================== Portfolio Analyst ===================== */
.pa { display: flex; flex-direction: column; gap: 14px; }
.pa-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pa-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pa-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; }
.pa-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pa-status.on { color: var(--text-2); } .pa-status.on i { background: var(--accent-hi); }
.pa-ctx { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.pa-kv { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.pa-kv span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pa-kv b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pa-src { flex-basis: 100%; font-size: 11.5px; color: var(--text-3); }
.pa-chat { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--card); min-height: 62vh; overflow: hidden; }
.pa-log { flex: 1; overflow-y: auto; padding: 20px clamp(12px, 3vw, 28px); display: flex; flex-direction: column; gap: 16px; max-height: 68vh; scroll-behavior: smooth; }
.pa-empty { max-width: 640px; margin: auto; text-align: center; padding: 24px 0; }
.pa-empty h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.pa-empty p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.pa-starters, .pa-follow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.pa-follow { justify-content: flex-start; margin-top: 12px; }
.pa-chip { border: 1px solid var(--border); background: var(--bg); color: var(--text-2); border-radius: 999px; padding: 7px 13px; font: 500 13px var(--sans); cursor: pointer; text-align: left; transition: border-color .15s, color .15s; }
.pa-chip:hover { border-color: var(--accent); color: var(--text); }
.pa-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 860px; }
.pa-msg.me { align-self: flex-end; max-width: 80%; }
.pa-msg.me .pa-b { background: var(--elevated); border: 1px solid var(--border); border-radius: 14px 14px 4px 14px; padding: 10px 14px; font-size: 14.5px; line-height: 1.55; }
.pa-av { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 600 12px var(--sans); background: var(--accent-soft); color: var(--accent-hi); margin-top: 2px; }
.pa-msg.bot .pa-b { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.pa-msg.bot .pa-b > * + * { margin-top: 10px; }
.pa-msg.bot ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.pa-msg.bot b { font-weight: 600; }
.pa-msg.err .pa-b { color: var(--dn); }
.pa-note { font-size: 12.5px !important; color: var(--text-3); line-height: 1.55; border-left: 2px solid var(--border); padding-left: 10px; }
.pa-t { width: 100%; font-size: 13.5px; }
.pa-t th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.pa-t td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; vertical-align: top; }
.pa-t td.r { text-align: right; white-space: nowrap; }
.pa-t th + th { text-align: right; }
.pa-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.pa-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: paDot 1.2s infinite ease-in-out; }
.pa-dots i:nth-child(2) { animation-delay: .15s; } .pa-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes paDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.pa-tl { margin-left: 10px; font-size: 13px; color: var(--text-3); }
.pa-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--bg); max-width: 900px; margin-left: 36px; }
.pa-card-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.pa-card-h .muted { font-size: 12.5px; }
.pa-q { margin: 0 0 10px 18px; font-size: 13.5px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.pa-q li::marker { color: var(--accent-hi); }
.pa-card-f, .pa-panel-f { justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pa-edit { width: 100%; }
.pa-edit td { padding: 4px 4px; vertical-align: top; }
.pa-edit .field { width: 100%; min-width: 72px; padding: 6px 8px; font-size: 13px; }
.pa-edit td:first-child .field { min-width: 84px; }
.pa-tag { display: inline-block; margin-top: 3px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-hi); }
.pa-hint { font-size: 11.5px; color: var(--text-3); margin-top: 3px; max-width: 220px; }
.pa-cash { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.pa-cash .field { width: 120px; padding: 6px 8px; }
.pa-attach { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px 0; }
.pa-thumb { position: relative; width: 74px; margin: 0; }
.pa-thumb img { width: 74px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.pa-thumb figcaption { font-size: 10.5px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 2px; }
.pa-thumb .x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); font-size: 13px; line-height: 1; cursor: pointer; color: var(--text); }
.pa-attach-t { font-size: 12.5px; color: var(--text-3); }
.pa-input { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--card); }
.pa-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 180px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--bg); color: var(--text);
  font: 14.5px/1.45 var(--sans); }
.pa-input textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pa-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); cursor: pointer; }
.pa-icon:hover { color: var(--accent-hi); border-color: var(--accent); }
.pa-icon svg { width: 18px; height: 18px; fill: currentColor; } .pa-icon svg .d { opacity: .35; }
.pa-input .btn { height: 42px; }
.pa-fine { font-size: 11.5px; color: var(--text-3); padding: 0 16px 12px; line-height: 1.5; background: var(--card); }
.pa-panel { width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text); padding: 0; }
.pa-panel::backdrop { background: rgba(0,0,0,.5); }
.pa-panel-in { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.pa-panel-h { display: flex; justify-content: space-between; align-items: center; }
.pa-panel-h h2 { font-size: 18px; font-weight: 600; }
.pa-sub { font-size: 14px; font-weight: 600; margin-top: 10px; } .pa-sub .muted { font-weight: 400; font-size: 12.5px; }
.pa-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pa-goals label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 700px) {
  .pa-chat { min-height: 70vh; border-radius: 12px; }
  .pa-log { max-height: none; padding: 14px 12px; }
  .pa-msg.me { max-width: 92%; }
  .pa-card { margin-left: 0; padding: 12px; }
  .pa-goals { grid-template-columns: 1fr; }
  .pa-edit thead { display: none; }
  .pa-edit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .pa-edit td { padding: 0; } .pa-edit td.r { text-align: right; }
  .pa-input { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pa-dots i { animation: none; opacity: .6; } .pa-log { scroll-behavior: auto; } }
.pa-ctx[hidden], .pa-attach[hidden], .pa-empty[hidden] { display: none; }
.pa-links { display: flex; gap: 8px; flex-wrap: wrap; }
