:root {
  --bg: #071a29;
  --bg-2: #0d2437;
  --panel: rgba(12, 38, 57, 0.92);
  --panel-strong: rgba(9, 29, 44, 0.97);
  --border: rgba(56, 143, 176, 0.22);
  --teal: #1ab1cf;
  --teal-bright: #36c2d9;
  --teal-soft: rgba(26, 177, 207, 0.12);
  --yellow: #ffc426;
  --ink: #eaf6fb;
  --muted: #97b4c2;
  --good: #28b373;
  --warn: #f0ab2a;
  --bad: #e25a5a;
  --shadow: 0 28px 80px rgba(3, 11, 18, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(26, 177, 207, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 196, 38, 0.08), transparent 22%),
    linear-gradient(160deg, #061523, #0b2132 48%, #061523);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(54, 194, 217, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 194, 217, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.42;
  z-index: 0;
}

body::after {
  background:
    radial-gradient(circle at 12% 20%, rgba(54, 194, 217, 0.12), transparent 22%),
    radial-gradient(circle at 88% 14%, rgba(255, 196, 38, 0.12), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(54, 194, 217, 0.08), transparent 30%);
  z-index: 0;
}

#wave-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.88;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.sidebar {
  padding: 28px 22px;
  background:
    linear-gradient(180deg, rgba(5, 20, 31, 0.94), rgba(4, 17, 28, 0.9)),
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.08), transparent 26%);
  border-right: 1px solid rgba(71, 140, 171, 0.2);
  display: grid;
  gap: 16px;
  align-content: start;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-width: 0;
}

.brand h1,
.hero h2,
.panel-head h3 {
  margin: 0;
}

.brand p,
.hero p,
.sidebar-note p,
.script-card p,
.run-summary-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.brand-badge,
.eyebrow,
.card-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

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

