/* ============================================================
   BTC Agents Dashboard
   ============================================================ */

  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* central command — deep navy black with multi-color neon */
  --bg:       #0a0d12;
  --surface:  #11151c;
  --surface2: #161b24;
  --surface3: #1e2530;
  --border:   rgba(120, 160, 180, 0.10);
  --border2:  rgba(120, 160, 180, 0.22);
  --text:     #d8dee6;
  --text-dim: #8b96a5;
  --muted:    #545c69;
  --muted2:   #2a313c;

  --accent:   #3dfba1;
  --accent-soft: rgba(61, 251, 161, 0.10);
  --accent-glow: rgba(61, 251, 161, 0.35);
  --cyan:     #5ce1ff;
  --cyan-soft: rgba(92, 225, 255, 0.10);
  --magenta:  #ff5fc0;
  --magenta-soft: rgba(255, 95, 192, 0.10);
  --amber:    #ffcb47;
  --amber-soft: rgba(255, 203, 71, 0.10);
  --green:    #3dfba1;
  --green-soft: rgba(61, 251, 161, 0.10);
  --red:      #ff5470;
  --red-soft: rgba(255, 84, 112, 0.10);
  --blue:     #5ce1ff;
  --blue-soft: rgba(92, 225, 255, 0.10);
  --purple:   #b08aff;
  --purple-soft: rgba(176, 138, 255, 0.10);
  --pink:     #ff5fc0;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-xl: 8px;

  --pad: 18px;
}

html, body { background: var(--bg); }

body {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(61, 251, 161, 0.025), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

/* density */
body.density-compact { --pad: 14px; font-size: 12px; }
body.density-spacious { --pad: 22px; font-size: 13px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent); color: #000; }

/* ----- scrollbar -----*/
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ============================================================
   App shell
   ============================================================ */

#root { min-height: 100vh; }

.shell {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 48px) 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----- top bar -----*/

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0;
  box-shadow: 0 0 24px -8px var(--accent-glow), inset 0 0 12px -4px var(--accent-soft);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-transform: none;
}

.brand-sub {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border2);
  border-radius: 0;
  font-size: 10px;
  color: var(--accent);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.status-pill::before { content: "["; color: var(--accent); }
.status-pill::after  { content: "]"; color: var(--accent); }

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

.status-pill.warn { color: var(--amber); border-color: rgba(255, 203, 71, 0.3); }
.status-pill.warn::before, .status-pill.warn::after { color: var(--amber); }
.status-pill.warn .dot { background: var(--amber); box-shadow: 0 0 6px rgba(255, 203, 71, 0.5); }

.status-pill.bad { color: var(--red); border-color: rgba(255, 84, 112, 0.3); }
.status-pill.bad::before, .status-pill.bad::after { color: var(--red); }
.status-pill.bad .dot { background: var(--red); box-shadow: 0 0 6px rgba(255, 84, 112, 0.5); }

.status-pill.cool { color: var(--blue); border-color: rgba(91, 184, 255, 0.3); }
.status-pill.cool::before, .status-pill.cool::after { color: var(--blue); }
.status-pill.cool .dot { background: var(--blue); }

.status-pill .dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.topbar-time {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: var(--pad);
  position: relative;
  transition: border-color 0.18s ease, background 0.18s ease;
}

/* L-shaped corner brackets (top-left + top-right + bottom-left + bottom-right) */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--accent);
  opacity: 0.55;
}

.card::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

/* card color accent variants — applied via class */
.card.accent-cyan::before, .card.accent-cyan::after { border-color: var(--cyan); }
.card.accent-magenta::before, .card.accent-magenta::after { border-color: var(--magenta); }
.card.accent-amber::before, .card.accent-amber::after { border-color: var(--amber); }
.card.accent-purple::before, .card.accent-purple::after { border-color: var(--purple); }

/* dot indicator on card header right side — like the reference */
.card-head .dot-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}
.card-head .dot-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.card-head .dot-indicator span:nth-child(1) { background: var(--red); }
.card-head .dot-indicator span:nth-child(2) { background: var(--amber); }
.card-head .dot-indicator span:nth-child(3) { background: var(--green); }

