/* Iyswarya Xerox colours: indigo header, amber badge (same as the shop's receipt), drawn as the shop's signboard
   (docs/superpowers/specs/2026-10-18-visual-identity-design.md): stamp ink, signboard yellow, carbon text, paper on
   copier grey. The signboard rules are at the end of this file. */
:root {
  --bg: #eef0f5; --card: #ffffff; --text: #20223a; --muted: #585b78;
  --brand: #2a2b86; --brand-text: #ffffff; --amber: #ffd21f; --accent: #2a2b86; --accent-text: #ffffff;
  --line: #d9dce6; --error: #c62828; --ok: #12805c; --ticket: #fff8d9;
  --ticket-muted: #4a4d6a;   /* grey on the ticket: 7.9:1 on the pale yellow */
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14152b; --card: #1d1f3a; --text: #e6e7f2; --muted: #a5a8c4; --brand: #1d1e5c; --accent: #a9aaff; --accent-text: #14152b; --line: #33365c; --error: #ff8a80; --ok: #5bd6a4; --ticket: #24264a; --ticket-muted: #b9bcd6; --ld-base: #33365c; --ld-shine: rgba(255, 255, 255, 0.08); --ld-track: #4a4d7a; --ld-ink: #a9aaff; --ld-btn-ink: #e6e7f2; }
  button.primary.ld-busy { --ld-btn-ink: #0f172a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, "Noto Sans Tamil", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; padding-bottom: 70px; overflow-x: hidden; }
header { display: flex; justify-content: space-between; align-items: center; gap: 8px 10px; padding: 10px 14px; background: var(--brand); color: var(--brand-text); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge { flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--amber); color: #1e1b4b; font-weight: 900; display: grid; place-items: center; }
h1 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
main { max-width: min(96vw, 1100px); margin: 0 auto; padding: 12px 14px; min-height: 72vh; }
#step-conditions, #step-upload, #step-options, #step-done { max-width: 580px; margin: 0 auto; }
#sorted { max-width: 720px; margin: 0 auto; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
.shopbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 6px 14px; background: var(--card); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.pill.on { color: #047857; } .pill.off { color: #64748b; }
.steps { display: none; }

/* ---- the sticky bar of the step rail (the three-tab pill went with one order, spec one-order §8) ---- */
.mode-nav {
  margin: 6px 12px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 4px 0;
}
.mode-nav[hidden] { display: none; }
.private { color: var(--ok); font-weight: 600; font-size: 0.9rem; }
.price { text-align: center; font-size: 1.4rem; font-weight: 800; margin: 4px 0; }
.price.muted { font-size: 1rem; font-weight: 600; color: var(--muted); }
.queue { text-align: center; font-weight: 600; color: var(--accent); }
.designer-link { display: block; padding: 12px; border-radius: 10px; background: #fef3c7; color: #78350f; font-weight: 700; text-decoration: none; margin-bottom: 8px; }
.notice { color: var(--muted); font-size: 0.95rem; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin: 12px 0; }
.consent input { width: 22px; height: 22px; flex: none; }
.file-btn { display: block; text-align: center; padding: 14px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.file-btn.disabled { opacity: 0.45; cursor: not-allowed; }
.file-btn input { display: none; }
.hint, .chosen { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
legend { font-weight: 600; padding: 0 4px; }
fieldset label { display: flex; gap: 6px; align-items: center; min-height: 40px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.stepper input { width: 64px; height: 44px; text-align: center; font-size: 1.1rem; }
#range { width: 120px; height: 36px; }
button.primary { width: 100%; max-width: 400px; display: block; margin: 12px auto 0; padding: 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 1.05rem; }
button.primary:disabled { opacity: 0.5; }
#download { width: 100%; max-width: 400px; display: block; margin: 10px auto 0; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-size: 1rem; font-weight: 600; }
#download:disabled { opacity: 0.5; }
#download[hidden] { display: none; }
#delete { width: 100%; max-width: 400px; display: block; margin: 12px auto 0; padding: 12px; border-radius: 10px; border: 1px solid var(--error); color: var(--error); background: none; }
progress { width: 100%; margin-top: 8px; }
.note { color: var(--muted); }
.error { color: var(--error); font-weight: 600; min-height: 1.5em; }
.code { font: 700 64px/1 ui-monospace, Consolas, "Cascadia Mono", monospace; letter-spacing: 0.14em; padding-left: 0.14em; text-align: center;
  margin: 8px 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.status { font-weight: 700; text-align: center; }
.status.done { color: var(--ok); }
.status.failed, .status.rejected { color: var(--error); }
.summary { color: var(--muted); text-align: center; }
/* Owner 2026-10-11: the customer sees and keeps what they sent (each order of the visit) */
.sent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sent-actions .sent-btn { flex: 1 1 140px; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-align: center; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; overflow-wrap: anywhere; cursor: pointer; }
.sent-actions .sent-btn[hidden], .sent-actions[hidden] { display: none; }
.sent-gone { flex: 1 1 100%; margin: 4px 0 0; color: var(--muted); font-weight: 600; text-align: center; }
.vs-row { display: flex; flex-direction: column; gap: 0; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.vs-row .sent-actions { margin-top: 6px; }

/* Spec 30: pay by UPI on the done screen (and in each visit row). 44 px targets, nothing wider than the screen. */
.pay-box { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 10px 0; padding: 12px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--card); min-width: 0; overflow-wrap: anywhere; }
.pay-box.paid { border-color: #047857; }
.pay-box p { margin: 0; text-align: center; }
.pay-due { font-size: 1.15rem; font-weight: 800; }
.pay-box.paid .pay-due { color: #047857; }
.pay-btn { min-height: 44px; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 700; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  overflow-wrap: anywhere; cursor: pointer; box-sizing: border-box; }
.pay-btn.pay-upi { background: #047857; border-color: #047857; color: #fff; font-size: 1.1rem; }
.pay-btn[hidden], .pay-box p[hidden] { display: none; }
.pay-qr { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto; background: #fff; border-radius: 8px; }
.pay-scan, .pay-counter { color: var(--muted); font-weight: 600; }
.pay-thanks { font-weight: 700; }

/* Visual option tiles: one tap, big target, picture + word. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 88px; padding: 8px 6px; border: 2px solid var(--line); border-radius: 12px; text-align: center; font-size: 0.85rem; font-weight: 600; cursor: pointer; background: var(--card); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:checked) { border-color: var(--accent); background: #eef2ff; color: #312e81; box-shadow: inset 0 0 0 1px var(--accent); }
.tile:has(input:disabled) { opacity: 0.35; cursor: not-allowed; }
.tile small { font-weight: 400; color: var(--muted); font-size: 0.72rem; }
.ico { font-size: 1.5rem; line-height: 1; min-height: 32px; display: grid; place-items: center; }
.swatch { width: 36px; height: 24px; border-radius: 6px; min-height: 0; }
.swatch.bw { background: linear-gradient(90deg, #111 0 33%, #888 33% 66%, #eee 66%); border: 1px solid #94a3b8; }
.swatch.colour { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7); }
.sheet { width: calc(var(--w) * 1.1px); height: calc(var(--h) * 1.1px); min-height: 0; border: 2px solid currentColor; border-radius: 2px; background: #fff; }
.flip { position: relative; width: 46px; height: 32px; }
.flip::before, .flip::after { content: ""; position: absolute; border: 2px solid currentColor; background: #fff; border-radius: 2px; }
.flip.single::before { left: 15px; top: 3px; width: 14px; height: 22px; }
.flip.single::after { display: none; }
.flip.long::before { left: 6px; top: 3px; width: 14px; height: 22px; }
.flip.long::after { left: 22px; top: 3px; width: 14px; height: 22px; background: repeating-linear-gradient(#fff 0 4px, #cbd5e1 4px 5px); }
.flip.short::before { left: 10px; top: 0; width: 22px; height: 13px; }
.flip.short::after { left: 10px; top: 16px; width: 22px; height: 13px; background: repeating-linear-gradient(#fff 0 4px, #cbd5e1 4px 5px); }
details.advanced { margin: 6px 0; }
details.advanced summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--accent); }
.rate { text-align: center; font-weight: 800; font-size: 1.1rem; color: var(--ok); margin: 8px 0 0; }

/* Several files + live preview beside the options. */
main.wide { max-width: 1100px; }
.file-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.file-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-list small { color: var(--muted); }
button.mini { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1rem; }
button.mini:disabled { opacity: 0.3; }
.add-more { width: 100%; padding: 10px; border-radius: 10px; border: 2px dashed var(--accent); background: none; color: var(--accent); font-weight: 700; margin: 4px 0 8px; }
/* owner 2026-11-07: "Take a picture" under Add files, and under Add more once files are there (qrprint/web/camera.js) */
.cam-take { display: block; width: 100%; min-height: 48px; padding: 10px; margin: 0 0 10px; border-radius: 10px; border: 2px solid var(--accent);
  background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.cam-take.big { max-width: 400px; margin: -4px auto 14px; min-height: 52px; font-size: 1.05rem; }
.cam-take:disabled { opacity: 0.45; cursor: not-allowed; }
.workspace { display: flex; flex-direction: column; gap: 12px; }
.preview { position: sticky; top: 0; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08); }
.preview h3 { margin: 0 0 6px; font-size: 0.95rem; }
.sheets { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.sheet-card { margin: 0; flex: none; text-align: center; }
.faces { display: flex; gap: 4px; }
.paper { position: relative; width: 84px; background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); display: grid; place-items: center; overflow: hidden; }
.paper img { display: block; height: auto; }
.pnum { position: absolute; right: 3px; bottom: 2px; font-size: 10px; color: #64748b; }
.face { position: absolute; left: 3px; top: 2px; font-size: 9px; background: rgba(255, 255, 255, 0.85); padding: 0 3px; border-radius: 3px; color: #312e81; }
.sheet-card figcaption { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.more { align-self: center; color: var(--muted); white-space: nowrap; }
.totals { font-weight: 800; color: var(--ok); text-align: center; margin: 6px 0 0; }
/* spec 42: print warnings under the totals - hints, never blockers */
.print-hints { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ticket); border-left: 4px solid var(--amber); }
.print-hints h3 { margin: 0 0 4px; font-size: 0.95rem; }
.print-hints p { margin: 4px 0; }
.print-hints .fix { font-weight: 700; }
.print-hints .note { font-size: 0.85rem; }
.print-hints .sig { font-weight: 600; }   /* owner 2026-10-24: the upload's digital signature answer */
.print-hints .sig.valid { color: var(--ok); }
.print-hints .sig.invalid { color: var(--error); }
.print-hints .sig-wish { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 600; }
.print-hints .sig-wish input { width: 1.4rem; height: 1.4rem; }
.print-hints .sig-picture { display: block; max-width: 100%; margin-top: .4rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (min-width: 860px) {
  .workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: start; }
  .preview { order: 2; top: 16px; }
  #options { order: 1; }
  .sheets { flex-wrap: wrap; overflow: visible; }
  .paper { width: 120px; }
}

/* Phase 2: page organizer, per-file chips, colour pages, exact faces from the shop PC. */
.arrange { margin: 12px 0; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.file-list li { flex-wrap: wrap; }
.file-list .file-chip { flex-basis: 100%; font-size: 0.8rem; }
.colour-pages { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.colour-pages[hidden] { display: none; }
.paper.exact img { width: 100%; height: 100%; object-fit: contain; }

/* Phase 2c: a password PDF shows 🔒 Unlock on its file row (44 px target) */
.file-list button.unlock { min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid #f59e0b; background: #fef3c7; color: #78350f; font: inherit; font-weight: 700; }
.file-list button.unlock.open { border-color: #16a34a; background: #dcfce7; color: #14532d; }

/* Phase 2c: room under the page so the floating WhatsApp button never sits on Send; the Google review card */
main { padding-bottom: 88px; }
.review { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffbeb; color: #78350f; text-align: center; }
.review h3 { margin: 0 0 4px; font-size: 1rem; }
.review .stars { display: block; font-size: 1.6rem; letter-spacing: 0.15em; color: #f59e0b; line-height: 1.3; }
.review-actions { display: flex; gap: 8px; margin-top: 8px; }
.review-open, .review-later { flex: 1; min-height: 48px; display: grid; place-items: center; padding: 8px 12px; border-radius: 10px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.review-open { background: var(--accent); color: var(--accent-text); border: 0; }
.review-later { background: none; color: inherit; border: 1px solid currentColor; }

/* Spec 23.2 / 27.6: conditions, the job banner, the chooser, the parts list, refused rows */
.conditions { margin: 0 0 12px; padding-left: 20px; line-height: 1.5; }
#cond-continue, #files-continue { width: 100%; min-height: 48px; margin-top: 12px; }
.checking { display: flex; gap: 8px; align-items: center; min-height: 28px; }
.file-list.refused li { opacity: 0.85; }
.file-list.refused .error { display: block; }
.job-banner { border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.job-banner p { margin: 0 0 6px; }
.job-banner .note { color: #92400e; }
.job-banner .alts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-banner .alts button { min-height: 44px; }
.chooser { border: none; border-radius: 12px; padding: 16px; width: min(92vw, 420px); }
.chooser .tile { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 64px; margin: 8px 0;
  padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; text-align: left; }
.chooser .tile.suggested { border: 2px solid #4338ca; }
.chooser .tile em { font-style: normal; font-size: 0.8em; color: #4338ca; }
.visit-orders button { min-height: 44px; }
.visit-orders { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
/* Spec 29.2: one big button, rows with thumbnails, the locked row */
.file-btn.big { display: block; min-height: 56px; font-size: 1.1rem; text-align: center; max-width: 400px; margin: 14px auto; box-shadow: 0 4px 14px rgba(67, 56, 202, 0.22); }
#files-continue.big, .sorted .primary.big { width: 100%; max-width: 400px; min-height: 52px; margin: 16px auto 0; display: block; }
#files-continue[hidden], #cond-continue[hidden], [hidden] { display: none !important; }
.row-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.lk-row { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lk-row .lk-field { flex: 1 1 160px; min-height: 44px; min-width: 0; }
.lk-row button { min-height: 44px; }
.lk-row .hint, .lk-row .lk-needs, .lk-row .error { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.lk-row button.ghost { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
/* Spec 29.5-29.6: the sorted list */
.sorted h2 { min-width: 0; overflow-wrap: anywhere; }   /* a long Tamil word wraps at 320 px */
.sorted-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.sorted-list .item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.sorted-list .item > p { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.sorted-list .item button { min-height: 44px; min-width: 44px; }
.sorted-list .ms-ask { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 8px; padding: 10px; }
.sorted-list .ms-ask p { flex-basis: 100%; margin: 0; color: #7c2d12; font-weight: 500; overflow-wrap: anywhere; }
.sorted-list .ms-ask p.hint { color: #9a3412; }
.sorted-list .ms-ask button { flex: 1 1 140px; max-width: 260px; }
#missing-sheet ul { padding-left: 0; list-style: none; display: grid; gap: 6px; }
.sorted-list .item .fname, .sorted-list .item strong { min-width: 0; overflow-wrap: anywhere; }
.sorted-list .so-by { color: var(--muted); }
.sorted-list .so-icon { font-size: 1.6rem; }
.sorted-list .so-acts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
/* spec print-as (owner 2026-11-03): one switch per file - what it prints as, the current choice filled in */
.print-as { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.print-as .pa-label { color: var(--muted); font-size: 0.9rem; }
.print-as button.chip { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.print-as button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.print-as button.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.file-list .print-as { margin-top: 4px; }
.file-list .pa-pick { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 8px; border: 1px solid #fed7aa; background: #fff7ed; }
.file-list .pa-pick p { flex-basis: 100%; margin: 0; font-weight: 500; }
.file-list .pa-pick .so-picks { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.setup-back { margin: 0 0 8px; }
.sorted button.ghost, #missing-sheet button.ghost { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.sorted-list .item button.primary { width: auto; margin-top: 0; padding: 8px 12px; font-size: 1rem; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.sorted .so-check { display: flex; align-items: center; gap: 8px; min-height: 44px; flex-basis: 100%; }
.sorted .so-check input { width: 22px; height: 22px; flex: none; }
/* owner 2026-10-11: what the ID copy prints, just above Continue ("3 cards -> 3 pages") */
.sorted .so-id-sum { flex-basis: 100%; margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--accent);
  background: #eef2ff; color: #1e1b4b; font-weight: 600; overflow-wrap: anywhere; }
#missing-sheet li { display: flex; align-items: center; gap: 8px; }
#missing-sheet button:not(.dlg-x):not(.lang-btn) { min-height: 44px; width: 100%; margin-top: 8px; }   /* never its ✕ or language switch */
/* Owner fixes: the picture choices of a manual side (A), the drop zone (B) */
.sorted-list .so-picks { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.sorted-list .so-pick { min-width: 72px; min-height: 72px; padding: 4px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.sorted-list .so-pick .row-thumb { width: 88px; height: 88px; }
.sorted-list .so-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; cursor: pointer; }
.sorted-list .so-pick span { font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: normal; overflow-wrap: anywhere; text-align: center; }
/* Owner fix 2026-10-10: "These look like the same card" on top of the list; a card row dragged onto another joins them */
.sorted .so-same { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; padding: 10px; border: 2px solid var(--accent);
  border-radius: 10px; background: var(--card); min-width: 0; }
.sorted .so-same p { flex-basis: 100%; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sorted .so-same-pics { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
/* owner 2026-11-11: a card cut out of its photo (app.js cardCut): the whole photo, moved so the card fills the box */
.so-cut { position: relative; display: block; flex: none; overflow: hidden; box-sizing: content-box; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 1px 3px rgba(32, 34, 58, 0.25); }
button.so-cut { cursor: zoom-in; }
.sorted .so-cut, .sorted-list .item button.so-cut, .sorted .so-same button.so-cut { min-width: 0; min-height: 0; }
.so-cut img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; pointer-events: none; visibility: hidden; }
.sorted .so-cuts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.sorted .so-cut-side { display: grid; gap: 2px; justify-items: center; }
.sorted .so-cut-side small { color: var(--muted); }
.sorted-list .item.so-skip .so-cuts, .sorted-list .item.so-skip > strong { opacity: 0.45; }
.sorted-list .item.so-skip .so-cuts { filter: grayscale(1); }
.sorted .so-same-pics .row-thumb { width: 96px; height: 96px; }
.sorted .so-same button { flex: 1 1 140px; min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.sorted .so-same button.primary { width: auto; margin-top: 0; padding: 8px 12px; font-size: 1rem; }
.sorted-list .item[draggable="true"] { cursor: grab; }
.sorted-list .item.so-drop-on { outline: 3px dashed var(--accent); outline-offset: 2px; }
.sorted-list .item.so-drop-on::before { content: attr(data-drop); flex-basis: 100%; text-align: center; font-weight: 700; }
.sorted-list .so-pick-card { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; text-align: left; overflow-wrap: anywhere; }
.sorted-list .so-pick-card span { min-width: 0; }
#step-upload.drop-on { outline: 3px dashed var(--accent); outline-offset: 4px; border-radius: 12px; }
/* Owner 2026-10-11: a tap on a small picture opens it big; a zoom button sits beside a picture whose tap already chooses */
.so-pick-wrap { display: flex; align-items: flex-start; gap: 4px; max-width: 100%; min-width: 0; }
.sorted-list .so-side .so-pick-wrap { flex: 1 1 200px; }
.so-pick-wrap .so-pick-card { flex: 1 1 auto; }
.zoom-btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; line-height: 1; border-radius: 10px; flex: none; }
/* OPEN-ISSUES 4: in "Which card is it a side of?" the ask box's button rule (flex 140px, max 260px) also caught the zoom
   button, which took the text's room and squeezed it letter by letter. The zoom stays 44 px; the text wraps by words. */
.sorted-list .ms-ask .zoom-btn { flex: none; max-width: none; }
.sorted-list .ms-ask .so-pick-card { flex: 1 1 auto; max-width: none; overflow-wrap: normal; }
.sorted-list .ms-ask .so-pick-card span { min-width: min-content; overflow-wrap: normal; }
.drop-hint { margin: 8px 0; padding: 12px; text-align: center; font-weight: 600; border: 2px dashed var(--line); border-radius: 10px; }
/* Owner 2026-10-11: "Start over" on every screen until the order is sent; a confirm dialog with its own language switch */
header .restart-btn { margin-left: auto; min-height: 44px; padding: 6px 10px; border: 1px solid currentColor; border-radius: 8px; background: transparent;
  color: inherit; font: inherit; font-size: 0.85rem; max-width: 8.5em; line-height: 1.15; cursor: pointer; }
header .restart-btn[hidden] { display: none; }
.restart-dlg .restart-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.restart-dlg .restart-actions button { min-height: 44px; }

/* 2026-10-13: the upload step. Secondary buttons were browser-default outside .sorted (Do it all as pages, visit rows, banner
   choices); the job box is a plain card with a heading and aligned rows; the sorted list and the job box no longer nest a
   second card inside the upload card. */
button.ghost { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
#step-upload > #sorted { background: none; border: 0; padding: 0; }

@media (prefers-color-scheme: dark) {
  .sorted-list .ms-ask {
    background: #271e16;
    border-color: #78350f;
    color: #fef3c7;
  }
  .sorted-list .ms-ask p {
    color: #fef3c7;
  }
  .sorted-list .ms-ask p.hint {
    color: #fde68a;
  }
  .sorted-list .so-pick {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
  }
  .sorted-list .so-pick span {
    color: #f8fafc;
  }
  .sorted .so-id-sum {
    background: #1e1b4b;
    color: #e0e7ff;
    border-left-color: var(--accent);
  }
  .zoom-btn {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
  }
  .shopbar {
    background: #1e1b4b;
    color: #e0e7ff;
  }
}


/* Owner 2026-10-15: Add files + Take photo side by side on a phone (Take photo only on a touch screen), stacked when very
   narrow; the quiet "No Aadhaar on your phone?" and "Birth certificate help" links under the hint. */
.link-btn { display: block; max-width: 100%; min-height: 44px; margin: 0 auto 8px; padding: 8px 6px; border: 0; background: none; color: var(--accent);
  font: inherit; font-weight: 600; text-align: center; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; cursor: pointer; }

/* Owner 2026-10-15: the done screen is a ticket (the code, a perforation, the stub), a 4-step tracker under it, the
   ready line. Only the tracker's current step moves, and not at all with reduced motion. */
.ticket { background: var(--ticket); border-radius: 14px; margin: 4px 0 8px; min-width: 0; }
.ticket-head { padding: 14px 12px 10px; text-align: center; }
.ticket-head p, .ticket-stub p { margin: 0; }
.ticket-label { font-weight: 700; }
.ticket-head .code { margin: 10px 0 8px; }
.ticket-say { color: var(--ticket-muted); font-size: 0.9rem; }
.ticket .summary, .ticket .price.muted { color: var(--ticket-muted); }
.speak-btn { display: block; max-width: 100%; min-height: 44px; margin: 10px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; overflow-wrap: anywhere; cursor: pointer; }
.perf { position: relative; height: 22px; background: radial-gradient(circle at 0 50%, var(--card) 11px, transparent 12px) left / 22px 22px no-repeat,
  radial-gradient(circle at 100% 50%, var(--card) 11px, transparent 12px) right / 22px 22px no-repeat; }
.perf::after { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed var(--line); }
.ticket-stub { display: grid; gap: 4px; padding: 6px 12px 12px; min-width: 0; overflow-wrap: anywhere; }
/* Phones: a vertical stepper (a dot and a line on the left, the word on the right) - four columns at 390 px split Tamil
   words mid-word. From 560 px the four steps sit side by side. A step label never breaks inside a word. */
.tracker { list-style: none; display: grid; gap: 0; margin: 12px 0 4px; padding: 0; font-size: 0.95rem; color: var(--muted); }
.tr-step { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 34px; line-height: 1.25;
  overflow-wrap: normal; word-break: normal; hyphens: none; }
.tr-step:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: calc(50% + 9px); bottom: calc(9px - 50%); width: 2px;
  background: var(--line); }
.tr-dot { flex: none; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.tr-step.done { color: var(--ok); font-weight: 700; }
.tr-step.done .tr-dot { background: var(--ok); }
.tr-step.done .tr-name::before { content: "✓ " / ""; }
.tr-step.now, .tr-step.wait { color: var(--text); font-weight: 800; }
.tr-step.now .tr-dot { background: var(--amber); animation: tr-pulse 1.4s ease-in-out infinite; }
.tr-step.wait .tr-dot { background: linear-gradient(90deg, var(--amber) 50%, var(--line) 50%); }
.tr-step.problem { color: var(--error); font-weight: 800; }
.tr-step.problem .tr-dot { background: var(--error); }
.tr-step.problem .tr-name::before { content: "! " / ""; }
.tr-step[aria-current="step"] { font-weight: 800; }   /* after .done: a reached step that is also the current one */
.tr-step.info .tr-dot { background: transparent; border: 2px dashed var(--line); }
@media (min-width: 560px) {
  .tracker { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: 0.8rem; }
  .tr-step { display: block; min-height: 0; }
  .tr-step:not(:last-child)::after { content: none; }
  .tr-dot { width: auto; height: 6px; margin-bottom: 6px; border-radius: 3px; }
  .tr-step.info .tr-dot { border: 0; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); }
}
.tr-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes tr-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tr-step.now .tr-dot { animation: none; } }
.ready-line { margin: 12px 0 0; padding: 10px 12px; border: 2px solid var(--ok); border-radius: 10px; color: var(--ok); font-weight: 800; text-align: center;
  overflow-wrap: anywhere; }
.keep-open { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; overflow-wrap: anywhere; }
/* the ring must stand out from the white card and the pale ticket (3:1): indigo in light mode, amber on the dark ones */
.link-btn:focus-visible, .speak-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .link-btn:focus-visible, .speak-btn:focus-visible { outline-color: var(--amber); } }

/* the sticky step rail (.mode-nav) must never cover what the page scrolls to: a tap there hit the bar (e2e 2026-10-16) */
html { scroll-padding-top: 76px; }

/* the photo tip under a picture the sort could not name (owner 2026-10-16) */
.so-tip { font-size: 0.9rem; color: var(--muted); margin: 2px 0 6px; }

/* spec 34: the service an order is for */
.sv-chosen { margin: 6px 0; font-weight: 600; color: #0f6e5a; }
.sv-chosen[hidden] { display: none; }

/* ---- the signboard look (owner 2026-10-18, docs/superpowers/specs/2026-10-18-visual-identity-design.md) ----
   The display face (Anek Tamil, /shared/fonts.css) for the shop's name and the headings; the page itself keeps the
   phone's own font. The ink header ends in a yellow board edge; the conditions read as four short rules with the
   privacy note as fine print; the order code is stamped in a yellow ring. */
header { border-bottom: 6px solid var(--amber); padding-top: 12px; padding-bottom: 12px; }
header h1, #shop-name { font: 800 clamp(1.35rem, 6vw, 1.9rem)/1.05 "Anek Tamil", system-ui, sans-serif; font-stretch: 78%; }
header .badge { width: 38px; height: 38px; border-radius: 9px; background: var(--amber); color: #2a2b86; box-shadow: inset 0 0 0 2px #2a2b86;
  font: 800 1rem/1 "Anek Tamil", system-ui, sans-serif; font-stretch: 75%; }
main h2, section > h2 { font: 700 1.6rem/1.15 "Anek Tamil", system-ui, sans-serif; font-stretch: 85%; }
html[lang="ta"] main h2, html[lang="ta"] section > h2 { line-height: 1.35; }
section { border-radius: 16px; border-color: var(--line); box-shadow: 0 1px 0 rgba(32, 34, 58, 0.06), 0 10px 28px -18px rgba(32, 34, 58, 0.35); }
.conditions { list-style: none; padding-left: 0; display: grid; gap: 2px; }
.conditions li { position: relative; padding: 9px 0 9px 30px; border-bottom: 1px solid var(--line); font-weight: 600; }
.conditions li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 13px; height: 13px; border-radius: 3px; background: var(--amber); box-shadow: inset 0 0 0 2px #2a2b86; }
#step-conditions .notice { font-size: 0.86rem; line-height: 1.55; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.consent { padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; align-items: center; }
.consent:has(input:checked) { border-color: var(--accent); }
button.primary, .file-btn { border-radius: 12px; min-height: 52px; }
.file-btn.big { box-shadow: 0 10px 22px -12px rgba(42, 43, 134, 0.6); }
.ticket { border: 2px dashed var(--line); }
.ticket-head .code { display: inline-block; color: #2a2b86; background: var(--amber); border: 3px solid #2a2b86; border-radius: 16px;
  padding: 8px 6px 8px 14px; transform: rotate(-2deg); animation: code-stamp 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes code-stamp { from { transform: rotate(-2deg) scale(1.5); opacity: 0; } to { transform: rotate(-2deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ticket-head .code { animation: none; } }
@media (max-width: 360px) { .ticket-head .code { font-size: 52px; } }


/* ---- motion: things that answer the tap (owner 2026-10-18, docs/superpowers/specs/2026-10-18-motion-design.md) ----
   One curve family (settle / land), short times, only transform and opacity. Reduced motion stops all of it below. */
:root { --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); }
/* a button gives under the thumb and springs back */
button.primary, button.ghost, .file-btn, .add-more, .speak-btn { transition: transform 0.12s var(--ease-spring); }
button.primary:not(:disabled):active, button.ghost:not(:disabled):active, .file-btn:not(.disabled):active, .add-more:active,
.speak-btn:active { transform: scale(0.97); }
/* a rate or total that changed rolls up into its new value (rollText) */
#rate.roll, #totals.roll { animation: roll-in 0.26s var(--ease-out); }
@keyframes roll-in { from { transform: translateY(0.5em); opacity: 0; } }
/* a file just added slides into the list */
#file-list li.row-in { animation: row-in 0.36s var(--ease-out); }
@keyframes row-in { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
/* the tracker: a reached step's line is filled green; the ticket opens with the reached steps filling in order (intro),
   later only the step the order just reached pops (just) */
.tr-step.done:not(:last-child)::before { content: ""; position: absolute; z-index: 1; left: 6px; top: calc(50% + 9px); bottom: calc(9px - 50%);
  width: 2px; background: var(--ok); transform-origin: top; }
.tr-dot { position: relative; z-index: 2; }
.tracker.intro .tr-step.done .tr-dot, .tr-step.just .tr-dot { animation: tr-pop 0.45s var(--ease-spring) both; }
.tr-step.now.just .tr-dot { animation: tr-pop 0.45s var(--ease-spring) both, tr-pulse 1.4s ease-in-out 0.45s infinite; }
.tracker.intro .tr-step.done::before, .tr-step.done.just::before { animation: tr-fill 0.4s var(--ease-out) 0.2s both; }
.tracker.intro .tr-step:nth-child(2) .tr-dot { animation-delay: 0.3s; }
.tracker.intro .tr-step:nth-child(2)::before { animation-delay: 0.5s; }
.tracker.intro .tr-step:nth-child(3) .tr-dot { animation-delay: 0.6s; }
.tracker.intro .tr-step:nth-child(3)::before { animation-delay: 0.8s; }
.tracker.intro .tr-step:nth-child(4) .tr-dot { animation-delay: 0.9s; }
@keyframes tr-pop { from { transform: scale(0); } }
@keyframes tr-fill { from { transform: scaleY(0); } }
@keyframes tr-bar { from { transform: scaleX(0); } }
@media (min-width: 560px) {
  .tr-step.done:not(:last-child)::before { content: none; }
  .tr-dot { transform-origin: left; }
  .tracker.intro .tr-step.done .tr-dot, .tr-step.just .tr-dot { animation-name: tr-bar; }
  .tr-step.now.just .tr-dot { animation-name: tr-bar, tr-pulse; }
}
/* ready: the line pops in with a check that rings once, and the code stamp jumps (readyAlert, never on a reopen) */
.ready-line { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ready-line[hidden] { display: none; }
.ready-line::before { content: "✓" / ""; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ok); color: var(--card); font-size: 16px; line-height: 1; }
.ready-line.fresh { animation: ready-in 0.5s var(--ease-spring) both; }
.ready-line.fresh::before { animation: tr-pop 0.45s var(--ease-spring) 0.15s both, ring 0.9s ease-out 0.45s; }
@keyframes ready-in { from { transform: translateY(10px) scale(0.94); opacity: 0; } }
@keyframes ring { from { box-shadow: 0 0 0 0 var(--ok); } to { box-shadow: 0 0 0 14px transparent; } }
.ticket-head .code.fresh { animation: code-ready 0.7s var(--ease-spring) both; }
@keyframes code-ready { 0% { transform: rotate(-2deg) scale(1); } 35% { transform: translateY(-8px) rotate(-5deg) scale(1.1); }
  70% { transform: rotate(0deg) scale(0.98); } 100% { transform: rotate(-2deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  button.primary:not(:disabled):active, button.ghost:not(:disabled):active, .file-btn:not(.disabled):active, .add-more:active,
  .speak-btn:active { transform: none; }
  #rate.roll, #totals.roll, #file-list li.row-in, .tracker.intro .tr-step.done .tr-dot, .tracker.intro .tr-step.done::before,
  .tr-step.just .tr-dot, .tr-step.now.just .tr-dot, .tr-step.done.just::before, .ready-line.fresh, .ready-line.fresh::before,
  .ticket-head .code.fresh { animation: none; }
}
/* spec 38: finishing on the order */
.extras { display: flex; flex-direction: column; gap: 8px; }
.extras .extra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.extras .extra input[type=number] { width: 4.5em; }
/* spec 39: a service job's stage on the order page */
.case-stage { font-weight: 600; }

/* owner 2026-10-22: the details the shop read, for the customer to check (app.js paintDetails) */
.details-box { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; padding: 12px; border: 2px solid var(--line); border-radius: 12px; }
.details-box h3, .details-box p { margin: 0; }
.details-field { display: flex; flex-direction: column; gap: 2px; }
.details-field input { min-height: 40px; font-size: 1rem; }
.details-state:empty { display: none; }

/* 2026-11-14: page numbers the page did not take ("2-99" on 12 pages): the box says so, with the words under the form */
#range[aria-invalid="true"], #colour-pages[aria-invalid="true"] { border-color: #c62828; outline: 2px solid #c62828; outline-offset: 1px; }
