/* ==========================================================================
   Zaynith Trader — a light, calm theme and a matching dark one.

   Everything is drawn from the tokens below, so a colour decision is made once.
   The brand green is only an ACCENT (the active tab, a focus ring, a mark);
   anything that carries text on white uses the darker "ink" shades, which keep
   at least 4.5:1 contrast. Profit/loss green and red are text colours too, so
   they are the dark, readable versions of those hues.

   Buttons have their own "fill" tokens rather than reusing the ink colours:
   in the dark theme the inks turn light so text stays readable on dark cards,
   but a button still needs a mid-tone fill under its white label.

   The dark theme only redefines tokens (see :root[data-theme="dark"]). Which
   theme applies is decided by a small script in base.html's <head> before
   the page paints, so there is no flash of the wrong one.
   ========================================================================== */
:root {
  color-scheme: light;      /* native scrollbars, pickers and dropdowns */
  --bg: #f5f7fa;            /* page */
  --panel: #ffffff;         /* cards */
  --panel2: #f7f8fa;        /* insets inside a card: strips, code, sub-panels */
  --hover: #fafbfc;         /* table row under the pointer */
  --line: #e7e9ee;          /* hairlines */
  --line-strong: #d6dae1;   /* input borders, ghost buttons */
  --text: #1b2130;
  --text-soft: #3a4254;     /* log output: a step quieter than body text */
  --muted: #667085;
  --brand: #00b386;         /* accent only — never text on white */
  --brand-ink: #00845d;     /* links: readable on white */
  --brand-soft: #e8f7f1;
  --brand-fill: #00845d;    /* button fills, white label on top */
  --brand-fill-hover: #006f4e;
  --blue-fill: #2c62d5;
  --red-fill: #cf3e1c;
  --red-fill-hover: #b33314;
  --accent: var(--brand-ink);
  --green: #04845c;
  --green-soft: #e7f6ef;
  --red: #cf3e1c;
  --red-soft: #fdeeea;
  --blue: #2c62d5;
  --blue-soft: #edf2fd;
  --warn: #a75a05;
  --warn-soft: #fdf4e7;
  /* Charts: brighter than the text colours, since they are marks, not words. */
  --chart-up: #00a676;
  --chart-down: #e2553a;
  --chart-fast: #e8770f;
  --star: #d98b00;
  --tip-bg: #1b2130;
  --tip-text: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* Dark: the same roles, re-mixed. Every text/background pair here keeps at
   least 4.5:1 contrast (chart marks and the accent at least 3:1). Button
   fills are not redefined: the light ones already read well on dark cards. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1218;
  --panel: #161b23;
  --panel2: #1d232d;
  --hover: #1a2029;
  --line: #29313d;
  --line-strong: #3a4452;
  --text: #e6e9ef;
  --text-soft: #c3c9d4;
  --muted: #9aa4b4;
  --brand: #1fc99a;
  --brand-ink: #3fd3a4;
  --brand-soft: #12302a;
  --green: #41cf95;
  --green-soft: #132b22;
  --red: #ff806a;
  --red-soft: #34191a;
  --blue: #86a8ff;
  --blue-soft: #1a2440;
  --warn: #f0aa4a;
  --warn-soft: #322513;
  --chart-up: #22c38e;
  --chart-down: #f26650;
  --chart-fast: #f28c2a;
  --star: #e0a02a;
  --tip-bg: #313a49;
  --tip-text: #f2f4f8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; margin: 2px 0 8px; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15.5px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- Top bar --------------------------------------------------------------
   Brand, one tab per place you go daily, and "More" for the occasional pages.
   On a phone the tabs drop to their own row and scroll sideways; "More" stays
   outside that row so its menu is never clipped by the scroll. */
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 28px; min-height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-weight: 700; font-size: 16.5px; color: var(--text); letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #00d09c, #00a07a); color: #fff;
  font-weight: 700; font-size: 15px;
}
.mainnav { display: flex; align-items: stretch; gap: 2px; align-self: stretch; }
.mainnav a {
  position: relative; display: flex; align-items: center; padding: 0 12px;
  color: var(--muted); font-weight: 500; font-size: 14.5px; white-space: nowrap;
}
.mainnav a:hover { color: var(--text); text-decoration: none; }
.mainnav a.active { color: var(--text); font-weight: 600; }
.mainnav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 3px; border-radius: 3px 3px 0 0; background: var(--brand);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Theme button: cycles Auto -> Light -> Dark. It shows the icon of the CURRENT
   choice, which base.html's head script records as data-theme-pref. */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { background: var(--panel2); color: var(--text); }