.card.tight { padding: 14px; }
.card.flush { padding: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.section-meta {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============================================================
   Alerts rail
   ============================================================ */

.alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border2);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
}

.alert .alert-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
}

.alert .alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: 500;
  margin-bottom: 2px;
  font-family: var(--font-display);
  letter-spacing: -0.2px;
  font-size: 13px;
}

.alert-detail {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.55;
}

.alert.warn  { border-color: color-mix(in oklab, var(--amber) 30%, transparent); background: linear-gradient(180deg, color-mix(in oklab, var(--amber) 5%, transparent), var(--surface)); }
.alert.warn  .alert-icon { background: var(--amber-soft); color: var(--amber); }
.alert.bad   { border-color: color-mix(in oklab, var(--red) 30%, transparent); background: linear-gradient(180deg, color-mix(in oklab, var(--red) 5%, transparent), var(--surface)); }
.alert.bad   .alert-icon { background: var(--red-soft); color: var(--red); }
.alert.info  { border-color: color-mix(in oklab, var(--blue) 30%, transparent); }
.alert.info  .alert-icon { background: var(--blue-soft); color: var(--blue); }
.alert.cool  { border-color: color-mix(in oklab, var(--blue) 25%, transparent); }
.alert.cool  .alert-icon { background: var(--blue-soft); color: var(--blue); }

/* ============================================================
   Hero scoreboard
   ============================================================ */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
}

.hero-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px var(--pad);
  position: relative;
  overflow: hidden;
}

.hero-cell.primary {
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 14%, transparent), color-mix(in oklab, var(--accent) 3%, transparent) 60%),
    var(--surface);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}

.hero-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-label .tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface3);
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.hero-value {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hero-cell.primary .hero-value { font-size: 44px; }
.hero-cell .hero-value { font-size: 30px; }

.hero-unit {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0;
}

.hero-sub {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.hero-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.hero-sub-row .lbl { color: var(--muted); }

/* allocation donut */
.alloc-ring {
  --pct: 100;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface3) 0);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.alloc-ring-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ============================================================
   Agent pipeline
   ============================================================ */

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}

.pipeline-step {
  position: relative;
  padding: 16px 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pipeline-step:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.pipeline-step:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--r-lg) var(--r-lg) 0; }

.pipeline-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -7px;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--surface);
  z-index: 1;
}

.pipeline-step:last-child::after { display: none; }

.pipeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-glyph {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.agent-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.pipeline-status.warn { background: var(--amber); }
.pipeline-status.bad  { background: var(--red); }
.pipeline-status.idle { background: var(--muted2); }

.pipeline-schedule {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pipeline-meta {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-meta .lbl { color: var(--muted); }

/* ============================================================
   Strategies — leg meters
   ============================================================ */

.strategies-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.strategy {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}

.strategy.focus {
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent) 6%, transparent), transparent),
    var(--surface2);
}

.strategy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.strategy-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.strategy-id {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.06em;
}

.strategy-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.score-num {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1;
}

.score-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.score-delta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.leg-meter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.leg {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.leg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.leg-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.leg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
}

.leg.met .leg-dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in oklab, var(--green) 22%, transparent); }
.leg.near .leg-dot { background: var(--amber); }

