/* ============================================================
   TPP Validation — Design System
   Institutional + technical. Swiss grid meets terminal.
   ============================================================ */

:root {
  /* Palette — light (warm institutional) */
  --bg: oklch(0.975 0.006 85);
  --bg-2: oklch(0.955 0.008 85);
  --bg-inset: oklch(0.99 0.004 85);
  --ink: oklch(0.18 0.01 85);
  --ink-2: oklch(0.38 0.01 85);
  --ink-3: oklch(0.58 0.008 85);
  --rule: oklch(0.88 0.008 85);
  --rule-2: oklch(0.82 0.008 85);

  /* Signal colors — single regulatory green, plus amber/red for states */
  --signal: oklch(0.62 0.15 155);
  --signal-soft: oklch(0.92 0.06 155);
  --warn: oklch(0.75 0.15 75);
  --warn-soft: oklch(0.94 0.08 75);
  --fail: oklch(0.58 0.18 25);
  --fail-soft: oklch(0.94 0.06 25);

  /* Type */
  --f-display: 'Instrument Serif', 'Times New Roman', serif;
  --f-body: 'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Density (Tweakable) */
  --scale: 1;
  --u: calc(8px * var(--scale));
  --gutter: calc(var(--u) * 3);
  --section-y: calc(var(--u) * 14);
  --card-pad: calc(var(--u) * 3);
  --radius: 2px;

  /* Sizes */
  --max: 1360px;
}

[data-theme='dark'] {
  --bg: oklch(0.16 0.008 260);
  --bg-2: oklch(0.20 0.010 260);
  --bg-inset: oklch(0.13 0.008 260);
  --ink: oklch(0.96 0.006 85);
  --ink-2: oklch(0.78 0.010 85);
  --ink-3: oklch(0.58 0.010 85);
  --rule: oklch(0.28 0.010 260);
  --rule-2: oklch(0.36 0.012 260);

  --signal: oklch(0.80 0.18 155);
  --signal-soft: oklch(0.30 0.10 155);
  --warn: oklch(0.82 0.17 75);
  --warn-soft: oklch(0.30 0.10 75);
  --fail: oklch(0.72 0.20 25);
  --fail-soft: oklch(0.32 0.10 25);
}

[data-density='compact'] { --scale: 0.78; --section-y: calc(var(--u) * 11); }
[data-density='spacious'] { --scale: 1.2; --section-y: calc(var(--u) * 18); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  transition: background 200ms ease, color 200ms ease;
}

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Primitives ---------- */
.eyebrow {
  display: flex;
  align-items: center; /* This centers all the spans vertically */
  gap: 12px;           /* Adjust this to control spacing between your spans */
  flex-wrap: wrap;     /* Optional: lets them wrap on tiny mobile screens */
}

.eyebrow img {
  /* This ensures the flag centers specifically with the text inside its span */
  vertical-align: middle; 
  
  /* Modern browsers sometimes need a tiny nudge for "optical" centering */
  margin-top: -2px; 
}

/* Ensure your .mono spans behave nicely with the images inside them */
.mono {
  display: inline-flex;
  align-items: center;
  gap: 6px; /* Space between the '·' and the flag */
}
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 calc(var(--u) * 4);
}

.mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mono-md { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.02em; }
.mono-sm { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; }

.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule-strong { height: 1px; background: var(--ink); border: 0; margin: 0; }

.kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  color: var(--ink-2);
  background: var(--bg-inset);
}

/* Chip / status pill */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--bg-inset);
}
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 30%, transparent);
}
.chip.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in oklch, var(--warn) 30%, transparent); }
.chip.fail .dot { background: var(--fail); box-shadow: 0 0 0 3px color-mix(in oklch, var(--fail) 30%, transparent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 160ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--ink); padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.btn-link:hover { text-decoration-thickness: 2px; }

/* Section header */
.sec-head {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: calc(var(--u) * 4);
  align-items: baseline;
  padding-bottom: calc(var(--u) * 3);
  border-bottom: 1px solid var(--rule);
  margin-bottom: calc(var(--u) * 5);
}
.sec-head .label { display: flex; align-items: baseline; gap: 10px; }
.sec-head h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  max-width: 22ch;
}

section.block { padding: var(--section-y) 0; border-top: 1px solid var(--rule); }

/* Grid helpers */
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px calc(var(--u) * 4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: calc(var(--u) * 4);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  zoom: 1.4;
}
.brand-mark {
  width: 26px; height: 26px;
  position: relative;
  display: grid; place-items: center;
}
.tppmark { width: 100%; height: 100%; display: block; }
.tppmark-bg { fill: var(--ink); }
[data-theme='dark'] .tppmark-bg { fill: var(--ink); }
.tppmark-check {
  stroke: var(--bg);
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: tppDraw 1.1s cubic-bezier(.6,.1,.2,1) 0.2s forwards;
}
.brand:hover .tppmark-check {
  animation: tppDraw 0.8s cubic-bezier(.6,.1,.2,1) forwards;
}
@keyframes tppDraw {
  0% { stroke-dashoffset: 60; }
  100% { stroke-dashoffset: 0; }
}
.tppmark-lg { width: 80px; height: 80px; }
.tppmark-hero { width: 140px; height: 140px; }
.brand b { font-weight: 600; }
.brand .dim { color: var(--ink-3); }

.nav-links {
  display: flex; gap: calc(var(--u) * 3.5);
  justify-content: center;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 180ms ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--u) * 8) 0 calc(var(--u) * 10);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: calc(var(--u) * 6);
  align-items: stretch;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-copy .eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: calc(var(--u) * 4);
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(44px, 6.8vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 calc(var(--u) * 3);
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  color: var(--ink-2);
}
.hero h1 .sig { color: var(--signal); font-style: normal; }

.hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 0 calc(var(--u) * 5);
  line-height: 1.5;
}

.hero-cta { display: flex; gap: 12px; margin-bottom: calc(var(--u) * 5); flex-wrap: wrap; }

.hero-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  padding-top: calc(var(--u) * 3);
  gap: calc(var(--u) * 2);
}
.hero-trust .cell { border-left: 1px solid var(--rule); padding-left: 12px; }
.hero-trust .cell:first-child { border-left: 0; padding-left: 0; }
.hero-trust .cell .mono { display: block; margin-bottom: 6px; }
.hero-trust .cell .v { font-family: var(--f-display); font-size: 28px; line-height: 1; letter-spacing: -0.02em; }

/* Validator panel */
.validator {
  background: var(--bg-inset);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0;
  display: flex; flex-direction: column-reverse;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--rule-2), 0 24px 48px -32px rgba(0,0,0,0.18);
  justify-content: space-between;
}
.validator-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
}
.validator-head .mono { flex: 1; color: var(--ink-2); }
.validator-head .tls {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11px; color: var(--signal);
}
.validator-body { padding: 20px; height: 100% }

