/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg: #07090e;
  --panel: rgba(17, 24, 39, 0.75);
  --panel2: rgba(26, 35, 52, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);

  --text: #f8fafc;
  --muted: #94a3b8;
  --gray: #64748b;

  --brand: #3d2416;
  --brand-hi: #7a5236;
  --brand-lo: #26160d;
  --paper: #f7f3eb;
  --paper-deep: #efe6d6;
  --ink: #1a120c;
  --ink-soft: #4a3a30;
  --mud: #3d2416;
  --gold: #f2b400;
  --moss: #1b3b2f;

  --cyan: #22d3ee;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --green: #34d399;
  --blue: #60a5fa;
  --red: #f87171;
  --teal: #2dd4bf;
  --orange: #fb923c;
  --sky: #7dd3fc;
  --pink: #f472b6;
  --indigo: #818cf8;
  --lime: #a3e635;
  --fuchsia: #e879f9;

  --radius: 12px;
  --radius-sm: 8px;
  --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glow-brand: none;
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-title, .nav-section-title {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

h2 { font-size: 16px; font-weight: 700; color: var(--text); }
h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 12px 0 8px; }
h4 { font-size: 13px; font-weight: 600; color: var(--text); }
p { color: var(--muted); font-size: 12.5px; }
.sub { color: var(--muted); font-size: 11.5px; }
code { color: var(--blue); font-family: Consolas, 'Cascadia Mono', monospace; font-size: 11.5px; }
a { color: var(--sky); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============================================================
   Top bar
   ============================================================ */
.app-topbar {
  min-height: 64px;
  height: auto;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 18px;
  background: var(--paper);
  border-bottom: 1px solid rgba(61, 36, 22, 0.22);
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.brand-copy { min-width: 0; overflow: hidden; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  background: var(--mud);
  border: 1px solid var(--mud);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  font-weight: 800;
  font-size: 15px;
}
.brand-title {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.brand-sub {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.top-controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; position: relative; z-index: 2; background: var(--paper); }

.app-topbar .btn {
  background: var(--paper);
  border: 1px solid rgba(61, 36, 22, 0.35);
  color: var(--ink);
}
.app-topbar .btn:hover {
  border-color: var(--mud);
  background: var(--paper-deep);
}
.app-topbar .btn.active {
  background: var(--mud);
  border-color: var(--mud);
  color: var(--paper);
  box-shadow: none;
}
.app-topbar .clock,
.app-topbar .pill {
  flex: none;
  min-width: max-content;
  white-space: nowrap;
  color: var(--ink);
  border-color: rgba(61, 36, 22, 0.22);
  background: var(--paper-deep);
}
.app-topbar .pill b { color: #3d2416; }
.app-topbar .health-pill.health-ok {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(52, 211, 153, 0.12);
}
.app-topbar .health-pill.health-warn {
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(251, 191, 36, 0.14);
}
.app-topbar .health-pill.health-bad {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(248, 113, 113, 0.12);
}

.btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.06);
}
.btn.active {
  background: var(--mud);
  border-color: var(--mud);
  color: var(--paper);
  box-shadow: none;
}
.btn:disabled { opacity: 0.45; cursor: default; }
select.btn { appearance: auto; cursor: pointer; padding: 6px 10px; }
select {
  appearance: auto;
  background: #ffffff;
  border: 1px solid rgba(3, 3, 184, 0.24);
  color: #3d2416;
  border-radius: 8px;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
select option { background: #ffffff; color: #3d2416; }
.app-topbar select.btn {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.60);
  color: #3d2416;
}
.app-topbar select.btn:hover {
  background: #f1f5ff;
  border-color: rgba(3, 3, 184, 0.40);
}
.app-topbar select.btn option { background: #ffffff; color: #3d2416; }
.btn-mini { padding: 3px 9px; font-size: 11px; margin-left: 8px; vertical-align: middle; }
.btn-kill { border-color: rgba(248, 113, 113, 0.45); color: var(--red); }
.btn-kill:hover { background: rgba(248, 113, 113, 0.1); border-color: var(--red); }

.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.pill b.bad { color: var(--red); }

.health-pill.health-ok { color: var(--green); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.health-pill.health-warn { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.health-pill.health-bad { color: var(--red); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.banner {
  flex: none;
  background: rgba(204, 0, 0, 0.1);
  border: 1px solid rgba(204, 0, 0, 0.35);
  color: #ffc9c9;
  font-size: 12px;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 10px 14px 0;
}
.banner[hidden] { display: none; }

/* ============================================================
   Sidebar
   ============================================================ */
.app-body { flex: 1; min-height: 0; display: flex; position: relative; overflow: hidden; }

.app-sidebar {
  width: 220px;
  flex: none;
  border-right: 1px solid rgba(247, 243, 235, 0.16);
  background: #26160d;
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 3px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #d08a55;
  margin: 14px 8px 4px;
}
.nav-section-title:first-child { margin-top: 2px; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  position: relative;
  transition: all 0.15s ease;
}
.nav-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.10); }
.nav-btn.active {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper);
  font-weight: 600;
}
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
}
.nav-btn svg { flex: none; }
.nav-btn em {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 1px 6px;
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
}
.nav-btn em.bad { color: var(--red); border-color: rgba(248, 113, 113, 0.4); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.18); display: flex; flex-direction: column; gap: 6px; }
.status-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.74); }
.status-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); flex: none; }
.status-row .dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.status-row .dot.warn { background: var(--amber); box-shadow: 0 0 6px rgba(251, 191, 36, 0.6); }
.status-row .dot.bad { background: var(--red); box-shadow: 0 0 6px rgba(248, 113, 113, 0.7); }
.status-row em { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; color: #ffffff; }

/* ============================================================
   Main workspace, panels
   ============================================================ */
.app-main { flex: 1; min-width: 0; padding: 16px; overflow: hidden; position: relative; background: var(--paper); color: var(--ink); --panel: #fbf8f2; --panel2: var(--paper-deep); --border: rgba(61, 36, 22, 0.16); --border-hi: rgba(61, 36, 22, 0.32); --text: var(--ink); --muted: var(--ink-soft); --gray: #7a5236; }
.tab-panel { height: 100%; min-height: 0; }
.tab-panel[hidden] { display: none !important; }

.panel {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.2s ease;
}
.panel:hover { border-color: var(--border-hi); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel.scroll { height: 100%; overflow: auto; }
.whatif-panel { margin-top: 12px; }
.whatif-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.table-responsive { overflow-x: auto; }

/* ============================================================
   Flow view layout
   ============================================================ */
.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; height: 100%; min-height: 0; color: #f8fafc; --panel: rgba(17, 24, 39, 0.75); --panel2: rgba(26, 35, 52, 0.6); --border: rgba(255, 255, 255, 0.08); --border-hi: rgba(255, 255, 255, 0.16); --text: #f8fafc; --muted: #94a3b8; --gray: #64748b; }
.diagram-panel { display: flex; flex-direction: column; min-height: 0; }

.outage-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  animation: outagePulse 2.2s ease-in-out infinite;
}
.outage-banner[hidden] { display: none; }
.outage-banner .ob-main { font-weight: 600; color: var(--text); }
.outage-banner .ob-title { font-weight: 700; }
.outage-banner .ob-desc { color: var(--muted); }
.outage-banner .ob-ico { font-size: 16px; }
.outage-banner.sev-critical { border-color: rgba(248, 113, 113, 0.55); background: rgba(248, 113, 113, 0.12); }
.outage-banner.sev-high { border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.08); animation: none; }
.outage-banner.sev-medium { border-color: rgba(125, 211, 252, 0.4); background: rgba(125, 211, 252, 0.06); animation: none; }
@keyframes outagePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(248, 113, 113, 0); }
  50% { box-shadow: 0 0 18px rgba(248, 113, 113, 0.25); }
}

