/* QScan web. Colours are the app's Theme.kt roles; radii and tiles follow Design.kt. */
:root {
  --o: #FF6B00;          /* primary */
  --o-btn: #F06400;      /* primary button fill: a touch deeper so white text stays readable */
  --o-btn-hover: #E05A00;
  --o-ink: #B84A00;      /* orange text on light orange */
  --oc: #FFF0E2;         /* primaryContainer */
  --oc-line: #FFD7B5;
  --ink: #0B0D20;        /* onBackground */
  --text-2: #4F5363;
  --text-3: #5F6472;
  --sub: #9295A7;        /* onSurfaceVariant: icons and hints only */
  --line: #E1E2E8;       /* outline */
  --line-2: #ECEDF1;
  --bg: #F5F6F6;         /* background */
  --surface: #FFFFFF;
  --chip: #F2F3F5;       /* tertiaryContainer */
  --grey: #757B86;
  --inv: #191B25;        /* inverseSurface */
  --err: #B3261E;
  --err-c: #FBE9E7;
  --ok: #1B7F3B;
  --ok-c: #E5F5EA;

  --r-card: 16px;
  --r-tile: 13px;
  --r-sheet: 28px;
  --shadow-1: 0 1px 2px rgba(11, 13, 32, .05), 0 2px 6px rgba(11, 13, 32, .04);
  --shadow-2: 0 14px 34px -12px rgba(120, 52, 0, .22), 0 4px 12px rgba(11, 13, 32, .06);
  --shadow-pop: 0 24px 60px -18px rgba(11, 13, 32, .28), 0 6px 18px rgba(11, 13, 32, .08);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --header: 68px;
  --gutter: 24px;
  color-scheme: light;
  accent-color: var(--o);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  caret-color: var(--o);
}
main { flex: 1; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
img, canvas, svg { display: block; }
::selection { background: #FFD3AD; color: var(--ink); }
:focus-visible { outline: 3px solid rgba(255, 107, 0, .55); outline-offset: 2px; border-radius: 10px; }
* { scrollbar-width: thin; scrollbar-color: #C9CBD3 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9CBD3; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 24px; height: 24px; fill: currentColor; flex: none; }
.ic.flip { transform: scaleX(-1); }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background-color .2s, color .2s, box-shadow .25s var(--ease), transform .2s var(--ease), opacity .2s;
}
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--o-btn); color: #fff; box-shadow: 0 8px 20px -10px rgba(240, 100, 0, .8); }
.btn-primary:hover { background: var(--o-btn-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #F4C49C; box-shadow: none; }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px #C9CBD3; background: #FAFAFB; }
.btn-soft { background: var(--oc); color: var(--o-ink); }
.btn-soft:hover { background: #FFE6CF; }
.btn-xl { height: 68px; padding: 0 40px; font-size: 20px; font-weight: 700; gap: 12px; }
.btn-xl .ic { width: 26px; height: 26px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--chip); color: var(--ink); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--header);
  background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.top .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 23px/1 var(--font-display); letter-spacing: -.02em; }
.brand img { width: 38px; height: 38px; }
.nav { display: flex; align-items: center; gap: 4px; height: 100%; }
.nav > a, .nav > button {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 12px; border-radius: 999px;
  font-weight: 600; font-size: 15px; color: var(--text-2); transition: color .2s, background-color .2s;
}
.nav > a:hover, .nav > button:hover, .nav > button[aria-expanded="true"] { color: var(--ink); background: var(--chip); }
.nav > a[aria-current="page"] { color: var(--o-ink); background: var(--oc); }
.nav .ic { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.nav > button[aria-expanded="true"] .ic { transform: rotate(180deg); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.burger { display: none; }

/* Drop-down panels */
.menu {
  position: absolute; top: calc(var(--header) - 6px); left: 50%; transform: translate(-50%, -6px);
  width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - var(--header) - 24px); overflow: auto;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-pop); border: 1px solid var(--line-2);
  padding: 28px; opacity: 0; visibility: hidden; transition: opacity .2s, transform .3s var(--ease), visibility 0s .2s;
}
.menu.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .3s var(--ease); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 20px; }
.menu-grid.narrow { grid-template-columns: repeat(3, 1fr); }
#menu-convert { width: min(860px, calc(100vw - 32px)); }
.menu h3 { font: 600 12.5px/1 var(--font); color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px 10px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px;
  font-weight: 600; font-size: 14.5px; color: var(--ink); transition: background-color .15s;
}
.menu-item:hover { background: var(--bg); }
.menu-item .glyph { width: 32px; height: 32px; border-radius: 9px; }
.menu-item .glyph .ic { width: 19px; height: 19px; }
.menu-item small { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* Mobile sheet */
.sheet {
  position: fixed; inset: var(--header) 0 0 0; z-index: 49; background: var(--surface); overflow: auto;
  padding: 12px 16px 40px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s, transform .3s var(--ease), visibility 0s .2s;
}
.sheet.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .3s var(--ease); }
.sheet section { padding: 14px 0 6px; border-bottom: 1px solid var(--line-2); }
.sheet section:last-child { border-bottom: 0; }
.sheet h3 { font: 600 12.5px/1 var(--font); color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; margin: 6px 10px 8px; }

/* ---------- Glyph tile (Design.Tools.Glyph: 48×47, radius 13, primary on primaryContainer) ---------- */
.glyph {
  width: 48px; height: 47px; border-radius: var(--r-tile); background: var(--oc); color: var(--o);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.glyph .ic { width: 26px; height: 26px; }
.glyph.off { background: var(--chip); color: var(--grey); }

/* ---------- Home ---------- */
.hero { padding: 64px 0 36px; text-align: center; }
.hero h1 {
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700;
  max-width: 640px; margin: 0 auto;
}
.hero h1 em { font-style: normal; color: var(--o); }
.hero .lead { font-size: 18.5px; line-height: 1.55; color: var(--text-2); max-width: 680px; margin: 18px auto 0; text-wrap: balance; }

/* Viewfinder corners: the app's camera frame, used as the site's signature */
.vf { position: relative; display: inline-block; padding: 22px 34px; }
.vf-c { position: absolute; width: 26px; height: 26px; border: 3px solid var(--o); pointer-events: none; }
.vf-c.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 11px; }
.vf-c.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 11px; }
.vf-c.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 11px; }
.vf-c.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 11px; }
@media (prefers-reduced-motion: no-preference) {
  .hero .vf-c { animation: lock-on 1s var(--ease) .15s both; }
  .hero .vf-c.tl { --dx: -18px; --dy: -14px; }
  .hero .vf-c.tr { --dx: 18px; --dy: -14px; }
  .hero .vf-c.bl { --dx: -18px; --dy: 14px; }
  .hero .vf-c.br { --dx: 18px; --dy: 14px; }
}
@keyframes lock-on {
  from { transform: translate(var(--dx), var(--dy)); border-color: rgba(255, 107, 0, .25); }
  to { transform: none; border-color: var(--o); }
}

