/* AEX — light efficiency console
   Industry-standard SaaS UX: clean density, soft surfaces, clear hierarchy.
   Inspired by modern ops / energy / data-platform tools. */

:root {
  /* Surfaces */
  --void: #f5f7fa;
  --bg: #f5f7fa;
  --bg-alt: #eef1f5;
  --panel: #ffffff;
  --panel2: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f4f8;

  /* Type */
  --ink: #0f172a;
  --text: #0f172a;
  --mute: #475569;
  --dim: #94a3b8;

  /* Borders */
  --line: #e8edf3;
  --line2: #d5dde8;

  /* Brand / semantic */
  --cyan: #0d9488;
  --cyan-d: #0f766e;
  --cyan-soft: #ccfbf1;
  --cyan-glow: rgba(13, 148, 136, 0.12);
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --green: #059669;
  --green-soft: #d1fae5;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-focus: 0 0 0 3px rgba(13, 148, 136, 0.18);

  /* Radius & layout */
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 14px;
  --r-pill: 999px;
  --max: 1180px;
  --gutter: clamp(16px, 2.8vw, 32px);
  --nav-h: 56px;

  /* Type stacks */
  --mono: "IBM Plex Mono", "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Soft ambient field — subtle mesh, not industrial grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(13, 148, 136, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 5%, rgba(37, 99, 235, 0.05), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(13, 148, 136, 0.04), transparent 50%),
    var(--bg);
}

#webgl {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: normal;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Concept status banner (overview honesty constraint) */
.status-banner {
  max-width: var(--max);
  margin: 16px auto 0;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--amber-soft), #fff);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  line-height: 1.5;
  color: var(--mute);
  font-weight: 500;
}
.status-banner .status-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .status-banner { margin-left: var(--gutter); margin-right: var(--gutter); }
}

a {
  color: var(--cyan-d);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── TOP NAV ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--nav-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: var(--shadow-xs);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--ink);
  min-width: 200px;
  flex-shrink: 0;
}

.nav-logo {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.nav-word { display: flex; flex-direction: column; gap: 1px; }
.nav-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--ink);
}
.nav-brand .sub {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.2;
  font-weight: 500;
}

.nav-links {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 0;
}

.nav-links button,
.nav-links a.btn-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--mute);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  border-radius: var(--r-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links button:hover,
.nav-links a.btn-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-links button.active {
  color: var(--cyan-d);
  background: var(--cyan-soft);
  box-shadow: none;
  font-weight: 600;
}

.nav-links a.btn-link {
  color: var(--mute);
  border: 1px solid var(--line2);
  margin-left: 4px;
}
.nav-links a.btn-link:hover {
  border-color: var(--dim);
  color: var(--ink);
  background: var(--panel);
}

/* ─── VIEW SHELL ─── */
.view { animation: fadeIn 0.25s ease; }
.view::before { display: none; }
.view > * { position: relative; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.hidden { display: none !important; }

/* ─── HERO ─── */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) var(--gutter) clamp(20px, 3vw, 28px);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.hero > div:first-child {
  padding: 8px 4px 8px 0;
  border: 0;
  position: relative;
}

.hero > div:first-child::before { display: none; }

.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan-d);
  margin: 0 0 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--cyan);
  border-radius: 1px;
}

.hero h1,
.section h2,
.console-header h2 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 14px;
  color: var(--ink);
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  max-width: 16ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--cyan-d);
  font-weight: 700;
  background: linear-gradient(180deg, transparent 62%, var(--cyan-soft) 62%);
}

.lede,
.section .sub {
  color: var(--mute);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 40rem;
  margin: 0 0 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

/* ─── BUTTONS ─── */
.btn,
button.btn {
  appearance: none;
  font-family: var(--sans);
  font-size: 13.5px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid transparent;
  background: var(--cyan);
  color: #fff;
  cursor: pointer;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
  box-shadow: var(--shadow-sm);
  line-height: 1.25;
}

.btn:hover {
  background: var(--cyan-d);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line2);
  margin-left: 0;
  box-shadow: var(--shadow-xs);
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: var(--dim);
  background: var(--panel2);
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── STAT STRIP ─── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border: 0;
  background: transparent;
}

