/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;
  --page: #090b0e;
  --surface: #11141a;
  --raised: #171b22;
  --hover: #1d222b;
  --line: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(255, 255, 255, 0.11);
  --text: #e4e3de;
  --text-2: #a5a39c;
  --muted: #75736d;
  --grid: #20242c;
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.14);
  --up: #45b96a;
  --down: #df6f6f;
  --warn: #fab219;
  --serious: #ec835a;
  --bull: #3987e5;
  --bear: #e66767;
  --mid: #383835;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* numbers use the same face with fixed-width digits; --code is the real monospace, for code and key hints only */
  --mono: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --code: "Geist Mono", "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --top-bg: rgba(8, 9, 12, .86);
  --side-bg: #0b0d11;
  --shadow: none;
  --pop-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  /* chart ink that has to flip with the background */
  --fc-typical: #ffffff;
  --fc-sd: rgba(215, 215, 215, .75);
  --fc-path: rgba(210, 210, 210, .07);
  --fc-path-soft: rgba(210, 210, 210, .12);
  --exh: #ffffff;
  --exh-soft: rgba(255, 255, 255, .62);
  --r: 14px;
  --r-sm: 7px;
  --side: 224px;
  --top: 54px;
}
/* Light theme: the same tokens, swapped (html[data-theme="light"], set before first paint in app.html). Charts read
   the tokens when drawn, so switching theme re-renders the page. */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f5f7;
  --surface: #ffffff;
  --raised: #f3f4f7;
  --hover: #eaedf2;
  --line: rgba(17, 24, 39, 0.07);
  --line-strong: rgba(17, 24, 39, 0.13);
  --text: #1a1d23;
  --text-2: #565c68;
  --muted: #8a8f99;
  --grid: #eceef2;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --up: #16a34a;
  --down: #dc2626;
  --warn: #c27803;
  --serious: #d4572a;
  --bull: #2563eb;
  --bear: #dc2626;
  --mid: #d4d6db;
  --s1: #2563eb; --s2: #d95926; --s3: #0f8a5f; --s4: #b07400;
  --s5: #c23c6d; --s6: #087a08; --s7: #6d5fd6; --s8: #dc2626;
  --top-bg: rgba(255, 255, 255, .88);
  --side-bg: #fbfbfc;
  --shadow: 0 1px 2px rgba(17, 24, 39, .03);
  --pop-shadow: 0 10px 30px rgba(17, 24, 39, .14);
  --fc-typical: #111418;
  --fc-sd: rgba(40, 44, 52, .7);
  --fc-path: rgba(40, 44, 52, .06);
  --fc-path-soft: rgba(40, 44, 52, .10);
  --exh: #111418;
  --exh-soft: rgba(17, 20, 24, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 400 13.5px/1.55 var(--sans); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; letter-spacing: -0.003em; }
