/* =============================================================================
   verAIficATor application stylesheet — calm, scientific, legible.
   Tokens live in tokens.css (shared palette with the WordPress theme "trs").
   No build step, no inline styles (CSP style-src 'self'), no external assets.
   A0–A4 / V0–V3 are DESCRIPTIVE: there is deliberately no colour scale for
   levels anywhere in this file.
   ========================================================================== */

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
main { flex: 1 0 auto; }
img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.18; text-wrap: balance; overflow-wrap: break-word; letter-spacing: -0.012em; }
h1 { font-size: var(--step-4); line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 650; }
h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.005em; }
h4 { font-size: var(--step-0); font-weight: 650; }
/* Public pages: serif display headings like the marketing site; app pages stay Inter. */
.page--public h1, .page--public h2 { font-family: var(--font-serif); font-weight: 600; }
.page--public .card h2, .page--public .panel h2, .page--public .notice h2 { font-family: var(--font); font-size: var(--step-1); font-weight: 650; }

p { text-wrap: pretty; overflow-wrap: break-word; max-width: var(--container-text); }
@media (max-width: 46rem) {
  h1, h2, h3, h4, p, li, dd, dt, td, th, summary, label { hyphens: auto; }
}
.mono, .hash, .id, code, kbd, pre { font-family: var(--font-mono); hyphens: none; overflow-wrap: anywhere; }
code, kbd { font-size: 0.92em; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; overflow-x: auto; font-size: var(--step--1); }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color 0.15s var(--ease); }
a:hover { color: var(--blue-600); }
strong, b { font-weight: 650; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-xl) 0; }
ul, ol { padding-left: 1.2rem; }
li + li { margin-top: 0.3rem; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.15em; cursor: help; }
::selection { background: var(--blue-100); color: var(--ink); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 1000; padding: 0.6rem 1rem; background: var(--navy); color: var(--text-on-navy); border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------- layout */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--text { max-width: calc(var(--container-text) + 2 * var(--gutter)); }
.section { padding-block: clamp(1.75rem, 4vw, 3rem) var(--space-2xl); }
.stack > * + * { margin-top: var(--flow, 1rem); }
.stack--lg { --flow: 2rem; } .stack--sm { --flow: 0.5rem; }
.grid { display: grid; gap: var(--space-md); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.grid > *, .split > * { min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.cluster--between { justify-content: space-between; }
.split { display: grid; gap: var(--space-lg); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.prose { max-width: var(--container-text); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2.25rem; font-size: var(--step-2); }
.prose h3 { margin-top: 1.5rem; }
.prose section + section { margin-top: 2.25rem; }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: var(--step--1); } .tiny { font-size: var(--step--2); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.eyebrow::before { content: ""; width: 1.4rem; height: 1px; background: currentColor; opacity: 0.6; }
.page-head { display: grid; gap: 0.75rem; }
.page-head .lead { margin-top: 0.25rem; }
.page-head__actions { margin-top: 0.5rem; }

/* -------------------------------------------------------------- wordmark */
.wordmark { font-family: var(--font); font-weight: 600; letter-spacing: -0.015em; color: var(--navy); white-space: nowrap; }
.wordmark .wm-em { color: var(--blue); font-weight: 800; letter-spacing: -0.005em; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: var(--touch); text-decoration: none; color: inherit; min-width: 0; }
.brand__mark { width: auto; height: 40px; flex: 0 0 auto; }
.brand__text { display: grid; line-height: 1.1; min-width: 0; }
.brand .wordmark { font-size: 1.35rem; }
.brand__descriptor { margin-top: 0.2rem; font-size: 0.7rem; font-weight: 500; color: var(--faint); letter-spacing: 0.01em; line-height: 1.3; max-width: 15.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 30rem) {
  .brand__mark { height: 32px; }
  .brand .wordmark { font-size: 1.15rem; }
  .brand__descriptor { display: none; }
}
/* Header mark: the light-on-dark variant and light wordmark in dark mode. */
.brand__mark--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__mark--light { display: none; }
  :root:not([data-theme="light"]) .brand__mark--dark { display: block; }
  :root:not([data-theme="light"]) .brand:not(.brand--negative) .wordmark { color: var(--text-on-navy); }
  :root:not([data-theme="light"]) .brand:not(.brand--negative) .wordmark .wm-em { color: #8fc0f4; }
}
:root[data-theme="dark"] .brand__mark--light { display: none; }
:root[data-theme="dark"] .brand__mark--dark { display: block; }
:root[data-theme="dark"] .brand:not(.brand--negative) .wordmark { color: var(--text-on-navy); }
:root[data-theme="dark"] .brand:not(.brand--negative) .wordmark .wm-em { color: #8fc0f4; }
.footer__brand .brand__mark--dark { display: block; }
.brand--negative .wordmark { color: var(--text-on-navy); }
.brand--negative .wordmark .wm-em { color: #8fc0f4; }
.brand--negative .brand__descriptor { color: var(--muted-on-navy); }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--line); transition: box-shadow 0.2s var(--ease); }
.site-header.is-scrolled { box-shadow: 0 6px 24px -18px rgba(13, 35, 64, 0.35); }
.site-header__inner { display: flex; align-items: center; gap: 0.5rem; min-height: var(--header-h); }
.site-header__spacer { flex: 1 1 auto; min-width: 0.5rem; }
.site-header .btn--sm { min-height: var(--touch); }

.nav-primary { display: none; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu li { margin: 0; }
.nav-primary .menu { display: flex; gap: 0.15rem; }
.nav-primary a { display: flex; align-items: center; min-height: var(--touch); padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--ink-2); font-size: var(--step--1); font-weight: 550; text-decoration: none; white-space: nowrap; }
.nav-primary a:hover { color: var(--blue); background: var(--blue-50); }
.nav-primary a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 8px 8px 0 0; }
.site-header .nav-cta { display: none; }
.nav-login { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-login__icon { display: none; width: 1.15rem; height: 1.15rem; }
@media (max-width: 40rem) {
  .nav-login { width: var(--touch); padding-inline: 0; justify-content: center; }
  .nav-login__icon { display: block; }
  .nav-login__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Account menu (signed in): native <details> dropdown, desktop only. */
.nav-account { position: relative; display: none; }
.nav-account summary { list-style: none; cursor: pointer; }
.nav-account summary::-webkit-details-marker { display: none; }
.nav-account__btn { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 16rem; }
.nav-account__btn .icon { width: 1.1rem; height: 1.1rem; }
.nav-account__btn .chev { width: 0.8rem; height: 0.8rem; }
.nav-account__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account[open] .nav-account__btn { border-color: var(--blue); }
.nav-account__menu { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 200; min-width: 15rem; padding: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.nav-account__menu a, .nav-account__menu button { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: 0.55rem 0.8rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--step--1); font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; }
.nav-account__menu a:hover, .nav-account__menu button:hover, .nav-account__menu a[aria-current="page"] { background: var(--blue-50); color: var(--blue); }
.nav-account__menu hr { margin: 0.35rem 0; }
.nav-account__menu .menu-heading { display: block; padding: 0.4rem 0.8rem 0.2rem; font-size: var(--step--2); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* Burger + drawer: native <details>, usable without JavaScript. */
.nav-drawer { display: block; }
.nav-drawer > summary { list-style: none; cursor: pointer; }
.nav-drawer > summary::-webkit-details-marker { display: none; }
.nav-toggle { display: inline-grid; place-items: center; width: var(--touch); height: var(--touch); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.nav-toggle:hover { border-color: var(--blue); }
.nav-toggle__bars, .nav-toggle__bars i, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle__bars { position: relative; background: transparent; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-drawer[open] .nav-toggle__bars i { opacity: 0; }
.nav-drawer[open] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-drawer[open] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }
.nav-drawer__panel { position: fixed; inset: var(--header-h) 0 0 0; z-index: 90; overflow-y: auto; background: var(--paper); padding: var(--space-lg) var(--gutter) var(--space-2xl); }
.nav-drawer__panel .menu li { border-bottom: 1px solid var(--line); }
.nav-drawer__panel .menu a { display: flex; align-items: center; min-height: 3.5rem; padding: 0.75rem 0; color: var(--ink); font-family: var(--font-serif); font-size: var(--step-2); text-decoration: none; }
.nav-drawer__panel .menu a[aria-current="page"] { color: var(--blue); }
.nav-drawer__cta { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); }
.nav-drawer__account { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--line-strong); }
.nav-drawer__account h2 { font-family: var(--font); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.5rem; }
.nav-drawer__account .menu a, .nav-drawer__account .menu button { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: 0.6rem 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--step-0); font-family: var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.nav-drawer__account .menu li { border-bottom: 1px solid var(--line); }
.nav-drawer__meta { margin-top: var(--space-lg); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--step--1); }
.nav-drawer__meta a { color: var(--muted); display: inline-flex; align-items: center; min-height: var(--touch); }

@media (min-width: 75rem) {
  .nav-primary { display: block; }
  .site-header .nav-cta { display: inline-flex; }
  .nav-account { display: block; }
  .nav-drawer { display: none; }
  .site-header__inner { gap: 0.75rem; }
}

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy); color: var(--muted-on-navy); margin-top: var(--space-2xl); padding-block: var(--space-2xl) var(--space-lg); font-size: var(--step--1); }
.site-footer a { color: #d9e6f5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { max-width: none; }
.footer__top { display: grid; gap: var(--space-xl); }
@media (min-width: 56rem) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__brand .brand__mark { height: 44px; }
.footer__claim { margin-top: var(--space-md); font-family: var(--font-serif); font-size: var(--step-1); color: var(--text-on-navy); font-style: italic; }
.footer__operator { margin-top: var(--space-sm); color: var(--muted-on-navy); }
.footer__address { margin-top: var(--space-sm); font-style: normal; line-height: 1.5; color: var(--muted-on-navy); }
.footer__col h2 { font-family: var(--font); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint-on-navy); margin-bottom: var(--space-sm); }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.footer__col li { margin: 0; }
.footer__col a { display: inline-flex; align-items: center; min-height: var(--touch); min-width: 2.5rem; }
@media (min-width: 56rem) { .footer__col a { min-height: 2rem; } }
.footer__bottom { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); justify-content: space-between; align-items: center; margin-top: var(--space-xl); padding-top: var(--space-md); border-top: 1px solid var(--line-on-navy); color: var(--faint-on-navy); font-size: var(--step--2); }
.footer__bottom p { margin: 0; }
.footer__bottom .mono { color: var(--muted-on-navy); }

/* --------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--touch); padding: 0.6rem 1.15rem;
  border: 1px solid var(--btn-bd); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: var(--step--1); font-weight: 600; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { --btn-bd: var(--blue); color: var(--btn-fg); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--primary { --btn-bg: var(--blue); --btn-fg: var(--text-on-accent); --btn-bd: var(--blue); }
.btn--primary:hover { --btn-bg: var(--blue-600); --btn-bd: var(--blue-600); color: var(--text-on-accent); }
.btn--ghost { --btn-bg: transparent; }
.btn--danger { --btn-fg: var(--danger); --btn-bd: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger-50); --btn-bd: var(--danger); color: var(--danger); }
.btn--sm { min-height: 2.4rem; padding: 0.4rem 0.9rem; }
.btn--icon { width: var(--touch); padding-inline: 0; }
.btn--block { width: 100%; }
.login-card { max-width: 26rem; }
.btn--sso { --btn-bg: #131314; --btn-fg: #e3e3e3; --btn-bd: #8e918f; }
.btn--sso:hover { --btn-bg: #1c1c1e; --btn-bd: #c4c7c5; color: #e3e3e3; }
.btn--sso img { flex: none; }
.btn__icon { flex: none; margin-right: 0.15rem; }
.login-card__alt { text-align: center; margin: -4px 0; }
.login-card { display: flex; flex-direction: column; gap: 10px; }
.login-card > * { margin: 0; }
.login-card > .login-card__alt { margin: -4px 0; }
main:has(.login-card) .btn { border-radius: 999px; min-height: 40px; }
.btn .icon { width: 1.1rem; height: 1.1rem; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.4rem; min-height: var(--touch); font-weight: 600; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ------------------------------------------- cards, panels, notices, badges */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-md); box-shadow: var(--shadow-sm); }
@media (min-width: 40rem) { .card { padding: var(--space-lg); } }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 0.6rem; }
.card--link { display: block; color: inherit; text-decoration: none; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.card--link:hover { border-color: var(--blue-100); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.card--muted p { color: var(--muted); font-size: var(--step--1); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-md); }
@media (min-width: 40rem) { .panel { padding: var(--space-lg); } }
.panel > h2:first-child, .panel > h3:first-child { margin-bottom: 0.6rem; }
.notice { display: block; padding: 0.85rem 1rem; background: var(--blue-50); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--radius); color: var(--ink-2); font-size: var(--step--1); }
.notice > strong:first-child, .notice > .notice__title { display: block; margin-bottom: 0.2rem; color: var(--ink); }
.notice p { max-width: none; }
.notice p + p, .notice p + ul { margin-top: 0.4rem; }
.notice ul { margin-top: 0.35rem; }
.notice--warn { border-left-color: var(--warn); background: var(--warn-50); }
.notice--ok { border-left-color: var(--ok); background: var(--ok-50); }
.notice--danger { border-left-color: var(--danger); background: var(--danger-50); }
.messages { list-style: none; padding: 0; display: grid; gap: 0.5rem; margin-bottom: var(--space-md); }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: var(--step--2); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; line-height: 1.4; }
.badge--status { border-color: var(--blue); color: var(--blue); }
/* Levels describe, they do not grade: neutral, monospace, never coloured. */
.badge--level { font-family: var(--font-mono); border-radius: 5px; min-width: 2.3rem; justify-content: center; background: var(--surface-2); }
/* Explicit, user-confirmed exception (ARCHITECTURE.md §9.1): this one indicator
   marks independent-review status, not a quality score, so it is coloured. */
