/* Older variable names, kept so every existing component follows the tokens in
   tokens.css (loaded first). New code uses the token names directly. */
:root {
  --bg-soft: var(--surface-2);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --line: var(--border);
  --line-soft: var(--border);
  --muted: var(--text-2);
  --dim: var(--text-3);
  --accent: var(--action);
  --accent-soft: var(--action-soft);
  --radius: var(--radius-md);
  --mono: var(--font-mono);
  --header-bg: color-mix(in srgb, var(--bg) 92%, transparent);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }

/* One visible focus ring for everything a keyboard can reach, in both themes. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: var(--focus-ring); outline-offset: var(--focus-offset);
}
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--line-soft);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
header.site .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--action);
  display: grid; place-items: center; font-size: var(--text-sm); font-weight: 800; color: var(--on-action);
}
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- language toggle ---------- */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang button {
  background: transparent; border: 0; color: var(--muted); padding: 5px 11px;
  font-size: var(--text-xs); font-weight: 600; cursor: pointer; letter-spacing: 0.04em;
}
.lang button.active { background: var(--panel-2); color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--btn-radius); border: 1px solid var(--btn-secondary-border); background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text); min-height: var(--btn-height); padding: 0 16px; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: 1.2;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, opacity var(--dur-fast) ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(var(--btn-press-scale)); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--surface-2); }
  .btn.primary:hover:not(:disabled) { background: var(--btn-primary-bg-hover); border-color: var(--btn-primary-bg-hover); }
  .btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 10%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .btn:active:not(:disabled) { transform: none; } }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { border-color: var(--btn-danger-border); color: var(--btn-danger-text); background: transparent; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: var(--text-sm); }
@media (pointer: coarse) { .btn.sm { min-height: 40px; } }
.btn.block { width: 100%; }

/* ---------- forms ---------- */
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; background: var(--input-bg); border: 1px solid var(--input-border);
  color: var(--text); border-radius: var(--input-radius); padding: 10px 13px;
  font-family: inherit; font-size: var(--text-sm); line-height: 1.5;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: var(--focus-ring); outline-offset: 0; border-color: var(--focus);
}
label { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }

/* ---------- public site nav ---------- */
.site-nav { display: flex; gap: 20px; margin-left: 8px; flex: 1; }
.site-nav a { color: var(--muted); font-size: var(--text-sm); font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.lang a {
  background: transparent; border: 0; color: var(--muted); padding: 5px 11px;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; display: inline-block;
}
.lang a:hover { text-decoration: none; color: var(--text); }
.lang a.active { background: var(--panel-2); color: var(--text); }

/* ---------- landing ---------- */
.lead { font-size: var(--text-lg); color: var(--muted); max-width: 68ch; }
.start-h { font-size: var(--text-md); margin: 0 0 4px; }

/* Extractable "direct answer" paragraph — what AI assistants tend to quote. */
.answer {
  font-size: var(--text-md); line-height: 1.65; color: var(--text);
  border-left: 3px solid var(--accent); padding-left: 18px; margin: 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps h3, .grid-2 h3 { margin: 0 0 8px; font-size: var(--text-md); }
.prose-narrow { max-width: 760px; }
.cta-block { text-align: left; }
.fine { color: var(--dim); font-size: var(--text-sm); max-width: 68ch; }

/* Visible to a screen reader, not on screen. The comparison table needs a
   header on its first column for the row headers to make sense when read
   aloud, but showing it would clutter the design. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}


/* ---------- comparison: form-filling vs interview ---------- */
.compare-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
}
.compare-table thead th {
  font-size: var(--text-xs); letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim); border-bottom: 1px solid var(--line);
}
.compare-table tbody th {
  font-weight: 600; color: var(--text); width: 150px; white-space: nowrap;
}
.compare-table td { color: var(--muted); }
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: 0; }

/* Our column is tinted rather than bolded: the point is made by the content,
   and shouting it would undercut the honest framing above the table. */
.compare-table .cmp-ours {
  background: var(--bg-soft);
  color: var(--text);
  border-left: 2px solid var(--accent);
}
.compare-table thead .cmp-ours { color: var(--accent); font-weight: 700; }

/* ---------- time saved: table + calculator ---------- */

/* Six columns do not fit a phone. The table scrolls inside its own box so the
   page body never scrolls sideways. */
.table-scroll { overflow-x: auto; margin: 26px 0 22px; -webkit-overflow-scrolling: touch; }

.savings-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.savings-table th, .savings-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.savings-table thead th {
  font-size: var(--text-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.savings-table tbody th { font-weight: 600; }
.savings-table tbody tr:last-child th,
.savings-table tbody tr:last-child td { border-bottom: 0; }

.sv-name { display: block; color: var(--text); }
.sv-detail { display: block; margin-top: 3px; font-size: var(--text-xs); font-weight: 400; color: var(--dim); }
.sv-saved { font-weight: 700; color: var(--ok); white-space: nowrap; }

.calc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
}
.calc h3 { margin: 0 0 6px; font-size: var(--text-md); }
.calc > p { margin: 0 0 18px; font-size: var(--text-sm); color: var(--muted); }

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.calc-inputs .field { position: relative; margin: 0; }
.calc-unit {
  position: absolute; right: 12px; bottom: 11px;
  font-size: var(--text-xs); color: var(--dim); pointer-events: none;
}
/* Room for the unit suffix, so a four-digit rate cannot run underneath it. */
#calcRate { padding-right: 62px; }

.calc-out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.calc-out dt {
  font-size: var(--text-xs); letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 5px;
}
.calc-out dd { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--text); }
.calc-headline dd { color: var(--ok); }

/* ---------- corporate intake checklist ---------- */
.intake {
  list-style: none;
  counter-reset: intake;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.intake-block {
  counter-increment: intake;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 16px;
}

.intake-block h3 {
  margin: 0 0 12px;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  gap: 10px;
}

.intake-block h3::before {
  content: counter(intake);
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-action);
  font-size: var(--text-xs); font-weight: 700;
}

.intake-block ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--text-sm); }
.intake-block li { margin-bottom: 7px; line-height: 1.55; }

/* Next step in the ladder, shown inside the paid panel. */
.chain-next {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.chain-next h4 { margin: 0 0 6px; font-size: var(--text-sm); }
.chain-next p { margin: 0 0 12px; font-size: var(--text-sm); color: var(--muted); line-height: 1.55; }

/* ---------- document ladder ---------- */
/* Brief -> Charter -> PID -> Plan. Four columns on a desk, stacked on a phone;
   the connector arrow is drawn with a pseudo-element so it disappears together
   with the horizontal layout instead of pointing sideways into nothing. */
.ladder {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  counter-reset: ladder;
}

.ladder-step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 16px 14px;
}

/* The brief is the visitor's own input, not something we sell. */
.ladder-step.is-input {
  background: var(--bg-soft);
  border-style: dashed;
}

.ladder-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-action);
  font-size: var(--text-xs); font-weight: 700;
  margin-bottom: 10px;
}
.ladder-step.is-input .ladder-n { background: var(--dim); }

