:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --ink: #171615;
  --muted: #67625c;
  --line: #ded8cc;
  --panel: #ffffff;
  --accent: #126a5a;
  --accent-ink: #ffffff;
  --blue: #214d8f;
  --red: #9a3a2f;
  --shadow: 0 18px 60px rgba(34, 29, 22, 0.10);

  /* Spacing scale — every margin/padding/gap on long-form content
     should snap to one of these values. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 22px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  /* Type scale — keep collapsed; .long-form h2/h3/p reference these. */
  --fs-eyebrow: 12px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-h3: 17px;
  --fs-h2: 24px;
  --fs-h1: 34px;
  --fs-hero: clamp(36px, 4.6vw, 56px);

  /* Line heights — three values cover every body/heading/label. */
  --lh-tight: 1.15;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;

  /* Radii + mono font stack — single sources of truth. */
  --rd-sm: 6px;
  --rd-md: 8px;
  --rd-lg: 12px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* One global inline-code rule. Long-form pages used to redefine this in
   five places (.compare, .guide, .faq, .claim-yes, .compliance-grid). */
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--line);
  padding: 1px 5px;
  border-radius: 4px;
}

/* One global preformatted-block rule. .guide pre and .faq pre were
   byte-identical copies. */
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: var(--rd-sm);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: var(--lh-normal);
  margin: 12px 0 16px;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* "Technical details for advanced users" — one collapsible block per
   page, placed just before the site footer. Keep the spacing consistent
   with .compliance / .compare-callout so the rhythm doesn't break. */
.tech-section {
  padding: var(--space-6) 0 var(--space-5);
  border-top: 1px solid var(--line);
}

.tech-section > .tech-details {
  margin: 0;
}

/* "Technical details for advanced users" collapsible.
   The site convention: every page leads with plain-language copy in the
   first screen, then offers an expandable block with the standards talk
   (PAdES, CMS PKCS#7, RFC 3161, eIDAS Article 26, etc.). Use this
   component everywhere those details live — never inline raw <details>. */
.tech-details {
  margin: var(--space-4) 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--rd-md);
  background: #fbfaf7;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--muted);
}

.tech-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 720;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
  user-select: none;
}

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