.leg-current {
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.leg-trigger {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.leg-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  width: 0;
}

.leg.met .leg-bar { background: var(--green); }
.leg.near .leg-bar { background: var(--amber); }

.strategy-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.strategy-meta .lbl { color: var(--muted); margin-right: 4px; }

.strategy-summary {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.strategy-summary .lbl { color: var(--muted); margin-right: 4px; text-transform: uppercase; font-size: 9px; letter-spacing: 0.12em; }

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid currentColor;
  white-space: nowrap;
  opacity: 0.92;
}

.badge.active        { background: var(--surface3);    color: var(--green); border-color: color-mix(in oklab, var(--green) 25%, transparent);  }
.badge.paper         { background: var(--surface3);    color: var(--blue);  border-color: color-mix(in oklab, var(--blue) 25%, transparent); }
.badge.testing       { background: var(--surface3);    color: var(--text-dim); border-color: var(--border2); }
.badge.under         { background: var(--surface3);    color: var(--red);   border-color: color-mix(in oklab, var(--red) 25%, transparent); }
.badge.retired       { background: var(--surface3);    color: var(--muted);  }
.badge.ready         { background: var(--surface3);    color: var(--blue);   border-color: color-mix(in oklab, var(--blue) 25%, transparent); }
.badge.warn          { background: var(--surface3);    color: var(--amber);  border-color: color-mix(in oklab, var(--amber) 25%, transparent); }
.badge.accent        { background: var(--surface3);    color: var(--accent); border-color: color-mix(in oklab, var(--accent) 30%, transparent); }
.badge.neutral       { background: var(--surface3);    color: var(--text-dim); }

.badge.solid {
  background: var(--accent);
  color: #000;
}

/* ============================================================
   Market snapshot
   ============================================================ */

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.market-row:first-child { padding-top: 0; }
.market-row:last-child { border-bottom: none; padding-bottom: 0; }

.market-key { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.market-val { font-size: 12px; font-weight: 500; font-family: var(--font-mono); display: flex; align-items: center; gap: 8px; }

.market-big {
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.btc-price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}

.delta-pill.pos { background: var(--green-soft); color: var(--green); }
.delta-pill.neg { background: var(--red-soft);   color: var(--red); }
.delta-pill.flat { background: var(--surface3);  color: var(--text-dim); }

/* F&G ring */
.fg-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.fg-ring {
  --pct: 25;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--pct) * 1%), var(--surface3) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.fg-ring-inner {
  width: 50px;
  height: 50px;
  background: var(--surface);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.fg-info { flex: 1; min-width: 0; }
.fg-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 4px; font-weight: 500; }
.fg-spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-top: 6px; }
.fg-bar {
  flex: 1;
  background: var(--muted2);
  border-radius: 1px;
  min-height: 4px;
  transition: height 0.3s ease;
}
.fg-bar.curr { background: currentColor; }

/* ============================================================
   Signals
   ============================================================ */

.signal-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.signal-card:last-child { margin-bottom: 0; }

.signal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.signal-action {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.signal-meta {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  flex-wrap: wrap;
}

.signal-meta .lbl { color: var(--muted); margin-right: 4px; }

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  border-radius: var(--r-md);
  background: var(--surface2);
  border: 1px dashed var(--border2);
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.empty-state-title .dot-big {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.empty-state-body {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

.empty-state-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.empty-state-foot strong { color: var(--text-dim); font-weight: 500; letter-spacing: 0.06em; }

/* ============================================================
   Directive
   ============================================================ */

.directive-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.directive-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.directive-cell .lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.directive-cell .val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.directive-notes {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.65;
  max-height: 88px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.directive-notes.open { max-height: 1000px; }

.directive-notes::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, transparent, var(--surface));
  pointer-events: none;
}

.directive-notes.open::after { display: none; }

.expand-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.15s ease;
}

.expand-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--muted2); }

/* ============================================================
   Watchlist
   ============================================================ */

.watch-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 8px;
}
.watch-item:last-child { margin-bottom: 0; }

.watch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.watch-sym {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
}

.watch-score {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.watch-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.watch-stat {
  background: var(--surface3);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.watch-stat .v {
  font-size: 12px;
  font-weight: 500;
}

.watch-stat .k {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.watch-foot {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.watch-foot .chip {
  background: var(--surface3);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-dim);
}

.watch-foot .chip.pos { background: var(--green-soft); color: var(--green); }
.watch-foot .chip.neg { background: var(--red-soft); color: var(--red); }

/* ============================================================
   Positions table
   ============================================================ */

table.positions {
  width: 100%;
  border-collapse: collapse;
}

table.positions th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: left;
  padding: 0 10px 10px 0;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}

table.positions td {
  padding: 12px 10px 12px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

table.positions tr:last-child td { border-bottom: none; }

/* ============================================================
   System log
   ============================================================ */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.log-list::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}

.log-entry {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 8px 0 10px;
  position: relative;
}

.log-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--bg);
  margin: 4px 0 0 9px;
  z-index: 2;
  position: relative;
}

