/* app.css — hand-written stylesheet for the cloud web binary.
 *
 * Layered on top of open-props.min.css (loaded first) for design
 * tokens. Slice 1 of issue #4: shell, topbar, hero, footer.
 * Subsequent slices extend with scenario cards, the loop diagram,
 * the without/with comparison, and the examples grid. See RFC 006.
 */

/* ── Tokens ─────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg: var(--gray-12);
  --bg-elev: var(--gray-11);
  --bg-code: #0a0a0a;
  --fg: var(--gray-1);
  --fg-muted: var(--gray-5);
  --fg-soft: var(--gray-3);
  --rule: var(--gray-9);
  --rule-soft: var(--gray-10);
  --accent: var(--lime-3);
  --accent-soft: var(--lime-7);
  --danger: var(--red-3);
  --warn: var(--orange-3);
  --ok: var(--lime-3);

  --max-page: 1080px;
  --max-prose: 64ch;

  --font-display: var(--font-mono);
  --font-body: var(--font-sans);
  --font-code: var(--font-mono);

  --radius: var(--radius-2);
  --rule-width: 1px;
}

/* ── Reset ──────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--font-size-2);
  line-height: var(--font-lineheight-3);
  -webkit-font-smoothing: antialiased;
  /* Safety belt: no individual element should ever push the
   * page wider than the viewport. If one does (long URL in a
   * <pre>, fixed-width table, oversized image), we'd rather
   * clip than horizontally scroll the whole page. NB: use `clip`,
   * not `hidden` — `hidden` makes the body a scroll container,
   * which silently breaks `position: sticky` on descendants
   * (the landing tower). `clip` keeps the horizontal safety belt
   * without establishing a scroll container. */
  overflow-x: clip;
}

/* Landing-page color overrides. The illustrated landing (#228) ships
 * a dark airfield aesthetic with a lime accent — different from the
 * dashboard tokens. Scoped to body:has(.lp-hero) so the dashboard,
 * receipt, and legal pages stay on their default tokens. */
body:has(.lp-hero) {
  --bg: #0a0b0d;
  --bg-elev: #101115;
  --bg-code: #0a0a0a;
  --fg: #e8e8ea;
  --fg-muted: #6a6c72;
  --fg-soft: #a8aab0;
  --rule: #1c1d22;
  --rule-soft: #141519;
  --accent: #b6e83b;
  --accent-soft: #7fea0e;

  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 80% -10%, rgba(127, 234, 14, 0.06), transparent 38%),
    radial-gradient(circle at -10% 110%, rgba(127, 234, 14, 0.04), transparent 35%);
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-code);
  font-size: 0.95em;
}

main {
  display: block;
}

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-4);
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

body:has(.lp-hero) .topbar {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom-color: var(--rule);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: var(--size-4);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.02em;
}

.topbar nav a {
  color: var(--fg-muted);
  text-decoration: none;
}

.topbar nav a:hover {
  color: var(--fg);
}

/* The topbar's <details>/<summary> wrapper. Above 720px the
 * disclosure is invisible — we force the nav open and hide
 * the burger. Below 720px the nav lives inside the disclosure
 * and the burger toggles it. No JS required.
 */
.topbar-nav {
  display: contents;
}

.topbar-nav > summary {
  display: none;
  list-style: none;
  cursor: pointer;
  padding: var(--size-2);
  border-radius: var(--radius);
}

.topbar-nav > summary::-webkit-details-marker { display: none; }
.topbar-nav > summary::marker { content: ''; }

.topbar-nav > summary:hover {
  background: color-mix(in oklab, var(--fg) 6%, transparent);
}

.topbar-nav > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.burger {
  display: inline-block;
  width: 1.25rem;
  height: 0.875rem;
  position: relative;
}

.burger::before,
.burger::after,
.burger {
  background: linear-gradient(var(--fg), var(--fg)) no-repeat;
  background-size: 100% 2px;
}

.burger {
  background-position: 0 50%;
}

.burger::before,
.burger::after {
  content: '';
  position: absolute;
  inset: 0;
  background-position: 0 0;
}

.burger::after {
  background-position: 0 100%;
}

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-8) var(--size-5) var(--size-8);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.hero .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--size-3);
}

.hero h1 {
  font-size: 4rem;
  letter-spacing: 0;
  margin-bottom: var(--size-2);
}

.hero .tagline {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  font-weight: 500;
  color: var(--fg);
  margin-bottom: var(--size-4);
  letter-spacing: 0;
}

/* ── Boundary · product loop ───────────────────────────────────── */

.boundary {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-8) var(--size-5) var(--size-9);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.boundary .section-head {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.boundary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--size-5);
  align-items: start;
}

.boundary-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

.boundary-flow li,
.boundary-proof {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
}

.boundary-flow li {
  padding: var(--size-4);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.flow-step {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--font-size-0);
}

.boundary-flow h3,
.boundary-proof h3 {
  font-size: var(--font-size-3);
}

.boundary-flow p {
  color: var(--fg-soft);
  font-size: var(--font-size-1);
}

.boundary-proof {
  padding: var(--size-4);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

.decision-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.decision-list li {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) max-content minmax(0, 1fr);
  gap: var(--size-3);
  align-items: center;
  padding: var(--size-2) 0;
  border-bottom: 1px solid var(--rule-soft);
}

.decision-list li:last-child {
  border-bottom: 0;
}

.decision-input {
  font-family: var(--font-display);
  color: var(--fg);
}

.decision-note {
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

@media (max-width: 900px) {
  .boundary-grid,
  .boundary-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .decision-list li {
    grid-template-columns: 1fr;
    gap: var(--size-1);
  }
}

.hero .lede {
  max-width: var(--max-prose);
  font-size: var(--font-size-3);
  color: var(--fg-soft);
  margin-bottom: var(--size-6);
}

/* ── CTAs ───────────────────────────────────────────────────────── */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
  margin-bottom: var(--size-8);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: transparent;
  color: var(--fg);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--gray-12);
}

.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--gray-12);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
}

.btn-ghost {
  border-color: var(--rule-soft);
  color: var(--fg-muted);
}

.btn-danger {
  border-color: color-mix(in oklab, var(--danger) 55%, var(--rule));
  color: color-mix(in oklab, var(--danger) 85%, white);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: color-mix(in oklab, var(--danger) 10%, transparent);
  color: color-mix(in oklab, var(--danger) 90%, white);
}

/* ── Terminal-style code panels ─────────────────────────────────── */

.hero-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
  align-items: stretch;
}

.hero-aside {
  max-width: var(--max-prose);
  margin: var(--size-4) auto 0;
  font-size: var(--font-size-1);
  color: var(--fg-soft);
}

.hero-aside code {
  font-family: var(--font-code);
  font-size: 0.95em;
  color: var(--fg);
}

.terminal {
  margin: 0;
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-out {
  border-color: color-mix(in oklab, var(--accent) 30%, var(--rule-soft));
}

.terminal-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: var(--size-2) var(--size-4);
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in oklab, var(--bg-elev) 60%, transparent);
}

.terminal pre {
  margin: 0;
  padding: var(--size-4);
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  line-height: 1.55;
  overflow-x: auto;
  color: var(--fg);
}

.terminal-out pre {
  color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────────── */

footer {
  max-width: var(--max-page);
  margin: var(--size-8) auto 0;
  padding: var(--size-7) var(--size-5) var(--size-8);
  border-top: var(--rule-width) solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(120px, 0.8fr));
  gap: var(--size-6) var(--size-5);
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  max-width: 30ch;
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg);
}

.footer-note {
  color: var(--fg-soft);
  font-size: var(--font-size-1);
  line-height: 1.55;
  margin: 0;
}

.footer-meta {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.04em;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  font-family: var(--font-display);
  font-size: var(--font-size-1);
}

.footer-col-title {
  color: var(--fg);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--size-1);
}

.footer-col a {
  color: var(--fg-muted);
  text-decoration: none;
}

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

@media (max-width: 720px) {
  footer {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 460px) {
  footer {
    grid-template-columns: 1fr;
  }
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .hero {
    padding: var(--size-8) var(--size-4) var(--size-7);
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-panels {
    grid-template-columns: 1fr;
  }

  /* Mobile nav: the <details> burger toggles a vertical link list
   * that drops below the topbar. Closed by default; the user
   * controls when it opens. No JS required. */
  .topbar {
    flex-wrap: wrap;
    gap: var(--size-2);
  }

  .topbar-nav > summary {
    display: inline-flex;
    align-items: center;
  }

  .topbar nav {
    display: none;
    flex-direction: column;
    gap: var(--size-3);
    width: 100%;
    padding: var(--size-3) 0 var(--size-2);
    border-top: 1px solid var(--rule-soft);
    margin-top: var(--size-2);
  }

  .topbar-nav[open] nav {
    display: flex;
  }

  .topbar nav a {
    font-size: var(--font-size-2);
    padding: var(--size-2) 0;
  }
}


/* ── Section headers (shared) ──────────────────────────────────── */

.section-head {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-5);
}

.section-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--size-3);
}

.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--size-3);
}

.section-head .section-lede {
  max-width: var(--max-prose);
  font-size: var(--font-size-3);
  color: var(--fg-soft);
}

/* ── Scenarios section ─────────────────────────────────────────── */

.scenarios {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.scenario-grid {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--size-5);
  align-items: start;
}

@media (max-width: 900px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

/* Single-column list once all five scenarios land (slice 3+). */
.scenario-list {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-5);
}

/* ── Scenario card ─────────────────────────────────────────────── */

.scenario {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-5);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  scroll-margin-top: 5rem;
}

.scenario-ok    { border-left: 3px solid var(--ok); }
.scenario-warn  { border-left: 3px solid var(--warn); }
.scenario-danger { border-left: 3px solid var(--danger); }

.scenario-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.scenario-title {
  display: flex;
  align-items: center;
  gap: var(--size-3);
  flex-wrap: wrap;
}

.scenario-title h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-4);
  letter-spacing: -0.01em;
  margin: 0;
}

.scenario-summary {
  color: var(--fg-soft);
  max-width: var(--max-prose);
}

/* Badges */

.badge {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--fg-muted);
  white-space: nowrap;
}

.badge-ok     { color: var(--ok); }
.badge-warn   { color: var(--warn); }
.badge-danger { color: var(--danger); }

/* Side-by-side terminal panels inside cards */

.scenario-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 720px) {
  .scenario-panels {
    grid-template-columns: 1fr;
  }
}

.terminal-out-ok     pre { color: var(--ok); }
.terminal-out-warn   pre { color: var(--warn); }
.terminal-out-danger pre { color: var(--danger); }

.terminal-out-warn   { border-color: color-mix(in oklab, var(--warn) 30%, var(--rule-soft)); }
.terminal-out-danger { border-color: color-mix(in oklab, var(--danger) 30%, var(--rule-soft)); }

/* Audit trail (collapsible) */

.scenario-trail {
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
}

.scenario-trail > summary {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  list-style: none;
}

.scenario-trail > summary::-webkit-details-marker { display: none; }

.scenario-trail > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: var(--size-2);
  color: var(--fg-muted);
  transition: transform 120ms ease;
}

.scenario-trail[open] > summary::before {
  transform: rotate(90deg);
}

.scenario-trail[open] > summary {
  color: var(--fg);
  margin-bottom: var(--size-3);
}

.timeline {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

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

.timeline th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom-color: var(--rule);
}

.timeline tbody tr:last-child td {
  border-bottom: 0;
}

.t-time   { color: var(--fg-muted); white-space: nowrap; }
.t-kind   { color: var(--accent); white-space: nowrap; }
.t-actor  { color: var(--fg-soft); white-space: nowrap; }
.t-summary { color: var(--fg); }

.rebuild {
  margin: var(--size-3) 0 0;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
}

.rebuild-ok   { color: var(--ok); }
.rebuild-fail { color: var(--danger); }

.scenario-rationale {
  color: var(--fg-soft);
  max-width: var(--max-prose);
  font-size: var(--font-size-2);
  border-left: 2px solid var(--rule-soft);
  padding-left: var(--size-3);
}

/* Placeholder aside (removed when remaining cards land) */

.scenario-placeholder {
  position: sticky;
  top: 5rem;
  background: var(--bg-elev);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: var(--size-4);
  color: var(--fg-muted);
}

.scenario-placeholder .placeholder-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--size-2);
}

.scenario-placeholder ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.scenario-placeholder li::before {
  content: "·  ";
  color: var(--rule);
}


/* ── Shape diagram ─────────────────────────────────────────────── */

.shape {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.shape-figure {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
}

.shape-svg {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  color: var(--accent);
  margin: 0 auto;
}

.shape-svg .shape-input {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--fg-muted);
}

.shape-svg .shape-node rect {
  fill: var(--bg-elev);
  stroke: var(--rule);
  stroke-width: 1;
}

.shape-svg .shape-node-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--fg);
}

