/* FilesPad v2: bold, colourful, calm. One stylesheet, self-hosted font, no frameworks. */

@font-face { font-family: "Poppins"; src: url("../fonts/poppins-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-medium.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  --page: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #121524;
  --muted: #5a6178;
  --line: #e2e5ee;
  --ink: #1d2b6b;
  --action: #2e5bff;
  --action-hover: #1f47e0;
  --on-action: #ffffff;
  --ok: #128a52;
  --warn: #c2410c;
  --focus: #2e5bff;

  /* One colour per tool. */
  --c-compress: #ff5a36;
  --c-photo: #2e6bff;
  --c-editor: #8a4dff;
  --c-scan: #0e9f6e;
  --c-pdf: #e8960c;

  --tone: var(--action);              /* set per tool page */

  --r-lg: 22px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 21, 36, .06);
  --shadow: 0 1px 2px rgba(18, 21, 36, .05), 0 12px 32px -12px rgba(18, 21, 36, .16);
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d1017;
    --surface: #161a24;
    --surface-2: #1d2230;
    --text: #edf0f7;
    --muted: #a2aabd;
    --line: #2a3040;
    --ink: #a9b8ff;
    --action: #5c7cff;
    --action-hover: #7a94ff;
    --on-action: #0b0e14;
    --ok: #46c98a;
    --warn: #ff9a5c;
    --focus: #8fa5ff;
    --c-compress: #ff7a5c;
    --c-photo: #5c8cff;
    --c-editor: #a77bff;
    --c-scan: #33c08d;
    --c-pdf: #f5b13d;
    --shadow-sm: none;
    --shadow: 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

.tone-compress { --tone: var(--c-compress); }
.tone-photo { --tone: var(--c-photo); }
.tone-editor { --tone: var(--c-editor); }
.tone-scan { --tone: var(--c-scan); }
.tone-pdf { --tone: var(--c-pdf); }
/* Re-mixed wherever the tone changes, so every tool gets its own soft tint. */
:root, [class*="tone-"] { --tone-soft: color-mix(in srgb, var(--tone) 12%, var(--surface)); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--text); background: var(--page); -webkit-font-smoothing: antialiased; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: var(--action); text-underline-offset: .2em; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.wrap--narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .45em; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }
h3 { font-size: 1.12rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); color: var(--muted); max-width: 58ch; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
@media (prefers-color-scheme: dark) { .brand svg path:first-child { fill: #5c7cff; } }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 500; font-size: .95rem; padding: 9px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav__dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tone); flex: none; }
.nav__pricing { color: var(--muted) !important; }
.menu { display: none; position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 500; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { width: 18px; height: 18px; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; display: grid; }
.menu__panel a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); }
.menu__panel a:hover { background: var(--surface-2); }
.menu__panel small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.35; }
.menu__panel strong { font-family: var(--display); font-weight: 500; }
@media (max-width: 900px) { .nav { display: none; } .menu { display: block; } }

/* Tool icon tile */
.tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); flex: none; }
.tile svg { width: 24px; height: 24px; }
.tile--lg { width: 60px; height: 60px; border-radius: 18px; }
.tile--lg svg { width: 32px; height: 32px; }
.tile--solid { background: var(--tone); color: #fff; }

/* ---------- Home ---------- */
.hero { padding: clamp(36px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); display: grid; gap: 40px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero__art { display: none; } }
.hero h1 { max-width: 14ch; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 26px; }
.hero__note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; }
.hero__note svg { width: 18px; height: 18px; color: var(--ok); }

