/* PDFUA web — self-hosted styles (no external fonts or CDNs, to keep the CSP strict).
   Light and dark themes, AA contrast, keyboard-friendly focus, reduced-motion aware. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f5f7fb;
  --surface-2: #eef2f9;
  --blocking: #b3261e;      /* "needed to pass" labels: 5.6:1 on --surface-2 */
  --text: #16181d;
  --muted: #4b515c;
  --border: #d3d9e2;

  --brand: #0b57d0;
  --on-brand: #ffffff;
  --brand-hover: #0a49ad;
  --progress-fill: #cfe0fb;   /* Fix file button while fixing (text on it stays --text: 4.5:1+) */
  --link: #0b4fbf;

  --pass: #0a6b2d;  --pass-bg: #e5f3ea;
  --fail: #a1140b;  --fail-bg: #fbe9e7;
  --warn: #7a5200;  --warn-bg: #fbf0d9;
  --manual: #5a3ea8; --manual-bg: #eee9fb;

  --focus: #16181d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --maxw: 68rem;
}

/* Dark colours: when the page theme is "dark" (theme.js), or without JavaScript on a device set to dark.
   The two blocks must stay identical (theme.js sets data-theme). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #161922;
  --surface-2: #1d212c;
  --blocking: #ff8a80;    /* 7:1 on the dark --surface-2 */
  --text: #e9ecf2;
  --muted: #aeb6c4;
  --border: #2a3040;

  --brand: #9ec5ff;
  --on-brand: #0b1a33;
  --brand-hover: #bcd6ff;
  --progress-fill: #23406e;
  --link: #9ec5ff;

  --pass: #79d99b;  --pass-bg: #10291a;
  --fail: #ff9a8f;  --fail-bg: #2c1512;
  --warn: #f0c674;  --warn-bg: #2a2210;
  --manual: #c9b6f5; --manual-bg: #1e1733;

  --focus: #9ec5ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1115;
    --surface: #161922;
    --surface-2: #1d212c;
    --blocking: #ff8a80;    /* 7:1 on the dark --surface-2 */
    --text: #e9ecf2;
    --muted: #aeb6c4;
    --border: #2a3040;

    --brand: #9ec5ff;
    --on-brand: #0b1a33;
    --brand-hover: #bcd6ff;
    --progress-fill: #23406e;
    --link: #9ec5ff;

    --pass: #79d99b;  --pass-bg: #10291a;
    --fail: #ff9a8f;  --fail-bg: #2c1512;
    --warn: #f0c674;  --warn-bg: #2a2210;
    --manual: #c9b6f5; --manual-bg: #1e1733;

    --focus: #9ec5ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

/* The hidden attribute must always win over component display rules (e.g. .progress uses grid). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: .2em 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: .6em 0; }

a { color: var(--link); }
a:hover { color: var(--brand-hover); }

/* Visible, consistent focus for every interactive element. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.icon { font-style: normal; }

/* Skip link */
.skip-link {
  position: absolute; left: .5rem; top: -3rem;
  background: var(--brand); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: var(--radius); z-index: 10;
  transition: top .15s ease;
}
.skip-link:focus { top: .5rem; color: var(--on-brand); }

/* Buttons — min target size 44px (exceeds WCAG 2.2 2.5.8). */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .6rem 1.25rem;
  border-radius: var(--radius); border: 2px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--link); }