.log-entry.orchestrator .log-dot { background: var(--accent); }
.log-entry.researcher   .log-dot { background: var(--green); }
.log-entry.tester       .log-dot { background: var(--blue); }
.log-entry.trader       .log-dot { background: var(--amber); }
.log-entry.reviewer     .log-dot { background: var(--purple); }
.log-entry.reporter     .log-dot { background: var(--pink); }

.log-body { min-width: 0; }

.log-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.log-agent {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.log-time {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.log-run {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 3px;
}

.log-msg {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.55;
}

.log-action-row {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.log-action-row strong { color: var(--text-dim); font-weight: 500; }

/* ============================================================
   Grid layouts
   ============================================================ */

.grid-2col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   Loading / error
   ============================================================ */

.loading-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  flex-direction: column;
}

.loading-screen .spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Footer
   ============================================================ */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   Context banner
   ============================================================ */

.context-banner {
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent) 5%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 14px 18px;
}

.context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 14px;
  flex-wrap: wrap;
}

.context-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 500;
}

.context-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.context-meta {
  display: flex;
  align-items: center;
}

.context-body {
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}

.context-headlines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.context-headline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.context-headline .bullet {
  color: var(--muted);
  flex-shrink: 0;
}

/* sparkline in strategy header */
.strategy-spark {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.strategy-spark-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* hero vs-hodl mini trend */
.hero-trend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--accent);
}

.hero-trend-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.c-pos { color: var(--green); }
.c-neg { color: var(--red); }
.c-flat { color: var(--text-dim); }
.c-accent { color: var(--accent); }
.c-blue { color: var(--blue); }
.c-muted { color: var(--muted); }

/* ============================================================
   Ticker bar — running data strip at top
   ============================================================ */

.ticker-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  margin: 0 calc(-1 * clamp(16px, 3vw, 48px));
  padding: 0 clamp(16px, 3vw, 48px);
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

.ticker-inner::-webkit-scrollbar { display: none; }

.ticker-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.ticker-label {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.ticker-value {
  color: var(--text);
  font-weight: 500;
}

.ticker-delta {
  font-size: 10px;
  font-weight: 500;
}

.ticker-sub {
  color: var(--muted);
  font-size: 10px;
}

/* ============================================================
   Card command header (shell-prompt subheader)
   ============================================================ */

.card-cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border2);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.card-cmd-prompt { color: var(--accent); font-weight: 500; }
.card-cmd-script { color: var(--text); }
.card-cmd-flag { color: var(--text-dim); margin-left: -4px; }

/* per-card command prompt accents */
.card.accent-cyan    .card-cmd-prompt { color: var(--cyan); }
.card.accent-magenta .card-cmd-prompt { color: var(--magenta); }
.card.accent-amber   .card-cmd-prompt { color: var(--amber); }
.card.accent-purple  .card-cmd-prompt { color: var(--purple); }
.card.accent-red     .card-cmd-prompt { color: var(--red); }

.card.accent-cyan    .card-cmd { border-color: color-mix(in oklab, var(--cyan) 22%, transparent); }
.card.accent-magenta .card-cmd { border-color: color-mix(in oklab, var(--magenta) 22%, transparent); }
.card.accent-amber   .card-cmd { border-color: color-mix(in oklab, var(--amber) 22%, transparent); }
.card.accent-purple  .card-cmd { border-color: color-mix(in oklab, var(--purple) 22%, transparent); }
.card.accent-red     .card-cmd { border-color: color-mix(in oklab, var(--red) 22%, transparent); }