.theme-toggle svg { display: none; width: 18px; height: 18px; }
:root[data-theme-pref="auto"] .theme-toggle .ti-auto,
:root[data-theme-pref="light"] .theme-toggle .ti-light,
:root[data-theme-pref="dark"] .theme-toggle .ti-dark { display: block; }

.nav-more { position: relative; }
.nav-more summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { background: var(--panel2); color: var(--text); }
.nav-more.active summary { color: var(--text); font-weight: 600; }
.nav-more .caret { font-size: 11px; margin-left: 2px; }
.nav-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 290px; padding: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.nav-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.nav-menu a:hover { background: var(--panel2); text-decoration: none; }
.nav-menu a.active { background: var(--brand-soft); }
.nav-menu a span { display: block; font-weight: 500; }
.nav-menu a small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 1px; }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 10px; }
  .mainnav {
    order: 3; width: calc(100% + 40px); margin: 6px -20px 0; padding: 0 12px;
    overflow-x: auto; scrollbar-width: none; min-height: 44px;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { padding: 0 10px; }
  .mainnav a.active::after { left: 10px; right: 10px; }
  /* Keep brand, More, the badge and the theme button on one line on a phone. */
  .topbar-right { gap: 6px; }
  .nav-more summary { padding: 7px 8px; }
  .theme-toggle { width: 30px; height: 30px; }
}

.badge { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.badge-paper { background: var(--blue-soft); color: var(--blue); }
.badge-live { background: var(--red-soft); color: var(--red); }
a.badge:hover { text-decoration: none; filter: brightness(.96); }

/* ---- Page frame ------------------------------------------------------------ */
.container { max-width: 1180px; margin: 28px auto; padding: 0 20px; }
.footer { text-align: center; color: var(--muted); padding: 28px 20px 36px; font-size: 12.5px; }
.page-head { margin: 0 0 20px; }
.page-title { margin: 0; }
.home-head { margin: 0 0 18px; }
.home-head p { margin: 2px 0 0; }

/* Sub-tabs under a section's title (AutoTrader, Stocks). */
.subnav { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 7px 15px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--muted); font-weight: 500; font-size: 13.5px;
}
.subnav a:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.subnav a.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 17px; }
.card h3 { margin: 0 0 12px; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: 20px; align-items: start; }  /* cards keep their own height */
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

/* Divider heading between the big blocks of a long page. */
.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 30px 2px 14px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.big { font-size: 19px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > span { color: var(--muted); }
.kv > b { font-weight: 600; text-align: right; }
.kv:last-child { border-bottom: 0; }

/* ---- Tables ------------------------------------------------------------------ */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td, .tbl tr:hover > td { background: var(--hover); }
.tbl td.r, .tbl th.r { text-align: right; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.card > .tbl, .card > table.tbl { margin: 0 -2px; width: calc(100% + 4px); }

/* ---- Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font: 600 14px/1.3 var(--font); cursor: pointer; color: #fff; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-primary { background: var(--brand-fill); }
.btn-primary:hover { background: var(--brand-fill-hover); }
.btn-paper { background: var(--blue-fill); }
.btn-live, .btn-danger { background: var(--red-fill); }
.btn-live:hover, .btn-danger:hover { background: var(--red-fill-hover); }
.btn-ghost { background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--panel2); border-color: var(--muted); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-fav { background: var(--panel); border: 1px solid var(--brand-ink); color: var(--brand-ink); }
.btn-fav:hover { background: var(--brand-soft); }

/* ---- Forms --------------------------------------------------------------------- */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]),
select, textarea {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
input[type=checkbox], input[type=radio] { accent-color: var(--brand-ink); width: 16px; height: 16px; }
.order-form label { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.order-form input:not([type=checkbox]):not([type=radio]), .order-form select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text);
}
.order-form .row { display: flex; gap: 14px; flex-wrap: wrap; }
.order-form .row label { flex: 1; min-width: 150px; }
.checkbox { display: flex !important; align-items: center; gap: 9px; color: var(--text) !important; }
.checkbox input { width: 16px !important; height: 16px; margin: 0 !important; flex-shrink: 0; }
.export-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 16px; }
.export-choices label { margin: 6px 0; color: var(--text); }

