:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1b2629;
  --muted: #5d6b6e;
  --line: #e2ded5;
  --accent: #1e6b66;
  --accent-ink: #ffffff;
  --accent-soft: #e3efeb;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --err: #9b2c2c;
  --err-soft: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 30, .05), 0 6px 24px rgba(20, 30, 30, .06);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121819; --card: #1a2223; --ink: #e8eeec; --muted: #9aa9a7; --line: #2b3536;
    --accent: #5fb7ae; --accent-ink: #0d1716; --accent-soft: #1f3331;
    --warn: #f0c56b; --warn-soft: #2e2716; --err: #f2a59c; --err-soft: #3a1f1c;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

header.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo svg { color: var(--accent); }
nav.cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.cats a { font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 99px; white-space: nowrap; }
nav.cats a:hover, nav.cats a.on { background: var(--accent-soft); color: var(--ink); }
@media (max-width: 640px) { nav.cats { display: none; } }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 680px; }
.badge { font: inherit; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 4px 11px; margin-bottom: 14px; }

.tool { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 18px; margin: 22px 0 10px; box-shadow: var(--shadow); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop-icon { color: var(--accent); }
.drop-title { font-weight: 650; font-size: 17px; }
.drop-hint { font-size: 14px; color: var(--muted); }

.files { margin-top: 12px; display: grid; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.fmove { display: flex; gap: 2px; }
.files-total { font-size: 13px; color: var(--muted); padding-left: 4px; }
.icon { border: 0; background: transparent; color: var(--muted); font-size: 18px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.icon:hover:not(:disabled) { background: var(--accent-soft); color: var(--ink); }
.icon:disabled { opacity: .3; cursor: default; }

.opts:empty { display: none; }
.opts { margin-top: 16px; display: grid; gap: 14px; }
.opts > div { display: grid; gap: 14px; }
.field-l { font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.field-h { font-size: 13px; color: var(--muted); margin-top: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; min-width: 84px; }
.seg label:hover { border-color: var(--accent); }
.seg input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-l { font-weight: 600; font-size: 14px; }
.seg-s { font-size: 12px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 10px; padding: 7px 12px; cursor: pointer; font: inherit; text-align: left; }
.chip b { font-size: 15px; }
.chip span { font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.custom, .inline { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.inline { margin-top: 0; }
.num, .txt { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.num { width: 96px; }
.txt { width: 100%; max-width: 360px; }
.inline .txt { width: auto; flex: 1; }
.num:focus, .txt:focus { outline: 2px solid var(--accent); border-color: transparent; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 11px; padding: 10px 18px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.stage { font-size: 14px; color: var(--muted); margin-top: 12px; min-height: 1em; }
.bar { height: 6px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.results { display: grid; gap: 8px; margin-top: 12px; }
.results:empty { display: none; }
.saving { font-size: 15px; color: var(--accent); }
.saving b { font-size: 18px; }
.res { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; }
.res.warn { border-color: var(--warn); background: var(--warn-soft); }
.res-main { flex: 1; min-width: 0; }
.res-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { font-size: 13px; color: var(--muted); }
.err { color: var(--err); background: var(--err-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.err.soft { color: var(--warn); background: var(--warn-soft); }
.okmsg { font-size: 14px; color: var(--muted); }
.note { padding: 14px; border-radius: 12px; background: var(--accent-soft); }
.textout { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.after { font-size: 14px; color: var(--muted); }
.after p { margin: 14px 0 0; }

.promo { margin: 8px 0 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; color: var(--muted); }
.promo:empty { display: none; }

section.info { padding: 26px 0 6px; }
section.info h2 { font-size: 22px; margin: 0 0 12px; letter-spacing: -.01em; }
ol.how { padding-left: 22px; margin: 0; display: grid; gap: 6px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.card { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card b { display: block; margin-bottom: 2px; }
.card span { font-size: 13px; color: var(--muted); }
h3.cat { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }

footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: grid; gap: 8px; }
footer a { color: var(--muted); }

/* Extension tools page */
body.ext .extnav { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 0; }
body.ext .extnav a { font-size: 14px; text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 99px; }
body.ext .extnav a.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* Scanner */
.scan-list { display: grid; gap: 14px; margin-top: 14px; }
.scan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.scan-card.unsure { border-color: var(--warn); background: var(--warn-soft); }
.scan-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-stage { position: relative; max-width: 520px; touch-action: none; user-select: none; }
.scan-canvas { display: block; max-width: 100%; border-radius: 8px; }
.scan-h { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(63, 209, 195, .25); border: 2.5px solid #3fd1c3; box-shadow: 0 0 0 2px rgba(0,0,0,.35); cursor: grab; touch-action: none; }
.scan-h:focus-visible { outline: 3px solid #fff; }
.scan-h:active { cursor: grabbing; background: rgba(63, 209, 195, .5); }
.scan-rot { font-size: 13px; color: var(--muted); }
.scan-card .row .btn { padding: 8px 12px; }

/* Language */
.langpick select { font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; cursor: pointer; }
.langsuggest { max-width: 920px; margin: 10px auto 0; padding: 0 20px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.langsuggest a { font-weight: 600; }
header.top .wrap { gap: 10px; }
nav.cats { flex: 1; justify-content: flex-end; }
.langsel { font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; }

/* Live camera */
html.cam-open, html.cam-open body { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; color: #fff; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.cam.flash::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .6; pointer-events: none; }
.cam-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cam-video { max-width: 100%; max-height: 100%; display: block; }
.cam-overlay { position: absolute; pointer-events: none; }
.cam-warn { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: #f0c56b; color: #2b2000; font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 99px; white-space: nowrap; }
.cam-tip { font-size: 13px; color: #cfd8d6; text-align: center; padding: 8px 16px 0; }
.cam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 18px 18px; gap: 10px; }
.cam-btn { justify-self: start; font: inherit; font-weight: 600; font-size: 15px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 9px 14px; cursor: pointer; }
.cam-btn.on { background: #f0c56b; color: #2b2000; border-color: #f0c56b; }
.cam-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.cam-right .cam-btn { justify-self: end; }
.cam-count { font-size: 13px; color: #cfd8d6; }
.cam-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: #fff; box-shadow: inset 0 0 0 4px #000; cursor: pointer; }
.cam-shutter:active { transform: scale(.94); }
.cam-top { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.cam-btn.small { font-size: 13px; padding: 7px 11px; background: rgba(0,0,0,.45); }
.cam-btn.small.on { background: #3fd1c3; color: #04201d; border-color: #3fd1c3; }

/* Pro */
.pro-link { font-size: 14px; font-weight: 700; text-decoration: none; color: #7a5200; background: #fbf1dc; padding: 6px 11px; border-radius: 99px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pro-link { color: #2b2000; background: #f0c56b; } }
.pro-tag { font-style: normal; font-size: 11px; font-weight: 700; color: #7a5200; background: #fbf1dc; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.pro-lock h3 { margin: 6px 0 4px; font-size: 20px; }
.pro-lock p { margin: 0 0 10px; color: var(--muted); }
.pro-badge { display: inline-block; font-size: 12px; font-weight: 700; color: #7a5200; background: #fbf1dc; border-radius: 99px; padding: 3px 10px; }
.pro-features { margin: 6px 0 14px; padding-left: 20px; display: grid; gap: 4px; }
.pro-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0; }
.pro-plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 4px; align-content: start; }
.pro-plan.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pro-plan-name { font-weight: 700; }
.pro-price { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.pro-plan-sub { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pro-plan .btn { text-align: center; text-decoration: none; }
.pro-key { margin-top: 10px; }
.pro-key summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.pro-key .inline { margin-top: 8px; }
.okbox { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-weight: 600; }
html.is-pro .pro-link::after { content: ' ✓'; }

/* Receipts review */
.rc-list { display: grid; gap: 10px; margin: 10px 0; }
.rc-row { display: grid; grid-template-columns: 74px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--card, transparent); }
.rc-row.unsure { border-color: #d89a2b; }
.rc-left { display: grid; gap: 6px; align-content: start; justify-items: center; font-size: 14px; }
.rc-thumb { width: 74px; max-height: 140px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.rc-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.rc-fields .wide { grid-column: 1 / -1; }
.rc-f { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.rc-f .txt { width: 100%; min-width: 0; box-sizing: border-box; font-size: 15px; color: var(--ink); }
.rc-sum { font-weight: 700; margin: 6px 0 12px; }
.rc-fields { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.rc-thumb { cursor: zoom-in; }
.rc-big { grid-column: 1 / -1; width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-out; }
.cam-btn.on:not(.lit) { background: transparent; color: #f0c56b; border-color: #f0c56b; }
.cam-btn.lit { box-shadow: 0 0 0 3px rgba(240,197,107,.35); }

/* Scanner page toolbar: four equal icon buttons */
.scan-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.scan-tbtn { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; min-height: 56px; }
.scan-tbtn:active { transform: scale(.97); }
.scan-ti { font-size: 22px; line-height: 1; }
.scan-tl { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.scan-tbtn.danger .scan-ti { color: #d0574a; }
/* Look picker with live previews */
.seg-thumb { display: block; width: 100%; height: 70px; object-fit: cover; object-position: top; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.seg.has-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg.has-thumbs label { min-width: 0; padding: 6px; }
.seg.has-thumbs .seg-s { display: none; }
.seg.has-thumbs .seg-l { font-size: 13px; }
.seg.has-thumbs { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .seg.has-thumbs { grid-template-columns: repeat(4, 1fr); } }
.seg.has-thumbs .seg-thumb { height: 96px; }
.seg.has-thumbs .seg-l { font-size: 14px; overflow-wrap: anywhere; hyphens: auto; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.35; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; }

/* Long file names: never push the card wider than the screen */
.tool, .results, .res { min-width: 0; max-width: 100%; }
.results { grid-template-columns: minmax(0, 1fr); }
.res > .btn, .res > button { flex: none; }
.res-name { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.files, .file { min-width: 0; max-width: 100%; }
.file .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fsize, .file .icon, .file button { flex: none; }
.file .fname { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }

/* Stamp: preview, colour swatches, strength slider */
.stamp-pvbox { margin-bottom: 14px; }
.stamp-pv { display: block; margin: 6px auto 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.swatch.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.swatch .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.swatch-custom { width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%; background: none; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range { flex: 1; min-width: 0; accent-color: var(--accent); }
.range-end { font-size: 13px; color: var(--muted); }
.range-v { font-size: 13px; font-variant-numeric: tabular-nums; width: 3.2em; text-align: right; }

/* PDF accessibility check */
.a11y-score { font-size: 20px; font-weight: 750; margin: 4px 0 10px; }
.a11y-score.good { color: var(--accent); }
.a11y-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.a11y-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.a11y-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; }
.a11y-pass .a11y-ic { background: #2f8a5f; } .a11y-warn .a11y-ic { background: #c98a1b; } .a11y-fail .a11y-ic { background: #c0473b; } .a11y-na .a11y-ic { background: #8a8f98; }
.a11y-t { font-size: 14px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.a11y-fix { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.a11y-fix h3 { margin: 0 0 4px; font-size: 17px; }
.row.wrap { flex-wrap: wrap; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.dl-grid .btn { width: 100%; }

/* Home page: finding tools */
.finder { margin: 0 0 14px; position: relative; }
.finder input[type=search] { width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; padding: 14px 16px 14px 44px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23687078' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") no-repeat 14px center; color: inherit; }
.finder input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.findres { display: grid; gap: 8px; margin-top: 8px; }
.findres .card { display: block; }
.findnone { color: var(--muted); margin: 6px 2px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 14px; color: var(--muted); align-items: center; }
.recent a { color: var(--accent); }
.tip { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 0 0 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.tip p { margin: 0; font-size: 15px; }
.tip .btn { flex: none; }
.also { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.also h3 { margin: 0 0 10px; font-size: 16px; }
.also-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.also-chip { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 15px; background: var(--card, #fff); }
.also-chip:hover { border-color: var(--accent); color: var(--accent); }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }
details.more .grid { margin-top: 8px; }

[hidden] { display: none !important; }

.badge { font-size: 13px; font-weight: 600; }
.badge-i { opacity: .7; font-size: 13px; }
.privinfo { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin: -6px 0 14px; font-size: 15px; max-width: 640px; }
.privinfo p { margin: 0 0 6px; } .privinfo p:last-child { margin: 0; }
.privtest { color: var(--muted); font-size: 14px; }
.browse { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.browse > span { font-size: 14px; color: var(--muted); margin-right: 2px; }
.bchip { font: inherit; font-size: 14px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; cursor: pointer; }
.bchip:hover { border-color: var(--accent); }
.bchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip { gap: 2px; }
/* Tap feedback on tool cards and chips */
.card { transition: transform .08s ease, border-color .15s; }
.card:active, .also-chip:active, .bchip:active { transform: scale(.97); }

/* Feedback box */
.fb { margin-top: 28px; }
.fb details { border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; background: var(--card, #fff); }
.fb summary { cursor: pointer; font-weight: 650; padding: 12px 0; list-style: none; }
.fb summary::-webkit-details-marker { display: none; }
.fb summary::after { content: '＋'; float: right; color: var(--muted); }
.fb details[open] summary::after { content: '－'; }
.fbform { display: grid; gap: 10px; padding-bottom: 14px; }
.fbform textarea { resize: vertical; min-height: 90px; font: inherit; }
.fbform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fbmsg { margin: 0; font-size: 15px; } .fbmsg.ok { color: var(--accent); } .fbmsg.bad { color: #b42318; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.fbform label.field { display: grid; gap: 6px; }
.fbform label.field > span { font-size: 14px; font-weight: 650; }

/* Interactive page previews (black out, fill & sign) */
.opts-stack { display: grid; gap: 14px; }
.pgboard { display: grid; gap: 14px; margin-top: 4px; }
.pg { position: relative; width: 100%; background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.18); overflow: hidden; }
.pg > canvas { display: block; width: 100%; height: 100%; }
.pg-ov { position: absolute; inset: 0; }
.pgboard.drawing .pg-ov { cursor: crosshair; touch-action: none; }
.pg-n { position: absolute; right: 6px; bottom: 6px; font-size: 12px; background: rgba(0,0,0,.55); color: #fff; padding: 1px 7px; border-radius: 99px; pointer-events: none; }
.rbox { position: absolute; background: #000; border-radius: 1px; }
.rbox.temp { background: rgba(0,0,0,.55); outline: 2px dashed #fff; }
.rbox-x { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #c0473b; color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.fs-hint { position: sticky; top: 64px; z-index: 5; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.pgboard.armed .pg-ov { cursor: copy; outline: 3px dashed var(--accent); outline-offset: -3px; }
.fsitem { position: absolute; touch-action: none; }
.fsitem img { display: block; width: 100%; height: auto; cursor: grab; user-select: none; -webkit-user-select: none; }
.fsitem.sel { outline: 2px dashed var(--accent); outline-offset: 2px; }
.fs-tools { display: none; position: absolute; top: -34px; right: 0; gap: 4px; }
.fsitem.sel .fs-tools { display: flex; }
.fs-tools button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 17px; cursor: pointer; padding: 0; }
.fs-tools .fs-x { background: #c0473b; color: #fff; border-color: #c0473b; }
.sigpad { width: 100%; aspect-ratio: 3 / 1; background: #fff; border: 1.5px dashed var(--line); border-radius: 12px; touch-action: none; display: block; margin-bottom: 8px; }
.fs-fields { display: grid; gap: 10px; }
.fs-h { margin: 0; font-size: 17px; }

/* Passport / ID photo */
.pp-editor { display: grid; gap: 10px; justify-items: stretch; }
.pp-frame { position: relative; width: min(100%, 340px); justify-self: center; background: #eee; border-radius: 4px; overflow: hidden; touch-action: none; cursor: grab; box-shadow: 0 0 0 1px var(--line); }
.pp-cv { display: block; width: 100%; height: 100%; }
.pp-guide, .pp-guide svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pp-l { position: absolute; left: 4px; transform: translateY(-110%); font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.pp-l.pp-top { transform: translateY(2px); }
.pp-editor input[type=range] { width: 100%; }
@media (max-width: 600px) { .rbox-x { width: 18px; height: 18px; line-height: 18px; font-size: 13px; right: -8px; top: -8px; } }
/* Remove hidden PDF data */
.cp-report { display: grid; gap: 10px; }
.cp-file { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card, #fff); }
.cp-name { font-weight: 600; word-break: break-all; margin-bottom: 4px; }
.cp-ok { margin: 4px 0 0; }
.cp-list { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 3px 12px; margin: 6px 0 0; font-size: .92em; }
@media (max-width: 600px) { .cp-list { grid-template-columns: 1fr; gap: 0; } .cp-list dd { margin-bottom: 6px; font-weight: 500; } }
.cp-list dt { color: var(--muted, #666); }
.cp-list dd { margin: 0; word-break: break-word; }
.checks { display: grid; gap: 6px; }
.sub-check { padding-left: 26px; }
/* Signature cleanup */
.sig-prev { display: grid; place-items: center; min-height: 90px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); }
.sig-prev img { max-width: 100%; max-height: 220px; }
.sig-prev img.sig-form { width: min(100%, 420px); max-height: none; background: #fff; box-shadow: 0 0 0 1px var(--line); image-rendering: auto; }
.ckb { background-color: #fff; background-image: linear-gradient(45deg, #e8e8e8 25%, transparent 25%, transparent 75%, #e8e8e8 75%), linear-gradient(45deg, #e8e8e8 25%, transparent 25%, transparent 75%, #e8e8e8 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.pp-ai { justify-content: center; }
.pp-check { margin: 0; text-align: center; font-size: .92em; min-height: 1.3em; }
.pp-check.ok { color: #1f7a4d; } .pp-check.warn { color: #9a5b00; }
/* Hindi exam helper */
.hi-step { margin-top: 18px; }
.hi-step > h2 { margin: 0 0 4px; font-size: 1.25rem; }
.hi-step + .hi-step { border-top: 1px solid var(--line); padding-top: 18px; }
.hi-link { text-align: center; margin: 10px 0 0; }
html[lang="hi"] body { line-height: 1.6; }