.shape-svg .shape-node-caption {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--fg-muted);
}

.shape-caption {
  max-width: var(--max-prose);
  margin: var(--size-4) auto 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  text-align: left;
}


/* ── Why · without/with panels ─────────────────────────────────── */

.why {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.why-panels {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 900px) {
  .why-panels {
    grid-template-columns: 1fr;
  }
}

.why-note {
  max-width: var(--max-prose);
  margin: var(--size-5) auto 0;
  padding: 0 var(--size-5);
  color: var(--fg-soft);
  font-size: var(--font-size-2);
}

/* ── Examples grid ─────────────────────────────────────────────── */

.examples {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

/* The examples section is a single focused stage: pills on top,
   one example panel below. Dimensions and spacing match the rest of
   the page. */
.examples-stage {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

/* Tab strip: two pills with a name and a one-word claim label
   underneath. The active tab carries a green underline so the
   selected example is unambiguous. */
.example-tabs {
  display: flex;
  gap: var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-2);
  flex-wrap: wrap;
}

.example-tab {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-decoration: none;
  color: var(--fg-muted);
  font-family: var(--font-display);
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.example-tab:hover {
  color: var(--fg);
  background: var(--bg-elev);
}

.example-tab.is-active {
  color: var(--fg);
  background: var(--bg-elev);
  border-color: var(--rule);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.example-tab .tab-name {
  font-size: var(--font-size-2);
  letter-spacing: -0.005em;
}

.example-tab .tab-claim-label {
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.example-tab.is-active .tab-claim-label {
  color: var(--accent);
}

/* The single focused panel below the tabs: claim → proof → table → link. */
.example-panel {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-5);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  scroll-margin-top: 5rem;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.panel-head-text {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.panel-hook {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--fg);
  max-width: var(--max-prose);
}

.panel-sub {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  max-width: var(--max-prose);
}

/* CTA row: three actions a visitor wants next. Primary action gets
   accent treatment; the others are quieter links. */
.panel-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3) var(--size-4);
  align-items: center;
  font-family: var(--font-display);
  font-size: var(--font-size-1);
}

.panel-cta-link {
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

.panel-cta-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel-cta-primary {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* The outcome table moves behind a <details> so the proof reads first.
   Visitors who want the receipt expand it; visitors who want the value
   skip it. */
.panel-table {
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
}

.panel-table > summary {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  list-style: none;
}

.panel-table > summary::-webkit-details-marker { display: none; }

.panel-table > summary::before {
  content: "▶";
  display: inline-block;
  margin-right: var(--size-2);
  color: var(--fg-muted);
  transition: transform 120ms ease;
}

.panel-table[open] > summary::before {
  transform: rotate(90deg);
}

.panel-table[open] > summary {
  color: var(--fg);
  margin-bottom: var(--size-3);
}

/* ── Diff strip (refund-agno) ─────────────────────────────────── */

.diff-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
}

@media (max-width: 720px) {
  .diff-strip { grid-template-columns: 1fr; }

  /* Tables with fixed % widths + nowrap (.example-table,
   * .security-table, .receipt-table, .prose table) can extend
   * past the viewport. Scope a horizontal scroll to the table
   * itself so the rest of the page stays inside the viewport. */
  .example-table,
  .security-table,
  .receipt-table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
}

.diff-side {
  margin: 0;
  padding: var(--size-3) var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
}

.diff-without {
  border-color: color-mix(in oklab, var(--danger) 30%, var(--rule-soft));
}

.diff-with {
  border-color: color-mix(in oklab, var(--ok) 30%, var(--rule-soft));
}

.diff-side figcaption {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-soft);
  margin-bottom: var(--size-2);
  display: flex;
  align-items: center;
  gap: var(--size-2);
  flex-wrap: wrap;
}

.diff-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.diff-without .diff-label { color: var(--danger); }
.diff-with .diff-label    { color: var(--ok); }

.diff-side ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--fg);
}

.diff-side li::before {
  content: "·  ";
  color: var(--fg-muted);
}

.diff-without li { color: var(--fg); }
.diff-with li    { color: var(--fg); }

/* ── Breadth strip (support-ops) ──────────────────────────────── */

/* The breadth strip is a numbered ticket list. Each row reads
   "ticket N · subject → outcome chip". It doubles as the receipt,
   so no <details> table follows for this variant. */
.breadth-strip {
  margin: 0;
  padding: var(--size-3) var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.breadth-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: var(--size-3);
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.breadth-n {
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.breadth-subject {
  color: var(--fg);
}

.breadth-arrow {
  color: var(--fg-muted);
  justify-self: end;
}

@media (max-width: 540px) {
  .breadth-row {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
  }
  .breadth-arrow {
    display: none;
  }
}

.chip {
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--fg-muted);
  white-space: nowrap;
}

.chip-ok     { color: var(--ok); }
.chip-warn   { color: var(--warn); }
.chip-danger { color: var(--danger); }

.example-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.example-table th,
.example-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}

.example-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
  border-bottom-color: var(--rule);
}

.example-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Column widths: outcome is the predictable middle, input gets a
   readable share, note absorbs the rest. */
.example-table .ex-input   { width: 36%; color: var(--fg); }
.example-table .ex-outcome { width: 26%; color: var(--accent); white-space: nowrap; }
.example-table .ex-note    { width: 38%; color: var(--fg-soft); }

/* Below ~520px, drop the note column entirely so the table stays
   inside its panel. */
@media (max-width: 520px) {
  .example-table .ex-note,
  .example-table thead th:nth-child(3) {
    display: none;
  }
  .example-table .ex-input   { width: 60%; }
  .example-table .ex-outcome { width: 40%; }
}

/* ── What KIFF is not · pills ──────────────────────────────────── */

.not {
  border-bottom: var(--rule-width) solid var(--rule-soft);
  padding-bottom: var(--size-9);
}

.pill-row {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--size-2);
  padding: 0.55rem 0.9rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg);
  flex-wrap: wrap;
}

.pill-label {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.pill-aside {
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

/* ── Install · three commands ──────────────────────────────────── */

.install {
  padding-bottom: var(--size-9);
}

.install-block {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-3) var(--size-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}


/* ── Scenarios aside · cloud line under the five cards ────────── */

.scenarios-aside {
  max-width: var(--max-page);
  margin: var(--size-5) auto 0;
  padding: var(--size-3) var(--size-5);
  color: var(--fg-muted);
  font-size: var(--font-size-1);
  border-top: 1px solid var(--rule-soft);
}

.scenarios-aside code {
  font-family: var(--font-code);
  color: var(--fg);
  background: var(--bg-elev);
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.95em;
}

/* ── Cloud card · the page's only cloud surface ────────────────── */

.cloud-card {
  max-width: var(--max-page);
  margin: var(--size-5) auto 0;
  padding: var(--size-5);
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
  scroll-margin-top: 5rem;
}

.cloud-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.cloud-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.cloud-head h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-3);
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}

.cloud-body {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
  max-width: var(--max-prose);
}

.cloud-body code {
  font-family: var(--font-code);
  color: var(--fg);
  background: var(--bg-code);
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.95em;
}

.cloud-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-3);
  margin-top: var(--size-2);
}

.cloud-cta-link {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

.cloud-cta-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cloud-cta-primary {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cloud-cta-tertiary {
  color: var(--fg-muted);
}

.cloud-status {
  margin: var(--size-3) 0 0;
  font-size: var(--font-size-1);
  color: var(--fg-muted);
}

.cloud-status strong {
  color: var(--fg-soft);
  font-weight: 500;
}

/* The cloud-card sits between the examples section and the
   not-pills section. Push the not-pills border up so the card
   does not float on its own. */
.examples + .cloud-card {
  margin-top: var(--size-7);
}

.cloud-card + .not {
  margin-top: var(--size-7);
}


/* ── Layer triad · Framework / Studio / Cloud (RFC 011 M1.3a) ──── */

.triad {
  max-width: var(--max-page);
  margin: var(--size-7) auto 0;
  padding: 0 var(--size-3);
  scroll-margin-top: 5rem;
}

.triad-head {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  margin-bottom: var(--size-5);
  max-width: var(--max-prose);
}

.triad-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.triad-head h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-3);
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}

.triad-lede {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-2);
}

.triad-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--size-4);
}

.triad-card {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-4);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.triad-card-accent {
  border-left: 3px solid var(--accent);
}

.triad-tag {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}

.triad-card h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-2);
  letter-spacing: -0.005em;
  color: var(--fg);
  margin: 0;
}

.triad-body {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-1);
  line-height: 1.55;
  flex: 1;
}

.triad-body code {
  font-family: var(--font-code);
  color: var(--fg);
  background: var(--bg-code);
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  font-size: 0.95em;
}

.triad-cta {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
  align-self: flex-start;
  margin-top: var(--size-2);
}

.triad-cta:hover {
  border-bottom-color: var(--accent);
}

.cloud-card + .triad {
  margin-top: var(--size-5);
}

.triad + .not {
  margin-top: var(--size-7);
}



/* ── Whitepaper page (/whitepaper) ─────────────────────────────── */

/* The whitepaper wears the same Layout as the landing — same topbar,
   same footer — but the main column is constrained to a reading
   width and the typography is tuned for body prose. */
.whitepaper {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
}

.whitepaper-head {
  margin-bottom: var(--size-6);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-4);
}

.whitepaper-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.whitepaper-source {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

/* Typography scope for the rendered markdown. Kept minimal: dark
   reading column, generous line height, code blocks aligned with the
   rest of the design system. */
.prose {
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 1.7;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: var(--size-8) 0 var(--size-3);
}

.prose h1:first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: var(--size-7) 0 var(--size-3);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-4);
  color: var(--fg);
  margin: var(--size-6) 0 var(--size-3);
}

.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-display);
  color: var(--fg);
  margin: var(--size-5) 0 var(--size-2);
}

.prose p { margin: 0 0 var(--size-4); }

.prose strong { color: var(--fg); }
.prose em { color: var(--fg); }

.prose a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--size-4) 0;
  padding-left: var(--size-5);
}

.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  margin: var(--size-4) 0;
  padding: var(--size-2) var(--size-4);
  border-left: 3px solid var(--rule);
  color: var(--fg-muted);
  font-style: normal;
}

.prose hr {
  margin: var(--size-7) 0;
  border: 0;
  border-top: 1px solid var(--rule-soft);
}

.prose code {
  font-family: var(--font-code);
  font-size: 0.95em;
  background: var(--bg-elev);
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  color: var(--fg);
}

.prose pre {
  margin: var(--size-4) 0;
  padding: var(--size-4);
  background: var(--bg-code);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  line-height: 1.55;
  color: var(--fg);
}

.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--size-4) 0;
  font-family: var(--font-code);
  font-size: var(--font-size-1);
}

.prose th,
.prose td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
}

.prose tbody tr:last-child td { border-bottom: 0; }

/* gomarkdown emits <h*> ids when AutoHeadingIDs is enabled.
   Keep anchor jumps clear of the sticky topbar. */
.prose [id] { scroll-margin-top: 5rem; }


/* ── Security page (/security) ───────────────────────────────────── */

/* Same Layout as the landing/whitepaper. Reading-column constraint
   like the whitepaper, but with section blocks (h2 + content) and a
   grid layout for the operational practices. */
.security {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
  color: var(--fg-soft);
  line-height: 1.7;
}

.security-head {
  margin-bottom: var(--size-7);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-5);
}

.security-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.security-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 var(--size-3);
}

.security-lede {
  font-size: 17px;
  margin: 0;
}

.security-section {
  margin: var(--size-7) 0;
}

.security-section h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  color: var(--fg);
  margin: 0 0 var(--size-3);
  letter-spacing: -0.01em;
}

.security-section h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-3);
  color: var(--fg);
  margin: var(--size-5) 0 var(--size-2);
  letter-spacing: -0.005em;
}

.security-section em {
  font-style: italic;
  color: var(--fg);
}

.security-section .section-lede {
  margin: 0 0 var(--size-4);
  color: var(--fg-muted);
}

.security-section p {
  margin: 0 0 var(--size-3);
}

.security-section a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.security-section a:hover {
  text-decoration-color: var(--accent);
}

.security-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  border: 1px solid var(--rule-soft);
  padding: 0.05em 0.35em;
  border-radius: var(--radius-2);
  color: var(--fg);
}

/* Operational-practices grid: <dl> with one <div class="security-row">
   per (term, definition) pair. Two columns on desktop, single column
   on narrow viewports. */
.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-5);
  margin: 0;
}

.security-row {
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}

.security-row dt {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 var(--size-2);
}

.security-row dd {
  margin: 0;
  color: var(--fg-soft);
}

@media (max-width: 640px) {
  .security-grid {
    grid-template-columns: 1fr;
    gap: var(--size-4);
  }
}

/* Sub-processor table. Same reading column, same border treatment
   as the whitepaper's tables. */
