/* ===================== PERSPECTIVE DASHBOARD ===================== */
:root {
  --shell: #101316;
  --bg: #15181b;
  --panel: #1c2026;
  --panel-2: #21262d;
  --chrome-mix: 24%;
  --chrome-tint: #000;
  --line: rgba(244,246,245,0.08);
  --line-2: rgba(244,246,245,0.14);
  --green: #25d07d;
  --green-dim: #0f6e44;
  --red: #ff4d4d;
  --amber: #e8b84b;
  --blue: #6fb8ff;
  --ink: #f4f6f5;
  --t-1: #c7cfca;
  --t-2: #9aa6a0;
  --t-3: #6f7a74;
  --ui: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: var(--bg); }
body {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(244,246,245,0.1); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(244,246,245,0.18); }
::-webkit-scrollbar-track { background: transparent; }

.up { color: var(--green); }
.down { color: var(--red); }
.mono { font-family: var(--mono); }

/* ===================== SHELL ===================== */
.app { display: grid; grid-template-rows: 54px 1fr; height: 100vh; }

/* ---------- TOP HEADER ---------- */
.topnav { display: flex; align-items: stretch; gap: 14px; padding: 0 18px; background: color-mix(in srgb, var(--bg), var(--chrome-tint) var(--chrome-mix)); border-bottom: 1px solid var(--line); }
.topnav .brand { display: flex; align-items: center; font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: -0.04em; color: var(--ink); }
.topnav .brand b { color: var(--green); }
.navtoggle { display: flex; align-items: center; color: var(--t-2); padding: 0 2px; transition: color .15s; }
.navtoggle:hover { color: var(--ink); }
.navtoggle svg { width: 20px; height: 20px; }
.topnav-links { display: flex; align-items: stretch; gap: 2px; margin-left: 4px; }
.topnav-links .nav-i { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--t-2); font-family: var(--ui); font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent; transition: color .15s; }
.topnav-links .nav-i svg { width: 16px; height: 16px; }
.topnav-links .nav-i:hover { color: var(--ink); }
.topnav-links .nav-i.active { color: var(--ink); border-bottom-color: var(--green); }
.topnav .spacer { flex: 1; }
.topnav .topadd { align-self: center; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--t-2); transition: color .15s, border-color .15s, background .15s; }
.topnav .topadd:hover { color: var(--green); border-color: rgba(37,208,125,0.4); background: rgba(37,208,125,0.06); }
.topnav .topadd svg { width: 16px; height: 16px; }
.topnav-links .navsep { align-self: center; width: 1px; height: 15px; background: var(--line); margin: 0 2px; }
.topnav .search { align-self: center; flex: 0 0 270px; }
.topnav .live-pill, .topnav .btn, .topnav .avatar { align-self: center; }

.body { display: grid; grid-template-columns: 250px 1fr; min-height: 0; transition: grid-template-columns .24s ease; }
.body.collapsed { grid-template-columns: 44px 1fr; }

/* collapsible holdings */
.folders-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.body.collapsed .folders-inner { display: none; }
.folders-rail { display: none; }
.body.collapsed .folders-rail {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%; height: 100%; padding: 16px 0; color: var(--t-2);
  transition: color .15s, background .15s;
}
.body.collapsed .folders-rail:hover { color: var(--green); background: rgba(255,255,255,0.03); }
.folders-rail svg { width: 18px; height: 18px; }
.folders-rail .rail-label {
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  font-family: var(--ui); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--t-3);
}
.folders-tools { display: flex; gap: 4px; }

/* ---------- ICON RAIL ---------- */
.rail {
  background: color-mix(in srgb, var(--bg), var(--chrome-tint) var(--chrome-mix));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0; gap: 6px;
}
.rail .logo {
  font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -0.04em;
  color: var(--ink); margin-bottom: 18px; line-height: 1;
}
.rail .logo b { color: var(--green); }
.rail .nav-i {
  width: 42px; height: 42px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--t-3); position: relative; transition: color .15s, background .15s;
}
.rail .nav-i svg { width: 20px; height: 20px; }
.rail .nav-i:hover { color: var(--t-1); background: rgba(255,255,255,0.04); }
.rail .nav-i.active { color: var(--green); background: rgba(37,208,125,0.1); }
.rail .nav-i.active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--green); border-radius: 0 3px 3px 0;
}
.rail .spacer { flex: 1; }
.rail .nav-i .tip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: #2a3036; color: var(--ink); font-family: var(--ui); font-size: 11px;
  padding: 5px 9px; border-radius: 5px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s; z-index: 50; box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.rail .nav-i:hover .tip { opacity: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dim), #155); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ui); font-weight: 600; font-size: 13px;
}