h1, h2, h3, .page-h h1 { letter-spacing: -0.02em; }
/* one weight step for emphasis everywhere: bold reads as shouting at terminal density */
b, strong { font-weight: 500; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: 0; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.up { color: var(--up); }
.down { color: var(--down); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.caps { text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ------------------------------------------------------------------ shell */
/* sidebar runs full height on the left (brand on top); the header sits to its right */
.top {
  position: fixed; top: 0; right: 0; left: var(--side); height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--top-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transition: left .18s ease;
}
.today { font-size: 12.5px; color: var(--text-2); white-space: nowrap; flex: none; }
.theme-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; flex: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
}
.theme-btn:hover { color: var(--text); background: var(--hover); }
.acct { position: relative; flex: none; }
/* account pill: initial, email, tier, chevron */
.acct-btn {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 12.5px; max-width: 270px;
}
.acct-btn:hover { background: var(--hover); color: var(--text); }
.acct-btn .av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--text); font-weight: 500; font-size: 11px; }
.acct-btn .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn .tier { font-size: 9.5px; font-weight: 500; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); }
.acct-btn svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.acct-menu {
  position: absolute; right: 0; top: 40px; min-width: 220px; z-index: 40; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--pop-shadow);
}
.acct-menu button { width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.acct-menu button:hover { background: var(--hover); color: var(--text); }
.theme-btn svg { width: 16px; height: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; font-size: 13px; min-width: 0; overflow: hidden; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.brand .wordmark { display: block; height: 13px; width: auto; color: var(--text); }
.search { position: relative; flex: 0 1 260px; margin-left: auto; }
.search input {
  width: 100%; height: 32px; padding: 0 34px 0 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); outline: none; font-size: 12.5px;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; color: var(--muted); }
.search kbd {
  position: absolute; right: 7px; top: 7px; height: 18px; min-width: 18px; padding: 0 5px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 4px; font: 11px var(--code); color: var(--muted); pointer-events: none;
}
.search-results {
  position: absolute; top: 38px; left: 0; right: 0; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden; display: none; max-height: 360px; overflow-y: auto;
}
.search-results.open { display: block; }
.search-results a { display: flex; gap: 10px; padding: 8px 12px; align-items: baseline; }
.search-results a:hover, .search-results a.sel { background: var(--hover); }
.tape { display: flex; gap: 18px; overflow: hidden; flex: 1; min-width: 0; white-space: nowrap; font-size: 12px; }
.tape span b { font-weight: 500; color: var(--muted); margin-right: 6px; }
.status { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }

.side {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); z-index: 25; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--side-bg); transition: width .18s ease;
}
.side-top {
  height: var(--top); flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px 0 16px; border-bottom: 1px solid var(--line);
}
.side-collapse {
  width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 6px; cursor: pointer;
  background: none; border: 0; color: var(--muted);
}
.side-collapse:hover { background: var(--hover); color: var(--text); }
.side-collapse svg, .side .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-collapse svg { transition: transform .18s ease; }
.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px 22px; }
.side h6 { margin: 20px 10px 6px; font-size: 10px; font-weight: 500; letter-spacing: .08em; white-space: nowrap; color: var(--muted); opacity: .8; }
.side h6:first-child { margin-top: 6px; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 1px 0; border-radius: 7px;
  color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.side a .ic { color: var(--muted); }
.side a:hover { background: var(--hover); color: var(--text); }
.side a:hover .ic { color: var(--text-2); }
.side a.active { background: var(--hover); color: var(--text); font-weight: 500; }
.side a.active .ic { color: var(--accent); }
.side a .chip { font-size: 10px; padding: 1px 6px; }
.side-foot { margin: 22px 10px 0; font-size: 11px; color: var(--muted); line-height: 1.6; }

/* collapsed: icons only (labels show as tooltips), section titles become thin rules */
body.side-min { --side: 60px; }
body.side-min .brand span, body.side-min .side a span, body.side-min .side-foot { display: none; }
body.side-min .side-top { padding: 0; justify-content: center; }
body.side-min .side-top .brand { display: none; }
body.side-min .side-collapse svg { transform: rotate(180deg); }
body.side-min .side a { justify-content: center; padding: 8px 0; }
body.side-min .side h6 { height: 1px; margin: 12px 10px; background: var(--line); overflow: hidden; color: transparent; }

main { margin-left: var(--side); padding: calc(var(--top) + 22px) 28px 48px; max-width: 1640px; transition: margin-left .18s ease; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 21px; font-weight: 500; letter-spacing: -.025em; }
.page-h p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }

/* ------------------------------------------------------------------ layout */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
@media (max-width: 1200px) { .c3 { grid-column: span 6; } .c4, .c5, .c7, .c8 { grid-column: span 12; } .c6 { grid-column: span 12; } .c9 { grid-column: span 12; } }

.eq { display: flex; flex-direction: column; } .eq > .card { flex: 1; }   /* cards side by side share one height */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: -.005em; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* chips: a faint tint and coloured text, no outline; colour carries the meaning, not weight */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 500; border: 1px solid transparent; background: var(--raised); color: var(--text-2); white-space: nowrap;
}
.chip.up { color: var(--up); background: rgba(69, 185, 106, .09); }
.chip.down { color: var(--down); background: rgba(223, 111, 111, .09); }
.chip.warn { color: var(--warn); background: rgba(250, 178, 25, .08); }
.chip.info { color: var(--accent); background: var(--accent-soft); }
.chip.sample { color: var(--serious); background: rgba(236, 131, 90, .08); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
  border: 1px solid rgba(236, 131, 90, .35); background: rgba(236, 131, 90, .07); color: var(--text-2); font-size: 13px;
}
.banner b { color: var(--serious); }

