/* Barline Scan: the old Paperwork AI glass look (light and dark), in Barline's colours and fonts.
   Fonts are Barline's own (SIL Open Font License), served from /scan/fonts/ so Scan needs nothing outside /scan/. */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/scan/fonts/6c3ee71175bb.woff2) format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/scan/fonts/a37bd65602dd.woff2) format('woff2'); }

:root {
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-d: 'Outfit', 'DM Sans', system-ui, sans-serif;
  --bg: #f7f4ef; --surface: #ffffff; --bar-solid: #fbfaf7; --label: #1b2430; --label-2: #3a4554; --label-sub: #5b6676; --label-3: #687282;
  --separator: rgb(27 36 48 / 16%); --fill: rgb(27 36 48 / 6%); --line: rgb(27 36 48 / 10%); --tint: rgb(245 154 44 / 15%);
  --green: #1a7349; --red: #c0281b; --amber: #9a5a00;
  --q-accent: #b45309; --q-glass: rgb(255 255 255 / 66%); --q-edge: rgb(255 255 255 / 90%); --q-shadow: rgb(60 40 10 / 16%);
  --q-primary: linear-gradient(180deg, #ffc566, #f59a2c); --q-primary-ink: #1d1204;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e15; --surface: #121925; --bar-solid: #121925; --label: #eef2f7; --label-2: #c9d2de; --label-sub: #9eabbd; --label-3: #8d9aae;
  --separator: rgb(255 255 255 / 14%); --fill: rgb(255 255 255 / 7%); --line: rgb(255 255 255 / 8%); --tint: rgb(255 181 71 / 15%);
  --green: #3ddc9b; --red: #ff7a7d; --amber: #ffc24b;
  --q-accent: #ffb547; --q-glass: rgb(23 32 48 / 66%); --q-edge: rgb(255 255 255 / 9%); --q-shadow: rgb(0 0 0 / 50%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --bg: #0a0e15; --surface: #121925; --label: #eef2f7; --label-sub: #9eabbd; color-scheme: dark; } }

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--label); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--q-accent); outline-offset: 2px; border-radius: 8px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spin { display: inline-flex; animation: q-spin 1s linear infinite; }
@keyframes q-spin { to { transform: rotate(360deg); } }
.cam-open body { overflow: hidden; }