/* ---------- PORTFOLIOS / FOLDERS ---------- */
.folders {
  background: color-mix(in srgb, var(--bg), var(--chrome-tint) var(--chrome-mix));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.folders-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px;
}
.folders-head .ft {
  font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--t-2);
}
.icon-btn {
  width: 26px; height: 26px; border-radius: 6px; color: var(--t-2);
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

.fsearch { padding: 0 12px 12px; }
.fsearch input {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 11px; color: var(--ink);
  font-family: var(--mono); font-size: 12px; outline: none;
}
.fsearch input::placeholder { color: var(--t-3); }
.fsearch input:focus { border-color: var(--line-2); }

.folder-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.folder { margin-bottom: 2px; }
.folder-h {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 8px 8px; border-radius: 6px; color: var(--t-1); text-align: left;
  transition: background .12s;
}
.folder-h:hover { background: rgba(255,255,255,0.03); }
.folder-h .chev { color: var(--t-3); transition: transform .2s; display: flex; }
.folder-h .chev svg { width: 12px; height: 12px; }
.folder.open .folder-h .chev { transform: rotate(90deg); }
.folder-h .fname { font-family: var(--ui); font-size: 13px; font-weight: 600; flex: 1; }
.folder-h .fcount { font-family: var(--mono); font-size: 10px; color: var(--t-3); }
.folder-items { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.folder.open .folder-items { max-height: 600px; }

.tk {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px 7px 26px; border-radius: 6px; text-align: left;
  position: relative; transition: background .12s;
}
.tk:hover { background: rgba(255,255,255,0.04); }
.tk.active { background: rgba(37,208,125,0.1); }
.tk.active::before {
  content: ""; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
.tk .sym { font-family: var(--sans); font-weight: 600; font-size: 13px; }
.tk .px { font-family: var(--mono); font-size: 11px; color: var(--t-2); }
.tk .chg { font-family: var(--mono); font-size: 11px; min-width: 48px; text-align: right; }
.add-group {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; margin-top: 6px; border-radius: 6px;
  color: var(--t-3); font-family: var(--ui); font-size: 12px; border: 1px dashed var(--line-2);
  transition: color .15s, border-color .15s;
}
.add-group:hover { color: var(--green); border-color: rgba(37,208,125,0.4); }
.add-group svg { width: 14px; height: 14px; }

/* ===================== MAIN ===================== */
.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 16px;
  padding: 0 22px; border-bottom: 1px solid var(--line);
}
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 13px;
}
.search:focus-within { border-color: var(--line-2); }
.search svg { width: 15px; height: 15px; color: var(--t-3); flex: none; }
.search input {
  flex: 1; background: none; border: none; outline: none; color: var(--ink);
  font-family: var(--mono); font-size: 13px;
}
.search input::placeholder { color: var(--t-3); }
.search kbd {
  font-family: var(--mono); font-size: 10px; color: var(--t-3);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px;
}
.topbar .spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-size: 12.5px; font-weight: 500;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line-2);
  color: var(--t-1); transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: rgba(244,246,245,0.3); color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn.green { border-color: rgba(37,208,125,0.4); color: var(--green); }
.btn.green:hover { background: rgba(37,208,125,0.08); border-color: var(--green); }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--t-2);
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

