/* COP406 Release Management Experience — navy/blue dark design system.
   Fixed dark palette (navy page background, slate panels, restrained blue
   accent). Status is never conveyed by color alone: every status indicator
   also carries a text label and a distinct shape/icon; color is layered on
   top of that existing system, not a replacement for it. */

:root {
  --page-bg: #0f172a;
  --ink: #f8fafc;
  --ink-2: #e2e8f0;
  --ink-3: #94a3b8;
  --muted: #64748b;
  --line: #334155;
  --line-2: #24324a;
  --surface: #1e293b;
  --surface-2: #26374d;
  --surface-3: #2e4258;
  --focus: #60a5fa;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --on-accent: #f8fafc;

  --danger: #ef4444;
  --danger-strong: #dc2626;
  --danger-bg: #3a1414;
  --danger-text: #fca5a5;

  --warn: #f59e0b;
  --warn-bg: #2a2110;
  --warn-text: #fcd34d;

  --success: #10b981;
  --success-bg: #0f2a1a;
  --success-text: #6ee7b7;

  --radius: 10px;
  --gutter: clamp(16px, 4vw, 64px);
  --max-shell: 1600px;
  --header-h: 68px;
  --footer-h: 40px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Desktop shell: fill the viewport and prevent page-level vertical scroll.
   Only applies on wide, tall viewports; narrow widths and zoom fall back to
   normal document flow (see the media query at the end). */
@media (min-width: 1000px) and (min-height: 640px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }
  body {
    display: grid;
    grid-template-rows: var(--header-h) 1fr var(--footer-h);
    height: 100vh;
  }
  .app-main {
    overflow: hidden;
    min-height: 0;
  }
  .panel.is-active {
    height: 100%;
    min-height: 0;
  }
  /* Content scrolls inside the active panel, not the whole page. */
  .panel-scroll {
    height: 100%;
    overflow-y: auto;
  }
  /* #auth-gate is a sibling of #app-shell under the same grid <body>. Span
     every row so it fills the viewport instead of being squeezed into the
     header row, and scroll internally in case the card doesn't fit. */
  #auth-gate {
    grid-row: 1 / -1;
    height: 100vh;
    overflow-y: auto;
  }
}

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
}

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

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: var(--gutter);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  max-width: var(--max-shell);
  margin: 0 auto;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.brand-mark {
  font-size: 26px;
  line-height: 1;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  flex: 1 1 auto;
  min-width: 0;
  /* Keep every tab on one line rather than wrapping to a second row under
     the brand — scroll horizontally on the rare viewport too narrow to fit
     all seven, instead of an uneven two-row tab bar. */
  overflow-x: auto;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar {
  height: 4px;
}
.tabs::-webkit-scrollbar-track {
  background: transparent;
}
.tabs::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.tabs ul {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}
.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.auth-surface {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-status {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
}
/* Sign-in error state. Does not rely on color alone: the aria-live region
   announces the message and the text itself states the failure. */
.auth-status.auth-error {
  color: var(--danger);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--line);
}
.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-solid:hover {
  background: var(--accent-hover);
}
.btn-outline {
  background: var(--surface);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--surface-2);
}

/* ---------- Main / panels ---------- */
.app-main {
  max-width: var(--max-shell);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--gutter);
}
.panel {
  display: none;
}
.panel.is-active {
  display: block;
}
.panel-scroll {
  padding: clamp(20px, 3vw, 40px) 0 40px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lead {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--ink-2);
  max-width: 70ch;
}
.talk-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.talk-tile {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.talk-tile:nth-child(2) {
  border-style: dashed;
}
.talk-tile:nth-child(3) {
  background: var(--surface-2);
  border-color: var(--ink-3);
}
.talk-tile:nth-child(4) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.talk-tile-number {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.talk-tile h2 {
  margin: 10px 0 8px;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.talk-tile p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}
.talk-tile:nth-child(4) .talk-tile-number,
.talk-tile:nth-child(4) p {
  color: var(--on-accent);
}
h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 17px;
  margin: 20px 0 10px;
}
.muted {
  color: var(--muted);
}
.note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line-2);
  padding-top: 14px;
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 5px;
}

