/* SignalDesk — Oxon Capital inspired palette */
:root {
  --color-ink: #0B1930;
  --color-ink-2: #0C192B;
  --color-indigo: #162859;
  --color-platinum: #F5F6F8;
  --color-white: #FFFFFF;
  --color-accent: #4A6CF7;

  --color-bg: #F5F6F8;
  --color-canvas: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-surface-2: #F5F6F8;
  --color-surface-3: #EAEDF2;

  --color-sidebar: #0B1930;
  --color-sidebar-hover: #162859;

  --color-text: #0B1930;
  --color-text-muted: rgba(11, 25, 48, 0.62);
  --color-text-dim: rgba(11, 25, 48, 0.42);
  --color-text-inverse: #FFFFFF;
  --color-text-inverse-muted: rgba(255, 255, 255, 0.66);
  --color-text-inverse-dim: rgba(255, 255, 255, 0.42);

  --color-border: rgba(11, 25, 48, 0.08);
  --color-border-strong: rgba(11, 25, 48, 0.16);
  --color-border-light: rgba(255, 255, 255, 0.10);
  --color-border-light-strong: rgba(255, 255, 255, 0.20);

  --color-up: #0d9488;
  --color-down: #dc2626;
  --color-warn: #d97706;
  --color-info: #4A6CF7;

  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11, 25, 48, 0.04);
  --shadow: 0 8px 24px rgba(11, 25, 48, 0.06);
  --shadow-lg: 0 24px 64px rgba(11, 25, 48, 0.10);

  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; border-color: var(--color-border); }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  height: 100%;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
input:focus, textarea:focus, select:focus { outline: none; }
textarea { resize: none; }
button { cursor: pointer; }
a { color: inherit; }

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.eyebrow {
  display: inline-block; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 4px 10px; border: 1px solid var(--color-border-strong); border-radius: 999px;
}
.eyebrow--dark { color: var(--color-text-inverse-muted); border-color: var(--color-border-light-strong); }
.display { font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11, 25, 48, 0.12); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(11, 25, 48, 0.22); }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* Layout */
.app { display: flex; height: 100vh; overflow: hidden; background: var(--color-bg); }

/* ===== Viewer home — premium dark hero ===== */
.vh-home {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(74,108,247,0.12), transparent 60%),
    #080d1a;
  min-height: 100%;
  padding: 40px 40px 72px;
  font-family: var(--font-sans);
}
.vh-home-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.vh-home-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.vh-home-meta { font-size: 12px; color: rgba(255,255,255,0.4); font-family: var(--font-mono); }

.vh-hero-list { display: flex; flex-direction: column; gap: 28px; }

/* Live pill — tuned for dark backgrounds */
.vh-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: #6EE7A0; }
.vh-live-dot { width: 8px; height: 8px; border-radius: 999px; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,0.18); }

/* Hero feature card */
.vht-hero {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center;
  background: linear-gradient(160deg, #16223f 0%, #0e1a30 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px; padding: 52px 56px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.45);
}
.vht-copy { min-width: 0; }
.vht-name { margin: 16px 0 0; color: #fff; font-size: 46px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.vht-tagline { margin: 18px 0 0; color: rgba(255,255,255,0.92); font-size: 21px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.vht-desc { margin: 16px 0 0; color: rgba(255,255,255,0.6); font-size: 15px; line-height: 1.65; max-width: 48ch; }
.vht-rule { height: 1px; background: rgba(255,255,255,0.10); margin: 26px 0; }
.vht-meta { margin: 0; font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.6; }
.vht-meta strong { color: rgba(255,255,255,0.85); font-weight: 600; }
.vht-cta {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 30px; padding: 15px 30px;
  background: #fff; color: #0B1930; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.vht-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0,0,0,0.4); }
.vht-cta-arr { transition: transform .15s ease; }
.vht-cta:hover .vht-cta-arr { transform: translateX(4px); }

/* Live dashboard preview — a chromeless iframe of the real tracker, scaled to
   a non-interactive thumbnail (clicking the panel opens the full dashboard). */
.vht-preview { min-width: 0; }
.vhp-shell {
  display: block; position: relative; width: 100%; aspect-ratio: 3 / 2;
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  background: var(--color-bg);
  transition: border-color .15s ease, transform .15s ease;
}
.vhp-shell:hover { border-color: rgba(255,255,255,0.24); transform: translateY(-2px); }
.vhp-frame-live {
  position: absolute; top: 0; left: 0;
  width: 263%; height: 263%;
  transform: scale(0.38); transform-origin: top left;
  border: 0; pointer-events: none; background: var(--color-bg);
}
.vhp-veil { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8,13,26,0) 72%, rgba(8,13,26,0.18)); }

/* Empty state (dark) */
.vh-empty-hero { background: linear-gradient(160deg,#16223f,#0e1a30); border: 1px solid rgba(255,255,255,0.08); border-radius: 28px; padding: 56px; max-width: 640px; }
.vh-empty-title { color: #fff; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 16px 0 0; }
.vh-empty-sub { color: rgba(255,255,255,0.6); font-size: 15px; line-height: 1.65; margin: 12px 0 0; }

/* Sidebar logo (viewer mode) */
.sidebar-logo { height: 26px; width: auto; display: block; }

/* Viewer home — responsive */
@media (max-width: 900px) {
  .vh-home { padding: 24px 18px 56px; }
  .vht-hero { grid-template-columns: 1fr; gap: 30px; padding: 32px 24px; border-radius: 22px; }
  .vht-name { font-size: 34px; }
  .vht-tagline { font-size: 18px; }
  .vh-empty-hero { padding: 32px 24px; }
}

/* ===== Notes hub — each section rendered as a widget container ===== */
.notes-hub-grid { display: flex; flex-direction: column; gap: 14px; }
.notes-section { height: auto; display: flex; flex-direction: column; }
.notes-section-head { cursor: default; }
.notes-section-title { cursor: default; }
.notes-section-count {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--color-text-dim);
  padding: 2px 8px; border-radius: 999px; background: var(--color-surface-3);
  margin-left: 10px;
}
.notes-section-link {
  font-size: 12px; color: var(--color-accent); text-decoration: none; font-weight: 500;
}
.notes-section-link:hover { text-decoration: underline; }
.notes-section-body { padding: 14px 16px; }
.notes-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px;
}
.notes-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.notes-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 6px;
}
.notes-card-title { font-size: 13px; font-weight: 600; color: var(--color-ink); line-height: 1.3; }
.notes-card-meta {
  font-size: 10px; color: var(--color-text-dim);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.notes-card-body {
  font-size: 12.5px; line-height: 1.55; color: var(--color-text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: auto;
}
.hv-fields { display: flex; flex-direction: column; gap: 10px; max-height: none; }
.hv-field-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--color-text-dim); text-transform: uppercase; margin-bottom: 3px;
}
.hv-field-body { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }

/* ===== Notes timeline (Notes Hub) ===== */
.tl { position: relative; display: flex; flex-direction: column; gap: 4px; padding-left: 4px; }
.tl-item { display: grid; grid-template-columns: 18px 1fr; gap: 16px; position: relative; }
/* vertical rail line behind the dots */
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ''; position: absolute; top: 0; bottom: -4px; left: 50%; width: 2px; transform: translateX(-50%); background: var(--color-border); }
.tl-item:last-child .tl-rail::before { bottom: auto; height: 22px; }
.tl-dot { width: 12px; height: 12px; border-radius: 999px; margin-top: 16px; z-index: 1; border: 3px solid var(--color-bg); box-shadow: 0 0 0 1px var(--color-border); }
.tl-dot-morning { background: var(--color-accent); }
.tl-dot-house   { background: #c026d3; }
.tl-dot-note    { background: #16a34a; }
.tl-content { padding-bottom: 18px; min-width: 0; }
.tl-time { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; }
.tl-time-abs { font-size: 12px; font-weight: 600; color: var(--color-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tl-time-rel { font-size: 11px; color: var(--color-text-dim); }
.tl-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; }
.tl-card:hover { border-color: var(--color-border-strong); }
.tl-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.tl-kind { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.tl-kind-morning { background: rgba(74,108,247,0.12); color: var(--color-accent); }
.tl-kind-house   { background: rgba(192,38,211,0.12); color: #a21caf; }
.tl-kind-note    { background: rgba(34,197,94,0.14); color: #15803d; }
.tl-card-title { font-size: 13.5px; font-weight: 600; color: var(--color-ink); }
.tl-card-body { font-size: 13px; line-height: 1.6; color: var(--color-text); white-space: pre-wrap; word-break: break-word; }
.tl-fields { display: flex; flex-direction: column; gap: 10px; }
.tl-field-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-dim); margin-bottom: 3px; }
.tl-field-body { font-size: 13px; line-height: 1.55; color: var(--color-text); white-space: pre-wrap; }

/* ===== Shared admin tables (Users + Coupons pages) ===== */
.usr-editor { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.usr-editor-head { font-size: 11px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.usr-editor-row { display: flex; gap: 12px; flex-wrap: wrap; }
.usr-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-dim); }
.usr-field-role { max-width: 220px; }
.usr-field input, .usr-field select { padding: 9px 11px; font-size: 13px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-2); font-family: var(--font-sans); }
.usr-field input:focus, .usr-field select:focus { outline: none; border-color: var(--color-accent); background: var(--color-white); }
.usr-editor-actions { display: flex; gap: 8px; justify-content: flex-end; }
.usr-msg { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; }
.usr-msg.err { color: var(--color-down); background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.25); }
.usr-msg.ok  { color: #15803d; background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.30); }
.usr-count { font-size: 11px; color: var(--color-text-muted); font-family: var(--font-mono); padding: 1px 8px; border-radius: 999px; background: var(--color-surface-3); margin-left: 6px; }
.usr-table { display: flex; flex-direction: column; }
.usr-row { display: grid; grid-template-columns: 1fr 130px 150px 220px; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--color-border); }
.usr-row:last-child { border-bottom: none; }
.usr-row-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--color-text-dim); background: var(--color-surface-2); }
.usr-uname { font-size: 13.5px; font-weight: 500; color: var(--color-ink); font-family: var(--font-mono); }
.usr-uname .you { font-size: 9.5px; color: var(--color-accent); font-family: var(--font-sans); margin-left: 6px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.usr-role-pill { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; display: inline-block; }
.usr-role-admin { background: var(--color-accent); color: var(--color-white); }
.usr-role-moderator { background: rgba(245,158,11,0.18); color: #b45309; }
.usr-role-user  { background: rgba(34,197,94,0.16); color: #15803d; }
.usr-role-select { font-family: var(--font-mono); font-size: 12px; padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-1); color: var(--color-ink); cursor: pointer; }
.usr-role-select:hover { border-color: var(--color-border-strong); }
.usr-role-select:focus { outline: none; border-color: var(--color-accent); }

/* Tracker lifecycle stage badge (shared: All Trackers + editor page-head) */
.tk-stage-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.tk-stage-building { background: rgba(100,116,139,0.18); color: #475569; }
.tk-stage-preview  { background: rgba(245,158,11,0.18); color: #b45309; }
.tk-stage-live     { background: rgba(34,197,94,0.18); color: #15803d; }
.usr-access { display: flex; align-items: center; gap: 6px; }
.usr-access-summary { font-size: 12px; color: var(--color-text-muted); }
.usr-access-all { color: var(--color-accent); font-weight: 600; }
.usr-access-edit { font-size: 10.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent; cursor: pointer; color: var(--color-text-muted); }
.usr-access-edit:hover { background: var(--color-surface-2); color: var(--color-ink); }
.usr-actions-col { text-align: right; }
.usr-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.usr-row-actions button { font-size: 11px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--color-border); background: transparent; cursor: pointer; color: var(--color-text-muted); }
.usr-row-actions button:hover { background: var(--color-surface-2); color: var(--color-ink); border-color: var(--color-border-strong); }
.usr-row-actions button.danger { color: var(--color-down); }
.usr-row-actions button.danger:hover { border-color: rgba(220,38,38,0.4); }
.usr-empty { padding: 24px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.usr-access-panel { padding: 16px 18px; background: var(--color-surface-1); border-bottom: 1px solid var(--color-border); border-left: 3px solid var(--color-accent); }
.usr-access-panel-head { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-dim); margin-bottom: 12px; }
.usr-access-all-toggle { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-white); cursor: pointer; margin-bottom: 10px; font-size: 13px; font-weight: 500; }
.usr-access-all-toggle input { width: 17px; height: 17px; accent-color: var(--color-accent); cursor: pointer; }
.usr-access-divider { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-dim); margin: 4px 0 8px; }
.usr-access-trackers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.usr-access-trk { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-white); cursor: pointer; font-size: 13px; }
.usr-access-trk input { width: 16px; height: 16px; accent-color: var(--color-accent); cursor: pointer; }
.usr-access-trk.disabled { opacity: 0.45; pointer-events: none; }
.usr-access-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ===== Marketing / checkout — Oxon Capital institutional theme =====
   Palette + tokens lifted from oxoncapital.co.uk: dark-navy ink, platinum
   surface, accent blue, soft large shadows, generous radius. Scoped to the
   standalone marketing pages so the in-app dashboard theme is untouched. */
.marketing-body {
  /* Oxon tokens */
  --ox-ink: #0B1930;
  --ox-ink-2: #0C192B;
  --ox-indigo: #162859;
  --ox-platinum: #F5F6F8;
  --ox-accent: #4A6CF7;
  --ox-green: #16a34a;
  --ox-line: rgba(11, 25, 48, 0.10);
  --ox-line-strong: rgba(11, 25, 48, 0.18);
  --ox-muted: rgba(11, 25, 48, 0.60);
  --ox-radius: 14px;
  --ox-radius-lg: 22px;
  --ox-shadow: 0 12px 32px rgba(11, 25, 48, 0.08);
  --ox-shadow-lg: 0 30px 80px rgba(11, 25, 48, 0.16);
  --ox-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ox-hero: linear-gradient(180deg, #14213D 0%, #0F1A30 100%);
  /* Map the shared variables the marketing classes use onto Oxon values */
  --color-ink: var(--ox-ink);
  --color-accent: var(--ox-accent);
  --color-text-muted: var(--ox-muted);
  --color-border: var(--ox-line);
  --color-border-strong: var(--ox-line-strong);
  background: var(--ox-platinum); margin: 0; min-height: 100vh;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ox-ink);
}
/* Dark institutional top bar */
.mkt-topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; background: var(--ox-hero); border-bottom: 1px solid rgba(255,255,255,0.08); }
.mkt-brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #fff; text-decoration: none; }
.mkt-brand .dot { width: 9px; height: 9px; border-radius: 999px; background: var(--ox-accent); box-shadow: 0 0 0 4px rgba(74,108,247,0.25); }
.mkt-nav { display: flex; gap: 20px; align-items: center; }
.mkt-nav a { font-size: 13px; color: rgba(255,255,255,0.72); text-decoration: none; font-weight: 500; transition: color .15s; }
.mkt-nav a:hover { color: #fff; }
.mkt-main { max-width: 1040px; margin: 0 auto; padding: 52px 28px 72px; }
/* Institutional hero band (used by other marketing pages, not checkout) */
.mkt-hero-band { background: var(--ox-hero); border-bottom: 1px solid rgba(255,255,255,0.06); }
.mkt-hero-inner { max-width: 1040px; margin: 0 auto; padding: 40px 28px 44px; }
.mkt-hero-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ox-accent); }
.mkt-hero-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin-top: 8px; line-height: 1.2; }
.mkt-hero-sub { font-size: 14px; color: rgba(255,255,255,0.66); margin-top: 8px; max-width: 560px; line-height: 1.55; }