/* ---------- TICKER HEADER ---------- */
.thead { flex: none; padding: 20px 22px 0; }
.thead-row { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.thead .tk-id { display: flex; align-items: baseline; gap: 12px; }
.thead .tk-sym { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.thead .tk-name { font-size: 14px; color: var(--t-2); }
.thead .tk-tag {
  font-family: var(--ui); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--t-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 8px; align-self: center;
}
.thead .tk-price { display: flex; align-items: baseline; gap: 12px; margin-left: auto; }
.thead .tk-last { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -0.01em; }
.thead .tk-delta { font-family: var(--mono); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chip {
  font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap;
  padding: 12px 18px; border-right: 1px solid var(--line);
  display: inline-flex; gap: 9px; align-items: center;
}
.chip:first-child { padding-left: 2px; }
.chip .lbl { color: var(--t-3); font-family: var(--ui); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.chip .ind { width: 6px; height: 6px; border-radius: 50%; }
.chip .ind.g { background: var(--green); } .chip .ind.a { background: var(--amber); } .chip .ind.r { background: var(--red); }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 4px; padding: 16px 22px 0; flex: none; border-bottom: 1px solid var(--line); }
.tab {
  font-family: var(--ui); font-size: 13.5px; font-weight: 500; color: var(--t-2);
  padding: 10px 16px 14px; position: relative; transition: color .15s;
}
.tab:hover { color: var(--t-1); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px;
  background: var(--green); border-radius: 2px;
}
.tab .count { font-family: var(--mono); font-size: 10px; color: var(--t-3); margin-left: 7px; }

.view { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; }

/* title dot-field band — sits inline with the page title, reacts to cursor */
.view-head-main { flex: 1 1 auto; min-width: 0; }
.title-row { display: flex; align-items: center; gap: 18px; }
.title-row .view-title { flex: none; }
.title-dots {
  display: block; flex: 1 1 auto; min-width: 40px; height: 22px;
  color: var(--ink); align-self: center;
  touch-action: none; cursor: crosshair;
}

/* ---------- PANELS ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.panel-h .pt { font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--t-1); }
.panel-h .pmeta { font-family: var(--mono); font-size: 10px; color: var(--t-3); margin-left: auto; }
.panel-h .dotrow { display: flex; gap: 5px; }
.panel-h .dotrow i { width: 7px; height: 7px; border-radius: 50%; background: #2b3338; }
.panel-h .dotrow i.g { background: var(--green); }
.panel-b { padding: 16px; }

/* ---------- OVERVIEW GRID ---------- */
.ov-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.ov-grid .span2 { grid-column: 1 / -1; }
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* chart */
.chart-wrap { position: relative; }
.chart-tools { display: flex; align-items: center; gap: 6px; }
.range-btn {
  font-family: var(--mono); font-size: 11px; color: var(--t-3);
  padding: 5px 10px; border-radius: 6px; transition: color .15s, background .15s;
}
.range-btn:hover { color: var(--t-1); }
.range-btn.active { color: var(--ink); background: rgba(255,255,255,0.07); }
.pchart { width: 100%; display: block; }
.pchart-svg text { font-family: var(--mono); fill: var(--t-3); font-size: 10px; }
.crosshair-tip {
  position: absolute; pointer-events: none; background: #2a3036; color: var(--ink);
  font-family: var(--mono); font-size: 11px; padding: 6px 9px; border-radius: 6px;
  white-space: nowrap; opacity: 0; transition: opacity .1s; transform: translate(-50%, -130%);
  box-shadow: 0 8px 22px rgba(0,0,0,0.5); z-index: 6;
}

/* data tiles within panels */
.kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 4px; overflow: hidden; }
.kcell { background: var(--panel); padding: 13px 14px; }
.kcell .kl { font-family: var(--ui); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--t-3); }
.kcell .kv { font-family: var(--mono); font-size: 20px; font-weight: 500; margin-top: 6px; }
.kcell .kd { font-family: var(--mono); font-size: 11px; margin-top: 3px; }

/* gauge */
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge svg { width: 76px; height: 76px; flex: none; }
.gauge .gv { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.gauge .gl { font-family: var(--ui); font-size: 12px; color: var(--t-2); margin-top: 2px; }

/* bars */
.barline { display: flex; align-items: center; gap: 12px; margin: 11px 0; }
.barline .bl { font-family: var(--ui); font-size: 12px; color: var(--t-1); width: 96px; flex: none; }
.barline .track { flex: 1; height: 7px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.barline .fill { height: 100%; border-radius: 4px; }
.barline .bv { font-family: var(--mono); font-size: 11px; color: var(--t-2); width: 52px; text-align: right; flex: none; }

/* events list */
.events { display: flex; flex-direction: column; }
.event { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: none; padding-top: 2px; }
.event .etag {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; height: fit-content; white-space: nowrap; border: 1px solid var(--line-2); color: var(--t-2);
}
.event .etag.ai { color: #b6e6c8; border-color: rgba(37,208,125,0.34); }
.event .etag.risk { color: var(--red); border-color: rgba(255,77,77,0.4); }
.event .ebody { flex: 1; }
.event .etitle { font-size: 13px; color: var(--ink); line-height: 1.35; }
.event .emeta { font-family: var(--mono); font-size: 10px; color: var(--t-3); margin-top: 4px; }

/* ---------- DATA TAB (visuals board) ---------- */
.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.board-head .bt { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--t-1); }
.board-head .bsub { font-family: var(--mono); font-size: 11px; color: var(--t-3); margin-top: 3px; }
.board { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.vcard.wide { grid-column: span 2; }
.vcard-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.vcard-h .vt { font-family: var(--ui); font-size: 12.5px; font-weight: 600; }
.vcard-h .vsrc { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--t-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; }
.vcard-h .vx { margin-left: auto; color: var(--t-3); display: flex; gap: 4px; }
.vcard-h .vx button { width: 24px; height: 24px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: var(--t-3); }
.vcard-h .vx button:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.vcard-h .vx svg { width: 14px; height: 14px; }
.vcard-b { padding: 14px; }
.vlegend { display: flex; gap: 16px; margin-top: 10px; }
.vlegend span { font-family: var(--mono); font-size: 10px; color: var(--t-2); display: inline-flex; align-items: center; gap: 6px; }
.vlegend i { width: 9px; height: 9px; border-radius: 2px; }
.add-visual {
  border: 1px dashed var(--line-2); border-radius: 4px; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--t-3); transition: color .15s, border-color .15s, background .15s;
}
.add-visual:hover { color: var(--green); border-color: rgba(37,208,125,0.4); background: rgba(37,208,125,0.03); }
.add-visual svg { width: 26px; height: 26px; }
.add-visual span { font-family: var(--ui); font-size: 13px; }

/* visual picker popover */
.picker {
  position: fixed; z-index: 100; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 7px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); width: 260px;
}
.picker .ph { font-family: var(--ui); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--t-3); padding: 8px 10px 6px; }
.picker button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; color: var(--t-1); }
.picker button:hover { background: rgba(255,255,255,0.06); }
.picker button .pi { width: 26px; height: 26px; border-radius: 6px; background: rgba(37,208,125,0.1); color: var(--green); display: flex; align-items: center; justify-content: center; flex: none; }
.picker button .pi svg { width: 15px; height: 15px; }
.picker button .pn { font-family: var(--ui); font-size: 13px; }
.picker button .pd { font-family: var(--mono); font-size: 10px; color: var(--t-3); }

/* ---------- RAW TAB ---------- */
.raw-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.raw-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 11px 15px; }
.raw-stat .rl { font-family: var(--ui); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--t-3); }
.raw-stat .rv { font-family: var(--mono); font-size: 19px; font-weight: 500; margin-top: 4px; }
.raw-filters { margin-left: auto; display: flex; gap: 6px; }
.fchip { font-family: var(--mono); font-size: 11px; color: var(--t-2); padding: 6px 11px; border-radius: 6px; border: 1px solid var(--line); transition: all .12s; }
.fchip:hover { border-color: var(--line-2); color: var(--ink); }
.fchip.active { color: var(--ink); background: rgba(255,255,255,0.06); border-color: var(--line-2); }