.quick-app { min-height: 100svh; color: var(--label); overflow-x: clip;
  background: radial-gradient(ellipse at 85% 18%, #ffe3c2 0, transparent 46%), radial-gradient(ellipse at 0 65%, #e1e5ff 0, transparent 55%), var(--bg); }
:root[data-theme="dark"] .quick-app { background: radial-gradient(ellipse at 85% 10%, rgb(255 140 60 / 16%) 0, transparent 48%), radial-gradient(ellipse at 0 65%, rgb(109 77 255 / 14%) 0, transparent 52%), var(--bg); }
.q-preview { padding: 8px 20px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--label-2); background: var(--q-glass); border-bottom: 1px solid var(--q-edge); }
.q-preview span { margin-left: 10px; font-weight: 400; letter-spacing: 0; color: var(--label-sub); }
.q-header { max-width: 840px; margin: auto; display: flex; align-items: center; gap: 10px; height: calc(74px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 24px 0; }
.q-brand { font-family: var(--font-d); font-size: 21px; font-weight: 800; letter-spacing: -.6px; }
.q-brand > span { font-weight: 500; color: var(--q-accent); margin-left: 3px; }
.q-brand-icon { display: grid; place-items: center; width: 35px; height: 35px; color: var(--q-accent); }
.q-header-actions { margin-left: auto; display: flex; gap: 6px; }
.q-icon { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--label-2); }
.q-icon:hover, .q-icon.is-on { background: var(--fill); }
.q-main { max-width: 460px; margin: 0 auto; padding: 8px 24px max(28px, env(safe-area-inset-bottom)); }
.q-loading { display: grid; place-items: center; min-height: 50vh; color: var(--q-accent); }
.q-site-line, .q-destination { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px; color: var(--label-sub); }
.q-destination { margin: -8px 0 16px; }
.q-destination strong { color: var(--label); font-weight: 700; }
.q-status-dot { width: 7px; height: 7px; flex-shrink: 0; background: #25a581; border-radius: 50%; box-shadow: 0 0 0 3px rgb(37 165 129 / 14%); }
.q-status-dot.is-off { background: #d08a1c; box-shadow: 0 0 0 3px rgb(208 138 28 / 16%); }
.q-site-line label { position: relative; display: flex; align-items: center; gap: 4px; }
.q-site-line select { font: inherit; color: var(--label); background: transparent; border: 0; font-weight: 700; padding: 8px 24px 8px 0; max-width: 300px; appearance: none; -webkit-appearance: none; min-height: 40px; }
.q-site-line select option { color: #1b2430; }
.q-site-line label svg { margin-left: -22px; pointer-events: none; }
.q-title { margin: 30px 0 22px; }
.q-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; color: var(--label-sub); }
.q-title h1 { font-family: var(--font-d); font-size: 44px; line-height: 1.02; letter-spacing: -1.8px; font-weight: 800; margin: 12px 0 16px; outline: none; }
.q-home-title { margin-top: 22px; margin-bottom: 0; }
.q-home-title h1 { font-size: 54px; line-height: .98; letter-spacing: -2.4px; }
.q-title h1 > span { color: var(--q-accent); }
.q-title p { color: var(--label-sub); font-size: 15px; line-height: 1.5; }
.q-material { background: var(--q-glass); border: 1px solid var(--q-edge); box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 10px 34px -20px var(--q-shadow); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); }
.q-scan-art { position: relative; height: 200px; margin: 0 -10px 8px; display: grid; place-items: center; isolation: isolate; }
.q-scan-halo { position: absolute; width: 235px; height: 190px; background: radial-gradient(ellipse, rgb(245 154 44 / 22%), transparent 70%); z-index: -1; }
.q-paper { position: relative; width: 131px; height: 175px; transform: rotate(-7deg) scale(.85); background: linear-gradient(145deg, #fff, #f4efe7); color: #25364a; border-radius: 5px; padding: 17px 15px; box-shadow: 0 20px 40px -14px rgb(70 45 10 / 35%), 1px 1px 2px rgb(255 255 255 / 90%) inset; }
.q-paper-logo { width: 14px; height: 14px; border-radius: 4px; background: #e0893b; margin-bottom: 9px; }
.q-paper-heading { font-size: 7px; font-weight: 800; letter-spacing: 1.6px; }
.q-paper-lines { display: grid; gap: 5px; margin-top: 12px; }
.q-paper-lines i { display: block; height: 2px; border-radius: 2px; background: #c9c1b4; }
.q-paper-lines i:last-child { width: 63%; }
.q-paper-rule { height: 1px; background: #d9d1c4; margin-top: 12px; }
.q-paper-lines.is-short { margin-top: 8px; gap: 4px; }
.q-paper-lines.is-short i { width: 82%; }
.q-paper-total { margin-top: 15px; display: flex; justify-content: space-between; font-size: 6px; }
.q-focus-frame { position: absolute; width: 154px; height: 177px; top: 5px; }
.q-focus-frame > i { position: absolute; width: 24px; height: 24px; border: 2px solid var(--q-accent); }
.q-focus-frame > i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0; }
.q-focus-frame > i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.q-focus-frame > i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.q-focus-frame > i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px; }
.q-scan-beam { position: absolute; top: 47%; left: 5px; right: 5px; height: 1px; background: linear-gradient(90deg, transparent, var(--q-accent), transparent); box-shadow: 0 0 12px 3px rgb(245 154 44 / 18%); animation: q-beam 3.2s ease-in-out infinite; }
@keyframes q-beam { 0%, 100% { top: 18%; } 50% { top: 80%; } }
.q-auto-badge { position: absolute; bottom: 3px; display: flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--q-edge); border-radius: 30px; font-size: 11px; font-weight: 700; background: var(--q-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 4px 20px -8px var(--q-shadow); }
.q-start-controls { display: flex; gap: 10px; margin-top: 12px; }
.q-page-control { display: flex; align-items: center; gap: 9px; padding: 0 16px; height: 60px; border-radius: 19px; color: var(--label-2); white-space: nowrap; font-size: 14px; }
.q-page-control strong { font-weight: 800; font-size: 16px; color: var(--label); }
.q-primary { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 15px 20px; border-radius: 19px; font-weight: 700; font-size: 16px; color: var(--q-primary-ink); background: var(--q-primary); box-shadow: 0 10px 26px -12px rgb(200 110 20 / 70%), inset 0 1px 1px rgb(255 255 255 / 40%); transition: transform .15s ease, filter .15s ease; }
.q-primary:hover:not(:disabled) { filter: brightness(1.04); }
.q-primary:active:not(:disabled) { transform: scale(.98); }
.q-primary svg:last-child:not(:first-child) { margin-left: auto; }
.q-primary.is-busy svg:first-child { animation: q-spin 1s linear infinite; }
.q-primary.is-danger { background: var(--red); color: #fff; box-shadow: none; }
.q-caption { text-align: center; font-size: 12px; line-height: 1.5; color: var(--label-sub); margin-top: 13px; }
.q-import { display: flex; align-items: center; gap: 7px; margin: 20px auto 0; padding: 10px; min-height: 44px; color: var(--label-sub); font-size: 13px; }
.q-filed-detail { text-align: center; font-size: 12px; color: var(--green); margin-top: 6px; }
.q-footer { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 30px; font-size: 11px; color: var(--label-3); text-align: center; }
.q-message { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 4px 0 14px; border-radius: 15px; font-size: 14px; line-height: 1.45; background: var(--surface); }
.q-message .q-icon { min-width: 36px; min-height: 36px; margin-left: auto; flex-shrink: 0; }
.q-message.is-success { color: var(--green); background: rgb(40 170 110 / 11%); border: 1px solid rgb(40 170 110 / 20%); }
.q-message.is-error { color: var(--red); border: 1px solid rgb(230 60 70 / 22%); }
.q-review-title { margin-top: 26px; margin-bottom: 18px; }
.q-review-title h1 { font-size: 40px; letter-spacing: -1.6px; }
.q-pages { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px 4px; scroll-snap-type: x proximity; }
.q-thumb { position: relative; flex-shrink: 0; width: 76px; height: 98px; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 6px 18px -10px var(--q-shadow), 0 0 0 1px var(--line); scroll-snap-align: start; display: grid; place-items: center; }
.q-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.q-thumb span { position: absolute; left: 4px; bottom: 4px; background: #1b2430; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.q-review-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 18px; font-size: 13px; color: var(--label-sub); }
.q-review-meta > span, .q-review-meta button { display: flex; align-items: center; gap: 6px; }
.q-review-meta button { padding: 10px 0 10px 10px; min-height: 44px; color: var(--q-accent); font-size: 13px; font-weight: 700; }
.q-review-actions { margin-top: 26px; }
.q-review-more { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.q-text-button { font-size: 14px; color: var(--q-accent); font-weight: 700; padding: 10px; min-height: 44px; }
.q-retake { display: block; margin: 10px auto; color: var(--label-sub); }
.q-supplier { display: grid; gap: 15px; }
.q-supplier-card { display: flex; align-items: center; gap: 13px; padding: 22px 18px; border-radius: 23px; }
.q-supplier-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--q-accent); background: var(--tint); flex-shrink: 0; }
.q-supplier-summary { display: grid; gap: 6px; min-width: 0; }
.q-supplier-label { font-size: 11px; letter-spacing: 1px; font-weight: 700; text-transform: uppercase; color: var(--label-sub); }
.q-supplier-summary strong { font-family: var(--font-d); font-size: 22px; letter-spacing: -.5px; overflow-wrap: anywhere; }
.q-supplier-change { margin-left: auto; flex-shrink: 0; }
.q-supplier-editor { display: grid; gap: 15px; padding: 18px; border-radius: 22px; }
.q-supplier-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; min-height: 30px; }
.q-supplier-dyn { display: grid; gap: 10px; }
.q-supplier-dyn:empty { display: none; }
.q-supplier-field { display: grid; gap: 7px; font-size: 13px; color: var(--label-sub); }
.q-supplier-field input, .q-supplier-field select { width: 100%; min-height: 50px; border: 1px solid var(--separator); border-radius: 13px; padding: 12px; font: inherit; font-size: 16px; color: var(--label); background: var(--surface); }
.q-supplier-select-wrap { position: relative; }
.q-supplier-select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 36px; }
.q-supplier-select-wrap > svg { position: absolute; top: 16px; right: 12px; pointer-events: none; color: var(--label-sub); }
.q-supplier-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.q-supplier-chip { border-radius: 30px; padding: 9px 13px; min-height: 40px; font-size: 13px; font-weight: 600; border: 1px solid var(--separator); background: var(--surface); color: var(--label); }
.q-supplier-note { font-size: 12px; line-height: 1.5; color: var(--label-sub); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.q-supplier-note.is-warning { color: var(--amber); }
.q-supplier-duplicates { display: grid; gap: 9px; background: var(--fill); border-radius: 13px; padding: 12px; font-size: 13px; }
.q-supplier-different { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 40px; }
.q-supplier-different input { width: 22px; height: 22px; accent-color: #f59a2c; }
.q-incomplete { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; margin-top: 20px; border: 1px dashed var(--separator); border-radius: 22px; color: var(--label-sub); }
.q-incomplete > svg { color: var(--q-accent); }
.q-incomplete strong { color: var(--label); font-size: 17px; }
.q-incomplete p { font-size: 13px; line-height: 1.5; }
.q-locked-supplier { padding: 22px; border-radius: 22px; display: grid; gap: 10px; }
.q-locked-supplier strong { font-family: var(--font-d); font-size: 24px; }
.q-locked-supplier p { font-size: 13px; color: var(--label-sub); line-height: 1.5; }
.q-recovery { display: flex; align-items: center; gap: 12px; border-radius: 17px; padding: 15px 16px; width: 100%; text-align: left; margin-top: 20px; font-size: 14px; font-weight: 600; color: var(--label); }
.q-recovery > span { flex: 1; min-width: 0; }
.q-recovery small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--label-sub); overflow-wrap: anywhere; }
.q-recovery-list { display: grid; gap: 4px; text-align: left; }
.q-recovery-list .q-recovery { margin-top: 6px; }
.q-demo { margin-top: 14px; padding: 18px; border-radius: 22px; display: grid; gap: 8px; }
.q-demo > p { font-size: 13px; color: var(--label-sub); line-height: 1.5; margin-bottom: 4px; }
.q-demo-account { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 12px 14px; min-height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.q-demo-account small { display: block; font-weight: 400; color: var(--label-sub); font-size: 12px; margin-top: 2px; }
.q-demo-account em { font-style: normal; font-size: 11px; color: var(--red); white-space: nowrap; }
.q-working { display: flex; align-items: center; justify-content: center; gap: 10px; position: fixed; z-index: 140; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom)); padding: 14px 20px; max-width: 92%; width: max-content; border: 1px solid var(--q-edge); border-radius: 22px; box-shadow: 0 10px 50px rgb(0 0 0 / 18%); background: var(--bar-solid); color: var(--label); font-size: 14px; font-family: var(--font); }
.q-modal-shade { position: fixed; inset: 0; z-index: 160; background: rgb(10 14 21 / 40%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 20px; font-family: var(--font); color: var(--label); }
.q-modal { width: 100%; max-width: 360px; max-height: calc(100dvh - 40px); overflow: auto; padding: 26px 22px 16px; border-radius: 28px; text-align: center; background: var(--bar-solid); box-shadow: 0 25px 90px rgb(0 0 0 / 28%); }
.q-modal.is-wide { max-width: 520px; }
.q-modal h2 { font-family: var(--font-d); font-size: 22px; letter-spacing: -.4px; margin-bottom: 10px; }
.q-modal p { font-size: 13px; line-height: 1.5; color: var(--label-sub); margin-bottom: 18px; }
.q-modal .q-text-button { display: block; margin: 8px auto 0; }
.q-wheel-wrap { position: relative; margin: 6px auto 22px; height: 240px; max-width: 240px; }
.q-wheel { height: 240px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 96px 0; position: relative; -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.q-wheel::-webkit-scrollbar { display: none; }
.q-wheel [role="option"] { height: 48px; min-height: 48px; display: flex; gap: 12px; align-items: center; justify-content: center; scroll-snap-align: center; color: var(--label-3); font-size: 22px; font-weight: 500; cursor: pointer; }
.q-wheel [role="option"].is-selected { color: var(--label); font-weight: 800; }
.q-wheel [role="option"] span { font-size: 17px; font-weight: 400; width: 48px; text-align: left; }
.q-wheel-selection { position: absolute; top: 96px; height: 48px; width: 100%; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); pointer-events: none; }
.q-sheet-image { background: #fff; border-radius: 14px; padding: 6px; margin-bottom: 14px; box-shadow: 0 0 0 1px var(--line); }
.q-sheet-image img { display: block; margin: auto; max-height: 52dvh; object-fit: contain; }
.q-sheet-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 4px; }
.q-tool { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px; border-radius: 14px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--label); }
.q-tool.is-danger { color: var(--red); }
.q-main-settings { max-width: 600px; }
.q-account { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 22px; margin-bottom: 26px; }
.q-account-avatar { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--q-accent); font-size: 18px; font-weight: 800; }
.q-account > div { min-width: 0; }
.q-account strong { font-size: 15px; }
.q-account p { font-size: 12px; color: var(--label-sub); margin-top: 4px; overflow-wrap: anywhere; }
.q-account > .q-text-button { margin-left: auto; flex-shrink: 0; }
.q-group { margin-bottom: 24px; }
.q-group > h2 { font-size: 13px; font-weight: 700; color: var(--label-sub); margin: 0 0 8px 6px; letter-spacing: .2px; }
.q-list { border-radius: 20px; overflow: hidden; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.q-row:first-child { border-top: 0; }
.q-row > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.q-row small { font-size: 12px; color: var(--label-sub); line-height: 1.45; overflow-wrap: anywhere; }
.q-row small.is-good { color: var(--green); } .q-row small.is-bad { color: var(--red); } .q-row small.is-warn { color: var(--amber); }
.q-segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--fill); }
.q-segment button { min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--label-sub); }
.q-segment button.is-on { background: var(--surface); color: var(--label); box-shadow: 0 2px 8px -4px var(--q-shadow); }