.card.accent-cyan    .card-cmd-flag { color: var(--cyan); opacity: 0.7; }
.card.accent-magenta .card-cmd-flag { color: var(--magenta); opacity: 0.7; }
.card.accent-amber   .card-cmd-flag { color: var(--amber); opacity: 0.7; }
.card.accent-purple  .card-cmd-flag { color: var(--purple); opacity: 0.7; }
.card.accent-red     .card-cmd-flag { color: var(--red); opacity: 0.7; }

.card-cmd-live {
  margin-left: auto;
  color: var(--green);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  animation: ticker-blink 2s ease-in-out infinite;
}

@keyframes ticker-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   Per-card category accents
   ============================================================ */

.card.accent-cyan {
  border-color: rgba(92, 225, 255, 0.18);
}
.card.accent-cyan::before, .card.accent-cyan::after {
  border-color: var(--cyan);
  opacity: 0.7;
}
.card.accent-cyan .section-label { color: var(--cyan); }

.card.accent-magenta {
  border-color: rgba(255, 95, 192, 0.18);
}
.card.accent-magenta::before, .card.accent-magenta::after {
  border-color: var(--magenta);
  opacity: 0.7;
}
.card.accent-magenta .section-label { color: var(--magenta); }

.card.accent-amber {
  border-color: rgba(255, 203, 71, 0.18);
}
.card.accent-amber::before, .card.accent-amber::after {
  border-color: var(--amber);
  opacity: 0.7;
}
.card.accent-amber .section-label { color: var(--amber); }

.card.accent-purple {
  border-color: rgba(176, 138, 255, 0.18);
}
.card.accent-purple::before, .card.accent-purple::after {
  border-color: var(--purple);
  opacity: 0.7;
}
.card.accent-purple .section-label { color: var(--purple); }

.card.accent-red {
  border-color: rgba(255, 84, 112, 0.18);
}
.card.accent-red::before, .card.accent-red::after {
  border-color: var(--red);
  opacity: 0.7;
}
.card.accent-red .section-label { color: var(--red); }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); }