.rawtable { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.rawtable thead th {
  text-align: left; font-family: var(--ui); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--t-3); font-weight: 600; padding: 0 14px 11px; position: sticky; top: 0; background: var(--bg);
}
.rawtable td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--t-1); }
.rawtable tr.new td { animation: flashrow 1.2s ease; }
@keyframes flashrow { 0% { background: rgba(37,208,125,0.12); } 100% { background: transparent; } }
.rawtable .time { color: var(--t-3); }
.rawtable .ds { color: var(--ink); font-family: var(--sans); font-size: 12.5px; }
.src-tag { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--t-2); white-space: nowrap; }
.src-tag.scraped { color: var(--blue); border-color: rgba(111,184,255,0.35); }
.src-tag.modeled { color: var(--amber); border-color: rgba(232,184,75,0.4); }
.src-tag.ai { color: var(--green); border-color: rgba(37,208,125,0.4); }
.st-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--t-2); font-size: 11px; }
.st-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ---------- SCREENER ---------- */
.screener { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.screener thead th {
  text-align: right; font-family: var(--ui); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--t-3); font-weight: 600; padding: 0 16px 13px; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--bg);
}
.screener thead th:first-child, .screener thead th:nth-child(2) { text-align: left; }
.screener thead th:hover { color: var(--t-1); }
.screener thead th .ar { opacity: 0; }
.screener thead th.sorted .ar { opacity: 1; color: var(--green); }
.screener tbody tr { cursor: pointer; transition: background .12s; }
.screener tbody tr:hover { background: rgba(255,255,255,0.03); }
.screener td { padding: 13px 16px; border-top: 1px solid var(--line); text-align: right; color: var(--t-1); }
.screener td:first-child { text-align: left; }
.screener td.name { text-align: left; color: var(--t-2); font-family: var(--sans); font-size: 12.5px; }
.screener td .sym { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.screener .pill { font-size: 10px; padding: 3px 8px; border-radius: 4px; }
.screener .pill.low { color: var(--green); background: rgba(37,208,125,0.12); }
.screener .pill.med { color: var(--amber); background: rgba(232,184,75,0.12); }
.screener .pill.high { color: var(--red); background: rgba(255,77,77,0.12); }

.view-title { font-family: var(--ui); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.view-sub { font-family: var(--mono); font-size: 12px; color: var(--t-3); margin-top: 5px; }
.view-head { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* alerts */
.alert { display: flex; gap: 14px; padding: 16px 16px 16px 15px; border: none; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; border-radius: 0; background: none; margin: 0; align-items: flex-start; width: 100%; text-align: left; transition: background .12s; }
.alert:hover { background: rgba(255,255,255,0.02); }
.alert.crit { border-left-color: var(--red); }
.alert.warn { border-left-color: var(--amber); }
.alert.info { border-left-color: var(--green); }
.alert .abadge { width: 24px; height: 24px; background: none; border-radius: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.alert .abadge svg { width: 20px; height: 20px; }
.alert.crit .abadge { color: var(--red); }
.alert.warn .abadge { color: var(--amber); }
.alert.info .abadge { color: var(--green); }
.alert .atitle { font-size: 14px; font-weight: 600; }
.alert .adesc { font-size: 13px; color: var(--t-2); margin-top: 4px; line-height: 1.5; }
.alert .ameta { font-family: var(--mono); font-size: 10px; color: var(--t-3); margin-top: 8px; }
.alert .asym { font-family: var(--mono); font-size: 12px; color: var(--green); margin-left: auto; }

/* ---------- MAP ---------- */
.map-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.mapbox { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px; overflow: hidden; }
.world { display: block; width: 100%; }
.mk { cursor: pointer; }
.mk .halo { transform-box: fill-box; transform-origin: center; animation: mkpulse 2.6s ease-out infinite; }
@keyframes mkpulse { 0% { transform: scale(0.32); opacity: .5; } 70%,100% { transform: scale(1.5); opacity: 0; } }

/* ---------- EXPLORE ---------- */
.exp-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.exp-grid .span2 { grid-column: 1 / -1; }
.metric-big { display: flex; gap: 30px; flex-wrap: wrap; }
.metric-big .mbl { font-family: var(--ui); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--t-3); }
.metric-big .mbv { font-family: var(--mono); font-size: 25px; font-weight: 500; margin-top: 6px; }
.opt-controls { display: flex; flex-direction: column; gap: 17px; }
.opt-row { display: flex; flex-direction: column; gap: 9px; }
.opt-row .ol { display: flex; justify-content: space-between; font-family: var(--ui); font-size: 12.5px; color: var(--t-1); }
.opt-row .ol b { font-family: var(--mono); color: var(--green); font-weight: 500; }
.opt-row input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 3px; background: var(--line-2); outline: none; }
.opt-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--green); cursor: pointer; box-shadow: 0 0 0 4px rgba(37,208,125,0.16); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-family: var(--ui); font-size: 12.5px; color: var(--t-1); }
.switch { width: 38px; height: 22px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .18s; flex: none; }
.switch.on { background: var(--green); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch.on::after { transform: translateX(16px); }
.rebal { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.rebal th { text-align: right; font-family: var(--ui); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--t-3); font-weight: 600; padding: 0 12px 10px; }
.rebal th:first-child { text-align: left; }
.rebal td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: right; color: var(--t-1); }
.rebal td:first-child { text-align: left; }
.rebal td .sym { font-family: var(--sans); font-weight: 600; color: var(--ink); font-size: 13px; }
.wbar { display: inline-block; height: 6px; border-radius: 3px; background: var(--green); vertical-align: middle; margin-right: 8px; min-width: 2px; }
.scatter-leg { display: flex; gap: 16px; margin-top: 12px; font-family: var(--mono); font-size: 10px; color: var(--t-2); }

.hidden { display: none !important; }