.badge--verified { border-color: var(--ok); color: var(--ok); background: var(--ok-50); font-weight: 750; letter-spacing: 0.06em; cursor: help; }
/* System states (admin dashboard): colour plus text, never colour alone. */
.badge--ok, .badge--warn, .badge--danger { white-space: normal; text-align: left; }
.badge--ok { border-color: var(--ok); color: var(--ok); background: var(--ok-50); }
.badge--danger { border-color: var(--danger); color: var(--danger); background: var(--danger-50); }
.badge--warn { border-color: var(--warn); color: var(--warn); background: var(--warn-50); }
.stat { display: grid; gap: 0.2rem; }
.stat-label { color: var(--muted); font-size: var(--step--1); }
.stat-value { font-family: var(--font-mono); font-size: var(--step-2); font-weight: 700; color: var(--ink); }

/* ---------------------------------------------------------- key / value */
.kv { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); gap: 0.5rem 1.25rem; margin: 0; font-size: var(--step--1); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 0.75rem; font-size: var(--step--2); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
  .kv dt:first-child { margin-top: 0; }
  .kv dd { margin-top: 0.1rem; font-size: var(--step-0); }
}

/* ---------------------------------------------------------------- tables */
.table-wrap {
  position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)),
    linear-gradient(to right, rgba(255, 255, 255, 0), var(--surface) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(13, 35, 64, 0.22), rgba(13, 35, 64, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(13, 35, 64, 0.22), rgba(13, 35, 64, 0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}
table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
caption { text-align: left; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; color: var(--ink); }
th[scope="row"] { background: transparent; font-weight: 600; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.level { white-space: nowrap; }
td.actions { white-space: nowrap; }
.matrix th, .matrix td { padding: 0.55rem 0.7rem; }

/* Content tables become stacked cards under 40rem (needs data-label on <td>). */
@media (max-width: 40rem) {
  .table-wrap--stack { overflow: visible; border: 0; border-radius: 0; background: none; }
  /* Column headers are repeated per cell via data-label, so the head goes away entirely
     (an absolutely positioned thead still widened the page in Chromium). */
  .table--stack thead { display: none; }
  .table--stack caption { display: block; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td, .table--stack th { display: block; }
  .table--stack tr { padding: 0.5rem 0.9rem; margin-bottom: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .table--stack tr:last-child { margin-bottom: 0; }
  .table--stack td, .table--stack th { border: 0; padding: 0.4rem 0; }
  .table--stack td[data-label] { display: grid; grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr); gap: 0.75rem; align-items: start; }
  .table--stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--step--2); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 0.15em; }
  .table--stack td.stack-head, .table--stack th.stack-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-bottom: 0.5rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--line); font-weight: 650; color: var(--ink); }
  .table--stack td.stack-head::before { content: none; }
  .table--stack td.actions { padding-top: 0.6rem; }
  .table--stack td.actions::before { content: none; }
  .table--stack td.actions .btn { width: 100%; }
  .table--stack td:empty { display: none; }
  .table--stack td.level { display: inline-grid; margin-right: 1rem; }
}