.power-bar-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 2px 0 6px; text-transform: uppercase; }
.power-bar-head .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
.power-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.pchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(52, 211, 153, 0.8); flex: none; }
.pchip:hover { border-color: var(--border-hi); background: rgba(255, 255, 255, 0.06); }
.pchip.off { color: var(--red); border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); text-decoration: line-through; }
.pchip.off::before { background: var(--red); box-shadow: 0 0 6px rgba(248, 113, 113, 0.8); }
.pchip.cascade { color: var(--amber); border-color: rgba(251, 191, 36, 0.45); background: rgba(251, 191, 36, 0.07); }
.pchip.cascade::before { background: var(--amber); box-shadow: 0 0 6px rgba(251, 191, 36, 0.8); }
.pchip.degrade { color: var(--sky); border-color: rgba(125, 211, 252, 0.35); }
.pchip.degrade::before { background: var(--sky); box-shadow: 0 0 6px rgba(125, 211, 252, 0.7); }

.chaos-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  background:
    radial-gradient(1200px 600px at 50% 0%, #151d2a 0%, #07090e 80%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, 0.02) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.02) 39px 40px);
}
canvas { display: block; width: 100%; height: 100%; }

/* SVG pipeline scene */
.flow-stage { width: 100%; height: 100%; min-height: 420px; }
.flow-svg { display: block; width: 100%; height: 100%; min-width: 820px; min-height: 420px; }
@media (max-width: 900px) { .flow-svg { min-width: 900px; } }

.fl-lane { fill: rgba(255, 255, 255, 0.022); stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.fl-lane-label {
  fill: var(--gray);
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
.fl-lane-sub { fill: var(--gray); font-size: 9px; opacity: 0.7; }

.fl-edge {
  fill: none;
  stroke: rgba(148, 163, 184, 0.55);
  stroke-width: 1.7;
  stroke-dasharray: 7 7;
  animation: edgeDash calc(1.15s / var(--flow-speed, 1)) linear infinite;
  transition: stroke 0.2s ease, opacity 0.2s ease, stroke-width 0.2s ease;
}
@keyframes edgeDash { to { stroke-dashoffset: -14; } }
.fl-head { fill: rgba(148, 163, 184, 0.6); transition: fill 0.2s ease, opacity 0.2s ease; }
.fl-edge-hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; }
.fl-label {
  font-size: 9.5px;
  fill: var(--muted);
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(7, 9, 14, 0.85);
  stroke-width: 3px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* edge states (classes live on .fl-edge-g groups) */
.fl-edge-g.degraded .fl-edge { stroke: rgba(251, 191, 36, 0.65); animation-duration: calc(2.3s / var(--flow-speed, 1)); }
.fl-edge-g.degraded .fl-head { fill: rgba(251, 191, 36, 0.7); }
.fl-edge-g.off .fl-edge { stroke: rgba(248, 113, 113, 0.55); stroke-dasharray: 3 7; animation-play-state: paused; }
.fl-edge-g.off .fl-head { fill: rgba(248, 113, 113, 0.6); }
.fl-edge-g.off .fl-label { fill: rgba(248, 113, 113, 0.75); }
.fl-edge-g.legacy .fl-edge { stroke: rgba(171, 178, 189, 0.45); stroke-dasharray: 2 6; animation-duration: calc(2.6s / var(--flow-speed, 1)); }
.fl-edge-g.idle .fl-edge { opacity: 0.14; animation-play-state: paused; }
.fl-edge-g.idle .fl-head { opacity: 0.14; }
.fl-edge-g.idle .fl-label { opacity: 0.15; }
.fl-edge-g.hl .fl-edge { stroke-width: 2.6; stroke: var(--cyan); filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.5)); }
.fl-edge-g.hl .fl-head { fill: var(--cyan); }
.fl-edge-g.hl .fl-label { fill: var(--text); font-size: 10.5px; font-weight: 600; }
.flow-svg.paused .fl-edge { animation-play-state: paused; }

