/* KeySigner public site: home, pricing and start.
   System fonts only, no images. The look is a signing instrument: ruled
   lines, mono field labels, and one credential above a visible boundary.
   Colors stay in the console's teal family. */

:root {
  color-scheme: light dark;
  --paper: light-dark(#F2F3EE, #0C1211);
  --surface: light-dark(#FBFBF8, #141C1A);
  --surface-2: light-dark(#E7EAE4, #1D2826);
  --ink: light-dark(#12201C, #EAEFEB);
  --muted: light-dark(#4C5A55, #A9B6B1);
  --line: light-dark(#D6DBD4, #28332F);
  --line-strong: light-dark(#ABB5AE, #475651);
  --control: light-dark(#6F7D77, #748781);
  --accent: light-dark(#0B5F58, #6AD3C4);
  --accent-strong: light-dark(#07443F, #9BE6DA);
  --accent-ink: light-dark(#FFFFFF, #07120F);
  --accent-soft: light-dark(#DAECE6, #12332F);
  --signal: light-dark(#8A4309, #F0AB66);
  --signal-soft: light-dark(#F7E8D6, #33240F);
  --good: light-dark(#14602F, #74D69E);
  --good-soft: light-dark(#DDF0E2, #14301F);
  --warn: light-dark(#6F4800, #E8C15A);
  --warn-soft: light-dark(#F8EED1, #33290F);
  --bad: light-dark(#A61F15, #F4978E);
  --bad-soft: light-dark(#FAE3E0, #3A1A17);
  /* light-dark() takes colors only, so shadows switch by theme selector below. */
  --shadow-light: 0 1px 1px rgb(18 32 28 / 5%), 0 18px 40px -28px rgb(18 32 28 / 35%);
  --shadow-dark: 0 1px 1px rgb(0 0 0 / 30%), 0 20px 44px -28px rgb(0 0 0 / 80%);
  --shadow: var(--shadow-light);

  /* The closing band and the enforce level stay deep in both modes; dark mode adds a bright edge so they lift off the page. */
  --deep: light-dark(#0A3531, #0E4640);
  --deep-edge: light-dark(#0A3531, #6AD3C4);
  --deep-bar: light-dark(#F2F3EE, #6AD3C4);
  --on-deep: #F2F3EE;
  --on-deep-muted: #C2D4CE;
  --on-deep-line: #2F5F59;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 5px;
  --radius-lg: 9px;
  --gutter: 16px;
  --wrap: 1240px;
  --header-h: 64px;

  /* Two display sizes for everything below a section heading. */
  --type-card: 1.625rem;
  --type-sub: 1.3125rem;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; --shadow: var(--shadow-dark); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --shadow: var(--shadow-dark); }
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 40px; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-sans);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
/* Main and step headings take focus from script so screen readers announce them.
   The outline shows only when the browser judges focus came from the keyboard. */
main:focus:not(:focus-visible),
[data-step] h2:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 22px; height: 1px;
  background: currentColor;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.button:hover { border-color: var(--ink); background: var(--surface-2); color: var(--ink); }
.button:active:not([disabled], [aria-disabled="true"]) { transform: translateY(1px); }
.button[disabled],
.button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

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

.button-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  padding-inline: 10px;
}
.button-quiet:hover { background: transparent; border-color: transparent; color: var(--accent-strong); text-decoration: underline; }

.button-block { width: 100%; }

.button[data-busy="true"]::after {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}
.link-arrow::after { content: "\00a0\2192"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Header and menu ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: var(--header-h);
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.brand:hover { color: var(--ink); }

/* Brand mark: a padlock whose body is a pen nib. */
.brand-mark {
  width: 18px; height: 28px;
  color: var(--ink);
  flex: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
.header-start { display: none; }
.menu-toggle:hover { border-color: var(--ink); background: var(--surface-2); }
.menu-toggle-label { display: inline-block; min-width: 5ch; text-align: left; }
.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  display: block;
  width: 16px; height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 160ms ease, background-color 160ms ease;
}
.menu-toggle-icon { position: relative; }
.menu-toggle-icon::before,
.menu-toggle-icon::after { content: ""; position: absolute; left: 0; }
.menu-toggle-icon::before { top: -5px; }
.menu-toggle-icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before { background: var(--ink); transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after { background: var(--ink); transform: translateY(-5px) rotate(-45deg); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.button) {
  display: inline-block;
  padding: 11px 0;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:not(.button):hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-nav a.button[aria-current="page"] { border-radius: 0; }
.nav-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* The menu collapses only where scripts can run to reopen it, so the
   links stay reachable with scripting off. */
@media (max-width: 859px) and (scripting: none) {
  .site-header { position: static; }
}
@media (max-width: 859px) and (scripting: enabled) {
  .site-header .menu-toggle { display: inline-flex; }
  .site-header .header-start { display: inline-flex; margin-left: auto; min-height: 44px; padding-inline: 14px; }
  .site-header[data-menu-open] .header-start { display: none; }
  .site-header .site-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 8px 0 16px;
  }
  .site-header:not([data-menu-open]) .site-nav { display: none; }
  .site-header .site-nav ul { flex-direction: column; gap: 0; }
  .site-header .site-nav a:not(.button) {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .site-header .site-nav a[aria-current="page"] { box-shadow: none; font-weight: 700; }
  .site-header .nav-actions .button { flex: 1 1 120px; }
}

/* ---------- Sections ---------- */

main { display: block; }

.section { padding-block: 64px; }
.section + .section { border-top: 1px solid var(--line); }
.section-tint { background: var(--surface); }

.section-head {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-bottom: 40px;
  max-width: 70ch;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.55rem + 1.9vw, 3.125rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

@media (min-width: 1024px) {
  .section { padding-block: 96px; }
  .section-head { margin-bottom: 48px; }
}

/* The first section under a page header continues it. */
.page-head + .section { padding-top: 0; }

/* Wide screens set the heading against its lede instead of leaving the right half empty. */
@media (min-width: 1100px) {
  .section:not(#faq, #plans) > .wrap:not(.split) > .section-head:has(> .lede) {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 72px;
    align-items: end;
    max-width: none;
  }
  .section:not(#faq, #plans) > .wrap:not(.split) > .section-head:has(> .lede) > .eyebrow { grid-column: 1 / -1; }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}
.split-body { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; }
  .split .section-head {
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-h) + 32px);
    align-self: start;
  }
}

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

.hero { padding-block: 44px 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}
.hero-copy { display: grid; gap: 22px; justify-items: start; min-width: 0; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.75rem + 3.5vw, 4.5rem);
  letter-spacing: -0.022em;
  line-height: 1.03;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-note {
  max-width: 60ch;
  padding: 12px 0 12px 16px;
  border-left: 2px solid var(--signal);
  font-size: 0.9375rem;
  color: var(--muted);
}
.hero-note strong { color: var(--ink); font-weight: 600; }

@media (max-width: 559px) {
  .hero-copy .actions { justify-self: stretch; }
  .hero-copy .actions .button,
  .band .actions .button { flex: 1 1 140px; }
}

@media (min-width: 1000px) {
  .hero { padding-block: 72px 96px; }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 72px; }
}

/* ---------- Credential instrument (hero figure) ---------- */

.slip {
  display: grid;
  gap: 0;
  min-width: 0;
  font-size: 0.9375rem;
}
.slip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.slip-layer {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  min-width: 0;
}
.slip-service { border-style: dashed; border-color: var(--control); }
.slip-rule { box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.slip-label {
  display: block;
  margin-bottom: 8px;
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.slip-title {
  font-family: var(--font-display);
  font-size: var(--type-sub);
  line-height: 1.2;
}
.slip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.slip-credential {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* The boundary: where the service's view ends and the rule begins. */
.slip-boundary {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 22px;
  text-align: center;
}
.slip-boundary::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--control);
}
.slip-boundary span {
  position: relative;
  padding: 4px 12px;
  background: var(--paper);
  border-block: 1px solid var(--control);
  font: 600 0.75rem/1.4 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.slip-members {
  display: grid;
  gap: 0;
  margin-top: 12px;
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
}
.slip-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.slip-member-name { font-weight: 600; }
.slip-member-key { display: block; font-size: 0.8125rem; color: var(--muted); }
.key-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--control);
}
.slip-member[data-approval="approved"] .key-dot { background: var(--accent); border-color: var(--accent); }
.slip-member[data-approval="waiting"] .key-dot { border-style: dashed; }
.slip-member[data-approval="lost"] .key-dot { border-color: var(--signal); background: var(--signal-soft); }
.slip-member[data-approval="lost"] .slip-member-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--signal); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font: 600 0.75rem/1.3 var(--font-sans);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.tag-good { background: var(--good-soft); color: var(--good); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-accent { background: var(--accent-soft); color: var(--accent-strong); }
.tag-signal { background: var(--signal-soft); color: var(--signal); }

.quorum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
  font-weight: 600;
}
.quorum-meter { display: flex; gap: 4px; }
.quorum-meter span {
  width: 24px; height: 8px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid var(--control);
}
.quorum-meter span[data-filled] { background: var(--accent); border-color: var(--accent); }

.slip-caption {
  margin-top: 14px;
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font: 600 0.8125rem/1 var(--font-mono);
  color: var(--accent);
}
.steps h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-card); }
.steps p { color: var(--muted); max-width: 44ch; }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
}
@media (min-width: 1024px) {
  .steps { gap: 48px; }
}

/* Five journey steps: two columns on tablets (the fifth spans), one row on desktop. */
@media (min-width: 720px) {
  .steps-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-journey > li:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .steps-journey { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
  .steps-journey > li:last-child { grid-column: auto; }
}

/* Long lists sit beside their heading, as the recovery section does. */
@media (min-width: 1100px) {
  #faq > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 72px;
    align-items: start;
  }
  #faq .section-head {
    grid-row: 1 / span 2;
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-h) + 32px);
  }
  #faq .faq { grid-column: 2; }
}

/* ---------- Accounts ---------- */

.account-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 40px;
  margin-bottom: 36px;
  list-style: none;
  padding: 0;
}
.account-modes li { padding: 14px 22px 0; border-top: 2px solid var(--ink); }
.account-modes strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--type-sub); line-height: 1.25; }
.account-modes span { color: var(--muted); }
/* Same outer border and gaps as the cards below, so the two rows share edges. */
@media (min-width: 640px) {
  .account-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1px; padding-inline: 1px; }
}

/* The rule runs the full width so the cards read as one set, not as children of the two modes above. */
.accounts-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.accounts-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}

.accounts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  list-style: none;
  padding: 0;
}
.account {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  background: var(--surface);
}
.account-kind {
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.account h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-sub); }
.account p { color: var(--muted); font-size: 0.9375rem; }
.account p.account-credential {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--control);
  font-size: 0.875rem;
  color: var(--ink);
}
.account-credential strong { font-weight: 600; }

@media (min-width: 640px) {
  .accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .accounts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Three use cases: one column until all three fit side by side, so no empty cell shows. */
@media (min-width: 640px) {
  .accounts-three { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .accounts-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.accounts-note { margin-top: 18px; color: var(--muted); font-size: 0.9375rem; }

/* ---------- Limits ---------- */

.limits {
  display: grid;
  list-style: none;
  padding: 0;
  border-top: 2px solid var(--signal);
}
.limits > li {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.limits strong { font-weight: 600; }
.limits p { color: var(--muted); font-size: 0.9375rem; }

/* ---------- Plans and prices ---------- */

.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
}
@media (min-width: 720px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
#plans .plans,
#plans .plans-foot { max-width: 880px; }
@media (min-width: 1280px) {
  #plans > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: 72px;
    align-items: start;
  }
  #plans .section-head { grid-row: 1 / span 2; margin-bottom: 0; }
  #plans .plans,
  #plans .plans-foot { grid-column: 2; max-width: none; }
  #plans .plan { padding: 28px; }
  #plans .plan h3 { font-size: 1.75rem; }
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  padding: 28px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
@media (min-width: 1024px) {
  .plan { padding: 36px; }
}
.plan[data-plan-emphasis="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 3px 0 var(--accent), var(--shadow);
}
/* Side by side, plans share rows: description, price, trial, features, button. */
@media (min-width: 720px) {
  .plan { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
  .plan:has(> .plan-features) { grid-row: span 5; }
}
.plan-head { display: grid; gap: 6px; align-content: start; }
.plan-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
@media (max-width: 559px) {
  /* The badge reads as an eyebrow over the plan name instead of wrapping under it. */
  .plan-head-row { flex-direction: column-reverse; align-items: flex-start; flex-wrap: nowrap; }
}
.plan h2,
.plan h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
}
.plan-for { color: var(--muted); }
.plan-price,
.plan-trial {
  display: grid;
  gap: 6px;
  align-content: start;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.plan-row-label {
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-features {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
  align-content: start;
}
.plan-features li {
  position: relative;
  padding-left: 26px;
}
.plan-features li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.45em;
  width: 12px; height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan > .button { margin-top: auto; }

/* Price slots. Markup starts as "unavailable" so the fallback shows
   without scripts; the script moves the slot to loading, then ready.
   No amount is ever written into this file or the pages. */
.price {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
}
.plan-price > .price { display: flex; min-height: 3.25rem; align-items: center; }
.plan-price > .price[data-price-state="available"] { align-items: baseline; }
.price-value {
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variant-numeric: lining-nums;
}
.price-inline .price-value { font-family: inherit; font-size: inherit; font-weight: 700; letter-spacing: 0; }
.price-unit { color: var(--muted); font-size: 0.9375rem; }
.price-label { color: var(--muted); }
.price-fallback { color: var(--muted); font-size: 0.9375rem; }
.plan-price .price-fallback { font-family: var(--font-display); font-size: var(--type-card); line-height: 1.2; color: var(--ink); }
.price-inline .price-fallback { font-size: inherit; }
.choice-text .price-fallback { color: var(--ink); font-weight: 600; }
.choice-text > .price-inline { display: flex; margin-top: 2px; }
.price-value { white-space: nowrap; }
@media (min-width: 560px) {
  .price-inline > .price-unit { white-space: nowrap; }
}

.price[data-price-state="unavailable"] .price-value,
.price[data-price-state="unavailable"] .price-unit,
.price[data-price-state="loading"] .price-unit,
.price[data-price-state="loading"] .price-fallback,
.price[data-price-state="available"] .price-fallback { display: none; }

.price[data-price-state="loading"] .price-value {
  display: inline-block;
  min-width: 5ch;
  min-height: 1em;
  border-radius: 4px;
  color: transparent;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.price-inline[data-price-state="loading"] .price-value { min-width: 4ch; }

.price-note {
  font-size: 0.875rem;
  color: var(--muted);
}
.plan-trial .price-note { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.plans-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 20px;
}

/* ---------- Page header (pricing, start) ---------- */

.page-head {
  padding-block: 44px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}
.page-head-copy { display: grid; gap: 16px; justify-items: start; min-width: 0; }
.page-head-copy > .status { justify-self: stretch; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.8rem + 3.1vw, 4.25rem);
  letter-spacing: -0.02em;
  line-height: 1.04;
}
@media (min-width: 1000px) {
  .page-head { padding-block: 80px 44px; }
  .page-head-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 72px; align-items: end; }
}

/* The self-service path, read top to bottom. */
.path {
  display: grid;
  list-style: none;
  padding: 0;
  counter-reset: path;
  border-top: 2px solid var(--ink);
}
.path li {
  counter-increment: path;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0 8px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}
.path li::before {
  content: counter(path);
  font: 600 0.8125rem/1.8 var(--font-mono);
  color: var(--accent);
}
.path strong { color: var(--ink); font-weight: 600; }
.path-title {
  margin-bottom: 10px;
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Comparison table ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.compare caption {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  color: var(--muted);
  font-size: 0.875rem;
}
.compare th,
.compare td {
  padding: 15px 24px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th {
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.compare tbody th { font-weight: 500; width: 44%; }
.compare th:nth-child(3),
.compare td:nth-child(3) { background: var(--accent-soft); }
.compare thead th:nth-child(3) { color: var(--accent-strong); }
/* Narrow screens: each feature becomes a card with its two plan values. */
@media (max-width: 559px) {
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare caption { padding: 16px 16px 12px; }
  .compare tbody,
  .compare tr { display: block; }
  .compare tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare tbody th,
  .compare td { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 12px; width: auto; padding: 4px 0; border: 0; }
  .compare tbody th { display: block; padding-bottom: 8px; font-weight: 600; }
  .compare td:nth-child(3) { background: none; }
  .compare td::before { color: var(--muted); font-weight: 500; }
  .compare td:nth-child(2)::before { content: "Personal"; }
  .compare td:nth-child(3)::before { content: "Organization"; color: var(--accent-strong); }
}
.yes { color: var(--good); font-weight: 600; }
.no { color: var(--muted); }
@media (min-width: 560px) and (max-width: 1023px) {
  .compare td.no { white-space: nowrap; }
}

/* ---------- Fee modes ---------- */

.fee-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
}
@media (min-width: 720px) {
  .fee-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
.fee-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 0;
  border-top: 2px solid var(--ink);
}
.fee-mode h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-card); }
.fee-mode p { color: var(--muted); max-width: 54ch; }
.fee-mode .price { margin-top: auto; padding-top: 8px; }
@media (min-width: 560px) and (max-width: 1023px) {
  .fee-mode .price-value + .price-unit { flex-basis: 100%; }
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  border-top: 2px solid var(--ink);
  max-width: 82ch;
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font: 400 1.5rem/1 var(--font-mono);
  color: var(--accent);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 20px; color: var(--muted); display: grid; gap: 10px; max-width: 68ch; }

/* ---------- Closing band ---------- */

.band {
  padding-block: 72px;
  border-top: 3px solid var(--deep-edge);
  background: var(--deep);
  color: var(--on-deep);
}
.band-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}
.band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.55rem + 1.9vw, 3.125rem);
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.band p { color: var(--on-deep-muted); max-width: 56ch; }
.band .button { border-color: var(--on-deep-muted); background: transparent; color: var(--on-deep); }
.band .button:hover { border-color: var(--on-deep); background: var(--on-deep-line); color: var(--on-deep); }
.band .button-primary { background: var(--on-deep); border-color: var(--on-deep); color: var(--deep); }
.band .button-primary:hover { background: var(--on-deep-muted); border-color: var(--on-deep-muted); color: var(--deep); }
.band :focus-visible { outline-color: var(--on-deep); }
@media (min-width: 860px) {
  .band-inner { grid-template-columns: minmax(0, 1fr) auto; column-gap: 64px; }
  .band-inner h2 { grid-column: 1; }
  .band-inner p { grid-column: 1; }
  .band-inner .actions { grid-column: 2; grid-row: 1 / span 2; }
}
@media (min-width: 1024px) {
  .band { padding-block: 88px; }
}

/* ---------- Start flow ---------- */

/* A task page: the heading steps back so the current step sits higher. */
.start-head { padding-block: 32px 20px; }
.start-head h1 { font-size: clamp(2.125rem, 1.8rem + 1.5vw, 3rem); }
@media (min-width: 1000px) {
  .start-head { padding-top: 56px; }
}
.start-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 80px;
}
@media (min-width: 1000px) {
  .start-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
  .start-aside { position: sticky; top: calc(var(--header-h) + 24px); }
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stepper;
}
.stepper li {
  counter-increment: stepper;
  display: grid;
  grid-template-rows: 5px auto;
  gap: 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.stepper li::before {
  content: "";
  align-self: end;
  height: 2px;
  background: var(--control);
}
.stepper li[data-step-state="complete"]::before { height: 3px; background: var(--accent); }
.stepper li[data-step-state="current"]::before { height: 5px; background: var(--ink); }
.stepper li[data-step-state="skipped"]::before { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.stepper li[data-step-state="current"] { color: var(--ink); font-weight: 600; }
.stepper a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}
.stepper a::before {
  content: counter(stepper);
  content: counter(stepper) / "";
  font: 600 0.75rem/1 var(--font-mono);
  color: var(--accent);
}
.stepper li[data-step-state="complete"] a::before { content: "\2713"; content: "\2713" / ""; }
.stepper li[data-step-state="skipped"] a::before { content: "\2013"; content: "\2013" / ""; }
.stepper-count { display: none; margin: 4px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.stepper a:hover { text-decoration: underline; }
/* Steps that cannot be opened yet should not look clickable. */
.stepper a[aria-disabled="true"] { cursor: default; }
.stepper a[aria-disabled="true"]:hover { text-decoration: none; }
.stepper a[aria-disabled="true"]::before { color: var(--muted); }
@media (max-width: 639px) {
  /* One row of numbered bars; the current step is named underneath. */
  .stepper a { justify-content: center; font-size: 0; }
  .stepper a::before { font-size: 0.8125rem; }
  .stepper-count { display: block; }
}

.flow,
.flow form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.flow { gap: 20px; }

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: transparent;
}
@media (min-width: 720px) {
  .step { padding: 20px 32px; }
}
.step-head { display: grid; gap: 6px; }
.step h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--muted);
}
.step-help { color: var(--muted); max-width: 62ch; }
.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 4px;
}
@media (max-width: 559px) {
  .step-actions .button { flex: 1 1 100%; }
}
/* With no primary action beside it, the lone Back lines up with the card text. */
[data-action="retry-checkout"][hidden] + [data-from-step="checkout"] { padding-inline-start: 0; justify-content: flex-start; }

/* One step is open at a time and the stepper carries the rest. If no step is
   marked current, or scripts cannot run, every step is shown. */
.step[data-step-state="current"],
.step:target {
  padding-block: 28px;
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: inset 0 3px 0 var(--accent), var(--shadow);
}
@media (min-width: 720px) {
  .step[data-step-state="current"],
  .step:target { padding-block: 36px; }
}
.step[data-step-state="current"] h2,
.step:target h2 { font-size: clamp(1.625rem, 1.4rem + 1vw, 2.125rem); color: var(--ink); }

@media (scripting: enabled) {
  .flow form:has(.step[data-step-state="current"]) { gap: 0; }
  .flow form:has(.step[data-step-state="current"]) .step:not([data-step-state="current"]) { display: none; }
}

/* On a phone the stepper carries progress, so the open step follows it directly. */
@media (max-width: 559px) {
  .start-head { padding-block: 16px 12px; }
  .start-head .page-head-copy { gap: 8px; }
  .start-head h1 { font-size: 1.75rem; }
  .start-layout { gap: 20px; }
  .flow { gap: 12px; }
  .step[data-step-state="current"],
  .step:target { padding-block: 20px; }
}
@media (max-width: 559px) {
  .start-head .lede { font-size: 1rem; }
}
/* The introduction only helps on Choose. Later steps open with their own heading. */
@media (scripting: enabled) {
  main:has([data-step="intent"]:not([data-step-state="current"])) .start-head .lede { display: none; }
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 600;
}

.choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 720px) {
  .choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.choice:hover { border-color: var(--ink); }
/* Drawn by hand: a native dark radio fills unselected controls and reads as selected. */
.choice input {
  appearance: none;
  display: grid;
  place-content: center;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  border: 2px solid var(--control);
  border-radius: 50%;
  background: transparent;
  flex: none;
}
.choice input:checked { border-color: var(--accent); }
.choice input:checked::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.choice-body { display: grid; gap: 4px; min-width: 0; }
.choice-title { font-weight: 600; }
.choice-text { color: var(--muted); font-size: 0.9375rem; }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice:has(input:checked) .choice-text { color: var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
.choice:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }

.field { display: grid; gap: 8px; max-width: 520px; }
.field label { font-weight: 600; }
.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: 1rem;
}
.input:hover { border-color: var(--ink); }
.input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.legal-acceptance {
  max-width: 56rem;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.legal-acceptance label {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  cursor: pointer;
  font-weight: 500;
}
.legal-acceptance input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
}
.legal-acceptance:has(input[aria-invalid="true"]) { border-color: var(--bad); }

.field-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--bad);
  font-size: 0.9375rem;
  font-weight: 600;
}
.field-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px; height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--bad);
  color: var(--surface);
  font: 700 0.75rem/1 var(--font-sans);
}

.error-summary {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 2px solid var(--bad);
  border-radius: var(--radius);
  background: var(--bad-soft);
}
.error-summary h2 { font-size: 1rem; color: var(--bad); }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--bad); font-weight: 600; }

/* Review sheet */
.review {
  display: grid;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.review > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.review > div:last-child { border-bottom: 0; }
.review dt { color: var(--muted); font-size: 0.875rem; }
.review dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 560px) {
  .review > div { grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: baseline; }
}
[data-review-field]:empty::before,
[data-summary-field]:empty::before {
  content: "Not set yet";
  color: var(--muted);
  font-weight: 400;
}

.fine-print { font-size: 0.875rem; color: var(--muted); max-width: 62ch; }
.review-billing { max-width: 62ch; }
.flow:has(input[name="plan"][value="personal"]:checked) [data-plan-only="organization"],
.flow:has([data-organization-name]:disabled) [data-new-organization-only] { display: none; }

/* Status panels share one tone scale keyed on data-state. An idle panel
   leaves the layout but stays a live region, so its first message is read. */
.status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.status::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status > div { display: grid; gap: 6px; min-width: 0; }
.status p { margin: 0; }
.status-block:not([hidden]) { display: grid; gap: 10px; justify-items: start; }
.status[data-state="idle"],
.status[data-state="signed-out"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.status[data-state="loading"],
.status[data-state="redirecting"],
.status[data-state="returned"],
.status[data-state="pending"] { background: var(--accent-soft); border-color: transparent; }
.status[data-state="loading"]::before,
.status[data-state="redirecting"]::before,
.status[data-state="returned"]::before {
  background: transparent;
  width: 14px; height: 14px; margin-top: 5px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
.status[data-state="pending"]::before { background: var(--accent); }
.status[data-state="signed-in"],
.status[data-state="confirmed"],
.status[data-state="success"] { background: var(--good-soft); border-color: transparent; }
.status[data-state="signed-in"]::before,
.status[data-state="confirmed"]::before,
.status[data-state="success"]::before { background: var(--good); }
.status[data-state="canceled"],
.status[data-state="warning"] { background: var(--warn-soft); border-color: transparent; }
.status[data-state="canceled"]::before,
.status[data-state="warning"]::before { background: var(--warn); }
.status[data-state="failed"],
.status[data-state="error"] { background: var(--bad-soft); border-color: var(--bad); }
.status[data-state="failed"]::before,
.status[data-state="error"]::before { background: var(--bad); }

.site-status {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 60;
  width: min(560px, calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}
.site-status:empty { display: none; }

/* Summary aside */
.summary-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.summary-card h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-sub); }
.summary { display: grid; border-top: 1px solid var(--line); }
.summary > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}
.summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
.summary dt { font-size: 0.8125rem; color: var(--muted); }
.summary dd { margin: 0; font-size: 0.9375rem; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 560px) and (max-width: 999px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 0; }
  .summary > div,
  .summary > div:last-child { padding-block: 10px; border-top: 1px solid var(--line); border-bottom: 0; }
}
.summary-path {
  display: grid;
  list-style: none;
  padding: 0;
  font-size: 0.9375rem;
}
.summary-path li {
  position: relative;
  padding: 0 0 12px 22px;
  color: var(--muted);
}
.summary-path li::before {
  content: "";
  position: absolute;
  left: 2px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--control);
  background: var(--paper);
}
.summary-path li::after {
  content: "";
  position: absolute;
  left: 6px; top: 18px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.summary-path li:last-child { padding-bottom: 0; }
.summary-path li:last-child::after { display: none; }
.summary-path strong { color: var(--ink); font-weight: 600; }

.notice {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.9375rem;
}
.scope-note {
  padding-left: 14px;
  border-left: 2px solid var(--signal);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Consent ---------- */

.consent {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 70;
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin-left: auto;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.consent h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--type-sub); }
.consent p { color: var(--muted); font-size: 0.9375rem; }
.consent .actions .button { flex: 1 1 120px; }

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

.site-footer {
  padding-block: 56px 40px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.footer-grid h2 {
  font: 600 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; }
.footer-grid li > a,
.footer-grid li > .text-button { display: inline-block; padding-block: 6px; min-height: 36px; }
@media (pointer: coarse) {
  .footer-grid li > a,
  .footer-grid li > .text-button { display: inline-flex; align-items: center; min-height: 44px; }
}
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-grid a[aria-current="page"] { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; }
.footer-about { display: grid; gap: 10px; max-width: 40ch; color: var(--muted); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
/* Stays out of the layout and the accessibility tree until it holds links. */
.footer-legal { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-legal:empty { display: none; }
.footer-legal a { display: inline-block; min-height: 36px; padding-block: 6px; color: var(--ink); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal a[aria-current="page"] { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; }
@media (min-width: 720px) {
  .footer-base > span:last-child { margin-left: auto; }
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.text-button:hover { color: var(--accent); text-decoration: underline; }
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.6fr repeat(2, minmax(0, 1fr)); }
}

/* ---------- Legal pages ---------- */

.legal-layout {
  max-width: calc(44rem + 2 * var(--gutter));
  padding-block: 64px;
}
.legal-head {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line-strong);
}
.legal-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 2.2rem + 1.2vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.legal-copy { display: grid; gap: 40px; overflow-wrap: break-word; }
.legal-copy section { display: grid; gap: 12px; }
.legal-copy h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
}
.legal-copy p { line-height: 1.65; }

/* ---------- Motion and contrast preferences ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

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

@media (forced-colors: active) {
  .brand-mark { forced-color-adjust: none; color: CanvasText; }
  .key-dot,
  .quorum-meter span[data-filled],
  .stepper li::before { forced-color-adjust: none; background: CanvasText; }
  .level-bar span { forced-color-adjust: none; border-color: CanvasText; }
  .level[data-level="observe"] .level-bar span:nth-child(-n+1),
  .level[data-level="coordinate"] .level-bar span:nth-child(-n+2),
  .level[data-level="enforce"] .level-bar span { background: CanvasText; }
  .stepper li[data-step-state]::before { background: CanvasText; }
  .stepper li[data-step-state="skipped"]::before { background: repeating-linear-gradient(90deg, CanvasText 0 4px, transparent 4px 8px); }
  .stepper li[data-step-state="current"] { font-weight: 700; }
  .choice:has(input:checked) { outline: 2px solid Highlight; }
  .choice:has(input:focus-visible) { outline: 3px solid CanvasText; outline-offset: 2px; }
  .choice input { forced-color-adjust: none; border-color: CanvasText; }
  .choice input:checked { border-color: Highlight; }
  .choice input:checked::before { background: Highlight; }
  .status, .error-summary, .consent, .level, .plan, .step { border: 1px solid CanvasText; }
}

@media print {
  .site-header, .consent, .site-status, .band { display: none !important; }
  body { background: #fff; color: #000; }
  .level[data-level="enforce"] { background: none; color: #000; border-color: #000; box-shadow: none; }
  .level[data-level="enforce"] p, .level[data-level="enforce"] p.level-verdict { color: #000; }
}
