/* ── Maargin Dashboard — design system aligned with maargin.ai ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;1,9..144,300&family=Manrope:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens (kept 1-to-1 with maargin.ai) ── */
:root {
  --bg:              #f8f6f1;
  --bg-2:            #0a1016;
  --surface:         #e0dbd1;
  --surface-2:       #e6e1d6;
  --line:            rgba(0,0,0,0.07);
  --line-2:          rgba(0,0,0,0.13);
  --fg:              #16140d;
  --fg-2:            #3a3828;
  --fg-mute:         #716d60;
  --fg-dim:          rgba(60,56,44,0.70);
  --accent:          #008CAB;
  --accent-rgb:      0,140,171;
  --signal:          #007a90;
  --signal-rgb:      0,122,144;
  --warm:            #9a6500;
  --warm-rgb:        184,120,16;
  --violet:          #5148b8;
  --violet-rgb:      81,72,184;
  --font-display:    'Fraunces', Georgia, serif;
  --font-body:       'Manrope', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', ui-monospace, monospace;
  --ease:            cubic-bezier(0.22, 1, 0.36, 1);
  --pad:             48px;
  --radius-card:     22px;
  --radius-sm:       12px;
  --radius-pill:     999px;
  --nav-h:           66px;
  --teal-rgb:        0,140,171;
  --line-rgb:        0,0,0;
  --nav-bg:          rgba(248,246,241,0.95);
  --nav-overlay-bg:  rgba(248,246,241,0.98);
  --line-rgb:        0,0,0;
  --card-bg:         rgba(255,255,255,0.85);
  --card-bg-strong:  rgba(255,255,255,0.72);
  --card-bg-soft:    rgba(255,255,255,0.60);
  --ink-1-rgb:       58,56,40;
  --teal-rgb:        0,140,171;
  --line-rgb:        0,0,0;
  --nav-bg:          rgba(248,246,241,0.95);
  --nav-overlay-bg:  rgba(248,246,241,0.98);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle noise + glow from maargin.ai */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(94,234,212,0.07), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(184,120,16,0.06), transparent 45%);
}
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(0,140,171,0.35); color: var(--fg); }

/* ── Scrollbars ── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.10); border-radius: var(--radius-pill); }

/* ── Keyframes ── */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse    { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.45; transform:scale(1.3); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes dlc-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes dlc-up   { from { transform: translateY(14px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes navIn    { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ═══════════════════════════════════════════
   NAV — identical to maargin.ai
   ═══════════════════════════════════════════ */
.mgn-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding: 20px 0;
  border-bottom: 1px solid transparent;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.mgn-nav.scrolled {
  padding: 14px 0;
  background: rgba(248,246,241,0.95);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-color: var(--line);
}

.mgn-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad);
  gap: 24px;
}

/* Logo */
.mgn-nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.mgn-logo-img {
  height: 26px;
  width: auto;
  display: block;
}
.mgn-logo-wordmark {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.mgn-logo-dot { color: var(--accent); }
.mgn-logo-ai  { font-family: var(--font-display); font-style: italic; font-weight: 300; color: var(--accent); }

/* Desktop nav links */
.mgn-nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  font-family: var(--font-body);
  font-size: 14px;
}
.mgn-nav-links a {
  padding: 4px 0;
  position: relative;
  color: var(--fg-2);
  transition: color 0.3s var(--ease);
  display: inline-block;
}
.mgn-nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width 0.4s var(--ease);
  display: block;
}
.mgn-nav-links a:hover, .mgn-nav-links a.active { color: var(--fg); }
.mgn-nav-links a:hover::after, .mgn-nav-links a.active::after { width: 100%; }

/* Nav CTA */
.mgn-btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.85);
  color: var(--fg);
  transition: all 0.4s var(--ease);
  flex-shrink: 0;
}
.mgn-btn-nav:hover {
  background: rgba(0,0,0,0.09);
  border-color: var(--fg-2);
  transform: translateY(-1px);
}
.nav-arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.mgn-btn-nav:hover .nav-arrow { transform: translateX(2px) translateY(-2px); }

/* Hamburger */
.mgn-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}
.ham-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.mgn-hamburger.open .ham-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mgn-hamburger.open .ham-bar:nth-child(2) { opacity: 0; }
.mgn-hamburger.open .ham-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile overlay */
.mgn-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(248,246,241,0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-direction: column;
  justify-content: center;
  padding: 80px var(--pad) 48px;
  overflow-y: auto;
}
.mgn-mobile-overlay.visible { display: flex; }