.security-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.security-table th,
.security-table td {
  text-align: left;
  padding: var(--size-3) var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.security-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.security-table tbody tr:last-child td { border-bottom: 0; }

/* Roadmap section. Visually distinct so a reader scanning the page
   for "what is missing" finds it without scrolling past artifacts. */
.security-roadmap {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-3);
  padding: var(--size-5);
  background: var(--surface-soft);
}

.security-roadmap-list {
  margin: 0 0 var(--size-4);
  padding-left: var(--size-4);
  display: grid;
  gap: var(--size-3);
}

.security-roadmap-list li {
  color: var(--fg-soft);
}

.security-roadmap-list strong {
  color: var(--fg);
}

.security-roadmap-note {
  margin: 0;
  color: var(--fg-muted);
  font-size: var(--font-size-1);
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}

/* ── Legal pages (/privacy, /terms, future /legal/*) ──────────────
   Long-form prose pages reuse the .prose typography; .legal adds
   the page header treatment and a small footnote block. No new
   component classes beyond these — section spacing, lists, links
   all inherit from .prose. */

.legal {
  max-width: 56rem;
  margin: var(--size-7) auto;
  padding: 0 var(--size-4);
}

.legal-head {
  margin: 0 0 var(--size-6);
  padding-bottom: var(--size-4);
  border-bottom: 1px solid var(--rule-soft);
}

.legal-badge {
  display: inline-block;
  margin: 0 0 var(--size-3);
  padding: 0.2em 0.7em;
  font-family: var(--font-mono);
  font-size: var(--font-size-0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--surface-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-2);
}

.legal-meta {
  margin: var(--size-2) 0 var(--size-3);
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

.legal-meta strong {
  color: var(--fg);
  font-weight: 600;
}

.legal-disclaimer {
  margin: var(--size-3) 0 0;
  padding: var(--size-3) var(--size-4);
  background: var(--surface-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-2);
  color: var(--fg-soft);
  font-size: var(--font-size-1);
}

.legal-footnote {
  margin: var(--size-4) 0 0;
  color: var(--fg-muted);
  font-size: var(--font-size-0);
  line-height: 1.6;
}


/* ── Receipt dashboard (/dashboard/receipts/{trace_id}) ──────────── */

/* Same Layout as the rest of the site so the dashboard feels like
   one product. Reading column slightly wider than the whitepaper
   because the causal-chain table needs more room. */
.receipt {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--size-9) var(--size-5) var(--size-9);
  color: var(--fg-soft);
  line-height: 1.65;
}

.receipt-empty .receipt-head {
  border-bottom: 0;
  padding-bottom: 0;
}

.receipt-head {
  margin-bottom: var(--size-7);
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: var(--size-5);
}

.receipt-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--size-2);
}

.receipt-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0 0 var(--size-3);
}

.receipt-lede {
  font-size: 17px;
  margin: 0;
}

.receipt-section {
  margin: var(--size-7) 0;
}

.receipt-section h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  color: var(--fg);
  margin: 0 0 var(--size-3);
  letter-spacing: -0.01em;
}

.receipt-section .section-lede {
  margin: 0 0 var(--size-4);
  color: var(--fg-muted);
}

.receipt-section p {
  margin: 0 0 var(--size-3);
}

.receipt-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-soft);
  border: 1px solid var(--rule-soft);
  padding: 0.05em 0.35em;
  border-radius: var(--radius-2);
  color: var(--fg);
}

.receipt-section .muted { color: var(--fg-muted); }

/* Identity + attestation grids — same shape as the security page's
   operational-practices grid. Two columns on desktop, single column
   on narrow viewports. */
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-5);
  margin: 0;
}

.receipt-row {
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--size-3);
}

.receipt-row dt {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 var(--size-2);
}

.receipt-row dd {
  margin: 0;
  color: var(--fg-soft);
  word-break: break-word;
}

@media (max-width: 640px) {
  .receipt-grid {
    grid-template-columns: 1fr;
    gap: var(--size-4);
  }
}

/* Causal-chain table. */
.receipt-chain,
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: var(--font-size-1);
}

.receipt-chain th,
.receipt-chain td,
.receipt-table th,
.receipt-table td {
  text-align: left;
  padding: var(--size-3) var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

.receipt-chain th,
.receipt-table th {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.receipt-chain tbody tr:last-child td,
.receipt-table tbody tr:last-child td { border-bottom: 0; }

.receipt-chain code.hash,
.receipt-section code.hash {
  font-size: 0.85em;
  letter-spacing: 0.02em;
}

/* Roadmap section — same visual cue as the security page's roadmap
   so visitors recognize "this is what we don't yet have" without
   having to read the heading. */
.receipt-roadmap {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-3);
  padding: var(--size-5);
  background: var(--surface-soft);
}

.receipt-roadmap-list {
  margin: 0;
  padding-left: var(--size-4);
  display: grid;
  gap: var(--size-3);
}

.receipt-roadmap-list li {
  color: var(--fg-soft);
}

.receipt-roadmap-list strong {
  color: var(--fg);
}

.receipt-empty-row {
  color: var(--fg-muted);
  margin: 0;
}


/* ── Problem · the staircase ───────────────────────────────────── */
.problem {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-9) var(--size-5);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.staircase {
  list-style: none;
  margin: var(--size-6) 0 var(--size-7);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--size-3);
}

.stair {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-4);
  background: color-mix(in oklab, var(--bg-elev) 40%, transparent);
}

.stair-tag {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--size-2);
}

.stair h3 {
  margin: 0 0 var(--size-2);
  font-size: var(--font-size-3);
}

.stair p {
  margin: 0;
  font-size: var(--font-size-1);
  color: var(--fg-soft);
}

.problem-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--size-4);
  padding: var(--size-5) 0 0;
  border-top: 1px solid var(--rule-soft);
}

.problem-summary p {
  margin: 0;
  font-size: var(--font-size-1);
  color: var(--fg-soft);
}

.problem-summary strong {
  display: block;
  color: var(--fg);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  margin-bottom: var(--size-1);
}

@media (max-width: 720px) {
  .staircase {
    grid-template-columns: 1fr;
  }
  .problem-summary {
    grid-template-columns: 1fr;
  }
}

/* ── Receipt · product surface ─────────────────────────────────── */
.receipt {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-9) var(--size-5);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.receipt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--size-5);
  align-items: start;
}

.receipt-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--size-4);
}

.receipt-reasons h3 {
  margin: 0 0 var(--size-2);
  font-size: var(--font-size-3);
}

.receipt-reasons p {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-1);
}

@media (max-width: 720px) {
  .receipt-grid {
    grid-template-columns: 1fr;
  }
}

.receipt-cta {
  max-width: var(--max-prose);
  margin: var(--size-5) auto 0;
  padding: var(--size-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--bg-elev) 40%, transparent);
  font-size: var(--font-size-1);
  color: var(--fg-soft);
}

.receipt-cta a {
  color: var(--accent);
  font-family: var(--font-code);
  font-size: 0.95em;
}

/* ── Vision · forward-looking ──────────────────────────────────── */
.vision {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-9) var(--size-5);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

.vision-body {
  max-width: var(--max-prose);
  margin: var(--size-5) auto 0;
}

.vision-body p {
  margin: 0 0 var(--size-3);
  color: var(--fg-soft);
  font-size: var(--font-size-2);
}

.vision-aside {
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  font-style: italic;
}


/* ── Dashboard ────────────────────────────────────────────────── */

.dash {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-5) var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

/* Overview two-column layout (#235 part D). Mirrors the Studio
 * tab's body grid: a wider runtime-signal column on the left and
 * a narrower "what to do next" rail on the right. Collapses to a
 * single column below 900px, matching .studio-body. Referenced by
 * dashboard.templ but previously unstyled, so Overview stacked as
 * one column. */
.dash-overview-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--size-4);
  align-items: start;
}

.dash-overview-runtime,
.dash-overview-next {
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
  min-width: 0;
}

@media (max-width: 900px) {
  .dash-overview-grid {
    grid-template-columns: 1fr;
  }
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--size-4);
}

.dash-header-text {
  flex: 1 1 320px;
  min-width: 0;
}

.dash-header h1 {
  margin: 0 0 var(--size-2) 0;
  /* Aligned to the Studio tab's type scale (#235): the prior
   * 2rem (--font-size-5) mono heading read oversized next to
   * Studio. 1.5rem with a tight line-height matches the rest of
   * the app. */
  font-size: var(--font-size-4);
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Dashboard eyebrow — small uppercase label above the page
 * heading. Previously unstyled (rendered as plain body text),
 * which is why the dashboard headers felt inconsistent with the
 * rest of the app (#235). Matches the section-head treatment. */
.dash .eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--size-2);
}

.dash-signout {
  margin: 0;
  flex: 0 0 auto;
}

.dash-onboarding {
  border-color: color-mix(in oklab, var(--accent) 30%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-elev) 60%);
}

.dash-steps {
  margin: 0;
  padding-left: var(--size-5);
  display: grid;
  gap: var(--size-2);
  font-size: var(--font-size-1);
  color: var(--fg-soft);
}

.dash-steps strong {
  color: var(--fg);
}

.dash-card {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-4);
  background: color-mix(in oklab, var(--bg-elev) 60%, transparent);
}

.dash-card h2 {
  margin-top: 0;
  /* Aligned to Studio's card type scale (#235 part D): the prior
   * --font-size-3 (1.25rem) card heading read heavier than the
   * Studio cards. --font-size-2 (1.1rem) converges them. */
  font-size: var(--font-size-2);
}

.dash-controls {
  max-width: min(1180px, calc(100vw - var(--size-8)));
}

.dash-controls-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: var(--size-5);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-elev) 62%);
}

.dash-controls-hero h2 {
  font-size: var(--font-size-5);
  line-height: 1.02;
}

.dash-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-4);
}

.dash-controls-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-3);
  margin: 0;
}

.dash-controls-facts div {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3);
  background: color-mix(in oklab, black 12%, transparent);
}

.dash-controls-facts dt {
  color: var(--fg-muted);
  font-size: var(--font-size-0);
  text-transform: uppercase;
}

.dash-controls-facts dd {
  margin: var(--size-1) 0 0;
  overflow-wrap: anywhere;
}

.dash-controls-receipt .dash-dl dd {
  overflow-wrap: anywhere;
}

.dash-controls-attempt {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3);
  margin: var(--size-3) 0;
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}

.dash-controls-attempt p {
  margin-bottom: 0;
}

.dash-controls-attempt-blocked {
  border-color: color-mix(in oklab, var(--accent) 32%, var(--rule-soft));
}

.dash-controls-proof-form {
  margin: 0;
}

.dash-controls-scenario {
  border-style: dashed;
}

.dash-controls-operator {
  margin-top: var(--size-4);
}

.dash-operator-grid dd {
  overflow-wrap: anywhere;
}

.dash-controls-steps {
  margin: var(--size-3) 0 0;
  padding-left: 1.25rem;
  color: var(--fg-soft);
}

.dash-controls-steps li + li {
  margin-top: var(--size-2);
}

@media (max-width: 820px) {
  .dash-controls {
    max-width: none;
  }

  .dash-controls-hero,
  .dash-controls-grid,
  .dash-controls-facts {
    grid-template-columns: 1fr;
  }
}

.dash-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--size-2) var(--size-4);
  margin: 0;
}

.dash-dl dt {
  color: var(--fg-muted);
  font-size: var(--font-size-1);
}

.dash-dl dd {
  margin: 0;
}

.dash-note {
  color: var(--fg-soft);
  font-size: var(--font-size-1);
}

.dash-warn {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
  background: color-mix(in oklab, orange 8%, var(--bg-elev) 60%);
  font-size: var(--font-size-1);
}

.dash-flash {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-4);
  font-size: var(--font-size-1);
}

.dash-flash-success {
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-elev) 60%);
}

.dash-flash-error {
  border-color: color-mix(in oklab, red 35%, var(--rule-soft));
  background: color-mix(in oklab, red 6%, var(--bg-elev) 60%);
}

