:root {
  --page: #eef1f4;
  --surface: #ffffff;
  --raised: #f6f8fa;
  --rail: #f8f9fb;
  --ink: #161a22;
  --ink-2: #5a6270;
  --muted: #8a919d;
  --line: #e2e6ec;
  --line-strong: #cdd3dc;
  --accent: #2a78d6;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --accent-ink: #ffffff;
  --up: #0f8a5f;
  --up-soft: rgba(15, 138, 95, 0.10);
  --down: #c93c3c;
  --down-soft: rgba(201, 60, 60, 0.10);
  --hold: #6b7280;
  --hold-soft: rgba(107, 114, 128, 0.12);
  --warn: #9a6200;
  --warn-soft: rgba(196, 128, 0, 0.12);
  --pos: #2a78d6;
  --neg: #e34948;
  --grid: #e8ebf0;
  --axis: #c3c9d2;
  --live: #17b07a;
  --shadow-float: 0 12px 32px -12px rgba(22, 26, 34, 0.28);
  --radius-panel: 16px;
  --radius-inner: 10px;
  --font: "Ubuntu Sans", "Inter", "Segoe UI Variable Text", "SF Pro Text", system-ui, sans-serif;
  --mono: "Ubuntu Sans Mono", "SF Mono", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1015;
    --surface: #151a21;
    --raised: #1b212a;
    --rail: #11151b;
    --ink: #e8ebf0;
    --ink-2: #a2abb9;
    --muted: #7b8494;
    --line: #242b35;
    --line-strong: #323b48;
    --accent: #4b93ea;
    --accent-soft: rgba(75, 147, 234, 0.14);
    --up: #2ec48c;
    --up-soft: rgba(46, 196, 140, 0.13);
    --down: #f07171;
    --down-soft: rgba(240, 113, 113, 0.13);
    --hold: #a2abb9;
    --hold-soft: rgba(162, 171, 185, 0.13);
    --warn: #e8b04b;
    --warn-soft: rgba(232, 176, 75, 0.14);
    --pos: #3987e5;
    --neg: #e66767;
    --grid: #222932;
    --axis: #39424f;
    --shadow-float: 0 14px 36px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font: 400 14px/1.55 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

/* ---------- rail ---------- */

.sidebar {
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; padding: 2px 8px; }
.brand img { border-radius: 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-inner);
  font-weight: 500;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { color: var(--ink); background: var(--raised); }
.sidebar nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.running-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
}
.running-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 4px rgba(23, 176, 122, 0.18); animation: pulse 1.6s ease-in-out infinite; flex: none; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }

/* ---------- page ---------- */