.mgn-mobile-links {
  list-style: none;
  margin-bottom: 40px;
}
.mgn-mobile-links li { border-bottom: 1px solid rgba(0,0,0,0.08); }
.mgn-mobile-links a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(26px, 7vw, 46px);
  font-weight: 300;
  color: var(--fg);
  letter-spacing: -0.025em;
  line-height: 1.1;
  padding: 14px 0;
  font-style: normal;
}

.mgn-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid transparent;
  transition: all 0.4s var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.mgn-btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(0,140,171,0.42);
}
.mgn-mobile-cta { width: 100%; justify-content: center; font-size: 15px; }

.mgn-mobile-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a8a498;
  margin-top: 28px;
}

/* ═══════════════════════════════════════════
   PAGE HERO
   ═══════════════════════════════════════════ */
.dash-hero {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.dash-hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.dash-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 24px;
  transition: color 0.3s var(--ease);
}
.dash-back:hover { color: var(--fg-2); }

.dash-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 16px;
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--warm);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--warm);
  animation: pulse 2.4s var(--ease) infinite;
  flex-shrink: 0;
}

.dash-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--fg);
  font-variation-settings: "opsz" 144;
  margin-bottom: 16px;
  animation: fadeUp 0.7s var(--ease) 0.2s both;
}
.dash-title em {
  font-style: italic;
  color: var(--warm);
}

.dash-sub {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--fg-2);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 24px;
  animation: fadeUp 0.7s var(--ease) 0.3s both;
}

.dash-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  flex-wrap: wrap;
  animation: fadeUp 0.7s var(--ease) 0.4s both;
}
.dash-sep { opacity: 0.35; user-select: none; }

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--signal);
  animation: pulse 1.8s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 4px;
}
.live-dot.small { width: 5px; height: 5px; margin-right: 3px; }

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.app-body {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  padding: 24px var(--pad) 48px;
  max-width: 1360px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-h) - 180px);
}

.col-left, .col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ═══════════════════════════════════════════
   PANEL  (maargin.ai card style)
   ═══════════════════════════════════════════ */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255,255,255,0.82);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  padding: 24px;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,140,171,0.40), transparent);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.panel:hover { border-color: rgba(0,140,171,0.30); box-shadow: 0 4px 28px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.04); }
.panel:hover::before { opacity: 1; }

/* Panel header / eyebrow */
.panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.panel-eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
  margin-right: 8px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════
   ORBITAL TIMELINE
   ═══════════════════════════════════════════ */
.orbital-timeline { margin-top: 4px; }
.ot-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 16px;
}
.ot-diagram-wrap { display: flex; align-items: center; gap: 16px; }
.ot-svg          { width: 130px; height: 130px; flex-shrink: 0; }

.ot-arc-sun { stroke: rgba(184,120,16,0.70); }
.ot-arc-ecl { stroke: rgba(81,72,184,0.50); }
.ot-earth   { fill: #1d4d6b; }
.ot-earth-glow { fill: none; stroke: rgba(0,140,171,0.30); stroke-width: 1; }
.ot-sat-dot-sun { fill: var(--signal); }
.ot-sat-dot-ecl { fill: rgba(124,111,240,0.7); }
.ot-sat-ring    { fill: none; stroke-width: 1.5; }
.ot-sat-ring-sun { stroke: var(--signal); opacity: 0.35; }
.ot-sat-ring-ecl { stroke: var(--violet); opacity: 0.3; }

.ot-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.ot-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}
.ot-badge-sun { background: rgba(184,120,16,0.13); color: var(--warm);   border: 1px solid rgba(184,120,16,0.28); }
.ot-badge-ecl { background: rgba(124,111,240,0.12); color: var(--violet); border: 1px solid rgba(124,111,240,0.25); }

.ot-countdown { display: flex; flex-direction: column; gap: 2px; }
.ot-cd-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  color: var(--fg);
  display: block;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.ot-cd-label { font-size: 10px; color: var(--fg-mute); }
.ot-abs-time { font-size: 10px; color: var(--fg-dim); font-family: var(--font-mono); }

