/* ============================================================
   Mission Control — futuristic HUD theme
   Deep-space base, neon accents, glassmorphic panels, scanlines.
   ============================================================ */

:root {
  /* Base */
  /* Tuned to the map's ocean tone so the page reads as one surface where the map
     doesn't reach (page edges, overscroll, loading screen). */
  --void: #0a1434;
  --deep: #0c1840;
  /* Fairly opaque: panels sit over the background map and must stay readable. */
  --panel: rgba(13, 18, 38, 0.84);
  --panel-solid: #0d1226;
  --line: rgba(120, 190, 255, 0.14);
  --line-hot: rgba(0, 229, 255, 0.5);

  /* Neon */
  --cyan: #00e5ff;
  --violet: #a855f7;
  --mint: #00ffa3;
  --amber: #ffb340;
  --rose: #ff4d7d;
  --blue: #4d8dff;

  /* Text */
  --text: #dbe7ff;
  --muted: #6f7fa6;

  --radius: 16px;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--void);
}

/* body must NOT paint a background: negative/low z-index layers behind it would be
   covered, because in-flow block backgrounds paint after them. That bug hid the map. */
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

/* ---- Background map (decorative) ----
   Layer order is all positive: map 0 → veil 1 → grid 2 → content 10 → bars 20.
   Nothing uses a negative z-index, which is what let body's background hide the map. */
.map-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.map-bg img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 165%;
  min-width: 1100px;
  /* Shifted left of centre so India (≈78°E) sits in frame rather than off the right edge. */
  transform: translate(-64%, -50%);
  opacity: 0.9;
  filter: saturate(1.3) brightness(1.15) drop-shadow(0 0 30px rgba(0, 229, 255, 0.3));
  animation: mapdrift 60s ease-in-out infinite alternate;
}

/* Veil: aurora wash + vignette so panels stay readable over the map */
.map-veil {
  position: fixed;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(45% 40% at 16% 10%, rgba(0, 229, 255, 0.14), transparent 60%),
    radial-gradient(42% 38% at 84% 16%, rgba(168, 85, 247, 0.16), transparent 62%),
    radial-gradient(55% 48% at 55% 95%, rgba(0, 255, 163, 0.09), transparent 66%),
    /* Gentle vignette only — heavier than this and the map disappears entirely. */
    radial-gradient(140% 100% at 50% 45%, transparent 55%, rgba(6, 11, 32, 0.35) 85%, rgba(6, 11, 32, 0.6) 100%);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes mapdrift {
  0%   { transform: translate(-64%, -50%) scale(1); }
  100% { transform: translate(-65%, -49%) scale(1.06); }
}

/* ---- Grid + scanline overlay ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 190, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 255, 0.045) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  background-size: 46px 46px, 46px 46px, 100% 3px;
  mask-image: radial-gradient(120% 90% at 50% 20%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 20%, #000 35%, transparent 100%);
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.05); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}

.muted { color: var(--muted); }
.small { font-size: 11px; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   Login
   ============================================================ */
.login-body { min-height: 100vh; display: grid; place-items: center; }

.login-card {
  position: relative;
  width: min(380px, 90vw);
  padding: 40px 32px 34px;
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.06),
    0 24px 70px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* Neon top edge */
.login-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  box-shadow: 0 0 14px var(--cyan);
}

.login-mark {
  font-size: 40px;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(0, 229, 255, 0.75);
  animation: pulse 3.2s ease-in-out infinite;
}
.login-card h1 {
  margin: 10px 0 4px;
  font-size: 20px;
  font-family: var(--mono);
  letter-spacing: 5px;
  text-transform: uppercase;
}
.login-card > .muted { font-size: 12px; letter-spacing: 1px; }
.login-card form { margin-top: 26px; display: grid; gap: 14px; }

.login-card input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text);
  background: rgba(4, 8, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.login-card input::placeholder { color: var(--muted); letter-spacing: 1px; }
.login-card input:focus {
  outline: none;
  border-color: var(--line-hot);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12), 0 0 22px rgba(0, 229, 255, 0.18);
}

.login-card button {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--void);
  background: linear-gradient(135deg, var(--cyan), var(--blue) 55%, var(--violet));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, filter 0.2s;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.28);
}
.login-card button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.45);
}
.login-card button:disabled { opacity: 0.55; cursor: default; }

.form-error { margin: 2px 0 0; font-size: 12px; color: var(--rose); font-family: var(--mono); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 22px rgba(0, 229, 255, 0.75); }
  50%      { opacity: 0.75; text-shadow: 0 0 34px rgba(0, 229, 255, 0.95); }
}