.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--line2);
}

.stat:last-child { border-right: 1px solid var(--line); }

.stat .v {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--cyan-d);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat .l {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--dim);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 6px;
  line-height: 1.35;
  font-weight: 500;
}

.stat-src {
  display: inline;
  color: var(--cyan);
  margin-top: 0;
  margin-left: 4px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── HERO INSTRUMENT CARD ─── */
.hero-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.hero-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mute);
  background: var(--panel2);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.meter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  flex: 1;
}

.meter {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 16px;
  background: transparent;
}

.meter:nth-child(2n) { border-right: 0; }
.meter:nth-child(n+3) { border-bottom: 0; }

.meter .label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
  font-weight: 600;
}

.meter .val {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bar {
  height: 4px;
  background: var(--bg-alt);
  margin-top: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), #14b8a6);
  border-radius: var(--r-pill);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.notice {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 0;
  background: rgba(13, 148, 136, 0.04);
  padding: 12px 14px;
  color: var(--mute);
  font-size: 0.88rem;
  line-height: 1.55;
}

.notice.cyan { border-left-color: var(--cyan); }
.notice strong { color: var(--ink); }

/* ─── SECTIONS ─── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) var(--gutter);
  border: 0;
  background: transparent;
}

.section h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  margin: 0 0 8px;
  padding-left: 0;
  border-left: 0;
  letter-spacing: -0.025em;
}

.section .sub { margin-bottom: 20px; padding-left: 0; }

/* ─── CARDS / GRIDS ─── */
.grid-3,
.grid-2,
.not-grid {
  display: grid;
  gap: 14px;
  border: 0;
  background: transparent;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 860px) {
  .grid-3, .grid-2, .stat-strip, .meter-grid { grid-template-columns: 1fr; }
  .stat { border-right: 1px solid var(--line); }
  .meter { border-right: 0; border-bottom: 1px solid var(--line); }
  .meter:last-child { border-bottom: 0; }
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  padding: 18px 18px;
  min-height: 0;
  display: block;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--line2);
  transform: translateY(-1px);
}

.grid-3 .card:last-child,
.grid-2 .card:last-child { border-right: 1px solid var(--line); }

.card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.card p, .card li {
  color: var(--mute);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.card ul { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.card li + li { margin-top: 0.35rem; }

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cyan-d);
  border: 0;
  border-bottom: 0;
  background: var(--cyan-soft);
  padding: 3px 9px;
  margin-bottom: 12px;
  border-radius: var(--r-pill);
  font-weight: 650;
}

/* ─── PROCESS TRACK ─── */
.process-track {
  display: grid;
  gap: 12px;
  border: 0;
}

.process-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 16px;
  align-items: start;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.process-step:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--line2);
}

.process-step:last-child { border-bottom: 1px solid var(--line); }

.process-num {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan-d);
  border: 0;
  background: var(--cyan-soft);
  margin-top: 2px;
}

.process-step > div { padding: 0; }

.process-step h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.process-step p {
  margin: 0;
  color: var(--mute);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ─── LAYERS ─── */
.layers {
  display: grid;
  gap: 8px;
  border: 0;
}

.layer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.layer:last-child { border-bottom: 1px solid var(--line); }
.layer:hover {
  background: var(--panel2);
  border-color: var(--line2);
  box-shadow: var(--shadow-sm);
}

.layer .num {
  font-family: var(--mono);
  color: var(--cyan-d);
  font-size: 12px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-soft);
  border-radius: var(--r-sm);
}

.layer .name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.layer .desc {
  color: var(--mute);
  font-size: 0.85rem;
  margin-top: 2px;
  line-height: 1.45;
}