.ot-period-info {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.ot-pi-sun { color: var(--warm); }
.ot-pi-ecl { color: var(--violet); }

/* ═══════════════════════════════════════════
   TASK QUEUE
   ═══════════════════════════════════════════ */
.tq-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tq-title::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
  vertical-align: middle;
}
.tq-count {
  background: rgba(var(--accent-rgb),0.18);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 10px;
}
.tq-list  { display: flex; flex-direction: column; gap: 8px; }
.tq-empty { font-size: 12px; color: var(--fg-dim); text-align: center; padding: 12px 0; }

.queue-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  padding: 12px;
  transition: border-color 0.3s var(--ease);
}
.queue-row:hover { border-color: rgba(0,0,0,0.10); }
.qr-main   { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.qr-type   { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--fg); }
.qr-status { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; font-weight: 500; }
.qr-meta   { display: flex; gap: 12px; font-size: 10px; color: var(--fg-mute); }
.qr-meta strong { color: var(--fg-2); font-family: var(--font-mono); }

/* ═══════════════════════════════════════════
   CENTER: DESCRIPTION + CHARTS
   ═══════════════════════════════════════════ */
.project-desc { margin-bottom: 20px; }
.pd-body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-mute);
}

.pd-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Telemetry Charts */
.telemetry-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.mini-chart {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  padding: 12px;
  transition: border-color 0.3s var(--ease);
}
.mini-chart:hover { border-color: rgba(0,0,0,0.10); }
.mc-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.mc-label  { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.mc-value  { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.mc-svg    { width: 100%; height: 60px; display: block; }

/* Telemetry Snapshot */
.telemetry-snapshot {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}
.ts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.3s var(--ease);
}
.stat-item:hover { border-color: rgba(0,0,0,0.10); }
.stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.stat-value { font-family: var(--font-display); font-size: 20px; font-weight: 300; letter-spacing: -0.02em; font-variation-settings: "opsz" 144; }

/* ═══════════════════════════════════════════
   DECISION FLOW (right column)
   ═══════════════════════════════════════════ */
.decision-flow  { display: flex; flex-direction: column; gap: 16px; }
.df-header      { display: flex; align-items: center; justify-content: space-between; }

.df-live {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  padding: 3px 10px;
  border: 1px solid rgba(0,140,171,0.22);
  border-radius: var(--radius-pill);
  background: rgba(0,140,171,0.06);
}

/* Active task card */
.active-task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  padding: 14px 16px;
}
.atc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.atc-id   { font-family: var(--font-mono); font-size: 10px; color: var(--fg-mute); letter-spacing: 0.08em; }
.atc-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 500;
  border: 1px solid;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  text-transform: uppercase;
}
.atc-type  {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 300;
  font-style: italic;
  color: var(--fg);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  font-variation-settings: "opsz" 144;
}
.atc-stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 10px; color: var(--fg-mute); }