.dash-code {
  font-family: var(--font-code);
  font-size: 0.92em;
  background: color-mix(in oklab, black 30%, var(--bg-elev) 70%);
  padding: var(--size-3);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.dash-inline-form {
  display: flex;
  gap: var(--size-3);
  margin: var(--size-3) 0;
  flex-wrap: wrap;
}

.dash-inline-form input {
  flex: 1 1 14ch;
  min-width: 0;
  padding: var(--size-2) var(--size-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.dash-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--size-3);
  margin: var(--size-3) 0;
}

.dash-template-card {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  padding: var(--size-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  margin: 0;
}

.dash-template-card h3 {
  margin: 0;
  font-size: var(--font-size-2);
}

.dash-template-card p {
  margin: 0;
  color: var(--fg-soft);
  font-size: var(--font-size-1);
}

.dash-event-form {
  margin: var(--size-3) 0;
}

.dash-event-form details summary {
  cursor: pointer;
  font-weight: 500;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-1);
  /* Fixed layout so the table respects its grid-column width
   * (1.5fr on Overview) instead of letting long cell content
   * (entity codes, reason text) push it past the column and
   * overlap the next-action rail. Cells wrap/break below. */
  table-layout: fixed;
}

.dash-table th,
.dash-table td {
  text-align: left;
  padding: var(--size-2) var(--size-3);
  border-bottom: 1px solid var(--rule-soft);
  /* Long codes/reasons wrap rather than forcing the column wider. */
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}

.dash-table th {
  color: var(--fg-muted);
  font-weight: 500;
}

.dash-table-action-form {
  margin: 0;
}

/* Proposals table (Overview, in the 1.5fr runtime column). With
 * table-layout:fixed the 6 columns would default to equal widths;
 * weight them so the date and outcome/receipt pills don't wrap to
 * 3 lines while Entity/Reasons (the variable-length text) get the
 * room. Percentages sum to 100. */
.dash-proposals-table {
  table-layout: fixed;
}

.dash-proposals-table th:nth-child(1), /* When    */
.dash-proposals-table td:nth-child(1) { width: 14%; }
.dash-proposals-table th:nth-child(2), /* Entity  */
.dash-proposals-table td:nth-child(2) { width: 22%; }
.dash-proposals-table th:nth-child(3), /* Action  */
.dash-proposals-table td:nth-child(3) { width: 20%; }
.dash-proposals-table th:nth-child(4), /* Outcome */
.dash-proposals-table td:nth-child(4) { width: 14%; }
.dash-proposals-table th:nth-child(5), /* Reasons */
.dash-proposals-table td:nth-child(5) { width: 18%; }
.dash-proposals-table th:nth-child(6), /* Receipt */
.dash-proposals-table td:nth-child(6) { width: 12%; }

/* The Entity cell stacks the id (code) over its type; keep the
 * code from forcing the column wide. */
.dash-proposals-table td:nth-child(2) code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* The When column should not wrap, but allow overflow on narrow screens */
.dash-proposals-table td:nth-child(1) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile: make proposals table horizontally scrollable */
@media (max-width: 720px) {
  .dash-proposals-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .dash-proposals-table {
    min-width: 600px;
  }
}

.dash-pill {
  display: inline-block;
  padding: 2px var(--size-2);
  border-radius: 999px;
  font-size: 0.85em;
}

.dash-pill-ok {
  background: color-mix(in oklab, var(--accent) 14%, var(--bg-elev) 70%);
  color: var(--accent);
}

.dash-pill-info {
  background: color-mix(in oklab, var(--fg-soft) 12%, var(--bg-elev) 70%);
  color: var(--fg-soft);
}

.dash-pill-warn {
  background: color-mix(in oklab, orange 12%, var(--bg-elev) 70%);
  color: var(--fg-soft);
}

.dash-pill-error {
  background: color-mix(in oklab, tomato 14%, var(--bg-elev) 70%);
  color: tomato;
}

.dash-pill-muted {
  background: color-mix(in oklab, var(--fg-soft) 8%, var(--bg-elev) 70%);
  color: var(--fg-soft);
}

/* ── connection status (#88) ────────────────────────────── */
.dash-connection {
  border-left: 3px solid var(--rule-soft);
}

.dash-connection-status {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  margin: 0;
}

.dash-connection-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg-soft);
  opacity: 0.4;
}

.dash-connection-dot-active {
  background: var(--accent);
  opacity: 1;
}

.dash-connection-active {
  border-left-color: var(--accent);
}

.btn-sm {
  padding: var(--size-1) var(--size-2);
  font-size: var(--font-size-0);
}


/* ── dashboard runner panel ─────────────────────────────── */
.dash-runner {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-elev) 60%);
}

.dash-runner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--size-4);
  margin-top: var(--size-4);
}

.dash-runner-card {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-4);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.dash-runner-card h3 {
  margin: 0;
  font-size: var(--font-size-2);
}

.dash-runner-headline {
  margin: 0;
  font-size: var(--font-size-1);
  color: var(--fg);
  font-weight: 600;
}

.dash-runner-narrative {
  margin: 0;
  font-size: var(--font-size-1);
  color: var(--fg-soft);
  line-height: 1.5;
}

.dash-runner-card .btn {
  align-self: flex-start;
}

/* ── advanced (collapsed by default) ─────────────────────── */
.dash-advanced {
  border-style: dashed;
}

.dash-advanced > summary {
  cursor: pointer;
  font-size: var(--font-size-1);
  color: var(--fg-soft);
  padding: var(--size-2) 0;
}

.dash-advanced[open] > summary {
  margin-bottom: var(--size-3);
}

.dash-advanced-body {
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

/* ── receipt: verify-yourself panel ──────────────────────── */
.receipt-verify {
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-elev) 60%);
  border-radius: var(--radius);
  padding: var(--size-5);
}

.receipt-verify h2 {
  margin-top: 0;
}

.receipt-verify a {
  color: var(--accent, #9cf);
  text-decoration: underline;
}

.receipt-verify a.hash {
  font-family: var(--font-code);
  font-size: 0.92em;
}
/* ---------- onboarding (#142) ---------- */

.onboarding-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  margin-right: var(--size-3);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 22%, var(--bg-elev) 60%);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.9em;
}

.dash-flash-warn {
  border-color: color-mix(in oklab, oklch(80% 0.15 80) 45%, var(--rule-soft));
  background: color-mix(in oklab, oklch(80% 0.15 80) 8%, var(--bg-elev) 60%);
}

.dash-snippet-tabs {
  display: grid;
  gap: var(--size-3);
  margin-top: var(--size-4);
}

.dash-snippet-tabs > details {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
  background: var(--bg);
}

.dash-snippet-tabs > details > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.dash-snippet-tabs > details[open] > summary {
  margin-bottom: var(--size-3);
}

.dash-snippet-tabs > details > summary::-webkit-details-marker {
  display: none;
}


/* ---------- onboarding YAML editor (#142, #148) ---------- */

.dash-yaml-editor {
  display: grid;
  gap: var(--size-3);
  margin-top: var(--size-4);
}

/* ---------- onboarding guided builder (#181) ---------- */

.dash-builder-form {
  display: grid;
  gap: var(--size-4);
  margin-top: var(--size-4);
}

.dash-builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--size-4);
}

.dash-builder-form .dash-label {
  display: grid;
  gap: var(--size-2);
}

.dash-builder-form .dash-label input[type="text"] {
  font-family: var(--font-code);
  font-size: 0.95em;
  padding: var(--size-2) var(--size-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}

.dash-builder-form .dash-label input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.dash-builder-form .dash-label small {
  font-weight: 400;
  color: var(--fg-soft);
}

.dash-builder-radio {
  display: grid;
  gap: var(--size-2);
  border: none;
  padding: 0;
}

.dash-builder-radio legend {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: var(--size-2);
}

.dash-builder-radio label {
  display: flex;
  gap: var(--size-2);
  align-items: center;
  font-weight: 400;
  cursor: pointer;
}

.dash-label {
  font-weight: 600;
  font-size: 0.95em;
}

.dash-yaml {
  width: 100%;
  font-family: var(--font-code);
  font-size: 0.95em;
  line-height: 1.45;
  padding: var(--size-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
  min-height: 16em;
  tab-size: 2;
  -moz-tab-size: 2;
}

.dash-yaml:focus {
  outline: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--rule-soft));
}

.dash-yaml-actions {
  display: flex;
  gap: var(--size-3);
  flex-wrap: wrap;
}

.dash-yaml-help {
  margin-top: var(--size-4);
  border: 1px dashed var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-3) var(--size-4);
  background: color-mix(in oklab, var(--bg) 96%, var(--bg-elev));
}

.dash-yaml-help > summary {
  cursor: pointer;
  font-weight: 600;
}

.dash-yaml-help-body {
  padding-top: var(--size-3);
}

.dash-example-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--size-3);
}

.dash-example-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--size-3);
  align-items: center;
  padding: var(--size-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.dash-example-row p {
  margin: 0;
}


/* ---------- pricing-lite (#154) ---------- */

.pricing {
  max-width: 72rem;
  margin: var(--size-8) auto;
  padding: 0 var(--size-5);
}

.pricing-head {
  padding-bottom: var(--size-6);
  margin-bottom: var(--size-7);
  border-bottom: 1px solid var(--rule-soft);
}

.pricing-head .eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--size-3);
}

.pricing-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 var(--size-4);
}

.pricing-lede {
  color: var(--fg-muted);
  margin: 0 0 var(--size-4);
  max-width: 56rem;
}

.pricing-section {
  margin: var(--size-7) 0;
}

.pricing-section > header {
  margin-bottom: var(--size-5);
}

.pricing-section h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.01em;
  margin: 0 0 var(--size-4);
}

.pricing-section h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-3);
  margin: 0 0 var(--size-3);
}

.pricing-section p {
  margin: 0 0 var(--size-3);
}

.pricing-section a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule-soft);
}

.pricing-section a:hover {
  text-decoration-color: var(--accent);
}

.pricing-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-2);
  background: color-mix(in oklab, var(--bg) 90%, var(--bg-elev));
}

.pricing-aside {
  color: var(--fg-muted);
  font-size: 0.95em;
  max-width: 56rem;
  margin: var(--size-4) 0 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--size-5);
}

.pricing-tier {
  display: flex;
  flex-direction: column;
  padding: var(--size-5);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.pricing-tier-builder {
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule-soft));
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-elev) 60%);
}

.pricing-tier > header {
  margin-bottom: var(--size-4);
}

.pricing-tier-eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--size-2);
}

.pricing-tier h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-5);
  letter-spacing: -0.02em;
  margin: 0;
}

.pricing-tier-unit {
  font-size: 0.55em;
  color: var(--fg-muted);
  font-weight: normal;
  letter-spacing: 0;
  margin-left: var(--size-2);
}

.pricing-tier-tag {
  margin: var(--size-2) 0 0;
  color: var(--fg-muted);
  font-size: 0.95em;
}

.pricing-tier-list {
  list-style: none;
  margin: 0 0 var(--size-4);
  padding: 0;
  display: grid;
  gap: var(--size-2);
  font-size: 0.95em;
}

.pricing-tier-list li {
  padding-left: var(--size-4);
  position: relative;
  color: var(--fg);
}

.pricing-tier-list li::before {
  content: "·";
  position: absolute;
  left: var(--size-2);
  color: var(--accent);
  font-weight: bold;
}

.pricing-tier-note {
  color: var(--fg-muted);
  font-size: 0.95em;
  margin: 0 0 var(--size-4);
}

.pricing-tier-cta {
  align-self: flex-start;
}

.pricing-tier-fineprint {
  margin: var(--size-3) 0 0;
  font-size: 0.85em;
  color: var(--fg-muted);
}

.pricing-pilot {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: var(--size-6);
  background: color-mix(in oklab, var(--bg) 96%, var(--bg-elev));
}

.pricing-pilot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--size-5);
  margin: var(--size-4) 0;
}

.pricing-pilot-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--size-3);
}

.pricing-pilot-grid li {
  padding-left: var(--size-4);
  position: relative;
}

.pricing-pilot-grid li::before {
  content: "·";
  position: absolute;
  left: var(--size-2);
  color: var(--accent);
  font-weight: bold;
}

.pricing-value-list,
.pricing-not-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--size-2);
}

.pricing-value-list li,
.pricing-not-list li {
  padding-left: var(--size-4);
  position: relative;
}

.pricing-value-list li::before,
.pricing-not-list li::before {
  content: "·";
  position: absolute;
  left: var(--size-2);
  color: var(--accent);
  font-weight: bold;
}

.pricing-faq > details {
  margin: var(--size-3) 0;
  padding: var(--size-3) var(--size-4);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--bg);
}

.pricing-faq > details > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.pricing-faq > details[open] > summary {
  margin-bottom: var(--size-3);
}

.pricing-faq > details > summary::-webkit-details-marker {
  display: none;
}

.pricing-faq > details > p {
  margin: 0;
  color: var(--fg-muted);
}


/* ---------- plan card (#143) ---------- */

.dash-card-soft {
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-elev) 60%);
  border-color: color-mix(in oklab, var(--accent) 25%, var(--rule-soft));
}

.dash-card-warn {
  background: color-mix(in oklab, oklch(80% 0.15 80) 8%, var(--bg-elev) 60%);
  border-color: color-mix(in oklab, oklch(80% 0.15 80) 45%, var(--rule-soft));
}

.dash-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--size-3);
  margin-bottom: var(--size-2);
}

.dash-plan-head h2,
.dash-plan-head .eyebrow {
  margin: 0;
}