.tech-details > summary::before {
  content: "+";
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

.tech-details[open] > summary::before { content: "−"; }

.tech-details > summary:hover { background: rgba(18, 106, 90, 0.04); }

.tech-details > .tech-details-body {
  padding: 4px 16px 14px;
  border-top: 1px dashed var(--line);
}

.tech-details > .tech-details-body > *:first-child { margin-top: 12px; }
.tech-details > .tech-details-body > *:last-child { margin-bottom: 0; }

.tech-details p,
.tech-details ul,
.tech-details ol {
  margin: 0 0 10px;
  line-height: var(--lh-relaxed);
}

.tech-details ul,
.tech-details ol { padding-left: 22px; }

.tech-details li { margin-bottom: 4px; }

.tech-details h4 {
  margin: 14px 0 4px;
  font-size: var(--fs-sm);
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.tech-details strong { color: var(--ink); }

/* Inline "tech aside" — short technical clarifier rendered as muted italics
   right under a layman bullet (no collapse, but visually de-emphasised). */
.tech-note {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--muted);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.field-hint {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff4dc;
  color: #5b3a00;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 720;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-block;
  width: 34px;
  height: 34px;
  vertical-align: middle;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 48px;
  align-items: start;
  padding: 56px 0 32px;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.lede {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.signing-panel {
  position: sticky;
  top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
  align-self: start;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 525px;
  padding: 32px;
  border: 1px dashed #b8b0a2;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #edf8f4;
}

.dropzone.has-preview {
  padding: 18px;
  cursor: default;
  background: #fbfaf7;
}

.dropzone-empty {
  display: grid;
  place-items: center;
  width: 100%;
}

.dropzone-preview {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}

#pdf-preview {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(34, 29, 22, 0.08);
}

.dropzone-preview-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 96px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--red);
  font-size: 18px;
  font-weight: 800;
}

.dropzone p,
.bands p,
.receipt p {
  color: var(--muted);
  line-height: 1.55;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button.secondary {
  border-color: #bfd7d1;
  color: var(--accent);
}

.button.ghost {
  background: transparent;
}

.button.wide {
  width: 100%;
}

.button.with-substep {
  flex-direction: column;
  gap: 2px;
  min-height: 60px;
  padding: 10px 16px;
}

.button-label {
  font-size: 15px;
}

.button-substep {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.82;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ceremony {
  padding: 20px;
}

.file-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.hash-box {
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.hash-box dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hash-box dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 13px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
}

.checkbox {
  grid-template-columns: 20px 1fr;
  align-items: start;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.checkbox input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

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

.status {
  color: var(--muted);
  font-size: 13px;
}

.receipt {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid #bed5c8;
  border-radius: 10px;
  background: #f1faf4;
}

.receipt h2 {
  margin-bottom: 6px;
}

.receipt-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 18px;
}

.receipt-facts > div {
  display: grid;
  gap: 4px;
}

.receipt-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.receipt-facts dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.receipt-facts-hash dd {
  font-family: var(--font-mono);
  font-size: 12px;
}

#receipt-fingerprint-ip {
  white-space: pre-wrap;
}

.receipt-facts-more {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.receipt-facts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 16px;
  padding: 4px 0;
  background: transparent;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.receipt-facts-toggle::after {
  content: "▼";
  font-size: 9px;
}

.receipt-facts-toggle[aria-expanded="true"]::after {
  content: "▲";
}

/* Primary row: a single full-width button (uses .button.wide for 100%). */
.receipt-actions {
  display: block;
}

.receipt-actions .button {
  width: 100%;
}

/* Secondary row: the timestamp-proof download. */
.receipt-actions-secondary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.receipt-actions-secondary .button {
  width: 100%;
}

/* Note explaining the evidence JSON now lives inside the signed PDF. */
.receipt-evidence-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.receipt-evidence-note code {
  font-size: 12px;
}

.receipt-next {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid #cfe5db;
  border-radius: 8px;
  background: #fbfdfc;
}

.receipt-next h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.receipt-next p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.receipt-next p:last-child {
  margin-bottom: 0;
}

.receipt-next-why {
  color: var(--muted) !important;
  font-size: 12.5px !important;
  font-style: italic;
}

.status-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--line);
  color: var(--muted);
  vertical-align: middle;
}

.status-badge[data-status="pending"] {
  background: #fef3c7;
  color: #78350f;
}

.status-badge[data-status="confirmed"] {
  background: #d1fae5;
  color: #065f46;
}

.status-badge[data-status="deferred"] {
  background: #fee2e2;
  color: #991b1b;
}

.receipt-ots-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.receipt-ots-detail-grid > div {
  display: grid;
  gap: 2px;
}

.receipt-ots-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.receipt-ots-detail-grid code {
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
  background: transparent;
  padding: 0;
}

.button.ghost.disabled,
.button.ghost[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.claims {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 16px 0 8px;
}

.claims article {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Inside the hero copy column, claims become a flat vertical list of
   plain text rows — no card boxes, no inter-card borders. Each claim is
   one short paragraph with the bold "✕ NO X" inline. */
.hero-copy .claims {
  display: block;
  padding: 24px 0 0;
}

.hero-copy .claims article {
  display: block;
  border-top: none;
  padding: 0;
  margin: 0 0 14px;
  gap: 0;
}

.hero-copy .claims article:last-child {
  margin-bottom: 0;
}

.hero-copy .claim-not {
  display: inline;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.hero-copy .claim-not::after {
  content: " — ";
  color: var(--muted);
  font-weight: 500;
}

.hero-copy .claim-yes {
  display: inline;
  font-size: 13.5px;
  line-height: 1.55;
}

.claim-not {
  margin: 0;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink);
}

.claim-not::before {
  content: "✕ ";
  color: #b91c1c;
  font-weight: 800;
  margin-right: 2px;
}

.claim-yes {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.compliance {
  padding: 28px 0 24px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.compliance-header {
  max-width: 720px;
  margin-bottom: 18px;
}

.compliance-header h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 6px 0 0;
}

.compliance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.compliance-grid article {
  background: var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.compliance-tag {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.compliance-grid h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.compliance-grid p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.compliance-footnote {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.compare-callout {
  padding: 32px 0 24px;
  border-top: 1px solid var(--line);
}

.compare-callout-header {
  max-width: 720px;
  margin-bottom: 20px;
}

.compare-callout-header h2 {
  font-size: 26px;
  line-height: 1.2;
  margin: 6px 0 10px;
}

.compare-callout-lede {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.compare-callout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 18px;
}

.compare-callout-grid article {
  background: var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.compare-callout-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.compare-callout-grid ul {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.compare-callout-grid li {
  margin-bottom: 8px;
}

.compare-callout-grid li:last-child {
  margin-bottom: 0;
}

.compare-callout-cta {
  margin: 18px 0 0;
  font-size: 14px;
}

.compare-callout-cta a {
  color: var(--accent);
  font-weight: 720;
  border-bottom: 1px solid var(--accent);
}

/* The /compare/, /guides/, /faq, /imprint long-form pages use these
   atoms plus the page-specific rules in /content.css. Don't add new
   compare-/guide-/faq- selectors here — they go in content.css. */
.site-footer {
  margin: 96px 0 32px;
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 700;
}
.site-footer-grid p {
  margin: 0 0 4px;
  line-height: 1.5;
}
.site-footer-grid nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.site-footer-grid nav a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.site-footer-grid nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}
.site-footer-grid nav a[aria-current="page"] {
  color: var(--accent);
}
.site-footer-fineprint {
  margin: 24px 0 0;
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 22, 21, 0.55);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(34, 29, 22, 0.22);
}

.modal-step {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-lede {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-email {
  color: var(--ink);
  font-weight: 720;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* "How it works" → architecture diagram modal. The diagram fills a large
   card; architecture-modal.js fetches /architecture and injects it into a
   shadow root inside #arch-modal-body. */
.how-diagram-cta {
  margin: 14px 0 0;
}

.arch-modal-card {
  width: min(1400px, calc(100vw - 32px));
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  display: flex;
}

.arch-modal-body {
  flex: 1;
  min-width: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.arch-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.arch-modal-close:hover {
  background: var(--line);
}

.arch-modal-loading {
  margin: 0;
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}

.turnstile-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.turnstile-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#turnstile-container {
  min-height: 65px;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 22px, 720px);
  }

  .topbar {
    align-items: flex-start;
    padding-top: 16px;
  }

  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 32px;
  }

  .dropzone {
    min-height: 390px;
    padding: 24px;
  }

  .bands {
    grid-template-columns: 1fr;
  }

  .claims {
    grid-template-columns: 1fr;
  }

  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .compare-callout-grid {
    grid-template-columns: 1fr;
  }

  .file-summary {
    flex-direction: column;
  }
}