.ladder-kind { display: block; font-weight: 700; font-size: var(--text-md); color: var(--text); }
.ladder-role {
  display: block; margin-top: 2px;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
}
.ladder-step.is-input .ladder-role { color: var(--dim); }
.ladder-step p { margin: 8px 0 0; font-size: var(--text-sm); color: var(--muted); line-height: 1.55; }

/* Download link inside a ladder step. Pinned to the bottom so the three links
   line up even when the descriptions differ in length. */
.ladder-step { display: flex; flex-direction: column; }
.ladder-sample {
  margin-top: auto;
  padding-top: 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
/* The arrow itself, not a CSS escape: "\2193" is one backslash away from
   rendering as literal text, and it did. */
.ladder-sample::before { content: "↓"; font-weight: 700; }
.ladder-sample-meta { font-size: var(--text-xs); font-weight: 400; color: var(--dim); }

/* ---------- sample documents ---------- */
.sample-grid { margin-top: 26px; align-items: stretch; }
.sample-doc { display: flex; flex-direction: column; }
.sample-doc h3 { margin: 0 0 4px; font-size: var(--text-md); }
.sample-doc .sample-meta {
  margin: 0 0 10px; font-size: var(--text-xs); letter-spacing: .03em;
  text-transform: uppercase; color: var(--dim);
}
.sample-doc p { font-size: var(--text-sm); color: var(--muted); line-height: 1.55; }
.sample-doc .btn { margin-top: auto; align-self: flex-start; }

@media (min-width: 1000px) {
  .ladder-step + .ladder-step::before {
    content: "";
    position: absolute;
    left: -11px; top: 50%;
    width: 8px; height: 8px;
    border-top: 1.5px solid var(--line);
    border-right: 1.5px solid var(--line);
    transform: translateY(-50%) rotate(45deg);
  }
}

/* ---------- pricing ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.pricing-secondary { margin-bottom: 20px; }
.pricing-grid { margin: 28px 0 20px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* var(--text), not #fff: a hardcoded white amount is invisible on the light
   theme's white card. */
.price { font-size: var(--text-xl); font-weight: 700; margin: 0 0 14px; color: var(--text); }
.ticks { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.ticks li { padding-left: 22px; position: relative; margin-bottom: 8px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 6px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}

/* ---------- articles ---------- */
.article-grid { margin-top: 26px; }
.article-card h2 { font-size: var(--text-lg); margin: 0 0 8px; line-height: 1.3; }
.article-card h2 a { color: var(--text); }
.article-card .meta, .article .meta { color: var(--dim); font-size: var(--text-xs); }
.crumbs { font-size: var(--text-sm); margin-bottom: 14px; }
.article h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 8px; }
.toc {
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px 20px; margin: 26px 0; background: var(--bg-soft);
}
.toc h2 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: var(--text-sm); }
.toc li { margin-bottom: 4px; }

.article-body { font-size: var(--text-md); line-height: 1.75; }
.article-body h2 {
  font-size: var(--text-xl); margin: 40px 0 12px; letter-spacing: -0.015em;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 80px;
}
.article-body h3 { font-size: var(--text-lg); margin: 28px 0 8px; scroll-margin-top: 80px; }
.article-body p { margin: 0 0 16px; color: var(--text); }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; color: var(--text); }
.article-body li { margin-bottom: 7px; }
.article-body strong { color: var(--text); }
.article-body a.anchor { float: left; margin-left: -20px; width: 20px; opacity: 0; }
.article-body h2:hover a.anchor, .article-body h3:hover a.anchor { opacity: 1; }
.article-body a.anchor::before { content: "#"; color: var(--accent); }
.article-body blockquote {
  margin: 22px 0; padding: 14px 18px; border-left: 3px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--text); border-radius: 0 8px 8px 0;
}
.article-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0 24px; font-size: var(--text-sm); display: block;
  overflow-x: auto;
}
.article-body th, .article-body td {
  border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top;
}
.article-body th { background: var(--panel-2); color: var(--text); font-weight: 600; white-space: nowrap; }
.article-body hr { border: none; border-top: 1px solid var(--line-soft); margin: 32px 0; }

.cta-inline {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; margin: 40px 0 26px; background: var(--panel);
}
.cta-inline h2 { margin: 0 0 6px; font-size: var(--text-lg); border: 0; padding: 0; }
.cta-inline p { color: var(--muted); margin: 0 0 16px; }

/* ---------- faq ---------- */
.faq { margin: 24px 0 32px; }
.faq-item { border-top: 1px solid var(--line-soft); padding: 20px 0; }
.faq-item h2, .faq-item h3 { font-size: var(--text-md); margin: 0 0 8px; line-height: 1.35; }
.faq-item p { color: var(--muted); margin: 0; }


.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px;
}
.card h4 { margin: 0 0 8px; font-size: var(--text-md); }
.card p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.step-n {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft);
  color: var(--action-soft-text); display: grid; place-items: center; font-size: var(--text-sm); font-weight: 700; margin-bottom: 12px;
}
section.block { padding: 52px 0; border-top: 1px solid var(--line-soft); }
section.block h2 { font-size: var(--text-xl); margin: 0 0 8px; letter-spacing: -0.02em; }
section.block .sub { color: var(--muted); margin: 0 0 28px; }

footer.site {
  border-top: 1px solid var(--line-soft); padding: 40px 0 48px;
  color: var(--dim); font-size: var(--text-sm); margin-top: 40px;
}
footer.site .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-grid {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr));
  gap: 32px; margin-bottom: 30px;
}
.footer-grid h6 {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 10px; font-weight: 700;
}
.footer-grid a { display: block; color: var(--dim); margin-bottom: 7px; }
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-grid .brand { margin-bottom: 10px; }
.footer-grid .brand a { display: inline; }
.footer-tagline { max-width: 42ch; margin: 0; color: var(--dim); }
.footer-legal { border-top: 1px solid var(--line-soft); padding-top: 18px; margin: 0; font-size: var(--text-xs); }
.footer-marks { margin-top: 6px; border-top: 0; padding-top: 0; }

.msg { max-width: 780px; margin: 0 auto 18px; display: flex; gap: 12px; }
.msg .avatar {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: grid; place-items: center; font-size: var(--text-xs); font-weight: 800;
}
.msg.user .avatar { background: var(--panel-2); color: var(--muted); }
.msg.assistant .avatar { background: var(--action-soft); color: var(--action-soft-text); }
.msg .body { min-width: 0; }
.msg .who { font-size: var(--text-xs); font-weight: 700; color: var(--dim); margin-bottom: 3px; letter-spacing: .04em; }
.msg .content { word-wrap: break-word; }
.msg .content strong { color: var(--text); }

.preview-inner { max-width: 840px; margin: 0 auto; }
.preview-page {
  width: 100%; display: block; border-radius: 6px; margin: 0 auto 18px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5); background: #fff;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.preview-page.locked { filter: blur(2px) saturate(.5); opacity: .82; }