main { padding: 28px 36px 56px; width: 100%; min-width: 0; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 620; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 14px; font-weight: 620; margin: 18px 0 8px; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font: 12px var(--mono); background: var(--raised); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--ink-2); margin: 0 0 12px; }
[hidden] { display: none !important; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 20px 22px;
  margin-bottom: 20px;
  min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .card { margin-bottom: 0; }

/* ---------- controls ---------- */

button, .button {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 16px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
button:hover, .button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: progress; }
button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover { background: var(--raised); filter: none; }
button.danger { background: #c93c3c; color: #fff; }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 600; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 400; cursor: pointer; }
fieldset { border: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
legend { color: var(--ink-2); font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 8px; }
fieldset label.check {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  background: var(--surface);
  transition: background-color 0.15s, border-color 0.15s;
}
fieldset label.check { position: relative; padding: 6px 14px; gap: 6px; }
fieldset label.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
fieldset label.check::before { content: "+"; font-weight: 600; color: var(--muted); width: 10px; text-align: center; }
fieldset label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
fieldset label.check:has(input:checked)::before { content: "\2713"; color: var(--accent); }
fieldset label.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; background: var(--raised); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
input[name="ticker"] { font-size: 18px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; }
input[name="ticker"]::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; font-size: 15px; }
output { font-size: 24px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
.model-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)) minmax(0, 0.9fr) minmax(0, 0.8fr); gap: 14px; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.form-error { color: var(--down); margin: 0 auto 0 0; font-weight: 500; }
.form-error:empty { display: none; }
.form-msg { color: var(--up); margin: 0 auto 0 0; font-weight: 500; }
.form-msg.error { color: var(--down); }
.options { display: flex; flex-direction: column; gap: 10px; }

/* ---------- figures ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 20px; min-width: 0; }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tile .value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.15; overflow-wrap: anywhere; }
.tile .sub { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--raised); }
tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px 0; margin: 0; }
.ticker { font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
td > a { white-space: nowrap; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--hold-soft); color: var(--hold); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }
.pill.review { background: var(--warn-soft); color: var(--warn); }
.delta { font-weight: 600; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--ink-2); }
.status-done { color: var(--up); font-weight: 600; }
.status-failed { color: var(--down); font-weight: 600; }
.status-cancelled { color: var(--muted); font-weight: 600; }
.status-running { color: var(--accent); font-weight: 600; }
.status-ok, .status-missing { font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.status-ok::before, .status-missing::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-ok { color: var(--up); }
.status-ok::before { background: var(--up); }
.status-missing { color: var(--ink-2); }
.status-missing::before { border: 2px solid var(--line-strong); width: 6px; height: 6px; }

/* ---------- live run: the deliberation track ---------- */

.stats-bar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); margin-bottom: 16px; overflow: hidden; }
.stats-bar div { padding: 12px 18px; color: var(--ink-2); font-size: 12.5px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stats-bar div:first-child { border-left: none; }
.stats-bar strong { color: var(--ink); font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; counter-reset: stage; }
.team {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 14px 14px 12px;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.team:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -15px;
  width: 16px;
  height: 2px;
  background: var(--line-strong);
}
.team.done:not(:last-child)::after { background: var(--up); }
.team.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.team h3 { margin: 0 0 10px; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.team h3::before {
  counter-increment: stage;
  content: counter(stage);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--raised);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  flex: none;
}
.team.active h3::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.team.done h3::before { background: var(--up); border-color: var(--up); color: #fff; content: "\2713"; }
.agent { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13px; }
.agent .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.agent.in_progress { font-weight: 600; }
.agent.in_progress .dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.4s ease-in-out infinite; }
.agent.completed .dot { border-color: var(--up); background: var(--up); }
.agent.pending { color: var(--muted); }
.agent .state { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.agent.in_progress .state { color: var(--accent); }

.live-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.live-grid .card { display: flex; flex-direction: column; height: 640px; }
.feed { overflow-y: auto; flex: 1; font-size: 13px; display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0 8px; }
.msg { flex: none; position: relative; padding: 8px 10px 8px 22px; white-space: pre-wrap; word-break: break-word; border-radius: 8px; }
.msg::before { content: ""; position: absolute; left: 8px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.msg .meta { color: var(--muted); font-size: 11.5px; display: block; margin-bottom: 2px; font-weight: 500; }
.msg.Agent::before { background: var(--accent); }
.msg.Data { color: var(--ink-2); max-height: 120px; overflow: hidden; cursor: pointer; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.msg.Data.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.msg.Data:hover { background: var(--raised); }
.msg.Tool { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.msg.Tool::before { background: #8f5fd6; border-radius: 2px; }
.msg.Error { color: var(--down); background: var(--down-soft); }
.msg.Error::before { background: var(--down); }
.msg.System { color: var(--ink-2); }
.section-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.section-tabs button { background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); font-weight: 500; padding: 4px 12px; font-size: 12.5px; border-radius: 999px; }
.section-tabs button:hover { color: var(--ink); filter: none; }
.section-tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.markdown { overflow-y: auto; flex: 1; padding-right: 6px; line-height: 1.65; max-width: 78ch; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { font-size: 15px; margin: 18px 0 8px; }
.markdown .table { overflow-x: auto; margin: 0 0 12px; }
.markdown table { font-size: 13px; }
.markdown p, .markdown ul, .markdown ol { margin: 0 0 12px; }
.markdown strong { font-weight: 650; }

/* ---------- charts ---------- */

.chart { position: relative; margin-bottom: 14px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart text.value { fill: var(--ink-2); font-weight: 600; }
.chart .bar.pos { fill: var(--pos); }
.chart .bar.neg { fill: var(--neg); }
.chart .line { fill: none; stroke: var(--pos); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--pos); opacity: 0.08; }
.chart .line.extra { stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .hit { fill: transparent; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .marker { fill: var(--pos); stroke: var(--surface); stroke-width: 2; }
.tooltip { position: fixed; z-index: 10; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-float); border-radius: var(--radius-inner); padding: 8px 12px; font-size: 12.5px; line-height: 1.5; }

/* ---------- misc ---------- */

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.progress { height: 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s; }
.key-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.6fr) 64px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.key-row:last-of-type { border-bottom: none; }
.key-row .name { font-weight: 600; }
.key-row .env { color: var(--muted); font: 11.5px var(--mono); display: block; margin-top: 2px; }
.key-row .actions input { flex: 1; }
.maint { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.maint > div { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 16px; }
.paths { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 18px 0 0; }
.paths dt { font-weight: 600; }
.paths dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--ink); border-radius: var(--radius-inner); padding: 12px 16px; margin-bottom: 18px; }
.banner.error { background: var(--down-soft); color: var(--down); font-weight: 500; }

/* ---------- depth and polish ---------- */

:root { --shadow-card: 0 1px 2px rgba(22, 26, 34, 0.05), 0 4px 14px -8px rgba(22, 26, 34, 0.10); }
@media (prefers-color-scheme: dark) { :root { --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 18px -10px rgba(0, 0, 0, 0.55); } }
body { background: radial-gradient(1200px 380px at 70% -120px, var(--accent-soft), transparent 70%) no-repeat, var(--page); }
.card, .tile, .team, .stats-bar { box-shadow: var(--shadow-card); }
.tile { position: relative; transition: transform 0.15s, box-shadow 0.15s; }
.tile:hover { transform: translateY(-1px); }
.card-head a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.card-head a:hover { color: var(--accent); }
.card-head a::after { content: " \2192"; }
.nowrap { white-space: nowrap; }
.sub-head { font-size: 13px; color: var(--ink-2); font-weight: 620; margin: 20px 0 8px; }
.form-grid .sub-head { margin: 10px 0 -8px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); }
.hint { font-size: 13px; margin: 0; }
.banner.info { background: var(--up-soft); }

/* ---------- overview ---------- */

  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent 55%), var(--surface);
  padding: 24px 26px;
}

.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: middle; }
.sdot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.sdot.bad { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.sdot.idle { border: 2px solid var(--line-strong); width: 9px; height: 9px; }

.fg { display: inline-grid; place-items: center; min-width: 52px; padding: 0 10px; border-radius: 12px; }
.fg-xfear { color: var(--down); background: var(--down-soft); }
.fg-fear { color: var(--warn); background: var(--warn-soft); }
.fg-neutral { color: var(--hold); background: var(--hold-soft); }
.fg-greed, .fg-xgreed { color: var(--up); background: var(--up-soft); }

.range { position: relative; height: 6px; min-width: 90px; border-radius: 999px; background: linear-gradient(90deg, var(--down-soft), var(--hold-soft), var(--up-soft)); }
.range-mark { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--hold-soft); color: var(--hold); }
.chip.up { background: var(--up-soft); color: var(--up); }
.chip.down { background: var(--down-soft); color: var(--down); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li.tl-up::before { background: var(--up); }
.timeline li.tl-down::before { background: var(--down); }
.timeline li.tl-bad::before { background: var(--warn); }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-head time { margin: 0 0 0 auto; font-size: 12px; }
.tl-body { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

.health { list-style: none; margin: 0; padding: 0; }
.health li { display: grid; grid-template-columns: 14px minmax(110px, max-content) 1fr; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.health li:last-child { border-bottom: none; }
.health-name { font-weight: 600; }
.health-detail { text-align: right; font-size: 13px; margin: 0; text-decoration: none; overflow-wrap: anywhere; }
.rule-list { margin: 14px 0 10px; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.rule-list li { margin-bottom: 4px; }

.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ov-grid > .card, .ov-grid > .tiles { margin-bottom: 0; }
.ov-grid .c4 { grid-column: span 4; } .ov-grid .c5 { grid-column: span 5; } .ov-grid .c6 { grid-column: span 6; }
.ov-grid .c7 { grid-column: span 7; } .ov-grid .c8 { grid-column: span 8; } .ov-grid .c12 { grid-column: 1 / -1; }
.ov-grid .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.perf { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.perf > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.perf > div:last-child { border-bottom: none; }
.perf dt { color: var(--ink-2); font-size: 13.5px; }
.perf dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }


.spark-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.spark path { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.spark.up path { stroke: var(--up); }
.spark.down path { stroke: var(--down); }

.calls { display: grid; gap: 5px; align-items: center; }
.calls-date { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.call { display: grid; place-items: center; height: 28px; border-radius: 7px; font-size: 11.5px; font-weight: 650; text-decoration: none; color: var(--ink); }
.call.none { background: var(--raised); border: 1px dashed var(--line); }
.call.buy { background: var(--up); color: #fff; }
.call.over { background: var(--up-soft); color: var(--up); }
.call.hold { background: var(--hold-soft); color: var(--hold); }
.call.under { background: var(--down-soft); color: var(--down); }
.call.sell { background: var(--down); color: #fff; }
.calls-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.calls-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.calls-legend .call { width: 22px; height: 20px; font-size: 10.5px; }

.update-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 550; text-decoration: none; }
.update-chip.new { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.update-chip.bad { border-color: var(--down); color: var(--down); }
.commits { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.commits li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.commits .muted { margin: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 1400px) {
  .ov-grid .c4, .ov-grid .c5, .ov-grid .c7 { grid-column: span 6; }
  .ov-grid .c8 { grid-column: 1 / -1; }
  .ov-grid .c4:has(.perf) { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .ov-grid .c4, .ov-grid .c5, .ov-grid .c6, .ov-grid .c7 { grid-column: 1 / -1; }
  .ov-grid .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@keyframes pulse { 50% { opacity: 0.45; } }

@media (max-width: 1180px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team:nth-child(3)::after { display: none; }
  .model-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-bar div:nth-child(4) { border-left: none; }
  .stats-bar div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .grid-2, .detail-grid, .maint, .form-grid, .live-grid, .pipeline, .key-row { grid-template-columns: 1fr; }
  .team::after { display: none; }
  .span-2 { grid-column: auto; }
  main { padding: 18px; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* sign-in page */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; }
.login-card h1 { margin: 0; font-size: 1.35rem; }
.login-card label { display: grid; gap: 6px; }
.login-brand { display: flex; align-items: center; gap: 10px; }
.login-card .error { margin: 0; color: var(--down); }
.login-card .error:empty { display: none; }
.login-card button { margin-top: 6px; }
.sign-out { margin: 8px 12px 0; }
.chart .reference { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 4 4; }
.chart text.reference-label { fill: var(--ink-2); }
.chart .event { stroke: var(--surface); stroke-width: 2; cursor: default; }
.chart .event.open { fill: var(--up); }
.chart .event.close { fill: var(--ink-2); }
.chart-note { font-size: 12.5px; margin: 4px 0 0; }
.equity-change { font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: baseline; }
.trades-verdict { margin: 0 0 12px; color: var(--ink); }
.action-open { color: var(--ink); }
.action-close { color: var(--ink-2); }
.money-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.money-verdict { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.money-verdict.up { color: var(--up); }
.money-verdict.down { color: var(--down); }
.money-total { font-size: 30px; font-weight: 700; margin: 4px 0; }
.money-total .delta { font-size: inherit; }
.money-parts { display: grid; grid-template-columns: repeat(4, minmax(130px, auto)); gap: 4px 28px; margin: 0; }
.money-parts dt { font-size: 12.5px; color: var(--ink-2); }
.money-parts dd { margin: 0; font-weight: 600; font-size: 16px; }
.money-parts dd.muted { font-weight: 400; font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.filters-title { font-weight: 600; font-size: 13px; align-self: center; margin-right: 4px; }
@media (max-width: 900px) { .money-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fg-card .fg-now { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 17px; }
.fg-big { font-size: 30px; font-weight: 700; min-width: 72px; padding: 4px 12px; }
.fg-scale { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--down) 0%, var(--warn) 35%, var(--hold) 50%, var(--up) 75%, var(--up) 100%); opacity: 0.85; }
.fg-pointer { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.fg-ends { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 6px; }
.fg-card p { margin: 10px 0 0; }
.bot-strip { display: flex; flex-wrap: wrap; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-inner); padding: 14px 18px; margin-bottom: 20px; gap: 12px 0; }
.bot-badge { display: inline-flex; align-items: center; gap: 8px; align-self: center; padding: 8px 14px; border-radius: 999px; font-size: 14px; margin-right: 22px; background: var(--hold-soft); color: var(--hold); }
.bot-badge.good { background: var(--up-soft); color: var(--up); }
.bot-badge.bad { background: var(--down-soft); color: var(--down); }
.bot-item { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 22px; border-left: 1px solid var(--line); }
.bot-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.bot-value { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; font-weight: 600; }
.bot-value .muted { font-weight: 400; margin: 0; }
.bot-check.good { color: var(--up); }
.bot-check.warn { color: var(--warn); }
.bot-coin { display: inline-flex; align-items: center; gap: 6px; }
.bot-link { margin-left: auto; align-self: center; font-weight: 600; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.bot-link:hover { color: var(--accent); }
@media (max-width: 900px) { .bot-item { border-left: none; padding: 0 16px 0 0; } }