/* ---------- Provenance key ---------- */
.provenance-key {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.prov {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.prov-icon {
  font-weight: 700;
}
.prov-verified {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.prov-illustrative {
  background: var(--surface);
  color: var(--ink);
  border-style: dashed;
}

/* ---------- Release-management flow map ---------- */
.release-flow-map {
  margin-top: 26px;
  border: 1px solid var(--ink);
  border-radius: calc(var(--radius) + 2px);
  padding: clamp(18px, 2.5vw, 30px);
  background:
    linear-gradient(90deg, var(--surface-2) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(var(--surface-2) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface);
}
.flow-map-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.flow-map-heading h2 {
  margin: 0;
}
.flow-map-summary {
  max-width: 50ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.release-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 28px 0 18px;
  padding: 0;
}
.release-flow-step {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.release-flow-step::after {
  content: "→";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.release-flow-step:last-child::after {
  display: none;
}
.flow-number,
.flow-kicker {
  display: block;
  font-family: var(--mono);
}
.flow-number {
  color: var(--muted);
  font-size: 12px;
}
.flow-kicker {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.release-flow-step h3 {
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.2;
}
.release-flow-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}
.flow-skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
}
.flow-skill-chips li {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 10px;
  line-height: 1.2;
}
.phase-trigger,
.phase-skills {
  border-style: dashed;
}
.phase-decision {
  border-width: 2px;
}
.phase-promote {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.phase-promote .flow-number,
.phase-promote .flow-kicker,
.phase-promote p {
  color: var(--on-accent);
}
.flow-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}
.flow-guide > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.flow-guide-mark {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border: 2px solid var(--ink);
}
.flow-guide-trigger {
  border-radius: 50%;
}
.flow-guide-evidence {
  transform: rotate(45deg);
}
.flow-guide-decision {
  background: var(--ink);
}
.flow-foundation {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.flow-foundation-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.flow-foundation-heading h3 {
  margin: 0;
}
.flow-foundation-heading > p {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.flow-skill-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.flow-skill {
  min-width: 0;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
}
.flow-skill .tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.flow-skill h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}
.flow-skill p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}
.flow-skill code {
  font-size: 11px;
}

/* ---------- Grid / cards ---------- */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}
.card h3 {
  margin-top: 0;
}
.card .tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Provenance tag on a card */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.badge.verified {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.badge.illustrative {
  background: var(--surface);
  color: var(--ink-2);
  border-style: dashed;
}

/* ---------- Verdict indicators (never color-only) ---------- */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
}
.verdict .shape {
  width: 12px;
  height: 12px;
  display: inline-block;
  border: 2px solid currentColor;
}
/* BLOCK: filled square + solid danger chip */
.verdict.block {
  background: var(--danger-strong);
  color: var(--on-accent);
  border-color: var(--danger-strong);
}
.verdict.block .shape {
  background: currentColor;
  border-radius: 0;
}
/* Caution: triangle-ish (rotated square) + striped border */
.verdict.caution {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn);
  border-style: dashed;
}
.verdict.caution .shape {
  transform: rotate(45deg);
  background: transparent;
}
/* Safe: circle + light chip */
.verdict.safe {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success);
}
.verdict.safe .shape {
  border-radius: 50%;
  background: transparent;
}

/* ---------- Release Journey: pipeline diagram ---------- */
.pipeline {
  margin-top: 14px;
  margin-bottom: 32px;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid var(--ink);
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(90deg, var(--surface-2) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(var(--surface-2) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface);
}
.pipeline-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.pipeline-node {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  align-items: center;
}
.pipeline-icon {
  font-size: 22px;
  line-height: 1;
}
.pipeline-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pipeline-node strong {
  font-size: 14px;
  line-height: 1.25;
}
.pipeline-sub {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}
.pipeline-node.role-github {
  border-style: dashed;
}
.pipeline-node.role-agent,
.pipeline-node.role-decision {
  border-width: 2px;
}
.pipeline-node.role-promote {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pipeline-node.role-promote .pipeline-role,
.pipeline-node.role-promote .pipeline-sub {
  color: var(--on-accent);
  opacity: 0.85;
}

.pipeline-arrow {
  flex: 0 1 90px;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}
.pipeline-arrow-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}
.pipeline-arrow-line {
  width: 100%;
  height: 1px;
  background: var(--ink);
  position: relative;
}
.pipeline-arrow-line::after {
  content: "\25B6";
  position: absolute;
  right: -2px;
  top: -6px;
  font-size: 10px;
  color: var(--ink);
}

.pipeline-branch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0;
}
.pipeline-branch-line {
  width: 1px;
  height: 26px;
  background: var(--ink);
  position: relative;
}
.pipeline-branch-line::after {
  content: "\25BC";
  position: absolute;
  left: -5px;
  bottom: -10px;
  font-size: 10px;
  color: var(--ink);
}
.pipeline-branch-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pipeline-row-evidence {
  gap: 14px;
}
.pipeline-evidence-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.pipeline-evidence-card strong {
  font-size: 13px;
}
.pipeline-evidence-card span:last-child {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}

/* ---------- Policy Gate / Downstream Safety: scenario explorer ---------- */
.scenario-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.scenario-pick {
  appearance: none;
  text-align: left;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.scenario-pick:hover {
  border-color: var(--ink-3);
}
.scenario-pick[aria-pressed="true"] {
  border-width: 2px;
  border-color: var(--accent);
  background: var(--surface-2);
}
.scenario-pick strong {
  font-size: 14px;
  line-height: 1.3;
}
.scenario-pick-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.scenario-trace {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 64px;
}
.step-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--surface);
  animation: scenarioStepIn 0.28s ease-out;
}
.step-card-final {
  border-left-color: var(--accent);
  border-left-width: 3px;
  background: var(--surface-2);
}
.step-number {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.step-content {
  flex: 1;
  min-width: 0;
}
.step-kicker {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.step-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.step-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.step-body p {
  margin: 0 0 6px;
}
.step-body p:last-child {
  margin-bottom: 0;
}
.step-body .verdict {
  margin-bottom: 8px;
}

@keyframes scenarioStepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Journey ---------- */
.journey {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}
.journey li {
  counter-increment: step;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 16px 60px;
  position: relative;
}
.journey li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.journey .actor {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Order Desk: live health strip ---------- */
.health-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 74ch;
}
.health-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
}
.health-checking {
  border-style: dashed;
  border-color: var(--accent);
  background: transparent;
}
.health-ok {
  border-radius: 50%;
  background: var(--success);
  border-color: var(--success);
}
.health-down {
  border-radius: 0;
  background: var(--danger);
  border-color: var(--danger);
}
.health-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.health-text strong {
  font-size: 13px;
}
#health-status-text {
  color: var(--ink-2);
}
.health-meta {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ---------- Order Desk: deployment-detection heading ---------- */
.deploy-detect-heading {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.deploy-detect-heading h3 {
  margin: 4px 0 10px;
}
.deploy-detect-lead {
  max-width: 74ch;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Trust banner ---------- */
.trust-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 74ch;
}
.trust-banner-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.4;
}
.trust-banner strong {
  color: var(--ink);
}

/* ---------- Two column ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ---------- Forms ---------- */
.form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 4px;
}
.form input,
.form select {
  width: 100%;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.form .hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.form .btn {
  margin-top: 18px;
  width: 100%;
}
.feedback {
  margin-top: 12px;
  font-size: 13px;
  min-height: 1.2em;
}
.feedback.ok {
  color: var(--success);
  font-weight: 600;
}
.feedback.err {
  color: var(--danger);
  font-weight: 600;
  border-left: 3px solid var(--danger);
  padding-left: 10px;
}

/* ---------- Orders list ---------- */
.order-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.order-item .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.order-item .code {
  font-family: var(--mono);
  font-weight: 700;
}
.order-item .meta {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.order-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
}
.order-status::before {
  content: "●";
  font-size: 9px;
}

/* ---------- Prose ---------- */
.prose {
  max-width: 74ch;
}
.prose p {
  color: var(--ink-2);
}

/* ---------- Auth gate (dedicated sign-in / sign-up screen) ----------
   #app-shell and #auth-gate are mutually exclusive top-level views, toggled
   by JS adding/removing a modifier class. Deliberately NOT using the native
   `hidden` attribute here: `#app-shell` needs `display: contents` when
   visible so header/main/footer remain direct grid children of <body> for
   the desktop no-scroll layout, and an unconditional `display` declaration
   on an author stylesheet always wins over the browser's `[hidden]` default
   regardless of specificity — that mismatch previously made a hidden modal
   render anyway. Owning both the shown and hidden state in one class avoids
   the conflict entirely. */
#app-shell {
  display: none;
}
#app-shell.is-visible {
  display: contents;
}
#auth-gate {
  display: block;
}
#auth-gate.is-hidden {
  display: none;
}
.auth-gate-inner {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 32px 28px;
}
.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-gate-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}
.auth-gate-lead {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.auth-gate-card .form .btn {
  width: 100%;
}
.link-btn {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover {
  color: var(--accent-hover);
}
.auth-gate-switch {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}

/* ---------- Configure the Agent: setup code walk ---------- */
.setup-lead {
  max-width: 74ch;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 6px 0 0;
}

.setup-steps {
  list-style: none;
  counter-reset: setup-step;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 16px;
}
.setup-step {
  counter-increment: setup-step;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px 64px;
  background: var(--surface);
}
.setup-step::before {
  content: counter(setup-step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.setup-step h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.setup-step-file {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.setup-step p {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}
.setup-step p:last-child {
  margin-bottom: 0;
}
.setup-step-note {
  font-size: 12px;
  color: var(--muted);
}
.setup-step-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}
.setup-step-list li {
  margin-bottom: 4px;
}
.setup-step-list li:last-child {
  margin-bottom: 0;
}

.field-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}
.field-list-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.field-list-row dt {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.field-list-row dd {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

.skill-samples {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.skill-sample {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 16px;
  background: var(--surface);
}
.skill-sample + .skill-sample {
  margin-top: 0;
}
.skill-sample summary {
  cursor: pointer;
  padding: 12px 0;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  padding-right: 24px;
}
.skill-sample summary::-webkit-details-marker {
  display: none;
}
.skill-sample summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
}
.skill-sample[open] summary::after {
  content: "\2212";
}
.skill-sample[open] summary {
  border-bottom: 1px solid var(--line-2);
}
.skill-sample-name {
  font-weight: 700;
  font-size: 14px;
  font-family: var(--mono);
}
.skill-sample-body {
  margin: 0;
  padding: 14px 0 16px;
  max-height: 420px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.skill-sample-body code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

/* ---------- Learn: analogy box ---------- */
.analogy-box {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface-2);
  max-width: 74ch;
}
.analogy-box p:last-child {
  margin: 8px 0 0;
  color: var(--ink-2);
}

/* ---------- Learn: FAQ accordion ---------- */
.faq {
  margin-top: 28px;
  display: grid;
  gap: 24px;
}
.faq-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 16px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 8px;
  background: var(--surface);
}
.faq-item + .faq-item {
  margin-top: 8px;
}
.faq-item summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
}
.faq-item[open] summary::after {
  content: "\2212";
}
.faq-item[open] summary {
  border-bottom: 1px solid var(--line-2);
}
.faq-answer {
  padding: 12px 0 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.faq-answer p {
  margin: 0 0 6px;
}
.faq-answer p:first-child {
  margin-top: 0;
}
.faq-answer ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.faq-answer ul:last-child {
  margin-bottom: 0;
}
.faq-answer li {
  margin-bottom: 4px;
}
.faq-answer li:last-child {
  margin-bottom: 0;
}

/* ---------- Learn: footnote strip ---------- */
.footnote-strip {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.footnote-strip p:last-child {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

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

/* ---------- Footer ---------- */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  max-width: var(--max-shell);
  margin: 0 auto;
  width: 100%;
}
.env-badge {
  font-family: var(--mono);
}

/* ---------- Responsive: allow scroll + stacking at narrow widths / zoom ---------- */
@media (max-width: 1320px) {
  .talk-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .release-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .release-flow-step::after {
    display: none;
  }
}

@media (max-width: 999px), (max-height: 639px) {
  .release-flow-map {
    padding: 18px;
  }
  .flow-map-heading,
  .flow-foundation-heading {
    display: block;
  }
  .talk-tiles {
    grid-template-columns: 1fr;
  }
  .talk-tile {
    min-height: 0;
  }
  .flow-map-summary,
  .flow-foundation-heading > p {
    margin-top: 12px;
  }
  .release-flow {
    grid-template-columns: 1fr;
  }
  .release-flow-step {
    min-height: 0;
  }
  .flow-guide {
    grid-template-columns: 1fr;
  }
  .flow-skill-strip {
    grid-template-columns: 1fr;
  }
  .footnote-strip {
    grid-template-columns: 1fr;
  }
  .pipeline-row,
  .pipeline-row-evidence {
    flex-direction: column;
  }
  .pipeline-arrow {
    flex: 0 0 auto;
    min-height: 32px;
    transform: rotate(90deg);
    margin: 4px 0;
  }
  .pipeline-arrow-label {
    transform: rotate(-90deg);
    white-space: nowrap;
  }
  body {
    display: block;
    height: auto;
    overflow: auto;
  }
  .app-header {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .field-list-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .setup-step {
    padding: 50px 16px 18px;
  }
  .setup-step::before {
    left: 16px;
    top: 16px;
  }
  .panel-scroll {
    padding: 20px 0 40px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