.paywall {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; max-width: 520px; margin: 0 auto 24px; text-align: center;
}
.paywall h3 { margin: 0 0 6px; font-size: var(--text-lg); }
.paywall p { color: var(--muted); font-size: var(--text-sm); margin: 0 0 16px; }
.paywall ul { text-align: left; color: var(--muted); font-size: var(--text-sm); margin: 0 0 18px; padding-left: 20px; }

.downloads { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- misc ---------- */
.notice {
  border-radius: 8px; padding: 11px 14px; font-size: var(--text-sm); margin-bottom: 14px;
  border: 1px solid var(--line);
}
.notice.info { background: var(--action-soft); border-color: color-mix(in srgb, var(--action) 35%, transparent); color: var(--text); }
.notice.warn { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--text); }
.notice.ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--text); }
.notice.err { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--text); }

.empty { text-align: center; color: var(--dim); padding: 60px 20px; max-width: 460px; margin: 0 auto; }

.spinner {
  width: 15px; height: 15px; border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }


.hidden { display: none !important; }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
}

@media (max-width: 820px) {

  .site-nav { display: none; }
  header.site .inner { height: 58px; }
  .wrap { padding: 0 18px; }
}

/* ---------------------------------------------------------------- generation progress ring */

.genprogress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 48px 20px;
  text-align: center;
}

.genring {
  --pct: 0;
  position: relative;
  width: 148px;
  height: 148px;
}

.genring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }

.genring .track { fill: none; stroke: var(--line); stroke-width: 8; }

.genring .bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  /* r=66 -> circumference 414.7 */
  stroke-dasharray: 414.7;
  stroke-dashoffset: calc(414.7 - (414.7 * var(--pct) / 100));
  transition: stroke-dashoffset .45s cubic-bezier(.4, 0, .2, 1);
}

.genring .halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  opacity: .16;
  stroke-linecap: round;
  stroke-dasharray: 40 374.7;
  transform-origin: 50% 50%;
  animation: genspin 1.9s linear infinite;
}

@keyframes genspin { to { transform: rotate(360deg); } }

.genring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.genring-pct {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.genring-state {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.genprogress-phase { font-size: var(--text-sm); color: var(--muted); max-width: 340px; margin: 0; }

.genprogress-hint { font-size: var(--text-xs); color: var(--dim); max-width: 340px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .genring .halo { animation: none; }
  .genring .bar { transition: none; }
}

/* ---------------------------------------------------------------- homepage visuals */

/* --- step cards --- */

.step-card { position: relative; padding-top: 22px; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.step-icon { width: 21px; height: 21px; }

.step-card .step-n {
  position: absolute;
  top: 16px; right: 18px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--dim);
}


/* ==================================================================
   LIGHT THEME
   Dark stays the default in :root above, so the site still renders
   correctly if JavaScript never runs. An explicit data-theme on <html>
   switches palettes; the head script sets it from the stored choice, or
   from the visitor's OS preference on a first visit.
   ================================================================== */

/* The light palette lives in tokens.css. Only things that are not colours stay here. */
:root[data-theme="light"] .card { box-shadow: var(--shadow-md); }



/* --- the toggle itself --- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.theme-toggle:hover { background: var(--panel-2); color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; }

/* Show the icon for the theme you would switch TO, not the current one. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-moon { display: none; }
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* Price note sits directly under the amount, so the "incl. btw" qualifier is
   never separated from the number it qualifies. */
.price-note {
  margin: -10px 0 14px;
  font-size: var(--text-xs);
  color: var(--dim);
}

.price-card.featured { border-color: var(--accent); }

/* ---------------------------------------------------------------- sample */

.sample-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.sample-card h2 { margin: 0 0 8px; }
.sample-card p { margin: 0; color: var(--muted); max-width: 62ch; }
.sample-card > div:first-child { flex: 1 1 340px; }

@media (max-width: 760px) {
  .sample-card { grid-template-columns: 1fr; }
  .sample-visual { display: none; }
}


/* One optional question after download, inside the paid panel. */
.feedback-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feedback-row input { width: 96px; flex: 0 0 auto; }

.review-ticks { margin-top: 18px; font-size: var(--text-md); }

.review-notice { max-width: 860px; }
.review-notice:empty { display: none; }
.review-notice .notice { margin-bottom: 16px; }

.review-sub { color: var(--muted); font-size: var(--text-sm); margin: 0 0 16px; }

.review-start, .review-offer, .review-improve { margin-bottom: 18px; }
.review-start h3, .review-offer h3, .review-improve h3 { margin: 0 0 8px; font-size: var(--text-md); }
.review-start p, .review-offer > p, .review-improve p { color: var(--muted); font-size: var(--text-sm); }
.review-start .notice { margin-bottom: 12px; }
.review-offer { border-color: var(--accent); }
.review-offer .ticks { margin: 4px 0 16px; }
.review-offer .fine { margin: 12px 0 0; }

.review-result { margin-bottom: 22px; }
.review-result.muted { opacity: .78; }
.review-result-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.review-result-head h3 { margin: 0 0 4px; font-size: var(--text-lg); }
.review-result-head .review-sub { margin: 0; }
.review-summary {
  font-size: var(--text-sm); line-height: 1.65; color: var(--text);
  border-left: 3px solid var(--accent); padding-left: 14px; margin: 0 0 18px;
}

.rag-counts { display: flex; gap: 8px; }
.rag-pill, .rag-badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid; font-weight: 700; white-space: nowrap;
}
.rag-pill { padding: 3px 11px; font-size: var(--text-xs); }
.rag-badge { padding: 2px 9px; font-size: var(--text-xs); letter-spacing: .05em; text-transform: uppercase; }
.rag-pill.red, .rag-badge.red {
  color: var(--danger); border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 11%, transparent);
}
.rag-pill.amber, .rag-badge.amber {
  color: var(--warn); border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 11%, transparent);
}

.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.finding {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 8px; padding: 14px 16px;
}
.finding.red { border-left-color: var(--danger); }
.finding.amber { border-left-color: var(--warn); }
.finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.finding-cat { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.finding-section { font-size: var(--text-xs); color: var(--dim); }
.finding-section::before { content: "· "; }
.finding-text { margin: 0 0 8px; font-size: var(--text-sm); line-height: 1.55; color: var(--text); }
.finding-meta { margin: 0 0 6px; font-size: var(--text-sm); line-height: 1.55; color: var(--muted); }
.finding-meta strong { color: var(--text); font-weight: 600; }
.finding-meta.advice { margin-bottom: 0; }

/* ================================================================ dossier workspace (app.html, phase 3.2)
   The layout chosen from the phase-2 prototypes: one page per chain of
   documents, the interview and the document as panels. Tokens only. */

.dz-body { min-height: 100vh; }
.dz-body.dz-locked { overflow: hidden; }
.dz-grow { flex: 1; min-width: 0; }
.dz-muted { color: var(--text-3); font-size: var(--text-sm); margin: 0; }
.dz-warn { color: var(--warn); font-size: var(--text-sm); margin: var(--space-3) 0 0; }
.dz-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.dz-hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0 var(--space-4); }
.dz-link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-semi); cursor: pointer; }
.dz-link:hover { text-decoration: underline; }
.dz-hide-lg { display: none; }