/* GlowCursor (React Bits): the light is drawn under the container's own content */
.glow-cursor { position: relative; overflow: hidden; }
.glow-cursor__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.glow-cursor > :not(.glow-cursor__canvas) { position: relative; z-index: 1; }
/* The site-wide layer: over everything, lets clicks through, and multiplies like a highlighter. */
.glow-layer.glow-cursor { position: fixed; inset: 0; z-index: 70; pointer-events: none; mix-blend-mode: multiply; }

.privacy {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 6px 16px 6px 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; box-shadow: var(--shadow-1);
  font-size: 14px; font-weight: 500; color: var(--text-2);
}
.privacy .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--oc); color: var(--o); display: inline-flex; align-items: center; justify-content: center; }
.privacy .ic { width: 17px; height: 17px; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 34px auto 30px; max-width: 980px; }
.chip {
  height: 40px; padding: 0 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14.5px; font-weight: 600; color: var(--text-2); transition: border-color .2s, color .2s, background-color .2s;
}
.chip:hover { border-color: #C9CBD3; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--oc); border-color: var(--oc-line); color: var(--o-ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; padding-bottom: 72px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; min-height: 196px; padding: 22px 22px 24px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .25s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--oc-line); }
.tool-card h2 { font: 600 17px/1.3 var(--font-display); letter-spacing: -.01em; margin-top: 18px; }
.tool-card p { margin-top: 7px; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.tool-card .tag {
  position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px 0 7px; border-radius: 999px; background: var(--chip);
  font-size: 12px; font-weight: 600; color: var(--text-3);
}
.tool-card .tag .ic { width: 15px; height: 15px; }
.grid .tool-card { animation: card-in .5s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .grid .tool-card { animation: none; } }

.foot { border-top: 1px solid var(--line-2); background: var(--surface); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 64px; padding-top: 14px; padding-bottom: 14px; font-size: 14px; color: var(--text-3); }
.foot .brand { font-size: 17px; color: var(--ink); }
.foot .brand img { width: 26px; height: 26px; }
.foot-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--text-3); text-underline-offset: 3px; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- Documents: privacy, terms, account deletion, licenses ---------- */
.doc-back { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.doc-back .ic { width: 18px; height: 18px; }
.doc-back:hover { color: var(--ink); }
.doc { max-width: 800px; margin: 0 auto; padding: 28px var(--gutter) 72px; }
.doc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.doc-tabs a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--text-2);
}
.doc-tabs a:hover { border-color: #C9CBD3; color: var(--ink); }
.doc-tabs a[aria-current="page"] { background: var(--oc); border-color: var(--oc-line); color: var(--o-ink); }
.doc .lang { display: flex; gap: 14px; margin: 0 0 14px; font-size: 14px; }
.doc .lang a { color: var(--text-3); text-underline-offset: 3px; }
.doc h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -.02em; }
.doc .date { margin: 8px 0 22px; font-size: 14px; color: var(--text-3); }
.doc .lead { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 20px 16px 18px; }
.doc .lead ul { margin: 0; }
.doc h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; margin: 34px 0 8px; }
.doc h3 { font-size: 16px; margin: 22px 0 6px; }
.doc p, .doc li { font-size: 15.5px; line-height: 1.65; }
.doc p { margin: 8px 0; }
.doc ul, .doc ol { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--o); }
.doc a { color: var(--o-ink); text-underline-offset: 3px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 52px 0; }
.doc .facts { display: grid; grid-template-columns: 210px 1fr; gap: 0; margin: 12px 0; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.doc .facts dt, .doc .facts dd { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 14.5px; line-height: 1.5; }
.doc .facts dt { color: var(--text-3); }
.doc .facts dt:first-of-type, .doc .facts dt:first-of-type + dd { border-top: 0; }
.doc details { margin: 12px 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; }
.doc summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 15px; }
.doc .license { margin: 0; padding: 0 16px 16px; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--text-2); }

