/* PeakPass — Ticketing Consistency Demo
   Aesthetic: control-room observability dashboard.
   Navy dominant, mono for data, sharp state colors. */

:root {
  --navy: #1A3A5C;
  --navy-700: #14304c;
  --navy-800: #0f2339;
  --navy-900: #0a1a2b;
  --blue: #387DC9;
  --blue-soft: #e7f0fb;
  --bg: #FAFBFC;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --line: #e3e7ee;
  --line-strong: #cfd6e1;
  --ink: #0f1d2e;
  --ink-2: #2c3e54;
  --muted: #6b7a8c;
  --muted-2: #94a0b1;
  --green: #3FA76B;
  --green-soft: #e4f4ea;
  --red: #D45A5A;
  --red-soft: #fbe5e5;
  --yellow: #F6D57B;
  --yellow-soft: #fbf1d3;
  --orange: #D98040;
  --orange-soft: #fbe8d7;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 0 rgba(15,29,46,0.04), 0 1px 2px rgba(15,29,46,0.04);
  --shadow-md: 0 1px 2px rgba(15,29,46,0.05), 0 4px 12px rgba(15,29,46,0.06);

  --font-sans: "Nunito", ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", sans-serif;
  --font-display: "Quicksand", "Nunito", ui-rounded, -apple-system, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* subtle scan-line grid on body */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(26,58,92,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(26,58,92,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

.app { position: relative; z-index: 1; }

/* ---------- TOP BAR ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--navy-900);
  color: #dfe8f2;
  border-bottom: 1px solid #000;
  font-family: var(--font-mono);
  font-size: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 18px; }
.logo-mark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(246,213,123,0.22);
}
.topbar-meta { color: #8aa2bd; display: flex; gap: 18px; }
.topbar-meta span b { color: #c7d6e8; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.mode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mode-badge.live { background: rgba(63,167,107,0.14); color: #7ed3a3; border: 1px solid rgba(63,167,107,0.35); }
.mode-badge.mock { background: rgba(246,213,123,0.14); color: #f6d57b; border: 1px solid rgba(246,213,123,0.4); }
.mode-badge.offline { background: rgba(212,90,90,0.14); color: #e89999; border: 1px solid rgba(212,90,90,0.4); }
.mode-badge .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- HERO ---------- */
.hero {
  padding: 48px 28px 36px;
  background:
    radial-gradient(1200px 340px at 80% -20%, rgba(56,125,201,0.18), transparent 60%),
    radial-gradient(900px 260px at 10% 110%, rgba(246,213,123,0.12), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: end;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--navy);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-eyebrow .bar { width: 28px; height: 1px; background: var(--navy); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.hero h1 em {
  font-style: normal;
  font-weight: 700;
  color: var(--navy);
}
.hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 620px;
  line-height: 1.55;
  margin: 0 0 22px;
  text-wrap: pretty;
}
.hero-oneliner {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: 3px;
  max-width: 640px;
}
.hero-oneliner b { color: var(--navy); font-weight: 600; }

.tech-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.tech-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.tech-badge .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: middle; }
.tech-badge[data-t="ts"] .dot { background: #3178c6; }
.tech-badge[data-t="fastify"] .dot { background: #000; }
.tech-badge[data-t="gql"] .dot { background: #e535ab; }
.tech-badge[data-t="pg"] .dot { background: #336791; }
.tech-badge[data-t="redis"] .dot { background: #d82c20; }
.tech-badge[data-t="docker"] .dot { background: #2496ed; }
.tech-badge[data-t="k6"] .dot { background: #7d64ff; }

/* hero-right stat cards */
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}
.stat-card .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1;
}
.stat-card .unit { font-size: 13px; color: var(--muted); margin-left: 4px; font-family: var(--font-sans); }
.stat-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-family: var(--font-mono); }
.stat-card.accent { background: var(--navy-900); color: #dfe8f2; border-color: #000; }
.stat-card.accent .label { color: #8aa2bd; }
.stat-card.accent .value { color: #fff; }
.stat-card.accent .sub { color: #8aa2bd; }

/* ---------- SECTION SHELL ---------- */
.section {
  max-width: 1440px; margin: 0 auto;
  padding: 40px 28px;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.section-head .title-group { display: flex; align-items: baseline; gap: 14px; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--navy);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: var(--blue-soft);
  border-radius: 3px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.section-head .sub {
  font-size: 13px; color: var(--muted);
  max-width: 520px; text-align: right;
  line-height: 1.5;
}

/* ---------- ARCHITECTURE STRIP ---------- */
.arch {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.arch-col {
  padding: 22px 20px;
  position: relative;
}
.arch-col + .arch-col { border-left: 1px dashed var(--line-strong); }
.arch-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.arch-node {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 10px;
}
.arch-node .node-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}
.arch-node .node-sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.arch-col.client .arch-node { display: flex; flex-direction: column; align-items: flex-start; }
.arch-col.client .browser-frame {
  width: 100%;
  height: 96px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: linear-gradient(180deg, #fff 0 16px, var(--surface-2) 16px);
  position: relative;
  margin-top: 10px;
}
.arch-col.client .browser-frame::before {
  content: ""; position: absolute; top: 6px; left: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 10px 0 0 var(--yellow), 20px 0 0 var(--green);
}
.arch-col.client .browser-frame::after {
  content: "peakpass.demo";
  position: absolute; top: 22px; left: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted);
  padding: 3px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.arch-col.api {
  background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}
.api-core {
  border: 1px solid var(--navy);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
  margin-bottom: 16px;
  position: relative;
}
.api-core .core-title {
  font-family: var(--font-display); font-weight: 500; font-size: 16px; margin-bottom: 2px;
}
.api-core .core-sub { font-family: var(--font-mono); font-size: 11px; color: #b7c9dd; }
.api-core .port {
  position: absolute; top: 12px; right: 14px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--yellow);
  background: rgba(246,213,123,0.15);
  padding: 2px 6px; border-radius: 3px;
}
.api-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.api-path {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}
.api-path .path-head {
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.api-path.write .path-head { background: var(--red-soft); color: #8e2f2f; border-bottom: 1px solid #f0cfcf; }
.api-path.read .path-head { background: var(--blue-soft); color: #1f4d82; border-bottom: 1px solid #cadff5; }
.api-path .path-head .method-chip {
  padding: 2px 6px; border-radius: 3px; font-weight: 600;
}
.api-path.write .path-head .method-chip { background: var(--red); color: #fff; }
.api-path.read .path-head .method-chip { background: var(--blue); color: #fff; }
.api-path ul { margin: 0; padding: 10px 12px 12px; list-style: none; }
.api-path li {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 0;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.api-path li .verb {
  font-weight: 600; font-size: 10px;
  padding: 1px 5px; border-radius: 2px; min-width: 36px; text-align: center;
}
.api-path.write li .verb { background: var(--red-soft); color: #8e2f2f; }
.api-path.read li .verb { background: var(--blue-soft); color: #1f4d82; }

.arch-col.data .data-node {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
  position: relative;
}
.arch-col.data .data-node.sot {
  border-color: var(--green);
  background: var(--green-soft);
}
.arch-col.data .data-node.cache {
  border-color: #e8b7b0;
  background: #fbe8e4;
}
.data-node .dn-title {
  font-family: var(--font-display); font-weight: 500; font-size: 15px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.data-node .dn-title .role {
  font-family: var(--font-mono); font-size: 9.5px; padding: 2px 6px; border-radius: 2px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.data-node.sot .dn-title .role { background: var(--green); color: #fff; }
.data-node.cache .dn-title .role { background: #b34a3a; color: #fff; }
.data-node ul { margin: 6px 0 0; padding: 0 0 0 14px; }
.data-node li { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); padding: 1px 0; }

/* arrows between arch cols */
.arch::before, .arch::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px; height: 1px;
  background: var(--line-strong);
  z-index: 2;
}
/* keep the layout but use inline arrow chars instead */
.arch::before { display: none; }
.arch::after { display: none; }

/* ---------- CONNECTION PANEL ---------- */
.conn-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 16px;
}
.conn-card, .check-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.conn-card .card-head, .check-card .card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(56,125,201,0.15); }
.input.small { padding: 7px 10px; font-size: 12px; }

.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-700); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted-2); }
.btn-accent { background: var(--blue); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #2a6bb5; }
.btn-danger { background: var(--red); color: #fff; }
.btn-warn { background: var(--yellow); color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 6px 8px; }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.full { width: 100%; justify-content: center; }
.btn .arrow { font-family: var(--font-mono); opacity: 0.7; }

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

.check-card .metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.check-card .metric-row:last-child { border-bottom: none; }
.check-card .metric-row .key { color: var(--muted); }
.check-card .metric-row .val { color: var(--ink); font-weight: 500; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.ok { background: var(--green-soft); color: #206a41; }
.status-pill.warn { background: var(--yellow-soft); color: #8c6a1f; }
.status-pill.err { background: var(--red-soft); color: #8e2f2f; }
.status-pill.info { background: var(--blue-soft); color: #1f4d82; }
.status-pill.idle { background: var(--surface-2); color: var(--muted); }

/* ---------- DEMO FLOW ---------- */
.flow-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.flow-main { min-width: 0; }
.flow-side { position: sticky; top: 20px; display: grid; gap: 16px; }

.run-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--navy-900);
  color: #dfe8f2;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}
.run-bar .rb-left { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 12.5px; }
.run-bar .rb-left b { color: #fff; font-weight: 600; }
.run-bar .rb-left .progress {
  width: 180px; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.run-bar .rb-left .progress .bar {
  height: 100%; background: var(--green);
  transition: width 0.4s ease;
}
.run-bar .rb-right { display: flex; gap: 8px; }

/* step card */
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56,125,201,0.12), var(--shadow-md); }
.step.done { border-color: #c9e3d4; }
.step.error { border-color: var(--red); }

.step-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.step-head:hover { background: var(--surface-2); }
.step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.step.done .step-num { background: var(--green); color: #fff; border-color: var(--green); }
.step.active .step-num { background: var(--blue); color: #fff; border-color: var(--blue); }
.step.error .step-num { background: var(--red); color: #fff; border-color: var(--red); }

.step-title-block .step-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.step-title-block .step-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex; gap: 10px; align-items: center;
}
.step-title-block .step-meta .endpoint-chip {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.step-title-block .step-meta .endpoint-chip.write { background: var(--red-soft); color: #8e2f2f; border-color: #f0cfcf; }
.step-title-block .step-meta .endpoint-chip.read { background: var(--blue-soft); color: #1f4d82; border-color: #cadff5; }

.step-timing {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.step-timing .t { color: var(--ink); font-weight: 500; }

.step-body {
  padding: 0 18px 18px;
  border-top: 1px dashed var(--line);
}

.step-body .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.field-block { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.tier-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
}
.tier-card {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
}
.tier-card:hover { border-color: var(--blue); }
.tier-card.selected { border-color: var(--navy); background: var(--navy); color: #fff; }
.tier-card.selected .tier-sub { color: #b7c9dd; }
.tier-card .tier-name {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
}
.tier-card .tier-price {
  font-family: var(--font-mono); font-size: 13px; margin-top: 2px;
}
.tier-card .tier-sub {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 4px;
}

.event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}
.event-card:hover { border-color: var(--blue); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.event-card.selected { border-color: var(--navy); border-width: 2px; padding: 13px; }
.event-card .event-date {
  font-family: var(--font-mono); font-size: 11px; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.event-card .event-title {
  font-family: var(--font-display); font-weight: 500; font-size: 17px;
  color: var(--ink); margin-bottom: 6px; line-height: 1.25;
}
.event-card .event-meta {
  display: flex; gap: 14px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
}
.event-card .capacity-bar {
  height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 10px; overflow: hidden;
}
.event-card .capacity-bar .fill { height: 100%; background: var(--green); }
.event-card .capacity-bar .fill.low { background: var(--yellow); }
.event-card .capacity-bar .fill.crit { background: var(--red); }

/* JSON viewer */
.json-block {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--navy-900);
  color: #e5eaf1;
  border-radius: 5px;
  padding: 12px 14px;
  overflow: auto;
  max-height: 260px;
  line-height: 1.55;
  white-space: pre;
}
.json-block .k { color: #9ecbff; }
.json-block .s { color: #ffd58a; }
.json-block .n { color: #c5f0a8; }
.json-block .b { color: #ff9ac4; }
.json-block .null { color: #8fa3b8; font-style: italic; }

.kv-table { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-family: var(--font-mono); font-size: 12px; }
.kv-table .k { color: var(--muted); }
.kv-table .v { color: var(--ink); word-break: break-all; }

/* Idempotency ribbon */
.idem-ribbon {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--orange-soft);
  border: 1px solid #efc59a;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7a4620;
  margin: 10px 0 12px;
}
.idem-ribbon .label { font-weight: 600; }
.idem-ribbon .key { color: #5a3516; background: #fff3dd; padding: 2px 6px; border-radius: 3px; }
.idem-ribbon .regen {
  margin-left: auto;
  color: var(--orange);
  cursor: pointer;
  text-decoration: underline dotted;
  background: none; border: none; font-family: var(--font-mono); font-size: 11.5px;
}

/* Result banner */
.result-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.result-banner.pending { background: var(--yellow-soft); border: 1px solid #ecd79a; }
.result-banner.paid { background: var(--green-soft); border: 1px solid #b7dcc4; }
.result-banner.err { background: var(--red-soft); border: 1px solid #e8b0b0; }
.result-banner .rb-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 16px;
}
.result-banner.pending .rb-icon { background: var(--yellow); color: #8c6a1f; }
.result-banner.paid .rb-icon { background: var(--green); color: #fff; }
.result-banner.err .rb-icon { background: var(--red); color: #fff; }
.result-banner .rb-title {
  font-family: var(--font-display); font-weight: 500; font-size: 16px; color: var(--ink);
}
.result-banner .rb-sub {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.result-banner .rb-stat {
  display: flex; gap: 14px;
}
.result-banner .rb-stat .stat .n {
  font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--ink); line-height: 1;
}
.result-banner .rb-stat .stat .l {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px;
}

/* Ticket Card */
.ticket-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.ticket {
  position: relative;
  background: var(--navy-900);
  color: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  top: 50%;
  transform: translateY(-50%);
}
.ticket::before { left: -9px; }
.ticket::after { right: -9px; }
.ticket .t-event {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--yellow); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px;
}
.ticket .t-title {
  font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.2;
  margin-bottom: 8px;
}
.ticket .t-code {
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(255,255,255,0.08);
  padding: 4px 8px; border-radius: 3px; display: inline-block;
  color: #fff;
  letter-spacing: 0.04em;
}
.ticket .t-meta {
  font-family: var(--font-mono); font-size: 10.5px; color: #8aa2bd;
  margin-top: 6px;
}
.ticket .t-qr {
  width: 68px; height: 68px;
  background: #fff;
  border-radius: 4px;
  padding: 6px;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 1px;
}
.ticket .t-qr span { background: var(--navy-900); border-radius: 1px; }
.ticket .t-qr span.off { background: transparent; }

/* duplicate demo rows */
.dup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.dup-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--surface-2);
}
.dup-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.dup-card .dup-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.dup-card .dup-result { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-family: var(--font-mono); font-size: 12px; }

/* ---------- STATE INSPECTOR ---------- */
.inspector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.inspector-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--navy-900);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.inspector-head .t {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.inspector-body {
  padding: 10px 14px;
  max-height: 520px;
  overflow: auto;
}
.insp-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.insp-row:last-child { border-bottom: none; }
.insp-row .k { color: var(--muted); }
.insp-row .v { color: var(--ink); font-weight: 500; text-align: right; word-break: break-all; max-width: 200px; }
.insp-row .v.empty { color: var(--muted-2); font-style: italic; }
.insp-row .v.highlight { background: var(--yellow-soft); padding: 1px 5px; border-radius: 3px; }

/* Explanation Notes */
.notes-card {
  background: linear-gradient(180deg, #1a3a5c 0%, #0f2339 100%);
  color: #dfe8f2;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.notes-card .nc-head {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 10px;
}
.notes-card .note {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.12);
  font-size: 12.5px;
  line-height: 1.5;
  display: grid; grid-template-columns: auto 1fr; gap: 10px;
  align-items: start;
}
.notes-card .note:last-child { border-bottom: none; }
.notes-card .note .badge {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 2px;
  background: rgba(246,213,123,0.18); color: var(--yellow);
  font-weight: 600; letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
}
.notes-card .note p { margin: 0; color: #c7d6e8; }
.notes-card .note b { color: #fff; font-weight: 500; }

/* ---------- REQUEST LOG ---------- */
.log-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.log-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.log-entry {
  border-top: 1px solid var(--line);
}
.log-entry:first-child { border-top: none; }
.log-entry .le-head {
  display: grid; grid-template-columns: auto auto 1fr auto auto auto; gap: 12px;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-mono); font-size: 12px;
}
.log-entry .le-head:hover { background: var(--surface-2); }
.le-head .method {
  font-weight: 600; font-size: 10.5px; padding: 2px 7px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.le-head .method.POST { background: var(--red-soft); color: #8e2f2f; }
.le-head .method.GET { background: var(--blue-soft); color: #1f4d82; }
.le-head .method.GQL { background: #f5e3f8; color: #7a2692; }
.le-head .url { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-head .status { font-weight: 600; }
.le-head .status.s2 { color: #206a41; }
.le-head .status.s4 { color: #b34a3a; }
.le-head .status.s5 { color: var(--red); }
.le-head .elapsed { color: var(--muted); }
.le-head .chev { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.log-entry .le-body {
  padding: 10px 14px 14px;
  background: var(--surface-2);
  border-top: 1px dashed var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.log-entry .le-body .lb-col { min-width: 0; }
.log-entry .le-body .lb-col .lb-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.log-empty {
  padding: 24px; text-align: center; color: var(--muted); font-family: var(--font-mono); font-size: 12px;
}

/* Footer / notice */
.footer {
  padding: 28px; text-align: center; color: var(--muted);
  font-family: var(--font-mono); font-size: 11.5px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* responsive */
@media (max-width: 1200px) {
  .hero-grid { grid-template-columns: 1fr; }
  .flow-wrap { grid-template-columns: 1fr; }
  .flow-side { position: static; }
  .arch { grid-template-columns: 1fr; }
  .arch-col + .arch-col { border-left: none; border-top: 1px dashed var(--line-strong); }
  .conn-panel { grid-template-columns: 1fr; }
  .dup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero h1 { font-size: 40px; }
  .event-grid { grid-template-columns: 1fr; }
  .step-body .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 28px 16px; }
  .hero { padding: 32px 16px 24px; }
}

/* fade-in for step body */
@keyframes stepIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.step-body { animation: stepIn 0.2s ease-out; }

/* shake for error */
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.step.error .step-num { animation: shake 0.4s; }

/* toggle / switch */
.switch {
  position: relative; display: inline-block; width: 36px; height: 20px;
  background: var(--line-strong); border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.switch.on { background: var(--green); }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch.on::after { transform: translateX(16px); }

/* select */
.select {
  appearance: none;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'><path d='M0 0l4 5 4-5z' fill='%236b7a8c'/></svg>") no-repeat right 10px center / 8px 5px;
  color: var(--ink);
  cursor: pointer;
}