/* ---- header */
.dz-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.dz-top .brand { flex: none; }
.dz-top .theme-toggle { width: 40px; height: 40px; }
.dz-switcher, .dz-account { position: relative; min-width: 0; }
.dz-switch-btn {
  display: flex; align-items: center; gap: var(--space-2); max-width: min(420px, 100%);
  min-height: 44px; padding: 4px var(--space-3); text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.dz-switch-btn svg { width: 14px; height: 14px; flex: none; color: var(--text-3); }
.dz-switch-text { display: grid; min-width: 0; }
.dz-switch-name { font-weight: var(--weight-semi); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-switch-doc { font-size: var(--text-xs); color: var(--text-3); }
#switchStatus { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-xs); white-space: nowrap; overflow: hidden; }
#switchStatus .dz-status { font-size: var(--text-xs); }
.dz-account-btn {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: var(--action-soft); color: var(--action-soft-text); border: 1px solid var(--border);
  font-weight: var(--weight-bold); font-size: var(--text-sm);
}

.dz-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 300px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: var(--space-2);
  transform-origin: top left;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
@starting-style { .dz-menu { opacity: 0; transform: scale(.97); } }
.dz-menu-right { left: auto; right: 0; transform-origin: top right; min-width: 260px; }
.dz-menu > button, .dz-menu > a {
  display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; color: var(--text);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: var(--text-sm);
}
.dz-menu > button:hover, .dz-menu > a:hover { background: var(--surface-2); text-decoration: none; }
.dz-menu > button[aria-current="true"] { background: var(--action-soft); }
.dz-menu hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-2) 0; }
.dz-menu-head { margin: var(--space-1) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.dz-menu-name { font-weight: var(--weight-semi); }
.dz-menu-sub { font-size: var(--text-xs); color: var(--text-3); display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.dz-menu-sub .dz-status { font-size: var(--text-xs); }
.dz-menu-email { margin: var(--space-1) var(--space-3) var(--space-2); font-size: var(--text-sm); color: var(--text-2); overflow-wrap: anywhere; }
.dz-menu-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }
.dz-menu .lang button { min-height: 32px; }

/* ---- status in words */
.dz-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: var(--weight-semi); white-space: nowrap; }
.dz-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dz-status.st-interview { color: var(--text-2); }
.dz-status.st-ready { color: var(--warn); }
.dz-status.st-concept { color: var(--action-soft-text); }
.dz-status.st-paid { color: var(--ok); }

/* ---- page */
.dz-main { min-width: 0; }
.dz-page, .dz-welcome { max-width: 1080px; margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); }
/* Questionnaires per stakeholder: a card on the dossier and a reading drawer. */
.dz-q-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.dz-q-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
#qCard .dz-q-back { font-size: var(--text-sm); margin: 0 0 var(--space-4); }
#qDrawerBody .dz-q-back { font-size: var(--text-sm); margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.dz-q-actions { margin-bottom: var(--space-4); }
.dz-q-intro { margin: 0 0 var(--space-4); color: var(--text); }
.dz-q-topic { font-size: var(--text-md); margin: var(--space-5) 0 var(--space-2); }
.dz-q-questions { margin: 0; padding-left: 1.4em; display: grid; gap: var(--space-3); }
.dz-q-question { display: block; color: var(--text); }
.dz-q-why { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--text-3); }
#qDrawer { width: min(max(520px, 46vw), 780px, 100vw); grid-template-rows: auto minmax(0, 1fr); }

/* Demo copy of the sample project: what it is, what is left, the way out. */
.dz-demo {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5);
  background: var(--action-soft); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.dz-demo strong { display: block; color: var(--action-soft-text); }
.dz-demo p { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text); max-width: 70ch; }
.dz-title { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.dz-title h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin: 0; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dz-title p { margin: var(--space-1) 0 0; color: var(--text-2); font-size: var(--text-sm); }
#dossierNotice:empty { display: none; }
#dossierNotice .notice { margin-bottom: var(--space-4); }

.dz-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.dz-doc { position: relative; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.dz-doc h2 { font-size: var(--text-lg); margin: 0; }
.dz-doc p { margin: 0; font-size: var(--text-sm); color: var(--text-2); }
.dz-doc .dz-muted { color: var(--text-3); }
.dz-doc-k { font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.dz-doc-line { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
.dz-doc-acts { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-2); }
.dz-doc.current { border-color: var(--action); box-shadow: 0 0 0 1px var(--action), var(--card-shadow); }
.dz-doc.later { background: transparent; border-style: dashed; box-shadow: none; }
.dz-doc.next { border-style: dashed; border-color: var(--action); }
@media (min-width: 901px) {
  .dz-doc + .dz-doc::before {
    content: ""; position: absolute; left: -13px; top: 50%; width: 8px; height: 8px;
    border-top: 1.5px solid var(--border-input); border-right: 1.5px solid var(--border-input);
    transform: translateY(-50%) rotate(45deg);
  }
}
.dz-meter { height: 6px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; }
.dz-meter > span { display: block; height: 100%; background: var(--action); transform-origin: left; transition: transform var(--dur-base) var(--ease-out); }
.dz-meter.done > span { background: var(--ok); }

.dz-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.dz-stack { display: grid; gap: var(--space-5); }
.dz-card { padding: var(--space-5); }
.dz-card:focus { outline: none; }
.dz-card:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.dz-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.dz-card-head h3 { font-size: var(--text-md); margin: 0; }
.dz-card-foot { margin: var(--space-4) 0 0; }
.dz-stale { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm); color: var(--text); background: var(--action-soft); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.dz-open-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.dz-open-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3); background: var(--surface); display: grid; gap: 4px; }
.dz-open-area { font-weight: var(--weight-semi); font-size: var(--text-sm); }
.dz-open-what { font-size: var(--text-sm); color: var(--text-2); }
.dz-open-who { font-size: var(--text-xs); color: var(--text-3); margin-bottom: var(--space-1); }
.dz-last { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.msg.compact { margin: 0; gap: var(--space-2); }
.msg.compact .avatar { width: 26px; height: 26px; }
.msg.compact .content { font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.dz-files { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.dz-files li { display: flex; justify-content: space-between; gap: var(--space-3); }
.dz-files li span:first-child { overflow-wrap: anywhere; }
.dz-retention { margin: var(--space-6) 0 0; font-size: var(--text-xs); color: var(--text-3); }

/* ---- welcome */
.dz-welcome { max-width: 760px; }
.dz-welcome h1 { font-size: var(--text-2xl); margin: 0 0 var(--space-2); letter-spacing: -0.01em; }
.dz-lead { color: var(--text-2); margin: 0 0 var(--space-6); }
.dz-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.dz-type {
  display: grid; gap: 4px; align-content: start; text-align: left; cursor: pointer;
  padding: var(--space-4); border: 1px solid var(--border-input); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-press) var(--ease-out);
}
.dz-type:active { transform: scale(var(--btn-press-scale)); }
.dz-type[aria-pressed="true"] { border-color: var(--action); box-shadow: 0 0 0 1px var(--action); background: var(--action-soft); }
.dz-type-n { font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-3); }
.dz-type-d { font-size: var(--text-sm); color: var(--text-2); }
.dz-label { display: block; font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text); margin-bottom: 6px; }
.field label { color: var(--text); font-size: var(--text-sm); }
.dz-optional { color: var(--text-3); font-weight: var(--weight-regular); }
.dz-drop {
  position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer;
  padding: var(--space-6) var(--space-4); border: 1.5px dashed var(--border-input); border-radius: var(--radius-md);
  background: var(--surface-2); color: var(--text); font-weight: var(--weight-regular); margin: 0;
}
.dz-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-drop:focus-within { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.dz-drop.over { border-color: var(--action); background: var(--action-soft); }
.dz-drop.has-file { border-style: solid; border-color: var(--ok); }
.dz-drop span { font-size: var(--text-sm); color: var(--text-3); }
.dz-free { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); color: var(--text-2); margin: var(--space-4) 0 var(--space-5); }
.dz-free svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 2px; }
.dz-free strong { color: var(--text); }
#welcomeNotice:empty { display: none; }