.fl-packet { pointer-events: none; }
.fl-plabel {
  font-size: 9px;
  font-weight: 500;
  paint-order: stroke;
  stroke: rgba(7, 9, 14, 0.85);
  stroke-width: 3px;
}

.fl-node { cursor: pointer; transition: opacity 0.2s ease; }
.fl-card {
  fill: rgba(17, 24, 39, 0.88);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  transition: stroke 0.2s ease, filter 0.2s ease;
}
.fl-node:hover .fl-card { stroke: rgba(255, 255, 255, 0.35); }
.fl-node.selected .fl-card {
  stroke: var(--brand-hi);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(204, 0, 0, 0.45));
}
.fl-halo { fill: none; stroke-width: 1.5; opacity: 0; }
.fl-node.bad .fl-card { stroke: rgba(248, 113, 113, 0.6); stroke-dasharray: 5 4; }
.fl-node.bad .fl-halo { animation: haloBlink 1.6s ease-in-out infinite; }
@keyframes haloBlink {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.55; }
}
.fl-name { fill: var(--text); font-size: 12px; font-weight: 600; font-family: 'Outfit', sans-serif; }
.fl-sub { fill: var(--gray); font-size: 9px; }
.fl-state { font-size: 8.5px; font-weight: 700; letter-spacing: 1px; fill: var(--red); }
.fl-state.warn { fill: var(--amber); }
.fl-dot { transition: fill 0.2s ease; }
.fl-dot.ok { fill: var(--green); filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.9)); }
.fl-dot.warn { fill: var(--amber); filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.9)); }
.fl-dot.bad { fill: var(--red); filter: drop-shadow(0 0 3px rgba(248, 113, 113, 0.9)); }
.fl-icon { stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }

/* hover isolation dimming */
.flow-svg.focus .fl-edge-g:not(.hl) .fl-edge { opacity: 0.15; animation-play-state: paused; }
.flow-svg.focus .fl-edge-g:not(.hl) .fl-head { opacity: 0.15; }
.flow-svg.focus .fl-edge-g:not(.hl) .fl-label { opacity: 0.1; }
.flow-svg.focus .fl-node:not(.hl) { opacity: 0.35; }