.flashes { margin-bottom: 18px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 8px; font-size: 13.5px; border: 1px solid transparent; }
.flash-success { background: var(--green-soft); border-color: rgba(4, 132, 92, .2); }
.flash-error { background: var(--red-soft); border-color: rgba(207, 62, 28, .2); }
.flash-warning { background: var(--warn-soft); border-color: rgba(167, 90, 5, .2); }

/* ---- "What this means" verdict panels ------------------------------------------ */
.verdict { border-left: 4px solid var(--line-strong); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.verdict h4 { margin: 0 0 6px; font-size: 16px; }
.verdict p { margin: 0; color: var(--muted); }
.verdict-good { border-left-color: var(--green); }
.verdict-good h4 { color: var(--green); }
.verdict-mixed { border-left-color: var(--warn); }
.verdict-mixed h4 { color: var(--warn); }
.verdict-bad { border-left-color: var(--red); }
.verdict-bad h4 { color: var(--red); }
.verdict-inconclusive { border-left-color: var(--blue); }
.verdict-inconclusive h4 { color: var(--blue); }

.notes { list-style: none; margin: 0 0 4px; padding: 0; }
.notes li { position: relative; padding: 8px 0 8px 26px; font-size: 13.5px; border-top: 1px solid var(--line); }
.notes li:first-child { border-top: 0; }
.notes li::before { position: absolute; left: 2px; top: 8px; font-weight: 700; }
.note-good::before  { content: "✓"; color: var(--green); }
.note-bad::before   { content: "✕"; color: var(--red); }
.note-warn::before  { content: "!"; color: var(--warn); }
.note-info::before  { content: "i"; color: var(--blue); }

.suggestions { list-style: none; margin: 0; padding: 0; counter-reset: sug; }
.suggestions li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.suggestions li:first-child { border-top: 0; }
.suggestions .change {
  display: inline-block; font-weight: 600; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; margin-bottom: 5px;
}
.suggestions .why { color: var(--muted); margin: 0 0 8px; }
.rerun-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }

.preset-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.preset-bar .label { color: var(--muted); font-size: 13px; }

/* Chip that acts as a button (backtest stock picker) */
.btn-link {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: var(--brand-ink); font: inherit; font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }

.log {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font: 12px/1.6 var(--mono); color: var(--text-soft);
  white-space: pre-wrap; max-height: 320px; overflow: auto; margin: 0;
}