/* ---- panels */
.dz-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(8, 12, 18, .4); opacity: 0; pointer-events: none; transition: opacity var(--dur-base) ease; }
.dz-scrim.open { opacity: 1; pointer-events: auto; }
.dz-drawer {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform var(--dur-drawer) var(--ease-drawer);
}
.dz-drawer.open { transform: none; }
.dz-drawer[hidden] { display: none; }
.dz-drawer-wide { width: min(760px, 100vw); grid-template-rows: auto minmax(0, 1fr); }
#settingsDrawer { grid-template-rows: auto minmax(0, 1fr); }
/* The conversation is the main workspace during the interview: wider than the
   other drawers, up to about half the screen. */
#chatDrawer { width: min(max(520px, 46vw), 780px, 100vw); }

/* Background work, always in view: above drawers and the scrim. */
/* Bottom left, over the dossier: never over the chat input on the right. On a
   phone the chat fills the screen, so there it sits at the top. */
.dz-busy {
  position: fixed; z-index: 60; left: var(--space-5); bottom: var(--space-5);
  display: flex; align-items: center; gap: var(--space-3); max-width: min(560px, calc(100vw - 32px));
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: var(--text-sm); color: var(--text-2);
  animation: busy-in 200ms var(--ease-out) both;
}
.dz-busy[hidden] { display: none; }
.dz-busy-text { display: grid; gap: 2px; min-width: 0; }
.dz-busy-text strong { color: var(--text); font-weight: 600; }
.dz-busy-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-3); white-space: nowrap; }
@keyframes busy-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .dz-busy { left: var(--space-3); right: var(--space-3); bottom: auto; top: var(--space-3); max-width: none; } }
@media (prefers-reduced-motion: reduce) { .dz-busy { animation: none; } }

/* Chat messages as structure rather than one block of text. */
.msg .content { white-space: normal; }
.msg .content p { margin: 0 0 var(--space-2); }
.msg .content p:last-child, .msg .content ol:last-child, .msg .content ul:last-child { margin-bottom: 0; }
.msg .content ol, .msg .content ul { margin: 0 0 var(--space-3); padding-left: 1.4em; }
.msg .content li { padding-left: 2px; }
.msg .content li + li { margin-top: var(--space-1); }
.msg .content li::marker { color: var(--text-3); font-weight: 600; }
.msg.user .body { background: var(--surface-2); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.dz-typing { display: flex; align-items: center; gap: var(--space-2); color: var(--text-3); }
/* Tables in chat (a RACI, milestones): real rows and columns. The wrapper
   scrolls sideways on its own, so a wide table never widens the drawer. */
/* The short preview on the dossier ("Laatst in het gesprek") is a few lines of
   text; a table there only stretches the card. The drawer shows it in full. */
.msg.compact .chat-table-wrap { display: none; }
.dz-grid > * { min-width: 0; }
.chat-table-wrap { overflow-x: auto; margin: 0 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chat-table-hint { margin: calc(var(--space-2) * -1) 0 var(--space-3); font-size: var(--text-xs); color: var(--text-3); }
.msg.compact .chat-table-hint { display: none; }
.chat-table-wrap:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.chat-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); line-height: var(--leading-snug); }
.chat-table th, .chat-table td { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.chat-table thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.chat-table th, .chat-table td { overflow-wrap: normal; word-break: normal; hyphens: auto; }
.chat-table tbody th { font-weight: 500; color: var(--text); min-width: 180px; }
.chat-table td.short { text-align: center; font-weight: 600; white-space: nowrap; }
.chat-table tbody tr:last-child th, .chat-table tbody tr:last-child td { border-bottom: 0; }
.chat-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.dz-drawer-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.dz-drawer-head h2 { font-size: var(--text-lg); margin: 0 0 2px; }
.dz-drawer-body { overflow-y: auto; padding: var(--space-5); overscroll-behavior: contain; }
.dz-drawer-foot { border-top: 1px solid var(--border); padding: var(--space-3) var(--space-5) var(--space-4); display: grid; gap: var(--space-2); }
.dz-paper-backdrop { background: var(--paper-backdrop); }
.dz-icon-btn {
  width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2);
}
.dz-icon-btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .dz-icon-btn:hover { background: var(--surface-2); color: var(--text); } }
#chatNotice:empty { display: none; }
.dz-chat-state { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-2); }
.dz-chat-state:empty { display: none; }
.dz-composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: end; }
.dz-composer textarea { min-height: 44px; max-height: 180px; resize: none; }
.dz-composer .btn, .dz-composer .dz-icon-btn { height: 44px; }
.dz-composer-hint { font-size: var(--text-xs); color: var(--text-3); }
#chatScroll .msg { margin-bottom: var(--space-5); }
#chatScroll .msg .content { overflow-wrap: anywhere; }

