:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(15, 19, 26, 0.86);
  --panel-solid: #0f131a;
  --panel-raised: #151a23;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f5f7;
  --muted: #929ba7;
  --soft: #c2c9d1;
  --accent: #c8ff43;
  --accent-ink: #111707;
  --blue: #72b7ff;
  --danger: #ff6e76;
  --warning: #ffcc66;
  --radius: 18px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(111, 160, 255, 0.12), transparent 38%),
    linear-gradient(180deg, #090c11 0%, var(--bg) 52%, #06080b 100%);
  font-family: var(--sans);
  overflow-x: hidden;
}
button { font: inherit; }
code { font-family: var(--mono); }

.ambient {
  position: fixed;
  z-index: -1;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.06;
  pointer-events: none;
}
.ambient-a { background: var(--accent); top: 16rem; left: -24rem; }
.ambient-b { background: var(--blue); right: -25rem; bottom: -10rem; }

.site-header {
  width: min(1540px, calc(100% - 48px));
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 255, 67, 0.35);
  border-radius: 11px;
  color: var(--accent);
  background: rgba(200, 255, 67, 0.06);
  box-shadow: inset 0 0 22px rgba(200, 255, 67, 0.04);
  font: 700 15px/1 var(--mono);
}
.brand strong { display: block; letter-spacing: -0.01em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.header-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255,255,255,0.025);
  font: 600 11px/1 var(--mono);
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 9px currentColor; }
.badge.ok { color: #dfff91; border-color: rgba(200,255,67,0.22); }
.badge.ok i { background: var(--accent); }
.badge.fail { color: #ffacb1; border-color: rgba(255,110,118,0.26); }
.badge.fail i { background: var(--danger); }
.badge.muted { color: var(--muted); }
.badge.muted i { background: #59616d; box-shadow: none; }

.app-shell { width: min(1540px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 28px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 52px;
  padding: 0 4px 38px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font: 700 10px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 { max-width: 900px; margin: 0; font-size: clamp(42px, 5vw, 72px); line-height: 0.98; letter-spacing: -0.055em; }
.lede { max-width: 970px; margin: 22px 0 0; color: var(--soft); font-size: 16px; line-height: 1.68; }
.hero-metric {
  min-width: 205px;
  padding: 18px 20px;
  border-left: 1px solid var(--line-strong);
}
.hero-metric span, .hero-metric small { display: block; color: var(--muted); font-size: 11px; }
.hero-metric strong { display: block; margin: 6px 0 4px; font: 600 28px/1 var(--mono); letter-spacing: -0.04em; }

.control-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.button {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-strong); background: var(--panel-raised); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: 0.43; cursor: not-allowed; }
.button.primary { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.button.primary:hover:not(:disabled) { background: #d3ff65; border-color: #d3ff65; }
.button.danger { color: #ffb4b8; }
.button-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 9px; font: 700 15px/1 var(--mono); opacity: 0.72; }
.button strong, .button small { display: block; }
.button strong { font-size: 13px; }
.button small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.button.primary small { color: rgba(17, 23, 7, 0.62); }

.status-strip {
  min-height: 61px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 34%) 42px;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(10, 13, 18, 0.78);
}
.status-copy { display: flex; align-items: center; gap: 11px; min-width: 0; }
.status-copy strong, .status-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-copy strong { font-size: 12px; }
.status-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 12px rgba(255,204,102,0.4); }
.status-dot.ok { background: var(--accent); box-shadow: 0 0 12px rgba(200,255,67,0.4); }
.status-dot.fail { background: var(--danger); box-shadow: 0 0 12px rgba(255,110,118,0.4); }
.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: #252b34; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width 180ms ease; }
.progress-label { color: var(--muted); font: 600 10px/1 var(--mono); text-align: right; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 12px; align-items: stretch; }
.terminal-card, .side-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(22px); }
.terminal-card { min-width: 0; overflow: hidden; }
.terminal-toolbar {
  height: 56px;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.018);
}
.traffic-lights { display: flex; gap: 7px; }
.traffic-lights i { width: 9px; height: 9px; border-radius: 50%; background: #3a414b; }
.traffic-lights i:first-child { background: #ff6e76; }
.traffic-lights i:nth-child(2) { background: #ffcc66; }
.traffic-lights i:last-child { background: #7bd88f; }
.terminal-title { text-align: center; min-width: 0; }
.terminal-title span { display: block; font: 600 11px/1.2 var(--mono); }
.terminal-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.terminal-actions { display: flex; align-items: center; gap: 4px; }
.text-button, .icon-button {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.text-button { padding: 7px 8px; border-radius: 7px; font: 600 9px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.text-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { color: var(--text); border-color: var(--line); background: rgba(255,255,255,0.035); }
.text-button:disabled, .icon-button:disabled { opacity: 0.4; cursor: not-allowed; }
.terminal-stage { position: relative; height: min(64vh, 720px); min-height: 480px; padding: 15px; background: #080b0f; }
#terminal { width: 100%; height: 100%; }
#terminal .xterm { height: 100%; }
#terminal .xterm-viewport { scrollbar-color: #343b46 transparent; }
.terminal-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(rgba(8,11,15,0.9), rgba(8,11,15,0.96)),
    repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(255,255,255,0.02) 24px);
}
.terminal-placeholder.hidden { display: none; }
.prompt-glyph { margin-bottom: 15px; color: var(--accent); font: 700 30px/1 var(--mono); }
.terminal-placeholder strong { color: var(--soft); font-size: 14px; }
.terminal-placeholder p { max-width: 430px; margin: 8px 0 0; font-size: 12px; line-height: 1.55; }
.terminal-footer { min-height: 42px; display: flex; align-items: center; gap: 18px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--muted); font: 500 9px/1.3 var(--mono); flex-wrap: wrap; }
.terminal-footer strong { color: var(--soft); font-weight: 500; }

.side-panel { overflow: hidden; }
.panel-section { padding: 20px; border-bottom: 1px solid var(--line); }
.panel-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading h2, .panel-section h2 { margin: 0; font-size: 15px; letter-spacing: -0.02em; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 16px; }
.command-sequence { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.command-sequence li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; color: var(--soft); font-size: 11px; line-height: 1.45; }
.command-sequence li > span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--accent); font: 700 9px/1 var(--mono); }
.command-sequence code { display: block; margin-top: 5px; padding: 7px 8px; overflow: hidden; color: #e6f7bd; background: #090c10; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.security-note { margin: 15px 0 0; padding: 10px 11px; border-left: 2px solid var(--accent); color: var(--muted); background: rgba(200,255,67,0.035); font-size: 10px; line-height: 1.5; }
.asset-list { display: grid; gap: 6px; max-height: 214px; overflow: auto; padding-right: 3px; }
.asset-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 25px; color: var(--muted); font: 500 9px/1 var(--mono); }
.asset-row i { width: 6px; height: 6px; border-radius: 50%; background: #343c47; }
.asset-row.cached i { background: var(--accent); box-shadow: 0 0 7px rgba(200,255,67,0.3); }
.asset-row span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.asset-row small { color: #66707c; font: inherit; }
.caveats ul { margin: 13px 0 0; padding-left: 17px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.caveats li + li { margin-top: 7px; }

footer { width: min(1540px, calc(100% - 48px)); min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; color: #626b76; font: 500 9px/1 var(--mono); }

@media (max-width: 1120px) {
  .control-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: repeat(3, 1fr); }
  .panel-section { border-bottom: 0; border-right: 1px solid var(--line); }
  .panel-section:last-child { border-right: 0; }
}
@media (max-width: 760px) {
  .site-header, .app-shell, footer { width: min(100% - 24px, 1540px); }
  .site-header { height: auto; min-height: 76px; padding: 12px 0; gap: 12px; }
  .header-badges { display: none; }
  .app-shell { padding-top: 32px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-metric { padding-left: 0; border-left: 0; }
  .control-deck { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr 42px; }
  .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .progress-label { grid-column: 2; grid-row: 1; }
  .terminal-toolbar { grid-template-columns: auto 1fr; }
  .terminal-title { text-align: left; }
  .terminal-actions { display: none; }
  .terminal-stage { min-height: 420px; height: 68vh; padding: 8px; }
  .side-panel { grid-template-columns: 1fr; }
  .panel-section { border-right: 0; border-bottom: 1px solid var(--line); }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; }
}
.liveness { display: flex; align-items: center; gap: 14px; padding: 7px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.liveness-grid { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); font: 500 10px/1.3 var(--mono); flex-wrap: wrap; }
.liveness[data-vm-state="input-stalled"] .liveness-grid,
.liveness.stalled .liveness-grid { color: var(--red, #ff6e76); }
.liveness-banner { flex-basis: 100%; margin: 4px 0 0; padding: 6px 10px; border: 1px solid var(--red, #ff6e76); border-radius: 6px; color: var(--red, #ff6e76); font: 500 10px/1.4 var(--mono); }
.liveness-actions { display: flex; gap: 8px; margin-left: auto; }
