/* ==========================================================================
   BLASTGATE — GRAPH-POWERED ENGINEERING INVESTIGATION CONSOLE
   Design Direction: Precision Developer Tool / Minimal Dark Engineering SaaS
   Palette: Deep Slate / Obsidian Canvas, Crisp Typography, High-Signal Indicators
   ========================================================================== */

:root {
  /* Surface & Base Hierarchy — Deep Obsidian & Precision Graphite */
  --ground: #080a0f;
  --surface: #0e131d;
  --surface-raised: #141c2b;
  --surface-card: #192336;
  --surface-sunken: #05070b;
  --surface-hover: #1e2b42;

  /* Crisp Engineering Borders */
  --rule: #1e293b;
  --rule-subtle: rgba(255, 255, 255, 0.06);
  --rule-hover: #334155;
  --rule-active: #8b5cf6;

  /* Typography Colors */
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --subtle: #64748b;

  /* High-Signal Verdict Colors */
  --block: #f43f5e;
  --block-bg: rgba(244, 63, 94, 0.12);
  --block-border: rgba(244, 63, 94, 0.4);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.4);
  --clear: #10b981;
  --clear-bg: rgba(16, 185, 129, 0.12);
  --clear-border: rgba(16, 185, 129, 0.4);

  /* Accents & Signals */
  --focus: #38bdf8;
  --focus-bg: rgba(56, 189, 248, 0.10);
  --cyan: #38bdf8;
  --cyan-bg: rgba(56, 189, 248, 0.10);
  --violet: #8b5cf6;
  --violet-bg: rgba(139, 92, 246, 0.10);
  --violet-border: rgba(139, 92, 246, 0.35);
  --violet-glow: rgba(139, 92, 246, 0.20);
  --violet-hover: #a78bfa;
  --indigo: #818cf8;
  --tone: var(--muted);

  /* Typography Stacks */
  --sans: "Archivo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout & Radii */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Tactical Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.65);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--ground);
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 14px/1.6 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

code {
  font: 500 0.86em/1.4 var(--mono);
  color: #e2e8f0;
  background: var(--surface-card);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule-subtle);
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

/* --- Top Engineering Header ------------------------------------------------------------------ */
.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 1.75rem;
  background: rgba(10, 13, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  margin: 0;
  font-weight: 800;
  font-stretch: 80%;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 100%);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
}

.top h1 {
  margin: 0;
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.health span {
  display: inline-flex;
  align-items: center;
  background: var(--surface-raised);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}

.health .dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.45rem;
  background: var(--muted);
}

.health .ok .dot {
  background: var(--clear);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.health .bad .dot {
  background: var(--block);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

.health .note .dot {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* Header Live Status Strip */
.current {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  min-height: 1.5rem;
  font-size: 0.88rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.current:empty {
  display: none;
}

.current-pr {
  font-weight: 800;
  font-stretch: 80%;
  font-family: var(--mono);
  color: var(--focus);
  background: var(--focus-bg);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.current-title {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.current-status {
  color: var(--warn);
  font-size: 0.82rem;
  font-family: var(--mono);
  margin-left: auto;
}

/* --- Layout: Left Rail + Main Workbench ------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  min-height: calc(100vh - 3.75rem);
}

.rail {
  border-right: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.25rem 1rem 3rem;
}

.rail h2 {
  margin: 0 0 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.rail h2.rail-sub {
  margin: 1.75rem 0 0.6rem;
}

.rail-note {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  color: var(--subtle);
  line-height: 1.45;
}

.rail-note-tight {
  margin: -0.2rem 0 0.6rem;
}

.scenarios {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.scenarios button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: all 120ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.scenarios button:hover {
  background: var(--surface-raised);
  border-color: var(--rule);
}

.scenarios button[aria-current="true"] {
  background: var(--surface-raised);
  border-color: var(--rule-hover);
  box-shadow: inset 3px 0 0 var(--focus);
}

.scenarios .pr {
  display: block;
  font-weight: 700;
  font-stretch: 85%;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

.scenarios button[aria-current="true"] .pr {
  color: var(--focus);
}

.scenarios .title {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Flagship PR-900 Highlight */
#flagship button {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(139, 92, 246, 0.04));
  border: 1px solid rgba(56, 189, 248, 0.3);
}

#flagship button:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(139, 92, 246, 0.08));
  border-color: var(--focus);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

#flagship button .pr {
  color: var(--focus);
}

#codegraph {
  border: 1px solid var(--violet-border);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(56, 189, 248, 0.02));
}

#codegraph .pr {
  color: var(--violet-hover);
}

#codegraph:hover {
  border-color: var(--violet-hover);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(56, 189, 248, 0.05));
  box-shadow: 0 0 12px var(--violet-glow);
}

#codegraph[aria-current="true"] {
  background: var(--surface-raised);
  border-color: var(--violet-hover);
  box-shadow: inset 3px 0 0 var(--violet-hover), 0 0 14px var(--violet-glow);
}