/* ---------- Tool landing ---------- */
.tool-hero { padding: 56px 0 80px; text-align: center; }
.tool-hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; }
.tool-hero .lead { font-size: 18px; color: var(--text-2); max-width: 640px; margin: 14px auto 0; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 14.5px; font-weight: 600; color: var(--text-3); padding: 6px 12px 6px 8px; border-radius: 999px; }
.back:hover { color: var(--ink); background: var(--chip); }
.back .ic { width: 18px; height: 18px; }

.drop {
  position: relative; max-width: 760px; margin: 40px auto 0; padding: 56px 24px 50px;
  background: var(--surface); border-radius: var(--r-sheet); box-shadow: var(--shadow-1); border: 1px solid var(--line-2);
  transition: background-color .25s, box-shadow .35s var(--ease);
}
.drop .vf-c { width: 34px; height: 34px; border-width: 3.5px; transition: transform .45s var(--ease); }
.drop .vf-c.tl { top: 18px; left: 18px; } .drop .vf-c.tr { top: 18px; right: 18px; }
.drop .vf-c.bl { bottom: 18px; left: 18px; } .drop .vf-c.br { bottom: 18px; right: 18px; }
.drop.over { background: var(--oc); box-shadow: var(--shadow-2); }
.drop.over .vf-c.tl { transform: translate(12px, 12px); } .drop.over .vf-c.tr { transform: translate(-12px, 12px); }
.drop.over .vf-c.bl { transform: translate(12px, -12px); } .drop.over .vf-c.br { transform: translate(-12px, -12px); }
.drop .hint { margin-top: 16px; font-size: 14.5px; color: var(--text-3); }
.drop .safe { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; font-size: 13.5px; color: var(--text-3); }
.drop .safe .ic { width: 17px; height: 17px; color: var(--o); }