/* ===================== RESEARCH — COMPARISON ===================== */
.cmp-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cmp-tickers { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cmp-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink);
  padding: 7px 8px 7px 12px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line-2);
}
.cmp-chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.cmp-chip button { width: 18px; height: 18px; border-radius: 5px; color: var(--t-3); display: flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.cmp-chip button:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.cmp-chip button svg { width: 11px; height: 11px; }
.cmp-add {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ui); font-size: 12.5px; font-weight: 500; color: var(--green);
  padding: 8px 13px; border-radius: 8px; border: 1px dashed rgba(37,208,125,0.4);
  transition: background .15s, border-color .15s;
}
.cmp-add:hover { background: rgba(37,208,125,0.07); border-color: var(--green); }
.cmp-add svg { width: 13px; height: 13px; }
.cmp-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg .range-btn { border-radius: 6px; padding: 6px 11px; }

.cmp-panel { margin-bottom: 22px; }
.cmp-panel .panel-b { padding: 14px 16px 10px; }
.cmp-svg { display: block; width: 100%; }
.cmp-svg text { font-family: var(--mono); fill: var(--t-3); font-size: 10px; }
.cmp-svg .endlab { font-family: var(--sans); font-weight: 700; font-size: 11px; }
.cmp-empty, .cmp-empty-tbl { font-family: var(--mono); font-size: 12.5px; color: var(--t-3); padding: 60px 0; text-align: center; }
.cmp-tip { transform: none; padding: 9px 11px; min-width: 152px; }
.cmp-tip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; font-family: var(--mono); font-size: 11px; }
.cmp-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.cmp-tip-row .ctr-s { font-family: var(--sans); font-weight: 600; color: var(--ink); width: 52px; }
.cmp-tip-row b { font-weight: 500; }
.cmp-tip-row .ctr-p { color: var(--t-3); margin-left: auto; }

.cmp-table-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cmp-table-head .bt { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--t-1); }
.cmp-table-head .bsub { font-family: var(--mono); font-size: 11px; color: var(--t-3); margin-top: 4px; }
.cmp-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.cmp-table thead th {
  text-align: right; font-family: var(--ui); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--t-3); font-weight: 600; padding: 0 14px 12px; white-space: nowrap;
}
.cmp-table thead th:nth-child(1), .cmp-table thead th:nth-child(2) { text-align: left; }
.cmp-table td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: right; color: var(--t-1); white-space: nowrap; }
.cmp-table td:nth-child(1), .cmp-table td:nth-child(2) { text-align: left; }
.cmp-table td.name { color: var(--t-2); font-family: var(--sans); font-size: 12.5px; }
.cmp-table .csw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; margin-right: 9px; }
.cmp-table .sym { font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.cmp-table .pill { font-size: 10px; padding: 3px 8px; border-radius: 4px; }
.cmp-table .pill.low { color: var(--green); background: rgba(37,208,125,0.12); }
.cmp-table .pill.med { color: var(--amber); background: rgba(232,184,75,0.12); }
.cmp-table .pill.high { color: var(--red); background: rgba(255,77,77,0.12); }
.cmp-table .na { color: var(--t-3); }
.cmp-table .rmcell { text-align: center; padding: 12px 8px; }
.cmp-table .rmcell button { width: 24px; height: 24px; border-radius: 5px; color: var(--t-3); display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.cmp-table .rmcell button:hover { background: rgba(255,77,77,0.12); color: var(--red); }

/* compare add popover */
.cmp-picker { width: 288px; padding: 0; overflow: hidden; }
.cmp-picker .pk-search { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--t-3); }
.cmp-picker .pk-search svg { width: 14px; height: 14px; flex: none; }
.cmp-picker .pk-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-family: var(--mono); font-size: 12.5px; }
.cmp-picker .pk-search input::placeholder { color: var(--t-3); }
.cmp-picker .pk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmp-picker .pk-grp { font-family: var(--ui); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--t-3); padding: 9px 8px 5px; }
.cmp-picker .pk-list button { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 9px; border-radius: 7px; text-align: left; }
.cmp-picker .pk-list button:hover { background: rgba(255,255,255,0.06); }
.cmp-picker .pk-sym { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink); width: 56px; flex: none; }
.cmp-picker .pk-name { font-family: var(--sans); font-size: 12px; color: var(--t-1); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-picker .pk-sec { font-family: var(--mono); font-size: 9.5px; color: var(--t-3); flex: none; }
.cmp-picker .pk-none { font-family: var(--mono); font-size: 12px; color: var(--t-3); padding: 22px; text-align: center; }

/* ===================== SCREENER — FILTERS + COLUMNS ===================== */
.sh-actions { display: flex; align-items: center; gap: 10px; }
.screen-filters {
  display: flex; align-items: center; gap: 16px 18px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.sf-search { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--t-3); }
.sf-search:focus-within { border-color: var(--line-2); }
.sf-search svg { width: 15px; height: 15px; flex: none; }
.sf-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-family: var(--mono); font-size: 12.5px; }
.sf-search input::placeholder { color: var(--t-3); }
.sf-group { display: flex; align-items: center; gap: 9px; }
.sf-l { font-family: var(--ui); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--t-3); }
.sf-sel {
  font-family: var(--ui); font-size: 12.5px; color: var(--t-1);
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 28px 8px 11px; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%236f7a74' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 15px;
}
.sf-sel:hover { border-color: var(--line-2); }
.sf-chips { display: flex; gap: 4px; }
.sf-reset { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ui); font-size: 12px; color: var(--t-2); padding: 7px 11px; border-radius: 7px; border: 1px solid var(--line-2); transition: color .15s, border-color .15s; }
.sf-reset:hover { color: var(--red); border-color: rgba(255,77,77,0.4); }
.sf-reset svg { width: 12px; height: 12px; }
.screen-count { font-family: var(--mono); font-size: 11px; color: var(--t-3); margin-bottom: 12px; }
.screener td .s-name { font-family: var(--sans); font-size: 12.5px; color: var(--t-2); }
.screener th.tl, .screener td.tl { text-align: left; }
.screener .na { color: var(--t-3); }
.screener td .pill { font-size: 10px; padding: 3px 8px; border-radius: 4px; }
.screener .s-empty { text-align: center; color: var(--t-3); font-family: var(--mono); padding: 40px 0; }