.dash-plan-name {
  margin: 0 0 var(--size-4);
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.dash-plan-meter-wrap {
  display: grid;
  gap: var(--size-2);
  margin-top: var(--size-4);
}

.dash-plan-meter-row {
  display: flex;
  justify-content: space-between;
  gap: var(--size-3);
  color: var(--fg-soft);
  font-size: var(--font-size-0);
}

.dash-plan-meter {
  width: 100%;
  height: var(--size-3);
  accent-color: var(--accent);
}

.dash-plan-actions {
  display: flex;
  gap: var(--size-3);
  flex-wrap: wrap;
  margin-top: var(--size-3);
}

/* ---------- governed activity card (#157) ---------- */

.dash-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--size-3);
  margin: var(--size-4) 0;
  padding: 0;
}

.dash-activity-cell {
  background: var(--bg-elev);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-2);
  padding: var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-1);
}

.dash-activity-cell dt {
  font-size: var(--font-size-0);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-1);
  margin: 0;
}

.dash-activity-cell dd {
  font-size: var(--font-size-5);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--text-0);
}

.dash-activity-allowed {
  border-color: color-mix(in oklab, oklch(75% 0.15 145) 35%, var(--rule-soft));
}

.dash-activity-approval {
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule-soft));
}

.dash-activity-blocked {
  border-color: color-mix(in oklab, oklch(70% 0.18 25) 35%, var(--rule-soft));
}

/* ---------- dashboard shell (#183, single bar #235) ---------- */

/* One bar: section tabs on the left, KIFF wordmark (link to the
 * public site) on the right. Replaces the prior three stacked
 * bars (marketing topbar + workspace/sign-out bar + tab nav). */
.dash-shell-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: var(--size-4);
  padding: 0 var(--size-5);
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg-elev);
}

.dash-shell-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--font-size-1);
  white-space: nowrap;
}

.dash-shell-wordmark:hover {
  color: var(--text-0);
}

.dash-shell-tabs {
  display: flex;
  gap: var(--size-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.dash-shell-tabs::-webkit-scrollbar {
  display: none;
}

.dash-shell-tab {
  display: inline-flex;
  align-items: center;
  padding: var(--size-3) var(--size-3);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: var(--font-size-1);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}

.dash-shell-tab:hover {
  color: var(--text-0);
  border-bottom-color: var(--rule);
}

.dash-shell-tab-active {
  color: var(--text-0);
  border-bottom-color: var(--accent);
}

.dash-shell-body {
  padding: var(--size-5) var(--size-5) var(--size-7);
  max-width: 80rem;
  margin: 0 auto;
  /* Align the dashboard tabs to Studio's tighter type scale. The
   * body default is --font-size-2 (1.1rem), which read crowded in
   * the dash cards next to Studio (whose elements set their own
   * 1rem/0.75rem sizes). Pin the shell body to --font-size-1 (1rem)
   * so Overview / Activity / Keys / Settings / Playground match
   * Studio. Studio sets explicit sizes on its own elements, so it
   * is unaffected. */
  font-size: var(--font-size-1);
}

@media (max-width: 720px) {
  .dash-shell-bar {
    padding: 0 var(--size-3);
  }
  .dash-shell-body {
    padding: var(--size-4) var(--size-3) var(--size-6);
  }
}


/* ── Landing v14 (illustrated airport) — issue #228 ───────────────
 *
 * Five sections (.lp-hero → .lp-why → .lp-mechanics → .lp-roles →
 * .lp-checkpoint) ported from .local/landing-rewrite-v14.html with
 * layout fixes:
 *   - hero callouts evenly distributed, no overlaps, none touching
 *     the card edge; mobile collapses to a stacked .lp-callout-strip
 *   - tower visually anchored to the bottom of its container with a
 *     subtle ground glow; CSS-only sticky on desktop, static on mobile
 *   - mechanics: six .step-NN cards along the runway diagonal from
 *     bottom-left to top-right, percent-anchored
 *   - roles: six role cards positioned by visual metaphor over the
 *     apron scene; not a bottom strip on desktop
 *   - checkpoint: checklist sits beside the visual on desktop, stacks
 *     under it on mobile
 *
 * All landing classes are prefixed `.lp-` (or use the contract names
 * called out in the ticket: .mechanics-step, .step-NN, .role-card,
 * .role-pilot, .tower-visual-wrap, etc.) so the new styles don't
 * stomp on dashboard, receipt, or legal pages that share Layout. */

.lp-section {
  position: relative;
  padding: clamp(56px, 7vw, 80px) 0;
  border-bottom: 1px solid var(--rule);
}

.lp-section:last-of-type {
  border-bottom: none;
}

.lp-col {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--size-5);
}

/* eyebrow with the lime dot */
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border-radius: 99px;
  padding: 4px 12px;
  margin-bottom: var(--size-4);
}

.lp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* Landing typography — emphasized italics replaced with lime text. */
.lp-section h1,
.lp-section h2 {
  font-family: var(--font-body);
  color: var(--fg);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.lp-section h1 em,
.lp-section h2 em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.lp-section h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  margin: 0 0 22px;
  max-width: 540px;
}

.lp-section h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.12;
  margin: 0 0 16px;
  max-width: 560px;
}

.lp-section h3 {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.4;
  margin: 0 0 6px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
}

.lp-section p {
  color: var(--fg-soft);
  margin: 0 0 14px;
  max-width: 480px;
}

.lp-section p:last-child {
  margin-bottom: 0;
}

.lp-section p code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--fg);
  background: var(--rule-soft);
  padding: 1px 5px;
  border-radius: 2px;
}

/* The illustrated stage common to all five sections. */
.lp-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0b0d;
  box-shadow:
    inset 0 0 80px 30px rgba(10, 11, 13, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.lp-stage picture,
.lp-stage img.lp-stage-bg {
  display: block;
  width: 100%;
  height: auto;
}

.lp-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 75% at 50% 50%, transparent 38%, rgba(10, 11, 13, 0.55) 70%, rgba(10, 11, 13, 1) 100%),
    linear-gradient(180deg, rgba(10, 11, 13, 0) 55%, rgba(10, 11, 13, 0.8) 100%),
    linear-gradient(0deg, rgba(10, 11, 13, 0) 80%, rgba(10, 11, 13, 0.4) 100%);
}

.lp-stage-meta {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

.lp-stage-meta::before {
  content: "kiff://";
  color: var(--accent);
  margin-right: 8px;
}

/* Floating callout label — shared base for hero callouts, mechanics
 * steps, and role cards. */
.lp-callout,
.mechanics-step,
.role-card {
  position: absolute;
  z-index: 4;
  width: 150px;
  font-family: var(--font-mono);
  background: rgba(13, 15, 19, 0.82);
  border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
  border-radius: 6px;
  padding: 8px 11px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  list-style: none;
}

.lp-callout::before,
.mechanics-step::before,
.role-card::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  top: -4px;
  left: 14px;
}

.lp-callout-tag,
.lp-num b {
  color: var(--accent);
  font-weight: 500;
}

.lp-callout-tag {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.lp-callout-txt {
  display: block;
  font-size: 10px;
  color: var(--fg);
  line-height: 1.4;
}

/* Mobile-only fallback strip, shown when the floating chips collapse. */
.lp-callout-strip {
  display: none;
  list-style: none;
  margin: var(--size-4) 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.lp-callout-strip li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-soft);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 99px;
  padding: 5px 11px;
}

.lp-chip-tag {
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
}

/* Buttons — landing-only, distinct from .btn used in the dashboard. */
.lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-soft);
  background: var(--bg-elev);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease;
}

.lp-btn:hover {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule));
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-elev));
  text-decoration: none;
}

.lp-btn-primary {
  color: #0a0b0d;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.lp-btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: #0a0b0d;
}

.lp-arrow {
  opacity: 0.7;
}

/* ── §01 hero ──────────────────────────────────────────────────── */

.lp-hero {
  padding-top: clamp(40px, 5vw, 56px);
}

.lp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: center;
}

.lp-hero p.lp-lede {
  font-size: 17px;
  color: var(--fg-soft);
  max-width: 460px;
  line-height: 1.55;
}

.lp-hero p.lp-lede em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

.lp-actions {
  margin: 24px 0 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  max-width: 520px;
}

.lp-trust-item {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-soft);
  line-height: 1.45;
}

.lp-trust-item::before {
  content: "";
  display: block;
  width: 14px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 7px;
}

/* Hero callouts — evenly distributed across the four corners of the
 * airfield image, generous margins from the card edge so nothing
 * touches the rounded border. The four positions form a balanced
 * diamond around the central tower. taxi-route and takeoff are
 * swapped from the original grid so "taxi route" sits low-right by
 * the parked aircraft and "takeoff" sits top-right. */
.lp-callout-clearance { top: calc(12% + 50px); left: 8%; }
.lp-callout-taxi      { top: 70%; left: 64%; }
.lp-callout-gate      { top: 70%; left: calc(8% + 80px); }
.lp-callout-takeoff   { top: calc(12% + 50px); left: 64%; }

/* ── §02 why · tower ───────────────────────────────────────────── */

.lp-why-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 56px);
  align-items: stretch;
}

.lp-why-aside {
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.lp-pull {
  margin: var(--size-3) 0 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  letter-spacing: -0.005em;
  max-width: 460px;
}

.lp-pull::before {
  content: "› ";
  color: var(--accent);
}

.lp-pull em {
  font-style: normal;
  color: var(--accent);
}

/* tower-visual-wrap — sticky on desktop so the tower stays FIXED
 * in view while the capability cards in the right column scroll
 * past it (parallax). Static on mobile. The image uses object-fit:
 * contain + object-position: bottom center so the silhouette stays
 * grounded. Once the cards have scrolled through, the next section
 * (.lp-mechanics, opaque + raised z-index) rises up and covers the
 * fixed tower so it never reads as a disconnected floating object. */
.tower-visual-wrap {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 460px;
  padding-bottom: 40px;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 20% at 50% 96%, rgba(182, 232, 59, 0.18), transparent 70%);
}

.tower-visual-wrap::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 36px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklab, var(--accent) 40%, transparent) 50%,
    transparent 100%);
  z-index: 1;
}

.tower-visual-wrap .tower-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  background: linear-gradient(
    180deg,
    rgba(10, 11, 13, 0) 0%,
    rgba(10, 11, 13, 0.45) 60%,
    rgba(10, 11, 13, 0.9) 100%);
  z-index: 1;
  pointer-events: none;
}

.tower-visual-wrap picture,
.tower-img {
  display: block;
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 460px;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  object-position: bottom center;
  filter:
    drop-shadow(0 0 32px rgba(182, 232, 59, 0.22))
    drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.lp-cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: var(--size-4);
}

.lp-cap {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.lp-cap:hover {
  border-color: color-mix(in oklab, var(--accent) 30%, var(--rule));
  background: color-mix(in oklab, var(--accent) 3%, var(--bg-elev));
}

.lp-cap-icon {
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: color-mix(in oklab, var(--accent) 5%, transparent);
}

.lp-cap-icon svg {
  width: 12px;
  height: 12px;
}

.lp-cap p {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── §03 mechanics ─────────────────────────────────────────────── */

.lp-mech-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 32px;
  align-items: end;
  margin-bottom: var(--size-5);
}

.lp-mech-head p {
  text-align: right;
  max-width: 360px;
  margin-left: auto;
}

.lp-runway-stage img.lp-stage-bg {
  min-height: 480px;
  object-fit: cover;
}

/* mechanics-steps overlay — six cards along the runway diagonal.
 * Approximate positions per #228, tuned slightly so cards do not
 * cover the strongest part of the glowing runway line. */
.mechanics-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mechanics-step {
  width: 152px;
}

.mechanics-step .lp-num {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.mechanics-step .lp-num b {
  margin-right: 4px;
}

.mechanics-step .lp-step-name {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg);
  font-weight: 500;
  margin: 0 0 3px;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.mechanics-step .lp-step-desc {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}

/* Diagonal positions — bottom-left to top-right. Steps 01, 02, and
 * 04 nudged up 50px so they clear the runway glow / aircraft. */
.step-01 { left: 8%;  top: calc(70% - 50px); }
.step-02 { left: 26%; top: calc(54% - 50px); }
.step-03 { left: 42%; top: 64%; }
.step-04 { left: 50%; top: calc(40% - 50px); }
.step-05 { left: 64%; top: 52%; }
.step-06 { left: 78%; top: 38%; }

/* ── §04 roles ─────────────────────────────────────────────────── */

.lp-roles-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
  margin-bottom: var(--size-5);
}

.lp-fleet-stage img.lp-stage-bg {
  min-height: 520px;
  object-fit: cover;
}

.roles-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.role-card {
  width: 152px;
  padding: 10px 11px;
}

.role-card .lp-ricon {
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: color-mix(in oklab, var(--accent) 5%, transparent);
}

.role-card .lp-ricon svg {
  width: 12px;
  height: 12px;
}

.role-card .lp-rname {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin-bottom: 2px;
}

.role-card .lp-rmap {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.role-card .lp-rverb {
  font-size: 10px;
  color: var(--fg-muted);
  line-height: 1.45;
}

/* Role positions per the A-F × 1-7 grid mapping in #228. The image
 * is 1535×1024; positions place each card near its visual metaphor
 * (pilot near aircraft nose, audit near gantry, etc.). */
.role-pilot    { left: 48%; top: calc(56% - 50px); }
.role-adapter  { left: calc(30% - 100px); top: calc(40% - 30px); }
.role-runtime  { left: 30%; top: 12%; }
.role-policy   { left: 74%; top: 22%; }
.role-audit    { left: 62%; top: 70%; }
.role-approver { left: 14%; top: 56%; }

/* ── §05 checkpoint ────────────────────────────────────────────── */

.lp-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 44px);
  align-items: center;
}

