/* RuleSize, direction A ("Cutting Mat"), chosen by Dudu on 2.12.2026. Ported from design/screens/rulesize.css + desktop.css.
   Fonts are served from this site (/vendor/fonts/), never from an outside server. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 700; font-display: swap; src: url("/vendor/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 800; font-display: swap; src: url("/vendor/fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); }

:root {
  --mat: #0E4A3D;
  --mat-deep: #0A3A30;
  --mat-line: rgba(255, 255, 255, 0.075);
  --paper: #F4F6F3;
  --card: #FFFFFF;
  --ink: #13211D;
  --ink-2: #47544F;
  --on-mat-2: #C6DAD2;
  --line: #D3DCD6;
  --tick: #F2BE22;
  --tick-soft: #FBEFC8;
  --pass: #11734F;
  --pass-bg: #E2F2E9;
  --warn: #8A4F00;
  --warn-bg: #FFF0D2;
  --fail: #B42318;
  --fail-bg: #FCE8E5;
  --mint: #8EE0BC;
  --focus: #0E4A3D; /* the focus ring: mat green on paper and cards; yellow on the dark mat and the camera (below) */
  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  /* Page edges. --page-max is the widest the page column gets; bars and the footer line up with it.
     The edges stay clear of the iPhone notch and rounded corners (viewport-fit=cover). */
  --gutter: 16px;
  --page-max: 100%;
  --edge-l: max(var(--gutter), env(safe-area-inset-left));
  --edge-r: max(var(--gutter), env(safe-area-inset-right));
  --bar-l: max(var(--edge-l), calc((100% - var(--page-max)) / 2 + var(--gutter)));
  --bar-r: max(var(--edge-r), calc((100% - var(--page-max)) / 2 + var(--gutter)));
}
.mat, .cam { --focus: var(--tick); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
img, svg, canvas { display: block; }
a { color: var(--mat); text-underline-offset: 3px; }
::selection { background: var(--tick-soft); color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible + .box, .btn:focus-visible, select:focus-visible, input[type="text"]:focus-visible, [tabindex]:focus-visible,
.dialog-back.kb button:focus, .dialog-back.kb a[href]:focus {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
button { font: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--card); color: var(--mat); padding: 10px 14px; border-radius: 10px; z-index: 50; font-weight: 700; }
.skip:focus { top: 8px; }

/* Page shell: a phone-width column on phones, a wide page on desktop. */
.shell { max-width: 1240px; margin: 0 auto; }
.wrap { max-width: var(--page-max); margin-inline: auto; padding-left: var(--edge-l); padding-right: var(--edge-r); }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--bar-r) 0 var(--bar-l); border-bottom: 1px solid var(--line); background: var(--paper); }
.logo { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.logo .logo-img { display: block; height: 32px; width: auto; }
.navbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 0 4px; }
.navbtn svg { width: 18px; height: 18px; }
.desk-nav { display: none; }
.topbar-title { font-weight: 700; font-size: 17px; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 0 4px; background: none; border: 0; cursor: pointer; }
.back svg { width: 20px; height: 20px; }
.spacer { width: 64px; }

.ico { width: 20px; height: 20px; flex: none; }