.vfield { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.vfield label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.vfield .val {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  word-break: break-all;
  min-height: 18px;
}
.vfield .val.cursor::after {
  content: '';
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: -3px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.checks {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule);
  margin-top: 6px;
}
.check {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.check.show { opacity: 1; transform: translateY(0); }
.check:last-child { border-bottom: 0; }
.check .ico {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--rule-2);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-3);
}
.check.ok .ico { border-color: var(--signal); background: var(--signal); color: #fff; }
.check.pending .ico {
  border: 1.5px solid var(--rule-2);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.check .name { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); }
.check .name .meta { color: var(--ink-3); margin-left: 6px; }
.check .t { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }

/* V5 — webhook dispatch row. Appears as the last check when a verdict
   lands on anything other than ALLOWED, so the user sees the push half
   of the story (subscribers get notified) right next to the verdict. */
.check.webhook {
  background: color-mix(in oklch, var(--signal) 8%, transparent);
  border-top: 1px dashed var(--rule);
  margin-top: 6px;
  padding-top: 12px;
  animation: webhook-in 380ms cubic-bezier(.2,.7,.2,1);
}
.check.webhook .ico {
  border: 0;
  background: var(--signal);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 13px; font-weight: 600;
}
.check.webhook .name { color: var(--ink); }
.check.webhook .name .meta {
  color: var(--ink-2);
  font-size: 11px;
  display: block;
  margin-top: 2px;
  margin-left: 0;
}
.check.webhook .t {
  color: var(--signal);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@keyframes webhook-in {
  0%   { opacity: 0; transform: translateX(-8px); }
  60%  { opacity: 1; transform: translateX(2px); }
  100% { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .check.webhook { animation: none; }
}

.validator-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2);
  gap: 14px;
}
.validator-foot .verdict {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12px;
  color: var(--ink-2);
}
.validator-foot .verdict.allowed { color: var(--signal); }
.validator-foot .verdict .big {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: inherit;
}

/* Ticker above hero */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  background: var(--bg-2);
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: calc(var(--u) * 6);
  padding: 12px 0;
  animation: ticker 48s linear infinite;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.ticker-track span { display: inline-flex; align-items: center; gap: 10px; }
.ticker-track .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Flow / How it works ---------- */

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-inset);
}
.flow-step {
  padding: calc(var(--u) * 3);
  border-right: 1px solid var(--rule);
  position: relative;
  min-height: 260px;
  display: flex; flex-direction: column;
}
.flow-step:last-child { border-right: 0; }
.flow-step .n {
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-3);
  margin-bottom: calc(var(--u) * 4);
}
.flow-step h3 {
  font-family: var(--f-display); font-weight: 400;
  font-size: 26px; letter-spacing: -0.015em; line-height: 1.1;
  margin: 0 0 calc(var(--u) * 1.5);
}
.flow-step p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.flow-step .detail {
  margin-top: auto;
  padding-top: calc(var(--u) * 2);
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
  display: flex; flex-direction: column; gap: 4px;
}
.flow-step .detail b { color: var(--ink); font-weight: 500; }

@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-step:nth-child(2) { border-right: 0; }
  .flow-step { border-bottom: 1px solid var(--rule); }
}

/* ---------- Regulations ---------- */

.regs { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 6); }
@media (max-width: 900px) { .regs { grid-template-columns: 1fr; } }

.reg-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); }
.reg-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: calc(var(--u) * 3);
  align-items: center;
  padding: calc(var(--u) * 2.5) 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 200ms ease;
}
.reg-row:hover { background: var(--bg-inset); }
.reg-row .tag {
  font-family: var(--f-display); font-size: 30px; letter-spacing: -0.02em; line-height: 1;
}
.reg-row .tag .sub { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); display: block; margin-top: 4px; letter-spacing: 0.06em; text-transform: uppercase; }
.reg-row .desc { color: var(--ink-2); font-size: 14px; max-width: 50ch; }
.reg-row .status { font-family: var(--f-mono); font-size: 11px; color: var(--signal); letter-spacing: 0.06em; text-transform: uppercase; }
.reg-row .status.upcoming { color: var(--warn); }

.reg-counter {
  border: 1px solid var(--rule);
  background: var(--bg-inset);
  border-radius: var(--radius);
  padding: calc(var(--u) * 3);
  display: flex; flex-direction: column; gap: calc(var(--u) * 2);
  position: sticky; top: 100px;
  align-self: start;
}
.reg-counter .cnum {
  font-family: var(--f-display);
  font-size: 88px;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.reg-counter .clabel { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.reg-counter .bars { display: flex; gap: 4px; }
.reg-counter .bar { flex: 1; height: 6px; background: var(--rule); border-radius: 1px; position: relative; overflow: hidden; }
.reg-counter .bar .fill { position: absolute; inset: 0; background: var(--signal); transform-origin: left; }

/* ---------- Pricing ---------- */

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--bg-inset); }
.price-card {
  padding: calc(var(--u) * 4);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  min-height: 520px;
  position: relative;
  transition: background 200ms ease;
}
.price-card:last-child { border-right: 0; }
.price-card:hover { background: var(--bg); }
.price-card.featured { background: var(--ink); color: var(--bg); }
.price-card.featured .mono, .price-card.featured .ink-2 { color: color-mix(in oklch, var(--bg) 70%, var(--ink)); }
.price-card.featured hr { background: color-mix(in oklch, var(--bg) 25%, transparent); }
.price-card .tier { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.price-card .amount { font-family: var(--f-display); font-size: 52px; line-height: 1; letter-spacing: -0.03em; margin: calc(var(--u) * 2) 0; }
.price-card .amount .unit { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.02em; text-transform: none; color: var(--ink-3); margin-left: 4px; }
.price-card.featured .amount .unit { color: color-mix(in oklch, var(--bg) 60%, var(--ink)); }
.price-card .blurb { color: var(--ink-2); font-size: 13.5px; margin: 0 0 calc(var(--u) * 3); min-height: 48px; }
.price-card.featured .blurb { color: color-mix(in oklch, var(--bg) 75%, var(--ink)); }
.price-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.price-card li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: baseline; }
.price-card li::before { content: '+'; font-family: var(--f-mono); color: var(--signal); }
.price-card .btn { margin-top: auto; justify-content: center; }