/* ---------- camera (from Paperwork AI v2 WebScanner) ---------- */
.cam { position: fixed; inset: 0; z-index: 150; background: #000; color: #f4f5f7; display: flex; flex-direction: column; overflow: hidden; font-family: var(--font); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.cam button:focus-visible { outline: 3px solid #ffb547; outline-offset: 3px; }
.cam-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #ffffff14; }
.cam-header strong { font-size: 17px; font-weight: 700; }
.cam-header small { display: block; color: #b9bec6; margin-top: 3px; font-size: 13px; }
.cam-icon { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: #ffffff1f; border-radius: 50%; color: #fff; }
.cam-icon[aria-pressed="true"] { background: #ffb547; color: #1d1204; }
.cam-header-actions { display: flex; gap: 9px; }
.cam-format { display: block; margin: 7px 0 0; border: 1px solid #ffffff40; border-radius: 14px; background: #ffffff12; color: #fff; font-size: 12px; padding: 6px 12px; min-height: 40px; }
.cam-stage { position: relative; flex: 1; min-height: 100px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.cam-feed { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cam-video-box { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; line-height: 0; }
.cam-video-box video { display: block; width: 100%; height: 100%; object-fit: contain; }
.cam-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-edges polygon { fill: rgb(255 181 71 / 10%); stroke: #ffb547; stroke-width: 2.5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cam-edges polygon.stable { stroke: #3ddc9b; fill: rgb(61 220 155 / 16%); stroke-width: 3px; }
.cam-edges circle { fill: #fff; stroke: #ffb547; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.cam-edges circle.stable { stroke: #3ddc9b; }
.cam-edges rect { fill: none; stroke: #ffffff90; stroke-width: 1.5; stroke-dasharray: 12 10; vector-effect: non-scaling-stroke; }
.cam-guidance { position: absolute; left: 12px; right: 12px; bottom: 15px; display: flex; justify-content: center; pointer-events: none; }
.cam-lock { display: flex; flex-direction: column; align-items: center; gap: 7px; background: #1c1c1ee6; border: 1px solid #ffffff25; border-radius: 20px; padding: 9px 16px; max-width: 92%; text-align: center; color: #eef0f2; font-size: 14px; line-height: 1.35; }
.cam-lock meter { appearance: none; width: 140px; height: 4px; border: 0; border-radius: 4px; background: #ffffff30; }
.cam-lock meter::-webkit-meter-bar { height: 4px; border: 0; background: #ffffff30; border-radius: 4px; }
.cam-lock meter::-webkit-meter-optimum-value { background: #3ddc9b; border-radius: 4px; }
.cam-lock meter::-moz-meter-bar { background: #3ddc9b; }
.cam-overlay { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 20px; text-align: center; color: #c3c8cf; background: #000; }
.cam-overlay.is-solid { background: #000000ed; }
.cam-overlay img { max-height: 42vh; max-width: 70vw; border: 2px solid #fff; border-radius: 6px; background: #fff; }
.cam-overlay p { max-width: 400px; color: #e7e9ec; line-height: 1.45; }
.cam-overlay-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.cam-camera-error { max-width: 380px; line-height: 1.5; display: grid; justify-items: center; gap: 8px; }
.cam-camera-error h2 { font-size: 21px; color: #fff; }
.cam-camera-error p { color: #c3c8cf; font-size: 14px; }
.cam-action { border: 1px solid #ffffff30; border-radius: 12px; background: #ffffff0c; padding: 12px 17px; color: #f4f5f7; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cam-action.is-primary { background: linear-gradient(180deg, #ffc566, #f59a2c); color: #1d1204; border-color: transparent; font-weight: 700; }
.cam-footer { background: #000; border-top: 1px solid #ffffff15; flex-shrink: 0; }
.cam-error { padding: 9px 18px; background: #6b2b24; color: #ffe8e3; font-size: 13px; line-height: 1.4; }
.cam-pages { display: flex; gap: 9px; overflow-x: auto; padding: 12px 16px 4px; max-height: 102px; }
.cam-page { position: relative; flex-shrink: 0; min-width: 62px; height: 80px; padding: 3px; background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.cam-page img { max-height: 74px; max-width: 80px; object-fit: contain; }
.cam-page-number { position: absolute; left: 3px; bottom: 3px; background: #1c1f24; color: #fff; font-size: 11px; border-radius: 5px; padding: 2px 5px; }
.cam-page-delete { position: absolute; right: -3px; top: -3px; display: flex; align-items: center; justify-content: center; background: #2a2e35; color: #fff; border: 1px solid #6b717a; border-radius: 50%; width: 32px; height: 32px; }
.cam-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; max-width: 680px; margin: 0 auto; }
.cam-mode { display: flex; flex-direction: column; gap: 6px; min-width: 88px; font-size: 12px; color: #b9bec6; }
.cam-mode button { border-radius: 20px; padding: 9px 12px; border: 1px solid #ffffff33; color: #eef0f2; background: #1c1c1e; min-height: 44px; }
.cam-mode button[aria-pressed="true"] { border-color: #ffb547; color: #ffb547; }
.cam-shutter { border: 3px solid #fff; background: #fff; color: #000; border-radius: 50%; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 0 4px #ffffff22; }
.cam-shutter.is-busy svg { animation: q-spin 1s linear infinite; }
.cam-done { min-width: 88px; padding: 11px 12px; border-radius: 12px; background: linear-gradient(180deg, #ffc566, #f59a2c); color: #1d1204; display: flex; gap: 6px; align-items: center; justify-content: center; min-height: 46px; font-size: 14px; font-weight: 700; }
.cam-done:disabled { background: #1c1c1e; color: #eef0f2; border: 1px solid #ffffff33; }
@media (min-width: 720px) { .cam-header { padding: 16px 28px; } .cam-controls { padding: 16px 26px; } .cam-pages { justify-content: center; } .cam-shutter { width: 76px; height: 76px; } }
@media (max-height: 600px) { .cam-header { padding: 7px 14px; } .cam-header small { display: none; } .cam-pages { max-height: 74px; padding-top: 7px; } .cam-page { height: 56px; } .cam-page img { max-height: 50px; } .cam-controls { padding: 7px 16px; } .cam-shutter { width: 56px; height: 56px; } }

/* ---------- corner editor (from Paperwork AI v2 PageEditor) ---------- */
.crop-overlay { position: fixed; inset: 0; z-index: 170; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: env(safe-area-inset-top) 0 calc(12px + env(safe-area-inset-bottom)); overflow: auto; background: #000; color: #fff; font-family: var(--font); }
.crop-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: min(760px, 100%); min-height: 54px; padding: 0 8px; }
.crop-header h2 { font-size: 17px; font-weight: 700; }
.crop-text-button { display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 44px; padding: 0 10px; border-radius: 10px; color: #fff; font-size: 17px; }
.crop-text-button.is-done { justify-self: end; color: #ffb547; font-weight: 700; }
.crop-help { padding: 0 20px; color: #aeaeb2; font-size: 15px; text-align: center; line-height: 1.4; }
.crop-stage { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; padding: 8px 18px; }
.crop-image { position: relative; width: fit-content; max-width: min(640px, 92vw); touch-action: none; background: #fff; }
.crop-image img { display: block; max-width: 100%; max-height: 60dvh; }
.crop-image svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop-image polygon { fill: rgb(255 181 71 / 14%); stroke: #ffb547; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.crop-image polygon.is-invalid { stroke: #ff7a7d; fill: rgb(255 80 80 / 18%); }
.crop-handle { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid #ffb547; background: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 45%); touch-action: none; }
.crop-handle::after { content: ""; position: absolute; inset: -10px; }
.crop-handle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.crop-error { margin: 0 16px; padding: 8px 12px; border-radius: 10px; background: rgb(255 69 58 / 22%); color: #ffd2cf; font-size: 15px; }
.crop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 12px; }
.crop-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 92px; min-height: 58px; padding: 6px 12px; border-radius: 14px; background: #1c1c1e; color: #fff; font-size: 13px; font-weight: 600; }
.crop-tool.is-primary { background: linear-gradient(180deg, #ffc566, #f59a2c); color: #1d1204; }

@media (min-width: 760px) { .q-header { height: 96px; padding-top: 0; } .q-main { padding-top: 16px; } .q-home-title h1 { font-size: 64px; } .q-scan-art { height: 230px; } .q-paper { transform: rotate(-7deg); } .q-focus-frame { top: 9px; width: 174px; height: 207px; } }
@media (max-width: 375px) { .q-main, .q-header { padding-left: 18px; padding-right: 18px; } .q-home-title h1 { font-size: 50px; } .q-supplier-card { padding: 18px 14px; gap: 10px; } .q-supplier-summary strong { font-size: 19px; } .q-start-controls { gap: 8px; } .q-page-control { padding: 0 12px; } .q-primary { padding: 15px; } }
@media (max-height: 760px) and (max-width: 759px) { .q-home-title { margin-top: 12px; } .q-home-title h1 { font-size: 50px; } .q-title p { font-size: 14px; } .q-scan-art { height: 180px; } .q-paper { transform: rotate(-7deg) scale(.78); } .q-focus-frame { height: 165px; width: 142px; top: 0; } .q-import { margin-top: 10px; } .q-footer { margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) { .q-primary { transition: none; } .q-scan-beam, .spin, .q-primary.is-busy svg:first-child, .cam-shutter.is-busy svg { animation: none; } }
@media (forced-colors: active) { .q-primary, .cam-done, .cam-action.is-primary { border: 2px solid ButtonText; } }