/* Header & nav */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; text-decoration: none; color: var(--text); }
.brand-logo { width: 34px; height: 34px; display: block; flex: none; }
.brand-name { font-size: 1.4rem; letter-spacing: -.02em; }
/* Header tools, pushed to the right: account, theme, language. */
.brand { margin-right: auto; }
.lang-select select {
  min-height: 34px; padding: .2rem .5rem;
  border: 1px solid var(--border); border-radius: 999px;
  background-color: var(--bg); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
/* Theme switch: a pill of two buttons. */
.theme-switch { display: inline-flex; gap: .2rem; border: 1px solid var(--border); border-radius: 999px; padding: .15rem; }
.theme-switch button {
  min-height: 32px; padding: .2rem .6rem;
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; border-radius: 999px; cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

/* Sections share vertical rhythm */
main > section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-intro { color: var(--muted); max-width: 46rem; font-size: 1.05rem; }

/* Hero */
.hero { text-align: left; padding-bottom: 0; }   /* no buttons under the tagline: let the next section sit closer */
.hero .lede { margin-bottom: 0; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 42rem; }

/* Checker */
.checker { background: var(--surface); border-radius: var(--radius); margin-block: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); }
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; background: var(--bg); margin-top: 1rem;
}
.drop.over { border-color: var(--brand); background: var(--surface-2); }
.drop .btn { margin: .5rem 0; }
.status { margin-top: 1rem; min-height: 1.5rem; color: var(--muted); }
/* Progress while a document is checked (native <progress>, styled; text label above it) */
.progress { margin-top: .5rem; display: grid; gap: .35rem; max-width: 32rem; }
.progress-label { font-size: .95rem; color: var(--text); }
.progress progress {
  appearance: none; -webkit-appearance: none; width: 100%; height: .75rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
.progress progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; transition: width .2s ease; }
.progress progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.drop.busy { opacity: .6; }
.drop.busy .btn { pointer-events: none; }
.status.error { color: var(--fail); font-weight: 600; }