@media (max-width: 900px) {
  .pricing { grid-template-columns: 1fr; }
  .price-card { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* ---------- Docs preview ---------- */

.docs-preview {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

   /* ============================================================
   DOCS preview & Endpoints (v5 Cleanup)
   ============================================================ */
/* 1. Gör raden till ett rutnät med 4 kolumner */
.docs-left .ep {
  display: grid;
  /* Kolumn 1 & 2: Metod-taggar (60px var) 
     Kolumn 3: Path (tar resten av platsen)
     Kolumn 4: Beskrivning (anpassar sig efter texten) */
  grid-template-columns: 60px 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

/* 2. Tvinga Path-texten att ALLTID börja i kolumn 3 */
.docs-left .ep .p {
  grid-column: 3;
  color: var(--ink);
}

/* 3. Tvinga Meta-texten att ALLTID börja i kolumn 4 */
.docs-left .ep .meta {
  grid-column: 4;
  text-align: right;
  color: var(--ink-3);
  font-size: 11px;
  white-space: nowrap;
}

/* 4. Justera metod-taggen (behöver inte längre fast width här om grid sköter det, 
   men vi behåller din styling för utseendet) */
.docs-left .ep .m {
  grid-column: auto; /* Låter dem fylla kolumn 1 och 2 naturligt */
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--signal-soft);
  color: var(--signal);
  font-size: 10.5px;
  text-align: center;
}
.docs-left .ep .m.post { 
  background: color-mix(in oklch, var(--warn) 20%, transparent); 
  color: var(--warn); 
}

/* 3. Style the path */
.docs-left .ep .p { color: var(--ink); flex: 1; }

/* 4. Align the meta label to the right */
.docs-left .ep .meta {
  margin-left: auto; /* Pushes to the far right */
  text-align: right;
  color: var(--ink-3);
  font-size: 11px;
  white-space: nowrap;
}
@media (max-width: 900px) { .docs-preview { display: flex;flex-direction: column; } }
.docs-left { padding: calc(var(--u) * 4); background: var(--bg-inset); }
.docs-left h3 { font-family: var(--f-display); font-size: 32px; letter-spacing: -0.02em; margin: 0 0 calc(var(--u) * 2); font-weight: 400; }
.docs-left p { color: var(--ink-2); margin: 0 0 calc(var(--u) * 3); }
.docs-left .endpoints { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.docs-left .ep { display: grid; grid-template-columns: 60px 60px 1fr auto; gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--rule); font-family: var(--f-mono); font-size: 12px; align-items: center; }
.docs-left .ep .m { padding: 2px 6px; border-radius: 2px; background: var(--signal-soft); color: var(--signal); font-size: 10.5px; text-align: center; letter-spacing: 0.04em; }
.docs-left .ep .m.post { background: color-mix(in oklch, var(--warn) 20%, transparent); color: var(--warn); }
.docs-left .ep .p { color: var(--ink); }
@media (max-width: 600px) {
  .docs-left .ep {
    /* Change from 4 columns to a simpler layout */
    grid-template-columns: 60px 1fr; 
    gap: 8px;
    padding: 15px 0;
  }

  .docs-left .ep .meta {
    grid-column: 1 / -1; /* Make the description take the full bottom row */
    color: var(--ink-2);
    font-size: 11px;
  }
  
  .docs-left .ep .p {
    justify-self: end; /* Align the version/path to the right */
  }
}
.docs-right {
  background: oklch(0.14 0.008 260);
  color: oklch(0.92 0.006 85);
  font-family: var(--f-mono);
  font-size: 12.5px;
  padding: calc(var(--u) * 4);
  overflow: auto;
  line-height: 1.6;
}
[data-theme='dark'] .docs-right { background: var(--bg-inset); }
.docs-right .ln { color: oklch(0.48 0.01 260); display: inline-block; width: 28px; user-select: none; }
.docs-right .k { color: oklch(0.80 0.14 290); }
.docs-right .s { color: oklch(0.78 0.14 155); }
.docs-right .n { color: oklch(0.80 0.13 75); }
.docs-right .c { color: oklch(0.50 0.01 260); font-style: italic; }
.docs-right .p { color: oklch(0.72 0.12 210); }

/* Blinking green dot — used in ticker + integrity monitor */
.dot {
    height: 6px;
    width: 6px;
    background-color: var(--signal);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--signal);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}


/* ---------- Contact ---------- */

.cta-band {
  padding: calc(var(--u) * 12) 0;
  background: var(--ink);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
[data-theme='dark'] .cta-band { background: var(--bg-inset); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cta-band h2 {
  font-family: var(--f-display);
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 400;
  margin: 0 0 calc(var(--u) * 5);
  max-width: 16ch;
}
.cta-band h2 em { font-style: italic; color: color-mix(in oklch, var(--bg) 55%, var(--ink)); }
.cta-band .form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  max-width: 760px;
  padding-top: calc(var(--u) * 4);
  border-top: 1px solid color-mix(in oklch, var(--bg) 20%, transparent);
}


/* Grundstilen för dina inputs */
.cta-band input {
    color: white; /* Ändrad från var(--bg) för att alltid vara vit som bas */
    font-family: var(--f-body);
    font-size: 18px;
    background: var(--ink) !important;
    border: none;
    border-bottom: 1px solid color-mix(in oklch, white 30%, transparent);
    padding: 12px 0px;
    outline: none;
    transition: all 160ms;
}

/* När fältet är aktivt (Focus) */
.cta-band input:focus {
    border-bottom-color: var(--signal);
    background: var(--ink) !important;
}

/* Den magiska biten: Döda den ljusblå autofill-färgen */
/* Vi använder box-shadow för att "fylla" bakgrunden med svart inifrån */
.cta-band input:-webkit-autofill,
.cta-band input:-webkit-autofill:hover, 
.cta-band input:-webkit-autofill:focus {
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Grön text när en giltig e-post har skrivits in */
/* Kräver att din input har type="email" */
.cta-band input[type="email"]:valid {
    color: white; /* Eller var(--signal) om den är grönaktig */
}

/* Valfritt: Gör även namnet grönt om det inte är tomt */
.cta-band input:not(:placeholder-shown):valid {
    color: white;
}


.cta-band .btn-primary { background: var(--bg); color: var(--ink); }
.cta-band .btn-primary:hover { background: var(--signal); color: var(--bg); }

/* ---------- Footer ---------- */

footer {
  padding: calc(var(--u) * 8) 0 calc(var(--u) * 4);
  border-top: 1px solid var(--rule);
  font-size: 13px;
}
.foot-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: calc(var(--u) * 4);
  padding-bottom: calc(var(--u) * 6);
}
.foot-top h4 { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; font-weight: 500; }
.foot-top ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-top a { color: var(--ink-2); text-decoration: none; }
.foot-top a:hover { color: var(--ink); }

/* ---------- Footer bottom strip ---------- */
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--u) * 3);
  padding-top: calc(var(--u) * 3);
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 100%;
  min-width: 0; /* allow children to shrink instead of overflowing */
}
.foot-bottom .right { display: flex; gap: 24px; }
@media (max-width: 900px) { .foot-top { grid-template-columns: 1fr 1fr; } }