/* Checkout body: just the checkout + footer, no header/hero. */
.checkout-body { display: flex; flex-direction: column; min-height: 100vh; }
.checkout-main { flex: 1; padding-top: 56px; }

/* Footer (Oxon institutional, dark) */
.mkt-footer { background: var(--ox-hero); color: rgba(255,255,255,0.7); border-top: 1px solid rgba(255,255,255,0.08); margin-top: auto; }
.mkt-footer-inner { max-width: 1040px; margin: 0 auto; padding: 36px 28px 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.mkt-footer-brand { display: flex; flex-direction: column; gap: 6px; }
.mkt-footer-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #fff; }
.mkt-footer-name .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ox-accent); box-shadow: 0 0 0 4px rgba(74,108,247,0.25); }
.mkt-footer-tag { font-size: 12.5px; color: rgba(255,255,255,0.55); max-width: 360px; line-height: 1.5; }
.mkt-footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.mkt-footer-nav a { font-size: 13px; color: rgba(255,255,255,0.7); text-decoration: none; }
.mkt-footer-nav a:hover { color: #fff; }
.mkt-footer-bottom { max-width: 1040px; margin: 0 auto; padding: 22px 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: rgba(255,255,255,0.42); }
.mkt-hero { text-align: center; margin-bottom: 40px; }
.mkt-h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 8px; }
.mkt-lede { font-size: 15px; color: var(--color-text-muted); max-width: 520px; margin: 0 auto; line-height: 1.6; }
.mkt-empty { text-align: center; padding: 60px 20px; color: var(--color-text-muted); font-size: 15px; }
.mkt-empty a { color: var(--color-accent); }

.mkt-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mkt-plan { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.mkt-plan:hover { border-color: var(--color-accent); box-shadow: 0 10px 30px rgba(74,108,247,.10); transform: translateY(-2px); }
.mkt-plan-name { font-size: 19px; font-weight: 700; color: var(--color-ink); }
.mkt-plan-sub { font-size: 12.5px; color: var(--color-text-muted); margin-top: 2px; }
.mkt-plan-price { display: flex; align-items: baseline; gap: 4px; }
.mkt-plan-amount { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; }
.mkt-plan-interval { font-size: 14px; color: var(--color-text-muted); }
.mkt-plan-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mkt-plan-feats li { font-size: 13px; color: var(--color-text); display: flex; align-items: center; gap: 8px; }
.mkt-check { color: #16a34a; font-weight: 700; }
.mkt-more { color: var(--color-text-dim); font-style: italic; padding-left: 22px; }
.mkt-plan-cta { display: block; text-align: center; padding: 11px 16px; border-radius: 10px; background: var(--color-ink); color: var(--color-white); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .12s; }
.mkt-plan-cta:hover { background: var(--color-accent); }
.mkt-foot-note { text-align: center; margin-top: 36px; font-size: 12px; color: var(--color-text-dim); font-style: italic; }

/* Checkout (CRO) — form left, sticky summary right */
.checkout-main { max-width: 1000px; }
.checkout-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.checkout-form-card { background: #fff; border: 1px solid var(--ox-line); border-radius: var(--ox-radius-lg); padding: 34px 36px; box-shadow: var(--ox-shadow-lg); }
.checkout-form-card .eyebrow { margin-bottom: 10px; }
.checkout-h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.2; }
.checkout-value { font-size: 14px; color: var(--color-text-muted); line-height: 1.55; margin: 0 0 20px; }
.checkout-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* Billing-interval upsell (segmented) */
.checkout-billing { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.checkout-bill-opt { position: relative; text-align: left; padding: 14px 16px; border: 1.5px solid var(--color-border); border-radius: 12px; background: var(--color-white); cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, background .12s; }
.checkout-bill-opt:hover { border-color: var(--color-border-strong); }
.checkout-bill-opt.is-active { border-color: var(--color-accent); background: rgba(74,108,247,0.05); box-shadow: 0 0 0 1px var(--color-accent) inset; }
.checkout-bill-label { font-size: 13px; font-weight: 600; color: var(--color-ink); }
.checkout-bill-price { font-size: 17px; font-weight: 800; color: var(--color-ink); letter-spacing: -0.01em; }
.checkout-bill-sub { font-size: 11px; color: #15803d; font-weight: 600; }
.checkout-bill-tag { position: absolute; top: -9px; right: 12px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: #16a34a; color: #fff; padding: 2px 8px; border-radius: 999px; }
.checkout-trust-item { font-size: 11.5px; font-weight: 500; color: var(--color-text); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px 12px; position: relative; padding-left: 26px; }
.checkout-trust-item::before { content: "✓"; position: absolute; left: 11px; color: #16a34a; font-weight: 700; }
.checkout-feats { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.checkout-feats li { font-size: 12.5px; color: var(--color-text); display: flex; align-items: center; gap: 7px; }

/* Order bump (the All Access upsell) */
.checkout-bump { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 20px; border: 2px dashed var(--color-accent); border-radius: 12px; background: rgba(74,108,247,0.05); cursor: pointer; transition: background .12s; }
.checkout-bump:hover { background: rgba(74,108,247,0.09); }
.checkout-bump input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--color-accent); cursor: pointer; flex-shrink: 0; }
.checkout-bump-body { display: flex; flex-direction: column; gap: 4px; }
.checkout-bump-title { font-size: 13.5px; font-weight: 700; color: var(--color-ink); display: flex; align-items: center; gap: 8px; }
.checkout-bump-save { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: #16a34a; color: #fff; padding: 2px 8px; border-radius: 999px; }
.checkout-bump-text { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; }
.checkout-bump-text strong { color: var(--color-ink); }

.checkout-section-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-dim); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.checkout-demo-pill { font-size: 8.5px; padding: 2px 6px; border-radius: 999px; background: rgba(245,158,11,0.18); color: #b45309; letter-spacing: 0.1em; }
.checkout-fill { margin-left: auto; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--color-accent); background: none; border: 0; cursor: pointer; }
.checkout-fill:hover { text-decoration: underline; }
.checkout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Coupon field */
.checkout-coupon { display: flex; gap: 8px; margin-top: 18px; }
.checkout-coupon input { flex: 1; padding: 10px 12px; font-size: 13px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-1); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.checkout-coupon input:focus { outline: none; border-color: var(--color-accent); background: var(--color-white); }
.checkout-coupon button { padding: 0 16px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--color-border-strong); background: var(--color-white); color: var(--color-ink); border-radius: 8px; cursor: pointer; }
.checkout-coupon button:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.checkout-coupon-msg { font-size: 12px; margin-top: 8px; padding: 7px 10px; border-radius: 7px; }
.checkout-coupon-msg.ok  { color: #15803d; background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.25); }
.checkout-coupon-msg.err { color: var(--color-down); background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.22); }
.checkout-pay-btn { margin-top: 18px; width: 100%; font-size: 15px; background: var(--ox-accent); border-radius: 12px; box-shadow: 0 8px 20px rgba(74,108,247,0.28); transition: transform .15s var(--ox-ease), box-shadow .15s var(--ox-ease), background .15s; }
.checkout-pay-btn:hover { transform: translateY(-1px); background: #3a5cf0; box-shadow: 0 12px 28px rgba(74,108,247,0.36); }
.checkout-pay-btn:disabled { transform: none; opacity: 0.7; box-shadow: none; }
.checkout-guarantee { font-size: 11.5px; color: var(--color-text-muted); text-align: center; margin-top: 10px; }
.checkout-signin { font-size: 12.5px; color: var(--color-text-muted); text-align: center; margin-top: 16px; }
.checkout-signin a { color: var(--color-accent); text-decoration: none; }

/* Sticky order summary — dark institutional panel (Oxon hero gradient) */
.checkout-summary { background: var(--ox-hero); border: 1px solid rgba(255,255,255,0.10); border-radius: var(--ox-radius-lg); padding: 26px 24px; position: sticky; top: 24px; box-shadow: var(--ox-shadow-lg); color: #fff; }
.checkout-summary .eyebrow { margin-bottom: 6px; color: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.20); }
.checkout-summary .checkout-sum-name { color: #fff; }
.checkout-summary .checkout-sum-sub { color: rgba(255,255,255,0.62); }
.checkout-summary .checkout-sum-line { color: rgba(255,255,255,0.72); border-top-color: rgba(255,255,255,0.12); }
.checkout-summary .checkout-sum-total { color: #fff; border-top-color: rgba(255,255,255,0.16); }
.checkout-summary .checkout-sum-discount { color: #6EE7A0; }
.checkout-summary .checkout-sum-perks li { color: rgba(255,255,255,0.82); }
.checkout-summary .mkt-check { color: #6EE7A0; }
.checkout-summary .checkout-demo-note { color: rgba(255,255,255,0.42); }
.checkout-sum-name { font-size: 18px; font-weight: 700; margin-top: 8px; }
.checkout-sum-sub { font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }
.checkout-sum-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-text-muted); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.checkout-sum-discount { color: #15803d; font-weight: 600; margin-top: 8px; padding-top: 0; border-top: 0; }
.checkout-sum-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; color: var(--color-ink); margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--color-border); }
/* 7-day free trial: $0 due today, recurring price shown below */
.checkout-sum-free { color: #16a34a; }
.checkout-summary .checkout-sum-free { color: #6EE7A0; }
.checkout-sum-after { margin-top: 8px; padding-top: 0; border-top: 0; font-size: 12.5px; }
.checkout-trial-note { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; margin: -2px 0 12px; }
.checkout-banner { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.32); color: #b45309; font-size: 13px; line-height: 1.5; padding: 11px 14px; border-radius: 12px; margin-bottom: 18px; }
.checkout-sum-perks { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 7px; }
.checkout-sum-perks li { font-size: 12px; color: var(--color-text); display: flex; align-items: center; gap: 7px; }
.checkout-demo-note { font-size: 11px; color: var(--color-text-dim); font-style: italic; margin-top: 16px; }
/* Keep grid tracks and form controls from blowing past a narrow viewport.
   Text inputs carry an intrinsic ~150px min-width, so a bare `1fr 1fr` track
   refuses to shrink and forces the whole page wider than the phone. */
.checkout-row > * { min-width: 0; }
.checkout-billing > * { min-width: 0; }
@media (max-width: 760px) {
  .mkt-main { padding-left: 18px; padding-right: 18px; }
  .checkout-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .checkout-summary { position: static; order: -1; padding: 22px 20px; }
  .checkout-form-card { padding: 24px 20px; }
  .checkout-feats { grid-template-columns: 1fr; }
  .checkout-billing { grid-template-columns: 1fr; }
  .checkout-row { grid-template-columns: 1fr; }
  .checkout-h1 { font-size: 22px; }
}
@media (max-width: 760px) and (min-width: 421px) {
  /* roomy phones: keep the billing toggle side-by-side, it reads better */
  .checkout-billing { grid-template-columns: 1fr 1fr; }
}

.login-getaccess { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--color-text-muted); }
.login-getaccess a { color: var(--color-accent); text-decoration: none; font-weight: 500; }
.login-getaccess a:hover { text-decoration: underline; }

/* ===== Login page ===== */
.login-body { background: var(--color-bg); height: 100vh; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; font-family: var(--font-sans); }
.login-card { width: 100%; max-width: 360px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 14px; padding: 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.06); }
.login-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--color-ink); margin-bottom: 24px; }
.login-brand .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--color-accent); }
.login-title { font-size: 24px; font-weight: 700; color: var(--color-ink); margin: 0 0 6px; letter-spacing: -0.01em; }
.login-sub { font-size: 13px; color: var(--color-text-muted); margin: 0 0 22px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); }
.login-label input { padding: 10px 12px; font-size: 14px; font-family: var(--font-sans); border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-1); transition: border-color 0.12s; }
.login-label input:focus { outline: none; border-color: var(--color-accent); background: var(--color-white); }
.login-btn { margin-top: 8px; padding: 11px 16px; font-size: 14px; font-weight: 600; border-radius: 8px; border: 0; background: var(--color-ink); color: var(--color-white); cursor: pointer; transition: background 0.12s; }
.login-btn:hover { background: var(--color-accent); }
.login-err { padding: 10px 12px; font-size: 12.5px; color: var(--color-down); background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.25); border-radius: 8px; }
.login-hints { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--color-border); }
.login-hints summary { cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); user-select: none; }
.login-hints summary:hover { color: var(--color-ink); }
.login-hint-body { margin-top: 12px; font-size: 12px; color: var(--color-text); line-height: 1.55; }
.login-hint-body code { background: var(--color-surface-2); padding: 1px 5px; border-radius: 3px; font-family: var(--font-mono); font-size: 11.5px; }
.login-hint-body ul { padding-left: 18px; margin: 8px 0 0; }
.login-hint-body li { margin: 4px 0; }

/* ===== User pill in topbar ===== */
.user-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border-radius: 999px; background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 11.5px; font-family: var(--font-sans); margin-left: 10px; }
.user-pill-role { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; padding: 1px 6px; border-radius: 999px; }
.user-pill-role-admin { background: var(--color-accent); color: var(--color-white); }
.user-pill-role-moderator { background: rgba(245,158,11,0.20); color: #fbbf24; }
.user-pill-role-user  { background: rgba(34,197,94,0.16); color: #15803d; }
.user-pill-name { font-weight: 500; color: var(--color-ink); }
.user-pill-logout { width: 20px; height: 20px; border-radius: 999px; background: var(--color-white); color: var(--color-text-muted); text-decoration: none; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.12s; }
.user-pill-logout:hover { background: var(--color-ink); color: var(--color-white); }

/* ===== Viewer (public read-only) mode ===== */
/* Use a normal-flow column instead of position:fixed so the banner doesn't
   double-scroll or sit on top of the sidebar's left edge. */
body.viewer-mode { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.viewer-mode .app { height: auto; flex: 1; min-height: 0; }
.viewer-banner {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  background: var(--color-ink); color: var(--color-white);
  font-size: 11.5px; font-family: var(--font-sans); line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.viewer-banner-pill {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em; padding: 2px 8px;
  border-radius: 999px; background: var(--color-accent); color: var(--color-white);
  flex-shrink: 0;
}
/* Viewer-mode chrome hiding — keep the widget HEADER (so the title is visible)
   but suppress every admin/meta indicator inside it. */
body.viewer-mode .widget-menu-btn,
body.viewer-mode .widget-menu,
body.viewer-mode .widget-lock-badge,
body.viewer-mode .widget-updated,
body.viewer-mode .widget-status,
body.viewer-mode .grid-stack-item > .ui-resizable-handle { display: none !important; }
body.viewer-mode .widget-drag-handle { cursor: default; }
body.viewer-mode .widget-title-btn { cursor: default; pointer-events: none; }
body.viewer-mode .widget { cursor: default; }
/* Header-right cluster has nothing to show in viewer mode → don't leave its gap */
body.viewer-mode .widget-head-r { gap: 0; }
/* Hide "12 widgets" count next to the tracker name in the page H1 */
body.viewer-mode .page-head h1 .count,
body.viewer-mode .sidebar-tracker-count { display: none !important; }
/* Lock the grid visually */
body.viewer-mode .grid-stack.grid-stack-locked .grid-stack-item { transition: none; }
/* Hide any "edit"/"settings"/"upload" controls within widgets */
body.viewer-mode [data-admin-only],
body.viewer-mode .widget-edit,
body.viewer-mode .widget-settings,
body.viewer-mode .widget-upload,
body.viewer-mode .ai-config,
body.viewer-mode .api-config,
body.viewer-mode .tabs-config,
body.viewer-mode .mk-config { display: none !important; }
/* Topbar: non-interactive current-tracker label (viewer mode) */
.view-tab-current {
  display: inline-flex; align-items: center;
  padding: 7px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--color-ink);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  line-height: 1.2;
  cursor: default;
}

/* Page head — viewer mode is tighter (no eyebrow) */
.page-head-viewer { padding-top: 8px; padding-bottom: 8px; }
.page-head-viewer h1 { margin-top: 6px; }
/* "Back to dashboard" link on a viewer tracker page */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--color-text-muted); text-decoration: none; padding: 4px 0; transition: color .12s; }
.back-link:hover { color: var(--color-accent); }
.back-link .back-arrow { font-size: 14px; line-height: 1; }

/* Sidebar tracker list (viewer-mode replacement for /trackers page).
   Section labels use the shared .sidebar-group-label class (same as admin). */
.sidebar-trackers-list { display: contents; }
/* Viewer-mode tracker links: inherit the SAME visual treatment as the admin
   sidebar nav (pill-shaped, 40px tall, white-active). The base .sidebar-nav a
   rule already provides nearly everything — we only need to handle the inner
   flex layout (name + optional count) and ellipsis truncation. */
.sidebar-nav a.sidebar-tracker-link { justify-content: space-between; }
.sidebar-tracker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--color-sidebar); color: var(--color-text-inverse);
  display: flex; flex-direction: column;
}
/* Brand + section labels left-align with the nav item TEXT (24px = 12px nav
   padding + 12px link padding) so the whole sidebar shares one left edge. */