#codegraph[aria-current="true"] .pr {
  color: var(--violet-hover);
}

/* --- Main Workbench -------------------------------------------------------------------------- */
main {
  padding: 1.75rem 2.25rem 5rem;
  max-width: 82rem;
}

main > section + section,
.progress + section {
  margin-top: 2.25rem;
}

.empty {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 2rem 0;
}

h2.section, h3, h4 {
  font-weight: 600;
}

h2.section {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h3 {
  font-size: 0.98rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--ink);
}

h4 {
  font-size: 0.88rem;
  margin: 1.15rem 0 0.4rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Change Hero Banner & Actions ------------------------------------------------------------ */
.change {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}

.change-head {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.change-head .pr {
  margin: 0;
  font-weight: 800;
  font-stretch: 75%;
  font-size: 2.2rem;
  line-height: 1;
  font-family: var(--mono);
  color: var(--focus);
  letter-spacing: -0.02em;
}

.change-head .title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.change-meta {
  margin: 0.85rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.breaking {
  color: var(--block);
  font-weight: 600;
  background: var(--block-bg);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--block-border);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.question.token {
  flex: 0 1 14rem;
}

.question {
  flex: 1 1 18rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

textarea, select, input {
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea:focus, select:focus, input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 2.75rem;
}

button.primary, button.secondary, button.ghost {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 120ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

button.primary {
  background: var(--focus);
  color: #06111f;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

button.primary:hover:not(:disabled) {
  background: #7dd3fc;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--surface-raised);
  color: var(--ink);
  border-color: var(--rule);
}

button.secondary:hover:not(:disabled) {
  background: var(--surface-card);
  border-color: var(--rule-hover);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

button.ghost:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--rule-hover);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.progress {
  min-height: 1.5rem;
  margin: 1.1rem 0 0;
  color: var(--focus);
  font-size: 0.88rem;
  font-family: var(--mono);
}

/* --- Start Panel / Empty State --------------------------------------------------------------- */
.start {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--focus);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  max-width: 56rem;
}

.start h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.start-lead {
  margin: 0 0 1.25rem;
  line-height: 1.65;
  color: var(--ink-secondary);
  font-size: 1rem;
}

.start-steps {
  margin: 0 0 1.5rem;
  padding-left: 1.35rem;
  color: var(--muted);
}

.start-steps li {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.start-steps strong {
  color: var(--ink);
}

.start-problem {
  border-left-color: var(--warn);
}

/* --- Investigation Loop Progress Pipeline ---------------------------------------------------- */
.loop-wrap {
  margin-top: 1.75rem;
}

.loop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.stage {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius-md);
  min-width: 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: all 140ms ease;
}

.loop-n {
  font: 700 0.74rem var(--mono);
  color: var(--subtle);
  margin-right: 0.4rem;
  padding: 0.1em 0.35em;
  background: var(--surface-sunken);
  border-radius: var(--radius-xs);
}

.loop-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.stage-status {
  float: right;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--mono);
  text-transform: uppercase;
}

.loop-detail {
  display: block;
  clear: both;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
  margin-top: 0.45rem;
}

.stage-completed {
  border-left-color: var(--focus);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.03), transparent);
}
.stage-completed .stage-status {
  color: var(--focus);
}

.stage-running {
  border-left-color: var(--warn);
  border-left-style: solid;
  animation: pulse-border 1.5s infinite;
}
.stage-running .stage-status {
  color: var(--warn);
}

.stage-failed {
  border-left-color: var(--block);
}
.stage-failed .stage-status {
  color: var(--block);
}

.stage-not_run,
.stage-not_applicable {
  border-style: dashed;
  border-left-style: dashed;
  opacity: 0.7;
}
.stage-not_run .stage-status,
.stage-not_applicable .stage-status,
.stage-not_applicable .loop-name {
  color: var(--subtle);
}

.stage.tone-block {
  border-left-color: var(--block);
}
.stage.tone-block .loop-detail {
  color: var(--block);
}

.stage.tone-warn {
  border-left-color: var(--warn);
}
.stage.tone-warn .loop-detail {
  color: var(--warn);
}

.stage.tone-clear {
  border-left-color: var(--clear);
}
.stage.tone-clear .loop-detail {
  color: var(--clear);
}

@keyframes pulse-border {
  0%, 100% { border-left-color: var(--warn); }
  50% { border-left-color: rgba(245, 158, 11, 0.4); }
}

/* --- Verdict: The Central Takeaway ----------------------------------------------------------- */
#result[data-tone="block"], .verdict-block { --tone: var(--block); --tone-bg: var(--block-bg); --tone-border: var(--block-border); }
#result[data-tone="warn"], .verdict-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); --tone-border: var(--warn-border); }
#result[data-tone="clear"], .verdict-clear { --tone: var(--clear); --tone-bg: var(--clear-bg); --tone-border: var(--clear-border); }

.verdict {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--tone-border, var(--rule));
  border-left: 6px solid var(--tone);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.75rem;
}

.stamp {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 900;
  font-stretch: 65%;
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--tone);
}