.brand-mark {
  flex: 0 0 auto;
  width: 78px;
  min-width: 78px;
  padding: 10px 10px 8px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)),
    rgba(9, 29, 44, 0.9);
  border: 1px solid rgba(73, 143, 174, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.brand-mark img {
  width: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}

.brand-copy {
  min-width: 0;
}

.brand h1 {
  font-size: 34px;
  margin-top: 8px;
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.sidebar-card,
.card,
.panel {
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 18px;
}

.nav-sidebar-card {
  overflow: hidden;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(4, 24, 37, 0.42);
  border: 1px solid rgba(73, 143, 174, 0.14);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-nav-link:hover {
  transform: translateX(2px);
  border-color: rgba(54, 194, 217, 0.26);
  background: rgba(4, 24, 37, 0.76);
}

.sidebar-nav-link.is-active {
  background: linear-gradient(135deg, rgba(255, 196, 38, 0.16), rgba(26, 177, 207, 0.12));
  border-color: rgba(255, 196, 38, 0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.sidebar-nav-icon {
  width: 22px;
  text-align: center;
  color: var(--yellow);
  font-size: 14px;
}

.machine-sidebar-card {
  gap: 12px;
}

.machine-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip,
.panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(54, 194, 217, 0.1);
  border: 1px solid rgba(26, 177, 207, 0.16);
  color: var(--teal-bright);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-note {
  background: linear-gradient(180deg, rgba(12, 38, 57, 0.95), rgba(9, 29, 44, 0.97));
}

.mobile-links {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mobile-link {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(4, 24, 37, 0.9);
  border: 1px solid rgba(73, 143, 174, 0.18);
  color: var(--ink);
  text-decoration: none;
  word-break: break-all;
}

.health-card {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.health-card strong {
  font-size: 16px;
}

.health-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.machine-registry {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.machine-card {
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(4, 24, 37, 0.92);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.machine-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.machine-card-head strong {
  font-size: 15px;
}

.machine-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.machine-meta-grid span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.machine-meta-grid strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.machine-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.btn-block {
  width: 100%;
}

.main {
  padding: 24px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-shell {
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(73, 143, 174, 0.16);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)),
    rgba(7, 26, 41, 0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
  min-width: 0;
}

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

.section-shell-head h3 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

/* ============================================================
   Status banner: one big colored bar that says, in plain English,
   what the runner is doing right now. Replaces the buried health
   chips that used to be tucked into the hero corner.
   ============================================================ */
.status-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 22px;
  border: 1px solid rgba(73, 143, 174, 0.22);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(7, 24, 36, 0.85);
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.status-banner-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 6px rgba(151, 180, 194, 0.12);
}

.status-banner-copy {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.status-banner-copy strong {
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.status-banner-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-banner-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.status-banner.is-good {
  border-color: rgba(40, 179, 115, 0.38);
  background:
    linear-gradient(135deg, rgba(40, 179, 115, 0.16), rgba(40, 179, 115, 0.04)),
    rgba(7, 24, 36, 0.85);
}

.status-banner.is-good .status-banner-dot {
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(40, 179, 115, 0.22);
  animation: lab-pulse-good 2.4s ease-in-out infinite;
}

.status-banner.is-warn {
  border-color: rgba(240, 171, 42, 0.4);
  background:
    linear-gradient(135deg, rgba(240, 171, 42, 0.16), rgba(240, 171, 42, 0.04)),
    rgba(7, 24, 36, 0.85);
}

.status-banner.is-warn .status-banner-dot {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(240, 171, 42, 0.22);
}

.status-banner.is-bad {
  border-color: rgba(226, 90, 90, 0.42);
  background:
    linear-gradient(135deg, rgba(226, 90, 90, 0.18), rgba(226, 90, 90, 0.04)),
    rgba(7, 24, 36, 0.9);
}

.status-banner.is-bad .status-banner-dot {
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(226, 90, 90, 0.22);
  animation: lab-pulse-bad 1.6s ease-in-out infinite;
}

.status-banner.is-busy {
  border-color: rgba(54, 194, 217, 0.42);
  background:
    linear-gradient(135deg, rgba(54, 194, 217, 0.18), rgba(54, 194, 217, 0.04)),
    rgba(7, 24, 36, 0.9);
}

.status-banner.is-busy .status-banner-dot {
  background: var(--teal-bright);
  box-shadow: 0 0 0 6px rgba(54, 194, 217, 0.22);
  animation: lab-pulse-busy 1.4s ease-in-out infinite;
}

@keyframes lab-pulse-good {
  0%, 100% { box-shadow: 0 0 0 6px rgba(40, 179, 115, 0.22); }
  50% { box-shadow: 0 0 0 12px rgba(40, 179, 115, 0.06); }
}
@keyframes lab-pulse-bad {
  0%, 100% { box-shadow: 0 0 0 6px rgba(226, 90, 90, 0.22); }
  50% { box-shadow: 0 0 0 12px rgba(226, 90, 90, 0.04); }
}
@keyframes lab-pulse-busy {
  0%, 100% { box-shadow: 0 0 0 6px rgba(54, 194, 217, 0.22); }
  50% { box-shadow: 0 0 0 12px rgba(54, 194, 217, 0.04); }
}

/* ============================================================
   Tab bar: yellow-pill design matched to the main dashboard's
   .release-switch-btn pattern so the two pages feel related.
   ============================================================ */
.lab-tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(4, 24, 37, 0.7);
}

.lab-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(151, 180, 194, 0.92);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.lab-tab-btn:hover {
  color: var(--teal-bright);
  background: rgba(54, 194, 217, 0.1);
}

.lab-tab-btn.active {
  background: linear-gradient(135deg, var(--yellow), #ffcf4f);
  color: #15334a;
  box-shadow: 0 10px 24px rgba(255, 196, 38, 0.22);
  transform: translateY(-1px);
}

.lab-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 14px;
  border-radius: 8px;
  background: rgba(54, 194, 217, 0.1);
  color: var(--teal-bright);
}

.lab-tab-btn.active .lab-tab-icon {
  background: rgba(21, 51, 74, 0.18);
  color: #15334a;
}

.lab-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(54, 194, 217, 0.16);
  color: var(--teal-bright);
  font-size: 11px;
  font-weight: 800;
}

.lab-tab-btn.active .lab-tab-count {
  background: rgba(21, 51, 74, 0.24);
  color: #15334a;
}

.lab-tab-panel {
  display: none;
}

.lab-tab-panel.active {
  display: grid;
  gap: 18px;
  animation: lab-tab-fade 0.22s ease-out;
}

.lab-tab-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
}

@keyframes lab-tab-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Slim hero variant: drop the giant 48px headline + tag pills now
   that the status banner carries the runner state. */
.hero-slim {
  padding: 22px 26px 20px;
  align-items: center;
}

.hero-slim h2 {
  font-size: clamp(24px, 2.2vw, 32px);
  margin-top: 4px;
}

.hero-slim p {
  margin-top: 6px;
  max-width: 720px;
}

.hero-slim .hero-actions {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 26px;
  border-radius: 28px;
  border: 1px solid rgba(63, 157, 193, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.16), transparent 26%),
    radial-gradient(circle at 18% 10%, rgba(54, 194, 217, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(12, 66, 92, 0.98), rgba(8, 33, 49, 0.98));
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%, transparent 70%, rgba(255,255,255,0.02));
  pointer-events: none;
}

.hero-copy {
  max-width: 850px;
  position: relative;
  z-index: 1;
}

.hero h2 {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.04;
  margin-top: 8px;
  max-width: 900px;
  letter-spacing: -0.04em;
}

.hero-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
  position: relative;
  z-index: 1;
}

.hero-status {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(73, 143, 174, 0.24);
  background: rgba(4, 24, 37, 0.88);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-pill.is-good {
  color: #59d39b;
  border-color: rgba(40, 179, 115, 0.3);
  background: rgba(40, 179, 115, 0.14);
}

.hero-pill.is-warn {
  color: #ffcf6b;
  border-color: rgba(240, 171, 42, 0.3);
  background: rgba(240, 171, 42, 0.16);
}

.hero-pill.is-bad {
  color: #ff8a8a;
  border-color: rgba(226, 90, 90, 0.3);
  background: rgba(226, 90, 90, 0.16);
}

.hero-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-quick-tag {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(4, 24, 37, 0.52);
  border: 1px solid rgba(73, 143, 174, 0.22);
  color: rgba(234, 246, 251, 0.92);
  font-size: 12px;
  font-weight: 800;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--yellow), #ffcf4f);
  color: #17374d;
  box-shadow: 0 18px 30px rgba(255, 196, 38, 0.22);
}

.btn-secondary {
  background: rgba(26, 177, 207, 0.12);
  color: var(--teal-bright);
  border: 1px solid rgba(26, 177, 207, 0.18);
}

.btn-disabled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}

.runner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.control-layout,
.analytics-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-facts,
.preset-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-fact-card,
.preset-card,
.analytics-card,
.evidence-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.06), transparent 30%),
    var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.control-fact-card strong,
.preset-card strong,
.analytics-card strong,
.evidence-card strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.2;
}

.control-fact-card p,
.preset-card p,
.analytics-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.preset-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.analytics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.evidence-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.evidence-card {
  min-height: 118px;
}

.evidence-card strong {
  font-size: 16px;
  word-break: break-word;
}

.empty-inline-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 18px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed rgba(73, 143, 174, 0.22);
  background: rgba(7, 26, 40, 0.66);
  color: var(--muted);
}