.layer .status {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-soft);
  border: 0;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  font-weight: 650;
}

.layer .status.live {
  color: var(--cyan-d);
  border: 0;
  background: var(--cyan-soft);
}

.layer .btn,
.layer .btn.ghost {
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
}

/* ─── CLARITY ─── */
.clarity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
}

.clarity-item {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mute);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  line-height: 1.35;
  box-shadow: var(--shadow-xs);
  font-weight: 500;
}

.clarity-item:last-child { border-right: 1px solid var(--line); }
.clarity-item strong {
  color: var(--red);
  font-weight: 650;
  margin-right: 6px;
}

/* ─── CONSOLE ─── */
.console-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0 48px;
  border: 0;
  background: transparent;
}

.console-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin: 0 var(--gutter);
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.console-header .sub { margin: 0; max-width: 36rem; color: var(--mute); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.actions .btn { margin: 0; }
.actions .btn + .btn { margin-left: 0; }

.howto-banner {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.06), rgba(37, 99, 235, 0.04));
  padding: 12px 16px;
  margin: 14px var(--gutter) 0;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--mute);
  font-weight: 500;
}

/* Pipeline rail */
.pipe-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 14px var(--gutter) 0;
  border: 0;
  background: transparent;
}

.pipe-step {
  flex: 1 1 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--sans);
  min-width: 90px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pipe-step:last-of-type { border-right: 1px solid var(--line); }

.pipe-conn { display: none; }

.pipe-idx {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  font-family: var(--mono);
}

.pipe-name {
  font-size: 13px;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 600;
}

.pipe-state {
  font-size: 11px;
  color: var(--dim);
  text-transform: none;
  font-weight: 500;
}

.pipe-step.done {
  border-color: rgba(13, 148, 136, 0.35);
  background: linear-gradient(180deg, #fff, rgba(204, 251, 241, 0.35));
}
.pipe-step.done .pipe-state,
.pipe-step.done .pipe-name { color: var(--cyan-d); }
.pipe-step.active {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.pipe-step.active .pipe-state { color: var(--blue); }
.pipe-step.warn .pipe-state { color: var(--amber); }
.pipe-step.fail {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(180deg, #fff, rgba(254, 226, 226, 0.4));
}
.pipe-step.fail .pipe-state { color: var(--red); }

.console-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 12px var(--gutter) 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--mute);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  font-weight: 500;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  margin-right: 6px;
  vertical-align: middle;
}
.dot.ok { background: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-glow); }
.dot.fail { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); }
.dot.idle { background: var(--dim); }

.mono-meta {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

/* KPI tiles */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  margin: 14px var(--gutter) 0;
  border: 0;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--panel);
  min-width: 0;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kpi:hover {
  border-color: var(--line2);
  box-shadow: var(--shadow-sm);
}

.kpi.empty {
  opacity: 0.85;
}

.kpi .k {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
}

.kpi .n {
  font-family: var(--mono);
  font-size: 1.1rem;
  margin-top: 6px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi .n.good { color: var(--green); }
.kpi .n.amber { color: var(--amber); }
.kpi .n.bad { color: var(--red); }
.kpi .n.muted { color: var(--dim); }

.kpi-hint {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
  font-weight: 500;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px var(--gutter) 0;
  margin: 0;
  background: transparent;
}

.tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--mute);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 10px 14px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  position: relative;
}

.tabs button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.tabs button.active {
  color: var(--cyan-d);
  background: var(--panel);
  box-shadow: none;
  border: 1px solid var(--line);
  border-bottom-color: var(--panel);
  margin-bottom: -1px;
  font-weight: 650;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 18px 20px;
  margin: 12px var(--gutter) 0;
  box-shadow: var(--shadow-xs);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--mute);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-tag {
  font-family: var(--sans);
  font-size: 10px;
  color: #fff;
  background: var(--cyan);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  letter-spacing: 0.03em;
  font-weight: 650;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--mute);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  min-width: 0;
}