.stamp-glyph {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.15em;
  height: 1.15em;
  font-size: 0.48em;
  line-height: 1;
  border: 3.5px solid var(--tone);
  border-radius: var(--radius-md);
  font-stretch: 100%;
}

.verdict-meaning {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.reasons {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--ink-secondary);
}

.reasons li {
  margin-top: 0.35rem;
  line-height: 1.5;
}

.source-note {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--subtle);
  font-family: var(--mono);
}

.summary {
  max-width: 78ch;
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--surface-sunken);
  border-left: 3px solid var(--rule-hover);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* Chips */
.chip {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-weight: 700;
  font-stretch: 80%;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid currentColor;
}

.chip-block { color: var(--block); background: var(--block-bg); }
.chip-warn { color: var(--warn); background: var(--warn-bg); }
.chip-clear { color: var(--clear); background: var(--clear-bg); }

/* --- Impact Map & Interactive Graph Explorer ------------------------------------------------- */
.map-wrap {
  overflow-x: auto;
  padding: 1rem 0;
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.impact-map {
  display: block;
  max-width: none;
  margin: 0 auto;
}

.impact-map .edge {
  fill: none;
  stroke-width: 2.2;
  cursor: pointer;
  transition: stroke 150ms ease, stroke-width 150ms ease;
}

.impact-map .edge-hit {
  stroke: var(--tone);
}

.impact-map .edge-safe {
  stroke: var(--muted);
  stroke-dasharray: 6 5;
}

.impact-map .edge[data-selected="true"] {
  stroke: var(--focus);
  stroke-width: 4;
  stroke-dasharray: none;
}

.impact-map .edge:focus-visible {
  outline: none;
  stroke: var(--focus);
  stroke-width: 4;
}

.impact-map .arrow-hit {
  fill: var(--tone);
}

.impact-map .arrow-safe {
  fill: var(--muted);
}

.impact-map .node {
  cursor: pointer;
}

.impact-map rect {
  fill: var(--surface-raised);
  stroke: var(--rule);
  stroke-width: 1.5;
  rx: 6;
  ry: 6;
  transition: all 140ms ease;
}

.impact-map .node-hit rect {
  stroke: var(--tone);
  stroke-width: 2;
  fill: var(--surface-card);
}

.impact-map .node-field rect {
  fill: #1e293b;
  stroke: var(--focus);
}

.impact-map .node:hover rect {
  stroke: var(--focus);
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.25));
}

.impact-map .node[data-selected="true"] rect {
  stroke: var(--focus);
  stroke-width: 3;
  fill: #1e293b;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.35));
}

.impact-map text {
  fill: var(--ink);
  pointer-events: none;
}

.impact-map .node-title {
  font: 600 12.5px var(--mono);
}

.impact-map .node-sub {
  font: 400 12px var(--sans);
  fill: var(--muted);
}

.impact-map .badge {
  font: 700 11px var(--sans);
  fill: var(--ink);
}

.impact-map .badge-bt {
  font: 600 10.5px var(--mono);
  fill: var(--focus);
}

.legend {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 82ch;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.legend .swatch {
  display: inline-block;
  width: 1.5rem;
  height: 0;
  border-top: 2.5px solid var(--tone);
  vertical-align: middle;
  margin-right: 0.4rem;
}

.legend .swatch.safe {
  border-top: 2.5px dashed var(--muted);
}

/* --- Evidence Inspector ---------------------------------------------------------------------- */
.inspector {
  margin-top: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1rem 1.25rem;
  max-width: 72rem;
  box-shadow: var(--shadow-sm);
}

.inspector-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}

.inspector-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.inspector-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  margin-right: 0.2rem;
}

button.pill {
  font: 600 0.8rem/1.3 var(--mono);
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.32rem 0.65rem;
  cursor: pointer;
  transition: all 120ms ease;
}

button.pill:hover {
  border-color: var(--focus);
  background: var(--surface-raised);
}

button.pill.is-active {
  border-color: var(--focus);
  background: var(--surface-card);
  color: var(--focus);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

button.inspector-close {
  font-size: 0.82rem;
  padding: 0.32rem 0.75rem;
  margin-left: auto;
}

.inspector-hint {
  margin: 0.75rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.inspector-card {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
}

.inspector-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.inspector-chain,
.inspector-unknowns {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.inspector-chain li + li,
.inspector-unknowns li + li {
  margin-top: 0.35rem;
}

.centrality-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--subtle);
}

/* --- Tables & Structured Inventory ----------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  font-weight: 600;
  color: var(--subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-sunken);
}

tbody th {
  font-weight: 500;
  color: var(--ink);
}

.inventory .status {
  white-space: nowrap;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.inventory .status-found .status { color: var(--focus); }
.inventory .status-none_found .status,
.inventory .status-not_checked .status { color: var(--subtle); }
.inventory .status-unknown .status { color: var(--warn); }
.inventory .status-check_failed .status { color: var(--block); }

.details section {
  max-width: 72rem;
}

.details td code {
  white-space: nowrap;
}

.exposure {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Agent Investigation Timeline ------------------------------------------------------------ */
#agent:not(:empty),
#simulation:not(:empty) {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0.75rem 0;
}