.foot-col {
  flex: 1;
  min-width: 0; /* critical: prevents flex children from pushing past parent width */
}
.foot-left { text-align: left; opacity: 0.5; }
.foot-right { text-align: right; opacity: 0.5; }

/* Center column holds the integrity monitor */
.foot-center {
  display: flex;
  justify-content: center;
}

/* ---------- Integrity monitor ---------- */
/* Desktop: both rows stacked vertically in a fixed-height strip.
   The items cross-fade via opacity — only the .active one is visible. */
.integrity-monitor {
  position: relative;
  width: 100%;
  max-width: 700px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.monitor-item {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  pointer-events: none;
}
.monitor-item.active {
  opacity: 1;
  pointer-events: auto;
}

.monitor-label {
  font-family: var(--f-mono, monospace);
  color: var(--signal);
  font-size: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.hash-text {
  font-family: var(--f-mono, monospace);
  color: var(--ink) !important;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.5px;
  min-width: 0;
  white-space: nowrap;         /* desktop: one line, no breaking */
}

/* Mobile: left-align the column, let the monitor grow tall enough
   for the hash to wrap underneath its label. */
@media (max-width: 768px) {
  .foot-center {
    justify-content: flex-start;
    display: none;
  }
  .integrity-monitor {
    height: auto;
    min-height: 24px;
    justify-content: flex-start;
    max-width: 100%;
  }
  .monitor-item {
    position: absolute;
    inset: 0;
    flex-direction: column;    /* label on top, hash below */
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
  }
  /* Hash can now wrap — it sits on its own line under the label,
     so the parent width no longer fights it. */
  .hash-text {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }
  /* Stack footer rows vertically on mobile */
  .foot-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: calc(var(--u) * 2);
  }
  .foot-right { text-align: left; }
}

/* ---------- Tweaks panel ---------- */

.tweaks-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 260px;
  z-index: 100;
  font-size: 12px;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.3);
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h5 { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 14px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.tweaks-panel h5 .close { cursor: pointer; color: var(--ink); font-family: var(--f-mono); }
.tweak-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.tweak-row .lbl { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.seg { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 0; border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 8px; cursor: pointer; color: var(--ink-2); font-family: var(--f-mono); font-size: 11px; border-right: 1px solid var(--rule-2); }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--ink); color: var(--bg); }

/* Variant switcher */
.variant-switch {
  display: inline-flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em;
}
.variant-switch a {
  padding: 7px 10px; color: var(--ink-3); text-decoration: none;
  border-right: 1px solid var(--rule); transition: all 140ms ease;
}
.variant-switch a:last-child { border-right: 0; }
.variant-switch a:hover { color: var(--ink); }
.variant-switch a.active { background: var(--ink); color: var(--bg); }

/* Upload / drop zone for hero validator */
.vfield.drop {
  border: 1px dashed var(--rule-2);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--f-mono); font-size: 12px;
  cursor: pointer;
  transition: all 160ms ease;
  background: var(--bg);
}
.vfield.drop:hover, .vfield.drop.drag {
  border-color: var(--signal);
  color: var(--ink);
  background: color-mix(in oklch, var(--signal) 5%, var(--bg));
}
.vfield.drop .drop-hint { display: block; }
.vfield.drop .drop-actions { display: flex; gap: 12px; justify-content: center; margin-top: 8px; font-size: 11px; }
.vfield.drop .drop-actions a { color: var(--ink); border-bottom: 1px solid var(--ink); cursor: pointer; }
.vfield.drop .drop-actions a:hover { color: var(--signal); border-color: var(--signal); }
.vfield.drop input { display: none; }

/* Workspace bots section */
.workspace-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-inset);
}
.ws-card {
  padding: calc(var(--u) * 4);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: calc(var(--u) * 2.5);
  min-height: 420px;
  position: relative;
}
.ws-card:last-child { border-right: 0; }
.ws-card .ws-logo {
  width: 44px; height: 44px;
  border: 1px solid var(--rule); border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg);
  font-family: var(--f-display); font-size: 22px;
}
.ws-card h3 {
  font-family: var(--f-display); font-size: 28px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1.05; margin: 0;
}
.ws-card .blurb { color: var(--ink-2); font-size: 14px; margin: 0; }
.ws-card .demo {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 12px; font-family: var(--f-mono); font-size: 11.5px; line-height: 1.6;
  margin-top: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.ws-card .demo .you { color: var(--ink-3); }
.ws-card .demo .cmd { color: var(--ink); }
.ws-card .demo .bot { color: var(--signal); padding-left: 10px; border-left: 2px solid var(--signal); }
.ws-card .demo .meta { color: var(--ink-3); font-size: 10.5px; }
@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .ws-card { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .workspace-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-card:nth-child(2n) { border-right: 0; }
  .ws-card:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .ws-card:nth-child(3) { grid-column: 1 / -1; border-bottom: 0; }
}

/* Hero mark decoration */
.hero-hero-mark {
  position: absolute;
  right: -40px; top: -30px;
  width: 280px; height: 280px;
  opacity: 0.06;
  pointer-events: none;
}

/* Deploy modes (Azure marketplace) row */
.deploy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
}
.deploy-card {
  padding: calc(var(--u) * 3); border-right: 1px solid var(--rule);
  background: var(--bg-inset);
  display: flex; flex-direction: column; gap: 10px;
}
.deploy-card:last-child { border-right: 0; }
.deploy-card .mono { color: var(--ink-3); }
.deploy-card h4 { font-family: var(--f-display); font-size: 22px; letter-spacing: -0.01em; margin: 0; font-weight: 400; }
.deploy-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
@media (max-width: 900px) {
  .deploy-grid { grid-template-columns: 1fr; }
  .deploy-card { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* Scroll-reveal default */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Marquee stats in how-it-works */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: calc(var(--u) * 6);
}
.stat {
  padding: calc(var(--u) * 3);
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat .big { font-family: var(--f-display); font-size: 56px; line-height: 1; letter-spacing: -0.03em; }
.stat .big .u { font-family: var(--f-mono); font-size: 14px; color: var(--ink-3); letter-spacing: 0; text-transform: none; margin-left: 2px; }
.stat .lbl { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 10px; }
@media (max-width: 900px) { .stats-row { grid-template-columns: 1fr 1fr; } .stat:nth-child(2) { border-right: 0; } }

/* Hero decorative grid overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  opacity: 0.4;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}
.hero > * { position: relative; }

/* ============================================================
   MIGRATED FROM INLINE <style> BLOCK (previously in index.html)
   ============================================================ */
  /* ============================================================
     Existing desktop adjustments (carried forward from earlier work)
     ============================================================ */

  /* Demo-button flash nudge */
  #btnDemo.flash {
    animation: btnFlash 1.6s ease-in-out 3;
  }
  #btnDemo.hidden { display: none; }
  @keyframes btnFlash {
    0%, 100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
    50%      { background: var(--signal-soft); box-shadow: 0 0 0 4px var(--signal-soft); }
  }
  @media (prefers-reduced-motion: reduce) {
    #btnDemo.flash { animation: none; }
  }

  /* Total-time badge pops against grey meta */
  .verdict-foot .total-ms,
  [data-v="verdict-label"] .total-ms {
    color: var(--ink);
    font-weight: 600;
  }
.price-card.featured .btn-primary {
  background: var(--signal);
  color: var(--bg);
}
.price-card.featured .btn-primary:hover {
  background: oklch(0.55 0.15 155);
  transform: translateY(-1px);
}
.nav-cta .btn-primary:hover,
.hero-cta .btn-primary:hover {
  background: var(--signal);
  color: var(--bg);
}
  /* Preferences trigger pill */
  .tweaks-trigger {
    position: fixed; bottom: 20px; right: 20px; z-index: 99;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--ink); color: var(--bg);
    border: 0; border-radius: 999px; cursor: pointer;
    font-family: var(--f-mono); font-size: 11px;
    letter-spacing: 0.06em; text-transform: uppercase;
    box-shadow: 0 10px 30px -12px rgba(0,0,0,0.4);
    transition: transform 180ms ease, opacity 180ms ease;
  }
  .tweaks-trigger:hover { transform: translateY(-1px); }
  .tweaks-trigger.hidden {
    opacity: 0; pointer-events: none; transform: translateY(6px);
  }

  /* Reduced-motion override */
  [data-motion="reduced"] *,
  [data-motion="reduced"] *::before,
  [data-motion="reduced"] *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  /* Skipped check rows (422 neutral state) */
  .check.skipped .name,
  .check.skipped .meta,
  .check.skipped .t { color: var(--ink-3); }
  .check.skipped .meta { font-style: italic; }

  /* ============================================================
     Validator height stability — keeps the card consistent across
     states so it doesn't jump between submissions.
     ============================================================ */
  .validator { justify-content: space-between; }
  .validator-body { flex: 1; display: flex; flex-direction: column; }
  #validator .vfield .val {
    min-height: 42px;
    display: flex; align-items: center;
  }
  #validator .checks { min-height: 264px; }
