/* Page organizer and photo fixer (qrprint/web). Touch first: 44-48 px targets, no text-only drags. */
.org-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }
.org-count { font-size: 0.9rem; color: #475569; }
.org-count.warn { color: #be123c; font-weight: 700; }
.org-hint { font-size: 0.85rem; color: #64748b; margin: 4px 0 8px; }
.org-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; } /* two tiles across on a 360 px phone */
.org-tile { background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; padding: 6px; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.org-tile.skipped { opacity: 0.45; }
.org-tile.colour { border: 2px solid #f59e0b; }
.org-tile.sortable-chosen { transform: scale(1.04); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.org-tile.sortable-ghost { opacity: 0.35; }
.org-face { position: relative; height: 150px; display: grid; place-items: center; overflow: hidden; background: #f1f5f9; border-radius: 8px; }
.org-face img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; } /* max-height:% does not resolve in an auto grid cell */
.org-face.org-plain { color: #64748b; font-size: 0.85rem; text-align: center; }
.org-face .org-look { position: absolute; right: 2px; top: 2px; background: rgba(255, 255, 255, 0.9); }
/* an edited tile the PC never drew: the raw page stays visible above this strip (spec one-order §1) */
.org-face .ld-failed.org-again { inset: auto 0 0 0; min-height: 44px; background: rgba(241, 245, 249, 0.94); }
.org-num { position: absolute; left: 4px; top: 4px; background: #312e81; color: #fff; border-radius: 999px; min-width: 24px; padding: 0 6px; font-size: 0.8rem; text-align: center; }
.org-bar, .org-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.org-btn { min-width: 44px; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.org-btn.danger { color: #be123c; border-color: #be123c; }
/* owner 2026-11-14: beside Colour, "Arrange cards" was squeezed to one word a line and stuck out of the tile.
   Fix / Arrange cards has a whole row on every screen; a wide screen's tile is wide enough for Print and Colour together. */
.org-btn.edit { flex: 1 1 100%; padding: 0 8px; }
@media (min-width: 860px) { .org-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); } }
.org-bar[hidden] { display: none; }   /* fewTools: folded under the tile's More button */
.org-btn.org-more { padding: 0 10px; font-size: 0.875rem; white-space: nowrap; }
/* owner 2026-11-14: beside More, More sat unevenly. With More on the tile:
   Print and Colour share a row, the Portrait/Landscape switch and More share the last. */
.org-marks:has(.org-more) { gap: 6px; }
.org-marks:has(.org-more) .org-btn.org-more { flex: 1 1 0; padding: 0 6px; }
.org-marks:has(.org-more) .org-btn.org-orient { padding: 0 6px; }
/* owner 2026-11-15: in Tamil the switch's word (அகலவாக்கு) is longer than half a tile; squeezed to 46 px it ran 70 px
   out of the tile and made the whole page wider than the phone. The switch keeps its word's width (More then takes
   the next row) and never reaches past its tile. */
.org-marks .org-btn.org-orient { flex: 1 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 340px) { .org-marks .org-btn.org-orient { font-size: 0.78rem; padding: 0 2px; } }   /* a 320 px phone: the Tamil word whole */
.org-note { margin: 6px 0 0; font-size: 0.8rem; color: #92400e; } /* a card PDF printed as its own pages (spec one-order §4) */
.org-btn:disabled { opacity: 0.35; }
.org-marks label { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 0.85rem; }

body.sc-open { overflow: hidden; }
.sc-overlay { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; box-sizing: border-box; background: #0f172a; color: #fff; overflow-x: hidden; overflow-y: auto; padding: 10px 14px 90px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sc-overlay:not([open]) { display: none; }
.sc-overlay::backdrop { background: #0f172a; }
.sc-overlay > * { flex-shrink: 0; }
.sc-title { font-size: 1.05rem; margin: 0; align-self: flex-start; }
.sc-frame { position: relative; display: inline-block; max-width: 100%; touch-action: none; }
/* owner 2026-11-14: a finger held on a pin opened the phone's picture menu. The picture is no press target (the pins and
   the frame are), and iPhone's own callout and text picking are off on every surface the finger drags on (dismiss.js
   stops Chrome's menu there). */
.sc-photo, .ca-pic { pointer-events: none; }
.sc-frame, .sc-result, .pe-stage, .fr-stage, .pf-stage, .vw-root .vw-stage { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.sc-frame.ld-wait { min-width: min(100%, 320px); min-height: 200px; }
.sc-find-ring { align-self: center; }
.sc-photo { display: block; max-width: 100%; max-height: 42vh; user-select: none; -webkit-user-drag: none; }
.sc-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sc-lines polygon { fill: rgba(251, 191, 36, 0.15); stroke: #fbbf24; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.sc-pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #fbbf24; border: 3px solid #fff; touch-action: none; cursor: grab; }
.sc-pin::before, .sc-grip::before, .sc-unmask::before { content: ""; position: absolute; inset: -9px; } /* 44 px touch area, small visual */
.sc-result { position: relative; width: min(100%, 360px); background: #fff; touch-action: none; }
.sc-clip { position: absolute; inset: 0; overflow: hidden; }
.sc-result-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.sc-mask { position: absolute; background: #000; touch-action: none; cursor: move; min-width: 12px; min-height: 8px; }
.sc-grip { position: absolute; right: -10px; bottom: -10px; width: 22px; height: 22px; border-radius: 50%; background: #fbbf24; border: 2px solid #fff; touch-action: none; }
.sc-btn.sc-unmask { position: absolute; right: -14px; top: -14px; width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0; border-radius: 50%; line-height: 1; }
.sc-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sc-btn { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid #475569; background: #1e293b; color: #fff; font: inherit; cursor: pointer; }
.sc-btn.on, .sc-btn.primary { background: #4338ca; border-color: #4338ca; font-weight: 700; }
.sc-slider { display: flex; flex-direction: column; width: min(100%, 360px); font-size: 0.85rem; }
.sc-msg { min-height: 1.2em; font-size: 0.85rem; color: #fde68a; text-align: center; margin: 0; }
.sc-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 12px; background: #0f172a; border-top: 1px solid #334155; }
.sc-foot .sc-btn { flex: 1; }

/* ID card copy (phase 2d): easy-mode frame and precise pins. Dark like the photo fixer. */
.fr-stage { position: relative; width: min(100%, 420px); aspect-ratio: 4 / 3; overflow: hidden; background: #000; touch-action: none; cursor: grab; border-radius: 8px; }
.fr-photo { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.fr-frame { position: absolute; border: 0; outline: 3px solid #fbbf24; outline-offset: 0; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6); pointer-events: none; } /* outline, not border: drawn outside, so the inner edge is exactly the crop */
.fr-overlay .sc-slider input { width: 100%; min-height: 44px; margin: 0; }
.fr-overlay .sc-btn, .sc-precise .sc-btn { margin: 0; width: auto; min-width: 44px; padding: 6px 12px; font-size: inherit; border: 1px solid #475569; } /* the page's button.primary (0,1,1) must not leak in */
.fr-overlay .sc-row .sc-btn, .sc-precise .sc-btn:not([data-snap]) { font-size: 1.25rem; line-height: 1; }
.sc-pin.sel { background: #22d3ee; }
.sc-loupe { position: absolute; width: 120px; height: 120px; box-sizing: content-box; border-radius: 50%; border: 3px solid #fff; background-color: #fff; background-repeat: no-repeat; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); z-index: 1; }
.sc-loupe::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -7px 0 0 -7px; border: 2px solid #ef4444; border-radius: 50%; }
.sc-loupe[hidden] { display: none; }
.sc-label { align-self: center; font-size: 0.85rem; flex-basis: 100%; text-align: center; }

/* ID card copy panel (phase 2d): photo groups and "Check the pairs". Button rules sit under .ic-overlay and its boxes reset margin/border/background:
   the pages' own button / button.primary (0,1,1) / section rules must not leak in (margins, width 100%). */
.sc-overlay.ic-overlay { padding-bottom: 150px; scroll-padding-bottom: 150px; } /* the Tamil footer wraps to 3 lines: the last slider stays reachable */
.ic-overlay .sc-btn { margin: 0; width: auto; min-width: 44px; padding: 6px 12px; font-size: inherit; border: 1px solid #475569; touch-action: manipulation; max-width: 100%; overflow-wrap: anywhere; }
.ic-overlay .sc-btn:disabled { opacity: 0.45; cursor: default; }
.ic-overlay .sc-btn.big { min-height: 48px; font-size: 1.05rem; padding: 8px 18px; border-color: #fbbf24; }
.ic-overlay .sc-btn.ic-again { min-height: 44px; padding: 8px 18px; }
.ic-overlay .sc-foot .sc-btn { flex: 1; }
.ic-types .sc-btn { border-radius: 999px; }
.ic-photos { align-items: center; justify-content: flex-start; }
.ic-photo { position: relative; display: inline-block; margin: 8px 22px 0 0; } /* room for the ✕ that overhangs the corner */
.ic-thumb { width: 64px; height: 64px; max-width: none; object-fit: cover; border-radius: 8px; display: block; }
.ic-overlay .sc-btn.ic-remove { position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
.ic-cards { display: flex; flex-direction: column; gap: 10px; width: min(100%, 420px); min-width: 0; }
.ic-group { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 8px 0 0; border: 0; border-top: 1px solid #334155; border-radius: 0; background: none; min-width: 0; }
.ic-person { display: flex; flex-direction: column; gap: 6px; margin: 0; border: 1px solid #334155; border-left: 6px solid #64748b; border-radius: 12px; padding: 8px; background: none; min-width: 0; }
.ic-p0 { border-left-color: #f59e0b; } .ic-p1 { border-left-color: #22d3ee; } .ic-p2 { border-left-color: #a78bfa; }
.ic-p3 { border-left-color: #4ade80; } .ic-p4 { border-left-color: #f472b6; } .ic-p5 { border-left-color: #f87171; }
.ic-pair { display: flex; gap: 4px; align-items: flex-start; min-width: 0; }
.ic-tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ic-side-name { font-size: 0.8rem; color: #cbd5e1; }
.ic-arrow { align-self: center; color: #94a3b8; }
.ic-overlay .ic-tools { justify-content: flex-start; gap: 4px; }
.ic-overlay .ic-tools .sc-btn { padding: 4px 8px; font-size: 0.85rem; }
.ic-overlay .ic-tools .sc-btn.big { padding: 6px 10px; font-size: 1rem; }
.ic-ask { align-items: center; }
.ic-ask > span { flex-basis: 100%; text-align: center; }
.ic-photo-nav { flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 4px; }
.ic-overlay .sc-btn.ic-nav { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 1.3rem; line-height: 1; }
.ic-which-photo { font-size: 0.8rem; color: #cbd5e1; text-align: center; min-width: 0; }
.ic-clean { display: flex; flex-direction: column; gap: 6px; width: min(100%, 420px); }
.ic-clean .sc-slider { width: 100%; }
.ic-clean input[type="range"] { width: 100%; min-height: 44px; margin: 0; }
.ic-check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
.ic-check input { width: 24px; height: 24px; margin: 0; }
.ic-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ic-badge { font-size: 0.85rem; padding: 2px 8px; border-radius: 999px; background: #334155; overflow-wrap: anywhere; }
.ic-tile .ic-badge { font-size: 0.75rem; border-radius: 10px; align-self: flex-start; }
.ic-badge.found, .ic-badge.number { background: #166534; }
.ic-badge.adjust, .ic-badge.choose { background: #92400e; }
.ic-badge.adjusted, .ic-badge.hand { background: #1e3a8a; }
.ic-overlay .ic-card { position: relative; display: block; box-sizing: border-box; width: 100%; aspect-ratio: 85.6 / 54; min-height: 44px; margin: 0; overflow: hidden; background: #fff; border: 3px solid transparent; border-radius: 6px; padding: 0; cursor: pointer; touch-action: manipulation; }
.ic-overlay .ic-card.chosen { border-color: #fbbf24; }
.ic-overlay .ic-card.portrait { aspect-ratio: 54 / 85.6; width: 63%; margin: 0 auto; } /* an upright badge: a portrait card */
.ic-overlay .ic-card.old { aspect-ratio: 66 / 86; width: 70%; margin: 0 auto; } /* an old paper voter ID (cardkit.js OLD_MM) */
.ic-overlay .ic-card.long { aspect-ratio: 86 / 208; width: 40%; margin: 0 auto; } /* a long Aadhaar strip (cardkit.js LONG_MM) */
.ic-overlay .ic-card.empty { background: transparent; border: 2px dashed #64748b; cursor: default; opacity: 1; }
.ic-card-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; pointer-events: none; }
.ic-finding { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ic-finding .sc-msg { margin: 0; }
.ic-skel { display: flex; flex-direction: column; gap: 6px; border: 1px solid #334155; border-left: 6px solid #475569; border-radius: 12px; padding: 8px; }
.ic-overlay .ic-card.skel { background: var(--ld-base); border-color: transparent; cursor: default; } /* beats .ic-overlay .ic-card's white */
.ic-photo > .ic-thumb.skel { width: 64px; height: 64px; border-radius: 8px; }

/* Unlock sheet (password PDFs): a modal <dialog> at the bottom; fits a 390 px phone, 44 px targets */
.ul-sheet { margin: auto auto 0; width: min(480px, 100%); max-width: 100%; max-height: 100%; box-sizing: border-box; border: 0; border-radius: 16px 16px 0 0; padding: 16px; overflow-y: auto; overflow-x: hidden; background: #fff; color: #0f172a; display: flex; flex-direction: column; gap: 10px; }
.ul-sheet:not([open]) { display: none; }
.ul-sheet::backdrop { background: rgba(15, 23, 42, 0.6); }
.ul-sheet > * { min-width: 0; }
.ul-title { font-size: 1.1rem; margin: 0; }
.ul-file { margin: 0; color: #475569; overflow-wrap: anywhere; }
.ul-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; min-width: 0; }
.ul-row { display: flex; gap: 8px; min-width: 0; align-items: flex-end; }
.ul-row > .ul-field { flex: 1; }
.ul-input { flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; font: inherit; font-size: 1.1rem; padding: 8px 10px; border: 1px solid #94a3b8; border-radius: 10px; }
.ul-btn { min-width: 44px; min-height: 44px; padding: 6px 14px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font: inherit; cursor: pointer; }
.ul-btn.primary { background: #4338ca; border-color: #4338ca; color: #fff; font-weight: 700; }
.ul-panel .ul-btn { width: auto; margin: 0; padding: 6px 14px; font-size: inherit; } /* the page's button.primary must not leak in */
.ul-btn:disabled { opacity: 0.5; cursor: default; }
.ul-msg { min-height: 1.2em; margin: 0; color: #b91c1c; overflow-wrap: anywhere; }
.ul-foot { display: flex; gap: 8px; align-items: stretch; }
.ul-foot .ul-btn { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 6px 14px; width: auto; font-size: inherit; } /* beats the page's button.primary (0,1,1) */
.ul-help { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #e2e8f0; padding-top: 10px; }
.ul-help-title { font-size: 1rem; margin: 0; }
.ul-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ul-chip[aria-expanded="true"] { background: #e0e7ff; border-color: #4338ca; font-weight: 700; }
.ul-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 12px; min-width: 0; }
.ul-panel[hidden] { display: none; }
.ul-built { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.05em; min-height: 1.4em; overflow-wrap: anywhere; }
.ul-why, .ul-note { margin: 0; font-size: 0.85rem; color: #475569; }
.ul-hints { margin: 0; padding-left: 1.2em; font-size: 0.9rem; color: #334155; }
.ul-page { margin: 0; font-weight: 600; }

/* WhatsApp chat button: bottom-right, lifted by --wa-lift (a page with a fixed bottom bar raises it) */
.wa-fab { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(var(--wa-lift, 16px) + env(safe-area-inset-bottom, 0px)); z-index: 7; width: 48px; height: 48px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); text-decoration: none; }
.wa-fab:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

/* Each kit dialog's own compact language switch (a modal dialog blocks the page's): title on the left, switch on the right.
   The dark dialogs use the default white outline; the light sheet and the organizer's header get a slate one. */
.kit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; }
.kit-head > h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kit-lang { flex: none; }
/* Spec 29.11: the board over an ID card sheet picture (designer review, counter order preview) */
.review-face, .sb-frame { position: relative; }
.sb-frame { line-height: 0; }
.sb-board { position: absolute; inset: 0; pointer-events: none; }
.sb-slot { pointer-events: auto; position: absolute; min-width: 44px; min-height: 44px; padding: 0; margin: 0; border: 2px solid transparent; border-radius: 4px;
  background: transparent; cursor: grab; touch-action: manipulation; }
.sb-slot.filled:hover, .sb-slot.filled:focus-visible { border-color: var(--ld-ring, #4338ca); }
.sb-slot.empty { border: 2px dashed #94a3b8; background: rgba(148, 163, 184, 0.12); cursor: pointer; }
.sb-slot.place { border-color: #a5b4fc; background: rgba(99, 102, 241, 0.05); }   /* spec print-as §4: where a lone card can go */
.sb-slot.picked { border: 3px solid #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35); }
.sb-slot.dragging { opacity: 0.7; z-index: 2; cursor: grabbing; }
.sb-empty { font-size: 0.75rem; line-height: 1.2; color: #475569; overflow-wrap: anywhere; }
.sb-slot.check { outline: 3px solid #d97706; outline-offset: -3px; } /* spec long-aadhaar §2: a stretched strip asks for a look */
.sb-check { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 0.7rem; line-height: 1.2; color: #7c2d12;
  background: #fef3c7; border-radius: 4px; padding: 2px 4px; overflow-wrap: anywhere; }
.sb-menu { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.sb-menu[hidden] { display: none; }
.sb-hint { flex-basis: 100%; margin: 0; }
.sb-act { min-height: 44px; min-width: 44px; padding: 0 14px; }
@media (prefers-reduced-motion: reduce) { .sb-slot.dragging { transition: none; } }
/* the small "Adjust" on a card's place: at its top-right corner, inside the card, 44 px to tap */
.sb-adjust { pointer-events: auto; position: absolute; transform: translateX(-100%); min-width: 44px; min-height: 44px; margin: 0; padding: 0 8px;
  border: 1px solid #4338ca; border-radius: 0 4px 0 10px; background: rgba(255, 255, 255, 0.92); color: #312e81; font: inherit; font-size: 0.75rem;
  line-height: 1.1; font-weight: 700; cursor: pointer; touch-action: manipulation; max-width: 50%; overflow-wrap: normal; z-index: 1; }
/* owner 2026-11-05 ("when i click adjust not working"): the counter's and the designer's button:active { transform: scale() } replaced the
   translateX above while pressed, so the button jumped one width away from the mouse, the release landed on the card and no click came */
button.sb-adjust:active:not(:disabled) { transform: translateX(-100%); }
.sb-adjust:focus-visible { outline: 3px solid #f59e0b; outline-offset: 1px; }
/* Adjust one card side (cardadjust.js): crop & straighten, look; the exact picture from the shop PC */
.ca-overlay { padding-bottom: 110px; }
/* Crop & straighten (owner, 2026-10-11): the source photo with its 4 dots, and a small Result beside it (under it on a phone).
   The padding keeps a dot's 44 px touch area inside the screen when it sits on the photo's edge. */
.ca-panel.ca-wide { width: min(100%, 900px); }
.ca-crop { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-start; width: 100%; }
.ca-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; font-size: 0.85rem; }
.ca-fig figcaption { color: #cbd5e1; }
.ca-source { flex: 1 1 260px; min-width: 0; }
.ca-src { box-sizing: border-box; max-width: 100%; padding: 24px; display: flex; justify-content: center; background: #1e293b; border-radius: 8px; }
.ca-src .sc-photo { max-height: 55vh; }
.ca-result { flex: 0 1 220px; width: min(100%, 220px); }
.ca-result-pic, .ca-look-pic { width: 100%; display: flex; justify-content: center; }
.ca-result .ca-view { width: 100%; }
.ca-live { z-index: 1; }
.ca-live[hidden] { display: none; }
.ca-view { position: relative; width: min(100%, 420px); aspect-ratio: 85.6 / 54; background: #1e293b; border-radius: 6px; overflow: hidden; }
.ca-pic { display: block; width: 100%; height: 100%; object-fit: contain; }
/* an upright badge (Card shape ▯ Portrait): the Result is a portrait card, never taller than the screen allows */
.ca-view.ca-portrait { aspect-ratio: 54 / 85.6; width: min(100%, 260px, calc(50vh * 54 / 85.6)); }
.ca-result .ca-view.ca-portrait { width: min(100%, 160px); }
.ca-view.ca-old { aspect-ratio: 66 / 86; width: min(100%, 280px, calc(50vh * 66 / 86)); }
.ca-result .ca-view.ca-old { width: min(100%, 170px); }
.ca-view.ca-long { aspect-ratio: 86 / 208; width: min(100%, 200px, calc(60vh * 86 / 208)); }
.ca-result .ca-view.ca-long { width: min(100%, 110px); }
.ca-shape { align-items: center; }
.ca-shape-label { color: #cbd5e1; font-size: 0.9rem; }
.ca-tabs { display: flex; gap: 6px; width: min(100%, 420px); }
.ca-tabs .sc-btn { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ca-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 420px); }
.ca-panel[hidden] { display: none; }
.ca-panel .sc-row { width: 100%; }
.ca-panel .sc-btn { max-width: 100%; overflow-wrap: anywhere; }
.ca-panel .sc-slider { width: 100%; }
.ca-panel .sc-slider input { width: 100%; min-height: 44px; margin: 0; }
.ca-switch[aria-checked="true"] { background: #15803d; border-color: #15803d; font-weight: 700; }
.ca-msg { min-height: 1.2em; margin: 0; text-align: center; }
.ca-cut { display: flex; flex-wrap: wrap; gap: 8px; background: #fff7ed; color: #7c2d12; border-radius: 8px; padding: 8px; margin: 6px 0; }
.ca-cut[hidden] { display: none; }
.ca-cut p { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.ca-cut button { flex: 1 1 140px; }
.sc-pin:focus-visible { outline: 3px solid #22d3ee; outline-offset: 2px; }

.ul-sheet .lang-switch, .org-head .lang-switch, .review .lang-switch { border-color: #94a3b8; }
.ul-sheet .lang-switch .lang-btn + .lang-btn, .org-head .lang-switch .lang-btn + .lang-btn, .review .lang-switch .lang-btn + .lang-btn { border-left-color: #94a3b8; }
.ul-sheet .lang-switch .lang-btn:not(.on), .org-head .lang-switch .lang-btn:not(.on), .review .lang-switch .lang-btn:not(.on) { color: #0f172a; }

/* Big preview viewer (viewer.js, spec 24). Everything is scoped under .vw-root; .vw-opens marks an opener. */
body.vw-lock { overflow: hidden; }
.vw-root { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; box-sizing: border-box; background: #0b1220; color: #fff; display: flex; flex-direction: column; overscroll-behavior: contain; }
.vw-root:not([open]) { display: none; }
.vw-root::backdrop { background: #0b1220; }
.vw-root .vw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; }
.vw-root .vw-title { flex: 1; min-width: 0; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.vw-root .vw-count { font-size: 0.9rem; color: #cbd5e1; }
.vw-root .vw-lang { flex: none; }
.vw-root .vw-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.vw-root .vw-stage.zoomed { cursor: move; }
.vw-root .vw-img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; background: #fff; user-select: none; -webkit-user-drag: none; pointer-events: none; will-change: transform; }
.vw-root .vw-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: #fde68a; }
.vw-root .vw-bar { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.vw-root .vw-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid #475569; border-radius: 10px; background: #1e293b; color: #fff; font: inherit; font-size: 1.1rem; cursor: pointer; user-select: none; -webkit-user-select: none; }
.vw-root .vw-btn:disabled { opacity: 0.35; }
.vw-root .vw-btn[hidden], .vw-root [hidden] { display: none; }
.vw-root .vw-again { position: absolute; left: 50%; top: calc(50% + 2.5em); transform: translateX(-50%); max-width: calc(100% - 24px); font-size: 1rem; }
.vw-root .vw-sharp { position: absolute; right: 10px; bottom: 10px; pointer-events: none; }
.vw-opens { cursor: zoom-in; }

/* Download dialog (download.js, spec 23.7). Everything is scoped under .dl-root. */
.dl-root { width: calc(100% - 32px); max-width: 560px; max-height: calc(100% - 32px); box-sizing: border-box; padding: 12px 14px; border: 0; border-radius: 14px; background: #fff; color: #0f172a; overflow-x: hidden; overflow-y: auto; }
.dl-root:not([open]) { display: none; }
.dl-root::backdrop { background: rgba(15, 23, 42, 0.6); }
.dl-root button, .dl-root select, .dl-root input[type="text"] { min-height: 44px; font: inherit; box-sizing: border-box; }
.dl-root .dl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-root .dl-title { flex: 1; min-width: 0; margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.dl-root .lang-switch { border-color: #94a3b8; }
.dl-root .lang-switch .lang-btn + .lang-btn { border-left-color: #94a3b8; }
.dl-root .lang-switch .lang-btn:not(.on) { color: #0f172a; }
.dl-root .dl-note { margin: 8px 0; font-size: 0.9rem; color: #475569; }
.dl-root .dl-btn { min-width: 44px; padding: 0 14px; border: 1px solid #94a3b8; border-radius: 10px; background: #f1f5f9; color: #0f172a; cursor: pointer; }
.dl-root .dl-btn:disabled { opacity: 0.5; }
.dl-root .dl-main { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.dl-root section { margin: 12px 0; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.dl-root .dl-h { margin: 0 0 8px; font-size: 1rem; }
.dl-root .dl-choice, .dl-root .dl-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.dl-root .dl-exams-h { align-self: center; font-weight: 600; }
.dl-root .dl-exam { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; }  /* spec 44.2: an exam preset and the day it was checked */
.dl-root .dl-exam-btn { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.dl-root .dl-exam-meta, .dl-root .dl-exam-livename, .dl-root .dl-exam-live, .dl-root .dl-exam-window { font-size: 0.85rem; color: #475569; overflow-wrap: anywhere; }
.dl-root .dl-exam-old { color: #b45309; font-weight: 600; }
.dl-root .dl-exam-livename { font-weight: 600; color: #0f172a; }
.dl-root .dl-exam-window { margin: 0 0 8px; }
.dl-root .dl-radio { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.dl-root fieldset.dl-choice { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; align-items: center; }
.dl-root .dl-legend { float: left; margin-right: 8px; padding: 0; font-weight: 600; line-height: 44px; }
.dl-root .dl-sheet-line, .dl-root .dl-done, .dl-root .dl-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-root .dl-sheet-name { flex: 1; min-width: 6em; }
.dl-root .dl-sheet { margin-bottom: 6px; }
.dl-root .dl-done-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dl-root .dl-changed { flex-basis: 100%; margin: 0; }   /* what was changed to get under the KB limit */
.dl-root .dl-pdf-quick { margin-top: 8px; }
.dl-root .dl-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.dl-root .dl-field select, .dl-root .dl-field input { width: 100%; max-width: 100%; }
.dl-root .dl-ready { margin: 6px 0; color: #15803d; font-weight: 600; }
.dl-root .dl-error { margin: 6px 0; color: #b91c1c; }
.dl-root .dl-problem { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dl-root [hidden] { display: none; }
.dl-root .dl-wait { display: flex; align-items: center; gap: 8px; }
.dl-root .dl-wait .dl-status { margin: 0; }
.dl-root .dl-skel { height: 44px; margin: 8px 0; border-radius: 10px; }
.dl-root .ld-spin + .dl-making { display: inline-block; margin: 6px 0 6px 8px; }
.dl-root .dl-still { margin: 4px 0; font-size: 0.9rem; color: #475569; }

/* Loading states (busy.js, spec 26). A skeleton is the size of what comes and shows at once; a ring only for an unknown shape or a
   button's own action, after 180 ms. A shimmering box must get its own size or aspect-ratio from the page; every busy action goes through
   Busy.button or checks Busy.isBusy. Colours are --ld-* tokens: light below; the dark pages (style.css, counter.css) and the dark dialogs set theirs. */
.ld-box { position: relative; } /* every picture box Busy.img manages keeps this for good: the failed line anchors to it */
.skel.skel { position: relative; overflow: hidden; background: var(--ld-base, #e2e8f0); } /* doubled: beats a page's own single-class box rules */
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--ld-shine, rgba(255, 255, 255, 0.6)), transparent); transform: translateX(-100%); animation: ld-sweep 1.4s ease-in-out infinite; pointer-events: none; }
.skel-line { display: inline-block; width: 10em; max-width: 100%; height: 1em; border-radius: 4px; vertical-align: middle; }
.ld-dark, .skel-dark, .sc-overlay, .vw-root { --ld-base: #334155; --ld-shine: rgba(255, 255, 255, 0.08); --ld-track: #475569; --ld-ink: #fbbf24; }
.dl-root, .ul-sheet, dialog.review { --ld-base: #e2e8f0; --ld-shine: rgba(255, 255, 255, 0.6); --ld-track: #cbd5e1; --ld-ink: #4338ca; --ld-btn-ink: #475569; } /* always light, also on a dark page */
img.ld-hide { visibility: hidden; } /* keeps its place: nothing moves when it arrives */
.ld-spin { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.ld-spin.ld-center { position: absolute; inset: 0; justify-content: center; pointer-events: none; }
.ld-ring { flex: none; width: 28px; height: 28px; box-sizing: border-box; border: 3px solid var(--ld-track, #cbd5e1); border-top-color: var(--ld-ink, #4338ca); border-radius: 50%; animation: ld-turn 0.8s linear infinite; }
.ld-spin.ld-inline .ld-ring { width: 1em; height: 1em; border-width: 2px; }
.ld-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ld-busy { position: relative; color: transparent !important; cursor: progress; } /* the label keeps the button's width */
.ld-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.1em; height: 1.1em; margin: -0.55em 0 0 -0.55em; box-sizing: border-box; border: 2px solid var(--ld-btn-ink, #475569); border-right-color: transparent; border-radius: 50%; animation: ld-turn 0.8s linear infinite; }
button.primary.ld-busy, .dl-root .dl-main.ld-busy, .ul-btn.primary.ld-busy, .sc-btn.ld-busy, .vw-btn.ld-busy, button.ghost.ld-busy { --ld-btn-ink: #fff; }
.ld-failed { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; box-sizing: border-box; width: 100%; min-width: 44px; min-height: 44px; margin: 0; padding: 4px; border: 0; border-radius: inherit; background: #f1f5f9; color: #334155; font: inherit; font-size: 0.75rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
p.ld-failed { cursor: default; }
.ld-dark .ld-failed, .skel-dark .ld-failed, .sc-overlay .ld-failed, .vw-root .ld-failed { background: #1e293b; color: #fde68a; }
progress.ld-bar { display: block; width: 100%; height: 8px; margin: 4px 0; accent-color: var(--ld-ink, #4338ca); }
progress.ld-bar[hidden] { display: none; }
/* Busy.panel: the big progress card of a real wait (owner 2026-10-11). In the flow by default; .ld-over centres it over the area being
   waited on (its host gets .ld-panel-host). It lets every tap through (Cancel / Back stay usable) except its own Try again. Always light. */
.ld-panel-host { position: relative; }
.ld-panel-host:has(> .ld-panel.ld-over:not(.ld-pending)) { min-height: 220px; } /* room for the card while the area is still empty */
.ca-view.ld-panel-host:has(> .ld-panel.ld-over:not(.ld-pending)) { min-height: 0; } /* the Adjust Result keeps its card shape */
.ld-panel { display: flex; justify-content: center; box-sizing: border-box; width: 100%; margin: 12px 0; pointer-events: none; }
.ld-panel.ld-over { position: absolute; inset: 0; z-index: 5; margin: 0; padding: 8px; align-items: center; }
.ld-panel.ld-pending { visibility: hidden; } /* a wait that ends within 180 ms is never seen (no flicker); still in the page for screen readers */
.ld-panel .ld-card { display: flex; flex-direction: column; align-items: center; gap: 10px; box-sizing: border-box; width: min(440px, 100%); max-width: 100%;
  padding: 20px 16px; border: 2px solid #c7d2fe; border-radius: 16px; background: #fff; color: #0f172a; text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18); overflow-wrap: anywhere; }
.ld-panel .ld-ring.ld-big { width: 56px; height: 56px; border-width: 6px; border-color: #e0e7ff; border-top-color: #4338ca; }
.ld-panel .ld-head { margin: 0; font-size: 1.25rem; font-size: max(18px, 1.25rem); font-weight: 700; line-height: 1.35; }
.ld-panel .ld-sub, .ld-panel .ld-slow { margin: 0; font-size: 1rem; line-height: 1.4; color: #334155; }
.ld-panel .ld-slow { color: #92400e; font-weight: 600; }
.ld-panel .ld-pbar { display: block; width: 100%; height: 14px; border-radius: 7px; background: #e0e7ff; overflow: hidden; }
.ld-panel .ld-pfill { display: block; height: 100%; width: 0; border-radius: 7px; background: #4338ca; transition: width 0.25s ease-out; }
.ld-panel [hidden] { display: none !important; }
.ld-panel.ld-ok .ld-card { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.ld-panel.ld-fail .ld-card { border-color: #dc2626; background: #fef2f2; color: #7f1d1d; }
.ld-panel .ld-again { pointer-events: auto; min-height: 44px; min-width: 44px; padding: 8px 20px; border: 0; border-radius: 10px; background: #4338ca; color: #fff; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.ld-panel .ld-again:focus-visible { outline: 3px solid #0f172a; outline-offset: 2px; }
@media (max-width: 360px) { .ld-panel .ld-card { padding: 14px 10px; } .ld-panel .ld-ring.ld-big { width: 44px; height: 44px; border-width: 5px; } }
.ca-view .ld-panel.ld-over { padding: 4px; } /* the small Result box of Adjust: a tighter card, the sentence stays large */
.ca-view .ld-panel .ld-card { padding: 8px 10px; gap: 4px; border-width: 1px; }
.ca-view .ld-panel .ld-ring.ld-big { width: 28px; height: 28px; border-width: 4px; }
.ca-view .ld-panel .ld-again { padding: 6px 14px; }
.ld-panel.ld-reduced .ld-ring.ld-big { animation: none; border-color: #4338ca; border-style: dotted; }
.ld-panel.ld-reduced .ld-pfill { transition: none; }
/* dark ink on the light primary fill of the dark pages: set in each page's own dark block (style.css, counter.css), since the designer page has no dark theme */
@keyframes ld-sweep { to { transform: translateX(100%); } }
@keyframes ld-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; display: none; }
  .ld-ring { animation: none; display: none; }
  .ld-word { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
  .vw-root .vw-status { position: absolute; top: calc(50% + 2.5em); left: 12px; right: 12px; width: auto; text-align: center; color: #fde68a; pointer-events: none; }
  .ld-busy { color: inherit !important; opacity: 0.6; }
  .ld-busy::after { animation: none; display: none; }
  .ld-panel .ld-ring.ld-big { display: block; animation: none; border-color: #4338ca; border-style: dotted; } /* still there, not turning */
  .ld-panel .ld-pfill { transition: none; }
}

/* Certificate help sheet (guides.js): a light bottom sheet like the unlock one, one <details> per guide, each
   picture beside its words, example names with every space drawn as a dotted box. Fits a 320 px phone with no sideways
   scroll; 44 px targets, 48 px for the guide headers, the name box and Close. */
.gd-sheet { margin: auto auto 0; width: min(480px, 100%); max-width: 100%; max-height: 100%; box-sizing: border-box; border: 0; border-radius: 16px 16px 0 0; padding: 16px; overflow-y: auto; overflow-x: hidden; background: #fff; color: #0f172a; display: flex; flex-direction: column; gap: 10px; }
.gd-sheet:not([open]) { display: none; }
.gd-sheet::backdrop { background: rgba(15, 23, 42, 0.6); }
.gd-sheet > * { min-width: 0; flex-shrink: 0; }   /* a scrolling flex column must not squeeze its lines on top of each other */
.gd-sheet .lang-switch { border-color: #94a3b8; }
.gd-sheet .lang-switch .lang-btn + .lang-btn { border-left-color: #94a3b8; }
.gd-sheet .lang-switch .lang-btn:not(.on) { color: #0f172a; }
.gd-sheet .lang-switch .lang-btn:focus-visible { outline-color: #0f172a; }
.gd-title { font-size: 1.15rem; margin: 0; }
.gd-lead, .gd-note, .gd-copies, .gd-rule { margin: 0; color: #334155; overflow-wrap: anywhere; }
.gd-note { font-size: 0.9rem; }
.gd-rule { color: #0f172a; font-weight: 600; }
.gd-copies { color: #166534; font-weight: 600; }
.gd-guide { min-width: 0; border: 1px solid #cbd5e1; border-radius: 12px; }
.gd-guide[open] { border-color: #4338ca; }
.gd-summary { display: list-item; min-height: 48px; box-sizing: border-box; padding: 12px; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.gd-summary .gd-pic { width: 48px; height: 32px; margin-right: 8px; vertical-align: middle; }
.gd-summary:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; border-radius: 10px; }
.gd-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; min-width: 0; }
.gd-body > * { min-width: 0; flex-shrink: 0; }
.gd-sub { font-size: 1rem; margin: 4px 0 0; border-top: 1px solid #e2e8f0; padding-top: 10px; }
.gd-items, .gd-examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gd-item, .gd-intro { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.gd-item > span, .gd-intro > span { min-width: 0; }
.gd-pic { width: 72px; height: 48px; flex: none; }
.gd-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px; border: 1px solid #e2e8f0; border-left-width: 4px; border-radius: 10px; background: #f8fafc; }
.gd-card.good { border-left-color: #16a34a; }
.gd-card.bad { border-left-color: #b91c1c; }
.gd-card.ok { border-left-color: #fbbf24; }
.gd-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gd-field-name { font-size: 0.8rem; color: #475569; }
.gd-example { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: 1.1rem; overflow-wrap: anywhere; }
.gd-box .gd-example { display: block; padding: 2px 6px; border-bottom: 2px solid #94a3b8; background: #fff; }
.gd-sp { display: inline-block; white-space: pre; min-width: 0.6em; border: 1px dotted #b45309; border-radius: 2px; background: #fef3c7; }
.gd-verdict { font-weight: 700; overflow-wrap: anywhere; }
.gd-card.good .gd-verdict { color: #166534; }
.gd-card.bad .gd-verdict { color: #b91c1c; }
.gd-card.ok .gd-verdict { color: #92400e; }
.gd-why { margin: 0; font-size: 0.9rem; color: #334155; overflow-wrap: anywhere; }
.gd-check { display: flex; flex-direction: column; gap: 4px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.gd-input { width: 100%; min-width: 0; min-height: 48px; box-sizing: border-box; margin: 0; padding: 8px 10px; border: 1px solid #94a3b8; border-radius: 10px; background: #fff; color: #0f172a; font: inherit; font-size: 1.2rem; }
.gd-input:focus-visible { outline: 3px solid #4338ca; outline-offset: 1px; }
.gd-result { min-height: 1.3em; min-width: 0; overflow-wrap: anywhere; }
.gd-good { margin: 0; color: #166534; font-weight: 600; }
.gd-issues { margin: 0; padding-left: 1.2em; color: #92400e; display: flex; flex-direction: column; gap: 4px; }
.gd-suggest { margin: 6px 0 0; font-weight: 600; }
.gd-suggest .gd-example { margin-left: 0.4em; }
.gd-private { margin: 0; font-size: 0.9rem; color: #166534; overflow-wrap: anywhere; }
.gd-steps, .gd-outcomes { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; color: #0f172a; overflow-wrap: anywhere; }
.gd-link { display: flex; align-items: center; justify-content: center; min-height: 44px; color: #3730a3; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.gd-link:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; border-radius: 6px; }
/* "See the steps with pictures": screenshots made on the first opening, each as wide as the card, its caption under it */
.gd-shots { min-width: 0; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.gd-shots-summary { display: list-item; min-height: 44px; box-sizing: border-box; padding: 10px 12px; font-weight: 600; color: #3730a3; cursor: pointer; overflow-wrap: anywhere; }
.gd-shots-summary:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; border-radius: 8px; }
.gd-shot-list { display: flex; flex-direction: column; gap: 12px; padding: 0 10px 10px; min-width: 0; }
.gd-shot { margin: 0; min-width: 0; }
.gd-shot img { display: block; width: 100%; max-width: 100%; height: auto; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.gd-shot figcaption { margin-top: 4px; font-size: 0.85rem; color: #334155; overflow-wrap: anywhere; }
.gd-more { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 2px; }
.gd-more-link { display: inline-flex; align-items: center; min-height: 44px; color: #3730a3; font-weight: 600; overflow-wrap: anywhere; }
.gd-more-link:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; border-radius: 6px; }
.gd-btn { min-width: 44px; min-height: 44px; width: auto; margin: 0; padding: 6px 14px; box-sizing: border-box; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font: inherit; font-size: 1rem; cursor: pointer; overflow-wrap: anywhere; }
.gd-btn.primary { min-height: 48px; background: #4338ca; border-color: #4338ca; color: #fff; font-weight: 700; }
.gd-btn:focus-visible { outline: 3px solid #0f172a; outline-offset: 2px; }
.gd-foot { display: flex; }
.gd-foot .gd-btn { flex: 1; }

.org-all { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.9rem; }
.org-all[hidden] { display: none; }
.org-btn.org-orient { min-height: 44px; padding: 0 10px; font-size: 0.85rem; white-space: nowrap; }
/* owner 2026-11-10: a long file's grid shows its first pages and "Show all N pages" (Organizer fold). Opened, the button
   that folds it again rides at the bottom of a phone's screen; on a wide screen the pages scroll in their own box. */
.org-fold { display: flex; justify-content: center; margin-top: 10px; }
.org-fold[hidden] { display: none; }
.org-btn.org-fold-btn { padding: 0 16px; font-weight: 700; }
.org-fold.open { position: sticky; bottom: 10px; z-index: 2; }
.org-fold.open .org-fold-btn { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28); }
@media (min-width: 860px) {
  .org-grid.org-long { max-height: min(74vh, 800px); overflow-y: auto; padding: 2px 6px 2px 2px; scrollbar-width: thin; }
  .org-fold.open { position: static; }
  .org-fold.open .org-fold-btn { box-shadow: none; }
}
/* Every modal dialog's corner close button (dismiss.js, owner 2026-10-16): the cross and a tap outside do what Escape does */
dialog.has-x { padding-top: max(2.75rem, 1em); }
.dlg-x { position: absolute; top: 0.4rem; right: 0.4rem; z-index: 5; width: 44px; height: 44px; min-height: 0; margin: 0; padding: 0;
  border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; color: #334155; font: 600 1.1rem/1 system-ui, sans-serif;
  cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.dlg-x:hover { background: #f1f5f9; }
.dlg-x:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; }

/* The page editor's Crop on a wide screen (owner 2026-11-01): the photo with the dots beside what prints. Only while the
   editor is open, so the ID card panel and the designer keep their own fixer. */
@media (min-width: 1000px) {
  body.pe-open .sc-overlay:has(> .sc-frame + .sc-result) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-content: start; justify-items: center; }
  body.pe-open .sc-overlay:has(> .sc-frame + .sc-result) > * { grid-column: 1 / -1; }
  body.pe-open .sc-overlay:has(> .sc-frame + .sc-result) > .sc-frame { grid-column: 1; align-self: start; }
  body.pe-open .sc-overlay:has(> .sc-frame + .sc-result) > .sc-result { grid-column: 2; width: min(100%, 520px, calc((100vh - 190px) * 0.72)); align-self: start; }   /* an A4 page fits above the buttons */
  body.pe-open .sc-overlay:has(> .sc-frame + .sc-result) .sc-photo { max-height: 70vh; }
}

/* ---- the page editor (owner 2026-11-01): one page big as it prints. Phone like Microsoft Lens (the page, then the
   strip of pages and the tool bar under it); 860 px and wider like PDF House (pages on the left, tools on top). ---- */
body.pe-open { overflow: hidden; }
.pe-overlay { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; box-sizing: border-box; background: #0f172a; color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.pe-overlay:not([open]) { display: none; }
.pe-overlay::backdrop { background: #0f172a; }
.pe-top { box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; background: #1e293b; border-bottom: 1px solid #334155; }
.pe-title { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-top > button { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid #334155; background: #0f172a; color: #fff; font: 700 1rem system-ui, sans-serif; }
.pe-top > button.primary { background: #4f46e5; border-color: #4f46e5; }
/* the customer page's own button.primary is a full-width block: not in this bar */
.pe-overlay .pe-top > button { flex: none; display: inline-flex; align-items: center; justify-content: center; width: auto; max-width: none; margin: 0; }
.pe-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto auto; grid-template-areas: "stage" "look" "strip" "tools"; }
.pe-stage { grid-area: stage; position: relative; min-height: 0; overflow: hidden; touch-action: none; background: #0b1120; }
.pe-overlay .pe-stage .pe-frame { position: absolute; inset: 14px 46px; }   /* three classes: beats Busy's .skel.skel while it loads */
.pe-frame[hidden] { display: none; }
.pe-pic { position: absolute; left: 50%; top: 50%; max-width: none; transform: translate(-50%, -50%); background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); user-select: none; -webkit-user-drag: none; cursor: zoom-in; }
.pe-nav { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; pointer-events: none; }
.pe-nav button { pointer-events: auto; width: 40px; height: 56px; border-radius: 12px; border: 1px solid #334155; background: rgba(30, 41, 59, 0.92); color: #fff; font: 700 1.6rem/1 system-ui, sans-serif; }
.pe-nav button:disabled { opacity: 0.3; }
.pe-where { display: none; }
.pe-tag { position: absolute; left: 50%; top: 10px; z-index: 1; transform: translateX(-50%); max-width: calc(100% - 100px); padding: 6px 14px; border: 0; border-radius: 999px; background: #fbbf24; color: #1e1b4b; font: 700 0.9rem system-ui, sans-serif; }
.pe-tag:disabled { background: #334155; color: #fff; opacity: 1; }
.pe-tag[hidden] { display: none; }
.pe-look { grid-area: look; display: grid; gap: 8px; padding: 10px 12px; background: #1e293b; border-top: 1px solid #334155; }
.pe-look[hidden] { display: none; }
.pe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-chips button { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #334155; background: #0f172a; color: #fff; font: 600 0.9rem system-ui, sans-serif; }
.pe-chips button.on { background: #4f46e5; border-color: #4f46e5; }
.pe-look-all { justify-self: start; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #4f46e5; background: #1e1b4b; color: #fff; font: 600 0.9rem system-ui, sans-serif; }
.pe-look-all:disabled { opacity: 0.4; }
.pe-slider { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: 8px; font-size: 0.9rem; color: #cbd5e1; }
.pe-strip { grid-area: strip; position: relative; display: flex; gap: 8px; margin: 0; padding: 8px 10px; list-style: none; overflow-x: auto; overflow-y: hidden; background: #1e293b; border-top: 1px solid #334155; scrollbar-width: thin; }
.pe-strip li { flex: none; }
.pe-thumb { position: relative; display: block; width: 46px; height: 62px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #fff; overflow: hidden; }
.pe-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pe-thumb.on { border-color: #fbbf24; box-shadow: 0 0 0 2px #fbbf24; }
.pe-strip li.sortable-chosen .pe-thumb { transform: scale(1.06); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.pe-strip li.sortable-ghost { opacity: 0.35; }
.pe-thumb.skipped img { opacity: 0.35; }
.pe-thumb.pe-plain { background: #334155; }
.pe-num { position: absolute; right: 2px; bottom: 1px; padding: 0 4px; border-radius: 4px; background: rgba(15, 23, 42, 0.85); color: #fff; font: 700 0.7rem system-ui, sans-serif; }
.pe-tools { grid-area: tools; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom, 0px); background: #1e293b; border-top: 1px solid #334155; }
.pe-tools button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 58px; padding: 6px 2px 8px; border: 0; background: none; color: #cbd5e1; font: 600 0.75rem/1.2 system-ui, sans-serif; }
.pe-tools .pe-ico { font-size: 1.3rem; line-height: 1; color: #fff; }
.pe-tools button.on, .pe-tools button.on .pe-ico { color: #fbbf24; }
.pe-tools button.danger, .pe-tools button.danger .pe-ico { color: #fca5a5; }
.pe-tools button:disabled { opacity: 0.35; }
.pe-toast { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #020617; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.pe-toast[hidden] { display: none; }
.pe-toast button { min-height: 40px; padding: 0 10px; border: 0; background: none; color: #fbbf24; font: 700 1rem system-ui, sans-serif; }
/* a narrow phone: the title gets its own line under ✕, the switch and Done; the smallest drop Done (✕ closes too) */
@media (max-width: 479px) {
  .pe-top { flex-wrap: wrap; row-gap: 4px; }
  .pe-top .kit-lang { margin-left: auto; }
  .pe-title { order: 9; flex: 1 0 100%; font-size: 0.95rem; }
}
@media (max-width: 359px) { .pe-top > button.primary { display: none; } }
@media (min-width: 860px) {
  .pe-body { grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "strip tools" "strip stage" "strip look"; }
  .pe-strip { flex-direction: column; align-items: center; gap: 14px; padding: 12px 8px; overflow-x: hidden; overflow-y: auto; border-top: 0; border-right: 1px solid #334155; }
  .pe-thumb { width: 96px; height: 128px; }
  .pe-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 0; border-bottom: 1px solid #334155; }
  .pe-tools button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid #334155; border-radius: 10px; font-size: 0.9rem; }
  .pe-tools .pe-ico { font-size: 1.05rem; }
  .pe-tools button.danger { margin-left: auto; border-color: #7f1d1d; }
  .pe-overlay .pe-stage .pe-frame { inset: 16px 24px 74px; }
  .pe-nav { inset: auto auto 16px 50%; width: max-content; transform: translateX(-50%); gap: 10px; padding: 4px 6px; border: 1px solid #334155; border-radius: 999px; background: #1e293b; pointer-events: auto; }
  .pe-nav button { width: 44px; height: 40px; border: 0; border-radius: 999px; background: none; }
  .pe-where { display: inline; font-weight: 700; white-space: nowrap; }
  .pe-toast { left: auto; right: 24px; bottom: 74px; width: min(420px, calc(100% - 48px)); }
}

/* ‹ n / N › in a card's Adjust (owner 2026-11-01): 44 px arrows; on a narrow phone the head wraps under the title */
.ca-overlay .kit-head { flex-wrap: wrap; row-gap: 6px; }
.ca-nav { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.ca-nav .ca-arrow { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }
.ca-where { min-width: 3.2em; text-align: center; font-weight: 700; white-space: nowrap; }

/* Language switch (lang.js): lives in each page's dark header. Everything is scoped under .lang-switch so the pages'
   button / button.primary rules (0,1,1) cannot leak in: width, margin and padding are set here. */
.lang-switch { display: inline-flex; flex: none; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 22px; overflow: hidden; }
.lang-switch .lang-btn { min-width: 44px; min-height: 44px; width: auto; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 0.95rem; cursor: pointer; }
.lang-switch .lang-btn + .lang-btn { border-left: 1px solid rgba(255, 255, 255, 0.35); }
.lang-switch .lang-btn.on { background: #fbbf24; color: #1e1b4b; font-weight: 700; }
.lang-switch .lang-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: -3px; }

/* Portrait / landscape (owner 2026-10-16): the head's "all pages" pair and each page's switch. */