/* Analysis Pipeline */
.analysis-pipeline { display: flex; flex-direction: column; gap: 6px; }
.ap-step { overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.ap-step-pending  { opacity: 0.45; }
.ap-step-active   { border-color: var(--accent); }
.ap-step-complete { border-color: rgba(0,140,171,0.27); }
.ap-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.85);
}
.ap-step-indicator     { font-size: 12px; width: 14px; text-align: center; }
.ap-step-complete .ap-step-indicator { color: var(--signal); }
.ap-step-active   .ap-step-indicator { color: var(--accent); }
.ap-step-pending  .ap-step-indicator { color: var(--fg-dim); }
.ap-step-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.ap-step-body {
  padding: 8px 12px;
  background: rgba(255,255,255,0.60);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  border-top: 1px solid var(--line);
}
.ap-spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 1.5px solid rgba(0,140,171,0.20);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* Decision History */
.dh-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.dh-title::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--accent);
  opacity: 0.6;
  margin-right: 8px;
  vertical-align: middle;
}
.dlc-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dlc-row-btn {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-2);
  text-align: left;
  transition: background 0.2s var(--ease);
}
.dlc-row-btn:hover { background: rgba(255,255,255,0.85); }
.dlc-ts           { color: var(--fg-mute); flex-shrink: 0; width: 64px; }
.dlc-task-type    { color: var(--fg-mute); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlc-action-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.dlc-conf    { color: var(--fg-mute); font-size: 10px; flex-shrink: 0; width: 28px; text-align: right; }
.dlc-chevron { color: var(--fg-dim); font-size: 12px; flex-shrink: 0; }

/* Badge semantics */
.badge-run-local  { color: var(--accent); border-color: var(--accent); }
.badge-escalate   { color: var(--signal); border-color: var(--signal); }
.badge-queue      { color: var(--warm);   border-color: var(--warm); }

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */
.dlc-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,30,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
  animation: dlc-fade 0.15s ease;
}
.dlc-modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,246,241,0.99) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-card);
  width: 460px; max-width: 92vw;
  max-height: 82vh;
  display: flex; flex-direction: column;
  animation: dlc-up 0.2s var(--ease);
  overflow: hidden;
}
.dlc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dlc-modal-title  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dlc-modal-ts     { color: var(--fg-mute); font-family: var(--font-mono); font-size: 10px; }
.dlc-modal-type   {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  color: var(--fg);
  font-variation-settings: "opsz" 144;
}
.dlc-modal-risk   { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.dlc-close {
  background: none; border: none;
  color: var(--fg-mute); font-size: 14px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.dlc-close:hover { color: var(--fg); background: rgba(0,0,0,0.07); }
.dlc-modal-body {
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.dlc-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  padding: 12px 16px;
}
.dlc-panel-title {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 10px;
}
.dlc-kv-grid { display: grid; grid-template-columns: 80px 1fr; gap: 3px 8px; font-size: 10px; }
.dlc-k { color: var(--fg-mute); }
.dlc-v { color: var(--fg-2); font-family: var(--font-mono); font-size: 10px; }
.dlc-res-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 10px; }
.dlc-res-label { color: var(--fg-mute); width: 72px; flex-shrink: 0; }
.dlc-res-sep   { color: var(--fg-dim); }
.dlc-res-req   { color: var(--fg-mute); }
.dlc-dot       { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dlc-reason {
  margin-top: 8px; color: var(--fg-mute); font-size: 10px; line-height: 1.55;
  border-left: 2px solid rgba(0,140,171,0.30);
  padding-left: 10px;
}
.dlc-risk { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; margin-top: 6px; }

/* ═══════════════════════════════════════════
   DEMO BANNER
   ═══════════════════════════════════════════ */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.demo-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 400;
  height: 32px;
  background: rgba(248,246,241,0.97);
  border-top: 1px solid rgba(184,120,16,0.40);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.demo-banner-track {
  display: flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  will-change: transform;
  padding-left: 24px;
}
.demo-banner-msg {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a5e00;
  opacity: 0.95;
  flex-shrink: 0;
}
.demo-banner-sep {
  color: rgba(184,120,16,0.50);
  font-size: 14px;
  flex-shrink: 0;
}

/* Push page content above the banner */
.app-body { padding-bottom: 56px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --pad: 36px; }
  .app-body { grid-template-columns: 260px 1fr 300px; gap: 16px; }
}

@media (max-width: 860px) {
  :root { --pad: 28px; }
  .mgn-nav-links  { display: none; }
  .mgn-btn-nav    { display: none; }
  .mgn-hamburger  { display: flex; }

  .app-body {
    grid-template-columns: 1fr;
    padding-bottom: 48px;
  }
  .col-left, .col-right { flex-direction: column; }

  .dash-title { font-size: clamp(30px, 8vw, 52px); }
  .ts-grid    { grid-template-columns: repeat(2, 1fr); }
  .telemetry-charts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  :root { --pad: 20px; }
  .dash-meta-bar { gap: 6px; }
  .ts-grid { grid-template-columns: 1fr 1fr; }
  .telemetry-charts { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════════════════════
   DARK THEME OVERRIDES — scheduler-dashboard.css
   ════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --nav-bg: rgba(7,9,12,0.92);
  --nav-overlay-bg: rgba(7,9,12,0.97);
  --line-rgb: 255,255,255;
  --card-bg: rgba(255,255,255,0.04);
  --card-bg-strong: rgba(255,255,255,0.06);
  --card-bg-soft:   rgba(255,255,255,0.03);
  --ink-1-rgb:      212,207,195;
  --bg:       #07090c;
  --bg-2:     #0a1016;
  --surface:  #0d141c;
  --surface-2:#121a24;
  --line:     rgba(255,255,255,0.06);
  --line-2:   rgba(255,255,255,0.11);
  --fg:       #f4f1ea;
  --fg-2:     #d4cfc3;
  --fg-mute:  #8b8679;
  --fg-dim:   rgba(244,241,234,0.38);
  --signal:   rgb(94,234,212);
  --signal-rgb: 94,234,212;
  --warm:     rgb(245,185,113);
  --warm-rgb: 245,185,113;
  --violet:   rgb(124,111,240);
  --violet-rgb: 124,111,240;
}

[data-theme="dark"] body { background: var(--bg); color: var(--fg-2); }

[data-theme="dark"] .mgn-nav.scrolled {
  background: rgba(7,9,12,0.92);
  border-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .mgn-mobile-overlay { background: rgba(7,9,12,0.97); }
[data-theme="dark"] .mgn-mobile-links a { color: #f4f1ea; }
[data-theme="dark"] .mgn-mobile-links li { border-color: rgba(255,255,255,0.07); }

[data-theme="dark"] .panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  box-shadow: none;
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .panel:hover {
  border-color: rgba(0,140,171,0.30);
  box-shadow: none;
}

[data-theme="dark"] .queue-row,
[data-theme="dark"] .active-task-card,
[data-theme="dark"] .ap-step-header,
[data-theme="dark"] .ap-step-body,
[data-theme="dark"] .stat-item,
[data-theme="dark"] .mini-chart,
[data-theme="dark"] .ap-step { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }

[data-theme="dark"] .dlc-row-btn { color: #d4cfc3; }
[data-theme="dark"] .dlc-row-btn:hover { background: rgba(255,255,255,0.04); }

[data-theme="dark"] .dlc-panel { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }

[data-theme="dark"] .dlc-modal {
  background: linear-gradient(180deg, rgba(11,24,32,0.98) 0%, rgba(7,9,12,0.98) 100%);
  border-color: rgba(255,255,255,0.11);
}
[data-theme="dark"] .dlc-close:hover { background: rgba(255,255,255,0.06); color: #f4f1ea; }

[data-theme="dark"] .demo-banner {
  background: rgba(7,9,12,0.95);
  border-top-color: rgba(245,185,113,0.28);
}
[data-theme="dark"] .demo-banner-msg { color: var(--warm); opacity: 0.8; }
[data-theme="dark"] .demo-banner-sep { color: rgba(245,185,113,0.33); }

[data-theme="dark"] .mgn-btn-nav {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.12);
  color: #f4f1ea;
}

/* ── Logo invert in dark mode ── */
[data-theme="dark"] .mgn-logo-img { filter: invert(1) brightness(2); }

/* ── Scheduler text boldness ── */
.dash-sub { font-weight: 500 !important; color: var(--fg) !important; font-size: 17px !important; }
.panel-eyebrow { font-weight: 600 !important; }
.pd-body { font-weight: 500 !important; color: var(--fg-2) !important; font-size: 14px !important; }
.qr-type { font-weight: 600 !important; font-size: 13px !important; }
.qr-meta { font-size: 11px !important; font-weight: 500 !important; color: var(--fg-2) !important; }
.qr-meta strong { color: var(--fg) !important; font-weight: 700 !important; }
.ot-cd-val { font-size: 26px !important; }
.ot-cd-label { font-size: 12px !important; font-weight: 600 !important; color: var(--fg-2) !important; }
.stat-label { font-size: 11px !important; font-weight: 600 !important; }
.stat-value { font-size: 22px !important; color: var(--fg) !important; }
.mc-label { font-weight: 600 !important; font-size: 11px !important; }
.mc-value { font-size: 14px !important; font-weight: 700 !important; }
.ap-step-label { font-weight: 700 !important; font-size: 11px !important; color: var(--fg) !important; }
.ap-step-body { font-weight: 500 !important; font-size: 11px !important; color: var(--fg-2) !important; }
.dlc-ts, .dlc-task-type { font-size: 11px !important; font-weight: 500 !important; }
.dlc-k { font-weight: 600 !important; color: var(--fg-2) !important; }
.dlc-v { font-weight: 500 !important; color: var(--fg) !important; }
.dlc-reason { font-weight: 500 !important; font-size: 11px !important; color: var(--fg-2) !important; line-height: 1.65 !important; }
.mgn-nav-links a { font-weight: 600 !important; font-size: 14px !important; }
.tq-title { font-size: 11px !important; font-weight: 700 !important; }
.dash-hero-eyebrow { font-weight: 700 !important; }

/* Toggle button */
.theme-toggle-btn {
  font-weight: 600 !important;
  border: 1.5px solid var(--accent, #008CAB) !important;
  color: var(--accent, #008CAB) !important;
  background: rgba(0,140,171,0.06) !important;
}