/* Flash the verdict footer in outcome color so the result is easy
   to catch even if the user's eye was on the check rows above. */
@keyframes verdictFlashAllowed {
  0%   { background: color-mix(in oklch, var(--signal) 35%, transparent); }
  100% { background: transparent; }
}
@keyframes verdictFlashDenied {
  0%   { background: color-mix(in oklch, var(--fail) 35%, transparent); }
  100% { background: transparent; }
}
.validator-foot.flash-allowed {
  animation: verdictFlashAllowed 900ms ease-out;
}
.validator-foot.flash-denied {
  animation: verdictFlashDenied 900ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .validator-foot.flash-allowed,
  .validator-foot.flash-denied { animation: none; }
}
  /* ============================================================
     Gateway support strip + Claude-styled config pane
     ============================================================ */
 /* --- Gateway Strip Layout --- */
.gateway-strip {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 4);
  padding: calc(var(--u) * 3) 0;
  margin-bottom: calc(var(--u) * 4);
  flex-wrap: wrap;
}

.gateway-strip-label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.gateway-strip-list {
  display: flex;
  gap: 32px; /* Mer luft mellan rena loggor */
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  justify-content: space-between;
}

/* De rena logotyperna */
.gateway-logo {
  height: 18px; /* Enhetlig höjd för att skapa horisontell harmoni */
  width: auto;
  filter: grayscale(1);
  opacity: 0.5; /* Diskret framtoning */
  display: block;
  transition: opacity 200ms ease;
}

/* Mörkt läge: Invertera loggorna så de blir ljusgrå istället för svarta */
[data-theme='dark'] .gateway-logo {
  filter: grayscale(1) invert(1);
  opacity: 0.4;
}