/* Whole-window drop target */
.dropzone-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 240, 226, .82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; pointer-events: none;
}
.dropzone-overlay.on { opacity: 1; visibility: visible; transition: opacity .2s; }
.dropzone-overlay .vf { padding: 48px 64px; font: 700 26px/1.2 var(--font-display); color: var(--o-ink); text-align: center; }
.dropzone-overlay .vf-c { width: 40px; height: 40px; border-width: 4px; }

/* App-only tool */
.app-only {
  max-width: 640px; margin: 40px auto 0; padding: 32px; text-align: left; display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border-radius: 24px; border: 1px solid var(--line-2); box-shadow: var(--shadow-1);
}
.app-only h2 { font-size: 20px; letter-spacing: -.01em; }
.app-only p { margin-top: 8px; color: var(--text-2); }
.app-only .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.badge-soon { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; background: var(--chip); font-weight: 600; font-size: 15px; color: var(--text-2); }
.badge-soon .ic { width: 20px; height: 20px; color: #3DDC84; }

/* ---------- Workspace ---------- */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - var(--header)); }
.ws-main { padding: 28px 32px 48px; min-width: 0; }
.ws-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.ws-head h1 { font-size: 22px; letter-spacing: -.015em; }
.ws-head .count { font-size: 14px; color: var(--text-3); font-weight: 500; }
.ws-head .tools { margin-left: auto; display: flex; gap: 8px; }
.ws-side {
  position: sticky; top: var(--header); height: calc(100vh - var(--header)); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line-2);
}
.side-body { flex: 1; overflow: auto; padding: 26px 24px 20px; }
.side-body h2 { font-size: 21px; letter-spacing: -.015em; display: flex; align-items: center; gap: 12px; }
.side-body h2 .glyph { width: 40px; height: 39px; border-radius: 11px; }
.side-body h2 .glyph .ic { width: 22px; height: 22px; }
.side-intro { margin-top: 12px; font-size: 14.5px; color: var(--text-2); }
.side-foot { padding: 16px 24px 22px; border-top: 1px solid var(--line-2); background: var(--surface); }
.side-foot .btn { height: 60px; font-size: 18px; font-weight: 700; }
.side-foot .why { margin-top: 10px; font-size: 13px; color: var(--text-3); text-align: center; min-height: 1em; }