#previewInner { max-width: none; }
#previewInner .paywall { max-width: none; text-align: left; margin: 0 0 var(--space-5); padding: var(--space-5); }
#previewInner .paywall h3 { font-size: var(--text-lg); }
#previewInner .paywall p { margin: 0 0 var(--space-3); }
#previewInner .downloads { justify-content: flex-start; margin-bottom: var(--space-3); }
#previewInner .ticks { margin-bottom: var(--space-4); }
.dz-outline { padding: var(--space-5); }
.dz-outline h3 { margin: 0 0 var(--space-3); font-size: var(--text-md); }
.dz-outline ul { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: 2px; }
.dz-outline li { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.dz-outline li:last-child { border-bottom: 0; }
.dz-preview-note { text-align: center; color: var(--text-3); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.dz-thin { padding: var(--space-5); display: grid; gap: var(--space-3); }
.dz-thin h3 { margin: 0; font-size: var(--text-lg); }
.dz-thin p { margin: 0; color: var(--text-2); font-size: var(--text-sm); }
.dz-thin-list { margin: 0; padding-left: 20px; font-size: var(--text-sm); display: grid; gap: 4px; }

.dz-toast {
  position: fixed; z-index: 60; left: 50%; bottom: var(--space-5); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-size: var(--text-sm); box-shadow: var(--shadow-md);
}
.dz-toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .dz-drawer, .dz-scrim, .dz-menu, .dz-meter > span { transition: none; }
}

/* ---- narrow screens: one column, full-width panels, compact header */
@media (max-width: 900px) {
  .dz-chain, .dz-grid { grid-template-columns: 1fr; }
  .dz-page, .dz-welcome { padding: var(--space-5) var(--space-4) var(--space-7); }
}
@media (max-width: 720px) {
  .dz-top { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .dz-hide-sm { display: none; }
  .dz-hide-lg { display: grid; }
  .dz-switcher { flex: 1; }
  .dz-switch-btn { width: 100%; max-width: none; }
  .dz-top .dz-grow { display: none; }
  .dz-types { grid-template-columns: 1fr; }
  .dz-title h1, .dz-welcome h1 { font-size: var(--text-xl); }
  .dz-drawer-head, .dz-drawer-body { padding-left: var(--space-4); padding-right: var(--space-4); }
  .dz-drawer-foot { padding: var(--space-3); }
  .dz-composer-hint span:first-child { display: none; }
}

/* ================================================================ document check (review.html, phase 3.4)
   Same header and page as the dossier workspace; the sidebar is gone. */

.rv-intro {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 400px); gap: var(--space-5) var(--space-7); align-items: start;
  grid-template-areas: "text signin" "example signin";
}
.rv-intro-text { grid-area: text; }
.rv-signin { grid-area: signin; }
.rv-example { grid-area: example; }
.rv-intro h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
.rv-intro .dz-lead { margin-bottom: var(--space-4); }
.rv-signin { padding: var(--space-5); position: sticky; top: 88px; }
.rv-signin .start-h { font-size: var(--text-lg); margin: 0 0 var(--space-1); }
.rv-signin .dz-muted { margin-bottom: var(--space-4); }
.rv-signin-foot { margin: var(--space-4) 0 0 !important; padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: var(--text-xs); }
.rv-example { margin-top: var(--space-2); }
.rv-example h2 { font-size: var(--text-md); margin: 0 0 var(--space-3); }

.rv-page { max-width: 900px; }
.rv-page h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin: 0 0 var(--space-2); letter-spacing: -0.01em; overflow-wrap: anywhere; }
#uploadView .dz-lead { margin-bottom: var(--space-4); }
#freeBanner .notice { margin-bottom: var(--space-4); }
.rv-drop { margin-bottom: var(--space-3); padding: var(--space-7) var(--space-4); }
.rv-cta-line {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4);
  background: var(--action-soft); border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--text);
}
.review-improve { padding: var(--space-5); border-color: var(--action); }
.review-improve h3 { font-size: var(--text-lg); }
.rv-older { margin: var(--space-2) 0 var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.rv-older > summary { cursor: pointer; padding: var(--space-3) var(--space-4); font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text-2); }
.rv-older[open] > summary { border-bottom: 1px solid var(--border); }
.rv-older > .review-result { padding: var(--space-4); margin: 0; }
.review-result.muted { opacity: 1; }
.review-start, .review-offer { padding: var(--space-5); }
#dropzone.over { border-color: var(--action); background: var(--action-soft); }

@media (max-width: 900px) {
  .rv-intro { grid-template-columns: 1fr; gap: var(--space-5); grid-template-areas: "text" "signin" "example"; }
  .rv-signin { position: static; }
}
@media (max-width: 720px) {
  .rv-intro h1, .rv-page h1 { font-size: var(--text-xl); }
  #langOut { display: inline-flex; }
}

/* ================================================================ public site (phase 3.5) */

/* Narrow text sections sit on the same left edge as every other section
   instead of floating centred (audit M8). */
.wrap.prose-narrow { max-width: 1180px; }
.wrap.prose-narrow > * { max-width: 760px; }

/* Rhythm: alternate a few key sections onto a tinted band. */
section.block.band { background: var(--surface-2); }

/* Pricing (audit H7): the amount is the loudest thing on the card, every card
   ends in one button, and the featured card says why it is featured. */
.pricing-grid .price-card, .pricing-secondary .price-card { position: relative; padding: var(--space-5); gap: 0; }
.price-card h3 { font-size: var(--text-md); margin: 0 0 var(--space-3); }
.price-card .price { font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -0.01em; line-height: 1.1; color: var(--text); margin: 0; }
.price-card .price-note { font-size: var(--text-sm); color: var(--text-3); margin: var(--space-1) 0 var(--space-4); }
.price-card .ticks { flex: 1; margin-bottom: var(--space-5); }
.price-card .price-cta { margin-top: auto; }
.price-flag {
  position: absolute; top: -12px; left: var(--space-5);
  padding: 2px var(--space-3); border-radius: var(--radius-full);
  background: var(--action); color: var(--on-action);
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .02em;
}
.pricing-secondary { margin-bottom: var(--space-6); }
.pricing-difference {
  border-left: 3px solid var(--action); background: var(--surface); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5) var(--space-6); margin: 0 0 var(--space-6); box-shadow: var(--card-shadow);
}
.pricing-difference h2 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.pricing-difference p { margin: 0; color: var(--text-2); max-width: 80ch; }

/* The public header fitted 380px on a 375px phone (audit H1): drop the
   wordmark on the narrowest screens, the P mark stays. */
@media (max-width: 420px) {
  header.site .brand > span:not(.mark) { display: none; }
  header.site .header-actions { gap: 6px; }
}

/* ---------------------------------------------------------------- homepage hero
   Two doors: the free document check first, then starting a project from a
   brief. Motion is limited to a small rise on first load, off under
   prefers-reduced-motion. */
.hero { padding: var(--space-8) 0 0; text-align: center; }
.hero-eyebrow {
  margin: 0 0 var(--space-4); font-size: var(--text-xs); font-weight: var(--weight-semi);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
}
.hero h1 {
  font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: -0.02em;
  max-width: 760px; margin: 0 auto;
}
.hero .lead {
  max-width: 620px; margin: var(--space-4) auto 0; font-size: var(--text-lg);
  line-height: var(--leading-snug); color: var(--text-2);
}
.hero-check { margin-top: var(--space-6); }
.hero-cta { height: 48px; padding: 0 var(--space-6); font-size: var(--text-md); }
.hero-second {
  max-width: 620px; margin: var(--space-7) auto 0; padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.hero-second h2 { margin: 0; font-size: var(--text-lg); }
.hero-second p { margin: var(--space-2) auto 0; color: var(--text-2); }
.hero-start { display: flex; gap: var(--space-2); max-width: 480px; margin: var(--space-4) auto 0; }
.hero-start input { flex: 1; min-width: 0; height: var(--input-height); }
.hero-start .btn { height: var(--input-height); white-space: nowrap; }
.hero-hint { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--text-3); }
.hero-notice { max-width: 480px; margin: var(--space-3) auto 0; text-align: left; }
.hero-notice:empty { display: none; }