.runner-card {
  padding: 20px 18px 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(12, 38, 57, 0.98), rgba(9, 29, 44, 0.98));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
}

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

.runner-card-head .panel-badge {
  background: rgba(4, 24, 37, 0.82);
}

.runner-title {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.runner-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.runner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.runner-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background: rgba(4, 24, 37, 0.88);
}

.runner-chip.is-good {
  color: #59d39b;
  border-color: rgba(40, 179, 115, 0.3);
  background: rgba(40, 179, 115, 0.14);
}

.runner-chip.is-warn {
  color: #ffcf6b;
  border-color: rgba(240, 171, 42, 0.3);
  background: rgba(240, 171, 42, 0.16);
}

.runner-chip.is-bad {
  color: #ff8a8a;
  border-color: rgba(226, 90, 90, 0.3);
  background: rgba(226, 90, 90, 0.16);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.content-section {
  display: grid;
  gap: 18px;
}

.kpi-card {
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(12, 38, 57, 0.96), rgba(9, 29, 44, 0.98));
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--yellow));
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  color: #fff;
  letter-spacing: -0.04em;
}

.kpi-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    rgba(10, 31, 46, 0.9);
}

.toolbar-group {
  display: grid;
  gap: 8px;
}

.toolbar-group-action {
  align-content: end;
}

.toolbar-group-action .btn {
  min-width: 180px;
}