.sidebar-brand { padding: 0 24px; height: 64px; display: flex; align-items: center; }
.sidebar-brand a { display: flex; align-items: center; text-decoration: none; color: inherit; }
.sidebar-brand .name { font-weight: 600; letter-spacing: -0.01em; font-size: 17px; }
.sidebar-section { padding: 0 24px 10px; }
.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
/* Group headers that organise the admin nav into Workspace / Build / Content / Admin */
.sidebar-group-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-inverse-muted); opacity: 0.6;
  padding: 0 12px; margin: 14px 0 5px;
}
.sidebar-group-label:first-child { margin-top: 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px; height: 40px; border-radius: 999px;
  font-size: 13.5px; text-decoration: none;
  color: var(--color-text-inverse-muted);
  transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav a:hover { background: var(--color-sidebar-hover); color: var(--color-text-inverse); }
.sidebar-nav a.active { background: var(--color-white); color: var(--color-ink); font-weight: 500; }

/* Sidebar footer — signed-in account + logout (admin, moderator, user) */
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--color-border-light); display: flex; flex-direction: column; gap: 10px; }
.sidebar-acct { display: flex; align-items: center; gap: 8px; padding: 0 2px; min-width: 0; }
.sidebar-acct-role { font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 999px; flex-shrink: 0; }
.sidebar-acct-name { font-size: 12.5px; color: var(--color-text-inverse-muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border-light-strong); color: var(--color-text-inverse-muted); font-size: 13px; font-weight: 500; text-decoration: none; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.sidebar-logout:hover { background: var(--color-sidebar-hover); color: var(--color-text-inverse); border-color: var(--color-white); }
.sidebar-logout svg { flex-shrink: 0; }
.sidebar-status {
  margin: 16px; padding: 16px;
  border-radius: 14px; border: 1px solid var(--color-border-light);
  background: rgba(22, 40, 89, 0.3);
}
.sidebar-status .label {
  font-size: 11px; color: var(--color-text-inverse-muted);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500;
}
.sidebar-status .row { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.sidebar-status .row .muted { color: var(--color-text-inverse-muted); }
.sidebar-status .row .live { display: flex; align-items: center; gap: 6px; color: var(--color-text-inverse); }
.sidebar-status .row .live .pulse { width: 6px; height: 6px; border-radius: 50%; background: #5ad9b7; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 70px; background: var(--color-sidebar); color: var(--color-text-inverse);
  display: flex; align-items: center; padding: 0 24px; gap: 24px;
}
.view-tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: thin; padding-bottom: 2px; }
.view-tabs::-webkit-scrollbar { height: 4px; }
.view-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.view-tab { flex-shrink: 0; white-space: nowrap; }
.view-tab {
  height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; letter-spacing: -0.01em;
  background: transparent; color: var(--color-text-inverse-muted);
  border: 1px solid var(--color-border-light-strong);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.view-tab:hover { color: var(--color-text-inverse); border-color: var(--color-white); }
.view-tab.active { background: var(--color-white); color: var(--color-ink); border-color: var(--color-white); }
.view-tab.add { width: 32px; padding: 0; border-style: dashed; font-size: 16px; line-height: 1; }

.market-tape { display: flex; align-items: center; gap: 20px; overflow: hidden; flex: 1; }
.market-tape .item { display: flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; }
.market-tape .sym { color: var(--color-text-inverse-muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; }
.market-tape .val { color: var(--color-text-inverse); font-variant-numeric: tabular-nums; }
.market-tape .chg { font-variant-numeric: tabular-nums; font-weight: 500; }
.market-tape .chg.up { color: #5ad9b7; }
.market-tape .chg.down { color: #ff8a8a; }

.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-right .clock { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--color-text-inverse-muted); }
.search-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--color-border-light-strong);
  background: transparent; color: var(--color-text-inverse-muted);
  font-size: 12px;
}
.search-pill:hover { color: var(--color-text-inverse); border-color: var(--color-white); }
.search-pill kbd { font-family: var(--font-mono); font-size: 10px; opacity: 0.7; padding: 2px 5px; border: 1px solid var(--color-border-light); border-radius: 4px; }

.content { flex: 1; overflow: auto; background: var(--color-bg); }

/* Sticky sub-header per page */
.page-head {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(245, 246, 248, 0.85);
  border-bottom: 1px solid var(--color-border);
  padding: 22px 32px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.page-head h1 {
  margin: 10px 0 0; font-weight: 500; letter-spacing: -0.02em;
  font-size: 22px; line-height: 1.12; color: var(--color-ink);
}
.page-head h1 .count { font-size: 14px; color: var(--color-text-dim); font-weight: 400; margin-left: 12px; font-variant-numeric: tabular-nums; }
.page-head .subtitle { font-size: 13px; color: var(--color-text-muted); margin-top: 8px; line-height: 1.6; max-width: 640px; }

.btn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 999px;
  background: var(--color-ink); color: var(--color-white);
  font-size: 13.5px; font-weight: 500; border: none;
  transition: background-color .15s ease;
}
.btn-pill:hover { background: var(--color-indigo); }
.btn-pill .plus { font-size: 16px; line-height: 1; }
.btn-pill-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  background: transparent; color: var(--color-text);
  font-size: 13px; border: 1px solid var(--color-border-strong);
}
.btn-pill-ghost:hover { background: var(--color-surface-2); }

/* Empty state */
.empty-page {
  padding: 96px 24px; text-align: center; max-width: 560px; margin: 0 auto;
}
.empty-page h2 { font-size: 28px; margin-top: 16px; color: var(--color-ink); }
.empty-page p { font-size: 14px; color: var(--color-text-muted); margin-top: 12px; line-height: 1.6; }
.empty-page .btn-pill { height: 48px; padding: 0 24px; font-size: 14px; margin-top: 28px; }

/* Grid stack overrides */
.grid-wrap { padding: 24px 32px; padding-bottom: 64px; }
.grid-stack { background: transparent; }
.grid-stack > .grid-stack-item > .grid-stack-item-content { inset: 0; }
.grid-stack > .grid-stack-item.ui-resizable-resizing,
.grid-stack > .grid-stack-item.ui-draggable-dragging { z-index: 5; }
.grid-stack-placeholder > .placeholder-content {
  background: rgba(74, 108, 247, 0.08);
  border: 1px dashed var(--color-accent);
  border-radius: 14px;
}

/* Widget card */
.widget {
  height: 100%; width: 100%; display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.widget-drag-handle {
  height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 16px; padding-right: 8px;
  border-bottom: 1px solid var(--color-border);
  cursor: grab;
}
.widget-drag-handle:active { cursor: grabbing; }
.widget-head-l { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.widget-title-btn {
  background: transparent; border: none; padding: 0;
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-ink); text-align: left;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.widget-title-btn:hover { color: var(--color-accent); }
.widget-title-static {
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-ink); padding: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.widget-lock-badge {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em;
  color: var(--color-text-muted); background: var(--color-surface-3);
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--color-border-strong);
}
.widget-locked .ai-config-locked input[readonly],
.widget-locked .ai-config-locked textarea[readonly],
.widget-locked .api-config-locked input[readonly],
.widget-locked .api-config-locked textarea[readonly],
.widget-locked .ai-config-locked select[disabled],
.widget-locked .api-config-locked select[disabled],
.widget-locked .api-config-locked input[type="number"][readonly] {
  background: transparent; color: var(--color-text-muted); cursor: default;
  border-color: transparent;
}
.widget-locked .ai-config-locked input[data-ai-key] {
  background: var(--color-white); color: var(--color-text); border-color: var(--color-border);
}
.widget-title-input {
  background: var(--color-surface-2); border: 1px solid var(--color-border-strong);
  border-radius: 999px; font-size: 13px; font-weight: 500;
  padding: 5px 12px; max-width: 260px; color: var(--color-ink);
}
.widget-head-r { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.widget-updated { font-size: 10.5px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; }
.widget-menu-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: transparent; border: none;
  color: var(--color-text-muted);
}
.widget-menu-btn:hover { background: var(--color-surface-3); color: var(--color-ink); }

.widget-menu {
  position: fixed; z-index: 200;
  width: 208px; background: var(--color-white);
  border: 1px solid var(--color-border-strong); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px 0; font-size: 13px;
}
.widget-menu button {
  width: 100%; text-align: left; padding: 8px 16px;
  background: transparent; border: none; color: var(--color-ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.widget-menu button:hover { background: var(--color-surface-2); }
.widget-menu button.danger { color: var(--color-down); }
.widget-menu hr { border: none; border-top: 1px solid var(--color-border); margin: 6px 12px; }
.widget-menu .section-label { padding: 4px 16px; font-size: 10px; color: var(--color-text-dim); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.widget-menu .meta { color: var(--color-text-dim); font-size: 11px; }
.widget-menu .on { color: var(--color-accent); font-size: 11px; }

.widget-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.widget-body > textarea { flex: 1; min-height: 0; }
.widget-list { flex: 1; min-height: 0; overflow: auto; }
.widget-status {
  padding: 6px 16px; font-size: 11px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2); color: var(--color-text-muted);
}
.widget-status.ok { background: rgba(13, 148, 136, 0.10); color: var(--color-up); }
.widget-status.err { background: rgba(220, 38, 38, 0.10); color: var(--color-down); }

/* widget interiors — shared parts */
.section-strip {
  padding: 6px 12px; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: 10px; color: var(--color-text-dim);
  text-transform: uppercase; letter-spacing: 0.14em;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}

.add-link {
  width: 100%; text-align: left; padding: 8px 12px;
  font-size: 11px; color: var(--color-accent);
  background: transparent; border: none; border-top: 1px solid var(--color-border);
}
.add-link:hover { background: var(--color-surface-2); }

.inline-form {
  padding: 8px 12px; border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.inline-form input, .inline-form textarea {
  width: 100%; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; margin-bottom: 6px;
}
.inline-form .row { display: flex; gap: 6px; margin-top: 6px; }
.inline-form .save {
  font-size: 11px; padding: 4px 10px; background: var(--color-accent);
  color: var(--color-white); border: none; border-radius: 6px; font-weight: 500;
}
.inline-form .cancel {
  font-size: 11px; padding: 4px 10px; background: transparent;
  color: var(--color-text-muted); border: none;
}

.row-item {
  display: flex; align-items: center; padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}
.row-item:hover { background: var(--color-surface-2); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-size: 12px; font-weight: 500; color: var(--color-text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; text-decoration: none; }
.row-item .title:hover { color: var(--color-accent); }
.row-item .meta { font-size: 10px; color: var(--color-text-dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-item .remove { opacity: 0; font-size: 11px; color: var(--color-text-dim); background: transparent; border: none; margin-left: 8px; }
.row-item:hover .remove { opacity: 1; }
.row-item .remove:hover { color: var(--color-down); }

.empty-mini {
  padding: 28px 16px; text-align: center;
  font-size: 12px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500;
}
.empty-mini .hint { display: block; font-size: 11px; color: var(--color-text-dim); margin-top: 6px; text-transform: none; letter-spacing: normal; font-weight: 400; max-width: 260px; margin-left: auto; margin-right: auto; }

.notes-area, .text-area {
  flex: 1; width: 100%; height: 100%; background: transparent;
  padding: 10px 12px; border: none; resize: none;
  font-size: 13px; line-height: 1.6; color: var(--color-text);
  overflow: auto;
}
.notes-area::placeholder { color: var(--color-text-dim); }

/* countdown */
.cd-row { padding: 10px 12px; border-bottom: 1px solid var(--color-border); }
.cd-row:hover { background: var(--color-surface-2); }
.cd-row .label { font-size: 12px; color: var(--color-text); display: flex; justify-content: space-between; align-items: center; }
.cd-row .remove { opacity: 0; font-size: 10px; color: var(--color-down); background: transparent; border: none; }
.cd-row:hover .remove { opacity: 1; }
.cd-row .big { font-size: 17px; font-weight: 600; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.cd-row .when { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.cd-row .body { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }

/* tickers */
.ticker-head {
  display: grid; grid-template-columns: 1fr auto auto;
  padding: 8px 16px; font-size: 10px; color: var(--color-text-dim);
  text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500;
  background: var(--color-surface-2);
}
.ticker-head > div:nth-child(2) { text-align: right; padding-right: 12px; }
.ticker-head > div:nth-child(3) { text-align: right; }
.ticker-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--color-border);
  text-decoration: none; color: inherit;
}
.ticker-row:hover { background: var(--color-surface-2); }
.ticker-row .sym { font-size: 12.5px; font-weight: 600; color: var(--color-text); }
.ticker-row:hover .sym { color: var(--color-accent); }
.ticker-row .name { font-size: 10.5px; color: var(--color-text-dim); }
.ticker-row .last { font-size: 12.5px; color: var(--color-text); padding-right: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.ticker-row .chg { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.ticker-row .chg .pct { font-size: 11px; opacity: 0.9; }
.ticker-row .chg.up   { color: var(--color-up); }
.ticker-row .chg.down { color: var(--color-down); }

/* news */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--color-border); align-items: flex-start; font-size: 13px; }
.news-list li:hover { background: var(--color-surface-2); }
.news-list .time { font-size: 10.5px; color: var(--color-text-dim); min-width: 36px; font-variant-numeric: tabular-nums; }
.news-list .src  { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.08em; min-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list a { color: var(--color-text); text-decoration: none; font-size: 12.5px; line-height: 1.45; }
.news-list a:hover { color: var(--color-accent); }

/* alerts */
.alert-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--color-border); font-size: 12px; }
.alert-row:hover { background: var(--color-surface-2); }
.alert-row .sym { font-weight: 600; min-width: 56px; }
.alert-row .cond { flex: 1; color: var(--color-text-muted); }
.alert-row .pill {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(13, 148, 136, 0.10); color: var(--color-up);
}
.alert-row.status-triggered .pill { background: rgba(217, 119, 6, 0.12); color: var(--color-warn); }
.alert-row.status-snoozed .pill { background: rgba(11, 25, 48, 0.06); color: var(--color-text-muted); }
.alert-row .remove { opacity: 0; background: transparent; border: none; color: var(--color-text-dim); font-size: 10px; }
.alert-row:hover .remove { opacity: 1; }
.alert-row .remove:hover { color: var(--color-down); }

/* ai / api */
.ai-config, .api-config { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-2); }
.ai-config label, .api-config label { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; }
.ai-config input, .ai-config select, .ai-config textarea,
.api-config input, .api-config select, .api-config textarea {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 6px 10px; font-size: 12px; width: 100%;
}
.ai-config input:focus, .api-config input:focus,
.ai-config textarea:focus, .api-config textarea:focus { border-color: var(--color-accent); }
.ai-row { display: flex; gap: 6px; }
.ai-row .grow { flex: 1; }
.ai-run {
  height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--color-ink); color: var(--color-white);
  font-size: 12px; font-weight: 500; border: none;
}
.ai-run:hover { background: var(--color-indigo); }
.ai-output, .api-output {
  padding: 12px; font-size: 12.5px; line-height: 1.6;
  color: var(--color-text); white-space: pre-wrap;
  font-family: var(--font-mono); flex: 1; min-height: 0; overflow: auto;
}
.ai-meta { padding: 6px 12px; border-top: 1px solid var(--color-border); font-size: 10.5px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; }

/* tracker */
.tracker { padding: 12px 16px; }
.tracker .subtitle { font-size: 13px; color: var(--color-text-muted); margin: 0 0 8px; }
.tracker-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.tracker-meta .badge { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--color-surface-3); color: var(--color-text-muted); }
.tracker-meta .when { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--color-text-dim); }
.tracker h4 { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-text-dim); margin: 14px 0 8px; font-weight: 500; }
.tracker-entry { padding: 6px 0; border-bottom: 1px solid var(--color-border); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.tracker-entry .label { font-size: 12px; color: var(--color-text); }
.tracker-entry .value { font-size: 12px; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.tracker-entry .bar { grid-column: 1 / -1; height: 4px; background: var(--color-surface-3); border-radius: 2px; overflow: hidden; }
.tracker-entry .bar-fill { height: 100%; background: var(--color-accent); }
.tracker-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--color-border); }
.tracker-brief { margin-top: 16px; }
.tracker-brief summary { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-text-dim); cursor: pointer; }
.tracker-brief p { font-size: 12px; color: var(--color-text-muted); margin: 6px 0; }

/* research widget (locked Russia-research cards + runners) */
.research-card { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.research-subtitle { font-size: 13px; color: var(--color-text-muted); line-height: 1.6; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.research-section { display: flex; flex-direction: column; gap: 6px; }
.research-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-text-dim); font-weight: 500; }
.research-body { font-size: 12.5px; color: var(--color-text); line-height: 1.55; }
.research-indicators { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.research-indicators li { padding: 8px 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font-size: 12px; }
.research-indicators li.redflag { border-color: rgba(220, 38, 38, 0.45); background: rgba(220, 38, 38, 0.06); }
.research-indicators .ind-label { font-weight: 500; color: var(--color-text); }
.research-indicators .ind-hint { color: var(--color-text-muted); font-size: 11.5px; flex: 1; min-width: 0; }
.research-indicators .ind-flag { font-size: 9.5px; letter-spacing: 0.14em; font-weight: 600; color: var(--color-down); padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(220, 38, 38, 0.4); white-space: nowrap; }
.research-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.research-sources a { font-size: 12px; color: var(--color-accent); text-decoration: none; word-break: break-all; }
.research-sources a:hover { text-decoration: underline; }
.research-note { background: var(--color-surface-2); padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--color-border-strong); }
.research-note .research-label { color: var(--color-text-muted); }

.research-runner .runner-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.research-runner .runner-badge { font-size: 9.5px; letter-spacing: 0.14em; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--color-ink); color: var(--color-white); }
.research-runner .runner-refresh { font-size: 11px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; }
.research-runner .research-url { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); background: var(--color-surface-3); padding: 8px 10px; border-radius: 6px; word-break: break-all; }
/* real_economy: live data cards */
.re-live-count { font-size: 10.5px; color: var(--color-text-dim); text-transform: none; letter-spacing: normal; font-weight: 400; margin-left: 6px; }
.re-live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.re-live-status { padding: 16px; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); text-align: center; grid-column: 1 / -1; }
.re-live-err { color: var(--color-down); }
.re-card { padding: 12px 14px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.re-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.re-card-label { font-size: 11px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-card-source { font-size: 10px; color: var(--color-text-dim); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; text-decoration: none; white-space: nowrap; }
.re-card-source[href]:hover { color: var(--color-accent); }
.re-card-value { font-size: 28px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.05; }
.re-card-unit { font-size: 16px; color: var(--color-text-muted); font-weight: 500; margin-left: 2px; }

/* 4-cell stat grid: Actual | MoM % | YoY % | 3M trend */
.re-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 6px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.re-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.re-stat-k { font-size: 9.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; }
.re-stat-v { font-size: 13px; color: var(--color-ink); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-stat-v--big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.re-stat-u { font-size: 12px; color: var(--color-text-muted); font-weight: 500; }
.re-trend-arrow { display: inline-block; margin-right: 2px; font-weight: 600; }
.re-stat-trend.re-trend-up   .re-stat-v { color: #15803d; }
.re-stat-trend.re-trend-down .re-stat-v { color: var(--color-down); }
.re-stat-trend.re-trend-flat .re-stat-v { color: var(--color-text-muted); }
.re-stat-trend.re-trend-none .re-stat-v { color: var(--color-text-muted); }
/* legacy classes (still referenced elsewhere) */
.re-card-deltas { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.re-delta { color: var(--color-text); white-space: nowrap; }
.re-delta-k { color: var(--color-text-dim); font-weight: 600; letter-spacing: 0.08em; font-size: 10px; text-transform: uppercase; margin-right: 4px; }
.re-trend.re-trend-up   { color: #15803d; }
.re-trend.re-trend-down { color: var(--color-down); }
.re-trend.re-trend-flat { color: var(--color-text-muted); }
.re-card-spark { margin-top: 4px; }
.re-spark { width: 100%; height: 28px; display: block; }
.re-chart { width: 100%; height: 96px; display: block; }
.re-chart-grid line { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 2 3; }
.re-chart-y { font-size: 9px; fill: var(--color-text-dim); font-family: var(--font-mono); text-anchor: end; }
.re-chart-x { font-size: 9px; fill: var(--color-text-dim); font-family: var(--font-mono); }
.re-chart-area { fill: var(--color-accent); fill-opacity: 0.12; stroke: none; }
.re-chart-line { fill: none; stroke: var(--color-accent); stroke-width: 1.5; stroke-linejoin: round; }
.re-chart-dot  { fill: var(--color-accent); stroke: var(--color-white); stroke-width: 1.5; }
.re-no-chart { font-size: 10.5px; color: var(--color-text-dim); font-family: var(--font-mono); padding: 8px 0; text-align: center; }
.re-card-date { font-size: 10.5px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.re-card-subtitle { font-size: 11.5px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; padding: 2px 0 4px; border-bottom: 1px dashed var(--color-border); margin-bottom: 4px; }
.re-row-wired { background: rgba(74, 108, 247, 0.04); }
.re-row-wip { background: rgba(245, 158, 11, 0.06); }
.re-row-expandable { cursor: pointer; transition: background 0.12s; }
.re-row-expandable:hover { background: rgba(74, 108, 247, 0.10); }
.re-row-expandable:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.re-row-expanded { background: rgba(74, 108, 247, 0.12); }
.re-chevron { display: inline-block; margin-right: 6px; font-size: 10px; color: var(--color-text-muted); transition: transform 0.15s; transform-origin: center; }
.re-row-expanded .re-chevron { transform: rotate(90deg); color: var(--color-accent); }
.re-help-text { font-size: 11px; color: var(--color-text-muted); padding: 4px 0 8px; font-style: italic; }
.re-help-text .re-live-pill { margin-left: 0; }

/* expander panel (chart, subtitle, source) — appears under a clicked row */
.re-expander { background: var(--color-surface-1); border-bottom: 1px solid var(--color-border); border-left: 3px solid var(--color-accent); padding: 10px 14px 12px; animation: re-exp-in 0.18s ease-out; }
@keyframes re-exp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.re-expander-inner { display: flex; flex-direction: column; gap: 8px; }
.re-exp-subtitle { font-size: 11px; color: var(--color-text); line-height: 1.45; padding: 2px 0 0; }
.re-exp-chart {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 2px 2px;
  overflow: hidden;
}
.re-exp-chart .re-chart-wide {
  display: block;
  width: 100%;
  height: auto;          /* viewBox aspect ratio (720x200) drives the height */
}
.re-exp-chart .re-chart-grid line { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 2 3; }
.re-exp-chart .re-chart-y-wide   { font-size: 8.5px; fill: var(--color-text-muted); font-family: var(--font-mono); text-anchor: end; font-variant-numeric: tabular-nums; }
.re-exp-chart .re-chart-x-wide   { font-size: 8.5px; fill: var(--color-text-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.re-exp-chart .re-chart-area-wide{ fill: var(--color-accent); fill-opacity: 0.14; stroke: none; }
.re-exp-chart .re-chart-line-wide{ fill: none; stroke: var(--color-accent); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.re-exp-chart .re-chart-dot-wide { fill: var(--color-accent); stroke: var(--color-white); stroke-width: 1.5; }
.re-exp-chart .re-no-chart       { padding: 20px 12px; text-align: center; font-size: 11px; color: var(--color-text-muted); font-style: italic; }
.re-exp-chart .re-chart-overlay  { cursor: crosshair; }
.re-exp-chart .re-chart-hover-line { stroke: var(--color-text-muted); stroke-width: 0.8; stroke-dasharray: 2 3; opacity: 0.55; pointer-events: none; }
.re-exp-chart .re-chart-hover-dot  { fill: var(--color-white); stroke: var(--color-accent); stroke-width: 2; pointer-events: none; }
.re-exp-chart .re-chart-hover-bg   { fill: var(--color-ink); opacity: 0.92; pointer-events: none; }
.re-exp-chart .re-chart-hover-text { font-size: 9px; fill: var(--color-white); font-family: var(--font-mono); font-variant-numeric: tabular-nums; pointer-events: none; }
.re-exp-hint { font-size: 9.5px; color: var(--color-text-dim); font-style: italic; font-family: var(--font-mono); padding-top: 0; }
.re-exp-foot { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--color-text-muted); font-family: var(--font-mono); padding-top: 0; }
.re-exp-source { color: var(--color-accent); text-decoration: none; font-weight: 500; }
.re-exp-source:hover { text-decoration: underline; }
.re-exp-asof { font-variant-numeric: tabular-nums; }
.re-exp-empty { font-size: 11px; color: var(--color-text-muted); font-style: italic; padding: 6px 0; }
.re-live-pill { display: inline-block; margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; padding: 2px 6px; border-radius: 999px; background: rgba(34, 197, 94, 0.14); color: #15803d; vertical-align: middle; }
.re-wip-pill  { display: inline-block; margin-left: 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.14em; padding: 2px 6px; border-radius: 999px; background: rgba(245, 158, 11, 0.18); color: #b45309; vertical-align: middle; }
.re-wip-msg   { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: #b45309; text-transform: uppercase; align-self: center; padding: 4px 10px; background: rgba(245, 158, 11, 0.10); border-radius: 6px; }

/* real_economy: 6-column indicator table */
.re-table { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden; }
.re-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1.5fr)   /* data point */
    minmax(0, 1fr)     /* source · freq */
    minmax(0, 0.9fr)   /* actual */
    minmax(0, 0.7fr)   /* MoM % */
    minmax(0, 0.7fr)   /* YoY % */
    minmax(0, 0.95fr); /* 3M */
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  font-size: 12.5px;
}
.re-row:last-child { border-bottom: none; }
.re-row.re-head { background: var(--color-surface-3); color: var(--color-text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; padding: 7px 12px; }
.re-row:not(.re-head):hover { background: var(--color-surface-2); }
.re-label { color: var(--color-text); font-weight: 500; min-width: 0; }
.re-source-freq { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 11px; }
.re-source { color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-freq { font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; align-self: flex-start; }
.re-freq-weekly    { background: rgba(34, 197, 94, 0.12);  color: #15803d; }
.re-freq-monthly   { background: rgba(74, 108, 247, 0.10); color: var(--color-accent); }
.re-freq-quarterly { background: var(--color-surface-3);   color: var(--color-text-dim); }
.re-num { font-variant-numeric: tabular-nums; text-align: right; color: var(--color-text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.re-row.re-head .re-num { color: var(--color-text-dim); text-align: right; }
.re-row-populated .re-cell-actual { color: var(--color-ink); font-weight: 500; }
.re-row .re-trend-arrow { display: inline-block; font-weight: 600; margin-right: 2px; }
.re-row .re-trend-arrow.re-trend-up   { color: #15803d; }
.re-row .re-trend-arrow.re-trend-down { color: var(--color-down); }
.re-row .re-trend-arrow.re-trend-flat { color: var(--color-text-muted); }
.re-row .re-trend-arrow.re-trend-none { color: var(--color-text-dim); }

/* Macro Stability Scoreboard — live tripwires + summary + feedback */
.ms-card { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; flex: 1; min-height: 0; overflow: auto; }
.ms-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ms-title-block { flex: 1; }
.ms-title { font-size: 15px; font-weight: 700; color: var(--color-ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em;
  padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), #6366f1);
  color: var(--color-white);
  text-transform: uppercase;
  cursor: help;
  vertical-align: middle;
}
.ms-ai-tag {
  display: inline-block;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(74, 108, 247, 0.12); color: var(--color-accent);
  margin-left: 8px; text-transform: uppercase;
  vertical-align: middle;
}
.ms-ai-tag-light {
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-white);
}
.ms-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.ms-refresh { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-muted); font-size: 14px; cursor: pointer; }
.ms-refresh:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }

.ms-overall { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-2); }
.ms-overall-score { font-size: 30px; font-weight: 800; padding: 8px 18px; border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; letter-spacing: -0.02em; }
.ms-overall-score.ms-stat-ok      { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.ms-overall-score.ms-stat-warning { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.ms-overall-score.ms-stat-danger  { background: rgba(220, 38, 38, 0.12); color: var(--color-down); }
.ms-overall-score.ms-stat-unknown { background: var(--color-surface-3); color: var(--color-text-muted); }
.ms-overall-meta { flex: 1; min-width: 0; }
.ms-overall-label { font-size: 13px; font-weight: 700; color: var(--color-ink); letter-spacing: 0.06em; }
.ms-overall-headline { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.5; margin-top: 4px; }
.ms-overall-stamp { text-align: right; }
.ms-overall-stamp-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; }
.ms-overall-stamp-time { font-size: 11px; color: var(--color-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 3px; }

.ms-section { display: flex; flex-direction: column; gap: 8px; }
.ms-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; }
.ms-status { padding: 12px; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); }
.ms-status.ms-err { color: var(--color-down); }

.ms-tripwire-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.ms-tripwire { border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 10px; background: var(--color-white); border-left-width: 3px; display: flex; flex-direction: column; gap: 4px; }
.ms-tripwire.ms-stat-ok      { border-left-color: #16a34a; background: rgba(34, 197, 94, 0.04); }
.ms-tripwire.ms-stat-warning { border-left-color: #d97706; background: rgba(245, 158, 11, 0.05); }
.ms-tripwire.ms-stat-danger  { border-left-color: var(--color-down); background: rgba(220, 38, 38, 0.05); }
.ms-tripwire.ms-stat-unknown { border-left-color: var(--color-border-strong); background: var(--color-surface-2); }
.ms-tripwire-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ms-tripwire-num { font-size: 9.5px; font-weight: 700; color: var(--color-text-dim); font-family: var(--font-mono); letter-spacing: 0.08em; }
.ms-tripwire-label { font-size: 12px; font-weight: 600; color: var(--color-ink); flex: 1; }
.ms-tripwire-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; padding: 2px 6px; border-radius: 999px; }
.ms-tripwire.ms-stat-ok      .ms-tripwire-badge { background: #16a34a; color: white; }
.ms-tripwire.ms-stat-warning .ms-tripwire-badge { background: #d97706; color: white; }
.ms-tripwire.ms-stat-danger  .ms-tripwire-badge { background: var(--color-down); color: white; }
.ms-tripwire.ms-stat-unknown .ms-tripwire-badge { background: var(--color-border-strong); color: var(--color-text); }
.ms-tripwire-data { font-size: 10.5px; color: var(--color-text-muted); }
.ms-tripwire-trip em { font-style: italic; color: var(--color-text); }
.ms-tripwire-current { font-family: var(--font-mono); font-weight: 700; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ms-tripwire-rationale { font-size: 10.5px; color: var(--color-text-muted); line-height: 1.5; font-style: italic; }

.ms-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.ms-summary-col { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ms-summary-green  { background: rgba(34, 197, 94, 0.04);  border-left: 3px solid #16a34a; }
.ms-summary-yellow { background: rgba(245, 158, 11, 0.05); border-left: 3px solid #d97706; }
.ms-summary-red    { background: rgba(220, 38, 38, 0.04);  border-left: 3px solid var(--color-down); }
.ms-summary-head { font-size: 11.5px; font-weight: 700; color: var(--color-ink); letter-spacing: 0.04em; }
.ms-summary-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ms-summary-col li { font-size: 11.5px; color: var(--color-text); line-height: 1.5; padding-left: 12px; position: relative; }
.ms-summary-col li::before { content: '•'; position: absolute; left: 0; color: var(--color-text-muted); }

.ms-feedback { list-style: none; padding: 0; margin: 0; counter-reset: ms-fb; display: flex; flex-direction: column; gap: 10px; }
.ms-feedback li { counter-increment: ms-fb; padding: 12px 14px 12px 36px; border-radius: 8px; background: var(--color-surface-2); position: relative; border-left: 3px solid var(--color-accent); }
.ms-feedback li::before { content: counter(ms-fb); position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; border-radius: 999px; background: var(--color-accent); color: var(--color-white); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.ms-feedback-title { font-size: 13px; font-weight: 700; color: var(--color-ink); margin-bottom: 4px; }
.ms-feedback-body { font-size: 11.5px; color: var(--color-text); line-height: 1.55; }

.ms-watch { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ms-watch li { font-size: 12px; color: var(--color-text); line-height: 1.5; padding: 7px 12px; background: var(--color-surface-1); border-radius: 6px; border-left: 3px solid var(--color-accent); }

.ms-bottom-line { padding: 12px 14px; background: var(--color-ink); color: var(--color-white); border-radius: 10px; }
.ms-bottom-line .ms-section-label { color: rgba(255, 255, 255, 0.65); }
.ms-bottom-body { font-size: 12.5px; line-height: 1.6; margin-top: 6px; }

.ms-sources { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 12px; font-size: 11.5px; }
.ms-sources-summary { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; cursor: pointer; user-select: none; }
.ms-sources-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.ms-sources-list a { color: var(--color-accent); text-decoration: none; }
.ms-sources-list a:hover { text-decoration: underline; }

/* Ukraine financial support tracker (static research widget) */
.ua-card { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; flex: 1; min-height: 0; overflow: auto; }
.ua-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ua-title-block { flex: 1; min-width: 260px; }
.ua-title { font-size: 15px; font-weight: 700; color: var(--color-ink); }
.ua-sub { font-size: 11.5px; color: var(--color-text-muted); margin-top: 3px; line-height: 1.5; }
.ua-sub a { color: var(--color-accent); text-decoration: none; }
.ua-sub a:hover { text-decoration: underline; }
.ua-source { font-size: 11px; color: var(--color-accent); text-decoration: none; font-weight: 500; white-space: nowrap; }
.ua-source:hover { text-decoration: underline; }

/* Headline cards */
.ua-headline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ua-stat-card { padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-white); display: flex; flex-direction: column; gap: 4px; border-left-width: 3px; }
.ua-stat-card.ua-stat-total { border-left-color: var(--color-accent); background: rgba(74, 108, 247, 0.05); }
.ua-stat-card.ua-cat-military  { border-left-color: #0891b2; }
.ua-stat-card.ua-cat-financial { border-left-color: var(--color-down); }
.ua-stat-card.ua-cat-drones    { border-left-color: #c026d3; }
.ua-stat-head { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; }
.ua-stat-value { font-size: 20px; font-weight: 800; color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.1; }
.ua-stat-sub { font-size: 10.5px; color: var(--color-text-muted); line-height: 1.5; font-style: italic; }

/* Section labels */
.ua-section { display: flex; flex-direction: column; gap: 8px; }
.ua-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; }

/* Donors */
.ua-donors { display: flex; flex-direction: column; gap: 7px; }
.ua-donor-row { display: grid; grid-template-columns: 150px 1fr 220px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.ua-donor-row:last-child { border-bottom: none; }
.ua-donor-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-ink); font-weight: 600; }
.ua-donor-flag { font-size: 16px; line-height: 1; }
.ua-donor-bar-wrap { position: relative; height: 22px; background: var(--color-surface-2); border-radius: 4px; overflow: hidden; }
.ua-donor-bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--color-accent), #6366f1); border-radius: 4px; transition: width 0.4s ease-out; }
.ua-donor-bar-value { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--color-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; mix-blend-mode: difference; color: white; }
.ua-donor-context { font-size: 11px; color: var(--color-text-muted); font-style: italic; }

/* Trends */
.ua-trends { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ua-trend { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; background: var(--color-surface-1); font-size: 12px; line-height: 1.55; }
.ua-trend.ua-trend-up   { background: rgba(34, 197, 94, 0.06);  border-left: 3px solid #16a34a; }
.ua-trend.ua-trend-down { background: rgba(220, 38, 38, 0.06);  border-left: 3px solid var(--color-down); }
.ua-trend.ua-trend-flat { background: var(--color-surface-2);   border-left: 3px solid var(--color-text-muted); }
.ua-trend-pip { font-weight: 700; font-size: 14px; line-height: 1.3; min-width: 14px; }
.ua-trend.ua-trend-up .ua-trend-pip   { color: #16a34a; }
.ua-trend.ua-trend-down .ua-trend-pip { color: var(--color-down); }
.ua-trend.ua-trend-flat .ua-trend-pip { color: var(--color-text-muted); }
.ua-trend strong { font-weight: 700; }

/* Links */
.ua-links-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ua-links-list a { color: var(--color-accent); text-decoration: none; }
.ua-links-list a:hover { text-decoration: underline; }

/* macro stability — KIMI-powered scoreboard */
.mk-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; flex: 1; min-height: 0; }
.mk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mk-title-block { flex: 1; }
.mk-title { font-size: 15px; font-weight: 700; color: var(--color-ink); display: flex; align-items: center; gap: 8px; }
.mk-badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; padding: 2px 7px; border-radius: 999px; background: #fee2e2; color: #b91c1c; }
.mk-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; font-family: var(--font-mono); }
.mk-refresh { border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text); font-size: 11.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-family: var(--font-sans); }
.mk-refresh:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }

.mk-config { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mk-cfg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-cfg-label { font-size: 11px; color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; min-width: 110px; }
.mk-cfg-input { flex: 1; min-width: 200px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 12px; font-family: var(--font-mono); background: var(--color-white); }
.mk-cfg-input:focus { outline: none; border-color: var(--color-accent); }
.mk-cfg-hint { font-size: 10px; color: var(--color-text-dim); font-style: italic; }
.mk-cfg-save { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--color-ink); background: var(--color-ink); color: var(--color-white); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.mk-cfg-save:hover { background: var(--color-accent); border-color: var(--color-accent); }

.mk-status { font-size: 11.5px; padding: 8px 12px; border-radius: 6px; background: var(--color-surface-2); color: var(--color-text); font-family: var(--font-mono); border-left: 3px solid var(--color-accent); }
.mk-status-err { background: rgba(220, 38, 38, 0.08); color: var(--color-down); border-left-color: var(--color-down); }

.mk-overall { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; }
.mk-overall-score { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; padding: 8px 18px; border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }
.mk-overall-score.mk-stat-ok      { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.mk-overall-score.mk-stat-warning { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.mk-overall-score.mk-stat-danger  { background: rgba(220, 38, 38, 0.12); color: var(--color-down); }
.mk-overall-score.mk-stat-unknown { background: var(--color-surface-3); color: var(--color-text-muted); }
.mk-overall-meta { flex: 1; }
.mk-overall-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; }
.mk-overall-verdict { font-size: 14px; color: var(--color-ink); margin-top: 2px; line-height: 1.4; }
.mk-overall-stamp { text-align: right; }
.mk-overall-stamp-label { font-size: 9.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.12em; }
.mk-overall-stamp-time { font-size: 12px; color: var(--color-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 2px; }

.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mk-stat-card { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-white); display: flex; flex-direction: column; gap: 4px; border-left-width: 3px; }
.mk-stat-card.mk-stat-ok      { border-left-color: #16a34a; background: rgba(34, 197, 94, 0.04); }
.mk-stat-card.mk-stat-warning { border-left-color: #d97706; background: rgba(245, 158, 11, 0.06); }
.mk-stat-card.mk-stat-danger  { border-left-color: var(--color-down); background: rgba(220, 38, 38, 0.05); }
.mk-stat-card.mk-stat-unknown { border-left-color: var(--color-border-strong); background: var(--color-surface-2); }
.mk-stat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.mk-stat-label { font-size: 11px; font-weight: 600; color: var(--color-text); }
.mk-stat-pill { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; padding: 2px 6px; border-radius: 999px; }
.mk-stat-ok      .mk-stat-pill { background: #16a34a; color: white; }
.mk-stat-warning .mk-stat-pill { background: #d97706; color: white; }
.mk-stat-danger  .mk-stat-pill { background: var(--color-down); color: white; }
.mk-stat-unknown .mk-stat-pill { background: var(--color-border-strong); color: var(--color-text); }
.mk-stat-value { font-size: 18px; font-weight: 700; color: var(--color-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mk-stat-rationale { font-size: 10.5px; color: var(--color-text-muted); line-height: 1.45; font-style: italic; }

.mk-narrative { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; background: rgba(74, 108, 247, 0.04); border-left: 3px solid var(--color-accent); }
.mk-narrative-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--color-text-dim); text-transform: uppercase; margin-bottom: 6px; }
.mk-narrative-body { font-size: 12.5px; color: var(--color-ink); line-height: 1.55; white-space: pre-wrap; }

.mk-source-block { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 12px; }
.mk-source-summary { font-size: 11px; color: var(--color-text-muted); font-weight: 600; cursor: pointer; user-select: none; letter-spacing: 0.06em; text-transform: uppercase; }
.mk-source-body { font-size: 10.5px; color: var(--color-text); font-family: var(--font-mono); background: var(--color-white); border: 1px solid var(--color-border); border-radius: 6px; padding: 10px 12px; margin-top: 8px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* sanctions widget */
.sc-card { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-head-meta { font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sc-refresh { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sc-refresh:hover { background: var(--color-surface-2); color: var(--color-ink); }
.sc-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.sc-status { padding: 24px 12px; text-align: center; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); }
.sc-err { color: var(--color-down); }
.sc-title { font-size: 13px; font-weight: 600; color: var(--color-ink); text-decoration: none; line-height: 1.35; display: block; margin-bottom: 4px; }
.sc-title:hover { color: var(--color-accent); text-decoration: underline; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.sc-tag { font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 999px; background: var(--color-surface-2); color: var(--color-text-muted); text-transform: uppercase; }
.sc-tag-type    { background: rgba(34,197,94,0.10); color: #15803d; }
.sc-tag-sector  { background: var(--color-surface-3); color: var(--color-text); }
.sc-excerpt { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.5; margin-top: 4px; }
.sc-read-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 4px 10px; margin-top: 8px; background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 999px; text-decoration: none; }
.sc-read-btn:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }

/* timeline legend */
.sc-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 4px 12px; border-bottom: 1px solid var(--color-border); font-size: 11px; color: var(--color-text-muted); }
.sc-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.sc-legend-item strong { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.sc-legend-dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.sc-legend-west .sc-legend-dot { background: var(--color-accent); }
.sc-legend-east .sc-legend-dot { background: var(--color-down); }

/* timeline body — central axis with cards branching left/right */
.sc-timeline { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 10px 0; }
.sc-timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: var(--color-border); transform: translateX(-50%); border-radius: 2px;
}
.sc-row { display: grid; grid-template-columns: 1fr 110px 1fr; gap: 12px; align-items: start; position: relative; }
.sc-empty { /* placeholder so grid columns are even */ }

/* axis cell (always in the middle column) */
.sc-axis { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 4px; z-index: 1; }
.sc-axis-dot {
  width: 14px; height: 14px; border-radius: 999px;
  border: 3px solid var(--color-white);
  box-shadow: 0 0 0 1px var(--color-border);
  margin-bottom: 6px;
}
.sc-axis-dot-west { background: var(--color-accent); }
.sc-axis-dot-east { background: var(--color-down); }
.sc-axis-date { font-size: 10.5px; font-weight: 600; color: var(--color-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; background: var(--color-white); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--color-border); white-space: nowrap; }
.sc-axis-ago { font-size: 9.5px; color: var(--color-text-dim); font-family: var(--font-mono); margin-top: 3px; }

/* event card — west = left side, east = right side */
.sc-event-card { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-white); position: relative; }
.sc-event-card-west { grid-column: 1; border-left: 3px solid var(--color-accent); }
.sc-event-card-east { grid-column: 3; border-right: 3px solid var(--color-down); }
.sc-event-card-west::after, .sc-event-card-east::after {
  /* connector line from card to central axis */
  content: ''; position: absolute; top: 18px; width: 12px; height: 2px;
  background: var(--color-border);
}
.sc-event-card-west::after { right: -12px; }
.sc-event-card-east::after { left:  -12px; }
.sc-row-west .sc-event-card-west .sc-title { color: var(--color-ink); }
.sc-row-east .sc-event-card-east .sc-title { color: var(--color-ink); }

/* tighter on narrow widget instances */
@container (max-width: 480px) {
  .sc-row { grid-template-columns: 1fr 70px 1fr; gap: 6px; }
  .sc-event-card { padding: 8px 10px; }
}

/* load more button */
.sc-load-more {
  display: block; width: 100%; margin: 16px 0 4px; padding: 10px 16px;
  background: var(--color-surface-2); color: var(--color-ink);
  border: 1px solid var(--color-border); border-radius: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  font-family: var(--font-mono); cursor: pointer; transition: all 0.15s;
}
.sc-load-more:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.sc-end-of-list { text-align: center; padding: 16px; font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); font-style: italic; border-top: 1px dashed var(--color-border); margin-top: 8px; }

/* jobs widget */
.jb-card { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.jb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jb-head-meta { font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.jb-refresh { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.jb-refresh:hover { background: var(--color-surface-2); color: var(--color-ink); }
.jb-filters { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.jb-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 11px; color: var(--color-text-muted); cursor: pointer; }
.jb-pill:hover { background: var(--color-white); color: var(--color-ink); border-color: var(--color-border-strong); }
.jb-pill.active { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.jb-pill-count { font-size: 10px; opacity: 0.65; font-variant-numeric: tabular-nums; }
.jb-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.jb-status { padding: 24px 12px; text-align: center; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); }
.jb-err { color: var(--color-down); }
.jb-item { padding: 10px 0 12px; border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 4px; }
.jb-item:last-child { border-bottom: none; }
.jb-item-head { display: flex; gap: 8px; align-items: baseline; }
.jb-src { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.jb-src-djinni    { background: rgba(34, 197, 94, 0.12);  color: #15803d; }
.jb-src-remoteok  { background: rgba(74, 108, 247, 0.12); color: var(--color-accent); }
.jb-src-wwr       { background: var(--color-surface-3);   color: var(--color-text-muted); }
.jb-when { font-size: 10.5px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.jb-title { font-size: 13.5px; font-weight: 500; color: var(--color-ink); text-decoration: none; line-height: 1.4; }
.jb-title:hover { color: var(--color-accent); text-decoration: underline; }
.jb-subline { font-size: 12px; color: var(--color-text-muted); }
.jb-salary { font-size: 11.5px; color: #15803d; font-weight: 500; font-variant-numeric: tabular-nums; }
.jb-summary { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.5; }
.jb-item-foot { margin-top: 4px; }
.jb-apply-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 5px 12px; background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 999px; text-decoration: none; }
.jb-apply-btn:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }

/* ukraine_news */
.un-card { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.un-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.un-head-meta { font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.un-refresh { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.un-refresh:hover { background: var(--color-surface-2); color: var(--color-ink); border-color: var(--color-border-strong); }
.un-filters { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.un-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 11px; color: var(--color-text-muted); cursor: pointer; }
.un-pill:hover { background: var(--color-white); color: var(--color-ink); border-color: var(--color-border-strong); }
.un-pill.active { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.un-pill-count { font-size: 10px; opacity: 0.65; font-variant-numeric: tabular-nums; }
.un-pill.active .un-pill-count { opacity: 0.75; }
.un-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.un-status { padding: 24px 12px; text-align: center; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); }
.un-err { color: var(--color-down); }
.un-item { padding: 10px 0 12px; border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 4px; }
.un-item:last-child { border-bottom: none; }
.un-item-head { display: flex; gap: 8px; align-items: baseline; }
.un-src { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.un-src-pravda, .un-src-ukrinform, .un-src-nv     { background: rgba(34, 197, 94, 0.12);  color: #15803d; }
.un-src-meduza, .un-src-mt                         { background: rgba(74, 108, 247, 0.12); color: var(--color-accent); }
.un-src-tass, .un-src-kommersant, .un-src-vedomosti { background: rgba(220, 38, 38, 0.10); color: var(--color-down); }
.un-src-bbc                                        { background: var(--color-surface-3);   color: var(--color-text-muted); }
.un-when { font-size: 10.5px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.un-title { font-size: 13.5px; font-weight: 500; color: var(--color-ink); text-decoration: none; line-height: 1.4; }
.un-title:hover { color: var(--color-accent); text-decoration: underline; }
.un-summary { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; }
.un-item-foot { margin-top: 4px; }
.un-read-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; padding: 5px 12px;
  background: var(--color-surface-2); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: 999px;
  text-decoration: none; cursor: pointer;
}
.un-read-btn:hover { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }

/* house_view_edit */
.hve-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; overflow: auto; }
.hve-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.hve-eyebrow { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; }
.hve-date { font-size: 14px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.hve-saved { font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hve-section { display: flex; flex-direction: column; gap: 4px; }
.hve-label { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.hve-hint { color: var(--color-text-dim); text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 11px; opacity: 0.7; }
.hve-area {
  width: 100%; resize: vertical; min-height: 60px;
  font-family: var(--font-sans, inherit); font-size: 13px; line-height: 1.5;
  color: var(--color-text); background: var(--color-white);
  border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 12px;
}
.hve-area:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12); }
.hve-area::placeholder { color: var(--color-text-dim); }
.hve-area-thesis { font-family: var(--font-mono); font-size: 12.5px; }

/* house_view_edit — publish action + timeline */
.hve-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 2px; }
.hve-publish-btn {
  font: 600 12px var(--font-sans); color: #fff; background: var(--color-accent);
  border: none; border-radius: 7px; padding: 7px 14px; cursor: pointer;
  transition: filter 0.15s ease;
}
.hve-publish-btn:hover { filter: brightness(1.08); }
.hve-publish-hint { font-size: 11px; color: var(--color-text-dim); }
.hve-timeline-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--color-border); }
.hve-timeline { display: flex; flex-direction: column; gap: 8px; }
.hve-tl-empty { font-size: 12px; color: var(--color-text-dim); padding: 6px 2px; }
.hve-tl-item { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; background: var(--color-surface, transparent); }
.hve-tl-head {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; padding: 9px 12px; color: var(--color-ink);
}
.hve-tl-head:hover { background: rgba(127, 127, 127, 0.06); }
.hve-tl-caret { font-size: 10px; color: var(--color-text-dim); transition: transform 0.15s ease; flex: 0 0 auto; }
.hve-tl-item.is-open .hve-tl-caret { transform: rotate(90deg); }
.hve-tl-date { font: 600 12.5px var(--font-mono); color: var(--color-ink); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.hve-tl-peek { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.hve-tl-body { display: none; flex-direction: column; gap: 12px; padding: 4px 14px 14px; }
.hve-tl-item.is-open .hve-tl-body { display: flex; }
.hve-tl-remove {
  align-self: flex-start; font: 500 11px var(--font-sans); color: var(--color-text-dim);
  background: none; border: 1px solid var(--color-border); border-radius: 6px; padding: 4px 9px; cursor: pointer;
}
.hve-tl-remove:hover { color: var(--color-danger, #c0392b); border-color: var(--color-danger, #c0392b); }

/* monthly_budget (v2 — match the screenshot layout) */
.mb-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0; overflow: auto; }
.mb-status { font-size: 11.5px; color: var(--color-text-dim); font-family: var(--font-mono); padding: 6px 0; }
.mb-status-err { color: var(--color-down); }

.mb-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--color-border); padding-bottom: 10px; }
.mb-title-block { display: flex; flex-direction: column; gap: 2px; }
.mb-title { font-size: 17px; font-weight: 600; color: var(--color-ink); letter-spacing: -0.01em; }
.mb-sub { font-size: 12px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.mb-source { font-size: 11px; color: var(--color-text-muted); text-decoration: none; white-space: nowrap; font-family: var(--font-mono); }
.mb-source:hover { color: var(--color-accent); text-decoration: underline; }

.mb-toprow { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.mb-card-group { display: flex; flex-direction: column; gap: 8px; flex: 3; min-width: 280px; }
.mb-card-group-og { flex: 1; min-width: 180px; padding-left: 16px; border-left: 1px dashed var(--color-border-strong); }
.mb-card-group-label { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.mb-cards-flex { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.mb-stat-card2 { padding: 12px 14px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mb-stat-card2-head { font-size: 9.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; }
.mb-stat-card2-value { font-size: 22px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; word-break: break-word; }
.mb-stat-card2-value.mb-neg { color: var(--color-down); }
.mb-stat-card2-value.mb-pos { color: #15803d; }
.mb-stat-card2-sub { font-size: 11px; color: var(--color-text-muted); }

.mb-pos { color: #15803d; }
.mb-neg { color: var(--color-down); }

.mb-chart-block { display: flex; flex-direction: column; gap: 6px; }
.mb-chart-label { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.mb-chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--color-text-muted); }
.mb-legend-pip { display: inline-flex; gap: 6px; align-items: center; }
.mb-legend-line { display: inline-block; width: 22px; height: 2px; }
.mb-legend-line.mb-legend-rev { background: var(--color-accent); }
.mb-legend-line.mb-legend-exp { background: var(--color-down); border-top: 2px dashed var(--color-down); height: 0; }
.mb-chart-wrap { padding: 4px 0 0; }
.mb-chart2 { width: 100%; height: auto; max-height: 320px; display: block; }
.mb-chart2 .mb-chart-grid line { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 3 3; }
.mb-chart2 .mb-chart-y { font-size: 10.5px; fill: var(--color-text-dim); font-family: var(--font-mono); }
.mb-chart2 .mb-chart-x { font-size: 10.5px; fill: var(--color-text-dim); font-family: var(--font-mono); }
.mb-chart2 .mb-line-rev { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; }
.mb-chart2 .mb-line-exp { fill: none; stroke: var(--color-down); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }

.mb-yearly-block { display: flex; flex-direction: column; gap: 6px; }
.mb-yearly-label { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.mb-yearly-wrap { overflow-x: auto; }
.mb-tbl { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12.5px; }
.mb-tbl th, .mb-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--color-border); text-align: left; }
.mb-tbl th { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; background: var(--color-surface-2); }
.mb-tbl td.mb-num, .mb-tbl th.mb-num { text-align: right; font-variant-numeric: tabular-nums; }
.mb-tbl tr:hover td { background: var(--color-surface-2); }
.mb-tbl-partial td:first-child { color: var(--color-text-muted); font-style: italic; }
.mb-tbl-partial-tag {
  font-size: 9.5px;
  color: var(--color-white);
  background: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  vertical-align: middle;
}
.mb-tbl-ytd-range {
  font-size: 10.5px;
  font-style: italic;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 3px;
  letter-spacing: 0;
  text-transform: none;
}
.mb-yearly-explainer {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--color-text);
  background: rgba(74, 108, 247, 0.06);
  border-left: 3px solid var(--color-accent);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.mb-yearly-explainer strong { font-weight: 700; }
.mb-yearly-explainer em { font-style: italic; color: var(--color-accent); }
.mb-yearly-explainer .mb-tbl-partial-tag { margin-left: 0; }

.mb-verify-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 12px; border-radius: 6px; margin-bottom: 8px;
  font-size: 11px; line-height: 1.55; font-family: var(--font-mono);
}
.mb-verify-ok { background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.25); color: #15803d; }
.mb-verify-warn { background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.30); color: #b45309; }
.mb-verify-icon { font-weight: 700; font-size: 14px; line-height: 1; flex-shrink: 0; }
.mb-verify-text { flex: 1; }

/* tab strip — Total budget vs Oil & Gas */
.mb-tabs {
  display: flex; gap: 4px; padding: 6px; border-radius: 10px;
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  align-self: flex-start; margin-bottom: 4px;
}
.mb-tab {
  border: 0; background: transparent; color: var(--color-text-muted);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 7px 16px; border-radius: 6px; cursor: pointer; font-family: var(--font-sans);
  transition: all 0.12s;
}
.mb-tab:hover { color: var(--color-ink); }
.mb-tab.mb-tab-active { background: var(--color-white); color: var(--color-ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.mb-tab-panel { display: flex; flex-direction: column; gap: 16px; }
.mb-tab-panel[hidden] { display: none; }

/* Oil & Gas tab specific styling */
.mb-og-toprow { display: flex; flex-direction: column; gap: 8px; }
.mb-line-actual   { fill: none; stroke: #c026d3; stroke-width: 2; stroke-linejoin: round; }
.mb-line-baseline { fill: none; stroke: var(--color-text-muted); stroke-width: 1.5; stroke-dasharray: 6 4; stroke-linejoin: round; }
.mb-legend-og-actual   { background: #c026d3; }
.mb-legend-og-baseline { background: var(--color-text-muted); height: 0; border-top: 2px dashed var(--color-text-muted); }

/* month-by-month block (last 12/24/36 months) */
.mb-monthly-block { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mb-monthly-head  { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mb-monthly-label { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.mb-monthly-sub   { font-size: 10px; color: var(--color-text-dim); text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; margin-left: 6px; }
.mb-monthly-controls { display: flex; gap: 4px; }
.mb-monthly-toggle {
  border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-muted);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 999px; cursor: pointer; font-family: var(--font-mono);
  transition: all 0.12s;
}
.mb-monthly-toggle:hover { background: var(--color-surface-2); color: var(--color-ink); }
.mb-monthly-toggle.mb-active { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.mb-monthly-wrap { overflow-x: auto; }
.mb-monthly-tbl { min-width: 640px; font-size: 12px; }
.mb-monthly-tbl th, .mb-monthly-tbl td { padding: 6px 8px; }
.mb-monthly-tbl .mb-tbl-month { font-weight: 600; font-family: var(--font-mono); }
.mb-monthly-tbl .mb-neg { color: var(--color-down); }
.mb-monthly-tbl .mb-pos { color: var(--color-up); }

.mb-sources { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 14px; font-size: 12px; }
.mb-sources[open] { padding-bottom: 14px; }
.mb-sources-summary { cursor: pointer; font-size: 11px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; outline: none; user-select: none; padding: 2px 0; }
.mb-sources-summary:hover { color: var(--color-ink); }
.mb-sources-body { margin-top: 10px; display: flex; flex-direction: column; gap: 14px; }
.mb-sources-section { display: flex; flex-direction: column; gap: 6px; }
.mb-sources-section-label { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.mb-sources-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.mb-sources-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mb-sources-name { color: var(--color-text); }
.mb-sources-link { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-accent); text-decoration: none; word-break: break-all; }
.mb-sources-link:hover { text-decoration: underline; }
.mb-sources-rowmap { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mb-sources-rowmap th, .mb-sources-rowmap td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--color-border); }
.mb-sources-rowmap th { font-size: 9.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.12em; }
.mb-sources-rowmap td:first-child, .mb-sources-rowmap th:first-child { font-family: var(--font-mono); width: 100px; color: var(--color-text-muted); white-space: nowrap; }
.mb-sources-rowmap-secondary td { color: var(--color-text-muted); }
.mb-sources-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--color-text); line-height: 1.55; }
.mb-sources-notes code { font-family: var(--font-mono); font-size: 10.5px; background: var(--color-surface-3); padding: 1px 5px; border-radius: 3px; }
.mb-sources-stamp { font-size: 11px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; padding-top: 6px; border-top: 1px solid var(--color-border); }

/* war_effort */
.we-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; overflow: auto; }
.we-status { font-size: 12px; color: var(--color-text-muted); padding: 24px 12px; text-align: center; font-family: var(--font-mono); }
.we-err { color: var(--color-down); }
.we-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); }
.we-date { font-size: 13px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; font-family: var(--font-mono); display: inline-flex; gap: 8px; align-items: baseline; }
.we-stale { font-size: 9.5px; letter-spacing: 0.14em; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: rgba(220, 38, 38, 0.12); color: var(--color-down); text-transform: uppercase; font-family: var(--font-sans, inherit); cursor: help; }
.we-source { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.12em; }
.we-personnel { padding: 12px 14px; background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.25); border-radius: 10px; display: flex; align-items: center; gap: 14px; }
.we-personnel-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--color-down); background: rgba(220, 38, 38, 0.1); border-radius: 10px; }
.we-personnel-icon svg { width: 28px; height: 28px; }
.we-personnel-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.we-personnel-label { font-size: 10.5px; color: var(--color-down); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.we-personnel-num { font-size: 28px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.we-personnel-delta { font-size: 12px; color: var(--color-down); font-variant-numeric: tabular-nums; font-weight: 500; }
.we-equip { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.we-row { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--color-border); font-size: 12.5px; align-items: center; }
.we-row:last-child { border-bottom: none; }
.we-row-icon { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.we-row-icon svg { width: 22px; height: 22px; display: block; }
.we-row:hover .we-row-icon { color: var(--color-ink); }
.we-row-label { color: var(--color-text); }
.we-row-value { font-variant-numeric: tabular-nums; color: var(--color-ink); font-weight: 500; }
.we-row-delta { font-variant-numeric: tabular-nums; color: var(--color-down); font-size: 11px; font-weight: 500; min-width: 56px; text-align: right; }

/* tabs widget */
.tabs-widget { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tabs-strip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-2); }
.tabs-strip-scroll { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.tabs-strip-scroll::-webkit-scrollbar { height: 6px; }
.tabs-strip-scroll::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }
.tabs-tab { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: transparent; border: 1px solid transparent; font-size: 12px; color: var(--color-text-muted); white-space: nowrap; cursor: pointer; user-select: none; }
.tabs-tab:hover { background: var(--color-white); color: var(--color-ink); border-color: var(--color-border); }
.tabs-tab.active { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.tabs-tab.active .tabs-tab-x { color: rgba(255,255,255,0.7); }
.tabs-tab-label { cursor: pointer; padding-right: 2px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tabs-tab-x { background: transparent; border: none; color: var(--color-text-dim); font-size: 16px; line-height: 1; padding: 0 6px; cursor: pointer; border-radius: 999px; }
.tabs-tab-x:hover { color: var(--color-down); background: rgba(220, 38, 38, 0.08); }
.tabs-add { flex-shrink: 0; height: 28px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px dashed var(--color-border-strong); color: var(--color-text-muted); font-size: 12px; cursor: pointer; }
.tabs-add:hover { background: var(--color-white); color: var(--color-ink); border-style: solid; border-color: var(--color-ink); }
.tabs-picker { padding: 12px 14px; background: var(--color-surface-2); border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 8px; }
.tabs-picker label { font-size: 10.5px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 500; }
.tabs-picker label .hint { text-transform: none; letter-spacing: normal; color: var(--color-text-dim); font-weight: 400; opacity: 0.8; }
.tabs-picker textarea { font-family: var(--font-mono); font-size: 11.5px; padding: 8px 10px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 6px; min-height: 70px; resize: vertical; }
.tabs-picker .tabs-picker-or { font-size: 11px; color: var(--color-text-dim); text-align: center; padding: 2px 0; }
.tabs-picker-actions { display: flex; gap: 8px; align-items: center; }
.tabs-picker select { flex: 1; padding: 6px 10px; font-size: 12px; background: var(--color-white); border: 1px solid var(--color-border); border-radius: 6px; }
.tabs-picker-add { padding: 8px 16px; border-radius: 999px; background: var(--color-ink); color: var(--color-white); font-size: 12px; font-weight: 500; border: none; cursor: pointer; }
.tabs-picker-add:hover { background: var(--color-indigo); }
.tabs-picker-err { font-size: 11.5px; color: var(--color-down); padding: 4px 0; }
.tabs-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.tabs-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs-empty { padding: 36px 16px; text-align: center; color: var(--color-text-muted); }
.tabs-empty-title { font-size: 14px; color: var(--color-text); font-weight: 500; margin-bottom: 4px; }
.tabs-empty-hint { font-size: 12.5px; }
.widget-embedded { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.widget-embedded > .widget-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }

.bm-link { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); text-decoration: none; word-break: break-all; padding: 8px 10px; background: var(--color-surface-3); border-radius: 6px; display: block; }
.bm-link[href]:hover { color: var(--color-accent); text-decoration: underline; }

.bm-chart-wrap { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; overflow: auto; }
.bm-chart-status { font-size: 12px; color: var(--color-text-muted); padding: 32px 16px; text-align: center; font-family: var(--font-mono); }
.bm-chart-err { color: var(--color-down); }
.bm-chart { width: 100%; height: auto; display: block; max-height: 480px; }
.bm-chart .bm-grid line { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 4 4; }
.bm-chart .bm-y-label, .bm-chart .bm-x-label { font-size: 13px; fill: var(--color-text-dim); font-family: var(--font-mono); }
.bm-chart .bm-y-label { text-anchor: end; }
.bm-chart .bm-area { fill: var(--color-accent); fill-opacity: 0.14; stroke: none; }
.bm-chart .bm-line { fill: none; stroke: var(--color-accent); stroke-width: 2.5; stroke-linejoin: round; }
.bm-chart .bm-last-dot { fill: var(--color-accent); stroke: var(--color-white); stroke-width: 2.5; }
.bm-chart .bm-current { fill: var(--color-ink); font-size: 18px; font-weight: 600; font-family: var(--font-mono); }
.bm-chart-meta { padding-top: 6px; border-top: 1px solid var(--color-border); }
.bm-chart-title { font-size: 13px; color: var(--color-text); font-weight: 500; line-height: 1.4; }
.bm-chart-sub { font-size: 11px; color: var(--color-text-muted); font-variant-numeric: tabular-nums; margin-top: 3px; }
.research-prompt { padding: 0 12px; border-bottom: 1px solid var(--color-border); }
.research-prompt summary { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-text-dim); cursor: pointer; padding: 8px 0; }
.research-prompt summary:hover { color: var(--color-ink); }
.research-prompt-block { padding: 6px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.research-prompt-block pre { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); background: var(--color-surface-3); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; margin: 0; max-height: 180px; overflow: auto; }

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(11, 25, 48, 0.30); backdrop-filter: blur(4px);
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 31;
  width: 100%; max-width: 480px; background: var(--color-white);
  border-left: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer-head { padding: 24px 24px 16px; border-bottom: 1px solid var(--color-border); display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-head .title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--color-ink); margin-top: 8px; }
.drawer-head .subtitle { font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }
.drawer-close {
  width: 36px; height: 36px; border-radius: 999px; background: transparent; border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
}
.drawer-close:hover { background: var(--color-surface-2); color: var(--color-ink); }
.drawer-search { padding: 16px 24px; border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 12px; }
.drawer-search input {
  width: 100%; background: var(--color-surface-2); border: 1px solid transparent;
  border-radius: 999px; padding: 10px 16px; font-size: 13.5px;
}
.drawer-search input:focus { border-color: var(--color-border-strong); background: var(--color-white); }
.drawer-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-tabs button {
  height: 32px; padding: 0 12px; border-radius: 999px;
  font-size: 11.5px; color: var(--color-text-muted); background: transparent;
  border: 1px solid var(--color-border-strong);
}
.drawer-tabs button:hover { color: var(--color-ink); }
.drawer-tabs button.active { background: var(--color-ink); color: var(--color-white); border-color: var(--color-ink); }
.drawer-tabs button .count { margin-left: 6px; opacity: 0.6; }
.drawer-list { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.catalog-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px;
  border-radius: 14px; border: 1px solid transparent;
  background: transparent; color: inherit; text-align: left; cursor: pointer;
}
.catalog-item:hover { background: var(--color-surface-2); border-color: var(--color-border); }
.catalog-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--color-border-strong); background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.catalog-body { flex: 1; min-width: 0; }
.catalog-body .name-row { display: flex; align-items: center; gap: 8px; }
.catalog-body .name { font-size: 13.5px; font-weight: 500; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; }
.catalog-body .blurb { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.55; }
.catalog-plus { color: var(--color-text-dim); font-size: 18px; line-height: 1; margin-top: 4px; }
.catalog-item:hover .catalog-plus { color: var(--color-accent); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--color-ink); color: var(--color-white);
  padding: 10px 18px; border-radius: 999px;
  font-size: 12px; z-index: 100; box-shadow: var(--shadow);
}

/* ============================ Refinery tracker widget ============================ */
.rt-card { display: flex; flex-direction: column; height: 100%; padding: 12px 14px 10px; gap: 10px; }
.rt-empty { font-size: 12.5px; color: var(--color-text-muted); padding: 14px 0; line-height: 1.55; }
.rt-empty code { background: var(--color-surface-2); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.rt-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--color-border); font-size: 12px; }
.rt-summary-counts { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rt-summary-counts strong { font-variant-numeric: tabular-nums; color: var(--color-text); }
.rt-dim { color: var(--color-text-muted); }
.rt-stamp { font-size: 11px; color: var(--color-text-dim); font-variant-numeric: tabular-nums; }
.rt-sep { color: var(--color-text-dim); margin: 0 2px; }

.rt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-height: 0; overflow-y: auto; }
.rt-row { padding: 8px 10px; background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: 8px; display: flex; flex-direction: column; gap: 3px; }
.rt-row-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rt-date { color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-facility { font-weight: 600; color: var(--color-text); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-title { font-size: 12.5px; color: var(--color-text); text-decoration: none; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rt-title:hover { color: var(--color-accent); text-decoration: underline; }
.rt-meta { font-size: 11px; color: var(--color-text-muted); display: flex; flex-wrap: wrap; gap: 2px 4px; }

.rt-badge { font-size: 9.5px; letter-spacing: 0.12em; font-weight: 600; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.rt-badge-high   { background: rgba(220, 38, 38, 0.12); color: #b91c1c; border-color: rgba(220,38,38,0.35); }
.rt-badge-medium { background: rgba(217, 119, 6, 0.12); color: #b45309; border-color: rgba(217,119,6,0.35); }
.rt-badge-low    { background: var(--color-surface-3); color: var(--color-text-muted); border-color: var(--color-border); }

.rt-footer { padding-top: 8px; border-top: 1px solid var(--color-border); font-size: 11.5px;
  color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rt-footer a { color: var(--color-accent); text-decoration: none; }
.rt-footer a:hover { text-decoration: underline; }

.rt-map {
  width: 100%; height: 280px; min-height: 240px;
  border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface-2); display: block;
}
.rt-list { max-height: 220px; }

.rt-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px 0 4px; border-bottom: 1px solid var(--color-border);
}
.rt-tab {
  border: 1px solid transparent; background: transparent;
  padding: 5px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--color-text-muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.rt-tab:hover { background: var(--color-surface-2); color: var(--color-text); }
.rt-tab.is-active {
  background: var(--color-surface-2); color: var(--color-text);
  border-color: var(--color-border);
}
.rt-tab-count {
  font-size: 10px; font-variant-numeric: tabular-nums;
  padding: 1px 5px; border-radius: 999px;
  background: var(--color-surface-3); color: var(--color-text-muted);
}
.rt-tab.is-active .rt-tab-count {
  background: var(--color-ink); color: var(--color-white);
}
.rt-pane { display: none; }
.rt-pane.is-active { display: flex; }

/* ============================================================
   Responsive — phones & small tablets
   On desktop the sidebar is a fixed 230px rail. Below 900px it
   becomes an off-canvas drawer toggled by a hamburger in the
   topbar, and the content area goes full width.
   ============================================================ */
.menu-toggle { display: none; }
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(8, 16, 36, 0.5);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  border: 0; padding: 0; margin: 0;
}

@media (max-width: 900px) {
  /* Hamburger toggle, shown only on small screens */
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0; padding: 0; cursor: pointer;
    border-radius: 10px; border: 1px solid var(--color-border-light-strong);
    background: transparent; color: var(--color-text-inverse);
    transition: border-color .15s ease, background-color .15s ease;
  }
  .menu-toggle:hover { border-color: var(--color-white); background: var(--color-sidebar-hover); }

  .topbar { height: 60px; padding: 0 14px; gap: 12px; }
  .topbar-right { gap: 8px; }

  /* Sidebar → off-canvas drawer */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    width: 274px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.45);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-backdrop { opacity: 1; visibility: visible; }

  .main { width: 100%; min-width: 0; }

  /* Tighter page chrome on small screens */
  .page-head {
    flex-direction: column; align-items: flex-start; gap: 12px;
    padding: 16px 18px;
  }
  .page-head h1 { font-size: 21px; }
  .page-head .subtitle { font-size: 12.5px; }
  .grid-wrap { padding: 16px 16px 56px; }
  .vh-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Viewer banner wraps instead of overflowing */
  .viewer-banner { font-size: 11px; padding: 8px 14px; line-height: 1.4; }
}

@media (max-width: 480px) {
  .topbar-right .clock { display: none; }
  .page-head { padding: 14px 16px; }
  .page-head h1 { font-size: 19px; }
  .grid-wrap { padding: 14px 14px 48px; }
  .login-card { padding: 26px 22px; }
}

/* ============================================================
   Viewer-mode read-only widget states.
   House View and the KIMI scoreboard render editable/admin chrome
   for admins; end users get a clean read-only render plus a
   tasteful empty state when the desk hasn't published yet.
   ============================================================ */
.hve-ro { gap: 16px; }
.hve-ro-stamp { font-size: 11px; color: var(--color-text-dim); font-family: var(--font-mono); }
.hve-ro-section { display: flex; flex-direction: column; gap: 6px; }
.hve-ro-label { font-size: 10px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; }
.hve-ro-thesis { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.hve-ro-thesis li { font-size: 14px; line-height: 1.5; color: var(--color-ink); font-weight: 500; }
.hve-ro-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--color-text); }

.hve-empty, .mk-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 36px 22px; min-height: 130px;
}
.hve-empty-title, .mk-empty-title { font-size: 14px; font-weight: 600; color: var(--color-text); }
.hve-empty-sub, .mk-empty-sub { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.5; max-width: 340px; }

/* =====================================================================
   Russia War-Endurance widgets (ru_model_card / ru_input_tile).
   Port of the React russia/ dashboard section styling, themed with the
   SignalDesk --color-* tokens. Shared chart engine: _ru_chart.js.
   ===================================================================== */
.ru-model, .ru-tile { --ru-accent: var(--color-accent); display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ru-loading { padding: 22px 16px; font-size: 12px; color: var(--color-text-muted); font-family: var(--font-mono); text-align: center; }
.ru-empty { padding: 18px; border: 1px dashed var(--color-border); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--color-text-muted); line-height: 1.55; background: var(--color-surface-2); }
.ru-empty-sm { padding: 14px; font-size: 12px; text-align: center; }
.ru-dim { color: var(--color-text-dim); font-size: 10.5px; font-family: var(--font-mono); }
.ru-tiny { font-size: 9.5px; }
.ru-pos { color: var(--color-up); font-weight: 700; }
.ru-neg { color: var(--color-down); font-weight: 700; }
.ru-mono { font-family: var(--font-mono); color: var(--color-text); }
.ru-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-text-dim); }

/* --- model card ------------------------------------------------------ */
.ru-model { border-left: 3px solid var(--ru-accent); padding-left: 12px; }
.ru-model-q { font-size: 15px; font-weight: 600; color: var(--color-ink); line-height: 1.3; margin-top: 3px; }
.ru-model-score { display: flex; align-items: baseline; gap: 12px; margin: 12px 0 6px; }
.ru-score-num { font-size: 40px; font-weight: 800; line-height: 0.9; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-score-num.ru-score-red { color: var(--color-down); }
.ru-score-den { font-size: 13px; font-weight: 500; color: var(--color-text-muted); margin-left: 4px; }
.ru-d90 { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-pill); padding: 2px 9px; font-size: 10.5px; font-weight: 700; }
.ru-d90.pos { background: rgba(13,148,136,0.12); color: var(--color-up); }
.ru-d90.neg { background: rgba(220,38,38,0.12); color: var(--color-down); }
.ru-model-constr { font-size: 11px; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 8px; }
.ru-balance { margin-bottom: 10px; }
.ru-balance-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.ru-balance-legend { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 7px; font-size: 10px; color: var(--color-text-dim); }
.ru-balance-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ru-balance-legend b { color: var(--color-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ru-balance-note { margin-left: auto; }

.ru-prows { border-top: 1px solid var(--color-border); }
.ru-prow { position: relative; display: grid; grid-template-columns: minmax(140px,1.5fr) 84px minmax(110px,2fr) 26px 100px minmax(0,92px); gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--color-border); }
.ru-prow-h { border-top: none; border-bottom: 1px solid var(--color-border); padding-top: 0; }
.ru-prow-h > div { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); }
.ru-prow:hover { background: var(--color-surface-2); }
.ru-prow-top .ru-prow-name { font-weight: 700; }
.ru-top-flag { position: absolute; right: 4px; top: 2px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-warn); }
.ru-prow-name { font-size: 12px; font-weight: 600; color: var(--color-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ru-prow-level { font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-top: 1px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ru-chip { font-size: 8.5px; font-weight: 700; color: var(--color-text-muted); background: var(--color-surface-3); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.ru-chip-stale { color: var(--color-warn); background: rgba(217,119,6,0.10); }
.ru-prow-z svg { display: block; }
.ru-prow-bar { position: relative; height: 18px; background: var(--color-surface-3); border-radius: 4px; overflow: hidden; }
.ru-bar-spine { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--color-border-strong); }
.ru-bar-fill { position: absolute; top: 3px; bottom: 3px; }
.ru-bar-fill.pos { border-radius: 0 3px 3px 0; }
.ru-bar-fill.neg { border-radius: 3px 0 0 3px; }
.ru-prow-mv { text-align: center; font-size: 13px; font-weight: 700; }
.ru-mv-up { color: var(--color-up); }
.ru-mv-down { color: var(--color-down); }
.ru-mv-flat { color: var(--color-warn); }
.ru-prow-lev { text-align: right; }
.ru-lev { display: inline-block; background: var(--color-surface-3); border: 1px solid var(--color-border-strong); border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity 0.12s; }
.ru-lev.pos { color: var(--color-up); } .ru-lev.neg { color: var(--color-down); }
.ru-prow:hover .ru-lev { opacity: 1; }
.ru-model-foot { font-size: 10px; color: var(--color-text-dim); border-top: 1px solid var(--color-border); margin-top: 10px; padding-top: 9px; line-height: 1.55; }

/* --- input tile ------------------------------------------------------ */
.ru-tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ru-tile-title { font-size: 13px; font-weight: 600; color: var(--color-ink); }
.ru-tile-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ru-stat-value { font-size: 26px; font-weight: 800; color: var(--color-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.ru-stat-sub { font-size: 10.5px; color: var(--color-text-muted); margin-top: 3px; }
.ru-tile-chart { margin-top: 10px; flex: 1; min-height: 120px; }
.ru-tile-hint { font-size: 9.5px; color: var(--color-text-dim); font-style: italic; font-family: var(--font-mono); margin-top: 4px; }

/* --- shared chart engine (_ru_chart.js) ------------------------------ */
.ru-chart { width: 100%; height: 100%; display: block; }
.ru-chart-grid line { stroke: var(--color-border); stroke-width: 1; stroke-dasharray: 2 3; }
.ru-chart-y { font-size: 8.5px; fill: var(--color-text-muted); font-family: var(--font-mono); text-anchor: end; font-variant-numeric: tabular-nums; }
.ru-chart-x { font-size: 8.5px; fill: var(--color-text-dim); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ru-chart-area { stroke: none; }
.ru-chart-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ru-chart-dot { stroke: var(--color-white); stroke-width: 1.5; }
.ru-chart-ref { stroke: var(--color-text-dim); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.7; }
.ru-chart-ref-lbl { font-size: 8px; fill: var(--color-text-dim); font-family: var(--font-mono); }
.ru-chart-overlay { cursor: crosshair; }
.ru-chart-hover-line { stroke: var(--color-text-muted); stroke-width: 0.8; stroke-dasharray: 2 3; opacity: 0.55; pointer-events: none; }
.ru-chart-hover-dot { fill: var(--color-white); stroke-width: 2; pointer-events: none; }
.ru-chart-hover-bg { fill: var(--color-ink); opacity: 0.92; pointer-events: none; }
.ru-chart-hover-text { font-size: 9px; fill: var(--color-white); font-family: var(--font-mono); font-variant-numeric: tabular-nums; pointer-events: none; }
.ru-spark { display: block; }

/* --- Page I: endurance hero (ru_endurance) --------------------------- */
.ru-endur-card { position: relative; overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.ru-endur-edge { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #4A6CF7, #dc2626); }
.ru-endur-body { padding-top: 6px; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ru-endur-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ru-endur-score { display: flex; align-items: baseline; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.ru-endur-num { font-size: 54px; font-weight: 800; line-height: 0.9; letter-spacing: -0.03em; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-endur-den { font-size: 15px; color: var(--color-text-dim); }
.ru-endur-sub { font-size: 12.5px; color: var(--color-text-muted); margin-top: 9px; max-width: 560px; line-height: 1.55; }
.ru-endur-sub b { color: var(--color-ink); }
.ru-endur-r { text-align: right; font-size: 11.5px; color: var(--color-text-dim); line-height: 1.7; }
.ru-live { color: var(--color-up); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ru-live-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--color-up); }
.ru-endur-chart { height: 210px; margin-top: 12px; }
.ru-endur-chart .ru-chart { height: 100%; }
.ru-endur-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 10.5px; color: var(--color-text-dim); }
.ru-endur-legend i { display: inline-block; margin-right: 5px; vertical-align: middle; }
.ru-endur-legend i.band { width: 16px; height: 8px; background: #4A6CF7; opacity: 0.18; border-radius: 2px; }
.ru-endur-legend i.line { width: 16px; height: 2px; background: #4A6CF7; border-radius: 2px; }
.ru-anchors { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }
.ru-anchors-lbl { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); font-weight: 700; margin-right: 2px; }
.ru-anchor { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px 10px; }
.ru-anchor i { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.ru-anchor-lbl { color: var(--color-text-muted); }
.ru-anchor b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-endur-foot { font-size: 10.5px; color: var(--color-text-dim); margin-top: 8px; line-height: 1.5; }

/* --- Page I: drivers board (ru_drivers) ------------------------------ */
.ru-drivers { height: 100%; }
.ru-drv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ru-drv-key { font-size: 10.5px; color: var(--color-text-dim); }
.ru-drv-key .erode { color: var(--color-down); font-weight: 700; }
.ru-drv-key .support { color: var(--color-accent); font-weight: 700; }
.ru-drv-sub { font-size: 11px; color: var(--color-text-muted); margin: 3px 0 12px; line-height: 1.5; }
.ru-drv-rows { display: grid; gap: 7px; }
.ru-drv-row { display: grid; grid-template-columns: minmax(0,180px) minmax(0,1fr) 82px; gap: 12px; align-items: center; width: 100%; background: none; border: none; padding: 0; font: inherit; text-align: left; cursor: default; }
.ru-drv-name { display: flex; align-items: center; gap: 7px; min-width: 0; justify-content: flex-end; }
.ru-drv-txt { font-size: 11.5px; color: var(--color-text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ru-drv-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.ru-drv-bar { position: relative; height: 15px; }
.ru-drv-spine { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: var(--color-border-strong); }
.ru-drv-fill { position: absolute; top: 0; bottom: 0; }
.ru-drv-fill.support { border-radius: 0 3px 3px 0; }
.ru-drv-fill.erode { border-radius: 3px 0 0 3px; }
.ru-drv-val { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ru-drv-legend { display: flex; align-items: center; gap: 14px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--color-border); flex-wrap: wrap; font-size: 10px; color: var(--color-text-dim); }
.ru-drv-legend > span i { display: inline-block; width: 7px; height: 7px; border-radius: 999px; margin-right: 5px; vertical-align: 0; }
.ru-drv-note { margin-left: auto; }

/* --- Page I: section gauges (ru_section_gauges) --------------------- */
.ru-gauges-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 13px; }
.ru-gauge { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 3px solid var(--color-accent); border-radius: 12px; padding: 13px 15px; box-shadow: 0 1px 2px rgba(11,25,48,0.04); }
.ru-gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ru-gauge-name { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-dim); }
.ru-gauge-head .ru-pos, .ru-gauge-head .ru-neg { font-size: 10.5px; }
.ru-gauge-num { font-size: 30px; font-weight: 800; color: var(--color-ink); line-height: 1.05; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.ru-gauge-num span { font-size: 12px; font-weight: 600; color: var(--color-text-dim); margin-left: 3px; }
.ru-gauge-bar { height: 5px; background: var(--color-surface-3); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.ru-gauge-bar div { height: 100%; border-radius: 3px; }
.ru-gauge-q { font-size: 11px; color: var(--color-text-muted); line-height: 1.4; }

/* --- Page I: fuel gauge (ru_funding_runway) ------------------------- */
.ru-fuel { height: 100%; border-left: 3px solid var(--ru-accent, var(--color-accent)); padding-left: 12px; }
.ru-fuel-num { display: flex; align-items: baseline; gap: 9px; margin-top: 6px; flex-wrap: wrap; }
.ru-fuel-num .big { font-size: 34px; font-weight: 800; color: var(--color-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.ru-fuel-num .unit { font-size: 13px; color: var(--color-text-muted); }
.ru-fuel-bar { height: 14px; background: var(--color-surface-3); border-radius: 7px; overflow: hidden; margin: 12px 0 8px; }
.ru-fuel-bar div { height: 100%; border-radius: 7px; }
.ru-fuel-scens { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.ru-fuel-scen { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 8px; padding: 4px 9px; font-size: 11px; }
.ru-fuel-scen .lab { font-size: 9.5px; font-weight: 600; color: var(--color-text-dim); }
.ru-fuel-scen b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-fuel-foot { font-size: 10px; color: var(--color-text-dim); line-height: 1.5; }

/* --- Page I: budget mix (ru_budget_gap) ----------------------------- */
.ru-budget { height: 100%; }
.ru-bud-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ru-bud-per { font-size: 10px; color: var(--color-text-dim); }
.ru-bud-lead { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--color-ink); margin: 8px 0 12px; }
.ru-bud-bar { display: flex; gap: 2px; height: 32px; border-radius: 6px; overflow: hidden; margin-bottom: 11px; }
.ru-bud-seg { display: flex; align-items: center; justify-content: center; min-width: 2px; }
.ru-bud-seg span { font-size: 11px; font-weight: 700; color: #fff; }
.ru-bud-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ru-bud-tile { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 10px; padding: 9px 11px; }
.ru-bud-tile.borrowed { border-left: 3px solid var(--color-down); border-radius: 0 10px 10px 0; }
.ru-bud-tile-h { display: flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-dim); }
.ru-bud-tile.borrowed .ru-bud-tile-h { color: var(--color-down); }
.ru-bud-tile-h i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ru-bud-tile-v { font-size: 18px; font-weight: 700; color: var(--color-ink); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ru-bud-tile-s { font-size: 10.5px; color: var(--color-text-dim); }
.ru-bud-foot { font-size: 10.5px; line-height: 1.6; color: var(--color-text-dim); margin-top: 11px; }
.ru-bud-foot b { color: var(--color-text-muted); }
.ru-bud-foot b.ru-neg { color: var(--color-down); }

/* --- Page I: desk note (ru_desk_note) ------------------------------- */
.ru-desknote { height: 100%; display: flex; flex-direction: column; }
.ru-desknote-body { margin-top: 8px; min-height: 0; overflow: auto; }
.ru-desknote-prose p { font-size: 13px; line-height: 1.6; color: var(--color-text); margin: 0 0 10px; }
.ru-standing { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; }
.ru-standing-tag { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); background: rgba(74,108,247,0.10); padding: 2px 8px; border-radius: 6px; margin-bottom: 8px; }
.ru-standing p { font-size: 13px; line-height: 1.65; color: var(--color-text); margin: 0; }
.ru-standing p b { color: var(--color-ink); }
.ru-standing-note { font-size: 10.5px; color: var(--color-text-dim); font-style: italic; margin-top: 10px; }

/* --- Page V: state-pollster overlay (ru_state_pollsters) ------------- */
.ru-poll-compare { display: flex; flex-direction: column; gap: 3px; margin: 8px 0 4px; font-size: 11px; color: var(--color-text-muted); }
.ru-poll-compare b { color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-poll-compare i { color: var(--color-text-dim); font-style: normal; font-size: 9.5px; margin-left: 2px; }
.ru-poll-gap { color: var(--color-text-dim); }

/* --- Page IV: external pressures ------------------------------------- */
.ru-feed-note { font-size: 11px; color: var(--color-text-dim); line-height: 1.5; margin-top: 8px; }
.ru-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.ru-tbl td { padding: 6px 8px; border-top: 1px solid var(--color-border); color: var(--color-text); vertical-align: top; }
.ru-tbl th { padding: 4px 8px; text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); border-bottom: 1px solid var(--color-border); }
.ru-tbl-d { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.ru-tbl-t { white-space: nowrap; color: var(--color-text-muted); }

/* strike lead */
.ru-strike { height: 100%; border-left: 3px solid var(--color-down); border-radius: 0 var(--radius) var(--radius) 0; padding-left: 12px; display: flex; flex-direction: column; }
.ru-strike-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ru-strike-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-ink); }
.ru-strike-badge { font-size: 9.5px; font-weight: 700; color: var(--color-down); background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.30); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ru-strike-kpis { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; margin: 13px 0 14px; }
.ru-strike-kpi.divider { border-left: 1px solid var(--color-border); padding-left: 26px; }
.ru-strike-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-dim); }
.ru-strike-big { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.ru-strike-big > span:first-child { font-size: 38px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ru-strike-big .red { color: var(--color-down); } .ru-strike-big .ink { color: var(--color-ink); }
.ru-strike-big .den { font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.ru-strike-note { font-size: 10.5px; color: var(--color-text-dim); margin-top: 3px; }
.ru-strike-chron { margin-top: 12px; }
.ru-strike-chron-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim); margin-bottom: 4px; }
.ru-strike-chron-h span { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--color-text-muted); }

/* balance of payments */
.ru-bop { height: 100%; }
.ru-bop-meta { font-size: 11px; color: var(--color-text-muted); margin: 4px 0 10px; }
.ru-bop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ru-bop-card { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; }
.ru-bop-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 6px; }
.ru-bop-val { font-size: 19px; font-weight: 700; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-bop-d { font-size: 11px; margin-top: 3px; }

/* sanctions */
.ru-sanc { height: 100%; }
.ru-sanc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 14px; }
.ru-sanc-stat { border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; background: var(--color-surface); text-align: center; }
.ru-sanc-v { font-size: 22px; font-weight: 800; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.ru-sanc-l { font-size: 10px; color: var(--color-text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }
.ru-sanc-h { font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 6px; }
.ru-sanc-tblwrap { overflow-x: auto; }
@media (max-width: 560px) { .ru-sanc-stats { grid-template-columns: repeat(2, 1fr); } }