/* ============================================================
   Top bar
   ============================================================ */
/* Both bars stick as one unit, so their heights can't drift apart and leave a seam. */
.header-stack { position: sticky; top: 0; z-index: 20; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.55), rgba(168, 85, 247, 0.4), transparent);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.crumb-sep { color: var(--muted); opacity: 0.5; }
.crumb {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  white-space: nowrap;
}

.chip {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 20, 0.55);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  white-space: nowrap;
}
.chip.mono { font-family: var(--mono); }
.chip.up   { color: var(--mint); border-color: rgba(0, 255, 163, 0.3); }
.chip.down { color: var(--rose); border-color: rgba(255, 77, 125, 0.3); }

/* The NSE-open chip breathes so it's obvious at a glance that the prices on screen
   are being re-polled, rather than a snapshot from whenever the page was opened. */
.chip.live-dot { animation: chip-pulse 2.4s ease-in-out infinite; }
@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 163, 0); }
  50%      { box-shadow: 0 0 16px rgba(0, 255, 163, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .chip.live-dot { animation: none; }
}

/* ============================================================
   Tab bar
   ============================================================ */
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 26px;
  background: rgba(5, 8, 18, 0.6);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 8px; }

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(4, 8, 20, 0.5);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: color 0.22s, border-color 0.22s, background 0.22s, box-shadow 0.28s;
}
.tab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  transition: opacity 0.22s, box-shadow 0.28s;
}
.tab-sub {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: none;
  opacity: 0.55;
}
.tab:hover { color: var(--text); border-color: rgba(0, 229, 255, 0.3); }
.tab.is-active {
  color: var(--void);
  background: linear-gradient(135deg, var(--cyan), var(--blue) 60%, var(--violet));
  border-color: transparent;
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.35);
}
.tab.is-active .tab-dot { opacity: 1; box-shadow: 0 0 9px currentColor; }
.tab.is-active .tab-sub { opacity: 0.7; }

/* ---- Panels ---- */
.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fadeIn 0.35s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.brand-mark {
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.8);
  animation: pulse 3.2s ease-in-out infinite;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 20, 0.6);
  color: var(--muted);
  white-space: nowrap;
  cursor: help;
}
.pill::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: middle;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: blink 2s ease-in-out infinite;
}
.pill.live    { color: var(--mint);  border-color: rgba(0, 255, 163, 0.35); }
.pill.mock    { color: var(--amber); border-color: rgba(255, 179, 64, 0.35); }
.pill.partial { color: var(--cyan);  border-color: rgba(0, 229, 255, 0.35); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ghost-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 7px 13px;
  color: var(--muted);
  background: rgba(4, 8, 20, 0.5);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.ghost-btn:hover {
  color: var(--cyan);
  border-color: var(--line-hot);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.22);
}
/* Setup gear: larger glyph, and lit up while its panel is open. */
#setup-btn { font-size: 15px; padding: 6px 10px; line-height: 1; }
#setup-btn.is-active {
  color: var(--cyan);
  border-color: var(--line-hot);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.3);
}

/* ============================================================
   Layout
   ============================================================ */
/* Content sits above the map/veil/grid layers. */
.container { position: relative; z-index: 10; max-width: 1280px; margin: 0 auto; padding: 30px 26px 70px; }
.section { margin-bottom: 52px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Glowing rule trailing each section title */
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), transparent);
}

/* ---- Stat tiles ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  position: relative;
  padding: 16px 16px 15px;
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.3s;
}
/* Accent bar down the left edge */
.stat::before {
  content: "";
  position: absolute;
  top: 12px; bottom: 12px; left: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}
.stat:hover {
  transform: translateY(-3px);
  border-color: var(--line-hot);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(0, 229, 255, 0.14);
}
.stat .label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.stat .value {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(120, 190, 255, 0.3);
}
.stat .sub { margin-top: 5px; font-size: 11px; font-family: var(--mono); }

.up   { color: var(--mint); }
.down { color: var(--rose); }
.stat .value.up   { text-shadow: 0 0 26px rgba(0, 255, 163, 0.4); }
.stat .value.down { text-shadow: 0 0 26px rgba(255, 77, 125, 0.4); }