.toolbar-group label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid rgba(73, 143, 174, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(4, 24, 37, 0.9);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

.toolbar input:focus,
.toolbar select:focus {
  border-color: rgba(54, 194, 217, 0.34);
  box-shadow: 0 0 0 4px rgba(54, 194, 217, 0.1);
}

.workspace,
.lower-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 18px;
}

.panel {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--panel);
}

.case-flow {
  display: grid;
  gap: 6px;
  min-width: 260px;
}

.case-flow strong {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(234, 246, 251, 0.96);
}

.case-flow span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}

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

.panel-head h3 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(67, 136, 168, 0.16);
  background: rgba(4, 24, 37, 0.46);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(67, 136, 168, 0.14);
  vertical-align: top;
}

th {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(4, 24, 37, 0.85);
  position: sticky;
  top: 0;
}

td {
  font-size: 14px;
  color: #edf6fb;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(26, 177, 207, 0.08);
}

.coverage-badge,
.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coverage-automated,
.result-passed {
  background: rgba(40, 179, 115, 0.14);
  color: #59d39b;
}

.coverage-manual-assist {
  background: rgba(240, 171, 42, 0.16);
  color: #ffcf6b;
}

.coverage-planned,
.result-running {
  background: rgba(26, 177, 207, 0.16);
  color: #58d0ea;
}

.result-failed {
  background: rgba(226, 90, 90, 0.16);
  color: #ff8a8a;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.run-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.run-summary-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--panel-strong);
}

.run-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 800;
}

.run-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  color: #fff;
  word-break: break-word;
}

.log-box {
  margin-top: 12px;
  min-height: 280px;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(2, 16, 24, 0.96);
  border: 1px solid rgba(73, 143, 174, 0.18);
  color: #dff2fb;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.script-list {
  display: grid;
  gap: 12px;
}

.workspace-scripts {
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  align-items: start;
}

.script-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 196, 38, 0.06), transparent 30%),
    var(--panel-strong);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.script-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 196, 38, 0.24);
}

.script-card.is-active {
  border-color: rgba(255, 196, 38, 0.34);
  box-shadow: 0 18px 34px rgba(255, 196, 38, 0.08), inset 0 0 0 1px rgba(255, 196, 38, 0.15);
}

.script-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.script-card h4 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.script-path {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.script-workspace {
  padding: 20px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.script-workspace-meta {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.script-workspace-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.script-editor {
  margin-top: 14px;
  min-height: 560px;
  width: 100%;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(73, 143, 174, 0.24);
  background: rgba(2, 16, 24, 0.96);
  color: rgba(234, 246, 251, 0.96);
  padding: 18px 20px;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 13px;
  line-height: 1.65;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.script-editor:focus {
  outline: none;
  border-color: rgba(54, 194, 217, 0.42);
  box-shadow: 0 0 0 1px rgba(54, 194, 217, 0.22);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(71, 140, 171, 0.2);
  }

  .workspace,
  .control-layout,
  .workspace-scripts,
  .lower-grid,
  .toolbar,
  .kpi-grid,
  .runner-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid,
  .control-facts,
  .preset-grid,
  .evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .main,
  .sidebar {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  .hero {
    padding: 18px;
    flex-direction: column;
    border-radius: 20px;
  }

  .brand-header {
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    justify-items: stretch;
  }

  .hero-slim .hero-actions {
    justify-content: flex-start;
  }

  .machine-meta-grid {
    grid-template-columns: 1fr;
  }

  .run-summary-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  .hero-pill {
    width: 100%;
  }

  .control-panel-actions {
    flex-direction: column;
  }

  .control-panel-actions .btn,
  .preset-card .btn {
    width: 100%;
  }

  .toolbar-group-action .btn {
    min-width: 0;
    width: 100%;
  }

  .status-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .status-banner-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .lab-tab-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  .lab-tab-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 12px;
  }

  .section-shell,
  .panel,
  .toolbar,
  .table-wrap {
    border-radius: 18px;
  }

  .panel-head,
  .section-shell-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-head h3,
  .section-shell-head h3 {
    font-size: 22px;
  }

  .hero h2 {
    font-size: 28px;
    letter-spacing: 0;
  }

  .hero-copy,
  .status-banner-copy {
    width: 100%;
  }

  .analytics-grid,
  .control-facts,
  .preset-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}