/* ------------------------------------------------------------------ stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.tile .value { font-size: 24px; font-weight: 400; margin-top: 6px; letter-spacing: -.03em; }
.tile .foot { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ------------------------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; user-select: none;
  position: sticky; top: 0; background: var(--surface);
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sorted::after { content: " ▾"; }
.tbl th.sorted.asc::after { content: " ▴"; }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .r, .tbl th.r { text-align: right; }
.tbl .sym { font-weight: 500; font-family: var(--mono); }
.tbl-scroll { max-height: 520px; overflow-y: auto; }

.heat { display: inline-block; min-width: 54px; text-align: center; padding: 2px 6px; border-radius: 5px; font-family: var(--mono); font-size: 12.5px; }
.bar-cell { position: relative; height: 6px; background: var(--raised); border-radius: 3px; min-width: 70px; overflow: hidden; }
.bar-cell i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 3px; }

/* ------------------------------------------------------------------ widgets */
.votes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.vote { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--raised); }
.vote .nm { font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; gap: 6px; }
.vote .st { font-weight: 500; margin-top: 4px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.vote .dt { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) { .votes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.meter { display: flex; gap: 4px; margin: 10px 0 4px; }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--raised); border: 0; }
.meter i.on { background: var(--bull); border-color: transparent; }

.log { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 82px 18px 1fr; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.log li:last-child { border-bottom: 0; }

.chart { width: 100%; height: 300px; position: relative; }
.chart.tall { height: 380px; }
.chart.short { height: 200px; }
.chart.mini { height: 140px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.band { height: 10px; width: 10px; border-radius: 2px; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 7px; padding: 6px 9px; font-size: 12px; display: none; white-space: nowrap; box-shadow: var(--pop-shadow);
}
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 7px; padding: 6px 9px; font-size: 12px; display: none; max-width: 320px; box-shadow: var(--pop-shadow);
}

.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 5px 12px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.tabs button.on { background: var(--hover); color: var(--text); font-weight: 500; }
:root[data-theme="light"] .tabs button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(17, 24, 39, .1); }
:root[data-theme="light"] .tabs { background: var(--raised); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select {
  height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
}

.btn { height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 12px; }
.btn:hover, .btn:focus-visible { color: var(--text); background: var(--hover); }
.page-h select, #liq-custom { height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); }

.empty { padding: 40px; text-align: center; color: var(--muted); }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.err { padding: 20px; color: var(--down); }

.note-body { line-height: 1.7; max-width: 820px; color: var(--text-2); }
.note-body h1, .note-body h2, .note-body h3 { color: var(--text); margin: 1.2em 0 .4em; }
.note-body code { font-family: var(--code); background: var(--raised); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.note-body pre { background: var(--raised); padding: 12px; border-radius: 8px; overflow-x: auto; }
.note-body pre code { background: none; padding: 0; }
.note-body a { color: var(--accent); }
button.chip { cursor: pointer; background: var(--surface); }
button.chip:hover { background: var(--hover); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 900px) {
  :root, body.side-min { --side: 0px; }
  .menu-btn { display: block; }
  .tape, .today, .status .hide-m, .side-collapse { display: none; }
  .acct-btn .em, .acct-btn .tier { display: none; }
  .side { transform: translateX(-100%); width: 260px; transition: transform .2s; z-index: 30; }
  body.side-min .side a span, body.side-min .brand span { display: inline; }
  body.side-min .side a { justify-content: flex-start; padding: 6px 10px; }
  body.side-min .side-top { padding: 0 10px 0 16px; justify-content: space-between; }
  body.side-min .side-top .brand { display: flex; }
  body.side-min .side h6 { height: auto; margin: 18px 10px 6px; background: none; color: var(--muted); }
  body.nav-open .side { transform: none; box-shadow: var(--pop-shadow); }
  main { padding: calc(var(--top) + 16px) 16px 40px; }
  .search { flex: 1; }
}

/* ---------------------------------------------------------------- assistant panel (jarvis.js) */
.jv-fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 54px; height: 54px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; box-shadow: var(--pop-shadow); overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease; }
.jv-fab:hover { transform: translateY(-2px) scale(1.04); }
.jv-fab img, .jv-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.jv-fab.open { transform: scale(.9); opacity: .85; }
.jv-fab.speaking, .jv-panel.speaking .jv-head .jv-av { box-shadow: 0 0 0 3px rgba(90, 209, 255, .55), 0 0 22px rgba(90, 209, 255, .45); animation: jv-pulse 1.4s ease-in-out infinite; }
@keyframes jv-pulse { 50% { box-shadow: 0 0 0 6px rgba(90, 209, 255, .25), 0 0 30px rgba(90, 209, 255, .5); } }
.jv-panel { position: fixed; right: 22px; bottom: 88px; z-index: 70; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--pop-shadow); overflow: hidden; }
.jv-panel[hidden] { display: none; }
.jv-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.jv-av { width: 36px; height: 36px; border-radius: 50%; flex: none; transition: box-shadow .2s ease; }
.jv-av.sm { width: 26px; height: 26px; margin-top: 2px; }
.jv-av.lg { width: 64px; height: 64px; margin: 0 auto; }
.jv-name { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.jv-status { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jv-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; flex: none; }
.jv-icon:hover { background: var(--raised); color: var(--text); }
.jv-icon.on { color: var(--accent); }
.jv-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.jv-empty { margin: auto 0; text-align: center; padding: 10px 8px; }
.jv-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.jv-chip { border: 1px solid var(--line-strong); background: var(--raised); color: var(--text-2); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.jv-chip:hover { color: var(--text); border-color: var(--accent); }
.jv-msg { display: flex; gap: 8px; align-items: flex-start; }
.jv-msg.me { justify-content: flex-end; }
.jv-bubble { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.jv-msg.me .jv-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.jv-msg.ai .jv-bubble { background: var(--raised); color: var(--text); border-bottom-left-radius: 4px; }
.jv-msg.err .jv-bubble { background: rgba(236, 90, 90, .1); color: var(--text-2); border: 1px solid rgba(236, 90, 90, .35); }
.jv-bubble p { margin: 0 0 8px; } .jv-bubble p:last-child { margin: 0; }
.jv-bubble ul, .jv-bubble ol { margin: 4px 0 8px; padding-left: 18px; } .jv-bubble li { margin: 2px 0; }
.jv-bubble code { font-family: var(--code); font-size: 12px; }
.jv-bubble h1, .jv-bubble h2, .jv-bubble h3 { font-size: 13.5px; margin: 6px 0 4px; }
.jv-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.jv-input { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.4; outline: none; }
.jv-input:focus { border-color: var(--accent); }
.jv-mic, .jv-send { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; flex: none; }
.jv-send { background: var(--accent); border-color: var(--accent); color: #fff; }
.jv-mic.on { background: #e5484d; border-color: #e5484d; color: #fff; animation: jv-pulse 1.2s ease-in-out infinite; }
.jv-foot { font-size: 10.5px; color: var(--muted); text-align: center; padding: 0 12px 8px; }
.jv-settings { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--raised); max-height: 60%; overflow-y: auto; }
.jv-settings[hidden] { display: none; }
.jv-set-h { font-weight: 650; margin-bottom: 8px; }
.jv-row { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; align-items: center; margin: 8px 0; font-size: 12.5px; color: var(--text-2); }
.jv-row small { grid-column: 2; color: var(--muted); font-size: 11px; }
.jv-row input[type=text], .jv-row input:not([type]), .jv-row select { padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; min-width: 0; }
.jv-row input[type=checkbox] { justify-self: start; }
.jv-pic { display: flex; gap: 6px; align-items: center; min-width: 0; } .jv-pic input { min-width: 0; font-size: 11.5px; }
.jv-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 600px) { .jv-panel { right: 8px; left: 8px; width: auto; bottom: 80px; height: calc(100vh - 100px); } .jv-fab { right: 14px; bottom: 14px; } }
.page-foot { margin-left: var(--side); padding: 0 28px 18px; margin-top: -30px; font-size: 11px; color: var(--muted); transition: margin-left .18s ease; }
.page-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.page-foot a:hover { color: var(--text-2); }

/* ---------------------------------------------------------------- agents page (pages/agents.js) */
.ag-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.ag-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ag-in { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--page); color: var(--text); font: inherit; outline: none; }
.ag-in:focus { border-color: var(--accent); }
textarea.ag-in { resize: vertical; min-height: 54px; line-height: 1.45; }
.ag-lbl { display: block; font-size: 11.5px; color: var(--muted); margin: 10px 0 5px; }
.ag-row { display: flex; gap: 8px; align-items: center; }
.ag-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ag-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ag-primary:hover { background: var(--accent); color: #fff; filter: brightness(1.08); }
.ag-ghost { background: none; }
.ag-danger { color: var(--down) !important; border-color: rgba(223, 111, 111, .4) !important; }
.ag-assist { display: flex; gap: 16px; align-items: flex-start; }
.ag-av-wrap { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; border: 1px solid var(--line-strong); }
.ag-av { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ag-tpl-item { text-align: left; padding: 12px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--page); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.ag-tpl-item:hover { border-color: var(--accent); background: var(--hover); }
.ag-tpl-h { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.ag-tpl-d { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.ag-form { max-width: 640px; }
.ag-form-h { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.ag-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ag-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--page); min-width: 0; }
.ag-card-h { display: flex; align-items: center; gap: 10px; }
.ag-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-kind { font-size: 11.5px; color: var(--muted); }
.ag-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: none; }
.ag-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.ag-status.on { color: var(--up); }
.ag-status.on i { background: var(--up); box-shadow: 0 0 0 3px rgba(69, 185, 106, .15); }
.ag-tickers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.ag-t { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--raised); color: var(--text-2); }
.ag-t:hover { color: var(--text); }
.ag-instr { font-size: 12px; color: var(--text-2); margin-top: 10px; line-height: 1.45; }
.ag-last { font-size: 12px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ag-filter { width: auto; padding: 4px 8px; font-size: 12px; }
.ag-feed { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; }
.ag-feed li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ag-feed li:last-child { border-bottom: 0; }
.ag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-top: 7px; flex: none; }
.lv-notable .ag-dot { background: var(--accent); }
.lv-alert .ag-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(250, 178, 25, .14); }
.ag-f-h { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.ag-f-agent { color: var(--text-2); }
.ag-f-t { font-weight: 500; margin-top: 2px; }
.ag-f-b { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.ag-open { font-size: 12px; color: var(--accent); white-space: nowrap; flex: none; margin-top: 18px; }
.ag-flash { padding: 9px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; background: var(--accent-soft); color: var(--text); }
.ag-flash.bad { background: rgba(223, 111, 111, .1); color: var(--down); }
@media (max-width: 700px) { .ag-grid2 { grid-template-columns: 1fr; } .ag-assist { flex-direction: column; } }
.ag-row .btn { white-space: nowrap; }

/* ---------------------------------------------------------------- watchlist (watchlist.js): tape, bookmark buttons, panel */
.tape { align-items: center; gap: 14px; }
.tape .tp { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.tape .tp b { font-weight: 500; color: var(--muted); margin: 0; }
.tape .tp:hover b { color: var(--text); }
.tape .tp-px { color: var(--text-2); }
.tape .tp.mine .tp-px { display: none; }   /* watchlist items: symbol and change only, like a ticker strip */
.tp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.tp-dot.up { background: var(--up); } .tp-dot.down { background: var(--down); }
.tp-sep { width: 1px; height: 14px; background: var(--line-strong); flex: none; }
.wl-btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 12px; align-self: center; }
.wl-btn:hover { color: var(--text); background: var(--hover); }
.wl-btn.on { color: var(--accent); border-color: rgba(57, 135, 229, .35); background: var(--accent-soft); }
.wl-btn.sm { height: 24px; width: 26px; padding: 0; justify-content: center; border-color: transparent; margin-left: 6px; flex: none; }
.wl-top { position: relative; flex: none; margin-left: auto; }
.wl-top + .search { margin-left: 0; }
.wl-top-btn { height: 32px; min-width: 32px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); }
.wl-top-btn:hover { color: var(--text); background: var(--hover); }
.wl-top-btn.on { color: var(--accent); }
.wl-n { font-size: 11px; color: var(--muted); }
.wl-pop { position: absolute; left: 0; top: 40px; width: 300px; z-index: 40; padding: 6px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--pop-shadow); }
.wl-pop[hidden] { display: none; }
.wl-pop-h { display: flex; justify-content: space-between; padding: 6px 8px 8px; font-weight: 500; font-size: 13px; }
.wl-add { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line-strong); background: none; color: var(--accent); cursor: pointer; margin-bottom: 4px; }
.wl-add:hover { background: var(--accent-soft); }
.wl-list { max-height: 320px; overflow-y: auto; }
.wl-row { display: grid; grid-template-columns: 54px 1fr auto 22px; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; }
.wl-row:hover { background: var(--hover); }
.wl-row b { font-weight: 500; }
.wl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wl-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; border-radius: 5px; }
.wl-x:hover { color: var(--down); background: var(--raised); }
.wl-empty { padding: 10px 8px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.wl-foot { border-top: 1px solid var(--line); margin-top: 4px; padding: 8px 8px 4px; font-size: 11px; color: var(--muted); }
.search-results a { align-items: center; }
@media (max-width: 900px) { .wl-top { margin-left: 0; } }
.wl-open { display: block; color: var(--accent); font-size: 12px; margin-bottom: 4px; }