/* enable tabular numerals on all data values for clean column alignment */
.focus-big,
.focus-cell-val,
.focus-stat-val,
.hero-value,
.btc-price,
.score-num,
.view-stat-val,
.drawer-stat-val,
.market-val,
.watch-score,
.delta-pill,
.alloc-ring-inner,
.fg-ring-inner {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* tighter, calmer card design */
.card {
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

/* ============================================================
   Allocation donut (Today card)
   ============================================================ */

.alloc-body {
  display: flex;
  align-items: center;
  gap: 22px;
}

.alloc-donut-large {
  --size: 120px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.alloc-donut-inner {
  width: calc(var(--size) - 38px);
  height: calc(var(--size) - 38px);
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.alloc-donut-pct {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.alloc-donut-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.alloc-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.alloc-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.alloc-legend-row:last-child { border-bottom: none; padding-bottom: 0; }

.alloc-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.alloc-legend-label {
  flex: 1;
  font-weight: 500;
}

.alloc-legend-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.alloc-legend-usd {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  text-align: right;
}

/* ============================================================
   Performance view
   ============================================================ */

.perf-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* Equity + BTC price side-by-side from 800px+ */
.perf-chart-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .perf-chart-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Condensed empty-state card */
.card.card-condensed .empty-state {
  padding: 14px 16px;
  background: transparent;
  border: none;
}
.card.card-condensed .empty-state-title {
  font-size: 13px;
}
.card.card-condensed .empty-state-body {
  font-size: 11px;
}
.card.card-condensed .empty-state-foot {
  padding-top: 8px;
  margin-top: 2px;
}

@media (max-width: 1100px) {
  .perf-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .perf-stats { grid-template-columns: repeat(2, 1fr); }
}

.perf-stat {
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perf-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.perf-stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

.perf-stat-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: var(--r-md);
  color: var(--text-dim);
  font-size: 12px;
}

table.trade-table {
  width: 100%;
  border-collapse: collapse;
}
table.trade-table th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: left;
  padding: 0 10px 10px 0;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}
table.trade-table td {
  padding: 12px 10px 12px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
table.trade-table tr:last-child td { border-bottom: none; }

/* ============================================================ */

/* Today tab — at wide widths, today panel + market signals side by side */
.today-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1280px) {
  .today-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
  .focus-market-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1600px) {
  .focus-market-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Strategies tab — 2 columns on wide screens */
.strategies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

@media (min-width: 1280px) {
  .strategies-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1700px) {
  .strategies-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Market tab — at wide widths show watchlist column too */
.market-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1100px) {
  .market-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

@media (min-width: 1500px) {
  .market-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

/* Operations tab — 3-col layout at wide widths */
.operations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1200px) {
  .operations-grid {
    grid-template-columns: 1fr 1.4fr;
  }
}

/* Focus hero — better proportions */
@media (min-width: 1280px) {
  .focus-hero { grid-template-columns: 1fr 2.5fr; }
}

@media (min-width: 1600px) {
  .focus-hero-cells { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================ */

/* ============================================================
   Clickable / drawer-trigger affordance
   ============================================================ */

.clickable {
  position: relative;
  cursor: pointer;
}

.clickable .chevron {
  display: none;
}

/* Action bar pinned at the bottom of clickable strategy cards */
.strategy-clickwrap > .strategy {
  position: relative;
  padding-bottom: 42px;
}

.strategy-clickwrap::after {
  content: "View full details →";
  position: absolute;
  bottom: 12px;
  right: 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 500;
  pointer-events: none;
  transition: color 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.strategy-clickwrap:hover::after {
  color: var(--accent);
  transform: translateX(2px);
}

.strategy-clickwrap:hover .strategy {
  border-color: var(--muted2);
}

/* In the Today "Closest to firing" wrapper, position the action bar at the wrapper level */
.focus-strategy-wrap {
  position: relative;
}

.focus-strategy-wrap .strategy {
  padding-bottom: 42px;
}

.focus-strategy-wrap::after {
  content: "[ VIEW FULL DETAILS ─►";
  position: absolute;
  bottom: 12px;
  right: 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
  transition: color 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.strategy-clickwrap::after {
  content: "[ VIEW FULL DETAILS ─►";
  position: absolute;
  bottom: 12px;
  right: 18px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
  transition: color 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.strategy-clickwrap::after,
.focus-strategy-wrap::after {
  content: "▸ VIEW FULL DETAILS ─►";
}

.focus-strategy-wrap:hover::after {
  color: var(--accent);
  transform: translateX(2px);
}

/* ============================================================
   TabBar
   ============================================================ */

.tabbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 12, 14, 0.88);
  backdrop-filter: blur(14px);
  margin: 0 calc(-1 * clamp(16px, 3vw, 48px));
  padding: 0 clamp(16px, 3vw, 48px);
  border-bottom: 1px solid var(--border);
}

.tabbar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 1800px;
  margin: 0 auto;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease;
}

.tab::before { content: "["; color: inherit; opacity: 0.5; }
.tab::after  { content: "]"; color: inherit; opacity: 0.5; }

.tab:hover { color: var(--text-dim); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.tab.active::before, .tab.active::after { opacity: 1; }

.tab-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface3);
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
}

.tab-badge.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.tab-badge.warn { background: var(--amber-soft); color: var(--amber); }

.tabbar-summary {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.tabbar-chip::before { content: "["; color: var(--muted); margin-right: 2px; }
.tabbar-chip::after  { content: "]"; color: var(--muted); margin-left: 2px; }

.tabbar-chip.warn {
  border-color: rgba(255, 203, 71, 0.2);
  color: var(--amber);
}

.tabbar-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.tabbar-chip-dot.cool { background: var(--blue); }
.tabbar-chip-dot.warn { background: var(--amber); }

.tab-content {
  display: block;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   View header
   ============================================================ */

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 4px;
}

.view-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}

.view-subtitle {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.view-header-stats {
  display: flex;
  gap: 18px;
}

.view-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.view-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.view-stat-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* ============================================================
   Focus hero
   ============================================================ */

.focus-hero {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.focus-hero-main {
  padding: 24px 28px;
  background: var(--surface2);
  border-right: 1px solid var(--border);
}

.focus-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 10px;
}

.focus-big {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 14px;
  text-shadow: 0 0 24px var(--accent-glow);
}

.focus-cell-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1;
}

.focus-sub {
  font-size: 11px;
}

.focus-hero-cells {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.focus-cell {
  padding: 22px 18px;
  border-right: 1px solid var(--border);
}
.focus-cell:last-child { border-right: none; }

.focus-cell-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 10px;
}

.focus-cell-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}

.focus-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.focus-cell-sub {
  font-size: 11px;
  margin-top: 8px;
}

/* ============================================================
   Today panel
   ============================================================ */

.focus-today {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}

.focus-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.focus-today-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.focus-today-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
}

.focus-today-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.focus-today-summary {
  background: var(--surface2);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.focus-today-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}

.focus-today-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.focus-today-status-dot.warn { background: var(--amber); }

.focus-today-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}

.focus-strategy-wrap {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.focus-strategy-wrap:hover { transform: translateY(-1px); }
.focus-strategy-wrap:hover .strategy { border-color: var(--muted2); }

.focus-strategy-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
  padding-left: 4px;
}

.focus-strategy-tag-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.strategy-clickwrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.strategy-clickwrap > .strategy {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* push leg meter / metadata to top, summary fills space above the action bar */
.strategy-clickwrap > .strategy > .strategy-summary {
  margin-top: auto;
  padding-top: 12px;
}

.strategy-clickwrap .chevron {
  top: 18px;
  right: 18px;
}

/* Strategy hover styling — the .strategy is INSIDE the .clickable wrap */
.strategy-clickwrap:hover .strategy {
  border-color: var(--muted2);
}

/* ============================================================
   Focus market grid
   ============================================================ */

.focus-market-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.focus-stat {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.focus-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.focus-stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-stat-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Action menu
   ============================================================ */

.action-menu { position: relative; }

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--accent);
  font-family: var(--font-mono);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px -4px var(--accent-glow);
}

.action-icon { font-size: 16px; line-height: 1; }

.action-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  padding: 4px;
  box-shadow: 0 16px 40px -8px rgba(0,0,0,0.6);
  z-index: 100;
  animation: popup-in 0.12s ease-out;
}

@keyframes popup-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.action-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--r-sm);
  text-align: left;
}

.action-item:hover { background: var(--surface2); }
.action-item:disabled { opacity: 0.4; cursor: not-allowed; }
.action-item:disabled:hover { background: transparent; }
.action-item.danger { color: var(--red); }
.action-item.danger:hover { background: color-mix(in oklab, var(--red) 10%, transparent); }

.action-shortcut {
  font-size: 10px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface2);
}

