/* ConfigHub Walkthrough Factory: shared high-contrast, arrival-gated sketchbook theme. */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: #FAF8F2; color: #0F172A;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.36; overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; }

.topbar {
  background: #FFFFFF; border-bottom: 2px solid #0F172A; padding: 6px 16px;
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
}
.brand-group { display: flex; align-items: center; gap: 10px; }
.topbar-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.subtitle { font-size: 13px; color: #1E293B; font-weight: 600; }
.step-nav { display: flex; gap: 4px; align-items: center; }

.step-pill, .ctrl-btn, .node-tag, .node-row, .callout-kicker, .beat-pill, .takeaway-label, .term-box, .yaml-snippet, .gate-badge, .test-pill, .zone-badge, .cmd-code, .cmd-tag, .cmd-prompt, .browser-url, .sb-tab, .prod-banner, .bc-badge, .bc-hint, .override-pin, .ver-badge, .yaml-inspector, .audit-head, .audit-badge {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.step-pill {
  background: #FFFFFF; color: #0F172A; border: 2px solid #0F172A; border-radius: 4px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.step-pill:hover { background: #FEF08A; }
.step-pill.done { background: #CCFBF1; border-color: #0F766E; color: #0F766E; }
.step-pill.active { background: #0F172A; border-color: #0F172A; color: #FFFFFF; }

.ctrl-btn {
  background: #FFFFFF; color: #0F172A; border: 2px solid #0F172A; border-radius: 4px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; box-shadow: 2px 2px 0 #0F172A;
}
.ctrl-btn:hover { background: #FAF8F2; }
.ctrl-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.ctrl-btn:disabled { color: #94A3B8; border-color: #94A3B8; box-shadow: none; cursor: default; }

.main-wrap { padding: 6px 16px 4px; display: flex; flex-direction: column; align-items: center; }

.telemetry-bar {
  width: calc(100vw - 32px); max-width: 1720px; margin: 0 auto 8px; padding: 5px 12px;
  background: #FFFFFF; border: 2px solid #0F172A; border-radius: 6px;
  box-shadow: 3px 3px 0 #0F172A;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 4px; border: 1.5px solid #0F172A;
  background: #F1F5F9; color: #0F172A; font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px; font-weight: 700;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #475569; display: inline-block; }
.live-pill.live-on { background: #DCFCE7; border-color: #15803D; color: #14532D; }
.live-pill.live-on .live-dot { background: #16A34A; }
.live-pill.live-prod { background: #D1FAE5; border-color: #047857; color: #064E3B; }
.live-pill.live-prod .live-dot { background: #059669; }
.live-pill.live-alert { background: #FEE2E2; border-color: #B91C1C; color: #7F1D1D; }
.live-pill.live-alert .live-dot { background: #DC2626; }

.counters-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.counter-chip {
  padding: 2px 9px; background: #FAF8F2; border: 1.5px solid #0F172A; border-radius: 4px;
  font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 600; color: #0F172A;
}
.counter-chip strong { font-weight: 700; color: #1D4ED8; }

/* 2-Row Workspace Grid: Full-width Command Deck on top, 2/3 Topology + 1/3 Right Panel (or full-width Topology) below */
.workspace-grid {
  position: relative; width: calc(100vw - 32px); max-width: 1720px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto 1fr; gap: 12px; align-items: stretch;
}
.workspace-grid.layout-full {
  grid-template-columns: 1fr;
}

/* Row 1: Full-Width Static Command Deck (Compact High-Contrast Guide ~31% + Widened Console ~69%) */
.command-deck {
  grid-column: 1 / -1; position: relative; z-index: 4;
  height: 248px;
  background: #FEF08A; border: 2px solid #0F172A; border-radius: 6px; box-shadow: 4px 4px 0 #0F172A;
  padding: 12px 14px;
  display: grid; grid-template-columns: 0.62fr 1.38fr; gap: 14px; align-items: stretch;
  overflow: hidden;
}
.command-deck.alert {
  background: #FEE2E2; border-color: #B91C1C; box-shadow: 4px 4px 0 #B91C1C;
}
.command-deck.alert .callout-kicker { color: #991B1B; }

.deck-guide {
  display: flex; flex-direction: column; gap: 7px; min-width: 0; height: 100%; overflow: hidden;
}
.deck-top-row {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.callout-kicker {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #0F172A; white-space: nowrap;
}
.guide-step-dots { display: flex; gap: 4px; align-items: center; flex: 1; min-width: 50px; }
.guide-dot { height: 6px; flex: 1; border-radius: 999px; background: rgba(15, 23, 42, 0.16); border: 1px solid #0F172A; }
.guide-dot.done { background: #15803D; }
.guide-dot.current { background: #EA580C; }

.beat-pill {
  background: #0F172A; color: #FFFFFF; border-radius: 4px; padding: 2px 6px;
  font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

.callout-title {
  font-size: 20px; font-weight: 700; color: #0F172A; line-height: 1.18; margin: 0;
  text-wrap: balance;
}

.takeaway-strip {
  background: #FFFFFF; border: 1.5px solid #0F172A; border-left: 4px solid #1D4ED8;
  border-radius: 4px; padding: 6px 9px; font-size: 13.6px; font-weight: 500; line-height: 1.3; color: #0F172A;
}
.takeaway-strip.alert {
  background: #FFFFFF; border-color: #B91C1C; border-left-color: #DC2626; color: #0F172A;
}
.takeaway-strip.recap {
  background: #DCFCE7; border-color: #047857; border-left-color: #047857; color: #0F172A;
}
.takeaway-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #0F172A; margin-right: 6px;
}
.takeaway-strip.alert .takeaway-label { color: #991B1B; }
.takeaway-strip.recap .takeaway-label { color: #064E3B; }

.guide-actions {
  margin-top: auto; display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.btn-action {
  background: #0F172A; color: #FFFFFF; border: 2px solid #0F172A; border-radius: 4px;
  padding: 0 14px; height: 36px; font-size: 13.5px; font-weight: 700; box-shadow: 2px 2px 0 #64748B;
  flex: 0 1 auto; min-width: 170px; max-width: 310px;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-action.orange { background: #EA580C; box-shadow: 2px 2px 0 #0F172A; }
.btn-action:hover { background: #C2410C; }
.btn-action:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-action.busy { opacity: 0.9; }

.btn-step {
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF; color: #0F172A; border: 2px solid #0F172A; border-radius: 4px;
  box-shadow: 2px 2px 0 #0F172A;
}
.btn-step:hover:not(:disabled) { background: #FAF8F2; border-color: #EA580C; color: #EA580C; }
.btn-step:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.btn-step:disabled { color: #94A3B8; border-color: #94A3B8; box-shadow: none; cursor: default; background: #F8FAFC; }

/* Right ~69% of Command Deck: Widened High-Contrast Console */
.term-box {
  background: #0F172A; color: #F8FAFC; border: 2px solid #0F172A; border-radius: 5px;
  padding: 9px 13px; display: flex; flex-direction: column; gap: 6px;
  height: 100%; min-height: 0; overflow: hidden;
}
.term-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: #CBD5E1; border-bottom: 1px solid #334155; padding-bottom: 5px; flex-shrink: 0;
}
.term-dots { display: inline-flex; gap: 5px; align-items: center; }
.term-dots span { width: 8px; height: 8px; border-radius: 50%; background: #475569; }
.term-dots span:first-child { background: #EF4444; }
.term-dots span:nth-child(2) { background: #FACC15; }
.term-dots span:nth-child(3) { background: #22C55E; }

.term-entries {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 7px;
  flex: 1; min-height: 0; overflow: hidden;
}
.term-entry { display: flex; flex-direction: column; gap: 2.5px; border-left: 3px solid #475569; padding-left: 10px; min-width: 0; }
.term-entry.is-done {
  flex-direction: row; align-items: baseline; gap: 10px;
  border-left-color: #475569; padding-left: 10px;
}
.term-entry.is-done .term-prompt { font-size: 12.8px; color: #CBD5E1; font-weight: 600; flex-shrink: 0; max-width: 50%; }
.term-entry.is-done .term-out { font-size: 12.5px; color: #94A3B8; padding-left: 0; flex: 1; }
.term-entry.is-latest { border-left-color: #EA580C; padding-top: 2px; }
.term-prompt {
  font-size: 15px; color: #FACC15; font-weight: 700; line-height: 1.28;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-claude {
  font-size: 13.5px; color: #38BDF8; font-weight: 600; line-height: 1.28; padding-left: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-out {
  font-size: 13.5px; color: #86EFAC; font-weight: 600; line-height: 1.28; padding-left: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-out.err { color: #FCA5A5; font-weight: 700; }

/* Row 2 Left: Static Planar Topology Canvas (click anywhere to step forward) */
.stage-canvas {
  position: relative; width: 100%;
  height: clamp(590px, calc(100vh - 404px), 760px);
  background: #FAF8F2; border: 2px solid #0F172A; border-radius: 6px;
  box-shadow: 4px 4px 0 #0F172A;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px); background-size: 20px 20px;
  cursor: pointer;
}
.zone-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#graphSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.nodes-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.callout-layer { position: absolute; inset: 0; z-index: 9; pointer-events: none; }

.zone-box {
  position: absolute; z-index: 1; background: #F8FAFC; border: 2px dashed #475569;
  border-radius: 6px; padding: 6px 10px;
  display: flex; flex-direction: column;
}
.zone-box.zone-local { background: #EFF6FF; border-color: #1E3A8A; }
.zone-box.zone-hub { background: #EFF6FF; border: 2px solid #1E3A8A; }
.zone-box.zone-vpc { background: #F0FDFA; border: 2px dashed #0F766E; }
.zone-box.zone-servers { background: #F8FAFC; border: 2px dashed #334155; }
.zone-box.zone-prod { background: #ECFDF5; border: 2px solid #047857; }
.zone-box.zone-standby { background: rgba(248, 250, 252, 0.85); border: 2px dashed #64748B; }
.zone-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: #0F172A;
}
.zone-box.zone-local .zone-head, .zone-box.zone-hub .zone-head { color: #1E3A8A; }
.zone-box.zone-vpc .zone-head { color: #115E59; }
.zone-box.zone-prod .zone-head { color: #065F46; }
.zone-box.zone-standby .zone-head { color: #0F172A; }
.zone-badge {
  background: #0F172A; color: #FFFFFF; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1.5px 8px; white-space: nowrap;
}
.zone-box.zone-vpc .zone-badge { background: #0F766E; }
.zone-box.zone-hub .zone-badge { background: #1E3A8A; }
.zone-box.zone-prod .zone-badge { background: #047857; }
.zone-box.zone-standby .zone-badge { background: #334155; }
.zone-standby-note {
  margin: auto 0; text-align: center; font-size: 13px; font-weight: 600; color: #0F172A;
}

.node {
  position: absolute; z-index: 4; pointer-events: auto; background: #FFFFFF; border: 2px solid #0F172A;
  border-radius: 6px; box-shadow: 3px 3px 0 #0F172A; padding: 5px 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.node.node-compact { padding: 4px 8px; gap: 2px; }
.node.clickable { cursor: pointer; }
.node.clickable:hover { border-color: #EA580C; }
.node.is-selected { outline: 3px solid #EA580C; outline-offset: 2px; }
.node.is-focus {
  outline: 3px solid #EA580C; outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(234, 88, 12, 0.16), 3px 3px 0 #0F172A;
}
.node.state-red.is-focus {
  outline-color: #DC2626;
  box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.22), 3px 3px 0 #DC2626;
}
.node.state-prod.is-focus {
  outline-color: #047857;
  box-shadow: 0 0 0 6px rgba(4, 120, 87, 0.22), 3px 3px 0 #047857;
}
.node.state-ok { background: #DCFCE7; border-color: #15803D; box-shadow: 3px 3px 0 #15803D; }
.node.state-prod { background: #D1FAE5; border-color: #047857; box-shadow: 3px 3px 0 #047857; }
.node.state-blue { background: #DBEAFE; border-color: #1D4ED8; box-shadow: 3px 3px 0 #1D4ED8; }
.node.state-teal { background: #CCFBF1; border-color: #0F766E; box-shadow: 3px 3px 0 #0F766E; }
.node.state-red { background: #FEE2E2; border-color: #DC2626; box-shadow: 3px 3px 0 #DC2626; }
.node.state-amber { background: #FEF3C7; border-color: #B45309; box-shadow: 3px 3px 0 #B45309; }
.node.state-running { background: #FEF9C3; border-color: #CA8A04; box-shadow: 3px 3px 0 #CA8A04; }
.node.state-working { background: #FEFCE8; border-color: #B45309; box-shadow: 3px 3px 0 #B45309; }
.node.state-human { background: #FFF7ED; border-color: #EA580C; box-shadow: 3px 3px 0 #EA580C; padding: 6px 8px; }
.node.state-hub { background: #EFF6FF; border: 2px solid #1E3A8A; box-shadow: 3px 3px 0 #1E3A8A; }
.node.state-hub .node-tag { background: #1E3A8A; color: #FFFFFF; border-color: #1E3A8A; }
.node.state-standby {
  background: rgba(248, 250, 252, 0.9); border: 2px dashed #64748B; box-shadow: none;
}
.node.state-standby .node-title, .node.state-standby .node-row { color: #1E293B; }
.node.state-standby .node-tag { color: #1E293B; border-color: #64748B; background: #F8FAFC; }
.node.state-done {
  background: #E2E8F0; border: 2px solid #64748B; box-shadow: 2px 2px 0 #94A3B8;
}
.node.state-done .node-title, .node.state-done .node-row { color: #1E293B; }
.node.state-done .node-tag { background: #CBD5E1; color: #0F172A; border-color: #64748B; }

.human-art {
  display: flex; align-items: center; justify-content: center;
  margin: 4px 0 2px; padding: 4px;
  background: #FFFFFF; border: 1.5px solid #0F172A; border-radius: 5px;
}
.human-art.compact {
  margin: 2px 0 1px; padding: 2px 3px;
}

.node.node-pulse { animation: nodePop 0.28s ease-out; }
.node.node-enter { animation: nodeEnter 0.24s ease-out; }
.panel-enter { animation: nodeEnter 0.24s ease-out; }
@keyframes nodePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes nodeEnter {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.node-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.node-title {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.8px; font-weight: 700; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node-title svg { flex-shrink: 0; }
.node-head-right { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.node-tag {
  font-size: 11px; font-weight: 700; color: #0F172A; background: #FFFFFF;
  border: 1.5px solid #0F172A; border-radius: 3px; padding: 1px 5px; white-space: nowrap; flex-shrink: 0;
}
.override-pin {
  font-size: 9.8px; font-weight: 700; color: #FFFFFF; background: #1D4ED8;
  border: 1.5px solid #0F172A; border-radius: 3px; padding: 1px 4px; white-space: nowrap;
}
.ver-badge {
  font-size: 9.8px; font-weight: 700; color: #FFFFFF; background: #0F766E;
  border: 1.5px solid #0F172A; border-radius: 3px; padding: 1px 4px; white-space: nowrap;
}
.node-rows { display: flex; flex-direction: column; gap: 2.5px; }
.node-row {
  font-size: 11.8px; color: #0F172A; font-weight: 600; display: flex; justify-content: space-between;
  align-items: center; gap: 5px; white-space: nowrap; overflow: hidden;
}
.node-row > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.node-row.wrap-row { white-space: normal; line-height: 1.22; font-size: 11.4px; }
.test-strip { display: flex; flex-wrap: nowrap; gap: 3.5px; margin-top: 1px; }
.test-pill {
  font-size: 9.8px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
  background: #DCFCE7; color: #14532D; border: 1px solid #15803D;
}
.test-pill.fail { background: #DC2626; color: #FFFFFF; border-color: #7F1D1D; }
.test-pill.muted { background: #F1F5F9; color: #334155; border-color: #64748B; }
.test-pill.done { background: #CBD5E1; color: #1E293B; border-color: #64748B; }

.gate-badge {
  font-size: 10.2px; font-weight: 700; padding: 1px 5px; border-radius: 3px; white-space: nowrap;
  background: #15803D; color: #FFFFFF; border: 1px solid #0F172A; flex-shrink: 0;
}
.gate-badge.fail { background: #DC2626; border-color: #7F1D1D; }
.gate-badge.blue { background: #1D4ED8; border-color: #0F172A; }
.gate-badge.teal { background: #0F766E; border-color: #0F172A; }
.gate-badge.amber { background: #B45309; border-color: #78350F; }
.gate-badge.done { background: #475569; border-color: #334155; color: #FFFFFF; }
.gate-badge.prod { background: #047857; border-color: #064E3B; color: #FFFFFF; }
.gate-badge.running, .gate-badge.working {
  background: #B45309; border-color: #78350F; color: #FFFFFF;
  display: inline-flex; align-items: center; gap: 3.5px;
}
.spin-dot {
  width: 7.5px; height: 7.5px; border-radius: 50%;
  border: 1.8px solid rgba(255, 255, 255, 0.35); border-top-color: #FFFFFF;
  display: inline-block; animation: spin360 0.7s linear infinite;
}
.clock-icon { width: 10.5px; height: 10.5px; display: inline-block; flex-shrink: 0; }
@keyframes spin360 {
  to { transform: rotate(360deg); }
}

/* Flush-Anchored High-Contrast Floating Beat Callout Popover */
.beat-callout {
  position: absolute; pointer-events: auto; cursor: pointer;
  width: clamp(268px, 21vw, 316px);
  background: #FFFBEB; color: #0F172A;
  border: 2.5px solid #0F172A; border-radius: 8px;
  box-shadow: 5px 5px 0 #0F172A;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 7px;
  animation: calloutIn 0.2s ease-out;
}
.beat-callout.is-alert {
  background: #FEF2F2; border-color: #B91C1C; box-shadow: 5px 5px 0 #B91C1C;
}
.beat-callout.is-prod {
  background: #ECFDF5; border-color: #047857; box-shadow: 5px 5px 0 #047857;
}
@keyframes calloutIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.beat-callout::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  background: inherit; border-top: 2.5px solid #0F172A; border-left: 2.5px solid #0F172A;
}
.beat-callout.is-alert::after { border-color: #B91C1C; }
.beat-callout.is-prod::after { border-color: #047857; }
.beat-callout.arrow-top::after { top: -9px; left: calc(var(--arrow-pos, 32px) - 9.5px); transform: rotate(45deg); }
.beat-callout.arrow-bottom::after { bottom: -9px; left: calc(var(--arrow-pos, 32px) - 9.5px); transform: rotate(225deg); }
.beat-callout.arrow-left::after { left: -9px; top: calc(var(--arrow-pos, 28px) - 9.5px); transform: rotate(-45deg); }
.beat-callout.arrow-right::after { right: -9px; top: calc(var(--arrow-pos, 28px) - 9.5px); transform: rotate(135deg); }

.bc-head { display: flex; align-items: center; gap: 8px; }
.bc-badge {
  background: #EA580C; color: #FFFFFF; border-radius: 4px; padding: 2px 7px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.beat-callout.is-alert .bc-badge { background: #DC2626; }
.beat-callout.is-prod .bc-badge { background: #047857; }
.bc-title {
  font-size: 16.5px; font-weight: 700; color: #0F172A; line-height: 1.2; flex: 1;
  text-wrap: balance;
}
.bc-body { font-size: 14.2px; font-weight: 500; color: #0F172A; line-height: 1.32; }
.bc-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding-top: 4px;
}
.bc-hint { font-size: 11px; color: #1E293B; font-weight: 600; margin-right: auto; }
.bc-next {
  background: #0F172A; color: #FFFFFF; border: 1.5px solid #0F172A; border-radius: 4px;
  padding: 4px 11px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.bc-next:hover { background: #EA580C; border-color: #EA580C; }

/* Row 2 Right (1/3): Composable Live Preview / YAML Inspector Panel */
.preview-panel {
  position: relative; z-index: 4;
  height: clamp(590px, calc(100vh - 404px), 760px);
  background: #FFFFFF; border: 2px solid #0F172A; border-radius: 6px; box-shadow: 4px 4px 0 #0F172A;
  padding: 9px 11px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  overflow: hidden;
}
.preview-panel[hidden] { display: none; }
.preview-panel.push-glow {
  border-color: #15803D; box-shadow: 4px 4px 0 #15803D;
}
.preview-panel.is-prod-panel {
  background: #ECFDF5; border-color: #047857; box-shadow: 4px 4px 0 #047857;
}
.preview-panel.is-alert-panel {
  background: #FEF2F2; border-color: #B91C1C; box-shadow: 4px 4px 0 #B91C1C;
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.preview-kicker {
  font-family: "IBM Plex Mono", monospace; font-size: 11.8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: #1D4ED8;
}
.preview-panel.is-prod-panel .preview-kicker { color: #065F46; }
.preview-panel.is-alert-panel .preview-kicker { color: #991B1B; }

.prod-banner {
  background: #065F46; color: #FFFFFF; border: 1.5px solid #064E3B; border-radius: 4px;
  padding: 4px 8px; font-size: 11.2px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-shrink: 0;
}
.prod-banner-left { display: inline-flex; align-items: center; gap: 6px; }

.browser-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #F1F5F9; border: 1.5px solid #0F172A; border-radius: 4px; padding: 4px 8px; flex-shrink: 0;
}
.browser-bar.is-prod {
  background: #D1FAE5; border-color: #047857;
}
.browser-url {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: #0F172A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser-bar.is-prod .browser-url { color: #064E3B; }

.tab-row { display: flex; gap: 5px; flex-shrink: 0; }
.sb-tab {
  flex: 1; background: #FFFFFF; color: #0F172A; border: 1.5px solid #0F172A; border-radius: 4px;
  padding: 4px 4px; font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap;
}
.sb-tab:disabled { background: #F1F5F9; color: #94A3B8; border-color: #CBD5E1; cursor: default; }
.sb-tab.active { background: #0F172A; color: #FFFFFF; }
.sb-tab.prod-tab { border-color: #047857; color: #065F46; background: #D1FAE5; }
.sb-tab.prod-tab.active { background: #047857; color: #FFFFFF; }
.sb-tab.fail { background: #FEE2E2; border-color: #DC2626; color: #991B1B; }
.sb-tab.fail.active { background: #DC2626; color: #FFFFFF; }

.app-viewport {
  flex: 1; min-height: 0; background: #FAF8F2; border: 2px solid #0F172A; border-radius: 5px;
  padding: 6px; display: flex; flex-direction: column; gap: 4.5px; overflow: hidden;
}
.app-viewport.is-prod { background: #FFFFFF; border-color: #047857; }
.app-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 7px; color: #0F172A; font-size: 14.5px; padding: 16px;
  border: 2px dashed #64748B; border-radius: 4px; background: #FFFFFF;
}
.mp-top {
  display: flex; align-items: center; justify-content: space-between;
  background: #0F172A; color: #FFFFFF; border-radius: 4px; padding: 4.5px 9px; flex-shrink: 0;
}
.mp-top.is-prod { background: #064E3B; }
.mp-logo { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.mp-bal { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 700; color: #86EFAC; }

.mp-ticker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex-shrink: 0;
}
.mp-tick-chip {
  background: #FFFFFF; border: 1.5px solid #0F172A; border-radius: 3px; padding: 2.5px 4px;
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 700; text-align: center;
}
.mp-tick-chip span { display: block; color: #15803D; font-size: 9.8px; }

.mp-card {
  background: #FFFFFF; border: 1.5px solid #0F172A; border-radius: 4px; padding: 4px 7px;
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.mp-card-title { font-size: 11.8px; font-weight: 700; color: #0F172A; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mp-watch-row {
  display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace;
  font-size: 11.2px; font-weight: 600; color: #0F172A; border-top: 1px solid #E2E8F0; padding-top: 1.5px;
}
.mp-up { color: #15803D; }

.mp-heatmap { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.mp-hm-cell {
  border: 1.5px solid #0F172A; border-radius: 3px; padding: 2.5px 6px;
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 700;
  display: flex; justify-content: space-between; background: #DCFCE7; color: #14532D;
}
.mp-hm-cell.neg { background: #FEE2E2; color: #7F1D1D; }

.mp-alerts { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.mp-alert-item {
  background: #EFF6FF; border-left: 3px solid #1D4ED8; padding: 2px 6px; border-radius: 2px;
  font-weight: 600; color: #0F172A;
}

.mp-gate-block {
  background: #FEE2E2; border: 2px solid #DC2626; border-radius: 4px; padding: 9px 10px;
  font-size: 12.6px; color: #0F172A; font-weight: 600; line-height: 1.32; flex-shrink: 0;
}
.mp-gate-block strong { display: block; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #B91C1C; margin-bottom: 3px; }

.yaml-box {
  background: #0F172A; color: #F8FAFC; border: 2px solid #0F172A; border-radius: 5px;
  padding: 5.5px 9px; flex-shrink: 0; overflow: hidden;
}
.yaml-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: 10.2px; font-weight: 700; color: #CBD5E1; margin-bottom: 2.5px;
}
.yaml-snippet { margin: 0; font-size: 10.8px; line-height: 1.25; color: #F8FAFC; white-space: pre; overflow: hidden; }

/* Live Concrete YAML Inspector Panel (panel: yaml) */
.yaml-inspector {
  flex: 1; min-height: 0; background: #0F172A; color: #F8FAFC;
  border: 2px solid #0F172A; border-radius: 5px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  font-size: 11.4px; line-height: 1.34;
}
.yaml-inspector.is-prod { border-color: #047857; }
.yaml-line {
  white-space: pre; overflow: hidden; text-overflow: ellipsis;
  padding: 0.5px 5px; border-radius: 2px; border-left: 3px solid transparent;
}
.yaml-line.yl-add { background: rgba(34, 197, 94, 0.16); color: #86EFAC; border-left-color: #22C55E; font-weight: 700; }
.yaml-line.yl-override { background: rgba(59, 130, 246, 0.22); color: #93C5FD; border-left-color: #3B82F6; font-weight: 700; }
.yaml-line.yl-block { background: rgba(239, 68, 68, 0.22); color: #FCA5A5; border-left-color: #EF4444; font-weight: 700; }
.yaml-line.yl-muted { color: #94A3B8; }

.audit-box {
  background: #FAF8F2; border: 2px solid #0F172A; border-radius: 5px;
  padding: 7px 9px; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
}
.audit-box.is-prod { background: #D1FAE5; border-color: #047857; }
.audit-box.is-alert { background: #FEE2E2; border-color: #B91C1C; }
.audit-head {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 10.8px; font-weight: 700; color: #0F172A; text-transform: uppercase;
}
.audit-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.audit-badge {
  font-size: 10.2px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  background: #FFFFFF; color: #0F172A; border: 1.5px solid #0F172A;
}
.audit-badge.ok { background: #DCFCE7; border-color: #15803D; color: #14532D; }
.audit-badge.blue { background: #DBEAFE; border-color: #1D4ED8; color: #1E3A8A; }
.audit-badge.fail { background: #DC2626; border-color: #7F1D1D; color: #FFFFFF; }
.audit-badge.prod { background: #047857; border-color: #064E3B; color: #FFFFFF; }
.audit-note { font-size: 12px; font-weight: 600; color: #0F172A; line-height: 1.28; }
.audit-copy-btn {
  align-self: flex-start; background: #0F172A; color: #FFFFFF; border: 1.5px solid #0F172A;
  border-radius: 4px; padding: 3px 9px; font-size: 11.5px; font-weight: 700;
}
.audit-copy-btn:hover { background: #047857; border-color: #047857; }

/* Click pointer & bridge overlay */
.click-float-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
#bridgeSvg, #clickArrowSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.click-badge {
  position: absolute; background: #EA580C; color: #FFFFFF;
  border: 2px solid #0F172A; box-shadow: 3px 3px 0 #0F172A;
  border-radius: 4px; padding: 3px 9px; font-family: "IBM Plex Sans", sans-serif;
  font-weight: 700; font-size: 12px; line-height: 1.1; white-space: nowrap;
  animation: clickBob 1.1s ease-in-out infinite;
}
@keyframes clickBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.confetti-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; width: 8px; height: 8px; border: 1.5px solid #0F172A;
  border-radius: 2px; animation: confettiDrop 1.4s ease-out forwards;
}
@keyframes confettiDrop {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx, 0px), var(--dy, 120px)) rotate(260deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .click-badge, .confetti-piece, .spin-dot, .beat-callout { animation: none; }
}

/* Bottom Behind-the-Scenes CLI strip */
.cmd-bar {
  width: calc(100vw - 32px); max-width: 1720px; margin: 8px auto 0; padding: 6px 12px;
  background: #0F172A; color: #F8FAFC; border: 2px solid #0F172A; border-radius: 6px;
  box-shadow: 3px 3px 0 #475569; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: border-color 0.2s ease;
}
.cmd-bar.cmd-flash { border-color: #EA580C; }
.cmd-left { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.cmd-tag { background: #1D4ED8; color: #FFFFFF; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 3px; flex-shrink: 0; }
.cmd-prompt { color: #FACC15; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.cmd-code { font-size: 13px; font-weight: 500; color: #F8FAFC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-copy {
  background: #FFFFFF; color: #0F172A; border: 1.5px solid #0F172A; border-radius: 4px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.cmd-copy:hover { background: #EA580C; color: #FFFFFF; }

.site-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 5px 16px 8px; font-size: 12px; color: #1E293B; width: calc(100vw - 32px); max-width: 1720px; margin: 0 auto;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #0F172A; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: #EA580C; }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; width: 100%; max-width: 100%; }
  .command-deck {
    height: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 12px;
    min-width: 0; max-width: 100%;
  }
  .deck-guide { height: auto; overflow: visible; min-width: 0; }
  .callout-title { white-space: normal; font-size: 19px; }
  .term-box { height: auto; min-height: 150px; min-width: 0; max-width: 100%; }
  .term-head { flex-wrap: wrap; gap: 6px; }
  .term-entry.is-done { flex-direction: column; gap: 2px; }
  .term-entry.is-done .term-prompt { max-width: 100%; }
  .term-prompt, .term-claude, .term-out { white-space: normal; word-break: break-word; }
  .btn-action { white-space: normal; height: auto; min-height: 36px; flex: 1; max-width: none; }
  .stage-canvas, .preview-panel { height: auto; min-width: 0; max-width: 100%; }
  .stage-canvas { padding: 12px; display: flex; flex-direction: column; gap: 10px; cursor: default; }
  #graphSvg, .click-float-layer, .confetti-layer, .callout-layer { display: none; }
  .cmd-code { white-space: normal; word-break: break-word; }
  .zone-layer, .nodes-layer { display: contents; }
  .node, .zone-box {
    position: static !important; width: 100% !important; height: auto !important; transform: none;
    min-width: 0; max-width: 100%;
  }
  .zone-box { display: flex; flex-direction: column; gap: 8px; }
  .zone-head, .node-head, .node-row, .prod-banner { flex-wrap: wrap; white-space: normal; }
  .zone-badge { white-space: normal; text-align: center; }
  .yaml-snippet, .yaml-line { white-space: pre-wrap; word-break: break-word; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; }
  .subtitle { display: none; }
  .step-nav { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .step-pill { text-align: center; padding: 5px 4px; font-size: 10px; }
  .main-wrap { padding: 8px 10px; }
  .telemetry-bar, .workspace-grid, .cmd-bar, .site-footer { width: 100%; max-width: 100%; }
  .deck-top-row { flex-wrap: wrap; gap: 6px; }
  .tab-row { flex-wrap: wrap; }
  .sb-tab { flex: 1 1 30%; }
}