.fl-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(13, 18, 28, 0.96);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 11.5px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  max-width: 260px;
}
.fl-tooltip[hidden] { display: none; }
.fl-tooltip .tt-title { font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.fl-tooltip .tt-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.fl-tooltip .tt-row b { color: var(--text); font-weight: 500; }
.fl-tooltip .swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.canvas-foot { margin-top: 10px; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.legend button:hover { border-color: var(--border-hi); }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.node-detail { margin-top: 10px; font-size: 12px; color: var(--muted); min-height: 18px; flex-basis: 100%; }
.node-detail b { color: var(--text); font-weight: 600; }

.side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; background: #3d2416; padding: 14px; border-radius: 12px; color: #0f172a; --text: #0f172a; --muted: #475569; --gray: #64748b; --panel: #ffffff; --panel2: #f1f5ff; --border: rgba(3, 3, 184, 0.16); --border-hi: rgba(3, 3, 184, 0.28); }

/* Side panel widgets (KPI, lake meter, zones, ladder, lineage, ticker) */
.kpi-head { display: flex; gap: 10px; font-size: 10.5px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.kpi-head span:first-child { width: 56%; }
.kpi-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed rgba(143, 163, 195, 0.14); }
.kpi-row:last-child { border-bottom: 0; }
.kpi-label { font-size: 11.5px; color: var(--muted); width: 56%; }
.kpi-before { color: var(--gray); text-decoration: line-through; font-size: 11px; margin-right: 6px; }
.kpi-after { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; min-width: 58px; text-align: right; transition: color 0.3s; }
.kpi-after.on { color: var(--green); }
.kpi-after.off { color: var(--gray); }

.meter { margin-top: 9px; }
.meter-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.meter-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.meter-track { height: 9px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--border); overflow: hidden; }
.meter-fill { height: 100%; width: 22%; border-radius: 6px; background: linear-gradient(90deg, #3d2416, #26160d); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.big-meter { margin-top: 16px; }

.lake-nums { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; gap: 4px; }
.lake-nums b { color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lake-nums .status { font-size: 11px; }
.lake-nums .status.ok { color: var(--green); }
.lake-nums .status.off { color: var(--gray); }

.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.zone { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 11px; }
.zone h4 { font-size: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; font-weight: 600; }
.zone h4 span { font-size: 10px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.zone .big { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.zone p { font-size: 11px; margin-top: 3px; }
.zone .zfill { height: 6px; border-radius: 3px; background: rgba(3, 3, 184, 0.10); border: 1px solid var(--border); overflow: hidden; margin-top: 7px; }
.zone .zfill i { display: block; height: 100%; border-radius: 3px; transition: width 0.8s; }

.pipe { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 16px 0 2px; font-size: 11.5px; }
.pipe .pnode { background: var(--panel2); border: 1px solid var(--border); padding: 5px 9px; border-radius: 7px; color: var(--text); font-size: 11px; }
.pipe .parrow { color: var(--gray); }

.ladder { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.lad-row { display: grid; grid-template-columns: 82px 1fr 112px; gap: 10px; align-items: center; }
.lad-row .g { font-weight: 600; font-size: 12.5px; color: var(--blue); font-variant-numeric: tabular-nums; }
.lad-row .meta { display: block; color: var(--muted); font-size: 10.5px; font-weight: 400; margin-top: 2px; }
.lad-row .bars { display: flex; gap: 3px; align-items: center; }
.lad-row .bars i { display: block; height: 8px; border-radius: 3px; transition: width 0.6s; }
.lad-row .bars i:nth-child(1) { background: var(--gray); }
.lad-row .bars i:nth-child(2) { background: var(--blue); }
.lad-row .bars i:nth-child(3) { background: var(--green); }
.lad-row .val { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.5; }
.lad-row .val b { color: var(--text); font-weight: 500; }

.lineage { margin-top: 14px; background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font-size: 12px; color: var(--muted); }

.ticker { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.ticker li { display: flex; justify-content: space-between; gap: 8px; }
.ticker b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.ticker li.off { color: var(--gray); }

table.catalog { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
table.catalog th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
table.catalog td { padding: 5px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.catalog td.num { text-align: right; }

.sim-cost { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--amber); }

/* Slide-over Activity Log Drawer */
.activity-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  height: 100%;
  background: rgba(13, 18, 28, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: transform 0.25s ease-in-out;
}
.activity-drawer[hidden] { display: none !important; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.drawer-header h3 { font-size: 13px; font-weight: 700; color: var(--text); margin: 0; }
.btn-close { background: transparent; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 8px; border-radius: 4px; }
.btn-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.feed-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#feed { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow: auto; min-height: 0; }
#feed li { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text); padding: 8px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04); }
#feed .t { color: var(--gray); font-variant-numeric: tabular-nums; flex: none; }
#feed .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; align-self: center; }
#feed li.err { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.06); }
#feed li.err .txt { color: var(--red); }

/* Dashboard Cards & KPIs */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.dash-kpi { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; transition: border-color 0.2s ease; }
.dash-kpi:hover { border-color: var(--border-hi); }
.dash-kpi .lbl { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-kpi b { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; color: var(--text); display: block; margin: 4px 0; }
.dash-kpi .dsub { font-size: 10.5px; color: var(--gray); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.chart-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.chart-card.wide { grid-column: span 2; }
.chart-card h3 { margin: 0 0 10px; font-size: 12px; color: var(--text); }

table.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dash-table td { padding: 6px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); font-variant-numeric: tabular-nums; }
.dash-table td.num, .dash-table th.num { text-align: right; }
.dash-table td.pos { color: var(--green); font-weight: 600; }
.dash-table td.neg { color: var(--red); font-weight: 600; }

.status-pill { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.status-pill.status-run { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.status-pill.status-close { color: var(--gray); border: 1px solid var(--border); background: rgba(100, 116, 139, 0.08); }
.status-pill.risk-high { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.status-pill.risk-low { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }

.prog { white-space: nowrap; }
.prog-track { display: inline-block; width: 64px; height: 6px; border-radius: 4px; background: var(--panel); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.prog-track i { display: block; height: 100%; background: linear-gradient(90deg, #3d2416, #7a5236); border-radius: 4px; transition: width 0.6s; }

.alarm-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 5px 0; }
.alarm-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.alarm-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.alarm-dot.alarm-critical { background: var(--red); box-shadow: 0 0 6px rgba(248, 113, 113, 0.7); }
.alarm-dot.alarm-major { background: var(--amber); }
.alarm-dot.alarm-minor { background: var(--sky); }
.alarm-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 10.5px; color: var(--gray); }

.cpu-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; }
.cpu-hero > .sub { flex: 0 0 100%; margin-top: 2px; }
.cpu-num { font-family: 'Outfit', sans-serif; font-size: 34px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cpu-spark-wrap { flex: 0 1 260px; min-width: 160px; display: flex; flex-direction: column; }
.cpu-spark { display: block; width: 100%; height: 44px; flex: none; }
.cpu-spark-scale { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; font-size: 9px; color: var(--gray); font-variant-numeric: tabular-nums; }
.cpu-drivers-grid { flex: 1 1 520px; min-width: 320px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.cpu-driver { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.cpu-driver .lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); margin-bottom: 3px; }
.cpu-driver b { display: block; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.cpu-driver i { display: block; font-style: normal; font-size: 9px; color: var(--muted); margin-top: 2px; }

.money-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.money-chip { background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; color: var(--muted); }
.money-chip b { color: var(--text); font-variant-numeric: tabular-nums; }

.bench-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bench-row { display: inline-flex; align-items: baseline; gap: 7px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 11.5px; }
.bench-row .bk { color: var(--gray); text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.6px; }
.bench-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.bench-row .vs { font-size: 10.5px; color: var(--muted); }
.bench-row .vs.up { color: var(--green); }
.bench-row .vs.down { color: var(--red); }

table.esg-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.esg-table th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.esg-table td { padding: 5px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); font-variant-numeric: tabular-nums; }
.esg-table td.num, .esg-table th.num { text-align: right; }
.esg-section { margin-top: 12px; }

.roi-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
#roi-chart { width: 100%; height: auto; display: block; margin-top: 6px; }

/* ============================================================
   What-if impact view
   ============================================================ */
.impact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(315px, 1fr)); gap: 10px; margin-top: 12px; }
.impact-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.impact-card summary { list-style: none; cursor: pointer; padding: 12px; display: flex; gap: 10px; align-items: center; transition: background 0.15s; }
.impact-card summary::-webkit-details-marker { display: none; }
.impact-card summary:hover, .impact-card[open] summary { background: rgba(255, 255, 255, 0.03); }
.impact-card[open] summary { border-bottom: 1px solid var(--border); }
.ic-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ic { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ic-name { font-weight: 600; font-size: 13px; color: var(--text); }
.ic-role { color: var(--muted); font-size: 11px; display: block; margin-top: 1px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.sev-badge { margin-left: auto; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex: none; }
.sev-critical { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.sev-high { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.sev-medium { color: var(--sky); border: 1px solid rgba(125, 211, 252, 0.35); background: rgba(125, 211, 252, 0.08); }
.chev { margin-left: 2px; color: var(--gray); transition: transform 0.2s; flex: none; }
.impact-card[open] .chev { transform: rotate(180deg); }
.impact-body { padding: 12px; font-size: 12px; color: var(--muted); overflow: hidden; }
.impact-body h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); margin: 11px 0 4px; }
.impact-body p { font-size: 12px; color: var(--muted); }
.impact-body ul { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.impact-body ul li { background: rgba(3, 3, 184, 0.06); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 11px; color: var(--text); }
.impact-body ul.bullets { display: block; padding-left: 2px; }
.impact-body ul.bullets li { border: 0; background: none; border-radius: 0; padding: 2px 0 2px 13px; position: relative; color: var(--muted); font-size: 12px; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.impact-body ul.bullets li::before { content: '\2014'; position: absolute; left: 0; color: var(--gray); }
.impact-body .kpi-hit { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.impact-body .fallback { border-left: 2px solid var(--border); padding-left: 9px; font-style: italic; margin-top: 2px; }
#impact-body table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
#impact-body td, #impact-body th { padding: 4px 6px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); text-align: left; }
#impact-body td.num { text-align: right; }
#impact-panel h3 { margin-top: 0; }

.impact-matrix { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.impact-matrix th { text-align: center; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.impact-matrix th:first-child { text-align: left; }
.impact-matrix td { padding: 6px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); text-align: center; white-space: nowrap; }
.impact-matrix td:first-child { text-align: left; color: var(--text); font-weight: 500; cursor: pointer; }
.impact-matrix tbody tr { cursor: pointer; transition: background 0.15s; }
.impact-matrix tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.impact-matrix .m-full { color: var(--red); }
.impact-matrix .m-part { color: var(--amber); }
.impact-matrix .m-none { color: var(--gray); }
.impact-matrix tbody tr.hot { background: rgba(96, 165, 250, 0.1); }
.impact-matrix tbody tr.hot td:first-child { color: var(--blue); }

table.impact-sim { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }`r`n.impact-sim { overflow: hidden; }`r`n.impact-sim p { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.impact-sim th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.impact-sim th.num, .impact-sim td.num { text-align: right; }
.impact-sim td { padding: 6px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); font-variant-numeric: tabular-nums; }
.impact-sim td.pos { color: var(--green); font-weight: 600; }
.impact-sim td.neg { color: var(--red); font-weight: 600; }

/* ============================================================
   Audit view
   ============================================================ */
.audit-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.audit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-group { display: flex; gap: 4px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.filter-btn { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 11.5px; cursor: pointer; font-family: inherit; }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: linear-gradient(135deg, #26160d, #7a5236); color: #fff; }
.audit-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--panel2); }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-table th { position: sticky; top: 0; text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 10px; background: #eef2ff; border-bottom: 1px solid var(--border); z-index: 1; white-space: nowrap; }
.audit-table td { padding: 5px 10px; border-bottom: 1px solid rgba(143, 163, 195, 0.07); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.audit-table td.time { color: var(--gray); font-variant-numeric: tabular-nums; }
.audit-table td.actor { font-weight: 500; }
.audit-table td.detail { max-width: 520px; }
.audit-table tr.outcome-err td { background: rgba(248, 113, 113, 0.05); }
.audit-table tr.outcome-warn td { background: rgba(251, 191, 36, 0.04); }
.outcome-badge { font-size: 9.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.4px; display: inline-block; }
.badge-ok { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.badge-warn { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.badge-err { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.audit-counts { display: flex; gap: 16px; font-size: 11px; color: var(--muted); padding-top: 8px; flex-wrap: wrap; }
.audit-counts b { color: var(--text); font-variant-numeric: tabular-nums; }
.audit-counts b.bad { color: var(--red); }

/* ============================================================
   Benefits view
   ============================================================ */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.journey { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.step { flex: 1; min-width: 150px; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 11px; position: relative; transition: opacity 0.5s; }
.step.done { border-color: rgba(204, 0, 0, 0.4); }
.step.locked { opacity: 0.38; }
.step:not(:last-child)::after { content: '\203A'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--gray); font-size: 13px; z-index: 1; }
.step .num { width: 21px; height: 21px; border-radius: 50%; background: linear-gradient(135deg, #3d2416, #26160d); color: #fff; font-weight: 600; font-size: 11.5px; display: flex; align-items: center; justify-content: center; margin-bottom: 7px; }
.step.locked .num { background: var(--gray); color: #0f1217; }
.step h4 { font-size: 12.5px; margin-bottom: 3px; }
.step p { font-size: 11px; line-height: 1.45; }

.kpi-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 10px; }
.kpi-table th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.kpi-table td { padding: 6px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); text-align: left; font-variant-numeric: tabular-nums; }
.kpi-table td.num { text-align: right; }
.kpi-table .up { color: var(--green); font-weight: 600; }
.kpi-table .down { color: var(--red); font-weight: 600; }
.kpi-table .before { color: var(--gray); text-decoration: line-through; margin-right: 6px; font-size: 11.5px; }

.bars { display: flex; flex-direction: column; gap: 13px; margin-top: 12px; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.bar-top b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--border); overflow: hidden; position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; transition: opacity 0.5s; }
.bar-fill.before { background: var(--gray); opacity: 0.45; }
.bar-fill.after { background: linear-gradient(90deg, #3d2416, #26160d); opacity: 0.95; }
.bar-legends { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.bar-legends i { display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.tile { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 11px; }
.tile .ic { display: block; margin-bottom: 6px; }
.tile h4 { font-size: 12.5px; margin-bottom: 3px; font-weight: 600; }
.tile p { font-size: 11.5px; line-height: 1.45; }

/* ============================================================
   Recommendations
   ============================================================ */
.rec-card { display: flex; gap: 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; border-left-width: 3px; }
.rec-card.sev-critical { border-left-color: var(--red); }
.rec-card.sev-high { border-left-color: var(--amber); }
.rec-card.sev-medium { border-left-color: var(--sky); }
.rec-card.sev-low, .rec-card.sev-info { border-left-color: var(--gray); }
.rec-rank { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 800; color: var(--gray); width: 26px; flex: none; text-align: center; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-weight: 600; font-size: 13px; color: var(--text); }
.rec-card .tag { display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; border: 1px solid var(--border); color: var(--muted); }
.rec-detail { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rec-detail b { color: var(--text); }
.rec-save { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 4px; }
.rec-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ============================================================
   Maintenance
   ============================================================ */
.wo-pri-A { color: var(--red); font-weight: 700; }
.wo-pri-B { color: var(--amber); font-weight: 600; }
.wo-pri-C { color: var(--muted); }
.maint-status { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 9px; border-radius: 999px; }
.maint-status.st-open { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.maint-status.st-progress { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.maint-status.st-done, .maint-status.st-closed { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }

/* ============================================================
   Quality
   ============================================================ */
table.spc-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.spc-table th { text-align: left; color: var(--gray); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.spc-table td { padding: 5px 8px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); font-variant-numeric: tabular-nums; }
.spc-table td.num, .spc-table th.num { text-align: right; }
.cpk { font-weight: 700; }
.cpk.ok { color: var(--green); }
.cpk.warn { color: var(--amber); }
.cpk.bad { color: var(--red); }
.fpy-chip { display: inline-block; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; color: var(--muted); margin: 3px 4px 3px 0; }
.fpy-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.pareto-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); padding: 3px 0; }
.pareto-row > span:first-child { width: 74px; flex: none; }
.pareto-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(3, 3, 184, 0.10); border: 1px solid var(--border); overflow: hidden; }
.pareto-track i { display: block; height: 100%; background: linear-gradient(90deg, #3d2416, #7a5236); border-radius: 4px; }

/* ============================================================
   Supply
   ============================================================ */
.starve-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); background: var(--panel2); border-radius: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.starve-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.starve-item b.sev-critical { color: var(--red); }
.starve-item b.sev-high { color: var(--amber); }
.starve-item b.sev-medium { color: var(--sky); }
.supplier-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-bottom: 1px dashed rgba(143, 163, 195, 0.12); font-size: 12px; color: var(--muted); }
.supplier-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.shortage-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; background: var(--panel2); }
.shortage-item.crit { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.06); }
.shortage-item b { color: var(--text); }

/* ============================================================
   Security
   ============================================================ */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.sec-zone { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; transition: border-color 0.2s ease; }
.sec-zone.compromised { border-color: rgba(248, 113, 113, 0.55); background: rgba(248, 113, 113, 0.07); animation: outagePulse 2.2s ease-in-out infinite; }
.sz-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.sz-top h4 { font-size: 13px; }
.sz-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 2px 9px; border-radius: 999px; }
.sec-zone .sz-status { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.sec-zone.compromised .sz-status { color: var(--red); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.sec-zone p { font-size: 11.5px; margin-bottom: 8px; }

/* ============================================================
   Connectors
   ============================================================ */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.conn-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.conn-card.online { border-left: 3px solid var(--green); }
.conn-card.degraded { border-left: 3px solid var(--amber); }
.conn-card.offline { border-left: 3px solid var(--red); }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.cc-top h4 { font-size: 13px; }
.cc-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 2px 9px; border-radius: 999px; }
.cc-status.online { color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.cc-status.degraded { color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.cc-status.offline { color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.conn-card p { font-size: 11.5px; }
.cc-meta { font-size: 11px; color: var(--gray); margin-top: 6px; font-variant-numeric: tabular-nums; }
.cc-actions { display: flex; gap: 6px; margin-top: 10px; }
.cc-actions .btn { padding: 4px 9px; font-size: 11px; }

/* ============================================================
   Cyber Lab
   ============================================================ */
.cyber-attacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.cyber-attack { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; transition: all 0.18s ease; }
.cyber-attack:hover { border-color: var(--border-hi); }
.cyber-attack.selected { border-color: var(--brand); box-shadow: var(--glow-brand); background: rgba(204, 0, 0, 0.08); }
.ca-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ca-name { font-weight: 600; font-size: 13px; color: var(--text); }
.ca-entry, .ca-anchor { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cyber-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.cyber-control { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: all 0.18s ease; }
.cyber-control .nm { font-size: 12.5px; font-weight: 500; color: var(--text); }
.cyber-control.off { opacity: 0.55; border-color: rgba(248, 113, 113, 0.4); }
.cyber-control .sw { margin-left: auto; width: 32px; height: 18px; border-radius: 999px; background: var(--gray); position: relative; flex: none; transition: background 0.2s ease; }
.cyber-control .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.2s ease; }
.cyber-control.on .sw { background: var(--green); }
.cyber-control.on .sw::after { left: 16px; }
.cyber-runbar { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.cyber-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.cyber-hero .ch { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.cyber-hero .ch b { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; display: block; margin: 4px 0; }
.cyber-hero .ch.bad b { color: var(--red); }
.cyber-hero .ch.good b { color: var(--green); }
.cyber-hero .ch.save { border-color: rgba(204, 0, 0, 0.45); }
.cyber-hero .ch.save b { color: var(--brand-hi); }
.cyber-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cyber-col { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.cyber-col.bad { border-color: rgba(248, 113, 113, 0.3); }
.cyber-col.good { border-color: rgba(52, 211, 153, 0.3); }
.cyber-col h4 { margin-bottom: 8px; font-size: 12px; }
.cyber-stat { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 3px 0; }
.cyber-stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.cyber-stat b.bad { color: var(--red); }
.cyber-stat b.good { color: var(--green); }
.cyber-layers { display: flex; flex-wrap: wrap; gap: 5px; }
.cyber-layer { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: rgba(3, 3, 184, 0.06); }
.cyber-layer.hit { color: var(--red); border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); }
.cyber-layer.safe { color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.cyber-savebar { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(204, 0, 0, 0.08); border: 1px solid rgba(204, 0, 0, 0.35); font-size: 12px; color: var(--muted); }
.cyber-savebar b { color: var(--text); }

/* ============================================================
   People
   ============================================================ */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.people-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.people-card h4 { font-size: 13px; margin-bottom: 2px; }
.fatbar { height: 7px; border-radius: 4px; background: rgba(3, 3, 184, 0.10); border: 1px solid var(--border); overflow: hidden; margin-top: 8px; }
.fatbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--amber), var(--red)); border-radius: 4px; }

/* ============================================================
   Digital Twin
   ============================================================ */
.twin-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.twin-line { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.line-name { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 8px; display: block; }
.twin-machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.machine-card { background: rgba(3, 3, 184, 0.06); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: all 0.18s ease; display: flex; flex-direction: column; gap: 2px; }
.machine-card:hover { border-color: var(--border-hi); }
.machine-card.selected { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.machine-card.off { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.06); }
.machine-card.deg { border-color: rgba(251, 191, 36, 0.4); }
.machine-card.impacted { border-color: rgba(125, 211, 252, 0.4); }
.mc-name { font-weight: 600; font-size: 12px; color: var(--text); }
.mc-stats { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-meta { font-size: 9.5px; font-weight: 700; letter-spacing: 0.7px; color: var(--gray); }
.machine-card.off .mc-meta { color: var(--red); }
.machine-card.deg .mc-meta { color: var(--amber); }
.machine-card.impacted .mc-meta { color: var(--sky); }
.mc-vib { font-size: 10px; color: var(--gray); font-variant-numeric: tabular-nums; }
.twin-detail { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; min-height: 100%; }

/* ============================================================
   Ontology
   ============================================================ */
.obj-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; margin-top: 12px; }
.obj-list { display: flex; flex-direction: column; gap: 6px; }
.obj-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.obj-item { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; cursor: pointer; font-size: 12px; transition: all 0.15s ease; }
.obj-item:hover { border-color: var(--border-hi); }
.obj-item.selected { border-color: var(--pink); background: rgba(244, 114, 182, 0.07); }
.obj-item .nm { font-weight: 500; color: var(--text); }
.obj-item .st { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.obj-item .st.st-run, .obj-item .st.st-ok, .obj-item .st.st-active { color: var(--green); }
.obj-item .st.st-hold, .obj-item .st.st-warn { color: var(--amber); }
.obj-item .st.st-fail, .obj-item .st.st-down { color: var(--red); }
.obj-detail { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.obj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.obj-props { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 10px 0; }
.obj-props > div { background: rgba(3, 3, 184, 0.06); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
.obj-props span { display: block; font-size: 10px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.obj-props b { font-size: 13px; font-variant-numeric: tabular-nums; }
.obj-links { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.obj-link { font-size: 11.5px; color: var(--muted); padding: 3px 0; }
.obj-link b { color: var(--sky); font-weight: 500; }
.obj-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.obj-history { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); margin-top: 6px; overflow: hidden; }
.obj-history li { padding-left: 13px; position: relative; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.obj-history li::before { content: '\2014'; position: absolute; left: 0; color: var(--gray); }

/* ============================================================
   Tour & modal
   ============================================================ */
.tour-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.62); z-index: 120; backdrop-filter: blur(2px); }
.tour-tip { position: fixed; z-index: 130; width: 320px; background: rgba(13, 18, 28, 0.98); border: 1px solid var(--border-hi); border-radius: 12px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
.tour-tip h4 { margin-bottom: 6px; }
.tour-tip p { font-size: 12px; }
.tour-dots { display: flex; gap: 5px; margin: 10px 0; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.tour-dots i.on { background: var(--brand-hi); }
.t-actions { display: flex; gap: 8px; justify-content: flex-end; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.66); z-index: 140; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal { width: min(480px, 92vw); background: rgba(13, 18, 28, 0.98); border: 1px solid var(--border-hi); border-radius: 14px; padding: 18px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.65); }
.modal h3 { margin-top: 0; }
.m-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ============================================================
   Status footer
   ============================================================ */
.app-status { height: 26px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-top: 1px solid rgba(61, 36, 22, 0.22); color: var(--ink-soft); font-size: 11px; background: var(--paper-deep); }
.app-status b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.app-status .ok { color: var(--moss); }
.app-status .warn { color: var(--amber); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1440px) {
  .app-topbar { gap: 10px; padding: 8px 12px; }
  .top-controls { gap: 5px; }
  .app-topbar .btn { padding: 6px 9px; }
}

@media (max-width: 1366px) {
  .app-topbar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 8px 12px; }
  .top-controls { flex-wrap: wrap; row-gap: 6px; }
}

@media (max-width: 1200px) {
  .app-topbar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 8px 12px; }
  .top-controls { flex-wrap: wrap; row-gap: 6px; }
}

@media (max-width: 1180px) {
  .brand-sub { display: none; }
  .top-controls { gap: 6px; }
  .flow-grid { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 1000px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  .app-body { flex-direction: column; }
  .app-main { overflow: visible; }
  .tab-panel { height: auto; }
  .app-sidebar { width: 100%; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .nav-section-title { display: none; }
  .sidebar-foot { display: none; }
  .nav-btn { width: auto; flex: none; }
  .nav-btn.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; }
  .flow-grid { grid-template-columns: 1fr; }
  .canvas-wrap { min-height: 420px; }
  .side { overflow: visible; }
  .two-col, .twin-layout, .obj-layout, .cyber-cols { grid-template-columns: 1fr; }
  .app-status { display: none; }
}
@media (max-width: 620px) {
  .zones, .tiles, .cyber-hero { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
  .top-controls { gap: 6px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* The line — same lot, two endings */
.line-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
}
.line-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.line-kicker {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3d2416;
  margin-bottom: 4px;
}
.line-title h2 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
}
.line-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.line-toggle {
  display: flex;
  padding: 3px;
  background: var(--paper-deep);
  border: 1px solid rgba(61, 36, 22, 0.22);
  border-radius: 9px;
}
.line-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
}
.line-toggle button[aria-pressed="true"] {
  background: #3d2416;
  color: #ffffff;
}
.line-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.line-meter {
  padding: 12px 14px 10px;
  border-top: 2px solid #3d2416;
  background: #fbf8f2;
}
.line-meter b {
  display: block;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.line-meter span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.line-meter.is-bad b { color: #b91c1c; }
.line-meter.is-held b { color: #3d2416; }
.line-rail {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  padding: 52px 16px 18px;
  background: var(--paper-deep);
  border: 1px solid rgba(61, 36, 22, 0.16);
  border-radius: 12px;
}
.line-rail::before {
  content: '';
  position: absolute;
  left: 7%;
  right: 7%;
  top: 58%;
  height: 3px;
  background: #a65a2c;
}
.line-lot {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 12.5%;
  width: 84px;
  height: 30px;
  margin-left: -42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  transition: left 0.65s ease, background 0.3s ease, opacity 0.3s ease;
}
.line-lot.is-held { background: #3d2416; }
.line-lot.is-gone { background: #b91c1c; opacity: 0.45; }
.line-station {
  position: relative;
  z-index: 1;
  background: #fbf8f2;
  border: 1px solid rgba(61, 36, 22, 0.16);
  border-radius: 10px;
  padding: 12px 12px 10px;
  min-height: 92px;
}
.line-station .line-op {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.line-station h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
}
.line-station p:last-child {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-soft);
}
.line-station.is-here { border-color: #3d2416; }
.line-station.is-bad { border-color: #b91c1c; background: #fff7f7; }
.line-station.is-held { border-color: #a65a2c; background: #f8ecd0; }
.line-story { min-height: 88px; }
.line-now {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  max-width: 68ch;
}
.line-act {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.line-act[hidden] { display: none; }
.line-act .btn {
  background: #3d2416;
  color: #ffffff;
  border-color: #3d2416;
}
.line-act span { font-size: 13px; color: #3d2416; }
.line-why { padding-bottom: 8px; }
.line-why-thesis {
  margin: 0 0 12px;
  max-width: 62ch;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
}
.line-why-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.line-why-col {
  background: #fbf8f2;
  border: 1px solid rgba(61, 36, 22, 0.16);
  border-top: 2px solid rgba(61, 36, 22, 0.18);
  padding: 12px 14px 8px;
}
.line-why-col.is-on { border-top-color: #3d2416; }
.line-why-col h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.line-why-col p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.line-apps-kicker { margin-top: 18px; }
.line-apps-lead {
  margin: 0 0 12px;
  max-width: 68ch;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}
.line-apps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}
.line-apps li {
  background: #fbf8f2;
  border: 1px solid rgba(61, 36, 22, 0.16);
  padding: 12px 14px 6px;
}
.line-apps span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a65a2c;
}
.line-apps b {
  display: block;
  margin: 4px 0 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.line-apps p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}
@media (max-width: 900px) {
  .line-head, .line-meters { display: block; }
  .line-controls { margin-top: 12px; }
  .line-meter { margin-bottom: 8px; }
  .line-title h2 { font-size: 22px; }
  .line-rail { grid-template-columns: 1fr 1fr; min-height: 0; }
  .line-why-cols, .line-apps { grid-template-columns: 1fr; }
  .line-lot { display: none; }
}