/* ---- Cards ---- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card {
  position: relative;
  min-width: 0;
  padding: 20px;
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: border-color 0.25s, box-shadow 0.3s;
}
/* HUD corner brackets */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1.5px solid var(--cyan);
  opacity: 0.5;
  transition: opacity 0.25s;
  pointer-events: none;
}
.card::before { top: 9px;  left: 9px;  border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.card::after  { bottom: 9px; right: 9px; border-left: none;  border-top: none;    border-radius: 0 0 4px 0; }
.card:hover { border-color: var(--line-hot); box-shadow: 0 20px 54px rgba(0,0,0,0.55), 0 0 30px rgba(0,229,255,0.12); }
.card:hover::before, .card:hover::after { opacity: 1; }

.card h3 {
  margin: 0 0 15px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text);
}
.card h3 .muted { letter-spacing: 1px; text-transform: none; }
.badge {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 8.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(255, 179, 64, 0.1);
  border: 1px solid rgba(255, 179, 64, 0.3);
  white-space: nowrap;
}
.card canvas { width: 100% !important; height: 224px !important; }

.span-2 { grid-column: span 2; }

/* Staggered entrance */
.stat:nth-child(1), .card:nth-child(1) { animation-delay: 0.02s; }
.stat:nth-child(2), .card:nth-child(2) { animation-delay: 0.07s; }
.stat:nth-child(3), .card:nth-child(3) { animation-delay: 0.12s; }
.stat:nth-child(4), .card:nth-child(4) { animation-delay: 0.17s; }
.stat:nth-child(5), .card:nth-child(5) { animation-delay: 0.22s; }
.card:nth-child(6) { animation-delay: 0.27s; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 8px; border-bottom: 1px solid rgba(120, 190, 255, 0.08); text-align: left; }
th {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}
td strong { font-family: var(--mono); letter-spacing: 0.5px; }
tbody tr { transition: background 0.18s; }
tbody tr:hover { background: rgba(0, 229, 255, 0.05); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Inline notes ---- */
.form-note { margin: 0; font-family: var(--mono); font-size: 11px; }
.form-note.ok  { color: var(--mint); }
.form-note.bad { color: var(--rose); }

.span-4 { grid-column: span 4; }

.hint {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.hint code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
}
.inline-btn { margin-left: 10px; padding: 4px 10px; font-size: 9.5px; vertical-align: middle; }

/* ---- Diagnostics ---- */
.diag-list { display: grid; gap: 10px; }
.diag {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  background: rgba(4, 8, 20, 0.45);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.diag-dot {
  width: 8px; height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
  box-shadow: 0 0 10px currentColor;
}
.diag-ok      .diag-dot { background: var(--mint); color: var(--mint); }
.diag-error   .diag-dot { background: var(--rose); color: var(--rose); }
.diag-missing .diag-dot { background: var(--amber); color: var(--amber); }
.diag-body { flex: 1; min-width: 0; }
.diag-name { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; }
.diag-detail { margin-top: 4px; font-size: 12.5px; color: var(--text); word-break: break-word; }
.diag-hint { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.diag-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
}
.diag-ok      .diag-status { color: var(--mint);  border-color: rgba(0, 255, 163, 0.3); }
.diag-error   .diag-status { color: var(--rose);  border-color: rgba(255, 77, 125, 0.3); }
.diag-missing .diag-status { color: var(--amber); border-color: rgba(255, 179, 64, 0.3); }

.disclaimer {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--muted);
  opacity: 0.75;
}

/* ============================================================
   Loading
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--void);
  transition: opacity 0.5s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.boot { display: grid; justify-items: center; gap: 20px; }
.boot-text {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--muted);
  animation: blink 1.8s ease-in-out infinite;
}
.spinner {
  width: 46px; height: 46px;
  border: 2px solid rgba(120, 190, 255, 0.12);
  border-top-color: var(--cyan);
  border-right-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.35);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .span-2, .span-4 { grid-column: span 2; }
}
@media (max-width: 620px) {
  .container { padding: 22px 15px 56px; }
  .grid { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: span 1; }

  /* The full control cluster can't fit 375px — drop the at-a-glance extras and
     keep the actions. The breadcrumb is redundant with the tab bar here. */
  .topbar { padding: 11px 15px; gap: 8px; }
  .topbar-right { gap: 7px; }
  .crumb, .crumb-sep, #updated, #tab-meta { display: none; }
  .brand { font-size: 11px; letter-spacing: 2.5px; }
  .pill { font-size: 9px; padding: 4px 9px; }
  .ghost-btn { font-size: 10px; padding: 6px 9px; }

  .tabbar { padding: 10px 15px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 9px 10px; font-size: 11px; letter-spacing: 1.2px; }
  .tab-sub { display: none; }

  .stat-row { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
  .stat .value { font-size: 21px; }
  .card canvas { height: 200px !important; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
