/* Akarika OCR — solid colours only */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --border: #e2e4e9;
  --border-strong: #c9ccd3;
  --text: #16181d;
  --text-2: #464a53;
  --muted: #6b707b;
  --brand: #1b5fd9;
  --brand-hover: #164fb6;
  --brand-press: #123f91;
  --brand-soft: #ebf2fd;
  --brand-ink: #ffffff;
  --ink: #111318;
  --ink-text: #f4f5f7;
  --ok: #0f7a52;
  --ok-soft: #e5f5ee;
  --err: #c8243a;
  --err-soft: #fdecee;
  --warn: #8a5a00;
  --warn-soft: #fff5db;
  --focus: #1b5fd9;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, .06);
  --shadow: 0 1px 3px rgba(17, 19, 24, .06), 0 12px 32px rgba(17, 19, 24, .08);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --font: "Source Sans 3", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Noto Sans Devanagari", "Source Sans 3", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111215;
    --bg-alt: #16181c;
    --surface: #1b1d22;
    --surface-2: #23262c;
    --border: #2e3138;
    --border-strong: #41454e;
    --text: #f1f2f4;
    --text-2: #c5c8cf;
    --muted: #8f949e;
    --brand: #4c8dff;
    --brand-hover: #6b9fff;
    --brand-press: #8ab3ff;
    --brand-soft: #172741;
    --brand-ink: #0b1220;
    --ink: #23262d;
    --ink-text: #f1f2f4;
    --ok: #4cc38a;
    --ok-soft: #12291f;
    --err: #ff6b7d;
    --err-soft: #34161b;
    --warn: #f5c451;
    --warn-soft: #2f2711;
    --focus: #6b9fff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; }