/* Text left, photo right on wide screens; one centred column below 1200 px,
   with the photo after the check button. */
.hero-photo { margin: var(--space-6) auto 0; max-width: 560px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 1200px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-7); align-items: center; text-align: left; }
  .hero-grid h1 { margin: 0; max-width: none; }
  .hero-grid .lead { margin: var(--space-4) 0 0; }
  .hero-grid .hero-points { display: grid; margin: var(--space-4) 0 0; }
  .hero-grid .safe { margin: var(--space-5) 0 0; }
  .hero-photo { margin: 0; max-width: none; }
}

/* A section heading with a photo beside it (the document chain). */
.section-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: var(--space-7); align-items: center; margin-bottom: var(--space-6); }
.section-media .lead { margin-top: var(--space-3); }
.section-media img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
@media (max-width: 860px) {
  .section-media { grid-template-columns: 1fr; gap: var(--space-5); }
  .section-media img { max-width: 480px; }
}

/* The benefits under the lead: a short list reads faster than one long
   sentence. Left-aligned inside a centred block, with a check per line. */
.hero-points {
  display: inline-grid; gap: var(--space-2); margin: var(--space-4) auto 0; padding: 0;
  list-style: none; text-align: left; max-width: 620px; font-size: var(--text-md); color: var(--text);
}
.hero-points li { position: relative; padding-left: 28px; line-height: var(--leading-snug); }
.hero-points li::before {
  content: ""; position: absolute; left: 4px; top: .3em; width: 12px; height: 7px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}
/* On a phone the check button must still be on the first screen, under the
   lead, the list and the closed confidentiality line. */
@media (max-width: 640px) {
  .hero-points { font-size: var(--text-sm); margin-top: var(--space-3); gap: var(--space-1); }
  .hero .safe { margin-top: var(--space-4); }
  .hero .hero-check { margin-top: var(--space-5); }
}

/* Confidentiality, inside the hero above the doors. A different colour on
   purpose, so a project manager deciding whether to upload a real brief cannot
   miss it; closed it is one line, open it says how. */
.safe {
  max-width: 680px; margin: var(--space-5) auto 0; text-align: left;
  background: color-mix(in srgb, var(--ok) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
  border-radius: var(--radius-md);
}
.safe summary {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center;
  gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4);
  cursor: pointer; list-style: none; font-size: var(--text-sm); color: var(--text); border-radius: var(--radius-md);
}
.safe summary::-webkit-details-marker { display: none; }
.safe summary:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.safe-icon { width: 22px; height: 22px; flex: none; color: var(--ok); }
.safe-sum { line-height: var(--leading-snug); }
.safe-lead-body { display: none; margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--text); }
.safe-more {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-weight: var(--weight-semi); color: var(--link); white-space: nowrap;
}
.safe-more::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-fast) var(--ease-out);
}
.safe[open] .safe-more::after { transform: translateY(2px) rotate(-135deg); }
.safe-body { padding: 0 var(--space-4) var(--space-4) calc(var(--space-4) + 22px + var(--space-3)); }
.safe[open] .safe-body { animation: safe-open 200ms var(--ease-out) both; }
@keyframes safe-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Fixed subjects in a label column, so the facts read like a fact sheet. */
.safe-list {
  margin: 0; padding: 0; display: grid;
  border-top: 1px solid color-mix(in srgb, var(--ok) 25%, var(--border)); font-size: var(--text-sm);
}
.safe-list > div {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-3) 0; border-bottom: 1px solid color-mix(in srgb, var(--ok) 15%, var(--border));
}
.safe-list dt { font-weight: var(--weight-semi); color: var(--text); }
.safe-list dd { margin: 0; color: var(--text-2); }
.safe-foot { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) {
  .safe[open] .safe-body { animation: none; }
  .safe-more::after { transition: none; }
}
/* On a phone the closed state is the heading and the toggle only; the lead
   moves into the opened part, so the doors stay on the first screen. */
@media (max-width: 640px) {
  .safe summary { grid-template-columns: 22px minmax(0, 1fr); }
  .safe-more { grid-column: 2; }
  .safe-lead-inline { display: none; }
  .safe-lead-body { display: block; }
  .safe-body { padding-left: var(--space-4); }
  .safe-list > div { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* Demo block: invitation and form beside a crop of the real demo record. */
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--space-7); align-items: center; }
.demo-grid .lead { margin-top: var(--space-3); }
.demo-form { margin-top: var(--space-5); max-width: 480px; }
.demo-row { display: flex; gap: var(--space-2); }
.demo-row input { flex: 1; min-width: 0; height: var(--input-height); }
.demo-row .btn { height: var(--input-height); white-space: nowrap; }
.demo-consent { display: flex; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text-2); cursor: pointer; }
.demo-consent input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--action); flex: none; }
.demo-block .hero-notice { margin: var(--space-3) 0 0; }
.demo-shot {
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-md);
}
.demo-shot img { display: block; width: 100%; height: auto; }
@media (max-width: 860px) {
  .demo-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .demo-shot { max-width: 440px; }
}
@media (max-width: 480px) {
  .demo-row { flex-direction: column; }
  .demo-row input { flex: none; }
  .demo-row .btn { width: 100%; }
}

/* Each theme shows its own screenshot. Dark is the default in :root, so with
   no data-theme at all the dark image shows, matching the page. */
.only-light { display: none !important; }
:root[data-theme="light"] .only-light { display: block !important; }
:root[data-theme="light"] .only-dark { display: none !important; }

/* Under the comparison: who it is for, and the one thing it does not do. */
.audience { margin-top: var(--space-6); gap: var(--space-4) var(--space-6); }
.audience p { margin: 0; color: var(--text-2); }
.audience strong { color: var(--text); }
.not-does { margin: var(--space-5) 0 0; padding-left: var(--space-4); border-left: 3px solid var(--action); color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

@keyframes hero-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero h1, .hero .lead, .hero-points, .hero-check, .hero-photo, .hero-second { animation: hero-rise 280ms var(--ease-out) both; }
.hero .lead { animation-delay: 40ms; }
.hero-points { animation-delay: 60ms; }
.hero-photo { animation-delay: 100ms; }
.hero-check { animation-delay: 80ms; }
.hero-second { animation-delay: 120ms; }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .lead, .hero-points, .hero-check, .hero-photo, .hero-second { animation: none; }
}

@media (max-width: 640px) {
  .hero { padding-top: var(--space-6); }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: var(--text-md); }
  .hero-start { flex-direction: column; }
  .hero-start input { flex: none; }
  .hero-start .btn { width: 100%; }
  .hero-cta { width: 100%; }
}


/* ------------------------------------------------------------------ admin page (/beheer)
   One reader, a wide screen most of the time; still usable on a phone. */