.mode-label {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule);
}

.mode-live .mode-label {
  border-color: var(--focus);
  color: var(--focus);
  background: var(--focus-bg);
}

.mode-demo .mode-label,
.mode-test .mode-label,
.mode-unknown .mode-label {
  border-style: dashed;
  color: var(--muted);
  background: var(--surface-raised);
}

.explanation-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-withheld_inconsistent {
  color: var(--warn);
}

.explanation {
  margin: 0.75rem 0;
  padding: 0.95rem 1.35rem;
  border-left: 3px solid var(--violet);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), var(--surface-raised));
  max-width: 80ch;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--ink-secondary);
}

.warnings {
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: var(--radius-md);
  padding: 0.2rem 1.25rem 0.75rem;
  max-width: 80ch;
}

.warnings h4 {
  color: var(--warn);
}

.facts li + li {
  margin-top: 0.3rem;
}

details {
  margin-top: 1.25rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

summary:hover {
  color: var(--focus);
}

.timeline {
  list-style: none;
  margin: 0.75rem 0 1.5rem;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0.95rem;
  width: 2px;
  background: linear-gradient(180deg, var(--rule) 0%, var(--violet-border) 45%, var(--rule) 100%);
}

.step {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem 0;
  position: relative;
}

.step-n {
  font: 700 0.8rem var(--mono);
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background: var(--ground);
  z-index: 1;
}

.step-body p {
  margin: 0.2rem 0;
  overflow-wrap: anywhere;
}

.step-head {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.step-status {
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--mono);
  margin-left: 0.5rem;
}

.step-ok .step-n {
  border-color: var(--focus);
  color: var(--focus);
}
.step-ok .step-status {
  color: var(--focus);
}

.step-warn .step-n {
  border-color: var(--warn);
  color: var(--warn);
}
.step-warn .step-status {
  color: var(--warn);
}

.step-failed .step-n,
.step-rejected .step-n {
  border-color: var(--block);
  color: var(--block);
}
.step-failed .step-status,
.step-rejected .step-status {
  color: var(--block);
}

.step-unknown {
  color: var(--warn);
}

/* --- Counterfactual Simulation -------------------------------------------------------------- */
.sim-form {
  display: grid;
  gap: 0.85rem;
  max-width: 50rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sim-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.sim-label {
  font-weight: 600;
  font-size: 0.92rem;
  border-left: 3px solid var(--warn);
  background: var(--warn-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  max-width: 80ch;
  color: var(--ink-secondary);
}

.sim-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 1rem 0;
}

.sim-compare p {
  display: grid;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.sim-compare .chip {
  justify-self: start;
}

.sim-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(23rem, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.sim-graph-col {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  background: var(--surface);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.sim-graph-col h3 {
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.sim-graph-col p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sim-diff {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

dt {
  color: var(--muted);
  font-weight: 500;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* --- Code-Graph Review & Diff Styling -------------------------------------------------------- */
pre.diff {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font: 0.85rem/1.55 var(--mono);
  white-space: pre;
  color: var(--ink);
}

.cg-change {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.cg-change h4 {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.94rem;
}

.mapping-unmapped,
.mapping-ambiguous,
.mapping-invalid {
  font-weight: 600;
  color: var(--warn);
}

.mapping-validated {
  color: var(--clear);
  font-weight: 600;
}

.cg p, .cg li, .cg dd, .cg h3 {
  overflow-wrap: anywhere;
}

.origin {
  margin-top: 1rem;
}

.origin summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--focus);
}

/* --- Investigation Memory -------------------------------------------------------------------- */
.memory {
  margin: 1.25rem 0 1.75rem;
  padding-left: 1.1rem;
  border-left: 2px dashed var(--rule);
}

.memory h5 {
  margin: 1.15rem 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.memory-status {
  margin: 0.35rem 0;
}

.status-record_failed,
.status-recall_failed {
  color: var(--warn);
}

tr.historical td,
td.historical-cell {
  color: var(--muted);
}

td.now-confirmed {
  color: var(--focus);
  font-weight: 600;
}

td.now-changed {
  color: var(--warn);
  font-weight: 600;
}

td.now-superseded {
  color: var(--subtle);
  font-style: normal;
}

td.when {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.82rem;
}

tr.historical .chip {
  border-style: dashed;
  opacity: 0.75;
}

/* --- Errors ---------------------------------------------------------------------------------- */
.error {
  border: 1px solid var(--block-border);
  background: var(--block-bg);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  max-width: 54rem;
}

.error p {
  margin: 0 0 0.5rem;
}

.error-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--block);
}

.error-detail {
  color: var(--ink-secondary);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* --- Responsive & Mobile Optimization (Desktop -> Tablet -> 390px Mobile) ------------------- */
@media (max-width: 960px) {
  .top {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1rem;
  }
  .scenarios {
    grid-auto-flow: column;
    grid-auto-columns: minmax(14rem, 1fr);
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  main {
    padding: 1.25rem 1rem 3.5rem;
  }
  .verdict {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
  }
  .sim-graphs {
    grid-template-columns: minmax(0, 1fr);
  }
  dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }
  dd {
    margin-bottom: 0.5rem;
  }
  table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1.15rem;
  }
  .change-head .pr {
    font-size: 1.8rem;
  }
  .change-head .title {
    font-size: 1.05rem;
  }
  .stamp {
    font-size: 2.8rem;
  }
  .actions button {
    width: 100%;
  }
  button.primary, button.secondary, button.ghost {
    padding: 0.75rem 1rem;
    min-height: 44px; /* Accessible touch target */
  }
}

@media (prefers-reduced-motion: no-preference) {
  #result, #agent, #simulation {
    transition: opacity 160ms ease;
  }
  [aria-busy="true"] {
    opacity: 0.55;
  }
}

/* ==========================================================================
   BLASTGATE PRODUCT WEBSITE & GUIDED TOUR STYLES
   Design System: Precision Engineering Intelligence
   ========================================================================== */

/* --- Site Structure & Shared Container ------------------------------------- */
.site-body {
  background-color: var(--ground);
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 15px/1.65 var(--sans);
  letter-spacing: -0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-container {
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padded {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 3.5rem;
}

.section-kicker {
  display: inline-block;
  font: 700 0.78rem var(--mono);
  color: var(--violet-hover);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.65rem;
  background: var(--violet-bg);
  border: 1px solid var(--violet-border);
  border-radius: var(--radius-sm);
}

.section-title {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* --- Top Marketing Header -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}

.site-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 82rem;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
}

.brand-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-sub {
  font: 600 0.75rem var(--mono);
  color: var(--focus);
  background: var(--focus-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 140ms ease;
  position: relative;
}

.site-nav-link:hover,
.site-nav-link.active {
  color: var(--ink);
}

.site-nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -0.4rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--violet);
  border-radius: 1px;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cta-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--focus);
  color: #040912;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: #7dd3fc;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--rule);
  text-decoration: none;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: var(--surface-card);
  border-color: var(--rule-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--rule);
  text-decoration: none;
  padding: 0.55rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--rule-hover);
  background: var(--surface-raised);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --- Hero Section ---------------------------------------------------------- */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--violet-border);
  border-radius: 9999px;
  font: 600 0.8rem var(--mono);
  color: var(--violet-hover);
  margin-bottom: 1.75rem;
  text-align: center;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 auto 1.5rem;
  max-width: 54rem;
}

.hero-highlight {
  background: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.65;
  color: var(--ink-secondary);
  max-width: 46rem;
  margin: 0 auto 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

.hero-btn-main {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

.hero-btn-sub {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  flex-direction: column;
  gap: 0.15rem;
}

.btn-sub {
  font: 500 0.76rem var(--mono);
  opacity: 0.8;
}

.hero-credibility {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font: 500 0.82rem var(--mono);
  color: var(--muted);
  margin-bottom: 3.5rem;
}

.cred-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.cred-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--focus);
}

/* --- Hero Product Visualization (PR-900 Topology Flow) --------------------- */
.hero-preview-wrap {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: left;
  margin-top: 1rem;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--rule);
}

.preview-dots {
  display: flex;
  gap: 0.4rem;
}

.preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule-hover);
}