.results { margin-top: 1.5rem; }
.results-summary { margin: .75rem 0 1.25rem; }
/* Summary cards: passed / failed / warnings. Icon + number + label; colour is never the only cue. */
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.stat {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
  border: 1px solid var(--border); border-left-width: 5px; border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow);
}
.stat-icon { flex: none; width: 2.4rem; height: 2.4rem; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.stat-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.stat-label { font-weight: 600; color: var(--text); }
.stat-sub { font-size: .88rem; color: var(--muted); margin-top: .15rem; }
.stat-passed { border-left-color: var(--pass); } .stat-passed .stat-icon { color: var(--pass); }
.stat-failed { border-left-color: var(--fail); } .stat-failed .stat-icon { color: var(--fail); }
.stat-warnings { border-left-color: var(--warn); } .stat-warnings .stat-icon { color: var(--warn); }
/* Fixed rules: a muted card (first), so it informs without competing with the outcome cards. */
.stat-fixed { background: var(--surface-2); border-left-color: var(--muted); box-shadow: none; }
.stat-fixed .stat-icon { color: var(--muted); }
.stat.is-zero:not(.stat-passed) { border-left-color: var(--border); box-shadow: none; }
.stat.is-zero:not(.stat-passed) .stat-icon { color: var(--muted); }
.stat.is-zero:not(.stat-passed) .stat-value { color: var(--muted); }
.stats-note { margin: .75rem 0 0; color: var(--muted); }

/* Check list with status badges (never colour alone — each has a label) */
.checks { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .5rem; }
.checks li {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.badge {
  flex: none; display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .2rem .55rem; border-radius: 999px; min-width: 7.5rem; justify-content: center;
}
.badge::before { content: ""; }
.badge-pass { background: var(--pass-bg); color: var(--pass); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--surface-2); color: var(--muted); }
.badge-fixed { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.check-text { display: flex; flex-direction: column; }
.check-title { font-weight: 600; }
.check-detail { color: var(--muted); font-size: .9rem; }

/* Grouped report: one disclosure per category (button + panel), counts as text */
.categories { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .6rem; }
.category { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.category-heading { margin: 0; font-size: 1rem; }
.disclosure {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 44px;
  padding: .8rem 1rem; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.disclosure:hover { background: var(--surface-2); }
.disclosure:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.category-name { font-weight: 700; flex: 1; }
.category-counts { display: inline-flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.count { font-size: .85rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap; }
.count-error { background: var(--fail-bg); color: var(--fail); }
.count-warning { background: var(--warn-bg); color: var(--warn); }
.count-ok { background: var(--pass-bg); color: var(--pass); }
.count-fixed { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.chevron { flex: none; width: .6rem; height: .6rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin: 0 .25rem .2rem; transition: transform .15s ease; }
.disclosure[aria-expanded="true"] .chevron { transform: rotate(225deg); margin-bottom: -.2rem; }
.disclosure-panel { padding: 0 1rem 1rem; }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rule { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .8rem; border-radius: var(--radius); background: var(--surface); }
.rule-fail { border-left: 4px solid var(--fail); }
.rule-warning { border-left: 4px solid var(--warn); }
.rule-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.rule-body p { margin: 0; }
.rule-title { font-weight: 600; }
.rule-where { color: var(--text); }
.rule-note { color: var(--muted); font-size: .9rem; }
.rule-meta { color: var(--muted); font-size: .88rem; }
.rule-meta a { color: var(--link); }
.rule-empty { color: var(--muted); margin: 0; }
.disclosure-na { width: auto; min-height: 44px; margin-top: .6rem; padding: .4rem .6rem; color: var(--link); font-size: .92rem; }
.disclosure-na .chevron { width: .45rem; height: .45rem; }
.rule-list-na { margin-top: .4rem; }

/* Rule reference page (rules.html, generated by tools/gen_report_pages.py) */
.rules-page { padding-bottom: 3rem; }
.rules-back { margin-left: auto; }
.rules-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: clamp(2rem, 5vw, 3.5rem); }
.rules-hero h1 { margin: 0 0 .75rem; font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: -.02em; }
.rules-lead { font-size: 1.2rem; max-width: 46rem; margin: 0 0 .75rem; }
.rules-source { color: var(--muted); max-width: 46rem; margin: 0 0 1.25rem; }
.rules-stats { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; }
.rules-stats li { border: 1px solid var(--border); border-radius: 999px; padding: .35rem .9rem; background: var(--bg); }
.rules-stats strong { font-size: 1.1rem; margin-right: .2rem; }

.rules-cats { margin-top: 2rem; }
.rules-cat-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.rules-cat-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem;
  align-items: center; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; height: 100%; box-sizing: border-box; }
.rules-cat-card:hover { border-color: var(--brand); color: var(--text); }
.rules-cat-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rules-cat-card .cat-icon { grid-row: 1 / 3; width: 2.4rem; height: 2.4rem; padding: .45rem; box-sizing: border-box;
  border-radius: 10px; background: var(--bg); color: var(--brand); }
.rules-cat-name { font-weight: 700; }
.rules-cat-count { color: var(--muted); font-size: .9rem; font-weight: 400; }

.rules-legend { margin-top: 2rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.rules-legend h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.rules-legend dl { margin: 0; display: grid; gap: .5rem; }
.rules-legend dl > div { display: grid; grid-template-columns: 13rem 1fr; gap: .75rem; align-items: baseline; }
.rules-legend dt, .rules-legend dd { margin: 0; }
@media (max-width: 40rem) { .rules-legend dl > div { grid-template-columns: 1fr; gap: .2rem; } }

.rules-cat { margin-top: 3rem; }
.rules-cat-heading { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; scroll-margin-top: 5rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--border); }
.rules-cat-heading .cat-icon { width: 1.6rem; height: 1.6rem; color: var(--brand); flex: none; }
.rules-cat-heading .rules-cat-count { margin-left: auto; font-size: 1rem; }
.rules-cp { margin: 1.75rem 0 .6rem; color: var(--muted); font-size: 1rem; font-weight: 600; }
.rule-ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.rule-ref { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; background: var(--bg);
  scroll-margin-top: 5rem; }
.rule-ref:target { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.rule-ref h4 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.rule-id { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; font-weight: 600;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: .05rem .4rem; margin-right: .45rem; vertical-align: .1em; }
.rule-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; }
.badge-rule { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .82rem; font-weight: 600;
  border: 1px solid; }
.badge-auto { color: var(--text); border-color: var(--border); background: var(--surface); }
.badge-human { color: var(--text); border-color: color-mix(in srgb, var(--manual) 55%, var(--border));
  background: var(--manual-bg); }
.badge-fix { color: #10232A; border-color: #F2A33A; background: #FCE3BE; }
.rule-guide { margin-top: .9rem; max-width: 72ch; }
.rule-guide h5 { margin: 0 0 .3rem; font-size: .95rem; }
.rule-guide p { margin: 0 0 .45rem; }
.rule-tf { padding-left: .75rem; border-left: 3px solid #F2A33A; }
.rule-steps-intro { color: var(--muted); }
.rule-steps { margin: 0; padding-left: 1.4rem; }
.rule-steps li { margin-bottom: .3rem; }
.rule-more { margin-top: .75rem; max-width: 72ch; }
.rule-more summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: 24px; }
.rule-more summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rule-more h5 { margin: .75rem 0 .3rem; font-size: .95rem; }
.rule-more p { margin: 0 0 .5rem; }
.rule-official { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--border); color: var(--muted);
  font-size: .9rem; }
.rule-official p { margin: 0 0 .2rem; }
.rule-official q { font-style: italic; }
.rule-official-label { font-weight: 700; color: var(--text); margin-right: .25rem; }
.rules-top { margin: 1.25rem 0 0; font-size: .95rem; }
.rules-attribution { color: var(--muted); font-size: .9rem; margin-top: 3rem; }

.callout { border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; border: 1px solid var(--border); }
.callout-manual { background: var(--manual-bg); border-color: color-mix(in srgb, var(--manual) 40%, var(--border)); }
.callout-manual h4 { margin-top: 0; color: var(--manual); }
.callout-manual { padding: 0; }
.manual-heading { margin: 0; font-size: 1rem; }
.manual-heading .disclosure:hover { background: color-mix(in srgb, var(--manual) 10%, transparent); }
.manual-heading .category-name { color: var(--manual); }
.count-manual { background: var(--bg); color: var(--manual); border: 1px solid color-mix(in srgb, var(--manual) 45%, var(--border)); }
#manual-panel { padding: 0 1.25rem 1rem; }
#manual-panel > p { margin-top: 0; }
.callout ul { margin: .5rem 0 0; padding-left: 1.2rem; }
/* Manual-review rows reuse the automated rule row (.rule); on the purple panel they sit on the page
   background so they read as separate cards. */
.callout ul.manual-list { padding-left: 0; margin-top: .5rem; }
.manual-list .rule { background: var(--bg); border-left: 4px solid var(--manual); }
.badge-manual { background: var(--manual-bg); color: var(--manual); border: 1px solid color-mix(in srgb, var(--manual) 45%, var(--border)); }


/* Actions on the checked file (report download; fixing comes later) */
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.report-actions .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
/* "Fix file" while fixing: the button itself is the progress bar (fills left to right). */
.report-actions .btn.btn-progress[aria-disabled="true"] {
  opacity: 1; cursor: progress; color: var(--text);
  background: linear-gradient(to right, var(--progress-fill) var(--progress, 0%), transparent var(--progress, 0%));
  font-variant-numeric: tabular-nums;
}

/* Suggestions for fixing (typed by the user before fixing) */
.fix-inputs { margin: 1.5rem 0 0; padding: 1rem 1.25rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.fix-inputs legend { padding: 0 .35rem; font-weight: 700; }
.fix-inputs .field { margin-top: 1rem; max-width: 36rem; }
.fix-inputs label { display: block; font-weight: 600; margin-bottom: .3rem; }
.fix-inputs input, .fix-inputs select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--muted); border-radius: 6px; padding: .5rem .6rem;
}
.fix-inputs input:focus-visible, .fix-inputs select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fix-inputs input[aria-invalid="true"] { border: 2px solid var(--fail); }
.field-hint { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }
.field-error { margin: .3rem 0 0; color: var(--fail); font-weight: 600; font-size: .92rem; }

/* Fix result panel */


/* Card grids (features, pricing) */
.card-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card h3 { margin-top: .25rem; }
.card p { color: var(--muted); margin-bottom: 0; }
.card-icon { font-size: 1.6rem; }

/* Pricing */
.pricing-grid { align-items: stretch; row-gap: 1.75rem; }   /* same height per row; prices and buttons line up at the bottom */
.plan { display: flex; flex-direction: column; position: relative; }
.plan-featured { border-color: var(--brand); border-width: 2px; }
/* Sits on the card's top border, so the featured card's content lines up with the others. */
.plan .plan-badge { position: absolute; top: 0; left: 1.5rem; transform: translateY(-50%); background: var(--brand); color: var(--on-brand); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .2rem .6rem; border-radius: 999px; margin: 0; white-space: nowrap; }
.plan .plan-price { font-size: .95rem; color: var(--muted); margin: 0 0 1rem; }
.plan-features { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .5rem; flex: 1; align-content: start; }
.plan-features li { position: relative; padding-left: 1.5rem; color: var(--text); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--pass); font-weight: 700; }
.plan .btn { width: 100%; }
.plan .plan-cost { margin: 0; padding-top: .75rem; border-top: 1px solid var(--border); display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .5rem; }
.plan-amount { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.plan-per { color: var(--muted); font-size: .92rem; }
.pricing-footnote { color: var(--muted); font-size: .92rem; margin-top: 1.5rem; max-width: 46rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 2rem; margin-top: 2rem; color: var(--muted); }

/* Partial-translation banner */
.i18n-banner { background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); border-radius: var(--radius); padding: .6rem 1rem; margin-top: 1rem; font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Alt-text review: replaces the results while open */
.alt-review { margin-top: .25rem; }
.alt-counter { margin: 0; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.alt-item { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .alt-item { grid-template-columns: 1fr; } }
.alt-image-box { display: flex; align-items: center; justify-content: center; min-height: 14rem; padding: .75rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.alt-image-box img { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.alt-figure .btn-small { margin-top: .6rem; min-height: 44px; padding: .4rem .8rem; font-size: .95rem; }
.alt-where { margin: 0 0 .5rem; font-weight: 600; }
.alt-context { margin: 0 0 1rem; }
.alt-context dt { margin-top: .5rem; font-size: .88rem; font-weight: 700; color: var(--muted); }
.alt-context dd { margin: .1rem 0 0; }
.alt-side .field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.alt-side textarea { width: 100%; box-sizing: border-box; min-height: 5.5rem; padding: .55rem .65rem; font: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: 6px; resize: vertical; }
.alt-side textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.field-warning { margin: .35rem 0 0; color: var(--warn); font-weight: 600; font-size: .92rem; }
.alt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: .75rem 0 1rem; }
.alt-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin-left: auto; }
.alt-decorative { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: start; margin-top: 1rem; }
.alt-decorative input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--brand); }
.alt-decorative label { font-weight: 600; }
.alt-decorative .field-hint { grid-column: 2; }
.alt-side textarea:disabled { opacity: .55; cursor: not-allowed; }
/* "Suggestions for fixing": one collapsible group per kind of value, like the result categories */
.fix-group { margin-top: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.fix-group-heading { margin: 0; font-size: 1rem; }
.fix-group-panel > .field:first-child, .fix-group-panel > .field-hint:first-child { margin-top: 0; }
.fix-inputs .fix-group .field { max-width: 36rem; }
.count-input { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.alt-side input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--muted); border-radius: 6px; padding: .5rem .6rem; }
.alt-side input[type="text"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.alt-side .field-source { margin: -.1rem 0 .4rem; }
/* Thumbnail strip under a review: every item, scrolls sideways */
.thumb-strip { display: flex; gap: .5rem; margin: 1.25rem 0 0; padding: .25rem .25rem .6rem; list-style: none;
  overflow-x: auto; scroll-behavior: smooth; }
.thumb-strip li { flex: none; }
.thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 7.5rem; height: 5rem;
  padding: .25rem; background: var(--surface-2); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
.thumb img { max-width: 100%; max-height: 100%; background: #fff; }
.thumb:hover { border-color: var(--muted); }
.thumb:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.thumb.is-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.thumb-num { position: absolute; left: .3rem; top: .25rem; min-width: 1.3rem; padding: 0 .3rem; border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: .78rem; font-weight: 700; line-height: 1.3rem; text-align: center;
  border: 1px solid var(--border); }
.thumb-mark { position: absolute; right: .3rem; top: .25rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; }
.thumb.is-done .thumb-mark { background: var(--pass); }
.thumb.is-done .thumb-mark::after { content: ""; position: absolute; left: .45rem; top: .22rem; width: .3rem; height: .6rem;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.thumb.is-suggested .thumb-mark { border: 2px solid var(--pass); background: var(--bg); }
/* A fieldset is as wide as its widest content by default (min-width: min-content): without this, a
   long thumbnail strip stretches "Suggestions for fixing" (and the preview) to the strip's full width. */
.fix-inputs, .fix-group, .fix-group-panel, .alt-review { min-width: 0; }
.thumb-strip { max-width: 100%; }
/* Comments and annotations: what is there, and a choice of what to do */
.annot-kinds { margin: .4rem 0 .9rem; padding-left: 1.25rem; }
.annot-kinds li { margin: .15rem 0; }
.annot-choice { margin: 0; padding: 0; border: 0; min-width: 0; }
.annot-choice legend { padding: 0; font-weight: 600; margin-bottom: .4rem; }
.annot-option { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: start; margin-top: .6rem; }
.annot-option input { width: 1.2rem; height: 1.2rem; margin: .15rem 0 0; accent-color: var(--brand); }
.annot-option label { font-weight: 600; }
.annot-option .field-hint { grid-column: 2; margin-top: .1rem; }
.annot-option input:disabled + label { color: var(--muted); }
.unt-objects { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.unt-objects-title { margin: 0; font-weight: 700; }
#fix-untagged > .fix-group-panel > .annot-option { margin-top: .9rem; }

/* The question asked before fixing when images are still undecided (a modal <dialog>). */
.undecided-dialog { width: min(36rem, calc(100vw - 2rem)); box-sizing: border-box; border: 1px solid var(--border, #c8c8c8); border-radius: 12px; padding: 0 1.75rem 1.5rem;
  overflow: hidden; box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.undecided-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.undecided-dialog h2 { margin-top: 0; font-size: 1.2rem; }
.undecided-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* A digitally signed file: fixing invalidates the signature. */
.signed-note { border-left: 4px solid var(--warn); padding: 0.5rem 0.75rem; margin: 0.75rem 0; background: var(--warn-bg); color: var(--text); }

/* A group whose current choices would leave a rule failing: only its count label is red, with words
   ("needed to pass") so colour is not the only signal (WCAG 1.4.1). --blocking meets 4.5:1 in light and dark. */
.count-input.count-blocking { color: var(--blocking); border-color: var(--blocking); font-weight: 600; }
.blocking-summary { color: var(--blocking); font-weight: 600; margin: 0.25rem 0 0.75rem; }

/* Accounts (account.js): header button and the sign-in / account dialogs. */
.account-area { display: flex; align-items: center; }
.account-area .btn { padding: .35rem .9rem; }
.account-dialog { width: min(32rem, calc(100vw - 2rem)); }
/* The brand ribbon across the top of every dialog: the logo's own ink colour,
   the same in both themes (white text on #10232A: contrast 15.6:1). */
.dialog-ribbon { display: flex; align-items: center; gap: .6rem; margin: 0 -1.75rem 1.25rem; padding: .85rem 1.75rem;
  background: #10232A; border-bottom: 3px solid #F2A33A; color: #ffffff; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.dialog-brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.dialog-brand img { display: block; flex: none; }
/* The X: 44 px target (WCAG 2.5.8), white on the ribbon, a visible focus ring in the logo's orange. */
.dialog-x { display: grid; place-items: center; width: 44px; height: 44px; margin: -.5rem -.6rem -.5rem 0;
  border: none; border-radius: 8px; background: transparent; color: #ffffff; cursor: pointer; }
.dialog-x:hover { background: rgba(255, 255, 255, .12); }
.dialog-x:focus-visible { outline: 3px solid #F2A33A; outline-offset: 0; }
.undecided-dialog h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.account-dialog label { display: block; font-weight: 600; margin: .75rem 0 .35rem; }
.account-dialog input { width: 100%; box-sizing: border-box; font: inherit; padding: .55rem .7rem; border: 1px solid var(--border-strong, var(--muted)); border-radius: 6px; background: var(--surface); color: var(--text); }
.account-dialog input[aria-invalid="true"] { border-color: var(--blocking); border-width: 2px; }
.account-dialog .field-error { color: var(--blocking); margin: .4rem 0 0; }
.account-dialog .undecided-actions { flex-wrap: wrap; }
.plans-choice { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.plans-choice li { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.plans-choice h3 { margin: 0; font-size: 1.05rem; }
.plans-choice p { margin: 0; color: var(--muted); }
.plans-choice .plans-cost { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; margin-top: auto; }
.plans-choice .plan-amount { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.plans-choice .btn { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.checkout-page { padding-top: 3rem; max-width: 40rem; }
.checkout-brand { font-weight: 700; display: flex; align-items: center; gap: .4rem; margin: 0 0 1.5rem; }
.checkout-tab-note { border-left: 4px solid var(--brand); padding: .5rem .9rem; background: var(--surface-2); }
/* One shot ribbon above "Get fix report / Get fixed file". */
.plan-ribbon { margin: 1rem 0 .5rem; padding: .6rem .9rem; border-radius: var(--radius); border: 1px solid var(--pass); border-left-width: 5px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.plan-ribbon.plan-ribbon-unused { border-color: var(--brand); }
/* Legal pages (privacy.html, terms.html, refunds.html) and the footer links to them. */
.footer-rules { margin: .75rem 0 0; font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .75rem; }
.legal-page { max-width: 46rem; padding-top: 2rem; padding-bottom: 3rem; }
.legal-page h1 { margin-top: 0; }
.legal-page h2 { margin-top: 2.25rem; }
.legal-page .table-wrap { overflow-x: auto; margin: 1rem 0; }
.legal-page table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.legal-page th, .legal-page td { border: 1px solid var(--border); padding: .5rem .65rem; text-align: left; vertical-align: top; }
.legal-page thead th { background: var(--surface-2); }
.legal-page tbody th { font-weight: 600; }
/* The owner's usage dashboard (stats.html). */
.stats-page { padding-top: 2rem; padding-bottom: 3rem; }
.stats-page .table-wrap { overflow-x: auto; margin: 1rem 0 2rem; }
.stats-page table { border-collapse: collapse; font-size: .95rem; }
.stats-page th, .stats-page td { border: 1px solid var(--border); padding: .4rem .7rem; text-align: right; }
.stats-page th[scope="row"], .stats-page thead th:first-child, .stats-page tr:first-child th { text-align: left; }
.stats-page tr:first-child th { background: var(--surface-2); }
/* Contact: the address itself as the link (mailto). */
.contact-email { font-size: 1.25rem; font-weight: 600; }
/* Public beta notice under the header (Decision 23). The logo's colours, the same in both themes:
   #10232A on #F2A33A has a contrast of 7.8:1. */
.beta-banner { background: #F2A33A; color: #10232A; }
.beta-banner p { margin: 0 auto; padding-block: .55rem; font-size: .95rem; line-height: 1.5; }
.beta-tag { display: inline-block; margin-right: .4rem; padding: 0 .5rem; border-radius: 999px;
  background: #10232A; color: #ffffff; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.beta-banner a { color: #10232A; font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.beta-banner a:hover { color: #10232A; text-decoration-thickness: 2px; }
.beta-banner a:focus-visible { outline: 3px solid #10232A; outline-offset: 2px; border-radius: 2px; }