/* Options */
.opt { margin-top: 24px; }
.opt > label, .opt > .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px; }
.help { margin-top: 8px; font-size: 13px; color: var(--text-3); line-height: 1.45; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--chip); border-radius: 14px; }
.seg.wrap-2 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.seg button {
  min-height: 40px; padding: 6px 8px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background-color .2s, color .2s, box-shadow .2s; line-height: 1.25;
}
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg .ic { width: 18px; height: 18px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 13, 32, .12); }
.choice { display: grid; gap: 8px; }
.choice button {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); transition: border-color .2s, background-color .2s;
}
.choice button:hover { border-color: #C9CBD3; }
.choice button[aria-pressed="true"] { border-color: var(--o); background: #FFF8F1; }
.choice b { display: block; font-size: 14.5px; font-weight: 600; }
.choice span { display: block; font-size: 13px; color: var(--text-3); margin-top: 1px; }
.choice .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #B7BAC6; flex: none; position: relative; transition: border-color .2s; }
.choice button[aria-pressed="true"] .radio { border-color: var(--o); }
.choice button[aria-pressed="true"] .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--o); }
.field {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: #8A8E9C; }
.field:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 4px rgba(255, 107, 0, .14); }
.field.bad { border-color: var(--err); box-shadow: 0 0 0 4px rgba(179, 38, 30, .1); }
.pw { position: relative; }
.pw .field { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 3px; top: 3px; }
.pw .icon-btn[aria-pressed="true"] { color: var(--o); }
.fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.fields .x { color: var(--text-3); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; }
.range output { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); position: relative; }
.swatches button[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--o); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 132px; padding: 8px; background: var(--chip); border-radius: 12px; aspect-ratio: .78; align-content: space-between; }
.pos-grid button { height: 26px; border-radius: 7px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s; }
.pos-grid button[aria-pressed="true"] { background: var(--o); box-shadow: none; }
.pos-grid .mid { grid-column: span 3; height: 1px; }
.note { margin-top: 18px; display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.note .ic { width: 19px; height: 19px; color: var(--o); margin-top: 1px; }

/* File cards */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; }
.fcard {
  position: relative; background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--line-2); padding: 12px 12px 14px;
  transition: box-shadow .3s var(--ease), border-color .2s, transform .3s var(--ease), opacity .2s;
  animation: card-in .45s var(--ease) both;
}
.fcard:hover { box-shadow: var(--shadow-2); border-color: var(--oc-line); }
.fcard.dragging { opacity: .4; }
.fcard.drop-before::before, .fcard.drop-after::after {
  content: ""; position: absolute; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--o);
}
.fcard.drop-before::before { left: -11px; } .fcard.drop-after::after { right: -11px; }
.thumb {
  position: relative; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--bg); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.thumb canvas, .thumb img { max-width: 88%; max-height: 88%; width: auto; height: auto; box-shadow: 0 1px 4px rgba(11, 13, 32, .16); background: #fff; transition: transform .35s var(--ease); }
.thumb .ph { width: 54%; aspect-ratio: .72; border-radius: 4px; background: linear-gradient(100deg, #eceef2 30%, #f7f8fa 50%, #eceef2 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.fcard .name { margin-top: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.fcard .meta { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.fcard .err { margin-top: 6px; font-size: 12.5px; color: var(--err); line-height: 1.35; }
.fcard .x-btn {
  position: absolute; top: -9px; right: -9px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 2px 8px rgba(11, 13, 32, .18); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s, color .2s;
}
.fcard .x-btn .ic { width: 18px; height: 18px; }
.fcard .x-btn:hover { color: var(--err); }
.fcard:hover .x-btn, .fcard:focus-within .x-btn { opacity: 1; }
.fcard .moves { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.fcard:hover .moves, .fcard:focus-within .moves { opacity: 1; }
.mini {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(25, 27, 37, .82); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; transition: background-color .2s;
}
.mini:hover { background: var(--inv); }
.mini .ic { width: 18px; height: 18px; }
.mini.flip .ic { transform: scaleX(-1); }
.fcard.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px;
  border: 2px dashed #D6D8E0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14.5px; animation: none;
}
.fcard.add:hover { border-color: var(--o); color: var(--o-ink); background: rgba(255, 240, 226, .5); box-shadow: none; }
.fcard.add .plus { width: 52px; height: 52px; border-radius: 50%; background: var(--o-btn); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px -10px rgba(240, 100, 0, .8); }
.fcard.add .plus .ic { width: 28px; height: 28px; }

/* Page thumbnails */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.pcard { position: relative; border-radius: 14px; padding: 10px 10px 8px; background: var(--surface); border: 1.5px solid var(--line-2); transition: border-color .2s, box-shadow .3s var(--ease), opacity .2s; }
.pcard .num { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pcard .ctrls { position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; opacity: 0; transition: opacity .2s; }
.pcard:hover .ctrls, .pcard:focus-within .ctrls { opacity: 1; }
.pcard.pick { cursor: pointer; }
.pcard.pick:hover { border-color: #FFC08C; }
.pcard.on { border-color: var(--o); box-shadow: 0 0 0 3px rgba(255, 107, 0, .16); }
.pcard .tick {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--o); color: #fff;
  display: none; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(240, 100, 0, .4);
}
.pcard .tick .ic { width: 17px; height: 17px; }
.pcard.on .tick { display: flex; }
.pcard.out { opacity: .38; }
.pcard .group {
  position: absolute; top: 16px; left: 16px; height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: var(--g, var(--o)); box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.pcard[draggable="true"] { cursor: grab; }

/* Sign */
.viewer { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.paper-wrap { position: relative; box-shadow: 0 2px 10px rgba(11, 13, 32, .12), 0 18px 40px -20px rgba(11, 13, 32, .25); background: #fff; }
.paper-wrap canvas { width: 100%; height: auto; }
.pager { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pager .icon-btn { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.pager .icon-btn:disabled { opacity: .4; }
.place {
  position: absolute; border: 1.5px dashed var(--o); border-radius: 6px; background: rgba(255, 240, 226, .25); cursor: move; touch-action: none;
}
.place img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.place .rm { position: absolute; top: -13px; right: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--inv); color: #fff; display: flex; align-items: center; justify-content: center; }
.place .rm .ic { width: 16px; height: 16px; }
.place .grip { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--o); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: nwse-resize; touch-action: none; }
.pad { position: relative; border-radius: 16px; background: var(--bg); border: 1.5px dashed #CDD0D8; overflow: hidden; }
.pad canvas { width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.pad .base { position: absolute; left: 20px; right: 20px; bottom: 38px; height: 1px; background: #CDD0D8; pointer-events: none; }
.pad .ph-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8A8E9C; font-size: 14px; pointer-events: none; transition: opacity .2s; }
.pad.inked .ph-text { opacity: 0; }
.pad-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pad-row .btn { height: 36px; padding: 0 14px; font-size: 14px; }

/* Text editor */
.editor { max-width: 820px; margin: 0 auto; }
.editor textarea {
  width: 100%; min-height: 70vh; resize: vertical; padding: 56px 64px; border: 1px solid var(--line-2); border-radius: 6px;
  background: #fff; box-shadow: 0 2px 10px rgba(11, 13, 32, .08), 0 24px 50px -28px rgba(11, 13, 32, .3);
  font: 400 16px/1.6 var(--font); color: var(--ink);
}
.editor textarea:focus { outline: none; border-color: var(--oc-line); }
.editor textarea::placeholder { color: #8A8E9C; }

/* Busy and result */
.state { max-width: 640px; margin: 0 auto; padding: 80px 24px 96px; text-align: center; }
.state h1 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.025em; line-height: 1.12; }
.state .lead { margin-top: 12px; font-size: 17px; color: var(--text-2); }
.bar { height: 10px; border-radius: 999px; background: #E9EAEE; overflow: hidden; margin: 36px auto 0; max-width: 460px; }
.bar i { display: block; height: 100%; background: var(--o); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.bar-text { margin-top: 14px; font-size: 14.5px; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 1.5em; }
.scan-anim { position: relative; width: 96px; height: 120px; margin: 0 auto 30px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-2); overflow: hidden; }
.scan-anim span { position: absolute; left: 18px; right: 18px; height: 6px; border-radius: 3px; background: #ECEDF1; }
.scan-anim span:nth-child(1) { top: 22px; right: 34px; } .scan-anim span:nth-child(2) { top: 38px; } .scan-anim span:nth-child(3) { top: 54px; right: 26px; }
.scan-anim span:nth-child(4) { top: 70px; } .scan-anim span:nth-child(5) { top: 86px; right: 44px; }
.scan-anim::after {
  content: ""; position: absolute; left: 0; right: 0; height: 34px; top: -34px;
  background: linear-gradient(to bottom, rgba(255, 107, 0, 0), rgba(255, 107, 0, .22)); border-bottom: 2px solid var(--o);
  animation: sweep 1.6s var(--ease) infinite;
}
@keyframes sweep { to { top: 120px; } }
@media (prefers-reduced-motion: reduce) { .scan-anim::after { animation: none; top: 40px; } }
.done-mark { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 26px; background: var(--ok-c); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.done-mark .ic { width: 42px; height: 42px; }
.result-file {
  display: flex; align-items: center; gap: 14px; margin: 30px auto 0; max-width: 460px; padding: 14px 16px; text-align: left;
  background: var(--surface); border-radius: 18px; border: 1px solid var(--line-2);
}
.result-file .glyph { width: 44px; height: 43px; }
.result-file b { display: block; font-size: 15px; font-weight: 600; word-break: break-word; }
.result-file span { font-size: 13.5px; color: var(--text-3); }
.saving { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 14px; border-radius: 999px; background: var(--ok-c); color: var(--ok); font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.continue { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.continue h2 { font-size: 16px; font-weight: 600; color: var(--text-2); font-family: var(--font); }
.continue .list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.continue a { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; transition: border-color .2s, box-shadow .3s var(--ease); }
.continue a:hover { border-color: var(--oc-line); box-shadow: var(--shadow-2); }
.continue a .glyph { width: 30px; height: 30px; border-radius: 50%; }
.continue a .glyph .ic { width: 17px; height: 17px; }

.alert { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 24px auto 0; max-width: 560px; padding: 14px 16px; border-radius: 16px; background: var(--err-c); color: #7A1A14; font-size: 14.5px; line-height: 1.45; }
.alert .ic { color: var(--err); width: 22px; height: 22px; }
.alert.soft { background: var(--oc); color: #6B3200; }
.alert.soft .ic { color: var(--o); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); opacity: 0;
  max-width: min(560px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 14px; background: var(--inv); color: #fff;
  font-size: 14.5px; box-shadow: var(--shadow-pop); transition: opacity .25s, transform .35s var(--ease); pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Result: preview + side panel ---------- */
.done { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: calc(100vh - var(--header)); }
.done-preview { padding: 28px 32px 56px; min-width: 0; }
.done-side {
  position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow: auto;
  background: var(--surface); border-left: 1px solid var(--line-2); padding: 32px 28px 36px;
}
.done-side .done-mark { width: 60px; height: 60px; border-radius: 20px; margin: 0 0 18px; }
.done-side .done-mark .ic { width: 34px; height: 34px; }
.done-side h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
.done-side .saving { margin-top: 12px; }
.done-side .result-file { margin: 20px 0 0; max-width: none; }
.done-side .dl { height: 60px; margin-top: 14px; font-size: 18px; font-weight: 700; }
.done-side .dl .ic { width: 24px; height: 24px; }
.done-side .alert { margin: 14px 0 0; max-width: none; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.side-actions .btn { padding: 0 12px; }
.done-side .continue { margin-top: 28px; padding-top: 22px; }
.done-side .continue .list { justify-content: flex-start; }
.continue.below { display: none; }

.pv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pv-head h2 { font-size: 22px; letter-spacing: -.015em; }
.pv-meta { font-size: 14px; font-weight: 500; color: var(--text-3); }
.pv-tools { margin-left: auto; }
.pv-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: -2px -2px 12px; scrollbar-width: thin; }
.pv-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; max-width: 280px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: border-color .2s, background-color .2s, color .2s;
}
.pv-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-chip .ic { width: 18px; height: 18px; color: var(--o); }
.pv-chip:hover { border-color: #C9CBD3; color: var(--ink); }
.pv-chip[aria-selected="true"] { background: var(--oc); border-color: var(--oc-line); color: var(--o-ink); }
.pv-loading { padding: 64px 0; text-align: center; color: var(--text-3); font-size: 14.5px; }
.pv-msg { max-width: 520px; margin: 24px auto; padding: 36px 28px; text-align: center; background: var(--surface); border-radius: 20px; border: 1px solid var(--line-2); color: var(--text-2); }
.pv-msg > .ic { width: 36px; height: 36px; color: var(--o); margin: 0 auto 12px; }
.pv-pw { display: flex; gap: 8px; margin-top: 18px; }
.pv-pw .field { flex: 1; }

.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.pv-page { margin: 0; width: 100%; max-width: 820px; }
.pv-sheet {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff;
  box-shadow: 0 1px 3px rgba(11, 13, 32, .12), 0 16px 36px -22px rgba(11, 13, 32, .35);
}
.pv-sheet img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pv-sheet .ph { width: 40%; aspect-ratio: .72; border-radius: 6px; background: linear-gradient(100deg, #eceef2 30%, #f7f8fa 50%, #eceef2 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.pv-page figcaption, .pv-image figcaption { margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; word-break: break-word; }
.pv-slide-text { width: 100%; height: 100%; padding: 6% 7%; overflow: hidden; }
.pv-slide-text h3 { font-size: 22px; margin-bottom: 12px; }
.pv-slide-text p { font-size: 14px; color: var(--text-2); margin-top: 4px; }

.pv-gallery { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pv-image { margin: 0; max-width: 100%; }
.pv-image img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; background: #fff; box-shadow: 0 1px 3px rgba(11, 13, 32, .12), 0 16px 36px -22px rgba(11, 13, 32, .35); }

.pv-text {
  margin: 0 auto; max-width: 820px; padding: 32px 36px; white-space: pre-wrap; word-break: break-word;
  background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(11, 13, 32, .12); font: 400 14.5px/1.6 var(--font); color: var(--ink);
}
.pv-paper {
  max-width: 820px; margin: 0 auto; padding: 56px 64px; background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(11, 13, 32, .12), 0 16px 36px -22px rgba(11, 13, 32, .35); font: 400 15px/1.55 var(--font);
}
.pv-paper h1 { font-size: 26px; margin: 18px 0 10px; } .pv-paper h2 { font-size: 21px; margin: 16px 0 8px; } .pv-paper h3 { font-size: 18px; margin: 14px 0 6px; }
.pv-paper p { margin: 0 0 8px; }
.pv-paper img { display: block; max-width: 100%; margin: 10px auto; }
.pv-bullet { display: inline-block; width: 1.2em; color: var(--text-2); }
.pv-break { border: 0; border-top: 1px dashed var(--line); margin: 28px -64px; }
.pv-table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; font-size: 13.5px; }
.pv-table td { border: 1px solid #C9CBD3; padding: 5px 8px; vertical-align: top; white-space: pre-wrap; }
.pv-book { background: #fff; border-radius: 14px; border: 1px solid var(--line-2); overflow: hidden; }
.pv-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 8px 8px 0; background: var(--bg); border-bottom: 1px solid var(--line-2); }
.pv-tab { flex: none; height: 36px; padding: 0 14px; border-radius: 10px 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--text-3); }
.pv-tab[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 -1px 0 var(--line-2) inset; }
.pv-grid { overflow: auto; max-height: 78vh; }
.pv-cells { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pv-cells td, .pv-cells th { border: 1px solid var(--line-2); padding: 5px 9px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pv-cells th { position: sticky; left: 0; background: var(--bg); color: var(--text-3); font-weight: 500; text-align: right; min-width: 40px; }
.pv-cells td.num { text-align: right; }
.pv-empty { padding: 14px 16px; font-size: 13.5px; color: var(--text-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav > a.wide { display: none; }
}
@media (max-width: 900px) {
  :root { --header: 60px; --gutter: 16px; }
  .nav, .top-end .app-link { display: none; }
  .burger { display: inline-flex; }
  .brand { font-size: 21px; } .brand img { width: 34px; height: 34px; }
  .hero { padding: 40px 0 24px; }
  .hero .lead { font-size: 16.5px; }
  .vf { padding: 16px 20px; }
  .vf-c { width: 20px; height: 20px; }
  .privacy { border-radius: 20px; text-align: left; padding-right: 14px; }
  .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 26px calc(var(--gutter) * -1) 22px; padding: 2px var(--gutter); scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tool-card { min-height: 0; padding: 18px 16px 18px; }
  .tool-card h2 { font-size: 16px; margin-top: 14px; }
  .tool-card p { font-size: 13.5px; }
  .tool-card .tag { top: 14px; right: 12px; padding: 0 8px 0 6px; }
  .tool-hero { padding: 32px 0 56px; }
  .drop { padding: 48px 16px 40px; margin-top: 28px; }
  .btn-xl { height: 62px; padding: 0 28px; font-size: 18px; }
  .ws { grid-template-columns: 1fr; }
  .ws-main { padding: 20px 16px 24px; }
  .ws-side { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line-2); }
  .side-body { overflow: visible; padding: 22px 16px 8px; }
  .side-foot { position: sticky; bottom: 0; z-index: 5; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -12px rgba(11, 13, 32, .18); }
  .side-foot .btn { height: 54px; font-size: 17px; }
  .files { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .pages { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .fcard.add { min-height: 220px; }
  .app-only { flex-direction: column; padding: 24px 20px; }
  .editor textarea { padding: 28px 22px; min-height: 55vh; }
  .state { padding: 48px 16px 64px; }
  .done { grid-template-columns: 1fr; }
  .done-side { order: -1; position: static; height: auto; overflow: visible; border-left: 0; border-bottom: 1px solid var(--line-2); padding: 24px 16px 22px; }
  .done-side .continue { display: none; }
  .continue.below { display: block; margin: 0 16px 40px; text-align: center; }
  .done-preview { padding: 20px 16px 40px; }
  .pv-paper { padding: 28px 20px; }
  .pv-break { margin: 22px -20px; }
  .pv-text { padding: 20px 18px; }
  .foot-links { margin-left: 0; }
  .doc .facts { grid-template-columns: 1fr; }
  .doc .facts dd { border-top: 0; padding-top: 0; }
}
@media (hover: none) {
  .fcard .x-btn, .fcard .moves, .pcard .ctrls { opacity: 1; }
  .tool-card:hover { transform: none; }
}

/* The page as plain HTML for readers that run no scripts (search engines, link previews). With scripts on, the real view replaces it. */
.js .static { display: none; }