.preview-dots span:nth-child(1) { background: #f43f5e; opacity: 0.7; }
.preview-dots span:nth-child(2) { background: #f59e0b; opacity: 0.7; }
.preview-dots span:nth-child(3) { background: #10b981; opacity: 0.7; }

.preview-title {
  font: 600 0.8rem var(--mono);
  color: var(--muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-link {
  font: 600 0.8rem var(--mono);
  color: var(--focus);
  text-decoration: none;
}

.preview-link:hover {
  text-decoration: underline;
}

.preview-body {
  padding: 2rem;
  background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.04), transparent 70%), var(--ground);
}

.graph-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.flow-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.flow-tag {
  font: 700 0.72rem var(--mono);
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 8.5rem;
  transition: all 140ms ease;
}

.flow-card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-hover);
}

.node-code {
  border-left: 3px solid var(--focus);
}

.node-mapping {
  border-left: 3px solid var(--violet);
}

.node-vulnerable {
  border-left: 3px solid var(--block);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.06), var(--surface));
}

.node-critical {
  border-left: 3px solid var(--warn);
}

.node-verdict {
  border-left: 3px solid var(--block);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), var(--surface));
}

.card-title {
  font: 700 0.88rem var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.card-meta {
  font: 500 0.78rem var(--mono);
  color: var(--focus);
}

.card-file {
  font-size: 0.75rem;
  color: var(--subtle);
  margin-top: auto;
}

.card-badge {
  font: 700 0.72rem var(--mono);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  align-self: start;
}

.badge-block {
  background: var(--block-bg);
  color: var(--block);
  border: 1px solid var(--block-border);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.card-sla {
  font: 600 0.75rem var(--mono);
  color: var(--block);
  margin-top: auto;
}

.verdict-stamp {
  font: 900 1.6rem var(--sans);
  color: var(--block);
  letter-spacing: -0.02em;
}

.verdict-reason {
  font: 600 0.76rem var(--mono);
  color: var(--muted);
}

.verdict-action {
  font-size: 0.76rem;
  color: var(--clear);
  margin-top: auto;
}

.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--subtle);
  font-size: 1.1rem;
}