.col-picker { width: 232px; }
.col-picker .ph { font-family: var(--ui); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--t-3); padding: 9px 10px 7px; }
.col-list { max-height: 360px; overflow-y: auto; }
.col-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; font-family: var(--ui); font-size: 13px; color: var(--t-1); }
.col-opt:hover { background: rgba(255,255,255,0.05); }
.col-opt .cb { width: 17px; height: 17px; border-radius: 5px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--green); flex: none; }
.col-opt.on .cb { background: rgba(37,208,125,0.14); border-color: rgba(37,208,125,0.5); }

/* ===================== MAP — TILE CHOROPLETH ===================== */
.map-scope { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.map-scope .range-btn { border-radius: 6px; padding: 6px 12px; }
.map-metrics { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.map-metrics .mm-l { font-family: var(--ui); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--t-3); margin-right: 4px; }
.map-section { margin-top: 6px; }
.map-section + .map-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.map-section-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.map-section-h .ms-title { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--ink); }
.map-section-h .ms-sub { font-family: var(--mono); font-size: 11px; color: var(--t-3); }
.tilemap { display: grid; gap: 6px; width: 100%; }
.tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: default; transition: transform .12s, box-shadow .12s, outline-color .12s;
  outline: 1px solid transparent; min-width: 0;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.4); outline-color: rgba(244,246,245,0.35); z-index: 2; }
.tile .tc { font-family: var(--sans); font-weight: 700; font-size: clamp(9px, 1.1vw, 13px); letter-spacing: -0.02em; }
.tile .tv { font-family: var(--mono); font-size: clamp(7px, 0.75vw, 9.5px); opacity: 0.82; }
.tile-legend { margin-top: 16px; max-width: 360px; }
.legbar { height: 9px; border-radius: 5px; }
.legbar.div { background: linear-gradient(90deg, rgba(255,77,77,0.9), rgba(255,77,77,0.18), rgba(244,246,245,0.08), rgba(37,208,125,0.18), rgba(37,208,125,0.9)); }
.legbar.seq { background: linear-gradient(90deg, rgba(37,208,125,0.12), rgba(37,208,125,0.92)); }
.legbar.rate { background: linear-gradient(90deg, rgba(232,184,75,0.14), rgba(232,184,75,0.92)); }
.leglabels { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 10px; color: var(--t-3); }

/* ===================== GEO MAP (vector world / US) ===================== */
.mapbox { min-height: 300px; display: block; }
.mapbox.loading::after { content: "Loading map\2026"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; color: var(--t-3); }
.geomap { display: block; width: 100%; height: auto; }
.geomap .geo { stroke: rgba(244,246,245,0.14); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill .15s, stroke .12s; cursor: default; }
.geomap .geo:hover, .geomap .geo.hot { stroke: rgba(244,246,245,0.85); stroke-width: 1.4; }
.geo-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; color: var(--t-3); font-family: var(--mono); font-size: 12px; }
.geo-fallback svg { width: 26px; height: 26px; opacity: .6; }