input, select, textarea {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 11px;
  width: 100%;
  min-height: 38px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:hover, select:hover, textarea:hover {
  border-color: var(--dim);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  background: #fff;
  box-shadow: var(--shadow-focus);
}

textarea { min-height: 96px; resize: vertical; }

.out {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--r-sm);
  padding: 14px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.out .ok { color: #2dd4bf; }
.out .warn { color: #fbbf24; }
.out .bad { color: #f87171; }
.out .key { color: #5eead4; }

.empty-out .empty-title {
  display: block;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 600;
}

.empty-out .empty-body { color: #64748b; }

/* Tables */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--panel);
}

table.data th, table.data td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data tr:last-child td { border-bottom: 0; }

table.data th {
  color: var(--mute);
  font-weight: 650;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--panel2);
  font-family: var(--sans);
}

table.data td {
  color: var(--mute);
  font-family: var(--mono);
  font-size: 12px;
}

table.data tr:hover td {
  background: rgba(13, 148, 136, 0.04);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: var(--sans);
  font-weight: 650;
}

.badge.issued {
  color: var(--cyan-d);
  background: var(--cyan-soft);
}
.badge.retired {
  color: var(--mute);
  background: var(--surface-2);
}
.badge.conditional {
  color: #b45309;
  background: var(--amber-soft);
}
.badge.reject {
  color: var(--red);
  background: var(--red-soft);
}

.footer {
  max-width: var(--max);
  margin: 24px auto 32px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: var(--dim);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
  font-weight: 500;
}

.footer strong { color: var(--ink); font-weight: 650; }

.text-link {
  display: inline;
  background: none;
  border: none;
  color: var(--cyan-d);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.text-link:hover { color: var(--ink); }

.depth-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.depth-nav .btn { margin-left: 0; }
.depth-nav .btn:first-child { margin-left: 0; }

.setup-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  color: var(--mute);
  font-size: 0.9rem;
  line-height: 1.55;
}
.setup-list li + li { margin-top: 0.4rem; }
.setup-list strong { color: var(--ink); font-weight: 650; }
ol.setup-list { list-style: decimal; }

/* Baseline compare bars */
.baseline-compare {
  display: grid;
  gap: 12px;
}
.bc-row {
  display: grid;
  grid-template-columns: 72px 1fr 100px;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
}
.bc-l {
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10.5px;
  font-weight: 650;
  font-family: var(--sans);
}
.bc-track {
  height: 10px;
  border: 0;
  background: var(--bg-alt);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bc-track i { display: block; height: 100%; min-width: 0; border-radius: var(--r-pill); }
.bc-track.base i { background: linear-gradient(90deg, #93c5fd, var(--blue)); }
.bc-track.actual i { background: linear-gradient(90deg, #5eead4, var(--cyan)); }
.bc-track.saved i { background: linear-gradient(90deg, #6ee7b7, var(--green)); }
.bc-v { text-align: right; color: var(--ink); font-weight: 600; }
.bc-v.good { color: var(--green); }
.bc-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.5;
}
.bc-note b { color: var(--ink); font-weight: 650; }

.evidence-actions { margin: 0.5rem 0 0.85rem; }
.evidence-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.evidence-meta .mm {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: var(--r-sm);
}
.evidence-meta .mm-l {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 650;
}
.evidence-meta .mm-v {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  margin-top: 4px;
  color: var(--ink);
  word-break: break-all;
  font-weight: 500;
}
.evidence-meta .mm-v.good { color: var(--green); }
.evidence-meta .mm-v.bad { color: var(--red); }
.evidence-meta .mm-v.amber { color: var(--amber); }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Boundary scope rail + component energy bars */
.bound-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.bound-chip {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  padding: 6px 11px;
  border: 1px solid var(--line2);
  color: var(--mute);
  background: var(--panel2);
  border-radius: var(--r-pill);
  font-weight: 550;
}
.bound-chip.on {
  color: var(--cyan-d);
  border-color: transparent;
  background: var(--cyan-soft);
  box-shadow: none;
  font-weight: 650;
}
.bound-chip.off {
  color: var(--dim);
  opacity: 0.7;
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.5);
}

.measure-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.measure-meta.empty-meta .mm-v { color: var(--dim); }
.measure-meta .mm {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--panel2);
  border-radius: var(--r-sm);
}
.measure-meta .mm-l {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 650;
}
.measure-meta .mm-v {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  margin-top: 4px;
  color: var(--ink);
  word-break: break-word;
  font-weight: 600;
}
.measure-meta .mm-v.good { color: var(--green); }
.measure-meta .mm-v.bad { color: var(--red); }

.comp-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}
.comp-row {
  display: grid;
  grid-template-columns: 88px 1fr 64px 36px;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
}
.comp-row.out { opacity: 0.5; }
.comp-name { color: var(--mute); font-family: var(--sans); font-weight: 500; }
.comp-track {
  height: 8px;
  background: var(--bg-alt);
  border: 0;
  border-radius: var(--r-pill);
  position: relative;
  overflow: hidden;
}
.comp-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5eead4, var(--cyan));
  min-width: 0;
  border-radius: var(--r-pill);
}
.comp-row.out .comp-track i {
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
}
.comp-val { text-align: right; color: var(--ink); font-weight: 600; }
.comp-flag {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  border: 0;
  padding: 3px 0;
  color: var(--dim);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-weight: 650;
  font-family: var(--sans);
}
.comp-row.in .comp-flag {
  color: var(--cyan-d);
  background: var(--cyan-soft);
}

.dim-bars { display: grid; gap: 10px; margin-top: 10px; }
.dim-row {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr 40px;
  gap: 8px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
}
.dim-row span { color: var(--mute); font-family: var(--sans); font-weight: 500; }
.dim-row b { color: var(--ink); text-align: right; font-weight: 650; }
.dim-row .bar {
  height: 6px;
  margin-top: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--cyan-d);
  background: var(--cyan-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 0;
  font-weight: 500;
}

.not-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
  min-height: 0;
}
.not-card h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: var(--red);
  font-weight: 650;
}
.not-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mute);
  line-height: 1.5;
}