/* Type */
.h1 { font-size: 31px; line-height: 1.08; font-weight: 800; letter-spacing: -0.012em; }
.h2 { font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.005em; }
.h3 { font-size: 17px; line-height: 1.3; font-weight: 700; }
.lead { font-size: 16.5px; color: var(--ink-2); }
h1, h2, h3, .h1, .h2, .h3 { text-wrap: balance; }
p, .lead, .fix { text-wrap: pretty; }
.small { font-size: 14px; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.block { display: block; }

/* Buttons */
.btn { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px; border-radius: 14px; border: 0; font-family: var(--font); font-size: 18px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn .ico { width: 22px; height: 22px; }
.btn-primary { background: var(--mat); color: #FFFFFF; }
.btn-primary:hover { background: var(--mat-deep); }
.btn-secondary { background: var(--card); color: var(--mat); border: 1.5px solid var(--mat); }
.btn[disabled], .btn[aria-disabled="true"] { background: #DDE4E0; color: #3F4B46; border: 0; cursor: not-allowed; }
.btn-row { display: grid; gap: 10px; }
.lbl-computer { display: none; } /* "Take photo" on phones, "Use your webcam" on computers (see Device order) */
.linkbtn { min-height: 44px; min-width: 44px; background: none; border: 0; padding: 0; color: var(--mat); font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.small-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--mat); font-weight: 700; font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.small-link .ico { width: 18px; height: 18px; }
/* A link alone on its line: a tap area 44 px tall (Apple guideline), the text unchanged. */
.tap-line { display: inline-flex; align-items: center; min-height: 44px; }

.iconline { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.iconline .ico { margin-top: 1px; color: var(--mat); }

/* The cutting-mat panel: the brand's one loud object. */
.mat { background-color: var(--mat); background-image: linear-gradient(var(--mat-line) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line) 1px, transparent 1px); background-size: 14px 14px; background-position: -1px -1px; color: #FFFFFF; border-radius: 16px; }

/* Document page hero */
.doc-hero { padding: 20px 0 8px; display: grid; gap: 14px; }
.hero-copy { display: grid; gap: 16px; }
.spec-panel { display: grid; grid-template-columns: 136px 1fr; gap: 14px; padding: 14px; align-items: center; }
.rule-fig { margin: 0; }
.rule-fig svg { width: 100%; height: auto; }
.spec-list { display: grid; gap: 9px; margin: 0; }
.spec-list div { display: grid; align-content: start; } /* R7-DES-10: the label stays right under its number in a taller cell */
.spec-list dt { font-size: 19px; font-weight: 800; line-height: 1.15; white-space: normal; } /* R2-DES-10: ranges stay whole (span.nowrap) */
/* A panel with no figure (online renewal): the four facts in two columns. */
.spec-panel.no-fig { grid-template-columns: 1fr; }
.spec-panel.no-fig .spec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.spec-panel.no-fig .spec-list dt { white-space: normal; }
.spec-list dd { margin: 0; font-size: 13.5px; color: var(--on-mat-2); line-height: 1.3; }
.band-key { display: flex; align-items: center; gap: 7px; }
.band-key::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--tick); flex: none; }
.price-line { font-size: 15.5px; }
.price-line b { font-size: 17px; }
.desk-figure { display: none; }
.desk-specs { display: none; }

/* Engine loading line */
.engine { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.bar { height: 6px; border-radius: 99px; background: #DDE4E0; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--mat); transition: width .2s linear; }
.engine.is-ready .bar { display: none; }
.processing .engine { justify-self: stretch; width: 100%; max-width: 280px; margin-inline: auto; }

/* Sections */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.section { padding: 24px 0; border-top: 1px solid var(--line); }
.section > .h2 { margin-bottom: 10px; }
.section p + p { margin-top: 10px; }
.rules { display: grid; gap: 0; margin-top: 12px; }
.rules li { list-style: none; display: grid; grid-template-columns: 6.2em 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rules li:last-child { border-bottom: 1px solid var(--line); }
.quote { border-left: 3px solid var(--tick); padding: 2px 0 2px 12px; margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.quote + p { margin-top: 12px; } /* R7-DES-9: our own words don't look like the rest of the quote */
.quote cite { display: block; font-style: normal; }
.source { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.gets { display: grid; gap: 10px; margin-top: 4px; }
.gets li { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15.5px; }
.gets .ico { color: var(--pass); margin-top: 1px; }
.cols .card { padding: 18px 16px; margin-top: 20px; }
.cols .h2 { margin-bottom: 12px; }
.gets + .once { margin-top: 14px; }
.steps-list { display: grid; gap: 14px; list-style: none; margin-top: 6px; }
.steps-list li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.step-n { width: 36px; height: 36px; border-radius: 50%; background: var(--mat); color: #FFFFFF; display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.tips { display: grid; gap: 8px; padding-left: 20px; font-size: 15.5px; }
.doc-cards { display: grid; gap: 12px; list-style: none; }
.doc-card { display: grid; gap: 6px; padding: 16px; text-decoration: none; color: var(--ink); }
.doc-card .h3 { color: var(--mat); }
.doc-card .price-tag { font-weight: 800; }

/* Legal and info pages (privacy, terms, refunds, accessibility, how it works, support) */
.legal { padding-top: 20px; padding-bottom: 28px; }
.legal-head { display: grid; gap: 8px; padding-bottom: 20px; }
.updated { font-size: 14px; color: var(--ink-2); }
.legal .section { padding: 22px 0; }
.legal .section > * + * { margin-top: 12px; }
.legal .section p + p { margin-top: 12px; }
.legal .section > .h2 { margin-bottom: 0; }
.legal .section > .h3 { margin-top: 18px; }
.legal li { font-size: 15.5px; }
.bul, ol.num { display: grid; gap: 8px; padding-left: 22px; align-content: start; } /* ol only: .num alone means tabular numbers */
ol.num li::marker { font-weight: 800; color: var(--mat); }
.summary .bul { gap: 10px; }
.toc { padding: 14px 16px; margin-bottom: 4px; }
.toc ol { display: grid; gap: 0; padding-left: 22px; margin-top: 6px; }
.toc li { font-size: 15px; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; }
.defs { display: grid; margin: 0; }
.defs div { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.defs div:last-child { border-bottom: 1px solid var(--line); }
.defs dt { font-weight: 700; }
.defs dd { margin: 0; font-size: 15px; color: var(--ink-2); }
.flow-steps { gap: 18px; }
.flow-steps .h3 { margin-top: 6px; }
.flow-cards { display: grid; gap: 12px; }
.flow-card { padding: 16px; display: grid; gap: 10px; align-content: start; }
.flow-card-h { display: flex; align-items: center; gap: 8px; color: var(--mat); }
.nowrap { white-space: nowrap; }
.btn-inline { display: inline-flex; width: auto; white-space: normal; text-align: center; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; }
.field input[type="text"], .field select { width: 100%; max-width: 100%; min-width: 0; font: inherit; font-size: 18px; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--ink-2); background: var(--card); color: var(--ink); }
.field input[type="text"] { text-transform: uppercase; letter-spacing: .04em; }

/* Footer */
.foot { padding: 22px var(--bar-r) max(28px, env(safe-area-inset-bottom)) var(--bar-l); border-top: 1px solid var(--line); display: grid; gap: 12px; }
.indie { font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 16px; font-size: 14px; }
.foot-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink-2); }

/* Banners */
.banner { padding: 12px var(--bar-r) 12px var(--bar-l); font-size: 15px; display: grid; gap: 8px; }
.banner-inapp { background: var(--tick-soft); color: var(--ink); border-bottom: 1px solid #E7CF86; }
.inapp-only { display: none; }
[data-inapp="1"] .inapp-only { display: grid; }
.banner-test { background: #E8EEF9; color: #1D2B4A; border-bottom: 1px solid #B9C7E6; }
.banner .btn { min-height: 44px; font-size: 16px; width: auto; justify-self: start; }

/* ---------- Tool screens (a phone-width column, also on desktop) ---------- */
.tool { max-width: 560px; margin: 0 auto; background: var(--paper); min-height: 100vh; }
.stack { display: grid; gap: 16px; padding-top: 18px; padding-bottom: 24px; }
.stack > * { min-width: 0; } /* one long line (a button, a file name) must not widen the column past the screen */
.list-title { margin: 6px 0 8px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px 5px 8px; font-weight: 700; font-size: 14.5px; }
.pill .ico { width: 18px; height: 18px; }
.pill-pass { background: var(--pass-bg); color: var(--pass); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-fail { background: var(--fail-bg); color: var(--fail); }

.status-row { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px; list-style: none; }
.status-row + .status-row { border-top: 1px solid var(--line); }
.status-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.status-ico .ico { width: 18px; height: 18px; }
.is-fail .status-ico { background: var(--fail); color: #FFFFFF; }
.is-warn .status-ico { background: var(--warn-bg); color: var(--warn); border: 1.5px solid #E7B866; }
.is-pass .status-ico { background: var(--pass-bg); color: var(--pass); }
.is-ask .status-ico, .is-info .status-ico { background: #EEF2EF; color: var(--ink-2); }
.status-row .h3 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.is-fail .tag { background: var(--fail-bg); color: var(--fail); }
.is-warn .tag { background: var(--warn-bg); color: var(--warn); }
.fix { margin-top: 4px; font-size: 15px; color: var(--ink-2); }
.fix b { color: var(--ink); }
.fix.block { margin-top: 2px; }

.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 15px; cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; left: 0; top: 0; cursor: pointer; }
.check .box { width: 24px; height: 24px; border: 2px solid var(--ink-2); border-radius: 6px; background: var(--card); margin-top: 1px; display: grid; place-items: center; }
.check input:checked + .box { background: var(--mat); border-color: var(--mat); }
.check input:checked + .box::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-2px) rotate(-45deg); }
.check-row { cursor: pointer; }

.check-head { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.thumb { position: relative; margin: 0; width: 112px; height: 112px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #DDE4E0; }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.check-head .small { margin-top: 4px; font-size: 15px; }
.keep { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; margin-top: -4px; }
.keep .linkbtn { color: var(--ink); }
.keep .small { flex-basis: 100%; }
ul.card { list-style: none; }
.passed li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 15.5px; list-style: none; }
.passed li + li { border-top: 1px solid var(--line); }
.passed .ico { color: var(--pass); width: 18px; height: 18px; }

.processing { display: grid; gap: 14px; justify-items: center; text-align: center; padding-top: 64px; padding-bottom: 64px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #DDE4E0; border-top-color: var(--mat); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { border-radius: 12px; padding: 14px; font-size: 15px; display: grid; gap: 8px; }
.notice-fail { background: var(--fail-bg); color: #5B140E; }
.notice-info { background: var(--tick-soft); color: var(--ink); }

/* Adjust. R7-DES-8: the width is min(), because "width: 300px" made the column wider than a 320 px screen. */
.adjust-stage { position: relative; width: min(300px, 100%); margin: 0 auto; touch-action: none; user-select: none; cursor: grab; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.adjust-stage canvas { width: 100%; height: auto; }
.adjust-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.adjust-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.adjust-tools .btn { min-height: 48px; font-size: 16px; padding: 0 8px; }
.guide-key { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }

/* Preview and price */
.result-head { display: grid; gap: 6px; justify-items: start; }
.preview { margin: 0; display: grid; gap: 12px; justify-items: center; }
.preview img { width: 240px; height: 240px; border-radius: 4px; border: 1px solid var(--line); }
.scale { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; font-size: 14.5px; color: var(--ink-2); max-width: 340px; }
.scale svg { width: 44px; height: 44px; }
.scale b { color: var(--ink); }
/* R10-DES-2: with large text on a narrow phone the text goes under the sketch and gets the card's width, so
   "10 × 15 cm" and "600 × 600 px" stay whole. At the normal size the sketch and the text stay side by side. */
.sheet-card { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px; align-items: center; }
.sheet-card > .sheet { flex: 0 0 104px; }
.sheet-card > div { flex: 1 1 8em; min-width: 0; }
.sheet { margin: 0; }
.sheet svg { width: 104px; height: auto; }
.price-card { padding: 18px 16px; display: grid; gap: 14px; }
.price-card .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 10px 12px; gap: 8px; } /* "Downloads open on Jan 5, 2027" wraps on a 320 px phone */
.price-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price { font-size: 40px; line-height: 1; font-weight: 800; letter-spacing: -0.02em; }
.once { font-weight: 700; font-size: 16px; }
.refund { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.refund-list { display: grid; gap: 6px; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.consent { border-top: 1px solid var(--line); padding-top: 14px; font-size: 14.5px; }
.delete-row { display: grid; gap: 2px; justify-items: start; }

/* Thank you */
.paid { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.paid-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--pass); color: #FFFFFF; display: grid; place-items: center; }
.paid-ico .ico { width: 24px; height: 24px; }
.code-card { padding: 16px; display: grid; gap: 6px; }
.code-label { font-size: 14px; color: var(--on-mat-2); font-weight: 700; }
.code { font-size: 30px; font-weight: 800; letter-spacing: .04em; line-height: 1.15; }
.code-note { font-size: 14.5px; color: #E4EEE9; }
.code-copy { justify-self: start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; background: #FFFFFF; color: var(--mat); border: 0; border-radius: 10px; padding: 0 14px; font-weight: 700; font-size: 15px; cursor: pointer; }
[data-act="home-order"] { display: inline-flex; align-items: center; min-height: 44px; } /* "Back to the … page" on the thank-you screen */
.code-copy .ico { width: 18px; height: 18px; }
.code-actions { display: flex; flex-wrap: wrap; gap: 0 10px; } /* Copy code and Save order confirmation (LEG-5) */
.downloads li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; list-style: none; }
.downloads li + li { border-top: 1px solid var(--line); }
.downloads .dl-main { grid-template-columns: 72px 1fr auto; }
.dl-main img, .dl-main canvas { width: 72px; height: 72px; border-radius: 4px; border: 1px solid var(--line); }
.dl-type { width: 44px; height: 44px; border-radius: 10px; background: var(--paper); color: var(--mat); display: grid; place-items: center; }
/* R2-SEC-1, R2-CX-2: a button (no file address in the page), with the word "Download" on it. */
.dl-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: var(--mat); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.dl-btn .ico { width: 22px; height: 22px; }
.print-how { padding: 16px; display: grid; gap: 10px; }
.steps { padding-left: 22px; display: grid; gap: 6px; font-size: 15.5px; }
.steps li::marker { font-weight: 800; color: var(--mat); }
.note { display: grid; grid-template-columns: 22px 1fr; gap: 10px; background: var(--tick-soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.after { padding: 16px; display: grid; gap: 10px; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yesno .btn { min-height: 48px; font-size: 16px; }

/* ---------- Camera ---------- */
/* R7-DES-1: with large text the camera screen scrolls, and the picture keeps a height that grows with the text, so the
   face stays in view above the instruction. At the normal size that height is 195 px, less than the room that is left
   (197 px on a small phone, 360 x 512 under the browser's bars), so everything fits as before. The other rows are
   max-content: they hold all their text. */
.cam { position: fixed; inset: 0; z-index: 40; background: #000000; color: #FFFFFF; overflow-y: auto; display: grid; grid-template-rows: max-content minmax(min(22em - 157px, 80vh), 1fr) max-content; }
.cam-top { min-height: 56px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 0 8px; }
.cam-title { text-align: center; font-weight: 700; font-size: 17px; }
.cam-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #1D2421; color: #FFFFFF; border: 0; cursor: pointer; }
.cam-icon .ico { width: 22px; height: 22px; }
.viewfinder { position: relative; overflow: hidden; background: #2A302D; min-height: 0; }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder video.mirror { transform: scaleX(-1); }
.vf-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.vf-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .82); color: #FFFFFF; font-size: 18px; font-weight: 800; padding: 8px 16px; border-radius: 999px; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.vf-msg { position: absolute; inset: auto 16px 16px 16px; background: rgba(0, 0, 0, .85); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.cam-panel { padding: 12px 16px 16px; display: grid; gap: 10px; max-width: 560px; width: 100%; margin: 0 auto; }
.cam-ready { font-size: 15px; font-weight: 700; color: #DDE7E2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px 6px 9px; font-size: 15px; font-weight: 700; }
.chips .ico { width: 17px; height: 17px; }
.chips .ok { background: var(--mint); color: #0B2A20; }
.chips .wait { background: #000000; color: #FFFFFF; box-shadow: inset 0 0 0 1.5px #8A9590; }
.chips .wait .ico { color: var(--tick); width: 14px; height: 14px; }
.auto-note { font-size: 14px; color: #C9D3CF; }
.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 8px; }
.side-btn { justify-self: center; display: grid; justify-items: center; gap: 2px; min-width: 56px; min-height: 44px; color: #FFFFFF; background: none; border: 0; font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px; }
.side-btn .ico { width: 26px; height: 26px; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #FFFFFF; display: grid; place-items: center; background: none; cursor: pointer; padding: 0; }
.shutter span { width: 58px; height: 58px; border-radius: 50%; background: #FFFFFF; }
.shutter.hold span { background: var(--mint); }
.stays { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13.5px; color: #C9D3CF; }
.stays .ico { width: 16px; height: 16px; }

/* Dialog (tips, in-app notice) */
.dialog-back { position: fixed; inset: 0; z-index: 60; background: rgba(10, 20, 16, .55); display: grid; place-items: end center; padding: 16px var(--edge-r) max(16px, env(safe-area-inset-bottom)) var(--edge-l); }
.dialog { background: var(--card); color: var(--ink); border-radius: 16px; padding: 20px; width: 100%; max-width: 520px; display: grid; gap: 12px; max-height: 85vh; overflow: auto; }

/* ---------- Tablet: a centred phone column, not a stretched phone layout ---------- */
@media (min-width: 600px) and (max-width: 899px) {
  :root { --page-max: 640px; }
}
/* ---------- Phones narrower than 360 px (iPhone SE 1st gen) ---------- */
@media (max-width: 359px) {
  .spec-panel { grid-template-columns: 96px 1fr; gap: 10px; padding: 12px; }
  .spec-list dt { font-size: 17px; }
  .h1 { font-size: 27px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: 40px; --page-max: 1240px; }
  .topbar { height: 76px; }
  .topbar .logo .logo-img { height: 40px; }
  .desk-nav { display: flex; gap: 30px; }
  .desk-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
  .navbtn.mobile-only { display: none; }
  .doc-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding: 56px 0 64px; }
  /* R10-SEO-3: no rule for a hero without a figure. Every page with .doc-hero has one, and a :has() rule matched only
     while the page was still loading (the figure not read yet), so the hero went from one column to two (CLS). */
  .hero-copy { display: grid; gap: 20px; }
  .h1.hero-title { font-size: 56px; line-height: 1.02; letter-spacing: -0.02em; max-width: 12ch; }
  .lead { font-size: 19px; max-width: 46ch; }
  .spec-panel.mobile-only { display: none; }
  .desk-figure { display: grid; margin: 0; padding: 32px 32px 22px; gap: 14px; }
  .desk-figure svg { width: 100%; height: auto; }
  .desk-figure .fig-stage { aspect-ratio: 112 / 66; } /* R10-SEO-3: the drawing's viewBox, so it has its height before its SVG is read */
  .desk-figure figcaption { font-size: 14px; color: var(--on-mat-2); }
  .desk-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; padding-top: 16px; border-top: 2px solid var(--ink);
    background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 60px), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px);
    background-size: 100% 10px, 100% 5px; background-repeat: no-repeat; }
  .desk-specs div { padding-right: 12px; }
  .desk-specs dt { font-size: clamp(18px, 1.9vw, 23px); font-weight: 800; line-height: 1.15; margin-top: 4px; white-space: nowrap; }
  .desk-specs dd { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); }
  .hero-copy .btn-row { grid-template-columns: auto auto; justify-content: start; gap: 12px; }
  .hero-copy .btn-row .btn { width: auto; padding: 0 26px; }
  .section { padding: 44px 0; }
  .section .h2, .section > .h2 { font-size: 28px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .cols .card { padding: 26px; margin-top: 0; }
  .steps-list.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
  .steps-list.four li { grid-template-columns: 1fr; gap: 6px; }
  .doc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { padding-top: 26px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
  .indie { max-width: 760px; }
  /* Reading width for the text, while a section's top line runs the full width of the page column. */
  .prose > * { max-width: 70ch; }
  .legal, #page > .stack { padding-top: 44px; padding-bottom: 48px; } /* the same top space as the legal pages (restore, 404) */
  .legal .section { padding: 32px 0; }
  .defs div { grid-template-columns: 200px minmax(0, 1fr); gap: 16px; }
  .flow-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Wide screens: the page column of the home page (direction D, 2.12), on every page, so the logo and the menu
   stay in the same place when you move between pages */
@media (min-width: 1024px) { :root { --gutter: 56px; --page-max: 1432px; } }
@media (min-width: 1760px) { :root { --page-max: 1472px; } }

@media (min-width: 900px) and (max-width: 1100px) {
  .h1.hero-title { font-size: 44px; }
}

/* Device order: phones get "Take photo" first, computers get "Upload a photo" first (design decision, 2.12). */
[data-device="desktop"] .btn-take { background: var(--card); color: var(--mat); border: 1.5px solid var(--mat); }
[data-device="desktop"] .btn-upload { background: var(--mat); color: #FFFFFF; border: 0; }
[data-device="desktop"] .hint-mobile, [data-device="mobile"] .hint-desktop { display: none; }
.hint-desktop { display: none; }
[data-device="desktop"] .hint-desktop { display: block; }
[data-device="desktop"] .btn-take .lbl-phone { display: none; }
[data-device="desktop"] .btn-take .lbl-computer { display: inline; }

/* ---------- Art and motion (design pass, 2.12; prototype in _review/motion/) ----------
   One authored moment: the hero drawing measures a photo once (about 2.9 s). The steps sit on a ruler that draws
   itself as it scrolls in, the document cards carry icon tiles, and buttons answer a press. Nothing loops and no
   text moves while it is read. The SVG as written (src/static/img/art/) IS the final frame: every animation is
   declared only under prefers-reduced-motion: no-preference, so with reduced motion the art shows its still frame
   at once. Transform, opacity and clip-path only, so nothing around the art moves. */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Hero with the measuring drawing (home and the free checker). Home: copy, drawing, actions, in one markup order
   for phones; a two-column grid on a computer. */
.hero-art { margin: 0; padding: 8px 10px 4px; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.rs-lab { font-size: 8px; } /* SVG user units; the drawing is about 340 px wide on a phone */
@media (max-width: 359px) { .rs-lab { font-size: 9px; } }
.home-hero { gap: 16px; }
.home-hero .hero-copy { gap: 12px; }
.hero-actions { display: grid; gap: 16px; }
.hero-actions .btn-row { gap: 6px; }
.hero-actions .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 10px 18px; } /* "… · $9.99" wraps at 320 px */
.hero-actions .small-link { justify-self: center; }
.checker-hero .hero-art { display: none; } /* phones: the checker's form stays first; the drawing fills the right half on a computer */

@media (min-width: 900px) {
  .art-hero .hero-art { padding: 22px 24px 14px; }
  .checker-hero .hero-art { display: block; }
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-areas: "copy art" "actions art"; column-gap: 56px; row-gap: 28px; align-items: start; }
  .home-hero .hero-copy { grid-area: copy; align-self: end; gap: 20px; }
  .home-hero .hero-actions { grid-area: actions; align-self: start; gap: 22px; }
  .home-hero .hero-art { grid-area: art; align-self: center; }
  .home-hero .h1.hero-title { max-width: 18ch; }
  .hero-actions .btn-row { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 24px; }
  .hero-actions .btn { width: auto; padding: 0 26px; }
  .hero-actions .small-link { justify-self: start; }
  .rs-lab { font-size: 6.6px; }
}

/* The hero animation: the keyframes only say where things start. */
@media (prefers-reduced-motion: no-preference) {
  /* 0 s: the phone photo comes up, so the panel is never empty */
  .rs-hero .rs-phone { animation: rs-phone 1650ms var(--ease-out) both; }
  /* 0.5 s: crop marks close in on the head; the rest of the photo dims */
  .rs-hero .rs-mk { animation-duration: 650ms; animation-timing-function: var(--ease-in-out); animation-delay: 500ms; animation-fill-mode: both; }
  .rs-hero .rs-mk-tl { animation-name: rs-mk-tl; }
  .rs-hero .rs-mk-tr { animation-name: rs-mk-tr; }
  .rs-hero .rs-mk-bl { animation-name: rs-mk-bl; }
  .rs-hero .rs-mk-br { animation-name: rs-mk-br; }
  .rs-hero .rs-ov { animation: rs-fade 420ms ease-out 650ms both; }
  /* 1.15 s: the square lifts off the phone and grows to 2 x 2 in */
  .rs-hero .rs-shot { animation: rs-fade 60ms linear 1100ms both; }
  .rs-hero .rs-final { transform-box: view-box; transform-origin: 0 0; animation: rs-grow 650ms var(--ease-in-out) 1150ms both; }
  /* 1.7 s: the ruler comes in at the chin; the 2 in line under the frame */
  .rs-hero .rs-ruler { animation: rs-ruler 420ms var(--ease-out) 1700ms both; }
  .rs-hero .rs-chin { transform-box: fill-box; transform-origin: 0 50%; animation: rs-draw 380ms var(--ease-out) 1780ms both; }
  .rs-hero .rs-dim { animation: rs-fade 420ms ease-out 1750ms both; }
  /* 1.95 s: the measuring line rises from the chin and settles inside 1 to 1 3/8 in */
  .rs-hero .rs-top { animation: rs-measure 620ms var(--ease-out) 1950ms both; }
  .rs-hero .rs-band { animation: rs-fade 360ms ease-out 2300ms both; }
  /* 2.5 s: the check */
  .rs-hero .rs-check { transform-box: fill-box; transform-origin: 50% 50%; animation: rs-pop 380ms var(--ease-out) 2500ms both; }
  .rs-hero .rs-tick { stroke-dasharray: 1; animation: rs-tick 320ms var(--ease-out) 2620ms both; }
}
@keyframes rs-fade { from { opacity: 0; } }
@keyframes rs-phone { 0% { opacity: 0; transform: translateY(6px); } 16% { opacity: 1; transform: none; } 73% { opacity: 1; } 100% { opacity: 0; } }
/* start = the phone photo's corners, in the final frame's units (divided by the 0.3214 scale it has on the phone) */
@keyframes rs-mk-tl { 0%, 18% { opacity: 0; transform: translate(-24.9px, -37.3px); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rs-mk-tr { 0%, 18% { opacity: 0; transform: translate(24.9px, -37.3px); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rs-mk-bl { 0%, 18% { opacity: 0; transform: translate(-24.9px, 180.4px); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rs-mk-br { 0%, 18% { opacity: 0; transform: translate(24.9px, 180.4px); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
/* the 36-unit crop square on the phone (x 80, y 34) = the 112-unit frame (x 42, y 14) scaled by 36/112 */
@keyframes rs-grow { from { transform: translate(66.5px, 29.5px) scale(0.3214); } }
@keyframes rs-ruler { from { opacity: 0; transform: translateX(-5px); } }
@keyframes rs-draw { from { transform: scaleX(0); } }
@keyframes rs-measure { 0% { opacity: 0; transform: translateY(67.2px); } 12% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rs-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes rs-tick { from { stroke-dashoffset: 1; } }

/* Document cards: an icon tile, and a small lift under a mouse */
.doc-card.has-ico { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: start; }
.doc-card.has-ico > * { grid-column: 2; }
.doc-card.has-ico > .doc-ico { grid-column: 1; grid-row: 1 / span 3; }
/* R10-DES-4: with large text on a narrow phone the card's icon goes above its title, so the text gets the card's
   width and "(54 KB–10 MB)." stays on one line. At the normal size (18em and wider) nothing moves. After the three
   rules above, which it overrides (a container query adds no weight). */
.doc-cards > li { container: doc-li / inline-size; }
@container doc-li (max-width: 11em) {
  .doc-card.has-ico { grid-template-columns: minmax(0, 1fr); }
  .doc-card.has-ico > * { grid-column: 1; }
  .doc-card.has-ico > .doc-ico { grid-row: auto; }
}
.doc-ico { width: 44px; height: 44px; border-radius: 11px; background: var(--paper); color: var(--mat); display: grid; place-items: center; }
.doc-ico svg { width: 32px; height: 32px; }
a.doc-card { transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 220ms ease; }
@media (hover: hover) and (pointer: fine) {
  a.doc-card:hover { border-color: #B9C8C0; box-shadow: 0 12px 24px -16px rgba(14, 74, 61, 0.45); }
  a.doc-card:hover .doc-ico { background: var(--tick-soft); }
  .doc-ico { transition: background-color 220ms ease; }
}
@media (min-width: 900px) {
  .doc-card.has-ico { grid-template-columns: 52px minmax(0, 1fr); column-gap: 18px; padding: 20px; }
  .doc-ico { width: 52px; height: 52px; border-radius: 12px; }
  .doc-ico svg { width: 36px; height: 36px; }
}

/* Buttons and cards: press feedback */
.btn { transition: transform 160ms var(--ease-out), background-color 160ms ease; }
@media (prefers-reduced-motion: no-preference) {
  .btn:active:not([disabled]):not([aria-disabled="true"]) { transform: scale(0.97); }
  a.doc-card:active { transform: scale(0.99); }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  a.doc-card:hover { transform: translateY(-2px); }
}

/* How it works: a ruler instead of green circles. Phones (and the long list on /how-it-works/): a vertical ruler;
   each step starts at a long tick, with its number beside it. */
.steps-list.ruled { gap: 0; margin-top: 10px; }
.steps-list.ruled li { position: relative; grid-template-columns: 1fr; gap: 4px; padding: 0 0 22px 46px; }
.steps-list.ruled li:last-child { padding-bottom: 4px; }
.steps-list.ruled li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), repeating-linear-gradient(180deg, var(--ink) 0 1px, transparent 1px 8px);
  background-size: 18px 2px, 2px 100%, 6px 100%; background-position: 0 0, 0 0, 0 0; background-repeat: no-repeat;
}
.steps-list.ruled .step-n { position: absolute; left: 24px; top: -5px; width: auto; height: auto; border-radius: 0; background: none; color: var(--ink); font-size: 17px; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.flow-steps.ruled .h3 { margin-top: 0; }

@media (min-width: 900px) {
  /* Desktop: one horizontal ruler across the four steps. Ten ticks per step, a long tick where each step starts. */
  .steps-list.four.ruled { position: relative; gap: 0; padding-top: 40px; margin-top: 18px; }
  .steps-list.four.ruled::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px;
    background-image: linear-gradient(var(--ink), var(--ink)),
      linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)),
      repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12.5%), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 2.5%);
    background-size: 100% 2px, 2px 20px, 2px 20px, 2px 20px, 2px 20px, 2px 20px, 100% 11px, 100% 6px;
    background-position: 0 0, 0 0, calc(25% + 0.5px) 0, calc(50% + 1px) 0, calc(75% + 1.5px) 0, 100% 0, 0 0, 0 0;
    background-repeat: no-repeat;
  }
  .steps-list.four.ruled li { padding: 0 28px 0 0; gap: 8px; }
  .steps-list.four.ruled li::before { content: none; }
  .steps-list.four.ruled .step-n { left: 8px; top: -27px; font-size: 17px; }
}

/* The ruler draws itself as the section scrolls in (browsers with scroll-driven animations; the rest show it drawn). */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .steps-list.ruled li { view-timeline: --rs-step block; }
    .steps-list.ruled li::before { animation: rs-reveal-y linear both; animation-timeline: --rs-step; animation-range: entry 0% cover 30%; }
    @media (min-width: 900px) {
      .steps-list.four.ruled { view-timeline: --rs-steps block; }
      .steps-list.four.ruled::before { animation: rs-reveal-x linear both; animation-timeline: --rs-steps; animation-range: entry 10% cover 30%; }
    }
  }
}
@keyframes rs-reveal-y { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes rs-reveal-x { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
/* ---------- end of art and motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: var(--mat); }
}

/* ---------- Camera: live instruction, guide labels and short screens (camera agent, 2.12) ---------- */
/* One big instruction at the bottom of the viewfinder, over the shoulders, so it never hides the head guide. */
.vf-hint { top: auto; bottom: 12px; left: 12px; right: 12px; width: -webkit-fit-content; width: fit-content; max-width: none; margin: 0 auto; transform: none; white-space: normal; text-wrap: balance; overflow: visible; text-overflow: clip; text-align: center; font-size: 21px; line-height: 1.2; padding: 9px 18px; border-radius: 22px; }
.vf-hint.is-ready { background: var(--mint); color: #0B2A20; } /* no fade: the words stay readable at every moment */
.vf-msg { inset: 12px 12px auto 12px; transform: none; } /* at the top, so it never covers the instruction at the bottom */
.vf-label { fill: #FFFFFF; font-size: 16px; font-weight: 700; paint-order: stroke; stroke: #000000; stroke-opacity: .55; stroke-width: 3px; stroke-linejoin: round; }
.auto-note .short { display: none; }
.cam-panel { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.cam-ready { padding-left: 0; } /* not the list indent of .num */
.vf-msg-btns { margin-top: 12px; gap: 8px; } /* Try again / Upload, when the photo checker did not start */
.vf-msg-btns .btn { min-height: 46px; font-size: 16px; }
.vf-msg-btns .btn .ico { width: 20px; height: 20px; }
/* Short screens (iPhone SE, Safari with its bars): a smaller panel, so the viewfinder keeps the whole head guide. */
@media (max-height: 700px) {
  .cam-top { min-height: 48px; }
  .cam-panel { gap: 6px; padding-top: 8px; }
  .chips { gap: 6px; }
  .chips li { font-size: 13px; padding: 4px 10px 4px 8px; gap: 5px; }
  .chips .ico { width: 15px; height: 15px; }
  .auto-note { font-size: 13px; }
  .auto-note .long { display: none; }
  .auto-note .short { display: inline; }
  .shutter { width: 62px; height: 62px; }
  .shutter span { width: 48px; height: 48px; }
  .side-btn .ico { width: 22px; height: 22px; }
  .vf-hint { font-size: 19px; bottom: 8px; padding: 7px 14px; }
  .vf-msg { inset: 8px 8px auto 8px; font-size: 14px; padding: 10px 12px; }
  .vf-msg-btns { margin-top: 10px; }
  .vf-msg-btns .btn { min-height: 44px; } /* R10-A11Y-3: the tool's 44 px also here, the only way on when the camera is blocked */
}
@media (max-height: 610px) { .vf-label { display: none; } }

/* ---------- Tool fixes (bug agent, 2.12) ---------- */
/* Tool bar: Back and the screen title on phones; on a computer the logo first, in the same place as on every
   page (DES-16), then Back, with the title in the middle. */
.tool-logo { display: none; }
@media (min-width: 900px) {
  .tool-bar { position: relative; justify-content: flex-start; gap: 28px; }
  .tool-bar .topbar-title { position: absolute; left: 50%; transform: translateX(-50%); }
  .tool-bar .spacer { display: none; }
  .tool-logo { display: inline-flex; }
}
/* Adjust: Zoom out, Zoom in and Reset with their words; Done on its own row. */
.adjust-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adjust-tools .btn { gap: 6px; white-space: normal; line-height: 1.15; }
.adjust-tools [data-act="adjust-done"] { grid-column: 1 / -1; }
@media (max-width: 420px) {
  .adjust-tools .btn:not([data-act="adjust-done"]) { flex-direction: column; gap: 2px; min-height: 60px; font-size: 15px; padding: 6px 4px; }
}
/* "Tick the box…" and the other short lines under a checkbox: a small gap above. */
.confirm-note:not(:empty), #consent-msg:not(:empty) { margin-top: 8px; }
.paid-card .h3 { overflow-wrap: anywhere; }
.engine-retry { justify-self: start; }
.copy-link { word-break: break-all; overflow-wrap: anywhere; }

/* ---------- Tool: round-1 fixes (team A, 2.12) ---------- */
/* DES-16/17: on a computer the tool fills the page like every page (bar and footer at the page width); the
   screens keep a reading column, and the preview puts the price beside the photo. */
@media (min-width: 900px) {
  .tool { max-width: none; }
  .tool > main { max-width: calc(560px + var(--edge-l) + var(--edge-r)); }
  .tool > main.pv-main { max-width: calc(980px + var(--edge-l) + var(--edge-r)); grid-template-columns: minmax(0, 1fr) minmax(0, 420px); grid-template-rows: auto 1fr; column-gap: 40px; align-items: start; }
  .pv-main > .pv-a { grid-column: 1; grid-row: 1; }
  .pv-main > .price-card { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; }
  .pv-main > .pv-b { grid-column: 1; grid-row: 2; }
}
.pv-a, .pv-b { display: grid; gap: 16px; min-width: 0; }
/* DES-3: on a phone the main button of the checks stays in reach at the bottom of the screen. */
@media (max-width: 899px) {
  .btn-row.is-sticky { position: sticky; bottom: 0; z-index: 5; padding: 14px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(244, 246, 243, 0), var(--paper) 14px); }
  /* A box reached with the keyboard (or scrolled to) stops above the sticky row, not under it (WCAG 2.4.11). */
  html:has(.btn-row.is-sticky) { scroll-padding-bottom: calc(164px + env(safe-area-inset-bottom)); }
}
/* DES-4: a smaller preview on a phone, so the price starts on the first screen. */
@media (max-width: 599px) {
  .preview img { width: 200px; height: 200px; }
}
/* A11Y-12: a long label wraps instead of pushing the screen sideways. */
.tool .btn, .cam .btn, .dialog .btn { white-space: normal; text-align: center; line-height: 1.2; }
/* DES-8: what needs attention looks like it. */
.confirm-note:not(:empty), #consent-msg:not(:empty) { color: var(--fail); font-weight: 700; }
/* R8-DES-3 (decision 1 of fix-plan-r8): in the "Your payment" card the line is in a yellow note, as on the document page.
   The buyer did nothing wrong, so it isn't red or bold there, and it starts at the note's own padding. */
.notice #consent-msg:not(:empty) { color: inherit; font-weight: inherit; margin-top: 0; }
/* R13-CX-2, R13-DES-3 (decision 2 of fix-plan-r13): news under the "Use order" button ("Your payment is confirmed", "Your other
   order … is still open") isn't an error: in the text's color, still bold. An error written there later replaces it, red again. */
#consent-msg > .is-ok { color: var(--ink); }
.check.is-missing .box, .is-missing .check .box { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-bg); }
.engine.is-error { color: var(--fail); font-weight: 700; }
.engine.is-error .bar { display: none; }
.dl-left[role="alert"] { color: var(--fail); font-weight: 700; }
.field-error { color: var(--fail); font-weight: 700; font-size: 14px; } /* /restore/: a code that doesn't look like one */
.field input[aria-invalid="true"] { border-color: var(--fail); }
/* Adjust: move buttons (A11Y-6) and the labels of the yellow guides (DES-6). */
.adjust-move { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.adjust-move .btn { min-height: 44px; font-size: 15px; padding: 0 6px; }
.adj-label { position: absolute; left: 6px; transform: translateY(3px); background: #13211D; color: #F2BE22; font-size: 12px; font-weight: 700; line-height: 1.3; padding: 1px 6px; border-radius: 4px; pointer-events: none; }
/* Thank you: Save to Photos, a sheet to try again, the order list on the page. */
.save-photos { margin-top: 10px; }
.downloads li:has(.dl-retry) { grid-template-columns: 44px 1fr auto; }
.dl-retry { width: auto; min-height: 44px; font-size: 15px; padding: 0 12px; }
.order-list { display: grid; gap: 6px; padding-left: 18px; margin-top: 6px; }
.use-order .h3 { overflow-wrap: anywhere; }
/* DES-18: on a computer the whole webcam picture shows (no crop), and the guide sits on the picture. */
.viewfinder.is-contain video { object-fit: contain; }
.cam-panel.is-failed .chips, .cam-panel.is-failed .auto-note { display: none; }
/* A11Y-7: a phone on its side (very short screen): the camera screen scrolls, and the viewfinder keeps a size (200 px;
   more with large text, R7-DES-1). */
@media (max-height: 480px) {
  .cam { grid-template-rows: max-content minmax(max(200px, min(12.5em, 80vh)), 1fr) max-content; }
  .vf-label { display: none; }
}
/* A11Y-13: Windows high contrast. The boxes, bars and badges keep an edge the system colours can show. */
@media (forced-colors: active) {
  .check .box { border: 2px solid CanvasText; }
  .check input:checked + .box { background: Highlight; border-color: Highlight; }
  .check input:checked + .box::after { border-color: HighlightText; }
  .bar { border: 1px solid CanvasText; }
  .bar span { forced-color-adjust: none; background: Highlight; }
  .status-ico, .pill, .tag, .chips li, .notice, .note, .dl-btn, .code-copy { border: 1px solid CanvasText; }
  .spinner { border-color: CanvasText; border-top-color: Highlight; }
  .adjust-stage svg { forced-color-adjust: none; }
  #tool .ico { color: inherit; } /* R7-DES-7: as on the pages, the icon takes the system colour of its text */
  #tool .scale svg rect:first-child { stroke: CanvasText; }
  #tool .scale svg rect:last-child { fill: CanvasText; }
  #tool .btn, .cam .btn, .cam-icon { border: 2px solid ButtonText; } /* buttons keep an edge when the system drops their fill */
  .dialog { border: 2px solid CanvasText; } /* R2-A11Y-7: the dialog and its buttons keep their edges too */
  .dialog .btn { border: 2px solid ButtonText; }
}

/* ---------- Tool: round-2 fixes (team A, 2.12) ---------- */
.dl-use { color: var(--ink); }
.dl-sec { display: grid; gap: 10px; } /* R2-DES-6 */
.dl-sec .save-photos { margin-top: 0; }
/* R2-CX-2: on a phone the file's name and what it is for get the width; the Download button sits under them. */
@media (max-width: 479px) {
  .downloads li, .downloads li:has(.dl-retry) { grid-template-columns: 44px 1fr; align-items: start; }
  .downloads .dl-main { grid-template-columns: 72px 1fr; }
  .downloads .dl-btn, .downloads .dl-retry { grid-column: 2; justify-self: start; }
}
.confirm-card { padding: 16px; display: grid; gap: 10px; } /* decision 3: the order confirmation, near the top */
.dialog-body { display: grid; gap: 12px; } /* R2-A11Y-6 */
.cam-panel.is-failed .shutter { visibility: hidden; } /* R2-DES-3: no camera picture, no shutter */
/* Decision 6, R2-DES-2: the pay button stays in reach at the bottom of the screen, inside the price card. */
.price-card .btn-row.is-sticky { position: sticky; bottom: 0; z-index: 2; margin: 0 -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(255, 255, 255, 0), var(--card) 12px); }
@media (min-width: 900px) {
  html:has(.price-card .btn-row.is-sticky) { scroll-padding-bottom: 96px; }
}
/* R2-A11Y-9: a phone on its side: a sticky row would cover half the screen, so it scrolls with the page. */
@media (max-width: 899px) and (max-height: 500px) {
  .btn-row.is-sticky, .price-card .btn-row.is-sticky { position: static; padding: 0; margin: 0; background: none; }
  html:has(.btn-row.is-sticky) { scroll-padding-bottom: 0; }
}
/* R2-CX-21: on a computer the small print of the price card and the thank-you page is at least 16 px. */
@media (min-width: 1024px) {
  .tool > main.pv-main { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
  .price-card .small, .refund-list li, .consent, .code-note, #dl-left { font-size: 16px; }
}

/* ---------- Pages: round-1 fixes (team B, 2.12) ----------
   Header menu, footer columns, document-page sections, legal layout, reading width, hovers. Page rules only:
   nothing here touches the tool screens (#tool, .cam). */
.topbar { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: var(--bar-r); top: calc(100% - 4px); z-index: 30; width: min(320px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(10, 30, 24, .45); padding: 6px 16px 10px; }
.menu-h { margin-top: 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.menu-panel ul { list-style: none; }
.menu-panel a { display: flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration: none; }
.desk-nav a[aria-current="page"], .menu-panel a[aria-current="page"] { color: var(--mat); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.foot-h { font-size: 14px; font-weight: 800; }
.foot-col ul { list-style: none; }
.foot-col a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--ink-2); font-size: 14.5px; overflow-wrap: anywhere; }
.foot-col a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.indie-line { font-size: 13.5px; color: var(--ink-2); }
#page .btn { white-space: normal; text-align: center; line-height: 1.2; } /* A11Y-12: a long label wraps instead of pushing the page sideways */
.desk-specs dt { white-space: normal; } /* DES-1: "54 KB–10 MB" wraps inside its column; ranges stay whole (span.nowrap) */
.photo-figure img { width: 100%; height: auto; border-radius: 8px; }
.faq .qa + .qa { margin-top: 18px; }
.faq .qa .h3 { margin-bottom: 4px; }
.refund-block .refund-rules { list-style: none; display: grid; margin-top: 6px; }
.refund-block .refund-rules li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15.5px; }
.refund-block .refund-rules li:last-child { border-bottom: 1px solid var(--line); }
.sample { display: grid; gap: 18px; }
.sample-fig { margin: 0; }
.sample-fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #FFFFFF; box-shadow: 0 14px 30px -20px rgba(10, 30, 24, .5); }
.sample-fig figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.cross { max-width: 560px; }
.end-cta { display: grid; gap: 14px; margin: 28px 0 8px; padding: 26px 20px; }
.end-cta .lead { color: var(--on-mat-2); }
/* On the dark mat the main button is the yellow one, as on the home page: Take photo on a phone, Upload on a computer. */
.end-cta .btn-primary, [data-device="desktop"] .end-cta .btn-upload { background: var(--tick); color: var(--ink); border: 0; }
[data-device="desktop"] .end-cta .btn-take { background: var(--card); color: var(--mat); }
.guide .sample-fig, .guide .quote { margin-top: 12px; }
.to-top { font-size: 14px; }
.to-top a { display: inline-flex; align-items: center; min-height: 44px; }
.toc-desk { display: none; }
.toc-phone summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
#restore-form { max-width: 420px; } /* DES-21 */
#doc-select { appearance: none; -webkit-appearance: none; padding-right: 44px; border: 1.5px solid var(--ink-2); border-radius: 12px; background-color: var(--card); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; } /* DES-23; no data: picture (CSP) */
@media (hover: hover) { /* DES-9 */
  [data-device="desktop"] .btn-upload:hover { background: var(--mat-deep); color: #FFFFFF; border-color: var(--mat-deep); } /* R2-A11Y-1 (team A) */
  .btn-secondary:hover, [data-device="desktop"] .btn-take:hover { background: #EEF3F0; border-color: var(--mat-deep); color: var(--mat-deep); }
  .desk-nav a:hover, .foot-col a:hover, .toc a:hover, .menu-panel a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
  .small-link:hover { color: var(--mat-deep); text-decoration-thickness: 2px; }
  .logo:hover { opacity: .85; }
  #doc-select:hover { border-color: var(--ink); }
  a.doc-card:hover { border-color: var(--mat); }
  .end-cta .btn-primary:hover, [data-device="desktop"] .end-cta .btn-upload:hover { background: #F6CA45; }
}
@media (min-width: 900px) {
  .menu.mobile-only { display: none; }
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 220px)); gap: 24px; }
  .prose > *, .indie { max-width: 34em; } /* DES-13: about 75 characters a line */
  .sample { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
  .end-cta { margin: 44px 0 16px; padding: 44px 48px; }
  .end-cta .btn-row { grid-template-columns: auto auto; justify-content: start; gap: 12px; }
  .end-cta .btn-row .btn { width: auto; padding: 0 26px; }
  .steps-list.four .h3 { font-size: 17px; } /* DES-22 */
  /* CX-21: bigger reading text on a computer (the home page keeps its own sizes) */
  #page main:not(.home-d) p, #page main:not(.home-d) li { font-size: 17px; }
  #page main:not(.home-d) .lead { font-size: 19px; }
  #page main:not(.home-d) :is(.small, .source, .indie-line, .to-top, .updated, figcaption) { font-size: 15px; }
  .foot-col a, .indie { font-size: 15px; }
}
/* DES-12: legal and help pages. A centred reading column; with a contents list, the list sits beside the text
   and stays in view. A ruler line above the title, as on the document pages. */
.legal-head { border-top: 2px solid var(--ink); padding-top: 18px;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 60px), repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px);
  background-size: 100% 10px, 100% 5px; background-repeat: no-repeat; }
@media (min-width: 1100px) {
  .legal-head .h1 { font-size: 44px; }
  .legal:not(.has-toc) { max-width: calc(34em + var(--edge-l) + var(--edge-r)); }
  .legal.has-toc { display: grid; grid-template-columns: minmax(0, 34em) 280px; column-gap: 64px; justify-content: center; align-items: start; }
  .legal.has-toc > * { grid-column: 1; }
  .legal.has-toc > .toc-desk { display: block; grid-column: 2; grid-row: 1 / span 99; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
  .legal.has-toc > .toc-phone, .to-top { display: none; }
}

/* ---------- Pages: second round (team B, 2.12) ---------- */
/* DES-31, COPY-10: the in-app banner is short: two lines of text and a Copy link button beside them (main.js). */
.banner-inapp { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; line-height: 1.35; }
.banner-inapp .btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
/* CX-12: on a computer, a QR code beside the hint, to open the same page on a phone. Black on white always. */
.qr-hint { align-items: center; gap: 14px; }
[data-device="desktop"] .qr-hint.hint-desktop { display: flex; }
.qr-hint .qr { flex: none; display: block; border: 1px solid var(--line); border-radius: 6px; forced-color-adjust: none; }
.qr-hint p { max-width: 30em; }
/* A11Y-13 on the pages: Windows high contrast. Buttons keep an edge, icons and the logo stay visible, and the
   yellow head band in the size lists keeps its colour. Only #page and the banners: the tool screens (#tool, #cam)
   are team A's. */
@media (forced-colors: active) {
  #page .btn, #banners .btn { border: 2px solid ButtonText; }
  #page a.btn { border-color: LinkText; }
  #page .ico { color: inherit; } /* the icon takes the system colour of its text, link or button */
  .band-key::before { forced-color-adjust: none; }
  .logo .logo-img { forced-color-adjust: none; background: #FFFFFF; border-radius: 6px; }
  #doc-select { appearance: auto; -webkit-appearance: menulist; background-image: none; padding-right: 12px; }
  .banner { border-bottom: 1px solid CanvasText; }
}
/* LEG-6: the Hebrew page for buyers in Israel (/il/), right to left. The lists keep their markers on the right. */
[dir="rtl"] :is(.bul, ol.num) { padding-left: 0; padding-right: 22px; }
.il-page { overflow-wrap: anywhere; }
/* ---------- Pages: round-2 fixes (team B, 2.12) ---------- */
/* R2-DES-10: with the text made larger (text zoom), the labels grow with it instead of running over. At the normal
   size nothing changes: 6.2em of 15 px is the old 92 px, and on a computer 5.4em of 17 px is 92 px too. */
@media (min-width: 900px) { #page main:not(.home-d) .rules li { grid-template-columns: 5.4em 1fr; } }
.desk-specs dt { overflow-wrap: anywhere; }
/* DES-22 (what was left of it in round 2): the terms in a list of definitions are balanced like the headings. */
.defs dt { text-wrap: balance; }
/* R2-DES-7: on the smallest phones the footer is one column, so the email and the document names stay on one line. */
@media (max-width: 359px) { .foot-cols { grid-template-columns: minmax(0, 1fr); } }
/* Decision 5 (R2-DES-1): on a 320 px phone the checker's button stays whole on the first screen with the face-points
   line (R2-LEG-2) above it: the hero copy is a little tighter there. */
@media (max-width: 359px) { .checker-hero .hero-copy { gap: 12px; } }

/* Checker page: a document card without its own page ends in a short source link ("Source: <site>."). It is not inside a
   sentence, so it needs a full 44 px tap height; the padding grows the target without moving the text. */
.doc-card .src-line a { display: inline-block; padding: 12px 0; margin: -12px 0; }

/* ---------- Pages: round-3 fixes (team B, 3.12) ---------- */
/* R3-A11Y-1: on a computer, the yellow button in the green box at the end of a page keeps its dark text on hover
   (about 10.6:1). The white text of R2-A11Y-1 belongs to the green hover of the Upload button at the top only. */
@media (hover: hover) {
  .end-cta .btn-primary:hover, [data-device="desktop"] .end-cta .btn-upload:hover { color: var(--ink); }
}
/* R3-A11Y-6: the menu and "On this page" (<summary>) get the site's focus ring, as every other stop does. */
summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* R3-DES-2: in the narrow text column of the help pages (How it works), the two buttons at the end are one under
   the other, each on one line. The label is one <span> (pages.mjs), so it wraps as text, not as flex columns. */
@media (min-width: 900px) { .legal .end-cta .btn-row { grid-template-columns: auto; } }
.end-cta .btn { white-space: normal; }
/* R3-SEO-3: the photo in the large figure (computers) is an <img> with srcset under the drawing, on the photo's
   square of the 112 x 66 viewBox: x 14.5, y 4, 51 x 51 (largeFigure in pages.mjs). */
.fig-stage { position: relative; }
.fig-photo { position: absolute; left: 12.946%; top: 6.061%; width: 45.536%; height: 77.273%; object-fit: cover; background: #FFFFFF; }
.fig-stage svg { position: relative; }
/* R3-DES-7, R3-A11Y-4: with the text made larger (text zoom), labels and ranges wrap instead of pushing the page
   sideways or running over the text beside them. At the normal size every column keeps its width:
   - the spec panel's figure column can shrink when the text grows;
   - the rule lists and the refund lines are rows that wrap: the label (6.2em of 15 px = 92 px; on a computer 5.4em
     of 17 px) and its text side by side, or the text under the label when they no longer fit;
   - long addresses and e-mails break anywhere; an inline button is never wider than its column. */
.spec-panel { grid-template-columns: minmax(0, 136px) 1fr; }
@media (max-width: 359px) { .spec-panel { grid-template-columns: minmax(0, 96px) 1fr; } }
.rules li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rules li > b { flex: 0 0 6.2em; }
.rules li > span { flex: 1 1 10em; min-width: 0; }
@media (min-width: 900px) { #page main:not(.home-d) .rules li > b { flex-basis: 5.4em; } }
.refund-block .refund-rules li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.refund-block .refund-rules li > b { flex: 0 0 5.94em; } /* 92 px at 15.5 px */
.refund-block .refund-rules li > span { flex: 1 1 10em; min-width: 0; }
@media (min-width: 900px) { #page main:not(.home-d) .refund-block .refund-rules li > b { flex-basis: 5.42em; } } /* 92 px at 17 px */
.btn-inline { max-width: 100%; }
.prose, .legal, .doc-card { overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .steps-list.four.ruled .step-n { top: -1.6em; } /* -27 px at 17 px */
  .desk-specs { grid-template-columns: repeat(auto-fit, minmax(max(7.5em, 33.33%), 1fr)); }
  /* R3-A11Y-4b: with larger text the range wraps after its dash instead of running over the next column. At the
     normal size it is on one line from 950 px; at 900-949 px it takes two, like "Up to 240 KB" beside it. */
  .desk-specs dt .nowrap { white-space: normal; }
  /* R8-DES-2, R9-DES-7: the size grows with the screen, so at 1024-1092 px "54 KB–10 MB" needed 2-4 px more than its
     column had. R8 took the room after each column down to 8 px, and then two large values read as one ("54 KB–10 MB
     White"). So the size grows a little slower (1.75vw, not 1.9vw: 18 px up to about 1030 px, 23 px from about
     1315 px), and 12 px stay after each column: "54 KB–10 MB" is on one line from 950 px, as the note above says. */
  .desk-specs div { padding-right: 12px; }
  .desk-specs dt { font-size: clamp(18px, 1.75vw, 23px); }
}

/* ---------- Tool: round-3 fixes (team A, 3.12) ---------- */
/* Decision 4 (R3-DES-1, R3-CX-3, R3-LEG-1): everything under the price is one box, so the sticky pay row stops
   under the price and never covers it. The "By paying, you agree…" line sits in the sticky row, above the button. */
.price-body { display: grid; gap: 14px; min-width: 0; }
.pay-terms { margin: 0; }
@media (max-width: 899px) {
  /* A box reached with the keyboard stops above the sticky pay row (terms line + button), not under it. */
  html:has(.price-card .btn-row.is-sticky) { scroll-padding-bottom: calc(212px + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) {
  html:has(.price-card .btn-row.is-sticky) { scroll-padding-bottom: 124px; }
}
@media (max-width: 899px) and (max-height: 500px) {
  html:has(.price-card .btn-row.is-sticky) { scroll-padding-bottom: 0; }
}
/* R3-CX-1: "Already paid? Use your order code" opens a field in place, in the price card. */
.have-code-form { display: grid; gap: 8px; }
.have-code-form .code-msg:empty { display: none; }
.have-code-form input[aria-invalid="true"] ~ .code-msg { color: var(--fail); font-weight: 700; } /* a code that can't be used */

/* ---------- Pages: round-4 fixes (team B, 3.12) ---------- */
/* R4-DES-6: the skip link hides above the page by its own height (its bottom edge on the page's top edge), not by a
   fixed -60 px, so with larger text (66 px tall at 200%) no strip of it shows above the logo. bottom: 100% and not
   translateY(-100%): WebKit rounds the translation and left 0.2-0.4 px of it on the screen. On focus it is where it
   was, 8 px from the top. */
.skip { top: auto; bottom: 100%; }
.skip:focus { top: 8px; bottom: auto; }
/* R4-DES-1: on a computer the top bar grows with its links. At the normal size it stays 76 px with the five links on
   one line; with larger text (200% at 900-1280 px) the links wrap to a second row inside the bar, each one whole,
   instead of running above the screen and under the bar. The tool's own bar (.tool-bar) keeps its rules. */
@media (min-width: 900px) {
  .topbar:not(.tool-bar) { height: auto; min-height: 76px; }
  .desk-nav { flex-wrap: wrap; justify-content: flex-end; row-gap: 0; }
  .desk-nav a { white-space: nowrap; }
}

/* Tool: round-4 fixes (team A, 3.12) */
/* Decision 1 (R4-CX-1, R4-A11Y-1): a download that didn't go ahead says why right after the button that was tapped.
   In a file row it sits under the name and the button; the count of downloads (#dl-left) is above the list. */
.dl-row-msg { margin: 0; color: var(--fail); font-weight: 700; }
.downloads li > .dl-row-msg { grid-column: 2 / -1; }
.dl-btn[aria-disabled="true"], .save-photos[aria-disabled="true"] { cursor: progress; }
/* R4-DES-2: the clear top of the sticky pay row rises into the space under the tax line, so at rest no line of the
   card shows half faded under it. */
.price-card > .price-body { margin-top: -12px; }
.price-card > .price-body > :first-child { margin-top: 12px; }
/* Decision 5 (R4-DES-7): a pay row taller than 35% of the screen (tool.js fitPayRow, large text) stays in its
   place in the card instead of at the bottom of the screen. */
.price-card .btn-row.is-sticky.is-tall { position: static; margin: 0; padding: 0; background: none; }
html:has(.price-card .btn-row.is-sticky.is-tall) { scroll-padding-bottom: 0; }
/* R4-A11Y-4: a large phone on its side (900 px wide or more, under 500 px high) gets the computer layout; its pay row
   scrolls with the page too, like on smaller phones on their side. */
@media (max-height: 500px) {
  .price-card .btn-row.is-sticky { position: static; padding: 0; margin: 0; background: none; }
  html:has(.price-card .btn-row.is-sticky) { scroll-padding-bottom: 0; }
}
/* R4-A11Y-2: in Windows high contrast the sticky rows keep a solid background, so the text under them never shows
   through. */
@media (forced-colors: active) {
  .btn-row.is-sticky, .price-card .btn-row.is-sticky { background: Canvas; }
}
/* R4-A11Y-3: the order code's message is red whenever it is a problem, also when the code itself is right. */
.have-code-form .code-msg.is-problem { color: var(--fail); font-weight: 700; }
/* R4-SEO-2: on a computer "Upload a photo" is first from the first paint (boot.js sets data-device before it), so
   nothing swaps places when the tool loads. */
[data-device="desktop"] #page .btn-row:has(.btn-take) .btn-upload { order: -1; }

/* Pages: round-5 fixes (team B, 3.12) */
/* R5-A11Y-4: a rule's name (the bold word on the left of a rule or refund line) breaks between words only. At
   900-1366 px "Background" (94 px) did not fit its 92 px column and .prose broke it as "Backgroun" / "d"; now the
   name is 94 px wide in that row, and its text starts 2 px further right, still 12 px away (never over it, also with
   wider letter spacing). The other rows don't move. "Head covering" still wraps at its space. */
.rules li > b, .refund-block .refund-rules li > b { overflow-wrap: normal; }
/* R5-DES-6: the renewal page's four facts (the panel with no figure): two columns at the normal size, as before;
   one column when a column would be narrower than 7.5em (text at 200% on a phone), so "6 months" is not cut at the
   panel's edge and "background" does not run into "Taken in the last". The 0.5 px under half a column is slack
   for rounding, so two columns always fit; 1fr still makes them the same width as before. */
.spec-panel.no-fig .spec-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(7.5em, calc(50% - 7.5px))), 1fr)); }

/* Tool: round-5 fixes (team A, 3.12) */
/* R5-DES-2: a file row's Download looks busy while the order server counts it ("Checking…"), like the large
   buttons. */
.dl-btn[aria-disabled="true"] { background: #DDE4E0; color: #3F4B46; }
/* R5-DES-4: with large text on a narrow phone, a long word (the support email) breaks where it has no room, so no
   line runs off the screen. Words that fit are never broken. */
#tool-main { overflow-wrap: anywhere; }
/* R5-SEO-1: the engine's bar keeps its place when the checks are ready, so nothing under it moves up. A load that
   failed keeps its own rule (the bar goes, and "Try again" comes). */
.engine.is-ready:not(.is-error) .bar { display: block; visibility: hidden; }
/* R5-DES-5: on a phone the tool's bar grows with a title that wraps to two lines (large text), so no line of it is
   cut. At the normal size it stays 56 px. */
@media (max-width: 899px) {
  .tool-bar { height: auto; min-height: 56px; padding-top: 4px; padding-bottom: 4px; }
}

/* ---------- Pages: round-6 fixes (team B, 3.12) ---------- */
/* R6-DES-2: Windows high contrast with a light theme (Desert, for example). The mat behind the figures turns to the
   system's Canvas (white), but the SVG keeps the paints it has for the dark green: the white and pale green labels
   vanish, and the ruler, its ticks and the size line under the photo fade to about 1.5:1. So everything drawn on
   the mat takes the system's text colour, in light and dark themes alike. The photo, the yellow band on it and the
   dashed chin line keep their colours: they lie on the photo, which forced colours never change. The phone's small
   figure has the same ruler. In the normal colours nothing changes. */
@media (forced-colors: active) {
  .desk-figure svg text { fill: CanvasText; }
  :is(.desk-figure, .rule-fig) svg :is(g[stroke], line:not([stroke-dasharray])) { stroke: CanvasText; }
  /* R7-A11Y-2: the photo checker's drawing too. */
  .hero-art svg text { fill: CanvasText; }
  .hero-art svg :is([stroke="#C6DAD2"], [stroke="#FFFFFF"]) { stroke: CanvasText; }
}
/* R6-DES-5 (what was left of R3-DES-7): the steps ruler ("How it works") grows with the text. At the normal size
   every value is today's:
   - on a computer the four steps start 40 px under the ruler (8 px + 2em of 16 px), so with text at 200% their
     numbers (top: -1.6em) stay under the ruler's ticks instead of crossing its line;
   - the vertical ruler (phones, and the long list on /how-it-works/) keeps 46 px before each step's text while that
     text is up to 17 px; with larger text the space grows, so a number never touches its title (8 px or more at
     200%). It grows slowly on purpose: with more than 58 px, "300 × 300 pixels" on /how-it-works/ broke inside
     "pixels" at 320 px with text at 200%. On a computer the four steps keep their own padding
     (.steps-list.four.ruled li is more specific). */
@media (min-width: 900px) { .steps-list.four.ruled { padding-top: calc(8px + 2em); } }
.steps-list.ruled li { padding-left: max(46px, calc(36.5px + 0.55em)); }
/* R6-DES-6: in the footer, "(DS-160)" (span.nowrap from tidy() in pages.mjs) is no longer a flex item of its own
   inside the inline-flex link: the link's words and the span wrap as one text, and "(DS-160)" still never breaks. */
.foot-col a > .nowrap, .menu-panel a > .nowrap { display: contents; } /* R7-DES-4: in the phone's menu too */
/* The breaks scan after R6-DES-6: on phones of 360-899 px with text at 200%, a footer column is about 160-180 px
   and "Accessibility" broke inside the word. A column is never narrower than 9em: at the normal size that is
   144 px, under half the footer at 360 px, so there are two columns as before (the 0.5 px under half a column is
   slack for rounding, and 1fr keeps both the same width); with larger text the columns go one under the other.
   Under 360 px the footer is one column already (R2-DES-7), and a computer keeps its three. */
@media (min-width: 360px) and (max-width: 899px) {
  .foot-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(9em, calc(50% - 8.5px))), 1fr)); }
}

/* ---------- Tool: round-6 fixes (team A, 3.12) ---------- */
/* R6-A11Y-1: the 35% rule (tool.js fitPayRow) for every sticky row of the tool: the pay row, and Continue on the checks
   screen. Taller than that (large text on a small phone), the row stays in its place in the page. */
#tool .btn-row.is-sticky.is-tall { position: static; margin: 0; padding: 0; background: none; }
html:has(#tool .btn-row.is-sticky.is-tall) { scroll-padding-bottom: 0; }
/* R6-SEO-2, R7-SEO-1: the engine line on the pages keeps room for its last words, "Ready. Checks run on this device."
   (tool.js), at any width and any text size, so nothing under it moves when they replace "Getting ready… 42%". The copy
   is hidden, also from screen readers, and takes no width. */
#engine-status .engine-text { display: flow-root; }
#engine-status:not(.is-error) .engine-text::before { content: "Ready. Checks run on this device."; float: left; width: 100%; margin-right: -100%; visibility: hidden; }
/* R6-DES-4: the words on the small buttons are never cut in the middle (R5-DES-4 lets long words break). With large text
   on a narrow phone the four move buttons take two rows, and Download takes the whole width of its row. */
.adjust-move .btn, .dl-btn { overflow-wrap: normal; }
.adjust-move { grid-template-columns: repeat(auto-fit, minmax(min(100%, 4em), 1fr)); } /* 4em: four in a row on a 320 px phone (R7-DES-8) */
/* R10-DES-1: the status line keeps room for ". This is as far as it goes." (tool.js draw() puts the line with it in
   data-full), so at the edge the buttons under it don't move, and the next tap lands on the same button. The copy is
   hidden, also from screen readers, and takes no width, like #engine-status. Without data-full there is no copy
   (attr() of a missing attribute is empty), and the line is as it was. */
#adj-status { display: flow-root; }
#adj-status::before { content: attr(data-full); float: left; width: 100%; margin-right: -100%; visibility: hidden; }
/* R11-SEO-1: the line under the tapped buttons (boot.js, main.js) keeps the room of "Getting ready… Tap again in a moment."
   when "Ready. Tap again." takes its place, so nothing under it moves up (large text on a phone). The copy is hidden, also
   from screen readers, and takes no width, like #engine-status. "This page didn’t load completely…" is longer: it may take
   more room, never less. */
#start-wait { display: flow-root; }
#start-wait::before { content: "Getting ready\2026  Tap again in a moment."; float: left; width: 100%; margin-right: -100%; visibility: hidden; }
/* R11-DES-1: on the green of the last block of a page (.end-cta) and of every .mat, the line is light, as the words
   next to it are (6.95:1). */
.mat #start-wait { color: var(--on-mat-2); }
.downloads li { container: dl-row / inline-size; }
/* R6-DES-4, R10-DES-2: in a narrow row (large text on a phone) the name, the text, the button and its message take the
   row's whole width under the icon, so "1800 × 1200 px" and "600 × 600 px" stay whole. */
@container dl-row (max-width: 12em) { .downloads li > div, .downloads li > .dl-btn, .downloads li > .dl-retry, .downloads li > .dl-row-msg { grid-column: 1 / -1; } }
/* R6-QA-3: an order code stays whole (tool.js keepCode). */
/* R11-DES-2: punctuation right after a code goes with it (keepCode(code, tail)), so no line starts with "." or "”". */
.keep-code, .keep-with { display: inline-block; max-width: 100%; }
/* R13-DES-1 (decision 6 of fix-plan-r13): inside .keep-with the code is plain text in the one box with its punctuation: a code
   wider than the line (a narrow box at 200%) breaks after its hyphen, and the comma stays with its last part, not alone on a line. */
.keep-with > .keep-code { display: inline; }
.linkbtn .keep-code { text-decoration: underline; text-underline-offset: 3px; }
/* R6-DES-8: in Windows high contrast "Checking…" looks busy too, not like a Download that can be tapped. */
@media (forced-colors: active) {
  .dl-btn[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
}

/* ---------- Pages: round-9 fixes (team S, 4.12) ---------- */
/* R9-DES-1: the in-app banner. When the copy fails, "Copy link" says "Couldn’t copy. Use the app menu." (boot.js), a
   long label that stays on one line (.btn is nowrap): in the grid above it left the text a column of one word, and
   with text at 200% it covered the text and pushed the page sideways. Now the text and the button share a row only
   while both fit; otherwise the button goes under the text, and its label wraps when it is wider than the screen.
   At the normal size "Copy link" stays beside the text, as before. [data-inapp="1"] makes this win over the
   display: grid of .inapp-only. The status line (#copy-link-status) is .sr-only, so it takes no room in the row.
   A label of two or three lines (text at 200%) keeps 6 px above and below it inside the border; one line at the
   normal size is still 44 px high (min-height). */
[data-inapp="1"] .banner-inapp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.banner-inapp > p { flex: 1 1 11em; min-width: 0; }
.banner-inapp .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: center; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; }
/* R9-DES-2, R9-A11Y-5: the note at the top of a tool page (#saved-note, "We couldn’t confirm your payment yet … email
   support@rulesize.com …", tool.js) is an item of the .hero-copy grid. At 320 px with text at 200% the e-mail was one
   word wider than the screen, and the whole first screen moved sideways. It breaks inside now, as on the other
   pages (.prose, .legal). At the normal size nothing changes. */
#saved-note { min-width: 0; overflow-wrap: anywhere; }