/* ===================== DATA PRODUCTS ===================== */
.product-banner { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin-bottom: 18px; }
.product-banner .pb-mark { width: 46px; height: 46px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(37,208,125,0.1); color: var(--green); border: 1px solid rgba(37,208,125,0.28); }
.product-banner .pb-mark svg { width: 22px; height: 22px; }
.product-banner .pb-main { flex: 1; min-width: 0; }
.product-banner .pb-name { font-family: var(--ui); font-size: 17px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.product-banner .pb-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--green); border: 1px solid rgba(37,208,125,0.3); border-radius: 4px; padding: 3px 8px; }
.product-banner .pb-desc { font-family: var(--ui); font-size: 13px; line-height: 1.5; color: var(--t-2); margin-top: 6px; max-width: 760px; text-wrap: pretty; }
.product-banner .pb-meta { text-align: right; flex: none; padding-left: 18px; border-left: 1px solid var(--line); }
.product-banner .pbm-k { font-family: var(--ui); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--t-3); }
.product-banner .pbm-v { font-family: var(--mono); font-size: 26px; font-weight: 500; color: var(--ink); margin-top: 2px; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.data-grid .span2 { grid-column: 1 / -1; }
.data-headline { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.data-headline .dh-v { font-family: var(--mono); font-size: 30px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.data-headline .dh-meta { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 12px; }
.data-headline .dh-src { color: var(--t-3); }
.data-analysis { font-family: var(--ui); font-size: 13.5px; line-height: 1.62; color: var(--t-1); text-wrap: pretty; }
.data-table { width: 100%; }
.data-table th, .data-table td { padding: 11px 16px; }
#dataChart { width: 100%; min-height: 320px; }

@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: 1fr; }
  .board, .sub-grid, .map-wrap, .exp-grid, .data-grid { grid-template-columns: 1fr; }
  .vcard.wide { grid-column: auto; }
}
@media (max-width: 760px) {
  .body { grid-template-columns: 1fr; }
  .folders { display: none; }
  .topnav .search { flex: 0 1 150px; }
  .topnav-links .nav-i span, .topnav-links .nav-i { font-size: 12px; padding: 0 9px; }
}

/* ===================== THEME VARIANTS (brightness) ===================== */
/* Graphite = :root default (darkest). Slate steps climb lighter. */
html[data-theme="slate"] {
  --bg: #212730;
  --panel: #29303a;
  --panel-2: #313945;
  --line: rgba(244,246,245,0.10);
  --line-2: rgba(244,246,245,0.17);
  --ink: #f5f7f6;
  --t-1: #ced6d1;
  --t-2: #a6b1ab;
  --t-3: #7e8a83;
}
html[data-theme="slate-light"] {
  --bg: #2b323c;
  --panel: #343c47;
  --panel-2: #3d4651;
  --line: rgba(244,246,245,0.11);
  --line-2: rgba(244,246,245,0.19);
  --ink: #f6f8f7;
  --t-1: #d6ddd8;
  --t-2: #b0bab4;
  --t-3: #8a958e;
}
html[data-theme="mist"] {
  --bg: #353d48;
  --panel: #3f4853;
  --panel-2: #49525e;
  --line: rgba(244,246,245,0.13);
  --line-2: rgba(244,246,245,0.22);
  --ink: #f8faf9;
  --t-1: #dde3df;
  --t-2: #bbc4be;
  --t-3: #95a09a;
}
html[data-theme="daylight"] {
  --bg: #e7ebe9;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --chrome-tint: #2a3340;
  --line: rgba(20,32,27,0.10);
  --line-2: rgba(20,32,27,0.18);
  --green: #12925a;
  --green-dim: #0f6e44;
  --red: #d83a3a;
  --amber: #b07d12;
  --blue: #2f72c4;
  --ink: #16201b;
  --t-1: #36413a;
  --t-2: #5d6862;
  --t-3: #899189;
}

/* ----- Sidebar & menu chrome darkness (independent of brightness) ----- */
html[data-chrome="soft"]   { --chrome-mix: 10%; }
html[data-chrome="dark"]   { --chrome-mix: 24%; }
html[data-chrome="deep"]   { --chrome-mix: 40%; }
/* On Daylight, the chrome tint is a cool ink — keep the mix gentler so rails read as tinted, not muddy */
html[data-theme="daylight"][data-chrome="soft"] { --chrome-mix: 5%; }
html[data-theme="daylight"][data-chrome="dark"] { --chrome-mix: 9%; }
html[data-theme="daylight"][data-chrome="deep"] { --chrome-mix: 15%; }
/* Daylight: swap the dark-surface white tints for ink tints so states stay visible */
html[data-theme="daylight"] .range-btn.active,
html[data-theme="daylight"] .fchip.active,
html[data-theme="daylight"] .topnav-links .nav-i.active.is-pill { background: rgba(20,32,27,0.06); }
html[data-theme="daylight"] .barline .track { background: rgba(20,32,27,0.08); }
html[data-theme="daylight"] .tk:hover,
html[data-theme="daylight"] .folder-h:hover,
html[data-theme="daylight"] .screener tbody tr:hover,
html[data-theme="daylight"] .alert:hover,
html[data-theme="daylight"] .icon-btn:hover,
html[data-theme="daylight"] .col-opt:hover,
html[data-theme="daylight"] .picker button:hover,
html[data-theme="daylight"] .cmp-picker .pk-list button:hover,
html[data-theme="daylight"] .vcard-h .vx button:hover,
html[data-theme="daylight"] .folders-rail:hover,
html[data-theme="daylight"] .cmp-chip button:hover { background: rgba(20,32,27,0.05); }
html[data-theme="daylight"] ::-webkit-scrollbar-thumb { background: rgba(20,32,27,0.18); }
html[data-theme="daylight"] .crosshair-tip,
html[data-theme="daylight"] .rail .nav-i .tip { background: #1d2622; color: #f5f7f6; }
/* chart gridlines / crosshair lines are inline stroke attrs — CSS overrides them on light bg */
html[data-theme="daylight"] .cmp-svg line { stroke: rgba(20,32,27,0.09); }
html[data-theme="daylight"] .geomap .geo { stroke: rgba(20,32,27,0.18); }
html[data-theme="daylight"] .geomap .geo:hover,
html[data-theme="daylight"] .geomap .geo.hot { stroke: rgba(20,32,27,0.7); }

/* ===================== MENU BAR VARIANTS ===================== */
/* underline = default. */
html[data-nav="pills"] .topnav-links { gap: 4px; align-items: center; }
html[data-nav="pills"] .topnav-links .navsep { display: none; }
html[data-nav="pills"] .topnav-links .nav-i { align-self: center; border-bottom: none; border-radius: 8px; padding: 7px 13px; }
html[data-nav="pills"] .topnav-links .nav-i.active { border-bottom: none; background: rgba(37,208,125,0.13); color: var(--green); }

html[data-nav="segmented"] .topnav-links { align-self: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
html[data-nav="segmented"] .topnav-links .navsep { display: none; }
html[data-nav="segmented"] .topnav-links .nav-i { align-self: stretch; border-bottom: none; border-radius: 6px; padding: 6px 12px; }
html[data-nav="segmented"] .topnav-links .nav-i.active { border-bottom: none; background: rgba(255,255,255,0.07); color: var(--ink); }
html[data-theme="daylight"][data-nav="segmented"] .topnav-links .nav-i.active { background: rgba(20,32,27,0.06); }

html[data-nav="minimal"] .topnav-links { gap: 2px; }
html[data-nav="minimal"] .topnav-links .navsep { display: none; }
html[data-nav="minimal"] .topnav-links .nav-i { gap: 0; border-bottom: none; padding: 0 12px; letter-spacing: 0.01em; }
html[data-nav="minimal"] .topnav-links .nav-i svg { display: none; }
html[data-nav="minimal"] .topnav-links .nav-i.active { border-bottom: none; color: var(--green); }

/* ===================== TWEAKS PANEL ===================== */
.tweaks-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 200; width: 248px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5); padding: 6px; font-family: var(--ui);
  animation: twin .16s ease;
}
@keyframes twin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tweaks-panel[hidden] { display: none; }
.tweaks-panel .tw-head { display: flex; align-items: center; padding: 8px 10px 10px; }
.tweaks-panel .tw-head span { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.tweaks-panel .tw-head button { margin-left: auto; width: 24px; height: 24px; border-radius: 6px; color: var(--t-3); display: flex; align-items: center; justify-content: center; }
.tweaks-panel .tw-head button:hover { background: rgba(127,127,127,0.14); color: var(--ink); }
.tweaks-panel .tw-head button svg { width: 15px; height: 15px; }
.tweaks-panel .tw-sec { padding: 8px 8px 10px; }
.tweaks-panel .tw-l { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--t-3); margin: 0 4px 8px; }
.tweaks-panel .tw-opts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.tweaks-panel .tw-opts.col { grid-template-columns: 1fr 1fr; }
.tweaks-panel .tw-opts button {
  font-family: var(--ui); font-size: 12px; color: var(--t-2);
  padding: 8px 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel);
  transition: color .12s, border-color .12s, background .12s;
}
.tweaks-panel .tw-opts button:hover { color: var(--ink); border-color: var(--line-2); }
.tweaks-panel .tw-opts button.on { color: var(--ink); border-color: rgba(37,208,125,0.55); background: rgba(37,208,125,0.12); }