/* ----------------------------------------------------------------- forms */
.form { display: grid; gap: var(--space-md); }
.field { display: grid; gap: 0.35rem; }
.field > label, .fieldset > legend, .filters label { font-weight: 600; font-size: var(--step--1); color: var(--ink); }
.field .help, .help, .hint { color: var(--faint); font-size: var(--step--1); max-width: 62ch; }
.field--inline { grid-template-columns: auto 1fr; align-items: center; gap: 0.7rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="range"]),
select, textarea {
  width: 100%; min-height: var(--touch); padding: 0.55rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: max(1rem, var(--step-0)); line-height: 1.4;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%; background-size: 0.35rem 0.35rem, 0.35rem 0.35rem; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding-right: 0.85rem; }
textarea { min-height: 7rem; resize: vertical; }
input[type="file"] { font: inherit; font-size: var(--step--1); color: var(--ink-2); padding: 0.4rem 0; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--blue); flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
.field--error :is(input, select, textarea), .field[data-invalid="true"] :is(input, select, textarea) { border-color: var(--danger); }
.errorlist { list-style: none; padding: 0; margin: 0; color: var(--danger); font-size: var(--step--1); display: grid; gap: 0.2rem; }
.errorlist li { padding-left: 1.3rem; position: relative; }
.errorlist li::before { content: "!"; position: absolute; left: 0; top: 0.1em; width: 1em; height: 1em; border-radius: 50%; background: var(--danger); color: var(--danger-50); font-size: 0.8em; font-weight: 800; line-height: 1; display: grid; place-items: center; }
.required-hint { color: var(--faint); font-size: var(--step--2); }
.choice-list { display: grid; gap: 0.15rem; }
.choice-list label, .choice { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; min-height: var(--touch); padding: 0.55rem 0.6rem; border-radius: var(--radius-sm); font-size: var(--step--1); font-weight: 400; color: var(--ink-2); cursor: pointer; }
.choice-list label:hover, .choice:hover { background: var(--surface-2); }
.choice-list input, .choice input { margin-top: 0.15rem; }
.choice-list--compact { gap: 0; }
.choice-list--compact label { min-height: 2.25rem; padding: 0.3rem 0.4rem; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-md); min-width: 0; }
.fieldset > legend { padding-inline: 0.4rem; }
.fieldset .choice-list { margin-top: 0.25rem; }
.filters { display: grid; gap: var(--space-sm); grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); align-items: end; }
.filters .field { gap: 0.25rem; }
.filters__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters-toggle > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--touch); padding: 0.5rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-weight: 600; font-size: var(--step--1); margin-bottom: var(--space-sm); }
.filters-toggle > summary::-webkit-details-marker { display: none; }
.filters-toggle > summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: 0.25rem; transition: transform 0.15s var(--ease); }
.filters-toggle[open] > summary::after { transform: rotate(-135deg); }
@media (min-width: 56rem) { .filters-toggle > summary { display: none; } }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: end; max-width: 36rem; }

