/* Provn — styles. Colours: ink #0F1B2D, teal #0E6B58, amber #B45309 */
:root {
  --ink: #0F1B2D; --muted: #4A5565; --bg: #F4F6F8; --card: #FFFFFF; --line: #DDE2E8;
  --ok: #0E6B58; --ok-bg: #E7F3EF; --warn: #B45309; --warn-bg: #FDF1E5; --pend: #1D4ED8; --pend-bg: #EAF0FD;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { color: var(--ok); }
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
.break { word-break: break-all; }
.error { color: #B42318; font-weight: 600; }
:focus-visible { outline: 3px solid var(--pend); outline-offset: 2px; }

/* Header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: 0.04em; color: var(--ok); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 15px; }
.site-header nav a { text-decoration: none; }
.site-header nav a[aria-current="page"]:not(.btn) { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; background: var(--card); }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 1.5px solid var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #22324d; color: #fff; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: #fff; color: var(--ink); }
.btn-sm { min-height: 40px; padding: 8px 14px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 17px; }
.link-btn { background: none; border: 0; padding: 8px 4px; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }

/* Hero */
.hero { padding: 48px 0 24px; max-width: 720px; }
.hero h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); margin: 0; }

/* Panels & layout */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stamp-layout, .verify-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.stamp-layout > .panel { flex: 999 1 520px; min-width: 0; }
.steps { flex: 1 1 260px; display: flex; flex-direction: column; gap: 16px; }
.verify-layout > .panel { flex: 1 1 380px; }
.verify-result { flex: 1 1 420px; min-width: 0; }
.placeholder { border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 24px; text-align: center; }

/* Drop zone */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 240px; padding: 32px; border: 2px dashed #9AA5B4; border-radius: var(--radius); background: #FAFBFC; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--ok); background: var(--ok-bg); }
.dropzone-sm { min-height: 140px; padding: 20px; }
.dz-title { font-weight: 600; font-size: 17px; }
.icon { width: 28px; height: 28px; flex: none; }
.dropzone .icon { width: 40px; height: 40px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; font-weight: 600; font-size: 15px; }
.field input, .id-form input { font: 16px var(--sans); padding: 12px 14px; min-height: 46px; border: 1.5px solid #9AA5B4; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .id-form input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px #C7D7FB; }
.file-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--bg); border-radius: 10px; padding: 10px 14px; word-break: break-all; }
.id-form { margin-top: 20px; }
.id-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; text-transform: uppercase; }