/* ===================== v1 ADDITIONS ===================== */
/* demo/live mode pill */
.live-pill.demo { color: var(--amber); }
.live-pill.demo .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* "coming soon" / locked affordances */
.locked { opacity: 0.55; cursor: not-allowed; }
.fchip.locked { display: inline-flex; align-items: center; gap: 6px; border-style: dashed; }
.fchip.locked svg { width: 12px; height: 12px; }
.fchip.locked:hover { color: var(--t-2); border-color: var(--line); background: none; }
.col-opt.locked { color: var(--t-3); }
.col-opt.locked:hover { background: none; }
.col-opt .soon-tag, .soon-tag {
  margin-left: auto; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber); border: 1px solid rgba(232,184,75,0.4); border-radius: 4px; padding: 2px 6px;
}
.alert.locked { cursor: default; }
.alert.locked:hover { background: none; }
.alert .asym.soon-tag { color: var(--amber); margin-left: auto; }
.cmp-picker .pk-list button.locked { cursor: not-allowed; }
.cmp-picker .pk-list button.locked:hover { background: none; }
.cmp-picker .pk-soon { font-family: var(--mono); font-size: 9.5px; color: var(--amber); display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.cmp-picker .pk-soon svg { width: 11px; height: 11px; }

/* map — global "coming soon" placeholder */
.soon-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 220px; padding: 30px; background: var(--panel);
  border: 1px dashed var(--line-2); border-radius: 6px; color: var(--t-3);
}
.soon-panel svg { width: 26px; height: 26px; opacity: .7; }
.soon-panel .soon-t { font-family: var(--ui); font-size: 15px; font-weight: 600; color: var(--t-1); }
.soon-panel .soon-d { font-family: var(--ui); font-size: 12.5px; color: var(--t-3); max-width: 460px; line-height: 1.55; }

/* account */
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.acct-grid .span2 { grid-column: 1 / -1; }
.api-key { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-key code {
  flex: 1; min-width: 200px; font-family: var(--mono); font-size: 12.5px; color: var(--green);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; word-break: break-all;
}
.api-note { font-family: var(--ui); font-size: 12px; line-height: 1.55; color: var(--t-3); margin-top: 12px; }
.api-note code { font-family: var(--mono); font-size: 11px; color: var(--t-2); background: var(--bg); border-radius: 4px; padding: 1px 5px; }

/* appearance switcher */
.appearance { display: flex; flex-direction: column; gap: 16px; }
.ap-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ap-l { font-family: var(--ui); font-size: 12px; font-weight: 500; color: var(--t-1); width: 130px; flex: none; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: #2a3036; color: var(--ink); font-family: var(--ui); font-size: 13px;
  padding: 11px 17px; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity .25s, transform .25s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* map — world placeholder badge + note */
.map-section-h .soon-tag { margin-left: 0; }
.mapbox .ph-badge {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  color: var(--amber); background: color-mix(in srgb, var(--panel), transparent 8%);
  border: 1px solid rgba(232,184,75,0.4); border-radius: 6px; padding: 5px 9px;
}
.mapbox .ph-badge svg { width: 12px; height: 12px; }
.map-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; padding: 13px 15px;
  background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--amber);
  border-radius: 6px; font-family: var(--ui); font-size: 12.5px; line-height: 1.55; color: var(--t-2);
}
.map-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--amber); }
.map-note b { color: var(--t-1); font-weight: 600; }