/* ---------------------------------------------------------------- wizard */
.wizard-progress { display: grid; gap: 0.35rem; }
.wizard-progress__text { font-size: var(--step--1); color: var(--muted); }
.wizard-progress__text strong { color: var(--ink); }
.wizard-progress progress { width: 100%; height: 0.45rem; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.wizard-progress progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.wizard-progress progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
.wizard-progress progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.wizard-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; counter-reset: s; }
.wizard-steps li { counter-increment: s; margin: 0; }
.wizard-steps a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--touch); padding: 0.35rem 0.75rem 0.35rem 0.4rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: var(--step--1); text-decoration: none; }
.wizard-steps a::before { content: counter(s); display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--step--2); font-weight: 700; }
.wizard-steps a:hover { border-color: var(--blue); color: var(--blue); }
.wizard-steps li[aria-current="step"] a { border-color: var(--blue); color: var(--blue); font-weight: 600; background: var(--blue-50); }
.wizard-steps li[aria-current="step"] a::before { background: var(--blue); color: var(--text-on-accent); }
.wizard-steps li.is-done a { color: var(--ink-2); }
.wizard-steps li.is-done a::before { content: "\2713"; background: var(--ok-50); color: var(--ok); }
@media (max-width: 56rem) { .wizard-steps { display: none; } }
@media (min-width: 56rem) { .wizard-progress { display: none; } }
.wizard-actions { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--line); }
@media (max-width: 30rem) {
  .wizard-actions { flex-direction: column-reverse; }
  .wizard-actions .btn { width: 100%; }
  .wizard-actions > span:empty { display: none; }
}
/* One card per activity (replaces the former 9-column table). */
.activity-list { display: grid; gap: var(--space-md); }
.activity-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 0; min-width: 0; }
.activity-card > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.activity-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem var(--space-md); border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.activity-card__title { font-weight: 650; color: var(--ink); font-size: var(--step-0); }
.activity-card__use { display: inline-flex; align-items: center; gap: 0.6rem; min-height: var(--touch); padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); font-weight: 600; font-size: var(--step--1); cursor: pointer; }
.activity-card__use:hover { background: var(--surface-3); }
.activity-card__body { display: grid; gap: var(--space-md); padding: var(--space-md); }
@media (min-width: 40rem) { .activity-card__body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.activity-card__body .field--wide { grid-column: 1 / -1; }
.activity-card .errorlist { grid-column: 1 / -1; }
.activity-card__extra .choice-list { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.25rem; max-height: 12rem; overflow-y: auto; }

/* --------------------------------------------------------- public record */
.record-head { display: grid; gap: 0.9rem; padding: var(--space-md); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
@media (min-width: 40rem) { .record-head { padding: var(--space-lg); } }
.record-head__top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.record-head .id { font-family: var(--font-mono); font-size: var(--step-2); font-weight: 700; letter-spacing: 0.02em; color: var(--ink); margin-right: auto; }
.record-head h1 { font-size: var(--step-3); line-height: 1.2; margin: 0; }
.record-head__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--muted); font-size: var(--step--1); }
.record-head__meta span + span::before { content: "·"; margin-right: 1rem; color: var(--faint); }
@media (max-width: 30rem) { .record-head__meta { flex-direction: column; } .record-head__meta span + span::before { content: none; } }
.record-head__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
@media (max-width: 30rem) { .record-head__actions .btn { flex: 1 1 calc(50% - 0.5rem); } }
.record-head__actions .btn { min-height: var(--touch); }
.record-section { display: grid; gap: var(--space-md); }
.record-section > h2 { padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.hash { font-family: var(--font-mono); font-size: var(--step--1); overflow-wrap: anywhere; color: var(--ink-2); }
.hash-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.hash-line .btn { min-height: 2.4rem; }
.qr { width: 160px; height: 160px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px; }
.level-legend { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.9rem; font-size: var(--step--1); margin: 0; }
.level-legend dt { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.level-legend dd { margin: 0; color: var(--ink-2); }
.level-legend dd strong { display: block; font-weight: 600; }
details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.6rem; min-height: var(--touch); font-weight: 650; color: var(--ink); }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); transition: transform 0.15s var(--ease); margin-left: 0.2rem; }
details.panel[open] > summary::before { transform: rotate(45deg); }
.verification-bars { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.verification-bars .badge { gap: 0.5rem; }
.verification-bars .badge b { font-weight: 800; }
.statement-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.statement-list li { position: relative; padding-left: 1.7rem; margin: 0; }
.statement-list li::before { content: ""; position: absolute; left: 0.15rem; top: 0.5em; width: 0.85rem; height: 0.45rem; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.version-table td.mono a { font-weight: 600; }
.table--stack .stack-head a, .table-wrap td a { display: inline-flex; align-items: center; min-height: 1.5rem; }

/* ------------------------------------------------------- misc components */
.code-display { display: block; font-family: var(--font-mono); font-size: var(--step-2); font-weight: 700; letter-spacing: 0.06em; padding: 0.9rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.area-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; padding: 0; margin: 0; border-bottom: 1px solid var(--line); }
.subnav li { margin: 0; }
.subnav a { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0.5rem 0.8rem; color: var(--ink-2); font-size: var(--step--1); font-weight: 550; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--blue); }
.subnav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.pager .btn { min-height: var(--touch); }
.hero { background: radial-gradient(900px 320px at 90% 0%, rgba(30, 102, 172, 0.10), transparent 70%), linear-gradient(180deg, var(--blue-50), transparent 70%); border-radius: var(--radius-lg); padding: clamp(1.25rem, 4vw, 2.5rem); }
.hero h1 { max-width: 22ch; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.feature-list li { position: relative; padding-left: 1.7rem; margin: 0; font-size: var(--step--1); color: var(--ink-2); }
.feature-list li::before { content: ""; position: absolute; left: 0.15rem; top: 0.5em; width: 0.85rem; height: 0.45rem; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.steps > li { counter-increment: step; position: relative; margin: 0; padding: var(--space-md); padding-top: calc(var(--space-md) + 1.9rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; top: var(--space-md); left: var(--space-md); font-family: var(--font-mono); font-size: var(--step--1); font-weight: 600; color: var(--blue); letter-spacing: 0.05em; }
.steps h3 { margin-bottom: 0.35rem; }
.steps p { color: var(--muted); font-size: var(--step--1); }
.error-page { display: grid; gap: var(--space-md); }
.error-page .code { font-family: var(--font-mono); color: var(--faint); font-size: var(--step--1); letter-spacing: 0.08em; }

/* ----------------------------------------------------------------- print */
@media print {
  .site-header, .site-footer, .no-print, .skip-link, .nav-drawer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .panel, .record-head { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; background: none; }
  a { color: inherit; text-decoration: none; }
  .record-head__actions { display: none; }
  details.panel > summary { display: none; }
}