.status-line { display: flex; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Steps */
.step { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.step p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* Results */
.result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.result-ok { border-top: 6px solid var(--ok); }
.result-warn { border-top: 6px solid var(--warn); }
.result-head { display: flex; gap: 12px; align-items: flex-start; }
.result-head h2 { margin: 0; font-size: 22px; }
.result-head p { margin: 2px 0 0; }
.result-ok .result-head .icon { color: var(--ok); width: 32px; height: 32px; }
.result-warn .result-head .icon { color: var(--warn); width: 32px; height: 32px; }
.result-ok h2 { color: var(--ok); }
.result-warn h2 { color: var(--warn); }
.done-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 18px; }
.done-grid p { margin: 0 0 6px; }
.seal-id { font-size: 26px; font-weight: 700; letter-spacing: 0.04em; }
.qr { width: 132px; height: 132px; image-rendering: pixelated; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.result-line { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; }
.result-line.ok { color: var(--ok); }
.result-line.warn { color: var(--warn); }
.result-line .icon { width: 22px; height: 22px; }

/* Certificate */
.certificate { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; margin-top: 36px; }
.cert-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-start; }
.cert-head h1 { margin: 4px 0 0; font-size: clamp(26px, 4vw, 36px); word-break: break-word; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.status { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 16px 18px; margin: 24px 0; }
.status p { margin: 2px 0 0; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-ok p, .status-pending p, .status-warn p { color: var(--ink); }
.status-pending { background: var(--pend-bg); color: var(--pend); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; margin: 0; }
.details dt { font-size: 13px; color: var(--muted); }
.details dd { margin: 2px 0 0; font-weight: 600; }
.details .span-2 { grid-column: span 2; }
.tag { font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 2px 8px; }
.check-file { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.check-file h2 { font-size: 18px; margin: 0 0 12px; }
.cert-foot { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }

/* Prose */
.prose { max-width: 720px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 32px 24px; }
.prose h2 { font-size: 21px; margin: 28px 0 8px; }
.prose li { margin: 6px 0; }

@media (max-width: 600px) {
  .details { grid-template-columns: 1fr; }
  .details .span-2 { grid-column: auto; }
  .certificate, .prose { padding: 20px; }
  .panel { padding: 16px; }
  .hero { padding-top: 32px; }
}

.print-only, .print-only-inline { display: none; }

@media print {
  /* margin 0 stops the browser adding its own header/footer (title, date, page number) */
  @page { size: A4; margin: 0; }
  html, body { background: #fff; font-size: 11pt; }
  body { padding: 12mm; }
  .site-header, .site-footer, .no-print, .skip, .flash { display: none !important; }
  .print-only { display: flex !important; }
  .print-only-inline { display: inline !important; }
  main.wrap, .wrap { max-width: none; padding: 0; margin: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .certificate { border: 2px solid var(--ink); border-radius: 14px; margin: 0; padding: 12mm 13mm 9mm;
                 min-height: calc(297mm - 24mm); display: flex; flex-direction: column; break-inside: avoid; }
  .cert-brand { align-items: center; gap: 10px; padding-bottom: 7mm; margin-bottom: 8mm; border-bottom: 1px solid var(--line); }
  .cert-wordmark { font-weight: 800; font-size: 20pt; letter-spacing: .06em; color: var(--ok); }
  .cert-domain { margin-left: auto; color: var(--muted); font-size: 10pt; }
  .cert-head h1 { font-size: 26pt; }
  .qr { width: 34mm; height: 34mm; }
  .cert-foot { margin-top: auto; }
  .cert-printfoot { align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5mm; padding-top: 4mm; border-top: 1px solid var(--line); font-size: 9.5pt; }
  .cert-printed { margin-left: auto; color: var(--muted); }
  a { text-decoration: none; color: var(--ink); }
}

/* ---------- v1.1: accounts, dashboard, pricing ---------- */
.flash { border-radius: 10px; padding: 12px 16px; margin: 20px 0 0; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: #0B5546; }
.flash-info { background: var(--pend-bg); color: #1E3A8A; }
.flash-warn { background: var(--warn-bg); color: #8A3B06; }
.error-link { color: inherit; margin-left: 4px; }
.center { text-align: center; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.btn-block { width: 100%; }
.btn-danger { background: #B42318; border-color: #B42318; color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }

.auth { max-width: 460px; margin: 0 auto; }
.auth h1 { margin: 40px 0 8px; font-size: 32px; }
.auth .lead { margin-bottom: 20px; font-size: 16px; }
.form { padding: 24px; margin-top: 16px; }
.form .btn-block { margin-top: 8px; }
.form-tight .field { margin: 12px 0; }
.hero-sm { padding: 32px 0 8px; }
.center-hero { margin: 0 auto; text-align: center; }

.usage-note { margin: 0 0 14px; }
.step-cta { background: var(--ok-bg); border-color: #BFE0D6; }
.step-cta p { color: var(--ink); margin-bottom: 10px; }

.batch-list { list-style: none; padding: 0; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; max-height: 320px; overflow: auto; }
.batch-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.batch-list li:last-child { border-bottom: 0; }
.b-name { word-break: break-all; }
.b-status { flex: none; text-align: right; }
.b-ok .b-status { color: var(--ok); }
.b-err .b-status { color: #B42318; }

/* Dashboard */
.dash-head { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: flex-end; padding: 32px 0 8px; }
.dash-head h1 { margin: 0 0 4px; font-size: 34px; }
.dash-head p { margin: 0; }
.usage { padding: 14px 18px; min-width: 260px; }
.usage p { margin: 6px 0 0; }
.usage-row { display: flex; justify-content: space-between; gap: 12px; }
.meter { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.meter-fill { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin: 20px 0 16px; }
.search { display: flex; gap: 8px; flex: 1 1 340px; }
.search input { flex: 1; min-width: 0; font: 15px var(--sans); padding: 10px 12px; min-height: 44px; border: 1.5px solid #9AA5B4; border-radius: 10px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { padding: 0; overflow-x: auto; }
table.stamps { width: 100%; border-collapse: collapse; font-size: 14px; }
.stamps th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.stamps td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stamps tr:last-child td { border-bottom: 0; }
.file-cell { min-width: 220px; word-break: break-word; }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions .link-btn { margin-right: 10px; font-size: 14px; padding: 0; }
.inline-form { display: inline; }
.link-btn.danger { color: #B42318; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.stamps .badge { margin-left: 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-pend { background: var(--pend-bg); color: var(--pend); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.empty { text-align: center; padding: 48px 24px; }
.empty h2 { margin-top: 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; }

/* Account */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 16px; }
.account-grid h2 { margin: 0 0 12px; font-size: 20px; }
.plan-line { font-size: 22px; margin: 0; }
.logout-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-zone { border-color: #F3C4BF; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 12px; align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan h2 { margin: 0; font-size: 22px; }
.price { font-size: 34px; font-weight: 800; margin: 8px 0 12px; }
.plan .ticks { flex: 1; }
.plan-featured { border: 2px solid var(--ink); }
.plan-flag { position: absolute; top: -13px; left: 20px; margin: 0; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-soon { background: #FAFBFC; }
.ticks { list-style: none; padding: 0; margin: 0 0 20px; }
.ticks li { padding: 6px 0 6px 26px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.ticks-muted li::before { content: "·"; color: var(--muted); }
.fineprint { margin-top: 16px; }
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }

/* Stamps table becomes cards on phones */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; background: transparent; border: 0; }
  table.stamps, .stamps tbody, .stamps tr, .stamps td { display: block; width: auto; }
  .stamps thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stamps tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 6px 0; }
  .stamps td { border: 0; padding: 4px 16px; }
  .stamps td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .file-cell { min-width: 0; }
  .row-actions { padding-top: 8px !important; padding-bottom: 8px !important; }
  .row-actions a, .row-actions .link-btn { display: inline-block; padding: 8px 0; margin-right: 18px; }
  .search { flex-basis: 100%; }
  .usage { min-width: 0; width: 100%; }
}

/* PayPal */
.pay-note { margin: 0 0 10px; }
.paypal-buttons { min-height: 100px; }
.paypal-buttons.is-busy { opacity: .5; pointer-events: none; }

/* Seal on files */
.seal-box { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px 12px; margin: 16px 0; background: #FAFBFC; }
.seal-toggle { margin: 12px 0 8px; }
.seal-options { display: flex; flex-wrap: wrap; gap: 10px 16px; padding-left: 30px; }
.seal-options[hidden] { display: none !important; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.field-inline select { font: 15px var(--sans); padding: 9px 10px; min-height: 42px; border: 1.5px solid #9AA5B4; border-radius: 10px; background: #fff; color: var(--ink); }
.seal-explain { flex-basis: 100%; margin: 4px 0 0; }
.sealed-out { margin: 18px 0 4px; padding: 16px; border-radius: 12px; background: var(--ok-bg); }
.sealed-out p { margin: 0 0 12px; }
.sealed-preview { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; background: #fff; }

.seal-upsell { margin: 16px 0; padding: 12px 16px; border-radius: 12px; background: var(--pend-bg); color: #1E3A8A; }
.seal-upsell a { color: inherit; font-weight: 600; }

/* ---------- Mobile tidy-up ---------- */
.header-cta, .nav-toggle, .mobile-only { display: none; }
.nav-toggle { width: 44px; height: 44px; align-items: center; justify-content: center; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; padding: 0; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: inline; }
.field-inline select, .search input { font-size: 16px; } /* 16px+ stops iPhones zooming in on tap */

@media (max-width: 720px) {
  .header-row { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .logo { margin-right: auto; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: inline-flex; }
  .site-header nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 2px 0 -4px; }
  .site-header nav.is-open { display: flex; }
  .site-header nav a { display: flex; align-items: center; min-height: 50px; padding: 0 4px; border-top: 1px solid var(--line); font-size: 17px; }
  .site-header nav a.btn { display: none; }
  .site-header nav .mobile-only { display: flex; }
  .site-header nav a[aria-current="page"] { font-weight: 700; text-decoration: none; color: var(--ok); }

  .hero { padding: 24px 0 16px; }
  .hero h1 { font-size: 29px; }
  .lead { font-size: 16.5px; }
  .dash-head { padding-top: 22px; }
  .dash-head h1, .auth h1 { font-size: 28px; }
  .auth h1 { margin-top: 24px; }
  .dropzone { min-height: 190px; padding: 24px 16px; }
  .link-btn { min-height: 44px; }
  .row-actions a, .row-actions .link-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .search { min-width: 0; }
  .search input { width: 100%; min-width: 0; }
  .toolbar-actions .btn { flex: 1 1 auto; }
  .stamps td[data-label]::before { font-family: var(--sans); }
  .seal-options { padding-left: 0; }
  .seal-box { padding: 4px 12px 12px; }
  .done-grid { gap: 14px; }
  .seal-id { font-size: 22px; }
  .actions .btn { flex: 1 1 auto; }
  .certificate { margin-top: 16px; }
  .cert-head { flex-direction: column-reverse; align-items: flex-start; }
  .cert-head .qr { width: 112px; height: 112px; }
  .price { font-size: 30px; }
  .footer-row { gap: 6px 18px; }
  .footer-row a { display: inline-flex; min-height: 40px; align-items: center; }
}

.seal-ink { flex-basis: 100%; margin: 2px 0 0; font-size: 14.5px; }
.seal-ink[hidden], [data-seal-place][hidden], [data-seal-align][hidden], [data-seal-position][hidden], [data-seal-pages][hidden] { display: none !important; }
.seal-pair { flex-basis: 100%; margin: 6px 0 0; font-size: 14.5px; }
.pair-line { margin: 12px 0 0 !important; }
.linked dd a { font-weight: 700; }
.file-cell .badge { margin-left: 6px; vertical-align: 1px; }

/* Document scanner */
.scan-entry { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.scan-entry .btn { gap: 10px; }
.scan-title { margin: 0 0 6px; font-size: 22px; }
.scan-add { gap: 10px; margin: 12px 0; cursor: pointer; }
.scan-mode { border: 0; padding: 0; margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 0 22px; }
.scan-mode legend { padding: 0; margin-bottom: 2px; }
.scan-mode .check { margin: 6px 0; min-height: 36px; align-items: center; }
.inline-busy { display: inline-flex; margin-left: 10px; font-weight: 400; }
.scan-list { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.scan-page { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.scan-page img { display: block; width: 100%; height: 180px; object-fit: contain; background: #EEF1F4; }
.scan-num { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 6px; }
.scan-tools { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.scan-tools button { min-height: 44px; border: 0; border-right: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; color: var(--ink); }
.scan-tools button:last-child { border-right: 0; color: #B42318; }
.scan-tools button:disabled { color: #C3C9D1; cursor: default; }

/* ---------- Brand theme: logo green as the accent colour ---------- */
:root { --brand: #0E6B58; --brand-dark: #0A5545; --brand-tint: #E7F3EF; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.prose a, .flash a, .lead a { color: var(--brand); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }
.site-header nav a:not(.btn) { color: var(--ink); }
.site-header nav a:not(.btn):hover, .site-header nav a[aria-current="page"]:not(.btn) { color: var(--brand); }
:focus-visible { outline-color: var(--brand); }

.btn-dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-dark:hover, .btn-dark:focus-visible { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-outline:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn-danger { background: #B42318; border-color: #B42318; color: #fff; }
.link-btn { color: var(--brand); }
.link-btn.danger { color: #B42318; }
.nav-toggle { color: var(--brand); border-color: #CFE3DC; }

.step-n { background: var(--brand); }
.plan-featured { border-color: var(--brand); }
.plan-flag { background: var(--brand); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-tint); }
.field input:focus, .id-form input:focus, .search input:focus, .field-inline select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #CDE6DE; }
.check input, .scan-mode input { accent-color: var(--brand); }
.scan-num { background: var(--brand); }
.row-actions a { color: var(--brand); }

/* Keep "confirmed / match" messages distinct from buttons: tinted panel + heavier heading, never a solid green block */
.status-ok { background: var(--brand-tint); border: 1px solid #BFDDD3; }
.status-ok strong { font-size: 17px; }
.result-ok { border-top-color: var(--brand); }

/* Seal style picker */
.seal-style-row { display: flex; align-items: flex-end; gap: 14px; flex-basis: 100%; flex-wrap: wrap; }
.seal-style-row .field-inline { flex: 1 1 220px; }
.seal-style-preview { width: 120px; height: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-sizing: border-box; }
.seal-style-preview.is-badge { height: 56px; width: 180px; }
.seal-style-preview.is-strip { height: 40px; width: 240px; }

/* ---------- Print: certificate always fits on one page (A4 or Letter) ---------- */
@media print {
  html, body { font-size: 10pt; }
  body { padding: 10mm 11mm; }
  .certificate { min-height: 240mm; padding: 9mm 10mm 7mm; }
  .cert-brand { padding-bottom: 4mm; margin-bottom: 5mm; }
  .cert-wordmark { font-size: 17pt; }
  .cert-head { flex-direction: row !important; flex-wrap: nowrap; align-items: flex-start; gap: 8mm; }
  .cert-head > div { flex: 1 1 auto; min-width: 0; }
  .cert-head h1 { font-size: 19pt; line-height: 1.2; }
  .cert-head .qr, .qr { width: 30mm !important; height: 30mm !important; flex: none; }
  .status { margin: 5mm 0; padding: 3.5mm 4.5mm; gap: 3mm; }
  .status strong { font-size: 11.5pt; }
  .status p { font-size: 9.5pt; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 3.2mm 8mm; }
  .details .span-2 { grid-column: span 2 !important; }
  .details dt { font-size: 8pt; }
  .details dd { font-size: 9.5pt; }
  .details dd.small, .details .small { font-size: 8.5pt; }
  .cert-foot { padding-top: 4mm; font-size: 8.5pt; }
  .cert-foot p { margin: 0 0 2mm; }
  .cert-printfoot { margin-top: 3mm; padding-top: 3mm; font-size: 8.5pt; }
  .certificate, .details, .status, .cert-head { break-inside: avoid; page-break-inside: avoid; }
}

.cert-issuer { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.cert-issuer .icon { width: 20px; height: 20px; color: var(--brand); flex: none; }
@media print { .cert-issuer { margin-bottom: 2.5mm; } .cert-issuer .icon { width: 4.5mm; height: 4.5mm; } }

/* ---------- Install as an app ---------- */
.install-help { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; max-width: 420px; margin: 0 auto;
  display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 40px 14px 14px;
  box-shadow: 0 12px 32px rgba(15, 27, 45, 0.18); font-size: 15px; }
.install-help img { border-radius: 10px; flex: none; }
.install-help ol { margin: 6px 0 0; padding-left: 20px; }
.install-help li { margin: 2px 0; }
.install-help svg { vertical-align: -3px; color: #007AFF; }
.install-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 24px; line-height: 1; padding: 6px; color: var(--muted); cursor: pointer; }
[data-install][hidden] { display: none !important; }
.offline { text-align: center; max-width: 460px; padding: 15vh 20px 40px; }
.offline img { border-radius: 20px; }
.offline h1 { margin: 18px 0 8px; }
@media (display-mode: standalone) { .site-header { padding-top: env(safe-area-inset-top); } }

/* ---------- Guides ---------- */
.crumbs { margin: 20px 0 0; color: var(--muted); }
.crumbs a { color: var(--brand); }
.guide { max-width: 760px; }
.guide-head { padding: 12px 0 8px; }
.guide-head h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.12; margin: 6px 0 10px; letter-spacing: -0.02em; }
.guide-head .lead { margin: 0 0 8px; }
.guide-body { max-width: none; font-size: 17px; line-height: 1.65; }
.guide-body h2 { font-size: 23px; margin: 32px 0 10px; }
.guide-body h3 { font-size: 18px; margin: 22px 0 6px; }
.guide-body p, .guide-body ul, .guide-body ol { margin: 0 0 14px; }
.guide-body ul, .guide-body ol { padding-left: 22px; }
.guide-body .faq { border-top: 1px solid var(--line); padding: 10px 0; }
.guide-body .faq summary { cursor: pointer; font-weight: 600; }
.guide-body .faq p { margin: 8px 0 4px; }
.guide-note { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; }
.guide-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-tint); }
.guide-cta img { border-radius: 12px; }
.guide-cta div { flex: 1 1 220px; }
.guide-cta p { margin: 2px 0 0; }
.guide-more h2 { font-size: 20px; margin: 28px 0 10px; }
.guide-list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }
.guide-list a { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.guide-list a:hover { border-color: var(--brand); }
.guide-list a strong { color: var(--brand); }
.guide-list-big { max-width: 760px; }
.guide-list-big a { padding: 18px 20px; }
.guide-list-big a strong { font-size: 18px; }
@media (max-width: 640px) {
  .guide-body { font-size: 16px; padding: 4px 18px 18px; }
  .guide-cta .btn { width: 100%; text-align: center; }
}
