:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b2230;
  --muted: #5a6475;
  --border: #dde1e7;
  --brand: #1f5fd1;
  --brand-dark: #174aa6;
  --brand-soft: #eaf1fd;
  --pass: #157347;
  --pass-soft: #e7f5ee;
  --warn: #9a6200;
  --warn-soft: #fff5e0;
  --fail: #b42318;
  --fail-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo svg { width: 26px; height: 26px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* hero + form */
.hero { padding: 40px 0 8px; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 720px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.check-form { margin-top: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
label.field { display: block; font-weight: 600; font-size: .95rem; }
label.field select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.field-help { font-size: .85rem; color: var(--muted); margin-top: 6px; font-weight: 400; }
.profile-details { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.custom-size { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 10px; }
.custom-size label { display: block; font-size: .85rem; font-weight: 600; }
.custom-size input { display: block; width: 120px; margin-top: 4px; padding: 9px 10px; font: inherit; font-weight: 400; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.custom-size input.invalid { border-color: var(--fail); }
.custom-size .units-toggle { margin-bottom: 6px; }

.dropzone { border: 2px dashed #b8c2d1; border-radius: var(--radius); padding: 36px 16px; text-align: center; background: #fbfcfe; transition: border-color .15s, background .15s; }
.dropzone.uppy-is-drag-over, .dropzone.drag-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; color: var(--brand); margin-bottom: 8px; }
.dropzone .dz-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.dropzone .dz-sub { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-secondary { background: var(--surface); color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); margin-top: 16px; }
.privacy-note svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: var(--pass); }

/* progress */
.progress { margin-top: 20px; }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.progress-bar { height: 8px; background: #e8ebf0; border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.progress-bar.indeterminate span { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.alert { padding: 12px 14px; border-radius: 8px; margin-top: 16px; font-size: .95rem; }
.alert-error { background: var(--fail-soft); color: var(--fail); border: 1px solid #f5c2bd; }
.alert-warn { background: var(--warn-soft); color: var(--text, inherit); border: 1px solid var(--border); }

/* report */
.report { margin-top: 28px; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.report-head .file-name { font-weight: 600; word-break: break-all; }
.report-head .meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; letter-spacing: .03em; padding: 4px 10px; border-radius: 99px; }
.badge svg { width: 14px; height: 14px; }
.badge-pass { background: var(--pass-soft); color: var(--pass); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-fail { background: var(--fail-soft); color: var(--fail); }
.badge-lg { font-size: 1rem; padding: 6px 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.card h2 { font-size: 1.15rem; }
.kv { width: 100%; border-collapse: collapse; font-size: .93rem; }
.kv th, .kv td { text-align: left; padding: 7px 0; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.kv th { font-weight: 500; color: var(--muted); width: 55%; padding-right: 12px; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }

.issues { list-style: none; margin: 0; padding: 0; }
.issues li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef0f3; }
.issues li:last-child { border-bottom: 0; }
.issues .ico { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; }
.issues .ico-fail { color: var(--fail); }
.issues .ico-warn { color: var(--warn); }
.issues .ico-pass { color: var(--pass); }
.issues .t { font-weight: 600; }
.issues .d { color: var(--muted); font-size: .9rem; }

.fix-box { border: 1px solid #c9d8f5; background: var(--brand-soft); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.fix-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.fix-checks { display: grid; gap: 10px; flex: 1 1 280px; }
.fix-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.fix-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.fix-total { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 160px; flex: 1 0 160px; max-width: 100%; }
@media (min-width: 640px) { .fix-total { flex: 0 0 200px; } }
.fix-total .price { font-size: 1.6rem; font-weight: 700; text-align: center; }
.fix-total .price.none { font-size: 1rem; font-weight: 600; color: var(--muted); }

.page-card { display: grid; grid-template-columns: 1fr 260px; gap: 20px; margin-top: 16px; }
@media (max-width: 760px) { .page-card { grid-template-columns: 1fr; } .page-card .thumb-col { order: -1; } }
.page-card h3 { display: flex; align-items: center; gap: 10px; }
.section { padding: 12px 0; border-top: 1px solid #eef0f3; }
.section:first-of-type { border-top: 0; }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px; }
.section-title svg { width: 18px; height: 18px; flex: 0 0 18px; }
.section ul { margin: 4px 0 0; padding-left: 20px; font-size: .92rem; }
.section .row { font-size: .92rem; }
.section .row span.v { font-family: var(--mono); font-size: .88rem; }
.thumb { position: relative; background: #fff; border: 1px solid var(--border); line-height: 0; }
.thumb canvas { width: 100%; height: auto; display: block; }
.thumb .box-overlay { position: absolute; border: 2px solid var(--fail); background: rgba(180, 35, 24, .12); }
.thumb .box-overlay.warn { border-color: #d48806; background: rgba(212, 136, 6, .12); }
.thumb .trim-line { position: absolute; border: 1px dashed #1f5fd1; pointer-events: none; }
.thumb .edge-need { position: absolute; box-sizing: border-box; pointer-events: none; }
.thumb-legend { font-size: .78rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.thumb-placeholder { aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; line-height: 1.4; padding: 12px; text-align: center; background: #f3f5f8; }
.units-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: .85rem; }
.units-toggle button { font: inherit; border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; color: var(--muted); }
.units-toggle button.on { background: var(--brand); color: #fff; }
.note { font-size: .88rem; color: var(--muted); }
.content { margin-top: 48px; max-width: 760px; }
.content h2 { margin-top: 1.6em; }
.hidden { display: none !important; }

/* results page */
.btn-sm { padding: 6px 12px; font-size: .9rem; }
.hero-tight { padding: 28px 0 4px; }
.toolbar { margin: 12px 0 0; padding: 16px 20px; }
.progress.card { margin-top: 16px; }
.status-msg { margin-top: 16px; }
.issues .more { white-space: nowrap; margin-left: 4px; }

/* guide */
.guide { max-width: 780px; }
.guide section { margin-top: 8px; }
.guide h2 { scroll-margin-top: 16px; }
.guide h3 { margin-top: 1.4em; scroll-margin-top: 16px; }
.guide ul, .guide ol { padding-left: 22px; margin: 0 0 1em; }
.guide li { margin-bottom: .45em; }
.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { padding-left: 26px; position: relative; }
.check-list li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2.5px solid var(--pass); border-bottom: 2.5px solid var(--pass); transform: rotate(-45deg); }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; margin: 0 0 1.2em; }
.toc ol { margin: 0; columns: 2; column-gap: 32px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.data { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 0 0 1.2em; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.data th, .data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.data thead th { background: #f1f4f8; font-weight: 600; }
.data tr:last-child td { border-bottom: 0; }
@media (max-width: 560px) { .data { font-size: .85rem; } .data th, .data td { padding: 7px 8px; } }
.diagram { margin: 0 0 1.2em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.diagram svg { width: 100%; max-width: 480px; height: auto; display: block; margin: 0 auto; }
.diagram figcaption { font-size: .88rem; color: var(--muted); margin-top: 10px; text-align: center; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .03em; padding: 1px 8px; border-radius: 99px; }
.pill-pass { background: var(--pass-soft); color: var(--pass); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-fail { background: var(--fail-soft); color: var(--fail); }
.faq h3 { font-size: 1rem; margin-bottom: .3em; }
.back-to-top { margin-top: 2em; font-weight: 600; }

/* accessibility report */
.issues li > div { min-width: 0; }
.rule-id { white-space: nowrap; }
.rule-details { margin-top: 4px; font-size: .88rem; }
.rule-details summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.rule-details ul { margin: 6px 0 0; padding-left: 18px; }
.rule-details li { display: list-item; border: 0; padding: 3px 0; }
.where { margin-top: 2px; }
.where-list { margin: 0; padding-left: 18px; font-size: .88rem; }
.where-list li { display: list-item; border: 0; padding: 2px 0; }
.where-list .d { font-size: .85rem; }
.rule-details.tech { margin-top: 6px; }
.rule-details.tech summary { font-weight: 400; font-size: .82rem; color: var(--muted); }
.rule-details .ctx { font-family: var(--mono); font-size: .78rem; color: var(--muted); word-break: break-all; }
.fix-form .price { font-size: 1.6rem; font-weight: 700; }
label.field input[type="text"] { display: block; width: 100%; padding: 8px 10px; font: inherit; font-weight: 400; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.link-btn:hover { text-decoration: none; }
/* keep the file name beside the PASS/FAIL badge; the meta line wraps instead (2026-11-14) */
.report-head > .badge + div { flex: 1 1 0; min-width: 0; }

/* single-fix tool pages (print-tool.js) */
.table-scroll { overflow-x: auto; }
.tool-table th, .tool-table td { width: auto; padding-right: 12px; }
.tool-table thead th { color: var(--muted); font-weight: 500; }
.tool-table tbody th, .tool-table tbody td { color: var(--text); }
.tool-option { max-width: 520px; margin-bottom: 14px; }

/* /printing and its report: document type with two limit sliders (PFC.printLimits, 2026-11-16) */
.limits { margin-top: 6px; }
.limit { margin-top: 12px; }
.limit label { display: block; font-weight: 600; font-size: .9rem; }
.limit-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.limit-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--brand); }
.limit-row input[type="number"] { width: 84px; padding: 6px 8px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.limits .link-btn { margin-top: 8px; font-size: .85rem; }
.limit-row span { width: 2.2em; }
/* a PASS/WARNING/FAIL pill as a table value: shift it left by its padding so its icon and word line up with the
   plain values in the rows below (owner, 2026-11-17) */
table.kv td > .badge:first-child { margin-left: -10px; }