.lp-check-aside {
  display: flex;
  flex-direction: column;
}

.lp-check-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--size-4);
  padding-top: var(--size-4);
  border-top: 1px solid var(--rule);
}

.lp-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  border-radius: 99px;
  padding: 5px 11px;
}

.lp-stat-icn {
  width: 16px;
  height: 16px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.lp-stat-icn svg {
  width: 9px;
  height: 9px;
}

.lp-stat-cleared {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule));
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-elev));
}

.lp-stat-cleared .lp-stat-icn {
  border-color: color-mix(in oklab, var(--accent) 35%, var(--rule));
}

.lp-stat-pending {
  color: #e2c15b;
  border-color: rgba(226, 193, 91, 0.45);
  background: rgba(226, 193, 91, 0.06);
}

.lp-stat-pending .lp-stat-icn {
  border-color: rgba(226, 193, 91, 0.45);
}

.lp-stat-rejected {
  color: #d66b6b;
  border-color: rgba(214, 107, 107, 0.45);
  background: rgba(214, 107, 107, 0.06);
}

.lp-stat-rejected .lp-stat-icn {
  border-color: rgba(214, 107, 107, 0.45);
}

.lp-check-banner {
  position: absolute;
  z-index: 4;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(10, 11, 13, 0.78);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 8px;
  padding: 9px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.lp-stamp {
  color: #0a0b0d;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 600;
}

.lp-check-steps {
  list-style: none;
  margin: var(--size-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-check-step {
  border-top: 1px solid var(--rule);
  padding: 10px 0 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.lp-check-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.16em;
  width: 20px;
  flex: 0 0 20px;
}

.lp-check-title {
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
}

.lp-check-desc {
  color: var(--fg-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ── Landing responsive ────────────────────────────────────────── */

/* Tablet: tighten card widths to keep content from clashing with
 * the airplane silhouettes. */
@media (max-width: 1100px) {
  .lp-section h1 { font-size: 44px; }
  .mechanics-step,
  .role-card,
  .lp-callout {
    width: 140px;
    padding: 8px 10px;
  }
  .mechanics-step .lp-step-name,
  .role-card .lp-rname { font-size: 11.5px; }
  .mechanics-step .lp-step-desc,
  .role-card .lp-rverb { font-size: 9px; }
}

/* Mobile breakpoint — collapse two-column grids, drop sticky tower,
 * convert hero callouts to stacked chips. The mechanics and roles
 * cards stay positioned but become compact, hiding the descriptive
 * paragraph; the .lp-callout-strip-six fallback shows the same six
 * concepts as a stacked list under each image so nothing is lost. */
@media (max-width: 880px) {
  .lp-hero-grid,
  .lp-why-grid,
  .lp-mech-head,
  .lp-roles-head,
  .lp-check-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .lp-mech-head p,
  .lp-roles-head p {
    text-align: left;
    margin-left: 0;
    max-width: 100%;
  }

  .lp-section h1 { font-size: 36px; max-width: none; }
  .lp-section h2 { font-size: 26px; max-width: none; }

  .tower-visual-wrap {
    position: static;
    align-self: auto;
    min-height: 0;
    padding-bottom: 0;
    max-width: 420px;
    margin: 0 auto;
  }

  .tower-img {
    max-height: none;
    width: 100%;
  }

  .lp-trust { grid-template-columns: repeat(4, 1fr); }
  .lp-cap-grid { grid-template-columns: 1fr 1fr; }

  /* Compact floating cards on tablet/mobile. */
  .lp-callout {
    padding: 5px 8px;
    width: 130px;
  }
  .lp-callout-tag { font-size: 8px; }
  .lp-callout-txt { font-size: 9.5px; }

  .mechanics-step,
  .role-card {
    width: 116px;
    padding: 7px 9px;
  }
  .mechanics-step .lp-step-desc,
  .role-card .lp-rverb { display: none; }
  .mechanics-step .lp-step-name,
  .role-card .lp-rname { font-size: 10.5px; line-height: 1.25; }
  .role-card .lp-rmap { font-size: 8.5px; margin-bottom: 0; }
  .role-card .lp-ricon { width: 20px; height: 20px; margin-bottom: 6px; }
  .mechanics-step .lp-num { font-size: 8.5px; margin-bottom: 4px; }

  .lp-runway-stage img.lp-stage-bg { min-height: 540px; }
  .lp-fleet-stage img.lp-stage-bg { min-height: 580px; }

  .lp-check-banner {
    position: static;
    transform: none;
    margin: 16px 0 0;
    width: 100%;
    justify-content: space-between;
    white-space: normal;
  }
}

/* Small phones: hide the floating cards entirely; show the stacked
 * chip strip instead. Cleaner reading at narrow widths than tiny
 * absolute-positioned cards on top of the image. */
@media (max-width: 640px) {
  .lp-section { padding: 48px 0; }
  .lp-col { padding: 0 var(--size-4); }
  .lp-section h1 { font-size: 30px; }
  .lp-section h2 { font-size: 22px; }
  .lp-hero { padding-top: 28px; }
  .lp-hero p.lp-lede { font-size: 16px; }

  .lp-callout,
  .mechanics-steps,
  .roles-overlay {
    display: none;
  }

  /* Strip is desktop-hidden by default; show it here. */
  .lp-callout-strip {
    display: flex;
    flex-direction: column;
  }

  .lp-actions .lp-btn {
    width: 100%;
    justify-content: center;
  }

  .lp-trust {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .lp-trust-item {
    font-size: 9px;
    line-height: 1.4;
  }

  .lp-cap-grid {
    grid-template-columns: 1fr;
  }

  .lp-runway-stage img.lp-stage-bg,
  .lp-fleet-stage img.lp-stage-bg {
    min-height: 320px;
  }
}

/* The strip is hidden by default everywhere and only shown on small
 * phones via the breakpoint above. */
@media (min-width: 641px) {
  .lp-callout-strip { display: none; }
}

/* ── §06 studio — typed four-stage authoring canvas (#228) ────────
 *
 * Mirrors the Studio visual-parity rebuild on #229/#231 (target:
 * .local/kiff-studio-evolution.html). A browser-style frame whose
 * four stage chips are CSS-only tabs: hidden radio inputs drive
 * which builder + YAML pair is visible via :checked. No JS, per
 * RFC 006. All classes prefixed `.lp-` so they never collide with
 * the dashboard's own `.studio-*` surface. */

.lp-studio-head {
  margin-bottom: var(--size-5);
  max-width: 620px;
}

.lp-studio-head h2 {
  margin-bottom: 14px;
}

.lp-studio-frame {
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: #07080b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 30px 60px rgba(0, 0, 0, 0.45);
}

/* The four stage radios live just inside the frame; visually
 * removed but kept focusable for keyboard tab-through. */
.lp-stage-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lp-studio-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #0d0e12;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.lp-studio-dots {
  display: flex;
  gap: 6px;
}

.lp-studio-dots i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg-muted);
  opacity: 0.5;
}

.lp-studio-url {
  flex: 1;
  text-align: center;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 4px 10px;
  color: var(--fg-soft);
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lp-studio-url .lp-scheme { color: var(--fg-muted); }
.lp-studio-url .lp-host { color: var(--fg); }

.lp-studio-save {
  width: 60px;
  text-align: right;
}

/* Stage bar — four clickable <label> chips + the domain name. */
.lp-studio-stagebar {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--rule);
  background: #0a0b0e;
  font-family: var(--font-mono);
}

.lp-studio-stage {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-right: 1px solid var(--rule);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 100ms ease, background-color 100ms ease;
}

.lp-studio-stage:hover { color: var(--fg); background: color-mix(in oklab, var(--fg) 4%, transparent); }

.lp-studio-stage-num {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--fg-muted);
}

.lp-studio-stage-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.lp-studio-stage-text b {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: inherit;
}

.lp-studio-stage-text i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.lp-studio-domain {
  margin-left: auto;
  align-self: center;
  padding: 0 16px;
  font-size: 11px;
  color: var(--fg-muted);
}

.lp-studio-domain b { color: var(--fg); font-weight: 500; }

/* :checked → highlight the active chip. One rule per stage. */
#lp-stage-1:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(1),
#lp-stage-2:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(2),
#lp-stage-3:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(3),
#lp-stage-4:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(4) {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

#lp-stage-1:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(1) .lp-studio-stage-num,
#lp-stage-2:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(2) .lp-studio-stage-num,
#lp-stage-3:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(3) .lp-studio-stage-num,
#lp-stage-4:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(4) .lp-studio-stage-num {
  border-color: var(--accent);
  color: var(--accent);
}

#lp-stage-1:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(1) .lp-studio-stage-text i,
#lp-stage-2:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(2) .lp-studio-stage-text i,
#lp-stage-3:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(3) .lp-studio-stage-text i,
#lp-stage-4:checked ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(4) .lp-studio-stage-text i {
  color: color-mix(in oklab, var(--accent) 70%, var(--fg-muted));
}

/* Keyboard focus ring on the active label for a11y. */
.lp-stage-radio:focus-visible ~ .lp-studio-stagebar .lp-studio-stage {
  outline: none;
}
#lp-stage-1:focus-visible ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(1),
#lp-stage-2:focus-visible ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(2),
#lp-stage-3:focus-visible ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(3),
#lp-stage-4:focus-visible ~ .lp-studio-stagebar .lp-studio-stage:nth-of-type(4) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.lp-studio-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  min-height: 360px;
}

.lp-pane {
  border-right: 1px solid var(--rule);
}

.lp-pane:last-child { border-right: none; }

.lp-pane-yaml { background: #060709; }

.lp-pane-head {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #0a0b0e;
}

.lp-live {
  float: right;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.lp-live::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
  animation: lp-blink 2s infinite;
}

@keyframes lp-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Stage panels — hidden by default, shown when their stage radio
 * is :checked. Both builder columns and YAML columns follow the
 * same show/hide rule. */
.lp-blocks,
.lp-yaml-body {
  display: none;
}

#lp-stage-1:checked ~ .lp-studio-body .lp-blocks-1,
#lp-stage-2:checked ~ .lp-studio-body .lp-blocks-2,
#lp-stage-3:checked ~ .lp-studio-body .lp-blocks-3,
#lp-stage-4:checked ~ .lp-studio-body .lp-blocks-4 {
  display: flex;
}

#lp-stage-1:checked ~ .lp-studio-body .lp-yaml-1,
#lp-stage-2:checked ~ .lp-studio-body .lp-yaml-2,
#lp-stage-3:checked ~ .lp-studio-body .lp-yaml-3,
#lp-stage-4:checked ~ .lp-studio-body .lp-yaml-4 {
  display: block;
}

.lp-blocks {
  padding: 12px;
  flex-direction: column;
  gap: 7px;
}

.lp-prim-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  padding: 6px 2px 1px;
}

.lp-block {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 9px 11px;
  background: #0c0d11;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-block-glyph {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
}