.flow-arrow small {
  font: 600 0.68rem var(--mono);
  color: var(--muted);
  text-align: center;
}

.preview-caption {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* --- Comparison Grid (Problem Section) -------------------------------------- */
.problem-section {
  background: var(--ground);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 2rem;
}

.compare-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.compare-badge {
  font: 700 0.75rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  align-self: start;
  margin-bottom: 1.25rem;
  background: var(--surface-raised);
  color: var(--muted);
  border: 1px solid var(--rule);
}

.badge-accent {
  background: var(--violet-bg);
  color: var(--violet-hover);
  border-color: var(--violet-border);
}

.compare-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.compare-list li {
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.94rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.compare-bad li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--block);
  font-weight: 700;
}

.compare-good li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--clear);
  font-weight: 700;
}

/* --- Dual Graph Grid (Solution Section) ------------------------------------- */
.dual-graph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.5rem;
}

.dual-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 140ms ease;
}

.dual-card:hover {
  transform: translateY(-2px);
  border-color: var(--rule-hover);
}

.dual-step {
  font: 700 0.74rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin-bottom: 0.6rem;
}

.dual-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.dual-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  flex: 1;
}

.dual-meta {
  font: 600 0.78rem var(--mono);
  color: var(--ink-secondary);
  background: var(--surface-raised);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}

.dual-highlight {
  border-color: var(--violet-border);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), var(--surface));
}

.dual-accent {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.04), var(--surface));
}

/* --- Features Grid --------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  transition: all 140ms ease;
}

.feature-card:hover {
  border-color: var(--rule-hover);
  transform: translateY(-2px);
}

.feature-num {
  font: 700 1.1rem var(--mono);
  color: var(--focus);
  margin-bottom: 0.85rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex: 1;
}

.feature-tag {
  font: 600 0.76rem var(--mono);
  color: var(--subtle);
  align-self: start;
  background: var(--surface-raised);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule);
}

/* --- Rubric Compliance Table ----------------------------------------------- */
.rubric-section {
  background: var(--ground);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.rubric-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.rubric-table {
  width: 100%;
  border-collapse: collapse;
}

.rubric-table th,
.rubric-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-size: 0.92rem;
}

