:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #eef0f5;
  --ink: #16181d;
  --ink-2: #5a6070;
  --ink-3: #868da0;
  --line: #dfe2ea;
  --accent: #2f4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #e8ecfd;
  --ok: #157a4a;
  --ok-soft: #e3f4eb;
  --err: #b3261e;
  --err-soft: #fcebea;
  --front: #2f4fd8;
  --back: #0d8a6a;
  --radius: 14px;
  --wrap-gutter: 20px;  /* full-width theme: only a gutter, no centred column */
  --shadow: 0 1px 2px rgba(16,18,29,.06), 0 8px 24px rgba(16,18,29,.07);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101218; --surface: #181b23; --surface-2: #20242e;
    --ink: #eef0f6; --ink-2: #a8afc0; --ink-3: #7b8296; --line: #2c313d;
    --accent: #8aa0ff; --accent-ink: #10131c; --accent-soft: #232a45;
    --ok: #5fd3a0; --ok-soft: #14301f; --err: #ff9b93; --err-soft: #3a1c1a;
    --front: #8aa0ff; --back: #5fd3a0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

:root[data-theme="dark"] {
  --bg: #101218; --surface: #181b23; --surface-2: #20242e;
  --ink: #eef0f6; --ink-2: #a8afc0; --ink-3: #7b8296; --line: #2c313d;
  --accent: #8aa0ff; --accent-ink: #10131c; --accent-soft: #232a45;
  --ok: #5fd3a0; --ok-soft: #14301f; --err: #ff9b93; --err-soft: #3a1c1a;
  --front: #8aa0ff; --back: #5fd3a0;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

/* Any element given a display value beats the [hidden] attribute's UA style,
   which silently reveals things meant to be hidden. Settle it once, here. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Full-width theme: content spans the viewport with a gutter, never a centred
   column. Line height is raised a little to keep long measures readable. */
.wrap { width: 100%; max-width: none; margin: 0; padding: 0 var(--wrap-gutter); }
@media (min-width: 720px)  { :root { --wrap-gutter: 48px; } }
@media (min-width: 1100px) { :root { --wrap-gutter: 88px; } }
@media (min-width: 1400px) { :root { --wrap-gutter: 112px; } }
@media (min-width: 1700px) { :root { --wrap-gutter: 140px; } }

/* ---- header ---- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; }
.brand-mark {
  width: 26px; height: 17px; border-radius: 3px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--back));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35);
}
.brand-name { font-size: 16px; }
.head-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.privacy-badge {
  margin: 0; display: inline-flex; align-items: center; gap: 7px;
  background: var(--ok-soft); color: var(--ok);
  font-size: 13px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
}

/* Header controls: theme, and who you are. */
.nav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  transition: border-color .15s, color .15s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* A sun that becomes a moon: one element, no icon font, no image request. */
.theme-ico {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  background: currentColor; position: relative;
  box-shadow: 0 0 0 2px transparent;
}
.theme-ico::after {
  content: ""; position: absolute; inset: -3px auto -3px -5px; width: 14px;
  border-radius: 50%; background: var(--surface);
  transform: scale(0); transform-origin: 30% 50%; transition: transform .18s;
}
#theme-btn[data-theme="dark"] .theme-ico::after { transform: scale(1); }
#theme-btn:hover .theme-ico::after { background: var(--surface); }

.nav-acct { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.acct-who {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Phones: ONE header row, so the tool starts near the top of the screen.
   The badge used to take a full-width row of its own, which pushed the
   buttons onto a second row too -- 136px of header at 375px wide. Here it
   shrinks to its green lock. The sentence is still there for screen readers
   (font-size 0 hides it visually only) and in the title tooltip, and the tool
   itself opens with "Nothing uploaded" right below. */
@media (max-width: 720px) {
  .head-inner { row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .head-nav { gap: 6px; flex-wrap: nowrap; }
  .privacy-badge { font-size: 0; gap: 0; padding: 6px 9px 5px; }
  .brand-name { font-size: 15px; }
  .acct-who { max-width: 110px; }
  #theme-label { display: none; }
  #theme-btn { padding: 6px 10px; }
  .nav-btn { padding: 6px 11px; }
}
/* Signed in on a phone: the email would force a second row. Sign out still
   shows, which is enough to tell you that you are signed in. */
@media (max-width: 520px) {
  .acct-who { display: none; }
}
/* 360px is the commonest Android width: 300px of room once the gutters are
   off, against 314px (signed out) and ~330px (signed in) at the sizes above.
   These trims buy the ~35px so it stays one row; below ~340px it may wrap to
   two rows, which is still half the old height. */
/* The language switch added one more item to the header. On the narrowest
   phones the brand shows as its mark alone; the words stay available to
   screen readers. Hindi labels are wider, so Hindi pages do this earlier. */
@media (max-width: 379px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 440px) {
  html[lang="hi"] .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 440px) {
  .head-inner { column-gap: 6px; }
  .brand { gap: 7px; }
  .brand-mark { width: 22px; height: 14px; }
  .brand-name { font-size: 14px; }
  .head-nav { gap: 4px; }
  .privacy-badge { padding: 6px 7px 5px; }
  .nav-btn { padding: 6px 9px; font-size: 13px; }
  #theme-btn { padding: 6px 8px; }
}
.lock {
  width: 11px; height: 13px; flex: none; border-radius: 2px;
  border: 1.7px solid currentColor; border-top: 0;
  position: relative; margin-top: 3px;
}
.lock::before {
  content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  width: 9px; height: 8px; border: 1.7px solid currentColor;
  border-bottom: 0; border-radius: 5px 5px 0 0;
}

/* ---- steps ---- */
.step { display: none; padding: 26px 0 40px; }
.step.is-active { display: block; animation: rise .22s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .step.is-active { animation: none; } }

.step-title { font-size: 25px; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 6px; }
.step-sub { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; }

.back-link {
  background: none; border: 0; padding: 4px 0; margin: 0 0 12px;
  color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer;
}
.back-link:hover { color: var(--accent); }

/* ---- document type tiles ---- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 620px) {
  .type-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
}

.type-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 16px 14px; cursor: pointer;
  text-align: left; font: inherit; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.type-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.type-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tt-art { width: 44px; height: 28px; border-radius: 4px; flex: none; position: relative; overflow: hidden; }
.tt-art::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); border-radius: 4px;
}
.tt-name { font-weight: 650; font-size: 15.5px; line-height: 1.2; }
.tt-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.tt-flag {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-2); background: var(--surface-2);
  border-radius: 999px; padding: 1px 7px;
}

.more-toggle {
  display: block; margin: 18px auto 0; padding: 10px 20px;
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1.5px solid var(--line); border-radius: 999px;
}
.more-toggle:hover { border-color: var(--accent); color: var(--accent); }
.group-title {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); margin: 26px 0 10px;
}

/* ---- state selector ---- */
.state-block {
  margin-bottom: 18px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.state-label { display: block; font-weight: 650; margin-bottom: 4px; }
.state-why { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.state-select {
  width: 100%; padding: 11px 13px; font: inherit;
  background: var(--bg); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px;
}
.state-select:focus { outline: none; border-color: var(--accent); }

.dropzone.is-locked {
  cursor: not-allowed; opacity: .6;
  border-style: solid; background: var(--surface-2);
}
.dropzone.is-locked:hover { border-color: var(--line); background: var(--surface-2); }

/* ---- dropzone ---- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-height: 240px; padding: 34px 18px; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line);
  border-radius: var(--radius); text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.dz-icon {
  width: 42px; height: 42px; margin-bottom: 4px; border-radius: 9px;
  background: var(--accent-soft); position: relative; flex: none;
}
.dz-icon::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 11px solid var(--accent); transform: translateY(-3px);
}
.dz-icon::after {
  content: ""; position: absolute; left: 50%; bottom: 11px; transform: translateX(-50%);
  width: 18px; height: 2.5px; border-radius: 2px; background: var(--accent);
}
.dz-main { font-weight: 650; font-size: 16px; }
.dz-sub { font-size: 13.5px; color: var(--ink-3); }

/* ---- password ---- */
.pw-block {
  margin-top: 18px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.pw-label { display: block; font-weight: 650; margin-bottom: 4px; }
/* The file name can be long and has no spaces to break at, so let it wrap
   anywhere rather than push the panel wider than the phone. */
.pw-file {
  margin: 0 0 8px; font-size: 13px; color: var(--ink-2);
  overflow-wrap: anywhere;
}
.pw-file strong { font-weight: 650; color: var(--ink); }
.pw-file[hidden] { display: none; }
.pw-hint { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.pw-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-input {
  flex: 1 1 190px; min-width: 0; padding: 11px 13px; font: inherit;
  background: var(--bg); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px;
}
.pw-input:focus { outline: none; border-color: var(--accent); }

/* ---- buttons ---- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px;
  padding: 11px 18px; border: 1.5px solid transparent;
  transition: filter .15s, border-color .15s;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 24px; font-size: 16.5px; }
.btn[disabled] { opacity: .5; cursor: default; filter: none; }

/* ---- busy ---- */
.busy { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 0; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy-text { margin: 0; color: var(--ink-2); }

/* ---- results ---- */
.cards { display: grid; gap: 20px; margin-bottom: 24px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }

.card-out {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.card-out h3 {
  margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
}
.card-out.is-front h3 { color: var(--front); }
.card-out.is-back h3 { color: var(--back); }
.card-out canvas, .card-out img {
  display: block; width: 100%; height: auto; border-radius: 7px;
  background: #fff; box-shadow: 0 0 0 1px var(--line);
}
.card-out .card-dl {
  display: block; width: 100%; margin-top: 11px; text-align: center;
  background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 9px; padding: 9px; font: inherit; font-weight: 600;
  font-size: 14.5px; cursor: pointer;
}
.card-out .card-dl:hover { border-color: var(--accent); color: var(--accent); }
.card-missing { color: var(--ink-3); font-size: 14px; padding: 22px 0; text-align: center; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- options ---- */
.opts { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
.opts summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.opts-body { display: grid; gap: 16px; padding: 16px 0 4px; }
.opt { display: grid; gap: 6px; font-size: 14.5px; font-weight: 600; }
.opt select {
  font: inherit; font-weight: 500; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.opt-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.opt-check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.opt-check em { display: block; font-style: normal; font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ---- adjust stage ---- */
.adjust-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 0; background: none; color: var(--ink-2); padding: 7px 16px; border-radius: 8px;
}
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pagepick { font-size: 14px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.pagepick select {
  font: inherit; font-weight: 500; padding: 7px 10px; border-radius: 8px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}

.viewport {
  max-width: 100%; height: 62vh; min-height: 340px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10px;
}
.stage {
  position: relative; flex: none;
  background: #fff; box-shadow: 0 0 0 1px var(--line);
  touch-action: none;
}
/* The stage is sized in pixels by the zoom control; the canvas fills it. Crop
   boxes are positioned in percentages, so they follow at any magnification. */
.stage canvas { display: block; width: 100%; height: 100%; }

#step-adjust .step-title { font-size: 21px; }
#step-adjust .step-sub { margin-bottom: 16px; font-size: 14px; }

.adjust-layout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) {
  /* Preview takes the room; controls sit in a fixed column beside it. */
  .adjust-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

.adjust-side { display: flex; flex-direction: column; gap: 18px; }
.side-group { display: flex; flex-direction: column; gap: 9px; }
.side-title {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3);
}
.side-hint { margin: 0; font-size: 12px; color: var(--ink-3); }

@media (min-width: 900px) {
  .adjust-side .seg, .adjust-side .zoomctl { width: 100%; }
  .adjust-side .seg-btn { flex: 1; }
  .adjust-side .actions { flex-direction: column; align-items: stretch; }
  .adjust-side .actions .btn { width: 100%; }
}

/* On narrow screens the controls stack under the preview, and the buttons ride
   the bottom of the viewport so Apply is always reachable. */
@media (max-width: 899px) {
  #step-adjust .actions {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line);
  }
}

.cropbox {
  position: absolute; border: 2px solid var(--front);
  background: rgba(47, 79, 216, .12);
  cursor: move; touch-action: none;
}
.cropbox[data-side="back"] { border-color: var(--back); background: rgba(13, 138, 106, .12); }
.cropbox.is-dim { opacity: .4; }
.cropbox[hidden] { display: none; }
.cb-tag {
  position: absolute; top: -1px; left: -1px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: #fff;
  background: var(--front); padding: 2px 7px; border-radius: 0 0 6px 0;
}
.cropbox[data-side="back"] .cb-tag { background: var(--back); }
.cb-handle {
  position: absolute; right: -9px; bottom: -9px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--front); border: 2.5px solid var(--surface);
  cursor: nwse-resize; touch-action: none;
}
.cropbox[data-side="back"] .cb-handle { background: var(--back); }

/* ---- messages ---- */
.err {
  margin: 14px 0 0; padding: 11px 14px; border-radius: 10px;
  background: var(--err-soft); color: var(--err); font-size: 14.5px; font-weight: 500;
}
.note {
  margin: 0 0 18px; padding: 11px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--ink-2); font-size: 14px;
}

/* ---- footer ---- */
.site-foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 22px 0 34px; margin-top: 20px;
  font-size: 13.5px; color: var(--ink-2);
}
.site-foot p { margin: 0 0 7px; }
.site-foot .fine { color: var(--ink-3); font-size: 12.5px; }

/* ---- learning note + other ask ---- */
.learn-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); font-size: 13px; color: var(--ink-2);
}
.learn-note p { margin: 0; flex: 1 1 260px; }
.learn-off {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: none; border: 0; padding: 4px 0; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 2px;
}
.learn-off:hover { color: var(--accent); }

.oa-why { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.oa-why em { font-style: normal; }
.oa-thanks { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ok); }

.other-ask {
  margin-top: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.other-ask label { display: block; font-weight: 650; font-size: 14px; margin-bottom: 8px; }
.other-ask em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.other-ask select {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}

/* ---- zoom bar ---- */
.zoomctl {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 3px;
}
.zoomctl button {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  min-width: 34px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px;
  background: none; color: var(--ink);
}
.zoomctl button:hover { background: var(--surface-2); color: var(--accent); }
.zoomctl #zoom-fit { font-size: 13px; font-weight: 600; }
#zoom-level {
  flex: 1; min-width: 52px; text-align: center; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
/* ---- crop shape picker ---- */
.modelist { display: flex; flex-direction: column; gap: 2px; }
.modeopt {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.modeopt:hover { background: var(--surface-2); }
.modeopt input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.modeopt:has(input:checked) { background: var(--accent-soft); font-weight: 600; }
.modeopt em { display: block; font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.modeopt.sub { margin-left: 22px; font-size: 12.5px; }
.modeopt.sub[hidden] { display: none; }
.btn-sm { font-size: 12.5px; padding: 7px 12px; margin-top: 8px; width: 100%; }

/* ---- resize handles ---- */
.cb-h {
  position: absolute; width: 14px; height: 14px; background: var(--front);
  border: 2px solid var(--surface); border-radius: 3px; touch-action: none;
}
.cropbox[data-side="back"] .cb-h { background: var(--back); }
.cb-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.cb-n  { left: 50%; top: -7px; margin-left: -7px; cursor: ns-resize; }
.cb-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.cb-w  { left: -7px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.cb-e  { right: -7px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.cb-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.cb-s  { left: 50%; bottom: -7px; margin-left: -7px; cursor: ns-resize; }
.cb-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
/* With the shape locked, the pure vertical handles would only fight the lock. */
.stage.locked .cb-n, .stage.locked .cb-s { display: none; }
/* A free rectangle is not the card's shape, so it says so rather than implying it. */
.cropbox.is-free { border-style: dashed; }

/* ---- perspective (quad) selection ---- */
.cb-quadlayer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.cb-quad {
  pointer-events: auto; cursor: move; touch-action: none;
  fill: rgba(47, 79, 216, .12); stroke: var(--front); stroke-width: 2;
  stroke-dasharray: 7 4;
}
.cb-quad[data-side="back"] { fill: rgba(13, 138, 106, .12); stroke: var(--back); }
.cb-quad.is-dim { opacity: .4; }
.cb-c {
  position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: var(--front); border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  cursor: grab; touch-action: none; z-index: 3;
}
.cb-c[data-side="back"] { background: var(--back); }
.cb-c.is-dim { opacity: .4; }
.cb-c[hidden] { display: none; }

/* ---- universal "crop any PDF" call to action ---- */
.universal-cta {
  display: flex; align-items: center; gap: 16px; width: 100%;
  margin: 0; padding: 18px 20px; cursor: pointer; text-align: left;
  font: inherit; color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 62%, var(--back)));
  border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s, filter .15s;
}
.universal-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
.universal-cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.uc-mark {
  width: 46px; height: 30px; flex: none; border-radius: 5px; position: relative;
  background: rgba(255, 255, 255, .22);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5);
}
.uc-mark::before {
  content: ""; position: absolute; left: 6px; top: 7px;
  width: 12px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, .75);
}
.uc-mark::after {
  content: ""; position: absolute; left: 23px; top: 10px;
  width: 16px; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .75);
  box-shadow: 0 6px 0 rgba(255, 255, 255, .55);
}

.uc-body { flex: 1; min-width: 0; }
.uc-body strong { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.uc-body em {
  display: block; font-style: normal; font-size: 13.5px; line-height: 1.45;
  opacity: .88; margin-top: 3px;
}
.uc-go {
  flex: none; font-weight: 700; font-size: 14.5px; padding: 9px 18px;
  border-radius: 999px; background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45);
}
@media (max-width: 560px) {
  .universal-cta { flex-wrap: wrap; gap: 12px; padding: 16px 18px; }
  .uc-go { width: 100%; text-align: center; }
}

/* --- one file or many ------------------------------------------------- */
/* Stacked, not side by side. These live in the hero's text column, which is
   around 690px even on a 1700px screen, and two cards in it left the copy
   wrapping to four lines each. The two are also deliberately not the same
   weight: one file is what almost everyone wants, so batch is the outlined
   card rather than a second filled one competing with it. */
.mode-choice { display: grid; gap: 12px; }

.universal-cta.is-batch {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow);
}
.universal-cta.is-batch:hover { border-color: var(--accent); }
.universal-cta.is-batch .uc-mark { background: var(--accent-soft); }
.universal-cta.is-batch .uc-mark::before,
.universal-cta.is-batch .uc-mark::after { background: var(--accent); }
.universal-cta.is-batch .uc-go {
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent);
}
/* A second card peeking out behind the first: "more than one". */
.uc-mark-many {
  box-shadow:
    inset 0 0 0 1.5px var(--accent),
    5px -5px 0 -1px var(--surface),
    5px -5px 0 0 var(--accent);
}

/* The cross-sell under the single-file dropzone. */
.cross-sell {
  margin: 22px 0 0; padding: 18px 20px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface);
}
.cs-head { margin: 0 0 14px; font-size: 15.5px; font-weight: 650; }
/* The limit, above the chooser, in one line. It was a four-item panel and that
   pushed the dropzone down the page — the notice is worth making, but not at
   the cost of the thing the visitor came to do. The detail lives below. */
.cs-note {
  margin: 0 0 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
}
.cs-note b { color: var(--ink); font-weight: 600; }
.cs-note .linkish { margin-left: 2px; }

/* Side by side below the chooser, so the cost is read against what replaces it.
   Stacked below 760px, drawbacks first. */
.cs-cols { display: grid; gap: 14px; margin-bottom: 16px; }
@media (min-width: 760px) { .cs-cols { grid-template-columns: 1fr 1fr; gap: 22px; } }

.cs-col { padding: 14px 16px; border-radius: var(--radius); }
.cs-col-cons { background: var(--surface-2); }
.cs-col-pros { background: var(--accent-soft); }
.cs-col-head {
  margin: 0 0 11px; font-size: 12px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2);
}
.cs-col-pros .cs-col-head { color: var(--accent); }

.cs-cons, .cs-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.cs-cons li, .cs-list li { position: relative; padding-left: 22px; }
.cs-cons li b, .cs-list li b { color: var(--ink); font-weight: 650; }

/* A drawn minus for what you lose, a drawn tick for what you gain. No icon
   font and no image request for either. */
.cs-cons li::before {
  content: ""; position: absolute; left: 1px; top: 8px;
  width: 11px; height: 2px; border-radius: 1px; background: var(--ink-3);
}
.cs-list { gap: 7px; }
.cs-list li::before {
  content: ""; position: absolute; left: 4px; top: 6px;
  width: 4px; height: 8px; border: solid var(--accent);
  border-width: 0 2px 2px 0; transform: rotate(43deg);
}
.linkish {
  border: 0; background: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
}

/* --- the batch run ---------------------------------------------------- */
.batch-progress { margin: 18px 0 6px; }
.bp-bar {
  height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
.bp-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width .25s ease;
}
.bp-text { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }

.batch-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.batch-row {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 14px 16px;
}
.batch-row.is-working { border-color: var(--accent); }
.batch-row.is-locked  { border-color: #d9a520; }
.batch-row.is-failed  { border-color: #c2412c; }

.br-head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.br-name {
  font-weight: 600; font-size: 14.5px; min-width: 0;
  overflow-wrap: anywhere;
}
.br-status { flex: none; font-size: 12.5px; color: var(--ink-2); }
.batch-row.is-done   .br-status { color: #1c7a4a; }
.batch-row.is-locked .br-status { color: #9a7210; }
.batch-row.is-failed .br-status { color: #c2412c; }
.br-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }

.br-thumbs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.br-thumb { display: grid; gap: 5px; justify-items: center; }
.br-thumb canvas {
  display: block; width: 190px; max-width: 42vw; height: auto;
  border-radius: 4px; box-shadow: var(--shadow);
}
.br-side { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }

.br-pw { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.br-pw .pw-input { flex: 1; min-width: 180px; }
.br-tools { margin-top: 12px; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }

/* --- account and the paid gate ---------------------------------------- */
.account-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); font-size: 13.5px;
}
.ab-who { font-weight: 600; overflow-wrap: anywhere; }
.ab-plan { color: var(--ink-2); }
.account-bar .linkish { margin-left: auto; }

/* Two columns: what the plan is for, and the form. The reasons come first
   because a form on its own asks for an email and gives nothing back. */
.gate { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) { .gate { grid-template-columns: 1.15fr .85fr; gap: 34px; } }

.gate-eyebrow {
  margin: 0 0 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--accent);
}
.gate-head {
  margin: 0 0 10px; font-size: 24px; line-height: 1.2; letter-spacing: -.02em;
}
.gate-for { margin: -4px 0 14px; font-size: 14.5px; color: var(--ink-2); }
.gate-refund { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.gate-refund a { color: inherit; text-decoration: underline; }
.gate-price {
  margin: 0 0 18px; font-size: 27px; font-weight: 800;
  letter-spacing: -.02em; color: var(--ink);
}

.gate-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.gate-benefits li {
  position: relative; padding-left: 32px; font-size: 13.5px;
  line-height: 1.55; color: var(--ink-2);
}
.gate-benefits li b {
  display: block; font-size: 14.5px; color: var(--ink);
  font-weight: 650; margin-bottom: 2px;
}
.gate-benefits li em { font-style: normal; font-family: var(--mono, ui-monospace, monospace); }
/* A drawn tick, so the list needs no icon font and no image request. */
.gate-benefits li::before {
  content: ""; position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft);
}
.gate-benefits li::after {
  content: ""; position: absolute; left: 6.5px; top: 6px;
  width: 4.5px; height: 9px; border: solid var(--accent);
  border-width: 0 2px 2px 0; transform: rotate(43deg);
}

.gate-free {
  margin: 20px 0 0; padding: 12px 14px; font-size: 13.5px; line-height: 1.5;
  color: var(--ink-2); border-radius: var(--radius);
  background: var(--surface-2); border: 1px dashed var(--line);
}

.gate-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px; box-shadow: var(--shadow);
}
.gate-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.gate-upgrade-head { margin: 0 0 4px; font-size: 15px; font-weight: 600; }

/* Account screen: days left, the plan picker and the buyer's own payments. */
.plan-now { display: flex; align-items: center; gap: 16px; }
.plan-days {
  flex: none; display: grid; place-items: center; min-width: 84px; padding: 10px 12px;
  border-radius: 12px; background: var(--ok-soft); color: var(--ok); text-align: center;
}
.plan-days-n { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.plan-days-l { margin-top: 4px; font-size: 12px; font-weight: 600; }
.plan-days.is-low { background: #fdf3dc; color: #8a5a00; }
.plan-state { margin: 0; font-size: 16px; font-weight: 700; }
.plan-until { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.plan-bar { margin: 14px 0 0; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.plan-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.plan-bar.is-low span { background: #d9a520; }
.plan-open { width: 100%; margin-top: 16px; }
.plan-usage { margin-top: 18px; }
.pu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pu-box { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.pu-box[hidden] { display: none; }
.pu-l { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pu-n { font-size: 26px; line-height: 1.1; font-weight: 800; }
.pu-s { font-size: 12.5px; color: var(--ink-2); }
.plan-pick { scroll-margin-top: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.plan-pick-head { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.plan-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.plan-opt {
  position: relative; display: grid; align-content: start; gap: 2px; padding: 12px 12px 10px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface);
}
.plan-opt:hover { border-color: var(--accent); }
.plan-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.po-len { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.po-price { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.po-per { font-size: 12px; color: var(--ink-3); }
.po-save {
  justify-self: start; margin-top: 4px; padding: 2px 7px; border-radius: 99px;
  background: var(--ok-soft); color: var(--ok); font-size: 11.5px; font-weight: 700;
}
.plan-total { margin: 14px 0 0; font-size: 14px; line-height: 1.5; }
.plan-buy { display: flex; justify-content: center; width: 100%; margin-top: 12px; text-decoration: none; }
.plan-history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-pays { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.plan-pays li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.plan-pays li:last-child { border-bottom: 0; }
.pp-date { flex: none; width: 92px; color: var(--ink-3); }
.pp-what { flex: 1; color: var(--ink-2); }
.pp-amt { flex: none; }
/* Plan status card at the top of the batch page. */
.batch-status {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 4px solid var(--ok); background: var(--surface);
}
.batch-status[hidden] { display: none; }
.bs-days {
  display: grid; place-items: center; min-width: 70px; padding: 8px 10px;
  border-radius: 10px; background: var(--ok-soft); color: var(--ok); text-align: center;
}
.bs-days[hidden] { display: none; }
.bs-days-n { font-size: 26px; line-height: 1; font-weight: 800; }
.bs-days-l { margin-top: 3px; font-size: 11.5px; font-weight: 600; }
.bs-state { margin: 0; font-size: 15px; font-weight: 700; }
.bs-sub { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.bs-usage { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.bs-usage[hidden] { display: none; }
.bs-bar { margin-top: 10px; max-width: 420px; height: 6px; }
.bs-acts { display: grid; gap: 6px; justify-items: end; }
.bs-more { padding: 8px 14px; font-size: 14px; }
.bs-acct { font-size: 13px; }
.batch-status.is-low { border-left-color: #d9a520; }
.batch-status.is-low .bs-days { background: #fdf3dc; color: #8a5a00; }
.batch-status.is-free { border-left-color: var(--accent); }
@media (max-width: 600px) {
  .batch-status { grid-template-columns: auto 1fr; gap: 12px; }
  .bs-acts { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
  .bs-acct { justify-self: end; }
}
button.acct-who { border: 0; background: none; padding: 0; cursor: pointer; font-family: inherit; }
button.acct-who:hover { color: var(--accent); text-decoration: underline; }
.gate-seg { margin: 0 0 18px; display: flex; }
.gate-seg .seg-btn { flex: 1; }
.gate-label {
  display: block; margin: 0 0 5px; font-size: 12.5px;
  font-weight: 600; color: var(--ink-2);
}
#auth-form .pw-input { width: 100%; margin-bottom: 14px; }
#auth-form .btn { width: 100%; padding: 12px; font-size: 15px; }

.cool-time { font-size: 17px; font-weight: 600; margin: 0 0 18px; }

/* ---- free-limit screen: the wait, then what batch does ---- */
.cool { display: grid; gap: 22px; }
.cool-wait {
  display: flex; gap: 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
.cool-wait .step-title { margin-top: 0; }
.cool-wait .step-title { margin-bottom: 6px; }
.cool-wait .cool-time { margin: 10px 0 12px; font-size: 15px; color: var(--ok); }
.cool-wait .cool-time:empty { display: none; }
.cool-ring { position: relative; width: 116px; height: 116px; flex: none; }
.cool-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cool-track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.cool-arc {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .3s;
}
.cool-ring.is-done .cool-arc { stroke: var(--ok); }
.cool-clock {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 24px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
@media (max-width: 560px) {
  .cool-wait { flex-direction: column; text-align: center; padding: 18px 16px; }
  .cool-ring { width: 104px; height: 104px; }
}

.cool-line { margin: 0 0 4px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.cool-small { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }

.cool-pitch {
  border: 1.5px solid var(--accent); border-radius: var(--radius);
  background: var(--accent-soft, var(--surface)); padding: 22px;
}
@media (max-width: 560px) { .cool-pitch { padding: 18px 16px; } }
.cool-head { font-size: 22px; line-height: 1.25; letter-spacing: -.015em; margin: 4px 0 16px; }

/* The picture: free = one PDF, one card, a pause; batch = a stack into a ZIP. */
.cool-compare { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 620px) { .cool-compare { grid-template-columns: 1fr 1fr; } }
.cc-side {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.cc-paid { border-color: var(--accent); }
.cc-label {
  margin: 0 0 10px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
}
.cc-paid .cc-label { color: var(--accent); }
.cc-flow { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.cc-pdf {
  width: 34px; height: 44px; border-radius: 4px; flex: none;
  background: var(--surface); border: 1.5px solid var(--ink-3);
  font-size: 9px; font-weight: 700; color: var(--ink-3);
  display: grid; place-items: end center; padding-bottom: 5px;
}
.cc-stack { position: relative; width: 50px; height: 56px; flex: none; }
.cc-stack .cc-pdf { position: absolute; }
.cc-stack .cc-pdf:nth-child(1) { left: 0; top: 0; }
.cc-stack .cc-pdf:nth-child(2) { left: 7px; top: 5px; }
.cc-stack .cc-pdf:nth-child(3) { left: 14px; top: 10px; border-color: var(--accent); color: var(--accent); }
.cc-arrow {
  width: 26px; height: 2px; background: var(--ink-3); position: relative; flex: none;
}
.cc-arrow::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border: 5px solid transparent; border-left: 7px solid var(--ink-3); border-right: 0;
}
.cc-paid .cc-arrow, .cc-paid .cc-arrow::after { background: var(--accent); }
.cc-paid .cc-arrow::after { background: none; border-left-color: var(--accent); }
.cc-card {
  width: 48px; height: 30px; border-radius: 4px; flex: none;
  background: linear-gradient(135deg, var(--front), var(--back));
}
.cc-pause { display: inline-flex; gap: 4px; margin-left: 4px; }
.cc-pause i { width: 5px; height: 18px; border-radius: 2px; background: var(--err, #c0392b); }
.cc-zip {
  width: 44px; height: 50px; border-radius: 6px; flex: none;
  background: var(--accent); color: var(--accent-ink, #fff);
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  background-image: repeating-linear-gradient(180deg, transparent 0 5px, rgba(255,255,255,.35) 5px 7px);
  background-size: 6px 60%; background-repeat: no-repeat; background-position: center 4px;
}
.cc-cap { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }

.cool-features {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: grid; gap: 12px 20px;
}
@media (min-width: 620px) { .cool-features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cool-features { grid-template-columns: 1fr 1fr 1fr; } }
.cool-features li {
  position: relative; padding-left: 38px;
  font-size: 14px; color: var(--ink-2); line-height: 1.45;
}
.cool-features b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.cf-ico {
  position: absolute; left: 0; top: 1px; width: 28px; height: 28px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
}
.cf-ico::before, .cf-ico::after { content: ""; position: absolute; }
/* stack */
.cf-stack::before { left: 7px; top: 6px; width: 10px; height: 13px; border: 1.6px solid var(--accent); border-radius: 2px; }
.cf-stack::after  { left: 11px; top: 9px; width: 10px; height: 13px; border: 1.6px solid var(--accent); border-radius: 2px; background: var(--surface); }
/* clock */
.cf-clock::before { left: 6px; top: 6px; width: 16px; height: 16px; border: 1.6px solid var(--accent); border-radius: 50%; box-sizing: border-box; }
.cf-clock::after  { left: 13px; top: 9px; width: 5px; height: 6px; border-left: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent); }
/* name tag */
.cf-name::before { left: 6px; top: 9px; width: 16px; height: 10px; border: 1.6px solid var(--accent); border-radius: 2px; box-sizing: border-box; }
.cf-name::after  { left: 9px; top: 13px; width: 9px; height: 1.6px; background: var(--accent); }
/* fix: a crop corner */
.cf-fix::before { left: 7px; top: 7px; width: 12px; height: 12px; border-left: 1.8px solid var(--accent); border-top: 1.8px solid var(--accent); }
.cf-fix::after  { left: 11px; top: 11px; width: 10px; height: 10px; border-right: 1.8px solid var(--accent); border-bottom: 1.8px solid var(--accent); }
/* lock */
.cf-lock::before { left: 8px; top: 12px; width: 12px; height: 9px; border: 1.6px solid var(--accent); border-radius: 2px; box-sizing: border-box; }
.cf-lock::after  { left: 10px; top: 6px; width: 8px; height: 8px; border: 1.6px solid var(--accent); border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; }
/* safe: a check */
.cf-safe::before { left: 9px; top: 6px; width: 7px; height: 12px; border-right: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(40deg); }

.cool-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cool-price { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.cool-note { margin: 0; flex-basis: 100%; font-size: 13.5px; color: var(--ink-3); }
@media (max-width: 560px) { .cool-cta .btn { width: 100%; } }

.picker-hint {
  margin: 0 0 12px; font-size: 13.5px; color: var(--ink-3);
}

/* ================================ hero ================================== */
.hero {
  display: grid; gap: 34px; align-items: center;
  padding: 10px 0 34px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); gap: 56px; padding: 26px 0 40px; }
}

.hero-eyebrow {
  margin: 0 0 12px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.hero-title {
  margin: 0 0 14px; font-size: 44px; line-height: 1.08;
  letter-spacing: -.03em; font-weight: 700;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), var(--back));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 900px) { .hero-title { font-size: 34px; } }
@media (max-width: 480px) { .hero-title { font-size: 28px; } }

.hero-sub {
  margin: 0 0 24px; font-size: 16.5px; line-height: 1.6; color: var(--ink-2);
}

.hero-points {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: grid; gap: 12px;
}
@media (min-width: 620px) { .hero-points { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.hero-points li {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.4;
}
.hero-points b { font-size: 14px; color: var(--ink); font-weight: 650; }
.hp-ico {
  width: 26px; height: 26px; border-radius: 7px; margin-bottom: 5px;
  background: var(--accent-soft); position: relative; flex: none;
}
.hp-lock::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 10px; border: 1.6px solid var(--accent);
  border-radius: 1.5px; margin-top: 12px;
}
.hp-lock::after {
  content: ""; position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
  width: 7px; height: 6px; border: 1.6px solid var(--accent);
  border-bottom: 0; border-radius: 4px 4px 0 0;
}
.hp-size::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 14px; height: 9px; border: 1.6px solid var(--accent); border-radius: 2px;
}
.hp-side::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 11px; height: 8px; border: 1.6px solid var(--accent); border-radius: 2px;
  transform: translate(-3px, -2px);
}
.hp-side::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 11px; height: 8px; border: 1.6px solid var(--accent); border-radius: 2px;
  background: var(--surface); transform: translate(3px, 2px);
}

/* ---- the explanatory diagram ---- */
.hero-art { width: 100%; }
.hero-art svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 899px) { .hero-art { max-width: 460px; margin: 0 auto; } }

.ha-page  { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.ha-card  { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.ha-card-src { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.ha-line  { fill: var(--ink-3); opacity: .55; }
.ha-faint { opacity: .28; }
.ha-photo { fill: var(--ink-3); opacity: .3; }
.ha-qr    { fill: var(--ink); opacity: .72; }
.ha-perf  { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }

.ha-card-band { fill: var(--accent); opacity: .85; }
.ha-front { fill: var(--front); opacity: 1; }
.ha-back  { fill: var(--back); opacity: 1; }
.ha-tag {
  fill: #fff; font-size: 9px; font-weight: 700; letter-spacing: .09em;
  font-family: inherit;
}

/* The crop selection, drawn the way it looks in the real editor. */
.ha-sel {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
  stroke: var(--accent); stroke-width: 2;
}
.ha-handle rect { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }

.ha-arrow { stroke: var(--ink-3); stroke-width: 2; opacity: .5; }
.ha-arrow-head { fill: var(--ink-3); opacity: .5; }

.ha-dim { stroke: var(--ink-3); stroke-width: 1.2; opacity: .55; }
.ha-dim-label {
  fill: var(--ink-3); font-size: 11px; font-weight: 600;
  text-anchor: middle; font-family: inherit;
}

/* The outputs lift off the page slightly, so the diagram reads as a result. */
.ha-out { filter: drop-shadow(0 4px 10px rgba(16, 18, 29, .1)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ha-out { filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5)); }
}

/* Each face on the page is selected in the colour of the card it becomes, so
   the eye pairs front with front and back with back without needing a label. */
.ha-sel-back {
  fill: color-mix(in srgb, var(--back) 12%, transparent);
  stroke: var(--back);
}
.ha-handle-back rect { fill: var(--back); }
.ha-arrow-back { stroke: var(--back); opacity: .75; }
.ha-arrow-head-back { fill: var(--back); opacity: .75; }
.ha-arrow { fill: none; }

/* Colour the front arrow to its card as well, so both faces read as a pair. */
.ha-arrow-front { stroke: var(--front); opacity: .75; }
.ha-arrow-head-front { fill: var(--front); opacity: .75; }

/* ---- the diagram as two short animations: one PDF, then many ----
   Every animation below runs only under .is-playing (added by initHeroArt
   in app.js), and every element's resting style is its FINAL state. So with
   no JS, before JS, or with reduced motion, each scene is a finished still. */
.hero-art[data-scene="single"] .ha-batch,
.hero-art[data-scene="batch"]  .ha-single { display: none; }

.hero-art svg g, .hero-art svg rect, .hero-art svg path, .hero-art svg text {
  transform-box: fill-box; transform-origin: center;
}

/* Scene 1 — one PDF */
.hs-scan { fill: var(--accent); opacity: 0; }
.hs-draw { stroke-dasharray: 100; stroke-dashoffset: 0; }
.hero-art svg .hs-out { transform-origin: left center; }   /* beats the svg-wide centre origin */

.is-playing .hs-page   { animation: ha-rise .45s ease-out both; }
.is-playing .hs-scan   { animation: ha-scan 1.3s .45s ease-in-out both; }
.is-playing .hs-sel-f  { animation: ha-pop .35s 1.75s ease-out both; }
.is-playing .hs-sel-b  { animation: ha-pop .35s 2s ease-out both; }
.is-playing .hs-draw-f { animation: ha-draw .5s 2.4s ease-out both; }
.is-playing .hs-draw-b { animation: ha-draw .5s 2.55s ease-out both; }
.is-playing .hs-head-f { animation: ha-fade .2s 2.85s both; }
.is-playing .hs-head-b { animation: ha-fade .2s 3s both; }
.is-playing .hs-out-f  { animation: ha-lift .55s 2.8s cubic-bezier(.2,.8,.3,1.15) both; }
.is-playing .hs-out-b  { animation: ha-lift .55s 2.95s cubic-bezier(.2,.8,.3,1.15) both; }
.is-playing .hs-dim    { animation: ha-fade .4s 3.6s both; }

@keyframes ha-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes ha-fade { from { opacity: 0; } }
@keyframes ha-pop  { from { opacity: 0; transform: scale(1.18); } }
@keyframes ha-draw { from { stroke-dashoffset: 100; } }
@keyframes ha-lift { from { opacity: 0; transform: translateX(-70px) scale(.42); } }
@keyframes ha-scan {
  0%   { opacity: 0;   transform: translateY(0); }
  12%  { opacity: .22; }
  88%  { opacity: .22; transform: translateY(254px); }
  100% { opacity: 0;   transform: translateY(254px); }
}

/* Scene 2 — many PDFs. --i = order a page lands in the stack, --r = the
   order it is processed (top page first) = the grid row its cards fill. */
.hb-band { fill: var(--ink-3); opacity: .3; }
.hb-doc {
  fill: var(--ink-2); font-size: 7px; font-weight: 700; letter-spacing: .06em;
  font-family: inherit;
}
.hb-count, .hb-colhead, .hb-zip-name, .hb-zip-sub {
  fill: var(--ink-3); font-family: inherit; text-anchor: middle;
}
.hb-count   { font-size: 11px; font-weight: 600; }
.hb-colhead { font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.hb-zip-name { fill: var(--ink); font-size: 11px; font-weight: 700; }
.hb-zip-sub  { font-size: 9px; }
.hb-flow { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 6; fill: none; opacity: .75; }
.hb-flow-head { fill: var(--accent); opacity: .75; }
.hb-card { filter: drop-shadow(0 2px 5px rgba(16, 18, 29, .1)); }
.hb-zip-body { fill: var(--surface); stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.hb-zip-fold { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.hb-zip-teeth { stroke: var(--accent); stroke-width: 5; stroke-dasharray: 3 3; opacity: .7; }
.hb-zip-pull { fill: var(--accent); }

.is-playing .hb-in    { animation: ha-drop .4s calc(var(--i) * .12s) ease-out both; }
.is-playing .hb-go    { animation: ha-go .45s calc(.9s + var(--r) * .7s) ease-in both; }
.is-playing .hb-card  { animation: ha-lift .45s calc(1.15s + var(--r) * .7s) cubic-bezier(.2,.8,.3,1.15) both; }
.is-playing .hb-fly   { animation: ha-fly .6s calc(4.5s + var(--r) * .08s) ease-in both; }
/* The column heads leave with the cards (forwards only, so the fade-out does
   not override the fade-in before it starts). */
.is-playing .hb-heads { animation: ha-fade .3s 1.1s both, ha-out .4s 4.6s forwards; }
.is-playing .hb-flow  { animation: ha-flow .6s linear infinite; }
.is-playing .hb-zip   { animation: ha-zip .5s 4.15s ease-out both; }
.is-playing .hb-zip-body { animation: ha-bump .35s 5.1s ease-out both; }
.is-playing .hb-count { animation: ha-out .4s 3.6s both; }

@keyframes ha-drop { from { opacity: 0; transform: translateY(-26px); } }
@keyframes ha-go   { to   { opacity: 0; transform: translateX(56px); } }
@keyframes ha-fly  { to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); } }
@keyframes ha-flow { to   { stroke-dashoffset: -12; } }
@keyframes ha-out  { to   { opacity: 0; } }
@keyframes ha-zip  {
  0%   { opacity: 0; transform: scale(.55); }
  70%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ha-bump { 50% { transform: scale(1.1); } }

/* Downloading: a badge per result (each face in scene 1, the ZIP in scene 2).
   The arrow bobs while the ring fills, then turns into a tick. Resting state =
   done: full ring, tick, "SAVED" / "Downloaded", full bar. */
.dl-bg    { fill: var(--surface); }
.dl-ring  { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; }
.dl-arrow, .dl-check { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dl-arrow { opacity: 0; }
.dl-f .dl-ring, .dl-f .dl-arrow, .dl-f .dl-check { stroke: var(--front); }
.dl-b .dl-ring, .dl-b .dl-arrow, .dl-b .dl-check { stroke: var(--back); }
.dl-z .dl-bg { fill: var(--accent); }
.dl-z .dl-ring { stroke: color-mix(in srgb, var(--accent-ink) 55%, var(--accent)); }
.dl-z .dl-arrow, .dl-z .dl-check { stroke: var(--accent-ink); }
.dl-saving { opacity: 0; }
.dl-track { fill: var(--line); }
.dl-bar   { fill: var(--accent); }
.hero-art svg .dl-bar { transform-origin: left center; }   /* fill from the left, not the middle */
.dl-status { fill: var(--ink-2); font-size: 9.5px; font-weight: 700; font-family: inherit; text-anchor: middle; }
.dl-going { opacity: 0; }
.dl-done  { fill: var(--back); }

/* scene 1: front at 3.9s, back 0.25s later */
.is-playing .dl-f { animation: ha-pop .3s 3.9s ease-out both; }
.is-playing .dl-b { animation: ha-pop .3s 4.15s ease-out both; }
.is-playing .dl-f .dl-ring  { animation: ha-draw 1.1s 4.1s ease-in-out both; }
.is-playing .dl-b .dl-ring  { animation: ha-draw 1.1s 4.35s ease-in-out both; }
.is-playing .dl-f .dl-arrow { animation: dl-bob 1.25s 3.95s ease-in-out both; }
.is-playing .dl-b .dl-arrow { animation: dl-bob 1.25s 4.2s ease-in-out both; }
.is-playing .dl-f .dl-check { animation: ha-pop .3s 5.2s ease-out both; }
.is-playing .dl-b .dl-check { animation: ha-pop .3s 5.45s ease-out both; }
.is-playing .dl-saving-f { animation: dl-show 1.25s 3.95s both; }
.is-playing .dl-saving-b { animation: dl-show 1.25s 4.2s both; }
.is-playing .dl-saved-f  { animation: ha-fade .25s 5.2s both; }
.is-playing .dl-saved-b  { animation: ha-fade .25s 5.45s both; }

/* scene 2: the ZIP, once the cards are in (bump ends ~5.45s) */
.is-playing .dl-z { animation: ha-pop .3s 5.5s ease-out both; }
.is-playing .dl-z .dl-ring  { animation: ha-draw 1.2s 5.7s ease-in-out both; }
.is-playing .dl-z .dl-arrow { animation: dl-bob 1.35s 5.55s ease-in-out both; }
.is-playing .dl-z .dl-check { animation: ha-pop .3s 6.9s ease-out both; }
.is-playing .dl-track { animation: ha-fade .25s 5.5s both; }
.is-playing .dl-bar   { animation: dl-fill 1.2s 5.7s ease-in-out both; }
.is-playing .dl-going { animation: dl-show 1.35s 5.55s both; }
.is-playing .dl-done  { animation: ha-fade .25s 6.9s both; }

@keyframes dl-bob {
  0%   { opacity: 1; transform: translateY(-2px); }
  25%  { transform: translateY(1.5px); }
  50%  { transform: translateY(-2px); }
  75%  { transform: translateY(1.5px); }
  96%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(1.5px); }
}
/* starts hidden: fill "both" holds the 0% frame during the delay */
@keyframes dl-show { 0% { opacity: 0; } 4%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dl-fill { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .hero-art * { animation: none !important; }
}

/* The scene picker under the diagram */
.ha-modes { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.ha-tabs {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface-2, var(--surface)); border: 1px solid var(--line);
}
.ha-tab {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.ha-tab:hover { color: var(--ink); }
.ha-tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.ha-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ha-caption { margin: 0; font-size: 13px; color: var(--ink-2); text-align: center; min-height: 1.4em; }

/* ---- result step: how files are named, free vs batch ---- */
.name-perk {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px dashed var(--line);
}
.np-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em; }
.np-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.np-label { width: 52px; flex: none; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.np-paid .np-label { color: var(--accent); }
.np-files { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.np-files code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px;
  padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-paid .np-files code { background: var(--accent-soft, var(--surface-2)); color: var(--accent); font-weight: 600; }
.np-text { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.np-go {
  font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline;
}

/* ---- notice bar (text set in /admin/ Settings, added by site-config.js) ---- */
.site-notice {
  background: var(--accent); color: #fff; text-align: center;
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.site-notice p { margin: 0 auto; padding: 8px 16px; max-width: 1100px; }
.site-notice a { color: #fff; text-decoration: underline; margin-left: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-notice { color: var(--accent-ink, #10131c); }
  :root:not([data-theme="light"]) .site-notice a { color: var(--accent-ink, #10131c); }
}
:root[data-theme="dark"] .site-notice, :root[data-theme="dark"] .site-notice a { color: var(--accent-ink, #10131c); }

/* ---- result step: the other download formats ---- */
.more-formats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.mf-label { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-right: 4px; }
.mf-btn { padding: 7px 12px; font-size: 13.5px; }
.mf-hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }

/* Footer "Install as app": shown only when the browser offers installation. */
.foot-install {
  font: inherit; font-size: inherit; font-weight: 700; cursor: pointer;
  background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline;
}

/* ---- account form: "Forgot password?" and its answer ---- */
.link-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: none; border: 0; padding: 0; margin-top: 10px;
  color: var(--accent); text-decoration: underline; justify-self: start;
}
.gate-ok { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--ok-soft); color: var(--ok); }

/* ---- language switch in the header ---- */
.lang-link {
  display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 700;
  color: var(--ink-2); text-decoration: none; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.lang-link:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 400px) { .lang-link { padding: 6px 8px; font-size: 13px; } }