svg { flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-press); }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-quiet:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn-light { background: #ffffff; color: #111318; }
.btn-light:hover { background: #e9ebef; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 28px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- header */
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { font-weight: 400; color: var(--text-2); }
.nav-links { display: flex; gap: 26px; margin-right: auto; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* ---------- hero + tool */
.hero { padding: 64px 0 72px; background: var(--bg-alt); border-bottom: 1px solid var(--border); text-align: center; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.03em; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--text-2); margin: 18px auto 0; max-width: 700px; }
.tool-wrap { max-width: 880px; margin-top: 40px; }
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px; text-align: left; }
.tool:focus { outline: none; }
.tool-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.tool-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 12px; padding: 48px 20px 44px; background: var(--surface);
  transition: background-color .12s, border-color .12s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop:focus-within { border-color: var(--brand); }
.drop-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 6px; }
.drop-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 20px; font-weight: 700; }
.drop-or { font-size: 14px; color: var(--muted); }
.drop .btn { pointer-events: none; }
.drop-hint { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

#stepReady { padding: 16px 16px 12px; }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.step-head h2 { font-size: 18px; }
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.file-list li + li { border-top: 1px solid var(--border); }
.file-list .f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.file-list .f-size { color: var(--muted); font-size: 13.5px; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.ftype { width: 34px; height: 40px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .02em; color: #fff; flex: none; }
.ftype.pdf { background: #c8243a; }
.ftype.img { background: #0f7a52; }
.ftype.doc { background: #1b5fd9; }
.ftype.ppt { background: #c4510f; }
.ftype.xls { background: #177245; }
.ftype.txt { background: #5b6270; }

.field { margin-top: 22px; }
.field-label { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.field-label .hint { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--brand-soft); color: var(--text); font-weight: 600; font-size: 14px; border: 1px solid var(--brand); }
.chip button { width: 24px; height: 24px; border-radius: 999px; border: 0; background: transparent; color: var(--brand); cursor: pointer; display: grid; place-items: center; }
.chip button:hover { background: var(--surface); }
.chip button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.chips .none { color: var(--muted); font-size: 14px; line-height: 32px; }
.combo { position: relative; margin-top: 10px; max-width: 420px; }
.combo-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.combo input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.combo input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.combo-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 15px; }
.combo-list li small { color: var(--muted); }
.combo-list li:hover, .combo-list li[aria-selected=true] { background: var(--surface-2); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.presets button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.presets button:hover { border-color: var(--brand); color: var(--brand); }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modes button { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .12s, background-color .12s; }
.modes button:hover { border-color: var(--border-strong); }
.modes button[aria-checked=true] { border-color: var(--brand); background: var(--brand-soft); }
.modes b { display: block; font-size: 15.5px; }
.modes em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 2px; }
.modes small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.modes button:disabled { opacity: .5; cursor: not-allowed; }
.mode-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; flex: none; }
.modes button[aria-checked=true] .mode-icon { background: var(--brand); color: var(--brand-ink); }
.mode-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.more { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.more[open] summary::before { transform: rotate(45deg); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.control { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.control select, .control input { height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 400; color: var(--text); }
.control select:focus, .control input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; align-self: end; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.tool-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-msg { color: var(--err); font-size: 14px; text-align: right; margin-top: 8px; min-height: 1px; }

/* ---------- results */
.results-section { padding: 48px 0 8px; }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.results-head h2 { font-size: 26px; }
.results { display: grid; gap: 20px; }
.result { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.r-progress { height: 3px; background: var(--surface-2); }
.r-bar { height: 100%; width: 0; background: var(--brand); transition: width .35s ease; }
.result.is-done .r-progress { visibility: hidden; }
.r-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.r-title { flex: 1; min-width: 180px; }
.r-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-meta { font-size: 13.5px; color: var(--muted); }
.r-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.r-export { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.r-export-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.fmt { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px 0 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background-color .12s; }
.fmt:hover:not(:disabled) { border-color: var(--brand); }
.fmt:disabled { opacity: .45; cursor: not-allowed; }
.fmt b { display: block; font-size: 14px; line-height: 1.2; }
.fmt small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.fmt-ic { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; flex: none; letter-spacing: .02em; }
.fmt-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fmt-ic.copy { background: var(--ink); color: var(--ink-text); }
.fmt-ic.word { background: #1b5fd9; font-size: 15px; }
.fmt-ic.pdf { background: #c8243a; }
.fmt-ic.jpg { background: #0f7a52; }
.fmt-ic.txt { background: #5b6270; }
.fmt.done-flash { border-color: var(--ok); }
.fmt-caret { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-left: -2px; }
.fmt-wrap { position: relative; }
.fmt-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; }
.fmt-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; cursor: pointer; }
.fmt-menu button:hover:not(:disabled), .fmt-menu button:focus-visible { background: var(--surface-2); }
.fmt-menu button:disabled { opacity: .5; cursor: not-allowed; }
.fmt-menu b { display: block; font-size: 14.5px; }
.fmt-menu small { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .r-export { padding: 12px 16px; }
  .r-export-label { width: 100%; }
  .r-export > .fmt, .r-export > .fmt-wrap { flex: 1 1 calc(50% - 8px); }
  .fmt-wrap .fmt { width: 100%; }
  .fmt { padding-right: 10px; }
  .fmt-menu { width: min(280px, calc(100vw - 48px)); }
}
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.working { background: var(--brand-soft); color: var(--brand); }
.pill.working::before { animation: pulse 1s ease-in-out infinite; }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.error { background: var(--err-soft); color: var(--err); }
@keyframes pulse { 50% { opacity: .25; } }
.r-alert { margin: 16px 20px 0; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14.5px; background: var(--warn-soft); color: var(--warn); }
.r-alert.error { background: var(--err-soft); color: var(--err); }
.r-body { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 20px; }
.r-body.with-preview { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.r-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; place-items: center; align-self: start; position: sticky; top: 80px; }
.r-preview img { max-height: 560px; width: auto; border-radius: 4px; box-shadow: var(--shadow-sm); }
.r-pages { display: grid; gap: 14px; min-width: 0; }
.r-empty-wait { color: var(--muted); font-size: 15px; padding: 28px 0; text-align: center; }
.page { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.page-head .pl { font-weight: 700; font-size: 14px; }
.page-head .pm { font-size: 13px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.page-head .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.page textarea { display: block; width: 100%; min-height: 140px; max-height: 640px; border: 0; resize: vertical; padding: 14px 16px; background: var(--surface); color: var(--text); font: 400 16px/1.75 var(--font-text); }
.page textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-soft); }
.page .empty { padding: 16px; color: var(--muted); font-size: 14.5px; }
.page .perr { padding: 12px 16px; color: var(--err); font-size: 14.5px; }

/* ---------- sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.025em; }
.section-head p:not(.eyebrow) { color: var(--text-2); font-size: 18px; margin-top: 12px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.feature { background: var(--surface); padding: 32px 28px; }
.f-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.f-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 15.5px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--ink-text); font-weight: 700; margin-bottom: 16px; }
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { color: var(--text-2); font-size: 15.5px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.split h2 { margin-bottom: 14px; }
.muted-p { color: var(--text-2); }
.lang-cloud { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lang-cloud li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14.5px; font-weight: 500; }
.all-langs { margin-top: 18px; }
.all-langs summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 15px; }
.all-langs-list { list-style: none; margin: 14px 0 0; padding: 16px; columns: 3 150px; column-gap: 20px; font-size: 14px; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r); max-height: 320px; overflow: auto; background: var(--surface); }
.all-langs-list li { break-inside: avoid; padding: 2px 0; }
.formats { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15.5px; }
.formats th, .formats td { text-align: left; padding: 14px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.formats th { width: 38%; font-weight: 700; padding-right: 16px; }
.formats td { color: var(--text-2); }

.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 700; font-size: 16.5px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 18px; color: var(--text-2); }

.cta { background: var(--ink); color: var(--ink-text); padding: 64px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.cta p { color: #b8bcc6; margin-top: 8px; font-size: 17px; }

.footer { padding: 56px 0 28px; border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand p { color: var(--muted); margin-top: 12px; max-width: 320px; font-size: 15px; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: 15px; }
.footer-col a:hover { color: var(--brand); }
.footer-base { margin-top: 40px; font-size: 14px; color: var(--muted); }
.footer-base > span { display: block; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---------- responsive */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 48px; }
  .r-body.with-preview { grid-template-columns: 1fr; }
  .r-preview { position: static; }
  .r-preview img { max-height: 320px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 48px; }
  .tool-wrap { margin-top: 28px; }
  .tool { padding: 8px; }
  #stepReady { padding: 10px 8px 6px; }
  .drop { padding: 36px 16px 32px; }
  .modes, .more-grid, .feature-grid, .steps { grid-template-columns: 1fr; }
  .field-label .hint { display: block; margin: 2px 0 0; }
  .tool-actions .btn { flex: 1; }
  .section { padding: 64px 0; }
  .r-head { padding: 14px 16px; }
  .r-body { padding: 16px; }
  .r-actions { width: 100%; }
  .r-actions .btn { flex: 1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .formats th { width: 34%; }
}

/* ================================================================ auth & account */
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-links { margin-right: 0; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 14px; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatar-xl { width: 88px; height: 88px; font-size: 32px; margin: 0 auto 14px; }
.avatar-btn { border: 2px solid transparent; background: none; padding: 1px; border-radius: 50%; cursor: pointer; display: block; }
.avatar-btn:hover, .avatar-btn[aria-expanded=true] { border-color: var(--brand); }
.user-menu-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.um-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-id { min-width: 0; }
.um-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-email { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 15px; background: none; border: 0; cursor: pointer; text-align: left; }
.um-item:hover, .um-item:focus-visible { background: var(--surface-2); }
.um-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.um-item[data-signout] { border-top: 1px solid var(--border); border-radius: 0 0 var(--r-sm) var(--r-sm); margin-top: 6px; padding-top: 12px; }

/* modal */
.modal { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 28px 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-align: center; }
.modal::backdrop { background: rgba(10, 12, 16, .55); }
.modal-sm { width: min(400px, calc(100vw - 32px)); text-align: left; }
.modal h2 { font-size: 22px; font-weight: 800; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-mark { width: 44px; height: 44px; margin: 0 auto 16px; display: block; }
.modal-lead { color: var(--text-2); margin-top: 8px; font-size: 15.5px; }
.modal-benefits { list-style: none; padding: 0; margin: 20px 0 22px; display: grid; gap: 8px; text-align: left; }
.modal-benefits li { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--text-2); }
.modal-benefits svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-google { width: 100%; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 16px var(--font); cursor: pointer; }
.btn-google:hover { background: var(--surface-2); }
.btn-google:disabled { opacity: .6; cursor: progress; }
.btn-google svg { width: 20px; height: 20px; }
.modal-error { margin-top: 12px; color: var(--err); font-size: 14px; }
.modal-fine { margin-top: 18px; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* page views */
.page-view { padding: 48px 0 88px; min-height: calc(100vh - 320px); background: var(--bg-alt); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.view-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -0.025em; }
.view-head .eyebrow { margin-bottom: 6px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.panel h2 { font-size: 19px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.empty-panel { text-align: center; padding: 56px 24px; display: grid; justify-items: center; gap: 10px; }
.empty-panel p { color: var(--text-2); margin-bottom: 10px; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.account-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-main { display: grid; gap: 24px; min-width: 0; }
.profile-card { text-align: center; position: sticky; top: 88px; }
.profile-card h2 { font-size: 21px; }
.profile-card .muted { color: var(--muted); font-size: 14.5px; margin-top: 2px; word-break: break-all; }
.badge-google { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.badge-google svg { width: 16px; height: 16px; }
.profile-meta { margin: 20px 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 10px; text-align: left; }
.profile-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.profile-meta dt { color: var(--muted); }
.profile-meta dd { margin: 0; font-weight: 600; text-align: right; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; display: grid; gap: 2px; }
.stat-n { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.activity { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
.activity th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 12px 10px 0; border-bottom: 1px solid var(--border); }
.activity td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.activity tr:last-child td { border-bottom: 0; }
.activity .a-file { display: flex; align-items: center; gap: 10px; max-width: 280px; }
.activity .a-file span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.activity .ftype { width: 28px; height: 32px; font-size: 8.5px; }
.activity .muted { color: var(--muted); white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-dot.done { color: var(--ok); }
.status-dot.error { color: var(--err); }
.empty-inline { text-align: center; padding: 24px 0 8px; display: grid; justify-items: center; gap: 12px; color: var(--text-2); }
.fine { margin-top: 14px; font-size: 13px; color: var(--muted); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--border); }
.panel-head + .setting-row { border-top: 0; padding-top: 0; }
.setting-row h3 { font-size: 16px; }
.setting-row p { color: var(--text-2); font-size: 14.5px; margin-top: 2px; }

.legal h1 { font-size: clamp(30px, 4vw, 40px); font-weight: 800; margin-bottom: 6px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p { color: var(--text-2); margin-top: 8px; }
.legal .muted { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ink-text); padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); font-size: 15px; font-weight: 500; z-index: 100; max-width: calc(100vw - 32px); }

@media (max-width: 960px) {
  .account-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}
@media (max-width: 640px) {
  .nav-cta { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 16px 18px; }
  .setting-row { flex-direction: column; align-items: flex-start; }
  .panel { padding: 18px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .user-menu { width: min(280px, calc(100vw - 32px)); }
}

/* ================================================================ scanner entry points */
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: border-color .12s, background-color .12s; }
.scan-cta:hover { border-color: var(--brand); background: var(--brand-soft); }
.scan-cta-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.scan-cta-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scan-cta-text { flex: 1; min-width: 0; }
.scan-cta-text b { display: block; font-size: 16px; }
.scan-cta-text small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.scan-cta-arrow { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modes em.rec { color: var(--ok); border-color: var(--ok); }

/* ================================================================ scanner dialog (always dark, like a camera app) */
html:has(.scanner[open]) { overflow: hidden; }
.scanner { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0d0e11; color: #f1f2f4; }
.scanner[open] { display: flex; flex-direction: column; }
.scanner::backdrop { background: #0d0e11; }
.scanner.flash .sc-stage { animation: scflash .18s ease-out; }
@keyframes scflash { from { filter: brightness(2.2); } to { filter: none; } }
.sc-top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px; border-bottom: 1px solid #23262c; flex: none; }
.sc-title { flex: 1; font-weight: 700; font-size: 17px; }
.sc-count { font-size: 14px; color: #a3a8b3; }
.sc-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #f1f2f4; display: grid; place-items: center; cursor: pointer; }
.sc-icon:hover { background: #23262c; }
.sc-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sc-view[hidden] { display: none; }
.sc-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #000; }
.sc-stage video, .sc-stage > img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.sc-frame { position: absolute; inset: 8% 10%; pointer-events: none; }
.sc-frame i { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; opacity: .85; }
.sc-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.sc-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.sc-frame i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.sc-frame i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.sc-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); text-align: center; background: #1b1d22; border: 1px solid #2e3138; border-radius: 12px; padding: 18px; font-size: 15px; line-height: 1.5; color: #d6d9df; }
.sc-busy { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: #1b1d22; border: 1px solid #2e3138; border-radius: 999px; padding: 8px 16px; font-size: 14px; color: #d6d9df; }
.sc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #23262c; flex: none; flex-wrap: wrap; }
.sc-side { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.sc-right { justify-content: flex-end; }
.sc-tools { display: flex; gap: 4px; }
.sc-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #3a3e47; background: #1b1d22; color: #f1f2f4; font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap; }
.sc-pill:hover:not(:disabled) { background: #262930; }
.sc-pill:disabled { opacity: .45; cursor: not-allowed; }
.sc-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-primary { background: #4c8dff; border-color: #4c8dff; color: #0b1220; }
.sc-primary:hover:not(:disabled) { background: #6b9fff; }
.sc-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; cursor: pointer; flex: none; }
.sc-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.sc-shutter:active span { transform: scale(.88); }
.sc-shutter:disabled { opacity: .35; cursor: not-allowed; }
.sc-thumbs { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; flex: none; }
.sc-thumbs:empty { display: none; }
.sc-thumb { position: relative; width: 48px; height: 64px; border-radius: 6px; overflow: hidden; border: 2px solid #3a3e47; padding: 0; background: #000; cursor: pointer; flex: none; }
.sc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sc-thumb span { position: absolute; right: 2px; bottom: 2px; background: #4c8dff; color: #0b1220; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 0 4px; }

.sc-crop { padding: 28px; }
.sc-imgwrap { position: relative; display: inline-block; line-height: 0; touch-action: none; }
.sc-imgwrap img { max-width: calc(100vw - 56px); max-height: calc(100dvh - 56px - 160px); display: block; user-select: none; -webkit-user-drag: none; }
.sc-poly { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.sc-poly polygon { fill: rgba(76, 141, 255, .18); stroke: #4c8dff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sc-handle { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; border: 3px solid #4c8dff; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); cursor: grab; touch-action: none; }
.sc-handle.drag { cursor: grabbing; transform: scale(1.25); }
.sc-handle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sc-hint { text-align: center; color: #a3a8b3; font-size: 14px; padding: 8px 16px 0; flex: none; }
.sc-filters { display: flex; gap: 8px; justify-content: center; padding: 12px 16px 0; flex-wrap: wrap; flex: none; }
.sc-filters button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #3a3e47; background: #1b1d22; color: #d6d9df; font: 600 14px var(--font); cursor: pointer; }
.sc-filters button[aria-checked=true] { background: #f1f2f4; color: #0d0e11; border-color: #f1f2f4; }

.sc-finish-body { flex: 1; overflow: auto; padding: 24px 16px; width: 100%; max-width: 980px; margin: 0 auto; }
.sc-finish-body h2 { font-size: 24px; font-weight: 800; }
.sc-sub { color: #a3a8b3; margin-top: 4px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin: 20px 0; }
.sc-card { margin: 0; background: #1b1d22; border: 1px solid #2e3138; border-radius: 10px; padding: 8px; position: relative; }
.sc-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #000; border-radius: 6px; }
.sc-card figcaption { font-size: 13px; color: #a3a8b3; margin-top: 6px; }
.sc-card-tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 4px; }
.sc-mini { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(13, 14, 17, .8); color: #f1f2f4; display: grid; place-items: center; cursor: pointer; }
.sc-mini:disabled { opacity: .35; cursor: not-allowed; }
.sc-mini svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sc-name { display: grid; gap: 6px; max-width: 420px; font-size: 14px; color: #a3a8b3; font-weight: 600; }
.sc-name input { height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid #3a3e47; background: #1b1d22; color: #f1f2f4; font: inherit; }
.sc-name input:focus { outline: 2px solid #4c8dff; border-color: transparent; }
.sc-finish-bar { justify-content: flex-end; }

@media (max-width: 640px) {
  .sc-bar { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .sc-pill { padding: 0 12px; font-size: 14px; }
  .sc-side .sc-pill { flex: 1 1 auto; }
  .sc-crop { padding: 20px; }
  .sc-imgwrap img { max-width: calc(100vw - 40px); max-height: calc(100dvh - 56px - 190px); }
  .sc-finish-bar .sc-pill { flex: 1 1 40%; }
  .scan-cta-text small { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .sc-native { display: none; } /* "Camera app" only makes sense on phones */
}