.lp-block-glyph.glyph-entity  { color: #7fb2ff; background: rgba(127, 178, 255, 0.12); }
.lp-block-glyph.glyph-state   { color: #6fe0a0; background: rgba(111, 224, 160, 0.12); }
.lp-block-glyph.glyph-action  { color: #e2c15b; background: rgba(226, 193, 91, 0.14); }
.lp-block-glyph.glyph-policy  { color: #c89bff; background: rgba(200, 155, 255, 0.12); }
.lp-block-glyph.glyph-audit   { color: #9b8cff; background: rgba(155, 140, 255, 0.12); }
.lp-block-glyph.glyph-adapter { color: #5fc8ef; background: rgba(95, 200, 239, 0.12); }

.lp-block-name {
  color: var(--fg);
  font-weight: 500;
  flex: 1;
  font-size: 12px;
}

.lp-block-name code {
  font-family: var(--font-mono);
  color: var(--fg);
  background: transparent;
  padding: 0;
  font-size: 11.5px;
}

.lp-block-tag,
.lp-block-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--rule);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.lp-block-tag.tag-entity  { color: #7fb2ff; border-color: rgba(127, 178, 255, 0.4); }
.lp-block-tag.tag-state   { color: #6fe0a0; border-color: rgba(111, 224, 160, 0.4); }
.lp-block-tag.tag-action  { color: #e2c15b; border-color: rgba(226, 193, 91, 0.4); }
.lp-block-tag.tag-audit   { color: #9b8cff; border-color: rgba(155, 140, 255, 0.4); }
.lp-block-tag.tag-adapter { color: #5fc8ef; border-color: rgba(95, 200, 239, 0.4); }

.lp-risk {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.lp-risk.risk-high { color: #d66b6b; background: rgba(214, 107, 107, 0.12); }
.lp-risk.risk-med  { color: #e2c15b; background: rgba(226, 193, 91, 0.12); }
.lp-risk.risk-low  { color: #6fe0a0; background: rgba(111, 224, 160, 0.12); }

.lp-block.highlight {
  border-color: color-mix(in oklab, var(--accent) 32%, transparent);
  background: color-mix(in oklab, var(--accent) 4%, #0c0d11);
}

.lp-blocks-add {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  border: 1px dashed var(--rule);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
  margin-top: 2px;
}

.lp-blocks-add::before { content: ""; }

.lp-yaml-body {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--fg-soft);
  white-space: pre;
  overflow-x: auto;
}

.lp-yaml-body .lp-yk { color: #7fb2ff; }
.lp-yaml-body .lp-yv { color: #9fd17a; }
.lp-yaml-body .lp-ya { color: var(--accent); }
.lp-yaml-body .lp-yc { color: var(--fg-muted); font-style: italic; }

/* ── §07 gates — departures wayfinding (#228 follow-up) ───────────

 *
 * Ported from v9 §06 "four doors", reframed as airport gates. A
 * hairline-ruled menu of four links into KIFF. */

.lp-gate-menu {
  margin-top: var(--size-5);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
}

.lp-gate {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--fg);
  text-decoration: none;
  transition: background-color 90ms ease, color 90ms ease;
}

.lp-gate:last-child { border-bottom: none; }

.lp-gate:hover {
  background: var(--bg-elev);
  color: var(--accent);
}

.lp-gate:hover .lp-gate-arrow { color: var(--accent); }
.lp-gate:hover .lp-gate-desc { color: var(--fg); }

.lp-gate-tag {
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 14px;
}

.lp-gate-desc {
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 14.5px;
}

.lp-gate-arrow {
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

/* Studio + gates responsive — collapse the two-pane frame to a
 * single column on tablet/mobile, wrap the stage chips, stack the
 * gate rows. */
@media (max-width: 880px) {
  .lp-studio-body {
    grid-template-columns: 1fr;
  }

  .lp-pane {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .lp-pane:last-child { border-bottom: none; }

  .lp-studio-save { display: none; }

  /* Let the stage chips wrap; the domain label drops to its own
   * row so the four stages stay legible. */
  .lp-studio-stagebar {
    flex-wrap: wrap;
  }

  .lp-studio-stage {
    flex: 1 1 auto;
  }

  .lp-studio-domain {
    width: 100%;
    margin-left: 0;
    padding: 8px 16px;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 640px) {
  .lp-studio-stage {
    flex: 1 1 50%;
    border-bottom: 1px solid var(--rule);
  }

  .lp-studio-stage-text i { display: none; }

  .lp-gate {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }

  .lp-gate-tag { grid-column: 1 / -1; }
}

/* ── Studio (#229) ──────────────────────────────────────────────
 *
 * Progressive domain-authoring surface at /dashboard/studio.
 * Mirrors the kiff-studio-evolution mockup: a slim stage strip, a
 * single framed "app window" with a titlebar, a two-column body
 * (block builder + live YAML) inside, and a footer row of
 * primitive explainer cards.
 *
 * All selectors live under .studio / .studio-* so this block does
 * not interact with any other dashboard page.
 */

.studio {
  --st-rule: var(--rule-soft);
  --st-rule-strong: var(--rule);
  --st-card: color-mix(in oklab, var(--bg-elev) 55%, transparent);
  --st-window: color-mix(in oklab, var(--bg-elev) 35%, transparent);
  --st-accent: var(--accent);
  --st-gap: var(--size-3);
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--size-4) var(--size-4) var(--size-7);
  display: flex;
  flex-direction: column;
  gap: var(--size-4);
}

.studio-banner {
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  padding: var(--size-2) var(--size-3);
  background: color-mix(in oklab, orange 7%, var(--bg-elev) 55%);
  font-size: var(--font-size-0);
  color: var(--fg-soft);
}

/* Success/info banner — a draft import that landed, etc. Green
 * rather than the amber "heads up" error tone. */
.studio-banner-ok {
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-elev) 55%);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--st-rule));
  color: var(--fg);
}

.studio-banner-ok strong {
  color: var(--accent);
}

.studio-observed {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: var(--size-4);
  align-items: start;
  border: 1px solid color-mix(in oklab, var(--st-accent) 32%, var(--st-rule));
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--st-accent) 5%, var(--st-window));
  padding: var(--size-4);
}

.studio-observed-kicker {
  margin: 0 0 var(--size-1);
  font-family: var(--font-code);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-accent);
}

.studio-observed-copy h2 {
  margin: 0 0 var(--size-2);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.05;
}

.studio-observed-copy p {
  margin: 0;
  max-width: 68ch;
  color: var(--fg-soft);
}

.studio-observed-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--size-2) var(--size-3);
  margin: 0;
}

.studio-observed-facts div {
  min-width: 0;
}

.studio-observed-facts dt {
  margin-bottom: 2px;
  font-family: var(--font-code);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.studio-observed-facts dd {
  margin: 0;
  color: var(--fg);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .studio-observed {
    grid-template-columns: 1fr;
  }
}

/* ── Slim stage strip ───────────────────────────────────────── */

.studio-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--size-4);
  border-bottom: 1px solid var(--st-rule);
  padding-bottom: var(--size-3);
}

.studio-strip-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: var(--size-2);
  border-top: 2px solid transparent;
  min-width: 0;
}

.studio-strip-label {
  font-family: var(--font-code);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0.7;
}

.studio-strip-name {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  font-weight: 600;
  color: var(--fg-muted);
}

.studio-strip-hint {
  font-size: 0.7rem;
  color: var(--fg-muted);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-strip-item.studio-stage-reached .studio-strip-name {
  color: var(--fg-soft);
}

.studio-strip-item.studio-stage-active {
  border-top-color: var(--st-accent);
}

.studio-strip-item.studio-stage-active .studio-strip-label,
.studio-strip-item.studio-stage-active .studio-strip-name {
  color: var(--st-accent);
}

.studio-strip-item.studio-stage-active .studio-strip-hint {
  color: var(--fg-soft);
  opacity: 1;
}

/* clickable strip tabs (preview mode) */
.studio-strip-tab {
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.studio-strip-tab:hover {
  border-top-color: color-mix(in oklab, var(--st-accent) 50%, var(--st-rule));
}

.studio-strip-tab:hover .studio-strip-name {
  color: var(--fg);
}

/* ── Framed window ──────────────────────────────────────────── */

.studio-window {
  border: 1px solid var(--st-rule-strong);
  border-radius: var(--radius);
  background: var(--st-window);
  overflow: hidden;
}

.studio-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-3);
  flex-wrap: wrap;
  padding: var(--size-2) var(--size-3);
  border-bottom: 1px solid var(--st-rule);
  background: color-mix(in oklab, var(--bg-elev) 50%, transparent);
}

.studio-titlebar-id {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  min-width: 0;
}

.studio-titlebar-app {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--font-size-1);
  color: var(--fg);
}

.studio-titlebar-sep {
  color: var(--fg-muted);
  opacity: 0.6;
}

.studio-titlebar-domain {
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  color: var(--fg-soft);
  background: color-mix(in oklab, var(--bg-code) 55%, transparent);
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  padding: 2px var(--size-2);
}

.studio-titlebar-actions {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  flex-wrap: wrap;
}

.studio-tab {
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  text-decoration: none;
  padding: var(--size-1) var(--size-2);
  border-radius: var(--radius);
  border: 1px solid var(--st-rule);
  color: var(--fg-soft);
  background: var(--bg);
}

.studio-tab-yaml {
  color: var(--bg);
  background: var(--st-accent);
  border-color: var(--st-accent);
  font-weight: 600;
}

.studio-tab-yaml:hover {
  color: var(--bg);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.studio-tab-ghost:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

.studio-save {
  display: inline-flex;
  align-items: center;
  gap: var(--size-1);
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  color: var(--fg-muted);
  padding-right: var(--size-1);
}

.studio-save-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--fg-muted);
}

.studio-save-saved .studio-save-dot {
  background: var(--st-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--st-accent) 25%, transparent);
}

.studio-save-form {
  margin: 0;
}

.studio-preview-badge {
  font-family: var(--font-code);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: oklch(82% 0.10 70);
  border: 1px solid color-mix(in oklab, oklch(80% 0.12 70) 40%, var(--st-rule));
  background: color-mix(in oklab, oklch(80% 0.12 70) 9%, var(--bg));
  border-radius: 999px;
  padding: 2px var(--size-2);
}

/* ── Two-column body ────────────────────────────────────────── */

.studio-body {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 0;
}

.studio-builder {
  padding: var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  border-right: 1px solid var(--st-rule);
  min-width: 0;
}

.studio-yaml {
  background: var(--bg-code);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .studio-body {
    grid-template-columns: 1fr;
  }
  .studio-builder {
    border-right: 0;
    border-bottom: 1px solid var(--st-rule);
  }
}

/* section labels */

.studio-section {
  font-family: var(--font-code);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0.7;
  margin: var(--size-2) 0 0 0;
}

.studio-section:first-child {
  margin-top: 0;
}

/* ── Typed primitive cards ──────────────────────────────────── */

.studio-card {
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  background: var(--st-card);
  overflow: hidden;
}

.studio-card-head {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  padding: var(--size-2) var(--size-3);
  cursor: pointer;
  list-style: none;
}

.studio-card-head::-webkit-details-marker {
  display: none;
}

.studio-card-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--st-rule-strong);
  background: var(--bg);
  color: var(--fg-soft);
  font-size: 13px;
  flex: 0 0 auto;
}

.studio-card-name {
  font-family: var(--font-code);
  font-size: var(--font-size-1);
  font-weight: 600;
  color: var(--fg);
  margin-right: auto;
  word-break: break-word;
}

.studio-card-chev {
  color: var(--fg-muted);
  transition: transform 120ms ease;
}

.studio-card[open] .studio-card-chev {
  transform: rotate(90deg);
}

.studio-tag {
  font-family: var(--font-code);
  font-size: 0.66rem;
  padding: 2px var(--size-2);
  border-radius: 999px;
  border: 1px solid var(--st-rule);
  color: var(--fg-muted);
  background: color-mix(in oklab, var(--fg-soft) 8%, var(--bg));
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-entity  { color: oklch(80% 0.10 240); border-color: color-mix(in oklab, oklch(80% 0.10 240) 35%, var(--st-rule)); }
.tag-state   { color: oklch(82% 0.09 175); border-color: color-mix(in oklab, oklch(80% 0.10 175) 35%, var(--st-rule)); }
.tag-action  { color: oklch(85% 0.10 80);  border-color: color-mix(in oklab, oklch(80% 0.12 80) 35%, var(--st-rule)); }
.tag-role    { color: oklch(80% 0.10 305); border-color: color-mix(in oklab, oklch(80% 0.10 305) 35%, var(--st-rule)); }
.tag-audit   { color: oklch(80% 0.10 305); border-color: color-mix(in oklab, oklch(80% 0.10 305) 35%, var(--st-rule)); }
.tag-adapter { color: oklch(82% 0.09 175); border-color: color-mix(in oklab, oklch(80% 0.10 175) 35%, var(--st-rule)); }

.studio-card-body {
  padding: var(--size-3);
  border-top: 1px solid var(--st-rule);
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.studio-card-note {
  font-family: var(--font-code);
  font-size: 0.72rem;
  color: var(--fg-soft);
  margin: 0;
}

.studio-card-actions {
  display: flex;
  gap: var(--size-2);
}

/* ── Form fields ────────────────────────────────────────────── */

.studio-fields {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  margin: 0;
}

.studio-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--size-2);
}

.studio-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-field > span {
  font-family: var(--font-code);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

.studio-field input,
.studio-field select,
.studio-transition-form select {
  padding: var(--size-1) var(--size-2);
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  min-width: 0;
}

.studio-field input:focus,
.studio-field select:focus {
  outline: none;
  border-color: var(--st-accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--st-accent) 25%, transparent);
}

.studio-field-error {
  color: tomato;
  font-size: 0.7rem;
}

.studio-field-hint {
  color: var(--fg-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.studio-field-hint code {
  font-family: var(--font-code);
  font-size: 0.95em;
  color: var(--fg-soft);
  background: color-mix(in oklab, var(--bg-code) 50%, transparent);
  padding: 0 3px;
  border-radius: 3px;
}

.studio-add {
  display: flex;
  gap: var(--size-1);
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
}

.studio-add input,
.studio-add select {
  flex: 1 1 12ch;
  min-width: 0;
  padding: var(--size-1) var(--size-2);
  border: 1px dashed var(--st-rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-family: var(--font-code);
  font-size: var(--font-size-0);
}

.studio-add-btn {
  padding: var(--size-1) var(--size-2);
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg-soft);
  font: inherit;
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  cursor: pointer;
  white-space: nowrap;
}

.studio-add-btn:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
}

.studio-add-btn.muted {
  color: var(--fg-muted);
  border-style: dashed;
}

.studio-delete {
  margin: 0;
}

.studio-transition-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: var(--size-1);
  align-items: center;
  margin: 0;
}

@media (max-width: 680px) {
  .studio-transition-form,
  .studio-field-row {
    grid-template-columns: 1fr;
  }
}

/* state chips + transitions */

.studio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-1);
}