.console-shell .tab-panel .panel:last-child {
  margin-bottom: 8px;
}

/* Registry filter row spacing if present */
#warnings {
  margin: 12px var(--gutter) 0;
}

/* ─── Responsive ─── */
@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
  }
  .nav-brand {
    min-width: 0;
    padding: 12px var(--gutter);
    border-bottom: 1px solid var(--line);
  }
  .nav-links {
    justify-content: flex-start;
    padding: 8px var(--gutter);
    gap: 2px;
  }
  .nav-links button,
  .nav-links a.btn-link {
    padding: 8px 10px;
    font-size: 12.5px;
  }
  .process-step { grid-template-columns: 40px 1fr; }
  .layer {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .layer .status,
  .layer .btn {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
  }
  .hero { padding-top: 20px; }
  .console-header,
  .howto-banner,
  .console-meta,
  .kpi-row,
  .panel,
  .pipe-rail,
  .tabs {
    margin-left: var(--gutter);
    margin-right: var(--gutter);
  }
  .pipe-rail { padding-left: 0; padding-right: 0; }
  .tabs { padding-left: 0; padding-right: 0; }
  .kpi-row { margin-left: var(--gutter); margin-right: var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .bar > i { transition: none; }
  .view { animation: none; }
  .btn:hover,
  .card:hover,
  .process-step:hover { transform: none; }
}

/* Selection + scrollbars */
::selection {
  background: rgba(13, 148, 136, 0.18);
  color: var(--ink);
}

.out::-webkit-scrollbar,
body::-webkit-scrollbar { width: 10px; height: 10px; }
.out::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 6px;
}
body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}
body::-webkit-scrollbar-track { background: transparent; }