/* Illustration: a document getting its stamp. Built with HTML, no image files. */
.hero__art { position: relative; height: 380px; }
.art-doc { position: absolute; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.art-doc--back { width: 230px; height: 300px; right: 40px; top: 20px; transform: rotate(7deg); background: color-mix(in srgb, var(--c-pdf) 14%, var(--surface)); border-color: transparent; }
.art-doc--front { width: 260px; height: 330px; right: 120px; top: 30px; transform: rotate(-4deg); padding: 26px 24px; }
.art-photo { width: 84px; height: 98px; border-radius: 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--c-photo) 25%, var(--surface)) 0 62%, color-mix(in srgb, var(--c-photo) 55%, var(--surface)) 62%); position: relative; overflow: hidden; }
.art-photo::after { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c-photo) 50%, var(--surface)); left: 24px; top: 20px; }
.art-line { height: 10px; border-radius: 5px; background: var(--surface-2); margin-top: 14px; }
.art-line--s { width: 55%; }
.art-sign { margin-top: 26px; width: 120px; height: 34px; color: var(--ink); }
.art-stamp { position: absolute; right: 30px; bottom: 60px; white-space: nowrap; transform: rotate(-9deg); border: 4px double var(--ok); color: var(--ok); border-radius: 12px; padding: 10px 16px; font-family: var(--display); font-weight: 700; letter-spacing: .06em; background: color-mix(in srgb, var(--ok) 8%, var(--surface)); box-shadow: var(--shadow-sm); }
.art-stamp small { display: block; font-family: var(--font); font-weight: 600; letter-spacing: 0; font-size: .82rem; color: var(--text); }
.art-chip { position: absolute; font-family: var(--display); font-weight: 500; font-size: .88rem; padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.art-chip--a { right: 0; top: 70px; color: var(--c-compress); }
.art-chip--b { right: 330px; top: 200px; color: var(--c-photo); }
.art-chip--c { right: 250px; top: 330px; color: var(--c-scan); }

.tools-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); padding-bottom: 12px; }
.tool-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: start; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tool-card:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.tool-card .tile { grid-row: span 2; }
.tool-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.5; }
.tool-card__tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tool-card__tags span { font-size: .8rem; font-weight: 600; color: var(--tone); background: var(--tone-soft); padding: 3px 9px; border-radius: 999px; }
.tool-card--feature { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (min-width: 1000px) {
  .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-card--feature { grid-column: span 2; padding: 26px 28px; }
  .tool-card--feature h3 { font-size: 1.6rem; }
  .tool-card--feature p { font-size: 1.05rem; }
  .tool-card--feature .tool-card__tags { align-self: end; }
}
.tool-card--feature:hover { color: #fff; }
.tool-card--feature p { color: rgba(255, 255, 255, .78); }
.tool-card--feature .tile { background: rgba(255, 255, 255, .14); color: #fff; }
.tool-card--feature .tool-card__tags span { color: #fff; background: rgba(255, 255, 255, .16); }
@media (prefers-color-scheme: dark) { .tool-card--feature { background: #233074; border-color: #33429a; } }

.section { padding: clamp(48px, 7vw, 88px) 0 0; }
.section__head { max-width: 640px; margin-bottom: 28px; }
.section__head p { color: var(--muted); }
.steps-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.steps-row li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.steps-row li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 700; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .steps-row li::before { background: var(--action); color: var(--on-action); } }
.steps-row h3 { margin-bottom: 4px; }
.steps-row p { margin: 0; color: var(--muted); font-size: .97rem; }
.promise { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.promise > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.promise .tile { grid-row: span 2; --tone: var(--ok); }
.promise h3 { margin: 6px 0 0; }
.promise p { margin: 0; color: var(--muted); font-size: .97rem; }

/* Home: drop anything */
.pick-sheet { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; max-width: 560px; }
.pick-sheet__title { font-family: var(--display); font-weight: 700; margin: 0 0 4px; }
.pick-sheet__file { color: var(--muted); font-size: .93rem; margin: 0 0 14px; overflow-wrap: anywhere; }
.pick-sheet__list { display: grid; gap: 8px; }
.pick-sheet__list button { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.pick-sheet__list button:hover { border-color: var(--tone); }
.pick-sheet__list .tile { width: 38px; height: 38px; border-radius: 11px; }
.pick-sheet__list strong { display: block; font-family: var(--display); font-weight: 500; }
.pick-sheet__list small { color: var(--muted); }

/* ---------- Tool page ---------- */
.tool-hero { display: flex; align-items: center; gap: 18px; padding: clamp(24px, 4vw, 44px) 0 clamp(18px, 3vw, 26px); }
.tool-hero h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); margin: 0 0 .2em; }
.tool-hero .lede { margin: 0; font-size: 1.05rem; }
@media (max-width: 560px) { .tool-hero { align-items: flex-start; } .tool-hero .tile--lg { width: 48px; height: 48px; border-radius: 14px; } .tool-hero .tile--lg svg { width: 26px; height: 26px; } }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(14px, 3vw, 30px); }
.tool__panel + .tool__panel { margin-top: 0; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 0 20px; background: var(--surface-2); border-radius: 999px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; font: inherit; font-family: var(--display); font-weight: 500; font-size: .95rem; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.dropzone { display: grid; place-items: center; text-align: center; gap: 4px; min-height: 280px; padding: 32px 18px; background: var(--tone-soft); border: 2px dashed color-mix(in srgb, var(--tone) 45%, transparent); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, var(--surface)); }
.dropzone__icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--tone); color: #fff; margin-bottom: 10px; box-shadow: 0 10px 24px -10px var(--tone); }
.dropzone__icon svg { width: 32px; height: 32px; }
.dropzone__title { font-family: var(--display); font-weight: 700; font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); margin: 0; color: var(--text); }
.dropzone__hint { color: var(--muted); margin: 0; font-size: .95rem; max-width: 46ch; }
.dropzone .btn { margin-top: 16px; pointer-events: none; }
.dropzone .btn--primary { background: var(--tone); }
.private-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; margin: 14px 0 0; }
.private-note svg { width: 17px; height: 17px; color: var(--ok); flex: none; }

.tool__status { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .95rem; }
.tool__status[data-kind="error"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }

.workspace { display: grid; gap: clamp(18px, 3vw, 32px); grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: start; }
.workspace--single { grid-template-columns: minmax(0, 1fr); max-width: 720px; margin-inline: auto; gap: 16px; }
@media (max-width: 860px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
.workspace__preview { display: grid; justify-items: center; gap: 12px; position: sticky; top: 84px; }
@media (max-width: 860px) { .workspace__preview { position: static; } }
.workspace__img { max-height: 420px; width: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
.workspace__panel { display: grid; gap: 16px; }
.panel-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin: 0; }

.cropper__frame { display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 18px 18px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; width: 100%; }
.cropper__canvas { touch-action: none; cursor: grab; box-shadow: 0 0 0 2px var(--tone), 0 10px 30px -12px rgba(0, 0, 0, .35); border-radius: 2px; }
.cropper__canvas:active { cursor: grabbing; }
.cropper__controls { display: flex; gap: 12px; align-items: center; width: 100%; }
.cropper__label { display: flex; align-items: center; gap: 10px; flex: 1; font-size: .92rem; color: var(--muted); }
.cropper__zoom { flex: 1; accent-color: var(--tone); }

/* Pickers (exam and type) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: inherit; font-family: var(--display); font-weight: 500; font-size: .93rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 40px; }
.pill:hover { border-color: var(--tone); }
.pill[aria-pressed="true"] { background: var(--tone); border-color: var(--tone); color: #fff; }
.spec-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; color: var(--muted); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; }
.spec-line strong { color: var(--text); font-weight: 650; }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field label, .options legend, .field__label { font-weight: 650; font-size: .93rem; }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.field--inline { display: flex; align-items: center; gap: 8px; max-width: 240px; }
.unit { color: var(--muted); }
input[type="text"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-height: 46px;
}
input[readonly] { background: var(--surface-2); color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 40%, transparent); outline-offset: 0; border-color: var(--focus); }
input[type="range"] { accent-color: var(--tone); width: 100%; }
input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.options { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0; display: grid; gap: 12px; }
.options legend { padding: 0 6px; }
details.options > summary { cursor: pointer; font-weight: 650; font-size: .93rem; list-style-position: inside; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .97rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tone); flex: none; }
.preset-note, .hint { color: var(--muted); font-size: .92rem; margin: 0; }
.file-info { font-weight: 650; margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 38px; }
.chip:hover { border-color: var(--tone); color: var(--tone); }
.chip[aria-pressed="true"] { background: var(--tone-soft); border-color: var(--tone); color: var(--tone); }
.pro-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: #7a4b00; background: #ffe4a6; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
@media (prefers-color-scheme: dark) { .pro-tag { color: #2b1a00; background: #f5c35b; } }

.btn { font: inherit; font-family: var(--display); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--action); color: var(--on-action); }
.btn--primary:hover { background: var(--action-hover); color: var(--on-action); }
.btn--tone { background: var(--tone); color: #fff; }
.btn--tone:hover { background: color-mix(in srgb, var(--tone) 85%, #000); color: #fff; }
.btn--quiet { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--quiet:hover { border-color: var(--tone); color: var(--text); }
.btn--small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; padding: 12px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { font: inherit; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn:not(:disabled):hover { border-color: var(--tone); color: var(--tone); }
.icon-btn svg { width: 18px; height: 18px; }
.progress { margin: 0; color: var(--tone); font-weight: 650; }

/* ---------- Result and the stamp ---------- */
.result { display: grid; gap: 14px; padding-top: 2px; }
.result__row { display: flex; gap: 14px; align-items: center; }
.result__preview { max-height: 120px; width: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.stamp { --c: var(--ok); position: relative; padding: 14px 16px 12px; border: 3px double var(--c); border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 6%, var(--surface)); transform: rotate(-1deg); transform-origin: left center; animation: stamp-in .34s cubic-bezier(.2, .9, .3, 1.3) both; }
.stamp--warn { --c: var(--warn); }
.stamp__title { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 1.02rem; letter-spacing: .06em; text-transform: uppercase; }
.stamp__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.stamp__checks li { display: flex; gap: 8px; align-items: baseline; }
.stamp__mark { color: var(--c); font-weight: 800; width: 1em; flex: none; }
.stamp__checks li.is-warn .stamp__mark { color: var(--warn); }
.stamp__note { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
@keyframes stamp-in { from { transform: scale(1.12) rotate(-4deg); opacity: 0; } to { transform: rotate(-1deg); opacity: 1; } }

/* ---------- File and page lists ---------- */
.filelist { list-style: none; margin: 0; padding: 0; counter-reset: f; display: grid; gap: 8px; }
.filelist__item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.filelist__name { font-weight: 650; overflow-wrap: anywhere; counter-increment: f; }
.filelist__name::before { content: counter(f) ". "; color: var(--muted); }
.filelist__meta { color: var(--muted); font-size: .88rem; grid-column: 1; }
.filelist__actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.filelist__item.is-done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.filelist__item.is-done .filelist__meta { color: var(--ok); font-weight: 600; }

.pagestrip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.pagestrip__item { display: grid; gap: 8px; justify-items: center; }
.pagestrip__thumb { position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; overflow: hidden; width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.pagestrip__thumb:hover { border-color: var(--tone); }
.pagestrip__thumb img { max-height: 100%; width: auto; }
.pagestrip__num { position: absolute; left: 6px; top: 6px; background: var(--tone); color: #fff; font-size: .78rem; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.pagestrip__actions { display: flex; gap: 4px; }
.scan-editor { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.scan-editor__frame { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r); padding: 10px; }
.scan-editor__canvas { touch-action: none; border-radius: 4px; }
.scan-editor__tools, .scan-editor__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-export { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- Editor ---------- */
.ed[hidden] { display: none !important; }
/* The editor opens as a full-screen workspace, like an app. */
html.ed-open, html.ed-open body { overflow: hidden; overscroll-behavior: none; }
.ed { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "top" "bar" "props" "body"; background: var(--page); color: var(--text); }
.ed__top { grid-area: top; display: flex; align-items: center; gap: 6px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.ed__title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 600; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed__iconbtn { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.ed__iconbtn svg { width: 22px; height: 22px; }
.ed__iconbtn:hover { background: var(--surface-2); }
.ed__iconbtn:disabled { opacity: .3; cursor: default; background: transparent; }
.ed__zoom { display: flex; align-items: center; gap: 2px; padding: 0 4px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 0 4px; }
.ed__zoomval { font: inherit; font-size: .85rem; font-weight: 700; min-width: 56px; height: 36px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.ed__zoomval:hover { background: var(--surface-2); }
.ed__save { flex: none; }
.ed__pagesbtn { display: none; }
.ed__bar { grid-area: bar; display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ed__bar::-webkit-scrollbar { display: none; }
.ed__group { display: flex; flex: none; gap: 2px; align-items: center; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.ed__group:last-child { border-right: 0; }
.tbtn { font: inherit; font-size: .8rem; font-weight: 600; display: inline-flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 60px; min-height: 52px; padding: 6px 8px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tbtn svg { width: 21px; height: 21px; }
.tbtn span { white-space: nowrap; }
.tbtn:hover { background: var(--surface-2); }
.tbtn[aria-pressed="true"] { background: var(--tone-soft); color: var(--tone); border-color: color-mix(in srgb, var(--tone) 40%, transparent); }
.tbtn:disabled { opacity: .35; cursor: default; background: transparent; }
.ed__props { grid-area: props; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; max-height: 34vh; overflow: auto; }
.ed__props:empty { display: none; }
.ed__props label { display: inline-flex; align-items: center; gap: 8px; }
.ed__props input[type="range"] { width: 130px; }
.ed__props select, .ed__props input[type="number"] { width: auto; min-height: 38px; padding: 6px 10px; }
.ed__body { grid-area: body; min-height: 0; display: grid; grid-template-columns: 168px minmax(0, 1fr); }
.ed__body--single { grid-template-columns: minmax(0, 1fr); }
.ed__body--single .ed__thumbs { display: none; }
.ed__thumbs { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 12px; padding: 14px 10px; background: var(--surface); border-right: 1px solid var(--line); }
.ed__thumbs-head { display: none; }
.ed__thumb { display: grid; gap: 4px; justify-items: center; }
.ed__thumb button.ed__thumbimg { padding: 0; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden; width: 100%; }
.ed__thumb button.ed__thumbimg[aria-current="true"] { border-color: var(--tone); }
.ed__thumb canvas { width: 100%; height: auto; display: block; }
.ed__thumbtools { display: flex; gap: 3px; }
.ed__thumbtools .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.ed__thumbtools .icon-btn svg { width: 15px; height: 15px; }
.ed__scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; background: var(--surface-2); }
.ed__pages { display: grid; gap: 32px; justify-items: start; padding: 34px 24px 24px; width: max-content; min-width: 100%; transform-origin: 0 0; }
.ed__pages.is-pinching { will-change: transform; }
.ed__page { position: relative; margin-inline: auto; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .14); touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
/* Phones: tools at the bottom, within thumb reach; pages in a slide-up panel. */
@media (max-width: 760px) {
  .ed { grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "body" "props" "bar"; }
  .ed__top { padding: 6px 6px; padding-top: max(6px, env(safe-area-inset-top)); gap: 2px; }
  .ed__zoom { display: none; }
  .ed__pagesbtn { display: inline-grid; }
  .ed__bar { border-bottom: 0; border-top: 1px solid var(--line); padding: 4px 6px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .ed__group { border-right: 0; padding-right: 0; margin-right: 0; }
  .tbtn { min-width: 62px; min-height: 52px; padding: 4px 6px; }
  .ed__props { border-bottom: 0; border-top: 1px solid var(--line); padding: 6px 10px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: none; scrollbar-width: none; gap: 8px; }
  .ed__props::-webkit-scrollbar { display: none; }
  .ed__props > * { flex: none; }
  .ed__props .chips { flex-wrap: nowrap; }
  .ed__props input[type="range"] { width: 110px; }
  .ed__props .hint { font-size: .85rem; }
  .ed__body { grid-template-columns: minmax(0, 1fr); }
  .ed__pages { padding: 30px 14px 20px; gap: 30px; }
  .ed__thumbs { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 70dvh; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); padding: 14px 14px max(14px, env(safe-area-inset-bottom)); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
  .ed.show-pages .ed__thumbs { display: grid; }
  .ed.show-pages::after { content: ""; position: fixed; inset: 0; z-index: 85; background: rgba(10, 12, 22, .45); }
  .ed__thumbs-head { display: flex; grid-column: 1 / -1; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 600; }
}
/* Download panel */
.ed-sheet { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 22, .5); }
.ed-sheet[hidden] { display: none; }
.ed-sheet__box { width: min(520px, 100%); max-height: 90dvh; overflow: auto; background: var(--surface); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.ed-sheet__head { display: flex; justify-content: space-between; align-items: center; }
.ed-sheet__head h2 { margin: 0; font-size: 1.2rem; }
@media (max-width: 760px) {
  .ed-sheet { place-items: end stretch; padding: 0; }
  .ed-sheet__box { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}
.img-hint { position: absolute; padding: 0; border: 1px dashed color-mix(in srgb, var(--tone) 45%, transparent); background: transparent; border-radius: 2px; cursor: move; touch-action: none; }
.img-hint:hover, .img-hint:focus-visible { border-style: solid; border-color: var(--tone); background: color-mix(in srgb, var(--tone) 8%, transparent); outline: none; }
.obj.is-untouched { color: transparent !important; }
.obj--img.is-untouched img { opacity: 0; }
.obj.is-grouped { outline: 1px dashed var(--tone); outline-offset: 1px; }
.group-box { position: absolute; border: 2px solid var(--tone); background: color-mix(in srgb, var(--tone) 6%, transparent); cursor: move; touch-action: none; }
.group-box .obj__del { right: -14px; top: -32px; }
.chip--icon { display: inline-flex; align-items: center; gap: 6px; }
.chip--icon svg { width: 16px; height: 16px; }
.ed__page.is-drawing, .ed__page.is-placing { touch-action: none; cursor: crosshair; }
.ed__page > canvas.ed__bg { width: 100%; height: 100%; }
.ed__layer { position: absolute; inset: 0; }
.ed__ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ed__label { position: absolute; left: -2px; top: -22px; font-size: .78rem; color: var(--muted); }
.obj { position: absolute; touch-action: none; }
.obj--text { line-height: 1.25; white-space: pre-wrap; word-break: break-word; outline: none; min-width: 1em; padding: 0 2px; cursor: move; }
.obj--text[contenteditable="true"], .obj--text[contenteditable="plaintext-only"] { cursor: text; }
.obj--rect { cursor: move; }
.obj--img { cursor: move; }
.obj--img img { width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.obj.is-selected { outline: 2px solid var(--tone); outline-offset: 2px; }
.obj__handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--tone); border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.obj__del { position: absolute; right: -12px; top: -30px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-weight: 700; cursor: pointer; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.obj--cover { position: absolute; pointer-events: none; }
.txt-hint { position: absolute; padding: 0; border: 1px dashed color-mix(in srgb, var(--tone) 70%, transparent); background: color-mix(in srgb, var(--tone) 7%, transparent); border-radius: 3px; cursor: text; }
.txt-hint:hover, .txt-hint:focus-visible { background: color-mix(in srgb, var(--tone) 18%, transparent); border-style: solid; outline: none; }
.sel-box { position: absolute; border: 2px dashed var(--tone); background: color-mix(in srgb, var(--tone) 10%, transparent); box-shadow: 0 0 0 1px #fff inset; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10, 14, 30, .5); touch-action: none; cursor: move; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 33.33% 0; border-top: 1px dashed rgba(255, 255, 255, .7); border-bottom: 1px dashed rgba(255, 255, 255, .7); }
.crop-box::after { inset: 0 33.33%; border: 0; border-left: 1px dashed rgba(255, 255, 255, .7); border-right: 1px dashed rgba(255, 255, 255, .7); }
.crop-box .obj__handle { background: #fff; border-color: var(--tone); }
.ed__export { display: grid; gap: 14px; }
.ed__export .btn--lg { width: 100%; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10, 12, 22, .55); padding: 16px; }
.modal__box { background: var(--surface); border-radius: var(--r-lg); padding: 20px; width: min(560px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); }
.modal__box h2 { font-size: 1.25rem; margin: 0; }
.sigpad { width: 100%; height: 200px; background: #fff; border: 1px dashed var(--line); border-radius: var(--r-sm); touch-action: none; cursor: crosshair; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ---------- Content below the tool ---------- */
.content { padding: clamp(40px, 6vw, 72px) 0 72px; }
.content > h2:first-child { margin-top: 0; }
.content h2 { margin-top: 1.8em; }
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 0; }
.faq details p { color: var(--muted); margin: 0 0 14px; }
.chart { max-width: 760px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.chart > summary { cursor: pointer; padding: 14px 16px; font-weight: 650; }
.chart .table-scroll { padding: 0 16px 14px; overflow-x: auto; }
.spec { border-collapse: collapse; width: 100%; font-size: .95rem; }
.spec th, .spec td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { font-weight: 650; color: var(--muted); }
.spec tr:last-child td { border-bottom: 0; }
.prose { max-width: 70ch; }
.prose li { margin-bottom: .4em; }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 24px 0 40px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.plan--pro { border: 2px solid var(--ink); position: relative; }
.plan h2 { margin: 0; font-size: 1.4rem; display: flex; align-items: center; gap: 10px; }
.plan__price { font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 14px; }
.plan__price small { font-family: var(--font); font-size: .95rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan ul { padding-left: 1.15em; margin: 0 0 10px; }
.plan li { margin-bottom: .4em; }
.badge { display: inline-block; font-family: var(--font); font-size: .78rem; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--ink) 12%, var(--surface)); padding: 3px 9px; border-radius: 999px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 24px; border-top: 1px solid var(--line); background: var(--surface); padding: 44px 0 40px; font-size: .93rem; color: var(--muted); }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__about { grid-column: 1 / -1; } }
.site-footer h2 { font-family: var(--display); font-size: .98rem; color: var(--text); margin: 0 0 10px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--action); text-decoration: underline; }
.popular { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.popular > summary { cursor: pointer; font-weight: 600; color: var(--text); width: fit-content; }
.popular ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.site-footer__legal { margin: 22px 0 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 520px) { body { font-size: 1rem; } .dropzone { min-height: 230px; } }

.lang-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 18px 0 6px; font-size: .95rem; }
.lang-list svg { width: 18px; height: 18px; color: var(--muted); }
.lang-list a { color: var(--text); text-decoration: none; }
.lang-list a:hover { text-decoration: underline; }
.lang-list a[aria-current="true"] { font-weight: 700; }

/* Pro passes */
.buy { margin: 32px 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: grid; gap: 12px; }
.buy h2 { margin: 0; }
.buy h3 { margin: 10px 0 0; font-size: 1.1rem; }
.buy__passes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pass { padding: 18px; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 8px; align-content: start; }
.pass--best { border-color: var(--tone, #3b5bfd); box-shadow: 0 0 0 1px var(--tone, #3b5bfd) inset; }
.pass h3 { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pass__price { font-family: var(--display); font-weight: 700; font-size: 1.8rem; margin: 0; }
.buy__key input, .buy__restore input { flex: 1; min-width: 200px; font-family: ui-monospace, Consolas, monospace; }
.buy__status[data-kind="error"] { color: #c4282d; }
.buy__status[data-kind="ok"] { color: var(--ok); font-weight: 600; }
.buy__current { padding: 14px; border-radius: var(--r); background: var(--surface-2); display: grid; gap: 8px; justify-items: start; }
.buy__keytext { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: .78rem; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.pro-note { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: .95rem; }
.buy .field--inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.buy .field--inline .btn { white-space: nowrap; flex: none; }
.ed__toast { position: fixed; left: 50%; bottom: 128px; pointer-events: none; transform: translateX(-50%); z-index: 92; max-width: min(520px, calc(100% - 40px)); padding: 8px 14px; border-radius: 12px; background: rgba(29, 34, 64, .94); color: #fff; font-size: .86rem; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); text-align: center; animation: ed-toast .18s ease-out; }
.ed__toast[data-kind="tip"] { bottom: auto; top: calc(66px + env(safe-area-inset-top, 0px)); }
@keyframes ed-toast { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ed__toast { animation: none; } }
.ed__toast[data-kind="error"] { background: #c4282d; }
@media (min-width: 761px) { .ed__toast { bottom: 28px; } }