/* Ta bort den gamla .gateway-chip koden helt */
  /* The Claude pane mirrors the structure of the old .docs-right code
     pane: dark background, mono font, ~same dimensions. But with a
     header/footer chrome that frames it as an assistant panel. */
  .claude-pane {
    background: oklch(0.14 0.008 260);
    color: oklch(0.92 0.006 85);
    display: flex;
    flex-direction: column;
    font-family: var(--f-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow: hidden;
  }
  [data-theme='dark'] .claude-pane { background: var(--bg-inset); }

  .claude-pane-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid oklch(0.22 0.008 260);
    background: oklch(0.11 0.008 260);
  }
  [data-theme='dark'] .claude-pane-head {
    border-bottom-color: var(--rule);
    background: var(--bg-2);
  }
  .claude-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #cc785c; /* Claude's signature warm orange — subtle use */
    box-shadow: 0 0 0 3px color-mix(in oklch, #cc785c 30%, transparent);
    flex-shrink: 0;
  }
  .claude-pane-title {
    font-family: var(--f-body);
    font-size: 13px;
    font-weight: 600;
    color: oklch(0.96 0.006 85);
    letter-spacing: -0.005em;
  }
  .claude-pane-sub {
    font-family: var(--f-mono);
    font-size: 10.5px;
    color: oklch(0.55 0.01 260);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: auto;
  }

  .claude-pane-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
  }
  .claude-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: oklch(0.18 0.008 260);
    border-radius: 4px;
    border-left: 2px solid #cc785c;
  }
  [data-theme='dark'] .claude-prompt {
    background: var(--bg-2);
  }
  .claude-prompt-label {
    font-family: var(--f-body);
    font-size: 13.5px;
    color: oklch(0.82 0.006 85);
  }

  /* Gateway dropdown — styled to match the dark pane */
  .gateway-select {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .gateway-select select {
    appearance: none;
    background: oklch(0.10 0.008 260);
    color: oklch(0.96 0.006 85);
    border: 1px solid oklch(0.25 0.008 260);
    border-radius: 3px;
    padding: 6px 28px 6px 12px;
    font-family: var(--f-mono);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 160ms ease;
  }
  .gateway-select select:hover,
  .gateway-select select:focus {
    border-color: #cc785c;
    outline: none;
  }
  .gateway-select-chev {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: oklch(0.65 0.01 260);
    font-size: 10px;
  }

  /* Code block — the generated config. Uses pre to preserve whitespace. */
  .claude-code {
    margin: 0;
    padding: 0;
    font-family: var(--f-mono);
    font-size: 12px;
    line-height: 1.65;
    color: oklch(0.90 0.006 85);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: auto;
    max-width: 100%;
    flex: 1;
    min-height: 360px;
  }
  /* Simple syntax-hint colours inside the generated code. We wrap
     specific tokens when rendering — these style them. */
  .claude-code .ck { color: oklch(0.80 0.14 290); }   /* keyword */
  .claude-code .cs { color: oklch(0.78 0.14 155); }   /* string */
  .claude-code .cc { color: oklch(0.50 0.01 260); font-style: italic; } /* comment */
  .claude-code .cn { color: oklch(0.80 0.13 75); }    /* number */
  .claude-code .cp { color: oklch(0.72 0.12 210); }   /* property */

  .claude-pane-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid oklch(0.22 0.008 260);
    background: oklch(0.11 0.008 260);
  }
  [data-theme='dark'] .claude-pane-foot {
    border-top-color: var(--rule);
    background: var(--bg-2);
  }
  .claude-pane-foot .mono { color: oklch(0.55 0.01 260); }
  .claude-copy {
    color: oklch(0.85 0.006 85);
    text-decoration: none;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1px solid oklch(0.25 0.008 260);
    border-radius: 2px;
    transition: all 140ms ease;
  }
  .claude-copy:hover {
    border-color: #cc785c;
    color: #cc785c;
  }
  .claude-copy.copied {
    border-color: var(--signal);
    color: var(--signal);
  }

  /* ============================================================
     Mobile navigation — hamburger + slide-down drawer.
     Hidden by default on desktop.
     ============================================================ */
  .nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--rule-2);
    border-radius: 6px;
    padding: 8px;
    color: var(--ink);
    cursor: pointer;
    transition: border-color 160ms ease;
  }
  .nav-toggle:hover { border-color: var(--ink); }
  .nav-toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

  .nav-drawer {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    max-width: 100vw;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 72px 20px 24px;
    transform: translateY(-100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 39;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.2);
    overflow-x: hidden;
  }
  .nav-drawer.open { transform: translateY(0); }
  .nav-drawer a {
    color: var(--ink);
    text-decoration: none;
    font-family: var(--f-body);
    font-size: 18px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--rule);
  }
  .nav-drawer a:last-child { border-bottom: 0; }
  .nav-drawer .drawer-cta {
    margin-top: 12px;
    padding: 14px;
    background: var(--ink);
    color: var(--bg);
    border: 0;
    border-radius: 2px;
    text-align: center;
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 500;
  }

  /* ============================================================
     Mobile polish — ≤720px
     Goal: everything legible, tappable, no horizontal scrolling.
     ============================================================ */
  @media (max-width: 720px) {
    /* NAV — brand far left, CTA + hamburger far right. Switch from the
       desktop grid to flex so justify-content: space-between works
       regardless of the removed middle column. */
    .nav-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      gap: 12px;
    }
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-cta { gap: 8px; }
    .nav-cta-btn { padding: 8px 12px; font-size: 12px; }
    /* On very narrow screens, drop the CTA from nav (it's in the drawer) */
    body.drawer-open { overflow: hidden; }

    /* Wrap padding tighter */
    .wrap { padding: 0 16px; }

    /* TICKER — slower and smaller so text is readable as it scrolls */
    .ticker-track { animation-duration: 90s; font-size: 10.5px; padding: 10px 0; }

    /* HERO — prevent the 44px serif floor from dominating */
    .hero { padding: calc(var(--u) * 3) 0 calc(var(--u) * 5); }
    .hero h1 {
      font-size: clamp(32px, 20vw, 69px);
      line-height: 1.02;
      letter-spacing: -0.025em;
      margin-bottom: calc(var(--u) * 2.5);
    }
    .hero-copy .eyebrow { margin-bottom: calc(var(--u) * 2.5); flex-wrap: wrap; }
    .hero-sub {
      font-size: 15px;
      margin-bottom: calc(var(--u) * 3);
      max-width: none;
    }
    .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; }
    .hero-cta .btn { justify-content: center; }

    /* Kill decorative grid overlay (striped on narrow) */
    .hero::before { display: none; }

    /* Hero trust — 2x2. Number size matched to .stat .big so the two
       "headline numbers" rows (Registers/Jurisdictions/... and End-to-end
       verdict / Validations / Uptime / Regulations) read at the same
       visual weight. */
    .hero-trust {
      grid-template-columns: 1fr 1fr;
      gap: 20px 16px;
      padding-top: calc(var(--u) * 2.5);
    }
    .hero-trust .cell { border-left: 0; padding-left: 0; }
    .hero-trust .cell .v { font-size: 36px; }

    /* VALIDATOR — tight paddings, meta wraps below name */
    .validator-head {
      padding: 10px 12px;
      font-size: 10.5px;
      flex-wrap: wrap;
    }
    .validator-head .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .validator-body { padding: 14px; }
    #validator .vfield .val { min-height: 38px; font-size: 12px; }
    #validator .checks { min-height: 260px; }
    .check {
      grid-template-columns: 20px 1fr auto;
      gap: 10px;
      padding: 10px 0;
      align-items: start;
    }
    .check .ico { margin-top: 2px; }
    .check .name {
      font-size: 11.5px;
      min-width: 0;
      word-break: break-word;
    }
    .check .name .meta {
      display: block;
      margin-left: 0;
      margin-top: 3px;
      font-size: 10.5px;
    }
    .check .t { font-size: 10.5px; padding-top: 2px; }
    .validator-foot {
      padding: 12px 14px;
      flex-wrap: wrap;
      gap: 8px;
    }
    .validator-foot .verdict .big { font-size: 18px; }
    [data-v="verdict-label"] {
      font-size: 10.5px;
      word-break: break-word;
      text-align: right;
      flex: 1;
      min-width: 0;
    }
    .vfield.drop { padding: 12px; }
    .vfield.drop .drop-hint { font-size: 11px; }
    .vfield.drop .drop-actions { flex-wrap: wrap; }

    /* SECTION HEADERS — § label stacks above h2 */
    .sec-head {
      grid-template-columns: 1fr;
      gap: 10px;
      padding-bottom: calc(var(--u) * 2);
      margin-bottom: calc(var(--u) * 3);
    }
    .sec-head h2 { font-size: clamp(22px, 6.5vw, 32px); max-width: none; }
    section.block { padding: calc(var(--u) * 7) 0; }

    /* FLOW — single column */
    .flow { grid-template-columns: 1fr; }
    .flow-step {
      border-right: 0;
      border-bottom: 1px solid var(--rule);
      min-height: 0;
      padding: calc(var(--u) * 2.5);
    }
    .flow-step:last-child { border-bottom: 0; }
    .flow-step h3 { font-size: 32px; }

    /* STATS — single column */
    .stats-row {
      margin-top: calc(var(--u) * 4);
    }
    .stat {
      border-right: 0;
      border-bottom: 1px solid var(--rule);
      padding: calc(var(--u) * 2);
    }
    .stat:last-child { border-bottom: 0; }
    .stat .big { font-size: 36px; }

    /* REGULATIONS — 2-column compact layout */
    .reg-row {
      grid-template-columns: 1fr auto;
      gap: 8px 12px;
      padding: calc(var(--u) * 2) 0;
    }
    .reg-row .tag { font-size: 32px; grid-column: 1 / -1; }
    .reg-row .tag .sub { margin-top: 2px; }
    .reg-row .desc { grid-column: 1; font-size: 13px; }
    .reg-row .status { grid-column: 2; align-self: center; }
    .reg-counter { position: static; }
    .reg-counter .cnum { font-size: 56px; }

    /* WORKSPACE — already stacks at 900px; tighten padding */
    .ws-card { min-height: 0; padding: calc(var(--u) * 3); }
    .ws-card h3 { font-size: 22px; }

    /* DEPLOY — already stacks at 900px */
    .deploy-card { padding: calc(var(--u) * 2.5); }

    /* PRICING — already stacks at 900px; remove the min-height */
    .price-card { padding: calc(var(--u) * 3); }
    .price-card .amount { font-size: 40px; }

    .claude-pane-body { padding: 14px; gap: 12px; }
    .claude-code { font-size: 11px; min-height: 280px; }
    .claude-prompt { padding: 10px 12px; }
    .claude-prompt-label { font-size: 12.5px; }
    .gateway-strip {
      gap: 12px;
      padding: calc(var(--u) * 2) 0;
    }
    .gateway-strip-label { width: 100%; }
    .gateway-chip { font-size: 10.5px; padding: 5px 10px; }

    /* CTA — stack form, single column */
    .cta-band { padding: calc(var(--u) * 6) 0; }
    .cta-band h2 {
      font-size: clamp(34px, 12vw, 48px);
      margin-bottom: calc(var(--u) * 3);
      max-width: none;
    }
    .cta-band .form {
      grid-template-columns: 1fr;
      gap: 16px;
      padding-top: calc(var(--u) * 2.5);
    }
    .cta-band .btn { justify-content: center; }

    /* FOOTER — brand full-width, rest 2x2 */
    footer { padding: calc(var(--u) * 5) 0 calc(var(--u) * 3); }
    .foot-top {
      grid-template-columns: 1fr 1fr;
      gap: calc(var(--u) * 3);
      padding-bottom: calc(var(--u) * 4);
    }
    .foot-top > div:first-child { grid-column: 1 / -1; }
    .foot-bottom {
      flex-direction: column;
      gap: 8px;
      align-items: flex-start;
    }
    .foot-bottom .right { flex-direction: column; gap: 4px; }

    /* PREFERENCES pill — smaller, panel edge-to-edge */
    .tweaks-trigger {
      bottom: 12px; right: 12px;
      padding: 8px 12px; font-size: 10px;
    }
    .tweaks-panel {
      bottom: 12px;
      right: 12px;
      left: 12px;
      min-width: 0;
      max-width: none;
    }

    /* ENDPOINTS STRIP — stack vertically so the OpenAPI button
       can go full-width like the other mobile buttons. */
    .pp-foot--endpoints {
      flex-direction: column;
      align-items: stretch;
    }
    .pp-foot--endpoints .endpoints-text { flex: none; }
    .btn--endpoints-spec {
      display: flex;             /* override .btn's inline-flex */
      width: 100%;
      justify-content: center;
      padding: 14px;
      font-size: 13px;
    }
  }

  /* ============================================================
     Very narrow phones (≤380px) — final tightening
     ============================================================ */
  @media (max-width: 480px) {
    /* Drop the CTA from the nav; it's in the drawer */
    .nav-cta .nav-cta-btn { display: none; }
    .hero h1 { font-size: clamp(34px, 12vw, 48px); }
  }

  /* ============================================================
     V5 — push vs pull block (sits between how-it-works flow and stats)
     Hand-tuned to match the existing flow-step vocabulary:
     warm bg-inset surface, 1px rules, mono labels, signal-green accent.
     ============================================================ */
  .pp {
    margin-top: calc(var(--u) * 10);
    margin-bottom: calc(var(--u) * 6);
  }
  .pp-head { max-width: 68ch; margin-bottom: calc(var(--u) * 5); }
  .pp-head .mono {
    display: inline-block;
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--signal); margin-bottom: calc(var(--u) * 2);
  }
  .pp-head h3 {
    font-family: var(--f-display);
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.05; letter-spacing: -0.025em;
    margin: 0 0 calc(var(--u) * 2);
    color: var(--ink);
  }
  .pp-head p { color: var(--ink-2); font-size: 16px; line-height: 1.55; margin: 0; max-width: 60ch; }
  .pp-head em { font-style: italic; color: var(--ink); }

  .pp-grid {
    display: grid; grid-template-columns: 1fr 1.15fr; gap: calc(var(--u) * 3);
  }
  .pp-card {
    background: var(--bg-inset);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: calc(var(--u) * 5);
    display: flex; flex-direction: column;
    gap: calc(var(--u) * 2);
    min-width: 0;        /* let long <pre> children wrap instead of pushing the grid track wider */
    overflow: hidden;    /* belt-and-braces: clip anything that still resists */
  }
  .pp-card.featured {
    background: var(--bg);
    border: 1px solid var(--ink);
    box-shadow: 0 2px 0 0 var(--ink);
    position: relative;
  }
  .pp-card.featured::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(180deg,
      color-mix(in oklch, var(--signal) 6%, transparent) 0%,
      transparent 40%);
    pointer-events: none;
  }
  .pp-card > * { position: relative; }
  .pp-tag {
    display: flex; align-items: baseline; gap: 12px;
    font-size: 11px;
  }
  .pp-tag .mono {
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-2); font-weight: 600;
  }
  .pp-tag .mono.sig { color: var(--signal); }
  .pp-tag .dim { color: var(--ink-3); font-weight: 400; }
  .pp-card h4 {
    font-family: var(--f-display);
    font-size: 24px; letter-spacing: -0.02em; line-height: 1.15;
    margin: 0; color: var(--ink);
  }
  .pp-card > p {
    margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55;
  }
  .pp-card > p b { color: var(--ink); font-weight: 600; }
  .pp-card > p .mono { font-size: 12.5px; color: var(--ink); background: var(--bg-2); padding: 1px 6px; border-radius: 3px; }

  .pp-flow {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--f-body);
    font-size: 13px;
    letter-spacing: 0;
    color: var(--ink-2);
    padding: 10px 0;
    border-top: 1px dashed var(--rule);
    flex-wrap: wrap;
  }
  .pp-flow.rev { border-top: 0; padding-top: 0; }
  .pp-flow b {
    color: var(--ink);
    font-weight: 600;
    letter-spacing: 0.01em;
    font-variant-ligatures: none;
  }
  .pp-arrow {
    flex: 1; color: var(--ink-3);
    text-align: center;
    font-family: var(--f-mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pp-arrow.sig { color: var(--signal); font-weight: 600; }

  .pp-code {
    margin: 0;
    font-family: var(--f-mono); font-size: 11.5px; line-height: 1.55;
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: calc(var(--radius) - 2px);
    padding: 12px 14px;
    white-space: pre-wrap;       /* preserve newlines but allow wrapping */
    overflow-wrap: anywhere;     /* break long tokens (cert blobs, URLs, hex) */
    word-break: break-word;
    overflow-x: auto;
    max-width: 100%;
  }

  .pp-notes {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
  }
  .pp-notes li {
    font-family: var(--f-mono); font-size: 12px; line-height: 1.5;
    color: var(--ink-2);
    padding-left: 16px; position: relative;
  }
  .pp-notes li::before {
    content: '→'; position: absolute; left: 0; top: 0;
    color: var(--signal); font-weight: 600;
  }
  .pp-notes li b { color: var(--ink); font-weight: 600; }
  .pp-notes li .mono { color: var(--ink); background: var(--bg-2); padding: 1px 5px; border-radius: 2px; font-size: 11px; }

  .pp-foot {
    display: flex; align-items: center; gap: 12px;
    margin-top: calc(var(--u) * 3);
    padding: 12px 16px;
    font-size: 12px; color: var(--ink-2);
  }
  .pp-foot b { color: var(--ink); font-weight: 600; }
  .pp-foot .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 25%, transparent);
    flex: 0 0 auto;
  }

  @media (max-width: 900px) {
    .pp-grid { grid-template-columns: 1fr; }
    .pp-card { padding: calc(var(--u) * 2); }
  }

  /* Stacked code blocks in API section — tighter gaps */
  #docs .pp-card .pp-code + .pp-code {
    margin-top: calc(var(--u) * -1);
    border-top: 1px dashed var(--rule);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  #docs .pp-card .pp-code:has(+ .pp-code) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 0;
  }
  #docs .pp-card .pp-code {
    font-size: 11px;
    line-height: 1.5;
    /* Collapsed by default — label + 2 lines of code */
    max-height: 5.8em;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 30px;           /* room for the label */
  }
  /* Label badge — always visible, rendered from data-label attr */
  #docs .pp-card .pp-code[data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: 8px; left: 14px;
    font-family: var(--f-mono);
    font-size: 9.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: var(--bg-inset);
    border: 1px solid var(--rule);
    padding: 2px 7px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
  }
  /* Fade hint at bottom when collapsed */
  #docs .pp-card .pp-code::after {
    content: '↓ expand';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 32px;
    background: linear-gradient(transparent, var(--bg-2) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  #docs .pp-card .pp-code.expanded {
    max-height: 600px;           /* generous ceiling — actual height determined by content */
  }
  #docs .pp-card .pp-code.expanded::after {
    opacity: 0;
  }
  /* Adjacent expanded blocks — keep them visually connected */
  #docs .pp-card .pp-code.expanded + .pp-code {
    border-top: 1px dashed var(--rule);
  }

  /* Embedded code panes inside cards — compact sizing */
  #docs .pp-card .claude-pane { overflow: hidden; }
  #docs .pp-card .claude-pane-body { padding: 12px 14px; gap: 10px; }
  #docs .pp-card .claude-prompt { padding: 8px 12px; }
  #docs .pp-card .claude-prompt-label { font-size: 12px; }

  /* Collapsible claude-code inside docs cards */
  #docs .pp-card .claude-code {
    min-height: 0;
    max-height: 6em;             /* ~4 lines collapsed */
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  #docs .pp-card .claude-code::after {
    content: '↓ expand';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 32px;
    background: linear-gradient(transparent, oklch(0.14 0.008 260) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    font-family: var(--f-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: oklch(0.45 0.01 260);
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  [data-theme='dark'] #docs .pp-card .claude-code::after {
    background: linear-gradient(transparent, var(--bg-inset) 60%);
  }
  #docs .pp-card .claude-code.expanded {
    max-height: 800px;
  }
  #docs .pp-card .claude-code.expanded::after {
    opacity: 0;
  }