.rubric-table thead th {
  background: var(--surface-raised);
  color: var(--muted);
  font: 700 0.78rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chip-accent {
  font: 600 0.8rem var(--mono);
  color: var(--violet-hover);
  background: var(--violet-bg);
  border: 1px solid var(--violet-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* --- Call to Action Banner ------------------------------------------------- */
.cta-section {
  padding: 6rem 0;
}

.cta-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(139, 92, 246, 0.12) 100%), var(--surface);
  border: 1px solid var(--violet-border);
  border-radius: var(--radius-xl);
  padding: 4rem 2.5rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 auto 1.25rem;
  max-width: 44rem;
  line-height: 1.15;
}

.cta-sub {
  font-size: 1.1rem;
  color: var(--ink-secondary);
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.cta-btn-main {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
}

.cta-btn-sub {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
}

/* --- Site Footer ----------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--surface-sunken);
  border-top: 1px solid var(--rule);
  padding: 4.5rem 0 2.5rem;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 24rem;
  margin: 0.85rem 0 1rem;
}

.footer-repo a {
  font: 500 0.82rem var(--mono);
  color: var(--focus);
  text-decoration: none;
}

.footer-repo a:hover {
  text-decoration: underline;
}

.footer-links-col h4 {
  font: 700 0.78rem var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.footer-links-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.footer-links-col a,
.footer-links-col span {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-links-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--subtle);
  margin: 0;
  line-height: 1.5;
}

/* --- Documentation Pages: How It Works & Architecture ---------------------- */
.page-content {
  padding: 3.5rem 0 6rem;
  flex: 1;
}

.page-header {
  margin-bottom: 3.5rem;
}

.page-title {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 1.25rem;
  line-height: 1.15;
}

.page-lead {
  font-size: 1.15rem;
  color: var(--ink-secondary);
  line-height: 1.65;
  max-width: 52rem;
  margin: 0;
}

.pipeline-flow-wrap {
  overflow-x: auto;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  margin-bottom: 3.5rem;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 58rem;
  gap: 0.5rem;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.step-num {
  font: 700 0.82rem var(--mono);
  color: var(--focus);
  background: var(--focus-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.step-label {
  font: 600 0.82rem var(--mono);
  color: var(--ink);
  white-space: nowrap;
}

.pipeline-arrow {
  color: var(--subtle);
  font-size: 1.1rem;
}

.stages-breakdown {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.stage-article {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 2rem;
}

.stage-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stage-badge {
  font: 700 0.85rem var(--mono);
  color: var(--focus);
}

.stage-component {
  font: 600 0.8rem var(--mono);
  color: var(--subtle);
  background: var(--surface-raised);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  align-self: start;
}

.stage-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--ink);
}

.stage-body p {
  color: var(--ink-secondary);
  line-height: 1.65;
  margin: 0 0 1.25rem;
}

.code-block {
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font: 0.86rem/1.6 var(--mono);
  margin: 1.25rem 0;
  color: #e2e8f0;
}

.stage-evidence,
.stage-note {
  background: var(--surface-raised);
  border-left: 3px solid var(--violet);
  padding: 0.85rem 1.15rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  margin-top: 1.25rem;
}

.stage-steps-list {
  padding-left: 1.25rem;
  color: var(--ink-secondary);
  margin: 1rem 0;
}

.stage-steps-list li {
  margin: 0.5rem 0;
  line-height: 1.55;
}

.verdict-points {
  padding-left: 1.25rem;
  color: var(--ink-secondary);
  margin: 1rem 0;
}

.verdict-points li {
  margin: 0.5rem 0;
  line-height: 1.55;
}

.page-cta-banner {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
}

.page-cta-banner h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.page-cta-banner p {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 auto 1.75rem;
  max-width: 38rem;
}

/* --- Architecture Page Specifics ------------------------------------------- */
.arch-section {
  margin-bottom: 4.5rem;
}

.arch-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 1.5rem;
}

.arch-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.arch-tag {
  font: 700 0.74rem var(--mono);
  color: var(--violet-hover);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.arch-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.arch-card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  flex: 1;
}

.arch-files {
  font: 500 0.78rem var(--mono);
  color: var(--subtle);
  background: var(--surface-raised);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--rule);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.5rem;
}

.trust-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.trust-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.trust-card p {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.65;
  margin: 0;
}

/* --- Demo Guide & Quickstart Page Specifics -------------------------------- */
.quick-callout {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(139, 92, 246, 0.08)), var(--surface);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.callout-icon {
  font-size: 2.5rem;
  flex: none;
}

.callout-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--ink);
}

.callout-body p {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  margin: 0 0 1rem;
}

.callout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.guide-section {
  margin-bottom: 4.5rem;
}

.guide-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
}

.guide-steps {
  display: grid;
  gap: 1.75rem;
}

.guide-step-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.5rem;
}

.guide-step-num {
  font: 700 1rem var(--mono);
  color: var(--focus);
  background: var(--focus-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  height: 2.75rem;
  display: grid;
  place-items: center;
}

.guide-step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: var(--ink);
}

.guide-step-content p {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0 0 0.85rem;
}

.guide-step-content ul,
.guide-step-content ol {
  padding-left: 1.25rem;
  color: var(--ink-secondary);
  margin: 0 0 1rem;
}

.guide-step-content li {
  margin: 0.4rem 0;
  font-size: 0.92rem;
}

.guide-check {
  font: 600 0.84rem var(--mono);
  color: var(--clear);
  background: var(--clear-bg);
  border: 1px solid var(--clear-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.5rem;
}

.code-step {
  margin: 1.5rem 0;
}

.code-step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.code-note {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.trouble-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.25rem;
}

.trouble-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.trouble-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--warn);
  margin: 0 0 0.5rem;
}

.trouble-card p {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  margin: 0 0 0.75rem;
}

/* --- Console Specific Top Bar & Navigation Extensions ---------------------- */
.console-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.top-brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.console-badge {
  font: 700 0.72rem var(--mono);
  color: var(--violet-hover);
  background: var(--violet-bg);
  border: 1px solid var(--violet-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.console-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.console-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 120ms ease;
}

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

.top-status-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-tour {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(56, 189, 248, 0.12));
  color: var(--violet-hover);
  border: 1px solid var(--violet-border);
  font: 600 0.82rem var(--mono);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 140ms ease;
}

.btn-tour:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(56, 189, 248, 0.2));
  border-color: var(--violet-hover);
  box-shadow: 0 0 12px var(--violet-glow);
  transform: translateY(-1px);
}

/* --- Interactive Guided Tour Modal & Overlay ------------------------------- */
.tour-guide {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem;
}

.tour-guide[hidden] {
  display: none !important;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  z-index: 1001;
}