:root {
  --adm-chat: var(--action);
  --adm-extract: var(--warn);
  --adm-document: var(--ok);
  --adm-review: color-mix(in srgb, var(--action) 45%, var(--danger));
  --adm-questionnaire: var(--text-3);
  --adm-other: var(--border-input);
}
.adm-badge { font-size: var(--text-xs); font-weight: var(--weight-semi); text-transform: uppercase; letter-spacing: .06em; color: var(--action-soft-text); background: var(--action-soft); border-radius: var(--radius-full); padding: 4px 10px; }
.adm-page { max-width: 1240px; margin: 0 auto; padding: var(--space-6) var(--space-6) var(--space-8); display: grid; gap: var(--space-5); }
.adm-page > * { min-width: 0; }
.adm-title { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }
.adm-title h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); margin: 0 0 var(--space-1); letter-spacing: -0.01em; }
.adm-period { display: grid; gap: var(--space-2); justify-items: end; }
.adm-presets { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.adm-presets .btn[aria-pressed="true"] { background: var(--action-soft); color: var(--action-soft-text); border-color: transparent; }
.adm-dates { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; justify-content: flex-end; }
.adm-dates label, .adm-logbar label { display: grid; gap: 4px; margin: 0; font-size: var(--text-xs); color: var(--text-2); }
.adm-dates input, .adm-logbar input[type=text], .adm-logbar select { min-height: 32px; padding: 4px var(--space-2); font-size: var(--text-sm); width: auto; }
#notice:empty { display: none; }

.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }
.adm-kpi { padding: var(--space-4) var(--space-5); display: grid; gap: 2px; }
.adm-kpi-label { font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.adm-kpi-value { font-size: var(--text-2xl); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.adm-kpi-sub { font-size: var(--text-sm); color: var(--text-2); }
.adm-kpi.bad .adm-kpi-sub { color: var(--danger); font-weight: var(--weight-semi); }

.adm-card { padding: var(--space-5); }
.adm-card h2 { font-size: var(--text-lg); margin: 0; }
.adm-sub { font-size: var(--text-sm); margin: var(--space-4) 0 var(--space-2); color: var(--text-2); }
.adm-sub:first-child { margin-top: 0; }
.adm-foot { margin-top: var(--space-3); }
.adm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }

.adm-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-2); }
.adm-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.adm-legend-item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.adm-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); }
.adm-axis { font-size: var(--text-xs); color: var(--text-3); font-variant-numeric: tabular-nums; align-self: start; }
.adm-bars { display: flex; align-items: stretch; gap: 3px; height: 220px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); padding: 0 2px; }
.adm-bar { flex: 1 1 0; min-width: 2px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.adm-stack { display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; min-height: 0; }
.adm-stack span { display: block; min-height: 1px; }
.adm-bar:hover .adm-stack { filter: brightness(1.12); }
.adm-bar-label { position: absolute; top: calc(100% + 4px); left: 0; font-size: var(--text-xs); color: var(--text-3); white-space: nowrap; }
.adm-chart { padding-bottom: var(--space-5); }
.adm-empty { padding: var(--space-5) 0; }

.adm-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.adm-table-wrap:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.adm-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.adm-table th, .adm-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.adm-table thead th { background: var(--surface-2); font-weight: var(--weight-semi); white-space: nowrap; }
.adm-table tbody th { font-weight: var(--weight-semi); min-width: 180px; }
.adm-table tfoot th, .adm-table tfoot td { border-bottom: 0; border-top: 2px solid var(--border); font-weight: var(--weight-semi); }
.adm-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.adm-table .bad { color: var(--danger); font-weight: var(--weight-semi); }
.adm-table tbody tr:last-child th, .adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-variant { margin-left: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--action-soft-text); background: var(--action-soft); border-radius: var(--radius-full); padding: 1px 8px; }
.adm-model { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--text-3); font-family: var(--font-mono); }
.adm-route { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400 !important; overflow-wrap: anywhere; }

.adm-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); margin: 0; font-size: var(--text-sm); }
.adm-dl dt { color: var(--text-2); }
.adm-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--weight-semi); overflow-wrap: anywhere; }

.adm-errors { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.adm-errors li { display: grid; gap: 2px; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.adm-err-meta { font-size: var(--text-xs); color: var(--text-3); }
.adm-err-text { font-family: var(--font-mono); font-size: var(--text-xs); overflow-wrap: anywhere; }

.adm-logbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-3); }
.adm-logbar .adm-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); min-height: 32px; }
.adm-log { max-height: 460px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5; }
.adm-log:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.adm-log > p { padding: var(--space-3); font-family: inherit; }
.adm-line { display: grid; grid-template-columns: auto 3.6em minmax(0, 1fr); gap: var(--space-3); padding: 3px var(--space-3); border-bottom: 1px solid var(--border); }
.adm-line time { color: var(--text-3); white-space: nowrap; }
.adm-lvl { color: var(--text-3); text-transform: uppercase; }
.adm-line.warn .adm-lvl { color: var(--warn); font-weight: 700; }
.adm-line.error { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.adm-line.error .adm-lvl { color: var(--danger); font-weight: 700; }
.adm-msg { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }

@media (max-width: 900px) {
  .adm-page { padding: var(--space-4) var(--space-4) var(--space-7); }
  .adm-grid { grid-template-columns: minmax(0, 1fr); }
  .adm-period, .adm-presets, .adm-dates { justify-items: start; justify-content: flex-start; }
  .adm-line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .adm-bars { height: 160px; }
}

/* Open points taken over from a document check, before the first completeness check. */
.dz-open-intro { margin-bottom: var(--space-3); }
.dz-open-area { display: flex; align-items: center; gap: 6px; }
.rag-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rag-dot.red { background: var(--danger); }
.rag-dot.amber { background: var(--warn); }

/* A project from a free check holds only the opening part; the rest is the full check. */
.dz-rest { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--action-soft); border-radius: var(--radius-sm); }
.dz-rest strong { color: var(--action-soft-text); font-size: var(--text-sm); }
.dz-rest p { margin: 0; font-size: var(--text-sm); color: var(--text); }

/* Welcome: the method first, then the document of that route (29 September 2026). */
.dz-welcome > .dz-label { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--text-2); }
.dz-types.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dz-method strong { font-size: var(--text-md); }
@media (max-width: 700px) { .dz-types.two { grid-template-columns: 1fr; } }

/* Homepage: one card per method route (29 September 2026). */
.routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.route { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.route h3 { margin: 0; font-size: var(--text-lg); }
.route-line { margin: 0; font-size: var(--text-sm); color: var(--text-2); }
.route-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.route-docs li { display: grid; gap: 2px; padding-left: var(--space-3); border-left: 2px solid var(--border-input); }
.route-n { font-size: var(--text-xs); font-weight: var(--weight-semi); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.route-docs strong { font-size: var(--text-md); color: var(--text); }
.route-q { font-size: var(--text-sm); color: var(--text-2); }
.route .ladder-sample { margin-top: auto; }
@media (max-width: 900px) { .routes { grid-template-columns: minmax(0, 1fr); } }