.studio-chip {
  font-family: var(--font-code);
  font-size: 0.7rem;
  padding: 2px var(--size-2);
  border-radius: 999px;
  border: 1px solid var(--st-rule);
  color: var(--fg-soft);
  background: var(--bg);
}

.studio-chip-initial {
  color: var(--fg-muted);
  border-style: dashed;
}

.studio-chip-state {
  color: oklch(85% 0.07 175);
  border-color: color-mix(in oklab, oklch(80% 0.10 175) 30%, var(--st-rule));
}

.studio-transitions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-code);
  font-size: 0.72rem;
}

.studio-transition {
  display: flex;
  gap: var(--size-2);
  align-items: baseline;
}

.studio-transition-event {
  color: oklch(85% 0.10 80);
}

.studio-transition-arrow {
  color: var(--fg-muted);
}

/* role / policy */

.studio-role {
  border-top: 1px dashed var(--st-rule);
  padding-top: var(--size-1);
}

.studio-role:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.studio-role-name {
  font-family: var(--font-code);
  font-size: var(--font-size-0);
  color: var(--fg);
}

.studio-role-perms {
  margin: 2px 0 0 0;
  padding-left: var(--size-4);
  font-family: var(--font-code);
  font-size: 0.7rem;
  color: var(--fg-soft);
}

.studio-boundary {
  display: flex;
  align-items: flex-start;
  gap: var(--size-1);
  padding: var(--size-2);
  border-radius: var(--radius);
  font-size: 0.72rem;
  line-height: 1.4;
}

.studio-boundary-glyph {
  flex: 0 0 auto;
}

.studio-boundary-holds {
  border: 1px solid color-mix(in oklab, var(--st-accent) 35%, var(--st-rule));
  background: color-mix(in oklab, var(--st-accent) 6%, transparent);
  color: var(--st-accent);
}

.studio-boundary-solo {
  border: 1px solid color-mix(in oklab, orange 35%, var(--st-rule));
  background: color-mix(in oklab, orange 6%, transparent);
  color: oklch(82% 0.12 70);
}

/* ── Risk pills ─────────────────────────────────────────────── */

.studio-pill {
  font-family: var(--font-code);
  font-size: 0.66rem;
  padding: 2px var(--size-2);
  border-radius: 999px;
  border: 1px solid var(--st-rule);
  color: var(--fg-soft);
  background: var(--bg);
  white-space: nowrap;
}

.studio-pill-risk-low {
  color: var(--fg-soft);
}

.studio-pill-risk-med {
  color: oklch(84% 0.12 80);
  border-color: color-mix(in oklab, oklch(80% 0.12 80) 40%, var(--st-rule));
  background: color-mix(in oklab, oklch(80% 0.12 80) 9%, var(--bg));
}

.studio-pill-risk-high {
  color: oklch(82% 0.17 25);
  border-color: color-mix(in oklab, oklch(70% 0.18 25) 45%, var(--st-rule));
  background: color-mix(in oklab, oklch(70% 0.18 25) 12%, var(--bg));
}

.studio-pill-risk-critical {
  color: white;
  border-color: oklch(60% 0.20 25);
  background: oklch(50% 0.20 25);
}

/* ── YAML pane ──────────────────────────────────────────────── */

.studio-yaml-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--size-2) var(--size-3);
  border-bottom: 1px solid color-mix(in oklab, white 8%, var(--bg-code));
}

.studio-yaml-name {
  font-family: var(--font-code);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklab, white 55%, var(--bg-code));
}

.studio-yaml-live {
  font-family: var(--font-code);
  font-size: 0.66rem;
  color: var(--st-accent);
}

.studio-yaml-live::before {
  content: "● ";
}

.studio-yaml-draft,
.studio-yaml-example {
  color: color-mix(in oklab, white 55%, var(--bg-code));
}

.studio-yaml-example {
  color: oklch(82% 0.10 70);
}

.studio-yaml-body {
  margin: 0;
  padding: var(--size-3);
  color: color-mix(in oklab, white 82%, var(--bg-code));
  font-family: var(--font-code);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  flex: 1;
}

.studio-yaml-body code {
  font-family: inherit;
  font-size: inherit;
  white-space: inherit;
  color: inherit;
}

.studio-scaffold {
  padding: var(--size-3);
  border-top: 1px solid color-mix(in oklab, white 8%, var(--bg-code));
}

.studio-scaffold-label {
  font-family: var(--font-code);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in oklab, white 55%, var(--bg-code));
  margin: 0 0 var(--size-1) 0;
}

.studio-scaffold ul {
  margin: 0;
  padding-left: var(--size-4);
  font-family: var(--font-code);
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.studio-scaffold a {
  color: var(--st-accent);
}

/* ── Import derived domain (observe → activate bridge, #243) ──
 * Lives in the dark YAML pane, below the live YAML, as a
 * collapsible paste box. Dark styling matches the scaffold. */
.studio-import {
  border-top: 1px solid color-mix(in oklab, white 8%, var(--bg-code));
}

.studio-import > summary {
  padding: var(--size-3);
  cursor: pointer;
  font-family: var(--font-code);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--st-accent);
  list-style: none;
}

.studio-import > summary::-webkit-details-marker {
  display: none;
}

.studio-import[open] > summary {
  border-bottom: 1px solid color-mix(in oklab, white 8%, var(--bg-code));
}

.studio-import-body {
  padding: var(--size-3);
  display: flex;
  flex-direction: column;
  gap: var(--size-3);
}

.studio-import-help {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: color-mix(in oklab, white 62%, var(--bg-code));
}

.studio-import-help code {
  font-family: var(--font-code);
  color: color-mix(in oklab, white 80%, var(--bg-code));
}

.studio-import-textarea {
  width: 100%;
  font-family: var(--font-code);
  font-size: 0.76rem;
  line-height: 1.5;
  padding: var(--size-2);
  background: var(--bg-code);
  color: color-mix(in oklab, white 85%, var(--bg-code));
  border: 1px solid color-mix(in oklab, white 12%, var(--bg-code));
  border-radius: var(--radius);
  resize: vertical;
  tab-size: 2;
  -moz-tab-size: 2;
}

.studio-import-textarea:focus {
  outline: none;
  border-color: var(--st-accent);
}

.studio-import-form {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
  align-items: flex-start;
}

/* ── Explainer footer row ───────────────────────────────────── */

.studio-explainers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--st-gap);
}

.studio-explainer {
  border: 1px solid var(--st-rule);
  border-radius: var(--radius);
  padding: var(--size-3);
  background: var(--st-card);
  display: flex;
  flex-direction: column;
  gap: var(--size-1);
}

.studio-explainer-head {
  display: flex;
  align-items: center;
  gap: var(--size-1);
  font-family: var(--font-code);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

.studio-explainer-primitive .studio-explainer-kind { color: var(--st-accent); }
.studio-explainer-convention .studio-explainer-kind { color: oklch(82% 0.10 240); }
.studio-explainer-mechanic .studio-explainer-kind { color: oklch(82% 0.10 305); }

.studio-explainer-sep { opacity: 0.5; }

.studio-explainer-name { color: var(--fg-soft); }

.studio-explainer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  font-weight: 600;
  color: var(--fg);
  line-height: 1.25;
}

.studio-explainer-body {
  margin: 0;
  font-size: 0.78rem;
  color: var(--fg-soft);
  line-height: 1.45;
}

.studio-explainer-body code {
  font-family: var(--font-code);
  font-size: 0.92em;
  background: color-mix(in oklab, var(--bg-code) 55%, transparent);
  padding: 0 3px;
  border-radius: 3px;
}


/* ── Docs site (/docs, /docs/{slug}) — issue #245 ─────────────────
 *
 * A small multi-page docs site rendered from vendored markdown
 * (internal/content/docs) through the same hermetic templ + embed.FS
 * pattern as /whitepaper. Two columns: a sticky sidebar nav on the
 * left, the rendered markdown in a .prose reading column on the
 * right. The rendered body reuses .prose verbatim — these rules only
 * add the page frame, the sidebar, and the verified/preview badges. */

.docs {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--size-6) var(--size-5) var(--size-9);
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: var(--size-7);
  align-items: start;
}

/* Sidebar nav — sticky under the topbar on desktop. */
.docs-nav {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: var(--size-5);
  font-size: var(--font-size-1);
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

.docs-nav-home {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
  padding-bottom: var(--size-3);
  border-bottom: 1px solid var(--rule-soft);
}

.docs-nav-home:hover { color: var(--accent); }

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--size-2);
}

.docs-nav-group-title {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.docs-nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  padding: var(--size-2) var(--size-3);
  border-radius: var(--radius);
  color: var(--fg-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.docs-nav-link:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--bg-elev) 50%, transparent);
}

.docs-nav-link-active {
  color: var(--fg);
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-elev) 60%);
  border-left-color: var(--accent);
}

/* verified / preview badges in the nav. Reuse the .badge palette
 * idea (currentColor border) but smaller for the dense sidebar. */
.docs-badge {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.docs-badge-verified { color: var(--ok); }
.docs-badge-preview  { color: var(--warn); }

/* Main reading column. */
.docs-main {
  min-width: 0;
}

.docs-eyebrow {
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--size-4);
  display: flex;
  gap: var(--size-2);
  align-items: center;
}

.docs-eyebrow a { color: var(--fg-muted); text-decoration: none; }
.docs-eyebrow a:hover { color: var(--accent); }

.docs-body {
  max-width: 46rem;
}

/* The first rendered heading carries the page title; tighten its
 * top margin so it sits right under the breadcrumb. */
.docs-body.prose h1:first-child { margin-top: 0; }

.docs-footnav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--size-3);
  margin-top: var(--size-8);
  padding-top: var(--size-4);
  border-top: 1px solid var(--rule-soft);
  max-width: 46rem;
}

.docs-footnav a {
  font-family: var(--font-display);
  font-size: var(--font-size-1);
  color: var(--fg-muted);
  text-decoration: none;
}

.docs-footnav a:hover { color: var(--accent); }

/* Mobile: nav stacks above the content, not sticky. */
@media (max-width: 860px) {
  .docs {
    grid-template-columns: 1fr;
    gap: var(--size-5);
  }
  .docs-nav {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--rule-soft);
    padding-bottom: var(--size-4);
  }
}


/* ── Overview governance-state headline (#246) ────────────────────
 *
 * The first card in the Overview runtime column. Tells a new tenant
 * exactly where they stand in three honest states — fresh / observed
 * / governed — so the front door never reads as an empty-domain
 * error and never misleads observed traffic as enforced. */

.dash-govstate h2 {
  display: flex;
  align-items: center;
  gap: var(--size-2);
}

.dash-govstate-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fg-muted);
  opacity: 0.5;
  flex: 0 0 auto;
}

/* observed = watching, not enforcing — warm/amber to read as
 * "in progress, not yet locked". */
.dash-govstate-dot-observe {
  background: var(--warn);
  opacity: 1;
}

/* governed = enforcing — accent/green to read as "live". */
.dash-govstate-dot-on {
  background: var(--ok);
  opacity: 1;
}

.dash-govstate-observed {
  border-color: color-mix(in oklab, var(--warn) 30%, var(--rule-soft));
}

.dash-govstate-governed {
  border-color: color-mix(in oklab, var(--ok) 30%, var(--rule-soft));
}

.dash-govstate-catalog-label {
  margin: var(--size-3) 0 var(--size-2);
  font-family: var(--font-display);
  font-size: var(--font-size-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.dash-govstate-catalog {
  list-style: none;
  margin: 0 0 var(--size-3);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-2);
}

.dash-govstate-catalog li {
  margin: 0;
}

.dash-govstate-catalog code {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-code) 55%, transparent);
  border: 1px solid var(--rule-soft);
  font-size: 0.9em;
}

/* Docs wayfinding card — persistent right-rail link to
 * docs.kiff.dev, rendered in every tenant state. */
.dash-docs-wayfinding {
  border-style: dashed;
}