.tour-card {
  position: relative;
  z-index: 1002;
  pointer-events: auto;
  background: var(--surface-raised);
  border: 1px solid var(--violet-border);
  border-left: 4px solid var(--violet);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  max-width: 36rem;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px var(--violet-glow);
  animation: tour-slide-up 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tour-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tour-step-badge {
  font: 700 0.78rem var(--mono);
  color: var(--focus);
  background: var(--focus-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.tour-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: color 120ms ease;
}

.tour-close:hover {
  color: var(--ink);
  background: var(--surface-card);
}

.tour-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

.tour-text {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.tour-btn {
  font: 600 0.88rem var(--mono);
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 120ms ease;
  border: 1px solid transparent;
}

.tour-btn.primary {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 10px var(--violet-glow);
}

.tour-btn.primary:hover {
  background: #9d74ff;
  transform: translateY(-1px);
}

.tour-btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--rule);
}

.tour-btn.ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--rule-hover);
}

.tour-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Pulsing highlight applied to elements during the tour */
.tour-highlight {
  position: relative;
  z-index: 1002 !important;
  box-shadow: 0 0 0 3px var(--violet), 0 0 25px var(--violet-glow) !important;
  border-color: var(--violet) !important;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

/* --- Responsive Rules for Website & Console (Desktop -> Tablet -> 390px Mobile) - */
@media (max-width: 960px) {
  .site-nav-container {
    padding: 0.75rem 1.25rem;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open {
    display: flex;
  }
  .mobile-toggle {
    display: block;
  }
  .graph-flow {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .flow-arrow {
    transform: rotate(90deg);
    margin: -0.25rem 0;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .stage-article {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .guide-step-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .console-top {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .console-nav {
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
}

@media (max-width: 480px) {
  .site-nav-container {
    padding: 0.65rem 1rem;
  }
  .brand-sub {
    display: none;
  }
  .site-header-actions .cta-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  .hero-badge {
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }
  .hero-title {
    font-size: 1.85rem;
    line-height: 1.14;
    word-break: break-word;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-btn-main, .hero-btn-sub {
    width: 100%;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .quick-callout {
    flex-direction: column;
    align-items: flex-start;
  }
  .cta-box {
    padding: 2.5rem 1.25rem;
  }
  .tour-guide {
    padding: 1rem;
  }
}

/* ==========================================================================
   Demo Video Showcase & Player Styles
   ========================================================================== */
.demo-video-section {
  padding: 5rem 0;
  background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.08), transparent 70%),
              radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.05), transparent 60%),
              var(--bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.demo-video-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.demo-video-header .section-tag {
  display: inline-block;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--focus, #38bdf8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.demo-video-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1rem;
}

.demo-video-header p {
  font-size: 1.1rem;
  color: var(--muted, #94a3b8);
  line-height: 1.6;
}

.demo-video-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.demo-video-player-card {
  background: #0f131d;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(139, 92, 246, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.demo-video-player-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

.demo-video-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080a0f;
  overflow: hidden;
  cursor: pointer;
}

.demo-video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.demo-video-media-wrap:hover .demo-video-poster {
  transform: scale(1.02);
}

.demo-video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(12, 15, 22, 0.45);
  transition: background 0.2s ease;
}

.demo-video-media-wrap:hover .demo-video-play-overlay {
  background: rgba(12, 15, 22, 0.3);
}

.demo-video-play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid #8b5cf6;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), inset 0 0 15px rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

.demo-video-media-wrap:hover .demo-video-play-btn {
  transform: scale(1.08);
  background: rgba(139, 92, 246, 0.9);
  border-color: #06b6d4;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.6);
}

.demo-video-play-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  margin-left: 4px;
}

.demo-video-badge {
  margin-top: 1rem;
  padding: 0.35rem 0.85rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 9999px;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 500;
  color: #67e8f9;
  letter-spacing: 0.04em;
}

.demo-video-info {
  padding: 1.5rem;
  border-top: 1px solid var(--rule);
}

.demo-video-info-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.demo-video-info-desc {
  font-size: 0.9rem;
  color: var(--muted, #94a3b8);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.demo-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-tag {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: #cbd5e1;
}

/* Video Breakdown List */
.demo-video-moments {
  background: #0f131d;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.75rem;
}

.demo-video-moments h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.demo-moment-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.demo-moment-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 1rem;
  align-items: start;
}

.demo-moment-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--focus, #38bdf8);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  text-align: center;
}

.demo-moment-body h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 0.25rem;
}

.demo-moment-body p {
  font-size: 0.82rem;
  color: var(--muted, #94a3b8);
  line-height: 1.45;
}

.demo-video-limitation {
  margin-top: 1.5rem;
  padding: 1.1rem;
  background: rgba(24, 30, 44, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-left: 3px solid #8b5cf6;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.demo-video-limitation strong {
  color: #fff;
  display: block;
  margin-bottom: 0.3rem;
}

/* Video Modal Dialog */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(8px);
}

.video-modal.is-active {
  display: flex;
}

.video-modal-container {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: #0f131d;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #141926;
  border-bottom: 1px solid var(--rule);
}

.video-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.video-modal-close {
  background: none;
  border: none;
  color: var(--muted, #94a3b8);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.video-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.video-modal-body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-modal-body video,
.video-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 860px) {
  .demo-video-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