/* ============================================================
   Inline-style replacements — small utility classes used in
   index.html so markup stays clean and styling lives here.
   ============================================================ */
.u-sig               { color: var(--signal); }
.u-sig-b             { color: var(--signal); font-weight: 600; }
.u-ink-underline     { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.tppmark-bg          { rx: 0; ry: 0; }

/* Hero sub — "New in v5" lead paragraph */
.hero-sub.hero-sub--lead {
  margin-top: calc(var(--u) * -3);
  color: var(--ink-3);
  font-size: 15px;
}

/* Embedded claude-pane inside a pp-card */
.claude-pane--embed {
  margin-top: calc(var(--u) * 2);
  border-radius: calc(var(--radius) - 2px);
}

/* pp-foot variant that pushes to the card bottom */
.pp-foot--bottom { margin-top: auto; }

/* Horizontal rule used in deploy card */
.rule--tight { margin: 12px 0; }

/* Deploy-card mono block */
.mono--deploy { color: var(--ink-2); line-height: 1.6; }

/* Small ghost button nudged for inline placement */
.btn--inline-top    { margin-top: 8px; }
.btn--endpoints-spec { margin: 0; padding: 8px 14px; font-size: 11px; }

/* Workspace logo color/font overrides */
.ws-logo--mcp   { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; }
.ws-logo--slack { color: #4A154B; }
.ws-logo--teams { color: #5059C9; }

/* Endpoints summary strip (under API cards) */
.pp-foot--endpoints {
  margin-top: calc(var(--u) * 4);
  flex-wrap: wrap;
  gap: 16px;
}
.pp-foot--endpoints .endpoints-text { flex: 1; }

/* Form feedback under CTA */
.form-feedback {
  margin-top: 10px;
  font-size: 14px;
  display: none;
}

/* Footer brand link */
.foot-brand-link { margin-bottom: 16px; display: inline-block; }

/* Footer brand copy */
.foot-brand-copy {
  color: var(--ink-3);
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.55;
}

/* Tweaks panel segmented rows — column counts */
.seg--cols-2 { --cols: 2; }
.seg--cols-3 { --cols: 3; }