/* Money summary strip */
.summary-card { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.summary-item { flex: 1; min-width: 150px; padding: 6px 16px; border-right: 1px solid var(--line); }
.summary-item:first-child { padding-left: 4px; }
.summary-item:last-child { border-right: 0; }
.summary-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.summary-value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.summary-pnl .summary-value { font-size: 24px; }
.summary-pct { font-size: 0.66em; font-weight: 500; opacity: 0.9; }
@media (max-width: 760px) {
  .summary-item { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .summary-item:last-child { border-bottom: 0; }
}

/* Price-change tick flash on live cells */
@keyframes tickUp   { from { background: rgba(0, 166, 118, .22); } to { background: transparent; } }
@keyframes tickDown { from { background: rgba(226, 85, 58, .22); } to { background: transparent; } }
.tick-up   { animation: tickUp .8s ease-out; }
.tick-down { animation: tickDown .8s ease-out; }

.confirm-card { max-width: 480px; margin: 30px auto; }
.confirm-tbl th { width: 130px; text-transform: none; }
.confirm-actions { display: flex; gap: 12px; margin-top: 16px; }
.login-card { max-width: 380px; margin: 60px auto; }
.mode-now { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
/* Settings page */
.settings-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-fields:disabled { opacity: .6; }
.settings-fields .tag { margin-left: 6px; font-weight: 500; }
.settings-why { font-weight: 400 !important; text-align: left !important; flex: 1; }
.setup-step { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.setup-step:last-of-type { border-bottom: 0; }
.setup-body { flex: 1; min-width: 0; }
.setup-go { align-self: center; flex-shrink: 0; }
/* Plans */
.nav-lock {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 6px; vertical-align: 1px;
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 10.5px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase;
}
a.tag:hover { text-decoration: none; border-color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.plans > .card { margin-bottom: 0; }
.plan-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-head h2 { margin: 0; }
.plan-tagline { min-height: 3em; margin: 8px 0 12px; }
.plan-list li { margin: 5px 0; }
.plan-col { width: 86px; text-align: center !important; font-weight: 700; }
.plan-col-current { background: var(--brand-soft); }
.plan-table tbody tr:hover td.plan-col-current { background: var(--brand-soft); }
.locked-card { max-width: 560px; margin: 30px auto; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } .plan-tagline { min-height: 0; } }
@media (max-width: 560px) { .plan-col { width: 58px; font-size: 12.5px; } }
/* Getting started page */
.gs-lead { font-size: 15px; margin: 0 0 6px; }
.gs-num {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  margin-right: 8px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 12.5px; font-weight: 700;
}
.gs-why td:first-child { width: 46%; }
.gs-why td, .gs-list li { line-height: 1.55; }
.gs-why code, .setup-body code { word-break: break-word; }
.gs-why .gs-group td { background: var(--panel2); color: var(--muted); font-size: 12px;
  font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 7px 10px; }
.gs-list { margin: 0; padding-left: 20px; }
.gs-list li { margin: 7px 0; }
.gs-path { border-top: 1px solid var(--line); }
.gs-path > summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; }
.gs-path > summary::-webkit-details-marker { display: none; }
.gs-path > summary::before { content: "▸ "; color: var(--muted); }
.gs-path[open] > summary::before { content: "▾ "; }
.gs-path > summary small { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.gs-path > p { margin: 4px 0 6px; }
.gs-steps { margin: 12px 0 14px; padding-left: 22px; }
.gs-steps > li { margin: 14px 0; line-height: 1.55; }
.gs-steps > li::marker { color: var(--brand-ink); font-weight: 700; }
.gs-plain { list-style: none; padding-left: 0; margin-top: 0; }
.gs-steps .code-block { margin: 7px 0 0; }
.gs-path .hint { margin-bottom: 16px; }
@media (max-width: 760px) {
  .gs-why, .gs-why tbody, .gs-why tr, .gs-why td { display: block; width: 100% !important; }
  .gs-why thead { display: none; }
  .gs-why td:first-child { border-bottom: 0; padding-bottom: 2px; font-weight: 600; }
  .gs-why td + td { padding-top: 2px; color: var(--muted); }
}
.setup-mark { font-weight: 700; width: 16px; text-align: center; flex-shrink: 0; }
.setup-step code { display: inline-block; margin-top: 4px; word-break: break-all; }
.strategy-controls { margin: 16px 0; }

/* "How to use this page" walkthrough box */
.guide {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.guide summary {
  cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--blue);
  list-style: none; user-select: none;
}
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "▸ "; }
.guide[open] summary::before { content: "▾ "; }
.guide[open] summary { border-bottom: 1px solid var(--line); }
.guide-body { padding: 14px 20px; font-size: 13.5px; color: var(--text); }
.guide-body ol, .guide-body ul { margin: 6px 0; padding-left: 22px; }
.guide-body li { margin: 6px 0; }
.guide-body .tip { color: var(--muted); }

/* Visible example line under a field/section (hint macro) */
.hint {
  margin: 6px 0 12px; font-size: 12.5px; color: var(--muted);
  border-left: 2px solid var(--line-strong); padding-left: 10px;
}
.hint b { color: var(--text); font-weight: 600; }

/* "Basics" / section heading inside a settings card */
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 6px 0 8px;
}

/* Collapsible "Advanced settings" block inside a form/card (advanced macro). */
.advanced { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; margin: 14px 0; }
.advanced summary {
  cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--muted);
  list-style: none; user-select: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸ "; }
.advanced[open] summary::before { content: "▾ "; }
.advanced[open] summary { border-bottom: 1px solid var(--line); color: var(--text); }
.advanced-body { padding: 8px 16px 6px; }

/* Stock search + favorite chips */
.search-wrap { margin: 8px 0 4px; }
.search-input {
  width: 100%; padding: 11px 14px !important; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-size: 14.5px;
}
.search-results { margin-top: 10px; }
.search-results .muted { padding: 6px 2px; }
.chips { margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500;
}
.chip form { display: inline; margin: 0; }
.x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.x:hover { color: var(--red); }

/* Trading mode presets (AutoTrader) */
.mode-picker { display: flex; gap: 12px; margin: 10px 0 16px; flex-wrap: wrap; }
.mode-card {
  flex: 1; min-width: 180px; margin: 0; padding: 12px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.mode-card .btn { width: 100%; }
.mode-card p { margin: 8px 0 0; text-align: left; }
.mode-active { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 760px) { .mode-picker { flex-direction: column; } }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--muted); }
.tag-buy { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.tag-sell { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.stars { letter-spacing: 1px; font-size: 13px; white-space: nowrap; color: var(--star); }

/* Hover tooltips (driven by data-tip; see initTooltips in app.js) */
.tooltip {
  position: fixed; z-index: 1000; max-width: 300px;
  background: var(--tip-bg); color: var(--tip-text); border-radius: 8px;
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45;
  pointer-events: none; box-shadow: var(--shadow-lg);
}
[data-tip] { cursor: help; }
.btn[data-tip], a[data-tip], summary[data-tip], .chip .x[data-tip] { cursor: pointer; }
label[data-tip] { cursor: help; }
.order-form label[data-tip] > :first-child,
.order-form label[data-tip] { border-bottom: none; }
th[data-tip], .summary-label[data-tip] { text-decoration: underline dotted var(--line-strong); text-underline-offset: 4px; }

/* Glossary */
.glossary-cat { margin: 26px 0 12px; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); text-transform: uppercase; letter-spacing: .06em; }
.terms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .terms { grid-template-columns: 1fr; } }
.term { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.term-name { font-weight: 600; margin-bottom: 5px; }
.term-def { font-size: 13.5px; color: var(--text); }
.term-eg { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.term-eg b { color: var(--blue); }
.glossary-empty { color: var(--muted); padding: 16px 2px; }

/* ---- Ask AI chat ------------------------------------------------------------ */
.hidden { display: none; }
.inline-form { display: inline; margin: 0; }
.code-block {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: 12px/1.5 var(--mono); overflow-x: auto; white-space: pre;
}

.chat-shell {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.chat-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-up); box-shadow: 0 0 0 3px var(--green-soft); }
.chat-model { font-size: 11.5px; }
.chat-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chat-quota { font-size: 11.5px; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 2px 9px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--panel);
  white-space: nowrap;
}
.pill-on { color: var(--green); border-color: rgba(4, 132, 92, .35); background: var(--green-soft); }
.pill-off { color: var(--muted); border-color: var(--line-strong); background: var(--panel2); }

.chat-log {
  padding: 20px; min-height: 300px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; background: var(--bg);
}
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-avatar {
  flex: 0 0 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.chat-you { flex-direction: row-reverse; }
.chat-you .chat-avatar { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.chat-ai .chat-avatar { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.chat-body { min-width: 0; max-width: 82%; }
.chat-text {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; word-wrap: break-word; overflow-wrap: anywhere;
}
.chat-you .chat-text { background: var(--blue-soft); border-color: transparent; }
.chat-error .chat-text { border-color: var(--red); background: var(--red-soft); }

/* Markdown inside a reply */
.chat-text p { margin: 0 0 9px; }
.chat-text p:last-child { margin-bottom: 0; }
.chat-text ul, .chat-text ol { margin: 0 0 9px; padding-left: 20px; }
.chat-text li { margin-bottom: 3px; }
.chat-text h4 { margin: 10px 0 6px; font-size: 13.5px; }
.chat-text h4:first-child { margin-top: 0; }
.chat-text code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.chat-text pre { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 9px; }
.chat-text pre code { background: none; border: none; padding: 0; }
.chat-text table { border-collapse: collapse; font-size: 12.5px; margin: 0 0 9px; width: 100%; }
.chat-text th, .chat-text td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.chat-text th { background: var(--panel2); }

/* "working on it" */
.chat-status .chat-text { color: var(--muted); font-style: italic; }
.chat-typing { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.chat-typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: chatblink 1.2s infinite; }
.chat-typing i:nth-child(2) { animation-delay: .2s; }
.chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes chatblink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* "Changed" card */
.chat-applied { border: 1px solid rgba(4, 132, 92, .35); border-radius: 10px; padding: 10px 12px; background: var(--green-soft); margin-top: 8px; }
.chat-applied h4 { margin: 0 0 8px; font-size: 12.5px; color: var(--green); }
.chat-applied table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.chat-applied td, .chat-applied th { padding: 4px 6px; text-align: left; border-bottom: 1px solid rgba(4, 132, 92, .15); }
.chat-applied tr:last-child td { border-bottom: none; }
.chat-applied .arrow { color: var(--muted); }
.chat-applied .note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }

/* Empty state */
.chat-welcome { text-align: center; padding: 26px 10px; margin: auto 0; }
.chat-welcome-icon { font-size: 30px; margin-bottom: 6px; }
.chat-welcome h4 { margin: 0 0 4px; font-size: 15.5px; }
.chat-welcome p { margin: 0 0 14px; font-size: 13.5px; }
.chat-suggests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chat-suggest {
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12.5px;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.chat-suggest:hover { border-color: var(--brand); color: var(--brand-ink); }

.chat-form { display: flex; gap: 8px; padding: 12px 14px; background: var(--panel); border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.chat-cite { font-size: 11.5px; margin-top: 7px; }
.chat-cite a { margin-right: 10px; }
.chat-foot { font-size: 11.5px; margin: 10px 2px 0; }

@media (max-width: 640px) {
  .chat-body { max-width: 100%; }
  .chat-bar { flex-wrap: wrap; gap: 8px; }
  .chat-bar-right { width: 100%; margin-left: 0; }
}

/* ----------------------------------------------------------------------------
   Autopilot — the self-review journal. Each entry is one review: what it did,
   why, and the before/after numbers that judged it.
   ---------------------------------------------------------------------------- */
.journal { list-style: none; margin: 0; padding: 0; }
.journal-item {
  background: var(--panel); border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.journal-item.kind-change   { border-left-color: var(--blue); }
.journal-item.kind-revert   { border-left-color: var(--warn); }
.journal-item.kind-rejected { border-left-color: var(--line-strong); }
.journal-item.kind-hold     { border-left-color: var(--line); }
.journal-item.kind-error    { border-left-color: var(--red); }

.journal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.journal-head b { font-size: 14.5px; }
.journal-item .why { color: var(--muted); margin: 0 0 10px; }
.journal-item p:last-child { margin-bottom: 0; }

.pill-change   { background: var(--blue-soft); border-color: rgba(44, 98, 213, .35); color: var(--blue); }
.pill-revert   { background: var(--warn-soft); border-color: rgba(167, 90, 5, .35); color: var(--warn); }
.pill-rejected { color: var(--muted); }
.pill-hold     { color: var(--muted); }
.pill-error    { background: var(--red-soft); border-color: rgba(207, 62, 28, .35); color: var(--red); }

.verdict-better  { background: var(--green-soft); border-color: rgba(4, 132, 92, .35); color: var(--green); }
.verdict-worse   { background: var(--red-soft); border-color: rgba(207, 62, 28, .35); color: var(--red); }
.verdict-same    { color: var(--muted); }
.verdict-pending { background: var(--blue-soft); border-color: rgba(44, 98, 213, .35); color: var(--blue); }

.change-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

/* Before -> after, side by side: the whole point of the page. */
.scores { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; flex-wrap: wrap; }
.score { flex: 1; min-width: 150px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.score-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.score-main { font-size: 20px; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; }
.score-sub { font-size: 12.5px; color: var(--muted); }
.score-arrow { color: var(--muted); font-size: 18px; }

@media (max-width: 640px) {
  .scores { flex-direction: column; align-items: stretch; }
  .score-arrow { text-align: center; }
}

/* ---------- Rotation (ZaynX.AI) page ----------------------------------------
   Reuses .score / .score-main / .kv from the Autopilot page so the two
   scoreboards read identically; only the pieces unique to this page are new. */
.lede { max-width: 68ch; color: var(--muted); }

.scoreboard { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.scoreboard .score { flex: 1 1 10rem; }

/* Both curves are drawn on one shared scale (see _curve_points), so the line
   that sits higher really is ahead -- the colours only separate them. */
.curve { display: block; width: 100%; height: auto; margin: 0.5rem 0; color: var(--brand); overflow: visible; }

.progress-wrap { margin-top: 1rem; }
.progress { height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: var(--brand); }

.badge-on, .badge-off { display: inline-block; padding: 0.3rem 0.6rem; border-radius: 6px; font-weight: 600; }
.badge-on  { background: var(--green-soft); color: var(--green); }
.badge-off { background: var(--panel2); color: var(--muted); }

/* Rotation alarms. Colour is a reinforcement, never the only signal -- each
   row also carries its severity in words. */
.alerts { list-style: none; padding: 0; margin: 0; }
.alerts li { padding: 10px 12px; border-left: 3px solid var(--line-strong); margin-bottom: 8px; background: var(--panel2); border-radius: 0 8px 8px 0; }
.alert-critical { border-left-color: var(--red) !important; }
.alert-warning  { border-left-color: var(--warn) !important; }
.alert-info     { border-left-color: var(--muted) !important; }
.card.verdict   { border: 1px solid var(--brand); border-left: 4px solid var(--brand); padding-left: 22px; }

/* ---------- ZaynX.AI ---------------------------------------------------------- */
.tagline { margin: -4px 0 14px; color: var(--muted); }

.card.countdown { border: 1px solid var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--panel) 70%); }
.card.countdown h2 { margin-top: 0; }

/* The countdown fills an inner div rather than a pseudo-element: it is also
   read by screen readers as content, so it needs to be a real element. */
.progress-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s ease; }

.journal li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.journal li:last-child { border-bottom: 0; }
.journal-when { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.journal-what { font-weight: 600; margin: 2px 0; }
.journal-detail { font-size: 13.5px; color: var(--muted); }

/* ---- Charts page: inline-SVG candlestick chart -------------------------------
   Every colour lives here rather than in app/charting.py, so the chart themes
   with the rest of the app and the geometry code stays about geometry. Strokes
   are set in absolute units because the SVG scales via its viewBox. */
.chart { width: 100%; height: auto; display: block; margin: 6px 0 10px; }
.chart text { font: 10px var(--font); fill: var(--muted); }
.chart .panel-title { font-size: 11px; fill: var(--muted); font-weight: 500; }
.chart .xlabel { font-size: 9px; }
.chart .axis line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .guide-line line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: .5; }

/* Candles. A green body closed above its open, red below. */
.chart .candle.up rect { fill: var(--chart-up); }
.chart .candle.up line { stroke: var(--chart-up); stroke-width: 1; }
.chart .candle.down rect { fill: var(--chart-down); }
.chart .candle.down line { stroke: var(--chart-down); stroke-width: 1; }

/* Bollinger envelope: a wash, not a line — it must sit behind the candles. */
.chart .bb-band { fill: var(--blue); opacity: .07; }
.bb-t { fill: var(--blue); }

/* Moving averages. Fast is the bright one because it is the one that moves. */
.chart .ma-fast { stroke: var(--chart-fast); stroke-width: 1.6; }
.chart .ma-slow { stroke: var(--blue); stroke-width: 1.6; }
.chart .ma-trend { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 4; }
.ma-fast-t { fill: var(--chart-fast); }
.ma-slow-t { fill: var(--blue); }
.ma-trend-t { fill: var(--muted); }

/* Support / resistance / stop / target, labelled at the right edge. Lines are
   stroked, labels are filled -- applying both to both would outline the text. */
.chart .level line { stroke-width: 1; stroke-dasharray: 6 3; }
.chart .level text { font-size: 9px; }
.chart .level-resistance line { stroke: var(--chart-down); }
.chart .level-resistance text { fill: var(--red); }
.chart .level-support line { stroke: var(--chart-up); }
.chart .level-support text { fill: var(--green); }
.chart .level-target line { stroke: var(--chart-up); opacity: .65; }
.chart .level-target text { fill: var(--green); opacity: .85; }
.chart .level-stop line { stroke: var(--chart-down); opacity: .65; }
.chart .level-stop text { fill: var(--red); opacity: .85; }

/* Volume and MACD histogram bars. */
.chart .vol.up { fill: var(--chart-up); opacity: .45; }
.chart .vol.down { fill: var(--chart-down); opacity: .45; }
.chart .hist.up { fill: var(--chart-up); opacity: .55; }
.chart .hist.down { fill: var(--chart-down); opacity: .55; }

.chart .rsi-line { stroke: var(--blue); stroke-width: 1.4; }
.chart .macd-line { stroke: var(--chart-fast); stroke-width: 1.4; }
.chart .macd-signal { stroke: var(--blue); stroke-width: 1.4; stroke-dasharray: 4 3; }

/* ---- Charts page: one indicator reading ------------------------------------- */
.reading { border-left: 3px solid var(--line-strong); padding: 8px 0 8px 12px; margin-bottom: 10px; }
.reading-bullish { border-left-color: var(--green); }
.reading-bearish { border-left-color: var(--red); }
.reading-neutral { border-left-color: var(--line-strong); }
.reading-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reading-value { color: var(--muted); font-size: 12.5px; margin-left: auto; font-variant-numeric: tabular-nums; }
.reading-says { margin: 5px 0 0; }
/* The teaching text is deliberately quieter than the reading but still legible. */
.reading-learn {
  margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55;
  background: var(--panel2); border-radius: 8px; padding: 8px 11px;
}
.pill-bull { color: var(--green); border-color: rgba(4, 132, 92, .35); background: var(--green-soft); }
.pill-bear { color: var(--red); border-color: rgba(207, 62, 28, .35); background: var(--red-soft); }
.pill-flat { color: var(--muted); }

@media (max-width: 720px) { .reading-value { margin-left: 0; width: 100%; } }

/* ---- Symbol type-ahead dropdown ---------------------------------------------
   Anchored to a wrapper around the input rather than to the surrounding
   label/row, so it lands in the same place on every form in the app. */
.sym-ac-wrap { display: block; position: relative; }
.sym-ac {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  margin-top: 4px; max-height: 268px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.sym-ac-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.sym-ac-row:last-child { border-bottom: 0; }
/* One highlight style for both keyboard and mouse. */
.sym-ac-row.active { background: var(--brand-soft); }
.sym-ac-sym { font-weight: 600; white-space: nowrap; }
.sym-ac-sym b { color: var(--brand-ink); }
.sym-ac-fav { color: var(--brand-ink); font-size: 11px; }
.sym-ac-name { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-ac-name b { color: var(--text); font-weight: 600; }
.sym-ac-note { padding: 8px 12px; color: var(--muted); font-size: 12.5px; }

/* A field you TYPE into must keep a text caret: `cursor` is inherited, so a
   label carrying data-tip would otherwise hand its `cursor: help` down. */
.order-form input, .search-input { cursor: auto; }
.order-form select { cursor: pointer; }

/* The 📈 shortcut beside each Recommendations row. */
.reco-chart { margin-left: 6px; font-size: 12px; text-decoration: none; }

/* "Where the stop goes" panel on the Charts page. */
.stop-card {
  margin: 14px 0 4px; padding: 12px 14px; background: var(--panel2);
  border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px;
}
.stop-card .kv { padding: 5px 0; }
.stop-card .section-label { margin-top: 0; }

/* "The order" panel — the placeable plan (limit / stop / target). */
.plan-card {
  margin: 14px 0 4px; padding: 12px 14px; background: var(--panel2);
  border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px;
}
.plan-card .kv { padding: 5px 0; }
.plan-card .section-label { margin-top: 0; }

/* Per-watch alert-level picker in the Charts watch table. */
.lvl-select { font-size: 12.5px; padding: 4px 8px !important; }

/* ---- Status board: every robot on Home -------------------------------------
   One card per robot. The left edge carries the status colour so a glance down
   the grid answers "what's running?" before any text is read. */
.robots-board .section-head-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.robots-board .section-head-row h2 { margin: 0; }
.board-strip {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 14px 0; padding: 12px 16px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
}
.board-strip > div { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.board-strip b { font-variant-numeric: tabular-nums; }
.robots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 20px; }
.robot {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.robot-running { border-left-color: var(--chart-up); }
.robot-waiting { border-left-color: var(--blue); }
.robot-paused, .robot-error { border-left-color: var(--chart-down); }
.robot-stopped, .robot-inactive, .robot-off { background: var(--panel); }
.robot-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.robot-head b { font-size: 15px; }
.robot-status { font-weight: 600; }
.robot-blurb { margin-bottom: 2px; }
.robot-money { margin-top: 2px; font-variant-numeric: tabular-nums; }
.robot-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; padding-top: 8px; }
.robot-actions .budget-input { width: 100px; padding: 4px 8px !important; font-size: 12.5px; }
@media (max-width: 600px) { .board-strip > div { min-width: 45%; } }

/* Results: one tab per robot's paper book. */
.report-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