/* ============================================================
   Drawer
   ============================================================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  animation: fade-in 0.18s ease-out;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border2);
  z-index: 1001;
  overflow-y: auto;
  animation: slide-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -20px 0 60px -10px rgba(0,0,0,0.7);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 18px;
  background: linear-gradient(180deg, var(--surface) 70%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 2;
  gap: 16px;
}

.drawer-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 4px;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.25;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.drawer-close:hover {
  background: var(--surface3);
  color: var(--text);
}

.drawer-body {
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.drawer-stat {
  background: var(--surface2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}

.drawer-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.drawer-stat-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.drawer-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.drawer-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.drawer-code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.drawer-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-history-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: var(--r-sm);
}

/* ============================================================
   Misc
   ============================================================ */

.grid-2col-reverse {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
}

.retired-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.retired-row:last-child { border-bottom: none; }
.retired-name { flex: 1; }

.card.subtle {
  background: var(--surface2);
  border-style: dashed;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  .focus-hero { grid-template-columns: 1fr; }
  .focus-hero-main { border-right: none; border-bottom: 1px solid var(--border); padding: 20px 24px; }
  .focus-market-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline-step { border-right: 1px solid var(--border); border-radius: 0 !important; }
  .pipeline-step::after { display: none; }
  .grid-2col, .grid-2col-reverse { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .view-header-stats { width: 100%; justify-content: space-between; }
  .view-stat { align-items: flex-start; }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .topbar-status {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .topbar-time { font-size: 9px; }
  .ticker-inner { gap: 16px; padding: 8px 0; }
  .ticker-item { font-size: 10px; }

  /* tabs scroll horizontally */
  .tabbar-inner {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .tabbar-inner::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 760px) {
  .shell { padding: 14px; }
  .tabbar {
    margin: 0 -14px;
    padding: 0 14px;
  }
  .ticker-bar { margin: 0 -14px; padding: 0 14px; }

  /* hide brand subtitle on narrow */
  .brand-sub { display: none; }
  .brand-title { font-size: 13px; }
  .brand-mark { width: 32px; height: 32px; font-size: 14px; }

  /* hero stacks fully */
  .focus-hero { grid-template-columns: 1fr; }
  .focus-hero-main {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 18px;
  }
  .focus-big { font-size: 36px; margin-bottom: 8px; }
  .focus-hero-cells { grid-template-columns: 1fr 1fr; }
  .focus-cell {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 14px 14px;
  }
  .focus-cell:nth-child(even) { border-right: none; }
  .focus-cell:nth-last-child(-n+2) { border-bottom: none; }
  .focus-cell-val { font-size: 18px; }

  .focus-market-grid { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .leg-meter { grid-template-columns: 1fr 1fr; }
  .watch-breakdown { grid-template-columns: 1fr 1fr; }
  .tabbar-summary { display: none; }
  .tab { padding: 10px 10px 8px; font-size: 11px; }
  .drawer-row { grid-template-columns: 1fr 1fr; }

  /* view headers stack */
  .view-title { font-size: 18px; }

  /* alerts stack to single col */
  .alerts { grid-template-columns: 1fr; }

  /* allocation donut row stacks */
  .alloc-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .alloc-donut-large { align-self: center; }

  /* perf stats */
  .perf-stats { grid-template-columns: repeat(2, 1fr); }

  /* tier-1 context body smaller */
  .context-body { font-size: 12px; }
  .context-headline { font-size: 10px; }

  /* card padding */
  .card { padding: 14px; }

  /* trade table needs scroll */
  table.trade-table,
  table.positions {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* log timeline tightens */
  .log-entry { grid-template-columns: 22px 1fr; gap: 8px; }
  .log-head { gap: 6px; }
  .log-time { font-size: 9px; }
}

@media (max-width: 480px) {
  .shell { padding: 12px; gap: 14px; }
  .tabbar, .ticker-bar { margin: 0 -12px; padding: 0 12px; }

  .focus-hero-cells { grid-template-columns: 1fr; }
  .focus-cell {
    border-right: none;
  }
  .focus-cell:not(:last-child) { border-bottom: 1px solid var(--border); }

  .focus-big { font-size: 30px; }
  .focus-cell-val { font-size: 17px; }
  .focus-market-grid { grid-template-columns: 1fr; }
  .leg-meter { grid-template-columns: 1fr; }
  .perf-stats { grid-template-columns: 1fr 1fr; }
  .watch-breakdown { grid-template-columns: 1fr 1fr; }

  .alerts { grid-template-columns: 1fr; }

  /* tabbar chips hidden */
  .tabbar-chip { display: none; }

  /* drawer full screen */
  .drawer { width: 100vw; }
  .drawer-row { grid-template-columns: 1fr 1fr; }

  /* shrink padding on inner cards */
  .strategy { padding: 12px; }
  .leg { padding: 7px 8px; }

  /* action popup widens */
  .action-popup { right: 0; min-width: 180px; }

  /* hide secondary view header stats area */
  .view-header { flex-direction: column; align-items: flex-start; }
  .view-header-stats { width: 100%; justify-content: space-between; gap: 12px; }

  /* condense the strategy "view full details" affordance */
  .focus-strategy-wrap::after,
  .strategy-clickwrap::after {
    font-size: 9px;
    letter-spacing: 0.1em;
    bottom: 10px;
    right: 12px;
  }

  /* footer single line */
  .foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}
