/* Base reset */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: a sectioned tool index (cards with a folded corner) that opens into a workbench: drop, arrange or mark up, set options, run, save. */
:root {
  --bg: #f1f2f8;
  --surface: #ffffff;
  --surface-2: #e9ebf7;
  --fg: #13152b;
  --muted: #5a5f80;
  --line: #d8dbee;
  --accent: #3a3fff;
  --accent-fg: #ffffff;
  --accent-2: #7b82ff;
  --accent-soft: #e4e5ff;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --good: #067647;
  --c-organize: #0b7f72;   --c-organize-soft: #dcf3ef;
  --c-optimize: #a85d00;   --c-optimize-soft: #fdeed2;
  --c-to: #b4206a;         --c-to-soft: #fbe3ef;
  --c-from: #6a3fd1;       --c-from-soft: #ebe4fb;
  --c-edit: #1d5fd1;       --c-edit-soft: #dde9fc;
  --c-security: #475467;   --c-security-soft: #e4e7ec;
  --c-review: #0e7c86;     --c-review-soft: #d9f2f3;
  --c-ai: #7a2fd6;         --c-ai-soft: #efe4fd;
  --c-advanced: #8a4b16;   --c-advanced-soft: #f6e8dc;
  --c-mine: #3a3fff;       --c-mine-soft: #e4e5ff;
  --c-workflows: #c2410c;  --c-workflows-soft: #fde6dc;
  --shadow: 0 1px 0 rgba(19,21,43,.04), 0 8px 24px -12px rgba(19,21,43,.18);
  --f-display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1f; --surface: #161933; --surface-2: #1f2347; --fg: #eceefb; --muted: #9ca1c8;
    --line: #2b3060; --accent: #8a90ff; --accent-fg: #0d0f1f; --accent-2: #b9bdff; --accent-soft: #272c68;
    --bad: #ff8f84; --bad-soft: #3b1b1d; --good: #4ade9b;
    --c-organize: #4fd6c3; --c-organize-soft: #11302d;
    --c-optimize: #ffb84d; --c-optimize-soft: #3a2a0d;
    --c-to: #ff7eb6;       --c-to-soft: #3d1830;
    --c-from: #b7a0ff;     --c-from-soft: #2a2050;
    --c-edit: #7aa9ff;     --c-edit-soft: #14284d;
    --c-security: #b6c0d0; --c-security-soft: #232a38;
  --c-review: #5ad8e0;   --c-review-soft: #0f2e31;
  --c-ai: #c9a2ff;     --c-ai-soft: #2c1b4a;
  --c-advanced: #f0b27a; --c-advanced-soft: #36240f;
    --c-mine: #8a90ff;     --c-mine-soft: #272c68;
    --c-review: #5ad8e0;   --c-review-soft: #0f2e31;
    --c-ai: #c9a2ff;       --c-ai-soft: #2c1b4a;
    --c-advanced: #f0b27a; --c-advanced-soft: #36240f;
    --c-mine: #8a90ff;     --c-mine-soft: #272c68;
    --c-workflows: #ff9a7a; --c-workflows-soft: #3a1d14;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f1f; --surface: #161933; --surface-2: #1f2347; --fg: #eceefb; --muted: #9ca1c8;
  --line: #2b3060; --accent: #8a90ff; --accent-fg: #0d0f1f; --accent-2: #b9bdff; --accent-soft: #272c68;
  --bad: #ff8f84; --bad-soft: #3b1b1d; --good: #4ade9b;
  --c-organize: #4fd6c3; --c-organize-soft: #11302d;
  --c-optimize: #ffb84d; --c-optimize-soft: #3a2a0d;
  --c-to: #ff7eb6;       --c-to-soft: #3d1830;
  --c-from: #b7a0ff;     --c-from-soft: #2a2050;
  --c-edit: #7aa9ff;     --c-edit-soft: #14284d;
  --c-security: #b6c0d0; --c-security-soft: #232a38;
  --c-review: #5ad8e0;   --c-review-soft: #0f2e31;
  --c-ai: #c9a2ff;       --c-ai-soft: #2c1b4a;
  --c-advanced: #f0b27a; --c-advanced-soft: #36240f;
  --c-mine: #8a90ff;     --c-mine-soft: #272c68;
  --c-workflows: #ff9a7a; --c-workflows-soft: #3a1d14;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  padding-block: 0 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 1120px; margin: 0 auto; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.brand svg { display: block; }
.top-note { font-family: var(--f-mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }

/* home */
.hero { padding-block: 28px 8px; max-width: 760px; }
.hero h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(32px, 5.4vw, 52px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; text-wrap: balance; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 56ch; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block: 28px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.search { margin-left: auto; min-width: 0; flex: 0 1 260px; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; }
.sec { margin-top: 30px; }
.sech { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; margin: 0 0 12px; }
.sech::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.cat-organize .sech { color: var(--c-organize); } .cat-optimize .sech { color: var(--c-optimize); }
.cat-to .sech { color: var(--c-to); } .cat-from .sech { color: var(--c-from); }
.cat-edit .sech { color: var(--c-edit); } .cat-security .sech { color: var(--c-security); }
.secn { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px;
  text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; color: var(--fg);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}
.card::after { content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 26px; background: linear-gradient(225deg, var(--bg) 50%, var(--surface-2) 50%); border-bottom-left-radius: 8px; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cat-organize .ico { background: var(--c-organize-soft); color: var(--c-organize); }
.cat-optimize .ico { background: var(--c-optimize-soft); color: var(--c-optimize); }
.cat-to .ico { background: var(--c-to-soft); color: var(--c-to); }
.cat-from .ico { background: var(--c-from-soft); color: var(--c-from); }
.cat-edit .ico { background: var(--c-edit-soft); color: var(--c-edit); }
.cat-security .ico { background: var(--c-security-soft); color: var(--c-security); }
.card h3 { font-family: var(--f-display); font-size: 19px; letter-spacing: -.01em; margin: 4px 0 0; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.io { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .02em; border-top: 1px dashed var(--line); padding-top: 10px; }
.empty { color: var(--muted); padding: 40px 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 44px; }
.fact { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; }
.fact b { display: block; font-family: var(--f-display); font-size: 16px; }
.fact span { color: var(--muted); font-size: 14px; }

/* tool view */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-block: 4px 18px; }
.crumb:hover { color: var(--fg); }
.thead { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.thead .ico { width: 54px; height: 54px; border-radius: 14px; }
.thead .ico svg { width: 28px; height: 28px; }
.thead h2 { font-family: var(--f-display); font-size: clamp(26px, 4vw, 36px); letter-spacing: -.025em; margin: 0; line-height: 1.1; }
.thead p { margin: 4px 0 0; color: var(--muted); }
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 820px) { .bench { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel h4 { margin: 0 0 12px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.drop { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 38px 16px; border: 2px dashed var(--line); border-radius: 12px; background: var(--bg); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-family: var(--f-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.drop .sub { color: var(--muted); font-size: 14px; }
.drop .ico { background: var(--surface-2); color: var(--muted); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; padding: 12px 16px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.files { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.file { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); }
.thumb { width: 52px; height: 66px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fname { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.fmeta { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.fnote { font-size: 13px; color: var(--muted); margin-top: 4px; }
.acts { display: flex; gap: 6px; }
.acts button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; line-height: 1; }
.acts button:hover:not([disabled]) { border-color: var(--accent); }
.acts button[disabled] { opacity: .35; cursor: default; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.hint { color: var(--muted); font-size: 13px; }
.fields { display: grid; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.field .help { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.rangeval { font-family: var(--f-mono); font-weight: 400; color: var(--muted); float: right; }
.side { display: grid; gap: 14px; position: sticky; top: 12px; }
@media (max-width: 820px) { .side { position: static; } }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.plabel { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.out { display: grid; gap: 10px; }
.outrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--f-display); }
.stat b { font-size: 28px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-family: var(--f-body); font-size: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; box-shadow: var(--shadow); }
.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; gap: 8px 24px; flex-wrap: wrap; }

/* page stage (crop, redact, sign, edit) */
.stage { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.stagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pglabel { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); min-width: 92px; text-align: center; }
.pagewrap { position: relative; width: 100%; max-width: 760px; margin: 0 auto; container-type: inline-size; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); touch-action: pan-y; }
.pagewrap canvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; cursor: crosshair; }
.ann { position: absolute; }
.annx { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); font-size: 13px; line-height: 20px; padding: 0; cursor: pointer; z-index: 2; }
.ann-redact { background: #000; outline: 1px solid #000; }
.ann-crop { outline: 2px dashed var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.ann-rect { border: 2px solid #d92d20; }
.ann-highlight { background: rgba(255,225,77,.45); }
.ann-whiteout { background: #fff; outline: 1px dashed #98a2b3; }
.ann-sign img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ann-text { white-space: nowrap; line-height: 1; font-family: Helvetica, Arial, sans-serif; }
.draft { pointer-events: none; outline: 2px dashed var(--accent); background: rgba(58,63,255,.12); }
.annin { position: absolute; border: 1px dashed var(--accent); background: rgba(255,255,255,.9); color: #000; padding: 0 2px; min-width: 120px; font-family: Helvetica, Arial, sans-serif; line-height: 1; outline: none; }
.sigbox { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); margin-top: 16px; }
.sigtabs { display: flex; gap: 8px; }
.sigcanvas { width: 100%; max-width: 420px; height: auto; aspect-ratio: 3 / 1; background: #fff; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; display: block; }
.sigrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sigrow input[type="text"], .sigrow select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.sigprev { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; max-width: 220px; }
.sigprev img { display: block; max-width: 100%; max-height: 64px; }

/* organize grid */
.orgbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.orggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 8px; display: grid; gap: 6px; justify-items: center; min-width: 0; }
.tthumb { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); border-radius: 6px; font-family: var(--f-mono); color: var(--muted); font-size: 12px; }
.tthumb img { max-width: 100%; max-height: 100%; display: block; transition: transform .15s; }
.tnum { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); }
.tacts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tacts button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; line-height: 1; font-size: 13px; }
.tacts button:hover:not([disabled]) { border-color: var(--accent); }
.tacts button[disabled] { opacity: .3; cursor: default; }

/* compare view */
.cmp { display: grid; gap: 10px; }
.cmprow { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.cmprow summary { cursor: pointer; padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.badge { font-family: var(--f-mono); font-size: 11.5px; padding: 2px 8px; border-radius: 99px; }
.badge.same { background: var(--c-organize-soft); color: var(--c-organize); }
.badge.diff { background: var(--bad-soft); color: var(--bad); }
.cmpbody { padding: 4px 12px 12px; display: grid; gap: 10px; }
.cmpbody canvas { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.dl { font-family: var(--f-mono); font-size: 12px; line-height: 1.5; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.dl div { white-space: pre-wrap; overflow-wrap: anywhere; }
.dl .add { color: var(--good); } .dl .del { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- accounts and plans ---------- */
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .top-note { display: none; } }
.acct { display: flex; align-items: center; gap: 10px; }
.navlink { color: var(--muted); text-decoration: none; font-size: 14px; }
.navlink:hover { color: var(--fg); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; text-decoration: none; background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); }
.pill.plan-pro { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; text-decoration: none; font-family: var(--f-display); }
.menuwrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 260px; display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.menu .hint { margin: 2px 0 0; }
.idp { width: 100%; text-align: center; font-weight: 600; }
.probadge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; vertical-align: 3px; background: var(--accent-soft); color: var(--accent); }
.propanel .probadge { margin-left: 0; margin-right: 4px; vertical-align: 1px; }
.gate { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gate .btn:not(.primary) { color: var(--fg); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; align-items: stretch; }
.plancard { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.plancard.hl { border: 2px solid var(--accent); }
.planname { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--f-display); font-size: 20px; font-weight: 700; }
.price b { font-family: var(--f-display); font-size: 36px; letter-spacing: -.03em; }
.price span { color: var(--muted); }
.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; align-content: start; }
.feat li { padding-left: 24px; position: relative; font-size: 14px; }
.feat li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.feat li.yes::before { content: "\2713"; color: var(--good); }
.feat li.no { color: var(--muted); }
.feat li.no::before { content: "\2013"; color: var(--muted); }
.stack { display: grid; gap: 8px; }
.narrow { max-width: 420px; }
.fine { margin-top: 18px; max-width: 70ch; }
.acctgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.acctgrid .panel { display: grid; gap: 12px; align-content: start; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.foot a { color: var(--muted); }

@media (max-width: 640px) { .search { margin-left: 0; flex: 1 1 100%; } }

/* ---------- new categories ---------- */
.cat-review .sech { color: var(--c-review); } .cat-review .ico { background: var(--c-review-soft); color: var(--c-review); }
.cat-ai .sech { color: var(--c-ai); } .cat-ai .ico { background: var(--c-ai-soft); color: var(--c-ai); }
.cat-advanced .sech { color: var(--c-advanced); } .cat-advanced .ico { background: var(--c-advanced-soft); color: var(--c-advanced); }
.cat-mine .sech { color: var(--c-mine); } .cat-mine .ico { background: var(--c-mine-soft); color: var(--c-mine); }

/* ---------- extra form controls ---------- */
.field textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; font: inherit; color: inherit; resize: vertical; }
.field input[type="file"] { width: 100%; font-size: 13px; }
.field.check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; }
.field.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.field.check label { font-weight: 500; margin: 0; }
.field.check .help { grid-column: 2; }
.fields.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field input[type="text"], .field input[type="email"] { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; }

/* ---------- markup stage ---------- */
.mk-svg, .mk-boxes, .mk-top { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mk-svg { overflow: visible; }
.mk-top > * { pointer-events: auto; }
.overlay:focus-visible { outline: 2px solid var(--accent); }
.mk-box { position: absolute; box-sizing: border-box; }
.mk-note { border-radius: 3px 3px 3px 0; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.mk-text { white-space: pre; line-height: 1.15; font-family: Helvetica, Arial, sans-serif; }
.mk-hl { opacity: .42; mix-blend-mode: multiply; }
.mk-sign img, .mk-stamp img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mk-stamp { display: grid; place-items: center; align-content: center; border: 2.5px solid; border-radius: 6px; font-family: Helvetica, Arial, sans-serif; text-align: center; line-height: 1.05; background: rgba(255,255,255,.35); }
.mk-stamp b { letter-spacing: .04em; } .mk-stamp span { opacity: .9; }
.mk-stamp:has(img) { border: 0; background: none; }
.mk-draft { fill: none; stroke: #3a3fff; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.mk-measure { fill: none; stroke: #d92d20; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mk-measure.area { fill: rgba(217,45,32,.14); }
.mk-mlabel { transform: translate(-50%, -50%); background: #fff; color: #b42318; border: 1px solid #d92d20; border-radius: 4px; padding: 1px 4px; white-space: nowrap; font-family: Helvetica, Arial, sans-serif; width: auto !important; height: auto !important; }
.mk-formfield { border: 1px dashed #5b5fe0; background: rgba(90,95,224,.12); color: #3a3fbf; font-family: Helvetica, Arial, sans-serif; overflow: hidden; padding: 1px 3px; }
.mk-formfield.kind-checkbox { background: rgba(90,95,224,.2); }
.mk-formfield.kind-signature { background: rgba(255,200,0,.18); border-color: #b58500; color: #8a6500; }
.mk-field { position: absolute; box-sizing: border-box; border: 1px solid #5b5fe0; background: rgba(228,229,255,.85); color: #111; padding: 0 3px; font-family: Helvetica, Arial, sans-serif; border-radius: 2px; }
.mk-field:focus { outline: 2px solid #3a3fff; background: #fff; }
.mk-check { margin: 0; accent-color: #3a3fff; }
textarea.annin { resize: none; min-width: 200px; background: #fffbe6; border-color: #e0b400; color: #111; }
.mk-list { display: grid; gap: 6px; }
.mk-listh { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.mk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.mk-desc { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.mk-go { font-family: var(--f-mono); font-size: 11.5px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 6px; cursor: pointer; color: var(--muted); }
.mk-ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-inline { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 4px 8px; font-size: 13px; width: 130px; max-width: 100%; }
.mk-inline.wide { width: 220px; }

/* ---------- reports and lists ---------- */
.tablewrap { overflow-x: auto; }
.facts-t { border-collapse: collapse; font-size: 13.5px; }
.facts-t th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 14px 4px 0; white-space: nowrap; }
.facts-t td { padding: 4px 0; overflow-wrap: anywhere; }
pre.code { margin: 0; padding: 10px 12px; font-family: var(--f-mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; background: var(--surface); border-top: 1px solid var(--line); }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.checks .badge { flex: none; }
.sigcheck { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.steps { display: grid; gap: 10px; margin: 10px 0; }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); display: grid; gap: 8px; }
.steph { display: flex; align-items: center; gap: 8px; }
.steph b { flex: 1; font-size: 14px; }
.stepn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; }
.steph .acts button { width: 26px; height: 26px; }
#step-add, #act-preset { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; }

/* ---------- AI ---------- */
.chat { display: grid; gap: 10px; margin: 6px 0; }
.msg { padding: 10px 12px; border-radius: 14px; max-width: 92%; overflow-wrap: anywhere; }
.msg.me { justify-self: end; background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.bot { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.pending { color: var(--muted); }
.msg.err { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.answer p { margin: 0 0 8px; } .answer ul { margin: 0 0 8px; padding-left: 20px; } .answer li { margin: 2px 0; }
.cite { font-family: var(--f-mono); font-size: 11.5px; padding: 0 4px; border-radius: 4px; background: var(--c-ai-soft); color: var(--c-ai); white-space: nowrap; }
.msgacts { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.askrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.askrow textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; font: inherit; color: inherit; resize: vertical; min-height: 44px; }

/* ---------- sharing ---------- */
.sharebox { display: grid; gap: 12px; }
.linkbox { flex: 1 1 220px; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 7px 10px; font-family: var(--f-mono); font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.sh-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin: 18px 0; }
.sh-head h1 { font-family: var(--f-display); font-size: clamp(22px, 4vw, 32px); letter-spacing: -.02em; margin: 8px 0 4px; overflow-wrap: anywhere; }
.sh-head p { margin: 0; }
.sh-note { margin-bottom: 18px; }
.sh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sh-layout.solo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .sh-layout { grid-template-columns: minmax(0, 1fr); } }
.sh-pages { display: grid; gap: 16px; min-width: 0; }
.sh-page { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; cursor: crosshair; max-width: 100%; }
.sh-layout.solo .sh-page { cursor: default; }
.sh-page canvas { display: block; width: 100%; height: 100%; }
.sh-pno { position: absolute; right: 8px; bottom: 6px; font-family: var(--f-mono); font-size: 11px; color: #667; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 6px; }
.sh-side { position: sticky; top: 12px; display: grid; gap: 12px; min-width: 0; }
@media (max-width: 860px) { .sh-side { position: static; } }
.sh-side > h4 { margin: 0; font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sh-form { display: grid; gap: 10px; }
.sh-form select, .sh-form textarea, .sh-form input[type="text"], .sh-form input[type="email"] { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; font: inherit; color: inherit; }
.sh-comments { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.sh-comment { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.sh-comment p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sh-cmeta { font-size: 12.5px; color: var(--muted); }
.sh-sig { position: absolute; outline: 2px dashed #3a3fff; background: rgba(58,63,255,.06); pointer-events: none; }
.sh-sig img { width: 100%; height: 100%; object-fit: contain; }
.sh-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; }
.sh-done { border-color: var(--good); }


/* ================= Website shell: header menus, footer, landing, sign-in, content pages ================= */
body { padding-bottom: 0; }
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); border-bottom: 1px solid transparent; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); padding-block: 10px; gap: 18px; justify-content: flex-start; }
header.top .top-right { margin-left: auto; flex-wrap: nowrap; gap: 8px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--bg); }
.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mainnav .navlink, .navbtn { color: var(--fg); font-weight: 500; font-size: 14.5px; padding: 8px 11px; border-radius: 9px; text-decoration: none; white-space: nowrap; }
.mainnav .navlink:hover, .navbtn:hover, .navbtn[aria-expanded="true"] { background: var(--surface); color: var(--accent); }
.navbtn { border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; font-size: 14.5px; }
.chev { width: 7px; height: 7px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.navbtn[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-1px); }
.ddwrap { position: relative; }
.dd { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px -16px rgba(19,21,43,.35); padding: 18px; }
.dd.mega { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow: auto; }
.dd.appsdd { left: auto; right: 0; width: min(520px, calc(100vw - 32px)); }
.dd h5 { margin: 0 0 8px; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cols { display: grid; gap: 18px 22px; }
.cols.two { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
.cols.many { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cols > div { display: grid; gap: 2px; align-content: start; }
.mlink { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--fg); text-decoration: none; font-size: 14px; }
.mlink:hover { background: var(--surface-2); }
.ico.mini { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.ico.mini svg { width: 15px; height: 15px; }
.iconbtn { border: 0; background: none; color: var(--fg); width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; font-size: 22px; line-height: 1; padding: 0; }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--surface); color: var(--accent); }
.dots { width: 16px; height: 16px; background: radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 0 / 6px 6px; display: block; }
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.apps > div { display: grid; gap: 6px; align-content: start; }
.appitem { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; color: var(--fg); text-decoration: none; cursor: pointer; font: inherit; }
.appitem:hover { border-color: var(--accent); }
.appitem b { font-size: 14px; }
.appitem span { font-size: 12.5px; color: var(--muted); }
.applinks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.applinks a { color: var(--fg); text-decoration: none; font-size: 14px; }
.applinks a:hover { color: var(--accent); }
.applinks hr { display: none; }
.burger { display: none; }
.burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; margin: 2px 0; }
.burger { flex-direction: column; }
.acct .navlink.login, .acct .navlink { color: var(--fg); font-weight: 500; padding: 8px 10px; }
@media (max-width: 1060px) { .mainnav .navlink:nth-child(3) { display: none; } }
@media (max-width: 920px) {
  .mainnav { display: none; }
  .burger { display: inline-flex; }
  .acct .navlink { display: none; }
}
@media (max-width: 520px) { .appsdd .apps { grid-template-columns: 1fr; } .acct .pill { display: none; } }
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(13,15,31,.45); display: flex; justify-content: flex-end; }
.drawerin { width: min(360px, 100%); height: 100%; overflow: auto; background: var(--bg); padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px; display: grid; gap: 6px; align-content: start; }
.drawerhead { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-display); font-size: 18px; }
.drawerauth { display: flex; gap: 8px; margin: 6px 0 10px; }
.drawerauth > * { flex: 1; text-align: center; }
.drawerauth .navlink { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.drawer details { border-top: 1px solid var(--line); padding: 4px 0; }
.drawer summary { cursor: pointer; font-weight: 600; padding: 9px 2px; }
.drawerlist { display: grid; gap: 2px; padding-bottom: 8px; }
.drawerfoot { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.drawerfoot a { color: var(--fg); text-decoration: none; }
body.noscroll { overflow: hidden; }

/* Footer: a dark full-width band in both themes */
.sitefoot { --foot-bg: #22232e; --foot-fg: #f4f4f8; --foot-muted: #b9bbcc; --foot-line: #3d3f50;
  margin-top: 80px; background: var(--foot-bg); color: var(--foot-fg); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: 52px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.footcols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 32px 24px; }
.footcol { display: grid; gap: 14px; align-content: start; }
.footcol h5 { margin: 0 0 6px; font-family: var(--f-display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--foot-fg); }
.footcol a { color: var(--foot-fg); text-decoration: none; opacity: .92; }
.footcol a:hover { color: #fff; opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.badges { display: grid; gap: 12px; align-content: start; }
.storebadge { display: flex; align-items: center; gap: 10px; min-width: 186px; border: 1.5px solid var(--foot-fg); border-radius: 9px; padding: 7px 16px 7px 12px; background: transparent; color: var(--foot-fg); text-decoration: none; cursor: pointer; font: inherit; text-align: left; }
.storebadge:hover { background: rgba(255,255,255,.08); }
.storebadge svg { width: 26px; height: 26px; flex: none; }
.storebadge span { display: grid; line-height: 1.15; }
.storebadge small { font-size: 10.5px; }
.storebadge b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sitefoot > .wrap { max-width: 1120px; margin: 0 auto; }
.footbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--foot-line); font-size: 14px; }
.footlang { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--foot-muted); border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.footlang svg { width: 18px; height: 18px; }
.footright { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.socials { display: flex; gap: 22px; }
.social { color: var(--foot-muted); display: inline-flex; }
.social:hover { color: #fff; }
@media (max-width: 980px) { .footcols { grid-template-columns: repeat(3, minmax(0, 1fr)); } .badges { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); } }
@media (max-width: 560px) { .footcols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Home */
.hero.center { margin-inline: auto; text-align: center; padding-block: 44px 18px; }
.hero.center p { margin-inline: auto; }
.cat-workflows .sech { color: var(--c-workflows); } .cat-workflows .ico { background: var(--c-workflows-soft); color: var(--c-workflows); }
.cat-ai .sech { color: var(--c-ai); } .cat-ai .ico { background: var(--c-ai-soft); color: var(--c-ai); }
.cat-advanced .sech { color: var(--c-advanced); } .cat-advanced .ico { background: var(--c-advanced-soft); color: var(--c-advanced); }
.cat-mine .sech { color: var(--c-mine); } .cat-mine .ico { background: var(--c-mine-soft); color: var(--c-mine); }

/* Tool landing: big title and select button before a file is chosen */
.landing { text-align: center; padding-block: 48px 8px; border-radius: 22px; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.landing.over { background: var(--accent-soft); outline-color: var(--accent); }
.landing h1 { font-family: var(--f-display); font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 10px; text-wrap: balance; }
.landing .lead { color: var(--muted); font-size: 18px; max-width: 54ch; margin: 0 auto 28px; text-wrap: pretty; }
.btn.huge { font-size: 20px; padding: 20px 46px; border-radius: 14px; box-shadow: 0 14px 30px -14px var(--accent); font-family: var(--f-display); }
.landing > .hint { margin: 12px 0 0; font-size: 14px; }
.howto, .related { text-align: left; max-width: 880px; margin: 64px auto 0; }
.howto h2, .related h2 { font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; margin: 0 0 16px; }
.howto ol { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.howto li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 16px 58px; position: relative; display: grid; gap: 3px; }
.howto li::before { content: counter(s); position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-display); font-weight: 700; }
.howto li span { color: var(--muted); font-size: 14px; }
.relgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.relcard { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--fg); text-decoration: none; font-weight: 500; }
.relcard:hover { border-color: var(--accent); }
.relcard .ico { width: 34px; height: 34px; flex: none; }

/* Sign-in pages */
.authwrap { display: grid; place-items: center; padding-block: 40px 20px; }
.authcard { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.authcard h1 { font-family: var(--f-display); font-size: 28px; letter-spacing: -.02em; margin: 0; }
.authcard > .hint { margin: -6px 0 4px; font-size: 14.5px; }
.authform { display: grid; gap: 14px; }
.authform .field input, .authform label input, .authform label select, .authform label textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 10px; padding: 11px 12px; font: inherit; }
.authform .field input:focus, .authform label input:focus, .authform label select:focus, .authform label textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.authform > label { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; }
.authform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--bad); }
.form-status:empty { display: none; }
#contact-form .form-status { color: var(--fg); }
.small-link { font-size: 13.5px; color: var(--accent); justify-self: start; text-decoration: none; }
.small-link:hover { text-decoration: underline; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.authfoot { text-align: center; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.authfoot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.idp { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* Content pages */
.page { padding-block: 32px 8px; }
.page.narrow { max-width: 760px; margin-inline: auto; }
.pagehead { margin-bottom: 28px; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.page h1 { font-family: var(--f-display); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; text-wrap: balance; }
.page h2 { font-family: var(--f-display); font-size: 22px; letter-spacing: -.02em; margin: 36px 0 10px; }
.page h3 { font-family: var(--f-display); font-size: 17px; margin: 0 0 6px; }
.page p, .page li { max-width: 68ch; }
.page .lead { font-size: 18px; color: var(--muted); }
.page a:not(.btn) { color: var(--accent); }
.page .btn { text-decoration: none; display: inline-block; color: var(--fg); }
.page .btn.primary { color: var(--accent-fg); }
.featgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-block: 8px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feat p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.feat .tools { font-size: 13.5px; margin: 0; }
.page .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 24px; }
.facts-table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.facts-table th, .facts-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.facts-table th { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 0 0 14px; color: var(--muted); }
.draft { background: var(--c-optimize-soft); color: var(--c-optimize); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 500; }
.legal h2 { font-size: 18px; }
.notfound { text-align: center; padding-block: 64px; }
.notfound h1 { font-family: var(--f-display); font-size: 40px; margin: 0 0 8px; }

a.btn { text-decoration: none; display: inline-block; color: inherit; }
a.btn.primary { color: var(--accent-fg); }


/* ================= Home: every tool on one screen ================= */
.wrap, .sitefoot > .wrap { max-width: 1320px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Each category gives its colour to icons, chips and pills through --cc. */
.cat-organize { --cc: var(--c-organize); } .cat-optimize { --cc: var(--c-optimize); } .cat-to { --cc: var(--c-to); } .cat-from { --cc: var(--c-from); }
.cat-edit { --cc: var(--c-edit); } .cat-security { --cc: var(--c-security); } .cat-review { --cc: var(--c-review); } .cat-ai { --cc: var(--c-ai); }
.cat-advanced { --cc: var(--c-advanced); } .cat-mine { --cc: var(--c-mine); } .cat-workflows { --cc: var(--c-workflows); }
:root { --ico-fg: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ico-fg: #0d0f1f; } }
:root[data-theme="dark"] { --ico-fg: #0d0f1f; }
[class*="cat-"] .ico, .ico[class*="cat-"] { background: var(--cc, var(--accent)); color: var(--ico-fg); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.ico svg { stroke-width: 2; }

/* File-type tiles: the format's own colour and letters, plus a small red PDF tag showing the direction. */
.ico.fmt { position: relative; background: var(--fc) !important; color: #fff !important; overflow: visible; }
.ico.fmt b { font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; line-height: 1; }
.ico.fmt b.long { font-size: 11px; letter-spacing: 0; }
.ico.fmt i { position: absolute; font-style: normal; font-family: var(--f-body); font-weight: 700; font-size: 8px; letter-spacing: .02em; line-height: 1;
  background: #e5322d; color: #fff; padding: 2px 3px; border-radius: 4px; box-shadow: 0 0 0 2px var(--surface); }
.ico.fmt.to i { right: -5px; bottom: -4px; }
.ico.fmt.from i { left: -5px; top: -4px; }
.ico.fmt.mini b { font-size: 11px; } .ico.fmt.mini b.long { font-size: 7.5px; }
.ico.fmt.mini i { font-size: 6px; padding: 1px 2px; }

/* Compact hero */
.hero.compact { padding-block: 18px 0; }
.hero.compact h1 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 6px; }
.hero.compact p { font-size: 15px; }

/* Filter bar: stays under the header while you scroll */
.bar { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--bg); margin-block: 10px 8px; padding-block: 8px; gap: 10px; flex-wrap: nowrap; }
.bar .chips { flex: 1 1 auto; min-width: 0; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.bar .chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 9px; font-size: 13px; font-weight: 500; color: var(--fg); white-space: nowrap; transition: background .12s, border-color .12s; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--cc, var(--fg)); flex: none; }
.chip.cat-all::before { background: conic-gradient(var(--c-organize) 0 25%, var(--c-to) 0 50%, var(--c-edit) 0 75%, var(--c-ai) 0); border-radius: 50%; }
.chip .n { font-family: var(--f-mono); font-size: 11px; color: var(--muted); display: none; }
.chips.counting .chip .n { display: inline; }
.chip:hover { border-color: var(--cc, var(--accent)); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.chip.none { opacity: .45; }
.search { position: relative; flex: 0 1 190px; min-width: 150px; margin-left: 0; }
.search input { padding-right: 34px; height: 34px; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; pointer-events: none; background: var(--bg); }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }

/* Recently used */
.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.recentlbl { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.recentpill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.recentpill:hover { border-color: var(--cc); }
.recentpill .ico.mini { width: 24px; height: 24px; border-radius: 50%; }
.recentpill .ico.mini svg { width: 13px; height: 13px; }

/* The grid: small cards, icon beside the name, two-line description */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 9px; }
.toolgrid .card { flex-direction: row; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 11px; min-height: 76px; border-radius: 12px; box-shadow: 0 1px 2px rgba(19,21,43,.05);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.toolgrid .card::after { width: 14px; height: 14px; border-bottom-left-radius: 5px; }
.toolgrid .card:hover, .toolgrid .card:focus-visible { transform: translateY(-2px); border-color: var(--cc); box-shadow: 0 10px 24px -14px var(--cc); outline: none; }
.toolgrid .card:hover .ico { transform: scale(1.06) rotate(-3deg); }
.toolgrid .ico { width: 36px; height: 36px; border-radius: 9px; transition: transform .14s ease; }
.toolgrid .ico svg { width: 19px; height: 19px; }
.toolgrid .ico.fmt b { font-size: 15px; } .toolgrid .ico.fmt b.long { font-size: 10px; }
.cardtxt { display: grid; gap: 3px; min-width: 0; flex: 1 1 0; overflow: hidden; }
.toolgrid .card h3 { display: block; font-family: var(--f-display); font-size: 14.5px; line-height: 1.3; letter-spacing: -.01em; margin: 0; padding-right: 6px; overflow-wrap: anywhere; }
.icocol { display: grid; justify-items: center; gap: 5px; flex: none; }
.icocol .probadge, .icocol .newbadge { margin: 0; vertical-align: 0; font-size: 8.5px; padding: 1px 4px; }
.toolgrid .card p { font-size: 12px; line-height: 1.32; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toolgrid .probadge, .newbadge { font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; line-height: 1.5; }
.newbadge { background: var(--good); color: var(--surface); }
.gridnote { color: var(--muted); text-align: center; margin: 18px 0 0; }
.gridnote:empty { display: none; }
.facts { margin-top: 36px; }

/* Menus and related tools reuse the solid icons */
.mlink .ico.mini, .relcard .ico { box-shadow: none; }

@media (max-width: 1180px) {
  .bar { flex-wrap: wrap; top: calc(58px + env(safe-area-inset-top, 0px)); }
  .bar .chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; mask-image: linear-gradient(90deg, #000 92%, transparent); }
  .bar .chips::-webkit-scrollbar { display: none; }
  .search { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .toolgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .toolgrid .card { flex-direction: column; gap: 9px; padding: 12px; min-height: 0; }
  .cardtxt { flex: none; }
  .icocol { grid-auto-flow: column; align-items: center; justify-content: start; }
  .toolgrid .card p { -webkit-line-clamp: 2; font-size: 12px; }
  .toolgrid .card h3 { font-size: 14px; }
  .search kbd { display: none; }
}
.toolgrid .probadge { margin-left: 0; vertical-align: 0; }


/* ================= Outline icons and Geist type ================= */
body { font-feature-settings: "ss01", "cv11"; letter-spacing: -.005em; }
h1, h2, h3, .brand, .hero h1, .landing h1, .page h1 { font-weight: 600; letter-spacing: -.035em; }
.toolgrid .card h3 { font-weight: 600; letter-spacing: -.02em; }
/* Icons are line drawings in their category colour inside a thin outlined tile; nothing is filled. */
[class*="cat-"] .ico, .ico[class*="cat-"] { background: transparent; color: var(--cc, var(--accent)); box-shadow: inset 0 0 0 1.5px var(--cc, var(--accent)); }
.ico svg { stroke-width: 1.8; }
.ico.fmt { --fcx: var(--fc); background: transparent !important; color: var(--fcx) !important; box-shadow: inset 0 0 0 1.5px var(--fcx); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico.fmt { --fcx: color-mix(in srgb, var(--fc) 55%, #ffffff); } }
:root[data-theme="dark"] .ico.fmt { --fcx: color-mix(in srgb, var(--fc) 55%, #ffffff); }
.ico.fmt b { font-weight: 600; }
.ico.fmt i { background: var(--surface); color: #e5322d; box-shadow: inset 0 0 0 1px #e5322d, 0 0 0 2px var(--surface); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico.fmt i { color: #ff7a75; box-shadow: inset 0 0 0 1px #ff7a75, 0 0 0 2px var(--surface); } }
:root[data-theme="dark"] .ico.fmt i { color: #ff7a75; box-shadow: inset 0 0 0 1px #ff7a75, 0 0 0 2px var(--surface); }
.toolgrid .card:hover .ico { background: color-mix(in srgb, var(--cc, var(--accent)) 10%, transparent); }
.toolgrid .card:hover .ico.fmt { background: color-mix(in srgb, var(--fcx) 10%, transparent) !important; }
.recentpill .ico.mini, .mlink .ico.mini { box-shadow: inset 0 0 0 1.25px var(--cc, var(--accent)); }
.recentpill .ico.fmt.mini, .mlink .ico.fmt.mini { box-shadow: inset 0 0 0 1.25px var(--fcx); }
.newbadge { background: transparent; color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.toolgrid .probadge, .icocol .probadge { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Pricing: payment note and billing questions */
.hint.center { text-align: center; margin: 0; }
.paysecure { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 14px; color: var(--muted); }
.paysecure b { color: var(--fg); font-weight: 600; }
.paysecure .lock { width: 16px; height: 18px; flex: none; position: relative; border: 1.8px solid var(--good); border-radius: 4px; margin-top: 6px; }
.paysecure .lock::before { content: ""; position: absolute; left: 2px; right: 2px; top: -8px; height: 9px; border: 1.8px solid var(--good); border-bottom: 0; border-radius: 6px 6px 0 0; }
.paymarks { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.paymark { font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; }
.billfaq { max-width: 760px; margin-top: 36px; }
.billfaq h2 { font-family: var(--f-display); font-size: 22px; margin: 0 0 6px; }
.billfaq .faq p { color: var(--muted); margin: 0 0 14px; }
a.btn.wide { display: block; text-align: center; }


/* ================= Home: the tool shelf (one panel per group) ================= */
.shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.shelfcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shelf.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.group { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 10px 10px; position: relative; overflow: hidden; }
.group::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--cc); }
.group header { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; }
.group h2 { margin: 0; font-family: var(--f-display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); }
.gcount { font-family: var(--f-mono); font-size: 11px; color: var(--cc); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; line-height: 17px; }
.ghint { margin: 2px 8px 8px; font-size: 12.5px; color: var(--muted); }
.group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 9px; color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .12s; }
.trow:hover, .trow:focus-visible { background: color-mix(in srgb, var(--cc) 10%, transparent); outline: none; }
.trow:hover .tname { color: var(--cc); }
.trow .ico.mini { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.trow .ico.mini svg { width: 16px; height: 16px; }
.trow .ico.fmt.mini b { font-size: 12px; } .trow .ico.fmt.mini b.long { font-size: 8px; }
.trow .tname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .probadge, .trow .newbadge { flex: none; margin: 0; font-family: var(--f-mono); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 0 5px; border-radius: 4px; line-height: 16px; vertical-align: 0; background: transparent; }
.trow .probadge { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.trow::after { content: "→"; color: var(--cc); opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s; flex: none; }
.trow:hover::after { opacity: 1; transform: none; }
.shelf.single .trow { padding-block: 8px; }
@media (max-width: 560px) { .shelf { display: flex; flex-direction: column; align-items: stretch; } .shelfcol { display: contents; } }


/* ================= Minimal look ================= */
/* Quieter, flatter neutrals in both themes. */
:root { --bg: #f7f7f9; --surface: #ffffff; --surface-2: #f0f1f5; --fg: #15161c; --muted: #6b6e7d; --line: #e6e7ec;
  --shadow: 0 1px 2px rgba(20,22,30,.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0c0d14; --surface: #13141d; --surface-2: #1b1c27; --fg: #ecedf3; --muted: #9496a8; --line: #24263a; --shadow: none; } }
:root[data-theme="dark"] { --bg: #0c0d14; --surface: #13141d; --surface-2: #1b1c27; --fg: #ecedf3; --muted: #9496a8; --line: #24263a; --shadow: none; }

/* Theme controls */
.themebtn svg { display: block; }
.themerow { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.themeseg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; }
.themeseg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.themeseg button[aria-checked="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Home: neutral chips without dots */
.chip { background: transparent; border-color: var(--line); color: var(--muted); }
.chip::before { display: none; }
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.search input { background: var(--surface); }
.hero.compact h1 { font-weight: 600; }

/* Panels: plain, with the group colour only as a small dot */
.group { box-shadow: none; border-radius: 14px; padding: 18px 12px 12px; }
.group::before { display: none; }
.group header { align-items: center; }
.group header::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cc); flex: none; }
.group h2 { font-size: 15.5px; }
.gcount { border: 0; padding: 0; color: var(--muted); font-size: 11.5px; margin-left: auto; }
.ghint { margin: 2px 8px 10px 23px; font-size: 12.5px; }

/* Rows and icons: one neutral colour; the group colour appears on hover */
.trow { font-weight: 450; color: var(--fg); }
.trow .ico.mini, .recentpill .ico.mini, .mlink .ico.mini, .relcard .ico { color: var(--muted) !important; box-shadow: inset 0 0 0 1px var(--line) !important; background: transparent !important; }
.trow .ico.mini { border-radius: 8px; }
.ico.fmt.mini i, .relcard .ico.fmt i { display: none; }
.trow:hover, .trow:focus-visible { background: var(--surface-2); }
.trow:hover .tname { color: var(--fg); }
.trow:hover .ico.mini, .mlink:hover .ico.mini, .recentpill:hover .ico.mini, .relcard:hover .ico { color: var(--cc) !important; box-shadow: inset 0 0 0 1.25px var(--cc) !important; }
.trow:hover .ico.fmt.mini, .mlink:hover .ico.fmt.mini, .recentpill:hover .ico.fmt.mini, .relcard:hover .ico.fmt { color: var(--fcx) !important; box-shadow: inset 0 0 0 1.25px var(--fcx) !important; }
.trow::after { color: var(--muted); }
.trow .probadge { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.trow .newbadge { color: var(--good); box-shadow: none; padding: 0; }
.recentpill { background: transparent; }
.recentpill:hover { border-color: var(--fg); }

/* Footer stays dark in both themes, a touch softer */
.sitefoot { --foot-bg: #15161c; --foot-line: #2a2c38; }

/* ================= PDF editor (full screen) ================= */
.ed { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--bg); color: var(--fg); font-size: 14px;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.ed .edi svg { display: block; }
.edtop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.edleft, .edright { display: flex; align-items: center; gap: 4px; min-width: 0; }
.edright { justify-content: flex-end; }
.edfile { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px; max-width: 220px; }
.edcenter { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.edsep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex: none; }
.edmode { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; flex: none; }
.edmode button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.edmode button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.edcrown { display: inline-flex; color: #f5b400; }
.edcrown.small { position: absolute; top: 3px; right: 4px; }
.edtools { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.edtools::-webkit-scrollbar { display: none; }
.edtool { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; border: 0; background: none; color: var(--fg); font: inherit; font-size: 11px; padding: 6px 6px 4px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.edtool:hover { background: var(--surface-2); }
.edtool[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.edib { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; color: var(--fg); border-radius: 9px; cursor: pointer; flex: none; }
.edib:hover:not(:disabled) { background: var(--surface-2); }
.edib:disabled { opacity: .35; cursor: default; }
.edib.small { width: 28px; height: 28px; }
.edib[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.edib.danger { color: var(--bad); }
.edzoom { border: 0; background: none; color: var(--fg); font: inherit; font-family: var(--f-mono); font-size: 12px; min-width: 48px; cursor: pointer; border-radius: 8px; padding: 6px 4px; }
.edzoom:hover { background: var(--surface-2); }
.edsave { margin-left: 8px; padding: 8px 18px; }
.edprops { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-height: 48px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.edgrow { flex: 1; }
.edlbl { font-size: 12px; color: var(--muted); margin-right: 6px; }
.edsel, .ednum, .edrange, .edcolor { display: inline-flex; align-items: center; position: relative; }
.edprops select, .edprops input[type="number"], .edprops input[type="url"] { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
.edprops input[type="number"] { width: 64px; }
.edurl { width: 280px; }
.edrange input { width: 90px; accent-color: var(--accent); }
.edval { font-family: var(--f-mono); font-size: 11px; color: var(--muted); width: 34px; text-align: right; }
.edseg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.edseg button { border: 0; background: none; color: var(--fg); font: inherit; font-size: 13px; padding: 5px 10px; cursor: pointer; display: inline-flex; align-items: center; }
.edseg button + button { border-left: 1px solid var(--line); }
.edseg button[aria-checked="true"] { background: var(--fg); color: var(--bg); }
.edtog { min-width: 30px; height: 30px; border: 1px solid var(--line); background: none; color: var(--fg); border-radius: 8px; cursor: pointer; font: inherit; }
.edtog[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.edtog:nth-of-type(2) b { font-style: italic; font-weight: 500; font-family: Georgia, serif; }
.edswatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent); cursor: pointer; padding: 0; }
.edswatch.none { background: linear-gradient(135deg, transparent 45%, var(--bad) 45%, var(--bad) 55%, transparent 55%), var(--surface) !important; }
.edpop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(0,0,0,.35); }
.edcustom { width: 22px; height: 22px; border-radius: 6px; overflow: hidden; border: 1px dashed var(--muted); cursor: pointer; }
.edcustom input { opacity: 0; width: 22px; height: 22px; cursor: pointer; }
.edstamps { display: flex; flex-wrap: wrap; gap: 6px; }
.edstampb { font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em; border: 1.5px solid currentColor; background: none; border-radius: 6px; padding: 3px 8px; cursor: pointer; opacity: .6; }
.edstampb[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent); }
.edsigprev { height: 32px; background: #fff; border-radius: 6px; padding: 2px 6px; border: 1px solid var(--line); }
.edbody { display: grid; grid-template-columns: 168px minmax(0, 1fr); min-height: 0; }
.edside { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 10px 10px 30px; }
.edsidehead { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.edpro { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.edpro .edi { color: #f5b400; }
.edthumbs { display: grid; gap: 12px; }
.edthumb { position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.edthumb:hover { background: var(--surface-2); }
.edthumb.cur { border-color: var(--accent); }
.edthumb.dropto { box-shadow: 0 -3px 0 var(--accent); }
.edthumb.dragging { opacity: .4; }
.edtframe { width: 100%; display: grid; place-items: center; }
.edtimg { width: 100%; max-width: 120px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); overflow: hidden; transition: transform .15s; }
.edtimg img { width: 100%; height: 100%; display: block; object-fit: cover; }
.edtnum { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.edtacts { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.edtacts button { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 6px; cursor: pointer; padding: 0; }
.edtacts button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.edtacts button:disabled { opacity: .3; }
.edscroll { overflow: auto; background: var(--surface-2); position: relative; overscroll-behavior: contain; }
.edpages { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 24px 80px; min-width: min-content; }
.edpwrap { display: grid; gap: 6px; justify-items: center; }
.edplabel { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.edpage { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 8px 24px -12px rgba(0,0,0,.25); }
.edsheet { position: absolute; left: 0; top: 0; transform-origin: 0 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.edcanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.edlayer, .edhints { position: absolute; inset: 0; }
.ed[data-tool="text"] .edsheet, .ed[data-tool="edittext"] .edsheet { cursor: text; }
.ed[data-tool="pen"] .edsheet, .ed[data-tool="shape"] .edsheet, .ed[data-tool="whiteout"] .edsheet, .ed[data-tool="link"] .edsheet, .ed[data-tool="markup"] .edsheet { cursor: crosshair; }
.ed[data-tool="note"] .edsheet, .ed[data-tool="stamp"] .edsheet, .ed[data-tool="sign"] .edsheet { cursor: copy; }
.edhint { position: absolute; border-radius: 2px; outline: 1px dashed transparent; }
.ed[data-tool="edittext"] .edhint { outline-color: color-mix(in srgb, #3a3fff 35%, transparent); }
.ed[data-tool="edittext"] .edhint:hover { background: color-mix(in srgb, #3a3fff 10%, transparent); outline-style: solid; }
.edfound { position: absolute; background: rgba(255, 200, 0, .35); border-radius: 2px; }
.edfound.cur { background: rgba(255, 120, 0, .55); outline: 1px solid #f97316; }
/* Objects on the page (sizes are PDF points) */
.eo { position: absolute; box-sizing: border-box; }
.ed[data-tool="select"] .eo { cursor: move; }
.eo-text { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.2em; outline: none; }
.eo-text.empty { outline: 1px dashed #3a3fff; }
.eo.editing { cursor: text; outline: 1px solid #3a3fff; }
.eo.editing [contenteditable], .eo-text[contenteditable] { outline: none; cursor: text; user-select: text; -webkit-user-select: text; }
.eo-edittext { overflow: visible; }
.eotx { position: absolute; white-space: pre; outline: none; min-width: 2px; }
.eo-image img, .eo-sign img { width: 100%; height: 100%; display: block; pointer-events: none; }
.eo-stamp { border: 2.2px solid; border-radius: 6px; display: grid; place-items: center; font-family: Helvetica, Arial, sans-serif; font-weight: 700; letter-spacing: .04em; white-space: nowrap; overflow: hidden; }
.eo-link { border: 1px dashed #1d4ed8; background: rgba(29, 78, 216, .08); color: #1d4ed8; font: 9px/1.2 var(--f-body); padding: 1px 3px; overflow: hidden; white-space: nowrap; }
.eo-note { display: grid; place-items: center; background: #fff7cc; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.eomk { position: absolute; mix-blend-mode: multiply; opacity: .4; }
.eo-ul .eomk, .eo-so .eomk { opacity: 1; mix-blend-mode: normal; }
.eo svg { display: block; overflow: visible; }
.edselbox { position: absolute; border: 1.5px solid #3a3fff; pointer-events: none; }
.edselbox.noframe { border-color: transparent; }
.edh { position: absolute; background: #fff; border: 1.5px solid #3a3fff; border-radius: 2px; pointer-events: auto; }
.h-nw { left: 0; top: 0; cursor: nwse-resize; } .h-ne { right: 0; top: 0; cursor: nesw-resize; transform: translate(100%, 0); }
.h-sw { left: 0; bottom: 0; cursor: nesw-resize; transform: translate(0, 100%); } .h-se { right: 0; bottom: 0; cursor: nwse-resize; transform: translate(100%, 100%); }
.h-e { right: 0; top: 50%; cursor: ew-resize; transform: translate(100%, -50%); } .h-w { left: 0; top: 50%; cursor: ew-resize; transform: translate(0, -50%); }
.edselbox .edh[data-h="p1"], .edselbox .edh[data-h="p2"] { border-radius: 50%; cursor: crosshair; margin: 0; }
.edghost { position: absolute; border: 1px dashed #3a3fff; background: rgba(58, 63, 255, .06); pointer-events: none; }
.edghost.g-ellipse { border-radius: 50%; }
.edghost.g-line, .edghost.g-arrow { height: 0; border: 0; border-top: 2px dashed #3a3fff; transform-origin: 0 0; background: none; }
.edghost.g-markup { background: rgba(255, 212, 0, .25); border-color: #e0a800; }
.edinklive { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.ednotepop { position: absolute; z-index: 3; width: 220px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 12px 32px -12px rgba(0,0,0,.4); display: grid; gap: 8px; }
.ednotepop textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font: 13px/1.4 var(--f-body); padding: 6px 8px; resize: vertical; }
.ednotepop .row { display: flex; justify-content: flex-end; gap: 6px; }
.edstatus { padding: 6px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); min-height: 30px; }
.edfind { position: absolute; top: 120px; right: 20px; z-index: 6; width: 300px; display: grid; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px -16px rgba(0,0,0,.4); }
.edfindhead, .edmodalhead { display: flex; align-items: center; justify-content: space-between; }
.edfind input[type="search"], .edfind input[type="text"] { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 9px; padding: 8px 10px; font: inherit; }
.edfindopts { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.edfind .row { display: flex; gap: 6px; flex-wrap: wrap; }
.edfind .hint { margin: 0; }
.edmodal { position: absolute; inset: 0; z-index: 8; background: rgba(10, 11, 18, .45); display: grid; place-items: center; padding: 16px; }
.edmodalbox { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 10px; }
.edkeys { border-collapse: collapse; font-size: 13.5px; }
.edkeys td { padding: 5px 10px 5px 0; }
.edkeys kbd { font-family: var(--f-mono); font-size: 11.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.edsummary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.edsummary p { margin: 0; display: flex; align-items: center; gap: 8px; }
@media (max-width: 1360px) { .edtool > span:not(.edi):not(.edcrown) { display: none; } .edtool { min-width: 38px; padding: 8px; } .edfile { max-width: 140px; } }
@media (max-width: 1000px) { .edfile { display: none; } }
@media (max-width: 760px) {
  .edtop { grid-template-columns: auto minmax(0, 1fr) auto; }
  .edbody { grid-template-columns: minmax(0, 1fr); }
  .edside { display: none; }
  .ed.sideopen .edbody { grid-template-columns: 120px minmax(0, 1fr); }
  .ed.sideopen .edside { display: block; }
  .edright .edzoom, .edright .edib[aria-label="Zoom in"], .edright .edib[aria-label="Zoom out"], .edright .edib[aria-label="Keyboard shortcuts"] { display: none; }
  .edmode button { padding: 6px 10px; }
}
.edsave { white-space: nowrap; }
@media (max-width: 760px) {
  .edtop { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "l m r" "c c c"; row-gap: 6px; padding: 6px 8px; }
  .edleft { grid-area: l; } .edright { grid-area: r; }
  .edcenter { grid-area: c; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .edcenter .edsep { display: none; }
  .edtools { overflow: visible; }
  .edsave { padding: 7px 12px; margin-left: 4px; }
  .edprops { padding: 6px 10px; gap: 8px; }
  .edurl { width: 200px; }
}
@media (max-width: 760px) { .edcenter .edtools { flex: none; } .edtool { min-width: 40px; } }

/* "Why Foldline" strip */
.trust { margin: 64px auto 8px; max-width: 1080px; text-align: center; }
.trust .eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.trust > h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.03em; line-height: 1.2; margin: 0 auto 34px; max-width: 24ch; text-wrap: balance; }
.trustgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.trustitem { padding: 34px 32px 32px; text-align: left; position: relative; }
.trustitem + .trustitem::before { content: ""; position: absolute; left: 0; top: 28px; bottom: 28px; width: 1px; background: var(--line); }
.trusticon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--accent); margin-bottom: 18px; }
.trustitem h3 { font-family: var(--f-display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.trustitem p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.trustmore { margin: 22px 0 0; font-size: 14px; }
.trustmore a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.trustmore a:hover { border-color: var(--fg); }
@media (max-width: 760px) {
  .trustgrid { grid-template-columns: minmax(0, 1fr); }
  .trustitem { padding: 26px 4px; }
  .trustitem + .trustitem::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; }
}

/* Sign-in pages: brand, provider buttons */
.authcard { padding: 34px 30px 26px; gap: 12px; }
.authcard h1 { text-align: center; font-size: 26px; }
.authcard > .hint { text-align: center; }
.authbrand { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; margin: 0 auto 6px; }
.authbrand svg { display: block; }
.idps { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.idps.n1 { grid-template-columns: minmax(0, 1fr); }
.idps.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.idp { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: border-color .12s, background .12s, transform .12s; }
.idp:hover { border-color: var(--fg); }
.idp:active { transform: translateY(1px); }
.idpicon { display: inline-grid; place-items: center; flex: none; }
.idpicon svg { display: block; }
.idp-Facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
.idp-Facebook:hover { background: #166fe0; border-color: #166fe0; }
.idp-SignInWithApple { background: #000; border-color: #000; color: #fff; }
.idp-SignInWithApple:hover { background: #1a1a1a; border-color: #1a1a1a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .idp-SignInWithApple { background: #fff; border-color: #fff; color: #000; } }
:root[data-theme="dark"] .idp-SignInWithApple { background: #fff; border-color: #fff; color: #000; }
.or { margin: 10px 0 2px; }
.authform .field input::placeholder { color: var(--muted); }
.linkish { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
@media (max-width: 420px) { .idps.n3 { grid-template-columns: minmax(0, 1fr); } .authcard { padding: 26px 18px 20px; } }

/* Signature & Stamp Studio */
.studio { gap: 12px; padding: 16px; }
.sthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stkind { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; }
.stkind button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.stkind button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.sigtabs .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.stchips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.stchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.stchip[aria-checked="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); font-weight: 600; }
.stdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.stdrop { display: grid; gap: 8px; justify-items: start; padding: 18px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface); }
.stdrop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.stdrop > span { color: var(--muted); font-size: 14px; }
.stimport { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 16px; align-items: start; }
.stcrop { position: relative; justify-self: start; max-width: 100%; cursor: crosshair; touch-action: none; user-select: none; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.stsrc { display: block; max-width: 100%; height: auto; }
.stsel { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(10, 12, 20, .45); pointer-events: none; border-radius: 3px; }
.stctrl { display: grid; gap: 12px; align-content: start; }
.stslider { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stslider input { accent-color: var(--accent); width: 100%; }
.stcheck, .stconsent { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.stconsent { font-weight: 600; }
.stresult { display: grid; place-items: center; min-height: 140px; padding: 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff repeating-conic-gradient(#f1f1f4 0 25%, #fff 0 50%) 0 0 / 18px 18px; }
.stresult img { max-width: 100%; max-height: 260px; display: block; }
.stfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.stfield { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.stfield input { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; }
.stsaved { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stsaved:empty { display: none; }
.stlbl { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.stsaveditem { position: relative; }
.stsavedb { display: grid; place-items: center; height: 52px; min-width: 70px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.stsavedb:hover { border-color: var(--accent); }
.stsavedb img { max-height: 42px; max-width: 120px; display: block; }
.stforget { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.stfoot { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.ststatus:empty { display: none; }
.edmodalbox .studio { border: 0; padding: 0; margin: 0; background: none; }
.edmodalbox { width: min(860px, 100%); }
@media (max-width: 720px) { .stimport { grid-template-columns: minmax(0, 1fr); } }

/* live camera in the studio */
.stcam { display: grid; gap: 10px; }
.stcamview { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; max-height: 420px; }
.stvideo { width: 100%; height: 100%; object-fit: contain; display: block; }
.stvideo.flipped { transform: scaleX(-1); }
.stguide { position: absolute; inset: 18% 12%; border: 2px dashed rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.stcount { position: absolute; inset: 0; display: grid; place-items: center; font: 600 72px/1 var(--font, inherit); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none; }
.stcam .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* typed signature styles */
.stfonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stfont { min-width: 0; padding: 8px 12px; font-size: 30px; line-height: 1.5; color: #1d3a94; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stfont[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* placed signatures and stamps: drag to move, corner to resize, x to delete */
.mk-marks { position: absolute; inset: 0; pointer-events: none; }
.mk-marks > * { pointer-events: auto; }
.movable { cursor: grab; touch-action: none; outline: none; border-radius: 4px; }
.movable:hover, .movable:focus-visible, .movable:focus, .movable.dragging { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.movable.dragging { cursor: grabbing; opacity: .92; }
.movable img { pointer-events: none; user-select: none; -webkit-user-drag: none; }
.markdel { position: absolute; top: -11px; right: -11px; width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #d92d20; color: #fff; font: 600 15px/18px system-ui, sans-serif; cursor: pointer; z-index: 3; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.markrs { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px; background: #fff; border: 2px solid var(--accent); cursor: nwse-resize; z-index: 3; opacity: 0; transition: opacity .12s; }
.movable:hover .markdel, .movable:focus .markdel, .movable:focus-within .markdel, .movable.dragging .markdel,
.movable:hover .markrs, .movable:focus .markrs, .movable:focus-within .markrs, .movable.dragging .markrs { opacity: 1; }
@media (hover: none) { .markdel, .markrs { opacity: 1; } }

/* ---------- home header: calm, centred, airy ---------- */
.homehead { max-width: 820px; padding-block: clamp(36px, 6vw, 64px) 8px; }
.homehead .eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.homehead .eyebrow i { font-style: normal; opacity: .5; }
.homehead h1 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 650; letter-spacing: -.035em; line-height: 1.06; margin: 0 0 14px; }
.homehead .lede { font-size: 16.5px; line-height: 1.55; color: var(--muted); max-width: 46ch; margin: 0 auto; }
.homesearch { display: block; position: relative; width: min(560px, 100%); margin: 32px auto 0; flex: none; min-width: 0; }
.homesearch input { width: 100%; height: 52px; padding: 0 52px 0 48px; font-size: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.18); transition: border-color .15s, box-shadow .15s; }
.homesearch input::placeholder { color: var(--muted); }
.homesearch input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 8px 24px -12px rgba(0,0,0,.2); }
.homesearch .searchico { position: absolute; left: 17px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.homesearch kbd { right: 14px; font-size: 12px; padding: 1px 8px; }
.homehead .recent { justify-content: center; gap: 4px 18px; margin: 22px 0 0; }
.homehead .recentlbl { font-family: inherit; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); margin-right: 2px; }
.homehead .recentpill { padding: 2px 0; gap: 6px; border: 0; background: none; border-radius: 0; font-size: 13.5px; font-weight: 500; color: var(--fg); opacity: .78; border-bottom: 1px solid transparent; transition: opacity .12s, border-color .12s; }
.homehead .recentpill:hover { opacity: 1; border-bottom-color: currentColor; }
.homehead .recentpill .ico.mini { width: 18px; height: 18px; border-radius: 5px; background: none; }
.homehead .recentpill .ico.mini svg { width: 15px; height: 15px; }
/* group tabs: quiet text tabs on a hairline, sticky while scrolling */
.bar { justify-content: center; margin-block: 34px 18px; padding-block: 0; border-bottom: 1px solid var(--line); }
.bar .chips { flex: 0 1 auto; justify-content: safe center; gap: 2px; }
.bar .chip { position: relative; border: 0; background: none; border-radius: 0; padding: 14px 14px 13px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color .12s; }
.bar .chip::before { width: 6px; height: 6px; border-radius: 50%; opacity: 0; transition: opacity .12s; }
.bar .chip.cat-all::before { display: none; }
.bar .chip:hover { color: var(--fg); border: 0; }
.bar .chip:hover::before, .bar .chip[aria-pressed="true"]::before { opacity: 1; }
.bar .chip[aria-pressed="true"] { background: none; color: var(--fg); border: 0; }
.bar .chip[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--fg); }
.bar .chip .n { font-size: 10.5px; }
@media (max-width: 760px) {
  .homehead .eyebrow { font-size: 10.5px; gap: 7px; }
  .bar { justify-content: flex-start; margin-block: 24px 14px; }
  .bar .chips { justify-content: flex-start; mask-image: linear-gradient(90deg, #000 90%, transparent); }
  .bar .chip { padding: 12px 11px 11px; }
}
/* Wide screens: text on the left, search on the right, so the whole tool list still fits in one window. */
@media (min-width: 1100px) {
  .hero.center.homehead { max-width: none; margin-inline: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: clamp(40px, 6vw, 96px); align-items: end; text-align: left; padding-block: 22px 0; }
  .hero.center.homehead > .eyebrow { grid-column: 1; grid-row: 1; justify-self: start; margin: 0 0 12px; }
  .homehead > h1 { grid-column: 1; grid-row: 2; font-size: clamp(32px, 2.7vw, 40px); margin: 0 0 8px; }
  .hero.center.homehead > .lede { grid-column: 1; grid-row: 3; margin: 0; max-width: 62ch; font-size: 15.5px; }
  .homehead > .homesearch { grid-column: 2; grid-row: 2; align-self: end; width: 100%; margin: 0 0 8px; }
  .homehead > .recent { grid-column: 2; grid-row: 3; justify-content: flex-start; flex-wrap: nowrap; overflow: hidden; margin: 0; padding-left: 4px; }
  .homehead > .recent .recentpill { flex: none; }
  .homehead > .recent .recentpill:nth-of-type(n+5) { display: none; }
  .bar { justify-content: flex-start; }
  .bar .chips { justify-content: flex-start; margin-left: -14px; }
  .bar { margin-block: 18px 12px; }
}

/* install page: the answer to "Install now" when the browser has no install window to show */
.installmsg { margin: 4px 0 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--fg); font-size: 15px; line-height: 1.5; max-width: 62ch; }
.feat.hl { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); transition: box-shadow .2s, border-color .2s; }

/* Prepaid Pro (Ziina) */
.plancard .yearly { margin: -4px 0 10px; font-size: 13px; }
.plancard .stack .btn + .btn { margin-top: 8px; }
.payments .paylist { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted, #666); }
.payments .paylist li { padding: 3px 0; }

/* Until the app draws, show only a quiet loader instead of the prerendered link list. */
html.fl-boot body > .wrap, html.fl-boot body > .foot, html.fl-boot body > footer { visibility: hidden; }
html.fl-boot body::after {
  content: ""; position: fixed; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 3px solid color-mix(in srgb, var(--accent, #7c3aed) 25%, transparent);
  border-top-color: var(--accent, #7c3aed); animation: fl-spin .8s linear infinite;
}
@keyframes fl-spin { to { transform: rotate(360deg); } }
html:not(.fl-boot) body > .wrap { animation: fl-in .18s ease-out; }
@keyframes fl-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html.fl-boot body::after { animation: none; } html:not(.fl-boot) body > .wrap { animation: none; } }

/* =====================================================================
   Foldline 2026: paper, precision, calm.
   Soft neutral canvas, crisp paper surfaces, near-black text, the brand accent
   for the main action and selected controls. The folded corner is the signature.
   ===================================================================== */
:root {
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --bg: #f4f4f6; --surface: #ffffff; --surface-2: #ececf0; --fg: #18181c; --muted: #585a64; --line: #dadae0; --line-strong: #c4c5cd;
  --canvas: #e8e8ed; --paper: #ffffff; --paper-line: #d3d4dc; --paper-ink: #2a2b33;
  --shadow: 0 1px 1px rgba(17,17,26,.04), 0 2px 8px -4px rgba(17,17,26,.08);
  --shadow-lift: 0 1px 1px rgba(17,17,26,.05), 0 12px 32px -16px rgba(17,17,26,.28);
  --paper-shadow: drop-shadow(0 1px 0.5px rgba(17,17,26,.22)) drop-shadow(0 14px 18px rgba(17,17,26,.12));
  --glass: rgba(246,246,248,.78);
  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: 150ms; --t-med: 200ms;
  --fold: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e0e12; --surface: #17171d; --surface-2: #202028; --fg: #f1f1f4; --muted: #a5a6b2; --line: #2c2d37; --line-strong: #3b3c48;
    --canvas: #0a0a0d; --paper-line: #d3d4dc; --glass: rgba(23,23,29,.74); --shadow: none; --shadow-lift: 0 14px 34px -18px rgba(0,0,0,.8); }
}
:root[data-theme="dark"] { --bg: #0e0e12; --surface: #17171d; --surface-2: #202028; --fg: #f1f1f4; --muted: #a5a6b2; --line: #2c2d37; --line-strong: #3b3c48;
  --canvas: #0a0a0d; --paper-line: #d3d4dc; --glass: rgba(23,23,29,.74); --shadow: none; --shadow-lift: 0 14px 34px -18px rgba(0,0,0,.8); }

body { font-family: var(--f-body); font-feature-settings: normal; letter-spacing: -.003em; background: var(--bg); color: var(--fg); }
h1, h2, h3, h4 { font-family: var(--f-display); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Floating header: translucent material where supported, solid otherwise. */
/* The header band runs edge to edge (the content column is narrower than the window). */
header.top { background: var(--bg); }

/* Controls: short, purposeful motion and a pressed state. */
.btn { transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast); border-color: var(--line-strong); color: var(--fg); min-height: 36px; }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px var(--accent); }
.btn.primary:hover:not([disabled]) { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); border-color: var(--line); }
.btn.huge { font-size: 17px; font-weight: 600; padding: 15px 30px; border-radius: 14px; letter-spacing: -.01em; box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 14px 28px -14px var(--accent); }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.iconbtn:hover:not([disabled]) { background: var(--surface-2); color: var(--fg); }
.iconbtn:active:not([disabled]) { transform: scale(.92); }
.iconbtn[disabled] { opacity: .35; cursor: default; }
@media (pointer: coarse) { .iconbtn { width: 44px; height: 44px; } .btn { min-height: 44px; } .btn.small { min-height: 40px; } }
.chip { transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .8; }
.field input[type="text"], .field input[type="password"], .field input[type="number"], .field input[type="email"], .field select, .field textarea { border-color: var(--line-strong); background: var(--surface); min-height: 38px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field label { color: var(--fg); }

/* ---------- Paper: CSS-drawn sheets with the Foldline folded corner ---------- */
.uart { position: relative; width: min(100%, 470px); aspect-ratio: 1.22; margin-inline: auto; }
.sheet { position: absolute; left: 25%; top: 6%; width: 48%; aspect-ratio: .773; padding: 9% 8% 0; display: flex; flex-direction: column; gap: 7%; filter: var(--paper-shadow);
  transition: transform var(--t-med) var(--ease); will-change: transform; }
.sheet::before { content: ""; position: absolute; inset: 0; background: var(--paper); border-radius: 5px; }
.sheet > i { position: relative; display: block; }
.sheet .sh-title { height: 5.5%; width: 58%; border-radius: 2px; background: var(--paper-ink); opacity: .86; flex: none; }
.sheet .sh-lines { flex: 1 1 0; background: repeating-linear-gradient(to bottom, var(--paper-line) 0 1.5px, transparent 1.5px 10px); max-height: 30%; }
.sheet .sh-lines.short { width: 72%; max-height: 16%; }
.sheet .sh-block { flex: none; height: 17%; border-radius: 3px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, #fff), color-mix(in srgb, var(--accent) 7%, #fff)); }
.sheet.s3 { transform: translate(-36%, 9%) rotate(-10deg); }
.sheet.s2 { transform: translate(-4%, -3%) rotate(3deg); }
.sheet.s1 { transform: translate(30%, 14%) rotate(-3deg); }
/* The folded corner: the sheet is cut diagonally and a lit flap sits in the gap. */
.fold::before { clip-path: polygon(0 0, calc(100% - var(--fc, 17%)) 0, 100% calc(var(--fc, 17%) * .773), 100% 100%, 0 100%); }
.fold { --fc: 20%; }
.fold::after { content: ""; position: absolute; top: 0; right: 0; width: var(--fc); aspect-ratio: 1; border-bottom-left-radius: 5px;
  background: linear-gradient(225deg, transparent 49.5%, #ffffff 50.5%, #f3f3f7 62%, #d2d3dc 100%);
  box-shadow: -2px 3px 5px -1px rgba(17,17,26,.18); }
/* Dragging files over the panel: the sheets square up into one neat stack, ready to receive. */
.ustage.over .sheet.s3 { transform: translate(-3%, 4%) rotate(0); }
.ustage.over .sheet.s2 { transform: translate(-1.5%, 2%) rotate(0); }
.ustage.over .sheet.s1 { transform: translate(0, 0) rotate(0); }

/* Paper thumbnail used in file lists. */
.pthumb { position: relative; display: grid; place-items: center; width: 44px; aspect-ratio: .773; flex: none; filter: drop-shadow(0 0 .5px rgba(17,17,26,.35)) drop-shadow(0 3px 4px rgba(17,17,26,.10)); }
.pthumb::before { content: ""; position: absolute; inset: 0; background: var(--paper); border-radius: 3px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%); }
.pthumb::after { content: ""; position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-bottom-left-radius: 2px; background: linear-gradient(225deg, transparent 49%, #fff 50%, #dcdde4 100%); }
.pthumb img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 3px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%); }
.pthumb b { position: relative; font: 700 10px/1 var(--f-mono); letter-spacing: .04em; color: #5c5e6a; }

/* ---------- Upload stage: the first screen ---------- */
.ustage { position: relative; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(20px, 4vw, 56px);
  margin-top: 14px; padding: clamp(28px, 4.2vw, 60px); min-height: clamp(340px, 46vh, 470px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lift); overflow: hidden; isolation: isolate; text-align: left;
  transition: border-color var(--t-med) var(--ease), background-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.ustage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 80% at 80% 45%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%), radial-gradient(40% 60% at 95% 100%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%); }
.ustage::after { content: ""; position: absolute; inset: 10px; border-radius: 20px; border: 2px dashed transparent; pointer-events: none; transition: border-color var(--t-med) var(--ease); }
.ustage.over { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lift); }
.ustage.over::after { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.ucopy { min-width: 0; }
.ucopy .eyebrow { font-family: var(--f-body); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--accent); margin: 0 0 10px; }
.ucopy h1 { margin: 0 0 12px; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; text-wrap: balance; }
.usub { margin: 0 0 26px; color: var(--muted); font-size: clamp(15px, 1.35vw, 18px); line-height: 1.5; max-width: 40ch; text-wrap: pretty; }
.uact { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.umeta { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.ucopy .hint { margin-top: 12px; }
.ustageart { min-width: 0; display: grid; align-items: center; }
.ustageart .ulist { animation: fl-rise var(--t-med) var(--ease); }
@keyframes fl-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Home: chosen files in place of the artwork */
.hchosen { display: grid; gap: 12px; }
.hchead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hchead b { font-size: 15px; margin-right: auto; }
.hfiles { list-style: none; margin: 0; padding: 4px; display: grid; gap: 6px; max-height: 236px; overflow: auto; }
.hfile { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 6px 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.hfile .pthumb { width: 36px; }
.hfname { display: grid; min-width: 0; }
.hfname .fname, .file .fname { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; word-break: break-word; line-height: 1.3; }
.hfname .fmeta { font-size: 12.5px; color: var(--muted); }
.hlabel { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.hactions { display: flex; flex-wrap: wrap; gap: 8px; }
.hact { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; min-height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease); }
.hact:hover { border-color: var(--accent); }
.hact:active { transform: scale(.97); }
.hact.first { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.hact.first .ico { background: rgba(255,255,255,.2); color: inherit; }

/* Most-used tools: one compact row */
.favs { margin-top: 22px; }
.favs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.fav { display: grid; justify-items: center; gap: 9px; padding: 16px 8px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.25; height: 100%;
  transition: border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.fav:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.fav:active { transform: scale(.98); }
.fav .ico { width: 40px; height: 40px; border-radius: 12px; }
.fav .ico svg { width: 22px; height: 22px; }

/* The full directory: quieter */
.directory { margin-top: 56px; }
.dirhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dirhead h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.dirhead .homesearch { margin: 0 0 0 auto; max-width: 360px; flex: 1 1 260px; }
.directory .bar { margin-block: 12px 10px; }
.directory .group { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 6px; }
.directory .group header { padding: 0 8px 6px; }
.directory .group h3 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.directory .trow { color: var(--fg); font-weight: 500; }
.directory .trow .ico.mini { opacity: .85; }
.recent { margin-top: 18px; }
.trust { margin-top: 72px; }

/* ---------- Tool landing ---------- */
.landingwrap { padding-bottom: 8px; }
.landingwrap .howto, .landingwrap .related { max-width: none; margin-top: 48px; }

/* ---------- Document workspace ---------- */
.workarea { padding-bottom: 32px; }
.wshead { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; min-width: 0; }
.wshead .crumb { margin: 0; padding: 6px 10px 6px 6px; border-radius: 10px; min-height: 36px; transition: background var(--t-fast); }
.wshead .crumb:hover { background: var(--surface-2); }
.wstitle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wstitle h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws { display: grid; grid-template-columns: 232px minmax(0, 1fr) 344px; gap: 16px; align-items: start; }
.ws.nofiles { grid-template-columns: minmax(0, 1fr) 344px; }
.ws.nofiles > .rail { display: none; }
.rail, .insp { position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 88px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.rail { padding: 12px 10px; scrollbar-width: thin; }
.railh, .insp h4 { margin: 2px 4px 10px; font-family: var(--f-body); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.railhint { margin: -4px 4px 10px; font-size: 12.5px; color: var(--muted); }
.rail .files { margin: 0 0 10px; gap: 6px; }
.rail .file { grid-template-columns: auto 40px minmax(0, 1fr); grid-template-areas: "n t b" "a a a"; gap: 6px 10px; padding: 8px; border-radius: 12px; background: transparent; border: 1px solid transparent; cursor: default;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast); }
.rail .file:not(:has(.ordn)) { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "t b" "a a"; }
.ws:not(.staged) .rail .file { cursor: pointer; }
.rail .file:hover { background: var(--bg); }
.rail .file.sel { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.rail .file.dragging { opacity: .45; }
.rail .file.dropat { box-shadow: inset 0 3px 0 var(--accent); }
.rail .file .pthumb { grid-area: t; width: 40px; }
.rail .file .fbody { grid-area: b; min-width: 0; }
.rail .file .fmeta { font-size: 12px; color: var(--muted); }
.rail .file .acts { grid-area: a; display: flex; justify-content: flex-end; gap: 2px; margin-top: -2px; }
.rail .file .fname { font-size: 13px; }
.ordn { grid-area: n; align-self: start; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; margin-top: 2px; }
.rail .addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 4px; }
.pagerail { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pagerail:empty { display: none; }
.pgthumb { display: grid; gap: 4px; justify-items: center; width: 100%; padding: 5px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); font-size: 11.5px; transition: background var(--t-fast), border-color var(--t-fast); }
.pgthumb:hover { background: var(--bg); }
.pgthumb[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pgthumb img, .pgph { display: block; width: 100%; aspect-ratio: .773; object-fit: contain; background: var(--paper); border-radius: 2px; box-shadow: 0 0 0 1px rgba(17,17,26,.12), 0 2px 4px -2px rgba(17,17,26,.2); }

.doc { min-width: 0; min-height: min(78vh, 900px); background: var(--canvas); border-radius: 20px; padding: clamp(14px, 2.4vw, 32px); display: grid; align-content: start; gap: 16px; }
.ws.staged .doc { background: var(--surface); border: 1px solid var(--line); }
.doc > .drop { min-height: 50vh; align-content: center; background: transparent; border-color: var(--line-strong); }
.doc > .drop .uart { width: min(70%, 300px); }
.doc .stage { margin-top: 0; border-top: 0; padding-top: 0; }
.preview { display: grid; gap: 12px; justify-items: center; }
.pvcap { max-width: 100%; color: var(--muted); font-size: 13px; text-align: center; }
.pvcap .fname { font-weight: 600; overflow-wrap: anywhere; }
.pvpage { width: 100%; max-width: 900px; display: grid; justify-items: center; }
.pvcanvas, .pvimg { display: block; width: 100%; height: auto; max-height: none; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(17,17,26,.06), 0 2px 4px rgba(17,17,26,.06), 0 24px 48px -24px rgba(17,17,26,.35); animation: fl-in var(--t-med) var(--ease); }
.pvimg { width: auto; max-width: 100%; }
.pvfile { display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted); padding: 60px 16px; max-width: 42ch; }
.pvfile .pthumb { width: 88px; }
.pvwait { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 80px 0; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: fl-spin .8s linear infinite; }
.pvnav { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pvnav:empty { display: none; }
.pvnum { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 88px; text-align: center; color: var(--fg); }

.insp { display: flex; flex-direction: column; padding: 0; }
.sheetbtn { display: none; }
.inspbody { display: grid; gap: 18px; padding: 16px 16px 4px; }
.inspbody:empty { display: none; }
.inspsec { display: grid; }
.inspinfo:empty { display: none; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.kv span { color: var(--muted); }
.kv b { font-variant-numeric: tabular-nums; }
.inspnote { margin: 0; }
.insp .panel { box-shadow: none; padding: 14px; border-radius: 14px; }
.insp > .panel, .inspbody > div > .panel { background: var(--bg); }
.inspfoot { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 18px 18px; margin-top: 12px; }
.inspfoot .err { margin: 0; }
.inspfoot .btn.wide { min-height: 48px; font-size: 16px; }
.inspfoot .progress { margin-top: 2px; }
.plabel { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Completion: the result card arrives and a small sheet folds its corner. */
.resultbox:empty { display: none; }
.panel.done { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: var(--surface); animation: fl-rise var(--t-med) var(--ease); }
.donehead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.donehead h4 { margin: 0; }
.donemark { position: relative; width: 22px; height: 28px; flex: none; filter: drop-shadow(0 0 .5px rgba(17,17,26,.4)) drop-shadow(0 2px 3px rgba(17,17,26,.12)); }
.donemark::before { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--good); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); animation: fl-cut 220ms var(--ease) both; }
.donemark::after { content: ""; position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-bottom-left-radius: 2px; background: linear-gradient(225deg, transparent 48%, #ffffff 50%, #cfe9dc 100%); transform-origin: 100% 0; animation: fl-flap 220ms var(--ease) 60ms both; }
@keyframes fl-cut { from { clip-path: polygon(0 0, 100% 0, 100% 0, 100% 100%, 0 100%); } }
@keyframes fl-flap { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel.done .stat b { font-size: 26px; }
.stat .save { color: var(--good); font-weight: 600; }
.outrow { background: var(--bg); }
.outrow .fname { overflow-wrap: anywhere; }

/* ---------- Medium screens ---------- */
@media (max-width: 1180px) {
  .ws { grid-template-columns: 196px minmax(0, 1fr) 300px; gap: 12px; }
  .pagerail { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- Phones and tablets: document first, settings in a bottom sheet ---------- */
@media (max-width: 699px) {
  .ustage { grid-template-columns: minmax(0, 1fr); padding: 26px 20px 22px; gap: 14px; border-radius: 22px; min-height: 0; }
  .ucopy h1 { font-size: clamp(30px, 8.5vw, 40px); }
  .usub { margin-bottom: 18px; font-size: 15.5px; }
  .uact .btn.huge { width: 100%; }
  .ustageart .uart { width: min(100%, 300px); aspect-ratio: 1.7; }
  .ustageart .sheet { width: 36%; left: 32%; top: 4%; }
}
@media (max-width: 899px) {
  .favs ul { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(104px, 1fr); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .favs li { scroll-snap-align: start; }
  .dirhead .homesearch { margin: 0; max-width: none; }

  .ws, .ws.nofiles { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .rail { position: static; max-height: none; padding: 10px; }
  .rail .files { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .rail .file { flex: 0 0 min(78%, 280px); scroll-snap-align: start; background: var(--bg); }
  .pagerail { display: flex; overflow-x: auto; gap: 8px; }
  .pagerail li { flex: 0 0 64px; }
  .doc { min-height: 50vh; border-radius: 16px; }
  body.inws main { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .insp:not(.static) { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; border-radius: 20px 20px 0 0; border-bottom: 0;
    box-shadow: 0 -12px 32px -12px rgba(17,17,26,.28); background: var(--surface); padding-bottom: env(safe-area-inset-bottom, 0px); transition: max-height var(--t-med) var(--ease); }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .insp:not(.static) { background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px); }
    .insp:not(.static) .inspfoot { background: transparent; }
  }
  .insp:not(.static) .sheetbtn { display: grid; justify-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 16px 2px; border: 0; background: none; color: var(--fg); font: 600 14px var(--f-body); cursor: pointer; }
  .sheetbtn .grab { width: 38px; height: 5px; border-radius: 99px; background: var(--line-strong); }
  .insp:not(.static):not(.open) .inspbody { display: none; }
  .insp:not(.static) .inspbody { overflow: auto; }
  .insp:not(.static) .inspfoot { margin-top: 4px; border-radius: 0; padding-top: 10px; }
  .insp.static { position: static; max-height: none; }
}
@media (max-width: 520px) {
  .ustage { padding: 22px 16px 18px; }
  .ustageart .uart { aspect-ratio: 1.9; width: min(100%, 250px); }
  .hfiles { max-height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .ustage, .btn, .fav, .hact, .iconbtn, .rail .file, .insp { transition: none !important; }
  .pvcanvas, .pvimg, .panel.done, .ustageart .ulist, .donemark::before, .donemark::after { animation: none !important; }
}

/* Touch screens: no dragging, so the instruction says tap. */
.usub .touch { display: none; }
@media (pointer: coarse) { .usub .desk { display: none; } .usub .touch { display: inline; } }
.file .fmeta, .hfile .fmeta, .outrow .fmeta, .rail .fmeta { font-family: var(--f-body); font-variant-numeric: tabular-nums; }

header.top .btn, .acct .btn, .acct a { white-space: nowrap; }
@media (max-width: 899px) { .insp .resultbox { order: -1; } }

.landerr { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 16px; max-width: 46ch; }
@media (max-width: 899px) { .ws .iconbtn, .insp .iconbtn { width: 44px; height: 44px; } .rail .btn.small { min-height: 44px; } }
/* Small screens: the file rail is one compact row so the document gets the height. */
@media (max-width: 899px) {
  .rail { padding: 8px 10px 10px; }
  .rail .railh { display: none; }
  .rail .file { grid-template-columns: auto 32px minmax(0, 1fr); grid-template-areas: "n t b" "a a a"; align-items: start; padding: 8px; }
  .rail .file:not(:has(.ordn)) { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "t b a"; align-items: center; padding: 6px 4px 6px 8px; }
  .rail .file .pthumb { width: 32px; }
  .rail .file .acts { margin: 0; }
  .rail .files:has(> .file:only-child) .file { flex: 1 1 100%; }
  .rail .addrow { padding: 0; }
  .rail .files { margin-bottom: 8px; }
  .pagerail { margin-top: 8px; padding-top: 8px; }
  .pagerail li { flex: 0 0 52px; }
  .railhint { margin: 0 0 6px; }
}

/* =====================================================================
   Tool directory and Tools menu (2026): graphite in dark, one icon family,
   whole-row links, badges on the trailing edge.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #151517; --surface: #1e1e22; --surface-2: #27272c; --fg: #f4f4f6; --muted: #a2a3ad; --line: #2e2e35; --line-strong: #3d3d45; --canvas: #0f0f11; --glass: rgba(30,30,34,.78); --accent-soft: #2a2c5c; }
}
:root[data-theme="dark"] { --bg: #151517; --surface: #1e1e22; --surface-2: #27272c; --fg: #f4f4f6; --muted: #a2a3ad; --line: #2e2e35; --line-strong: #3d3d45; --canvas: #0f0f11; --glass: rgba(30,30,34,.78); --accent-soft: #2a2c5c; }

/* Line icons: no boxes, a small tint of the category colour. */
.lico { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; color: color-mix(in srgb, var(--cc, var(--accent)) 78%, var(--fg)); }
.lico svg { display: block; width: 20px; height: 20px; }

/* Whole-row tool links on a shared grid: icon · name · badges. */
.trow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; min-height: 38px; padding: 7px 10px; border-radius: 10px; color: var(--fg); text-decoration: none; font-size: 14.5px; font-weight: 500; line-height: 1.3;
  transition: background var(--t-fast) var(--ease), color var(--t-fast); }
.trow:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.trow:hover .tname { color: var(--fg); }
.trow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.trow:active { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.tlabel { display: grid; min-width: 0; }
.tname { overflow-wrap: anywhere; }
.tcat { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.tbadges { display: inline-flex; gap: 6px; justify-self: end; }
.tbadges:empty { display: none; }
.trow .newbadge, .trow .probadge { margin: 0; padding: 0 6px; height: 18px; line-height: 18px; border-radius: 5px; font: 600 10px/18px var(--f-body); letter-spacing: .06em; text-transform: uppercase; vertical-align: 0; box-shadow: none; }
.trow .newbadge { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.trow .probadge { background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 85%, var(--fg)); }

/* Directory */
.directory { margin-top: 56px; }
.dirhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.dirhead h2 { font-size: 24px; letter-spacing: -.03em; }
.homesearch { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; }
.homesearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.catfilters { position: relative; display: flex; align-items: center; min-width: 0; margin-bottom: 6px; }
.catfilters .chips { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; min-width: 0; flex: 1 1 auto; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.catfilters .chip { flex: none; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500; min-height: 34px; gap: 7px; }
.catfilters .chip::before { display: none; }
.catfilters .chip:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 5%, transparent); }
.catfilters .chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--fg); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.catfilters .chip .n { display: inline; font: 500 11.5px var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.catfilters .chip.none { opacity: .45; }
.catselwrap { display: none; }
.catfilters.compact .chips { visibility: hidden; position: absolute; inset: 0; pointer-events: none; }
.catfilters.compact .catselwrap { display: block; flex: 1 1 auto; }
.catselect { width: 100%; min-height: 44px; padding: 10px 40px 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: 600 15px var(--f-body); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.scope { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 2px 0; font-size: 14px; color: var(--muted); }
.scope:empty { display: none; }
.scope b { color: var(--fg); }
.linkish { border: 0; background: none; padding: 4px 2px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; }
.linkish:hover { text-decoration: underline; }

.directory .shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 28px; align-items: start; margin-top: 18px; }
.directory .shelfcol { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.directory .group { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; overflow: visible; }
.directory .group::before { display: none; }
.directory .group header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.directory .group h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; text-transform: none; color: var(--fg); }
.directory .gcount { border: 0; padding: 0; font: 500 13px var(--f-body); color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.directory .group ul { gap: 1px; }
.directory .shelf.single { grid-template-columns: minmax(0, 1fr); }
.directory .shelf.single .shelfcol { gap: 0; }
.directory .shelf.single .group ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 20px; }
.gridnote .empty { text-align: center; padding: 40px 16px; border: 1px dashed var(--line-strong); border-radius: 18px; margin-top: 12px; }
.gridnote .empty p { margin: 0 0 6px; }
.emptyacts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 1099px) {
  .directory .shelf { display: block; columns: 2; column-gap: 28px; }
  .directory .shelfcol { display: contents; }
  .directory .group { break-inside: avoid; margin-bottom: 26px; display: block; }
}
@media (max-width: 639px) {
  .directory .shelf { columns: 1; }
  .dirhead .homesearch { flex: 1 1 100%; max-width: none; }
  .trow { min-height: 46px; }
}

/* Header: the Tools trigger */
.toolsbtn.mobile { display: none; }
@media (max-width: 920px) { .toolsbtn.mobile { display: inline-flex; border: 1px solid var(--line-strong); background: var(--surface); min-height: 40px; padding: 7px 12px; } }

/* Tools menu: one floating panel on desktop */
.tm { position: fixed; z-index: 70; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 60px -24px rgba(10,10,20,.45); opacity: 0; transform: translateY(-4px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.tm.shown { opacity: 1; transform: none; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tm { background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(24px); backdrop-filter: saturate(1.6) blur(24px); }
}
.tmtop { flex: none; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.tmtitle { display: none; }
.tmsearchwrap { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.tmsearchwrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tmsico { color: var(--muted); flex: none; }
.tmsearch { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 15px var(--f-body); padding: 10px 0; }
.tmselwrap { display: none; }
.tmbody { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.tmrail { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); overflow: auto; transition: opacity var(--t-fast); }
.tmrail.dim { opacity: .55; }
.tmcat { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 500 14px var(--f-body); text-align: left; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast); }
.tmcat:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); color: var(--fg); }
.tmcat[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--fg); font-weight: 600; }
.tmcat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tmdot { width: 8px; height: 8px; border-radius: 3px; background: var(--cc, var(--muted)); }
.tmn { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.tmpane { min-width: 0; overflow: auto; padding: 10px 10px 12px; }
.tmlisthead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 4px 10px 8px; font-size: 13px; color: var(--muted); }
.tmlisthead h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--fg); }
.tmlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; }
.tmempty { grid-column: 1 / -1; text-align: center; padding: 30px 12px; color: var(--muted); }
.tmempty p { margin: 0 0 12px; }
.tmempty b { color: var(--fg); }
.tmfoot { flex: none; display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); }
.tmall { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.tmall:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tmscrim { position: fixed; inset: 0; z-index: 69; background: rgba(10,10,14,.42); }
@media (max-width: 720px) { .tmlist { grid-template-columns: minmax(0, 1fr); } }

/* Phones and small tablets: a bottom sheet */
@media (max-width: 899px) {
  .tm { left: 0 !important; right: 0; bottom: 0; width: auto !important; border-radius: 20px 20px 0 0; border-bottom: 0; transform: translateY(16px); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); }
  .tm.shown { transform: none; }
  .tmtitle { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
  .tmtitle h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
  .tmclose { width: 44px; height: 44px; font-size: 22px; }
  .tmtop::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: -4px auto 8px; }
  .tmselwrap { display: block; margin-top: 10px; }
  .tmselect { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: 600 15px var(--f-body); }
  .tmselect:disabled { opacity: .5; }
  .tmbody { grid-template-columns: minmax(0, 1fr); }
  .tmrail { display: none; }
  .tmpane { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .tmlist { grid-template-columns: minmax(0, 1fr); }
  .tm .trow { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .tm, .tm.shown { transition: none; transform: none; } }

/* Phones: the header keeps the logo, Tools, account and menu; theme moves into the menu. */
@media (max-width: 560px) {
  .top-right .themebtn, .top-right .ddwrap:has(> .appsdd) { display: none; }
  header.top .top-right { gap: 6px; }
  .toolsbtn.mobile { padding: 7px 10px; }
}
.drawertheme { margin-top: 16px; }
.trow::after { content: none; display: none; }

/* "Why Foldline": the full content width, an intro column beside three promises. */
.trust { max-width: none; margin: 72px 0 8px; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: clamp(20px, 3vw, 40px); align-items: stretch;
  padding: clamp(24px, 3.4vw, 44px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.trustintro { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; }
.trust .eyebrow { font-family: var(--f-body); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--accent); margin: 0 0 10px; }
.trust .trustintro h2 { margin: 0; max-width: 16ch; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; letter-spacing: -.035em; text-align: left; }
.trust .trustmore { margin: 0; }
.trust .trustmore a { color: var(--accent); font-weight: 600; border: 0; padding: 0; }
.trust .trustmore a:hover { text-decoration: underline; }
.trust .trustgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border: 0; }
.trust .trustitem { padding: 22px 22px 24px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line); text-align: left; }
.trust .trustitem + .trustitem::before { display: none; }
.trust .trusticon { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.trust .trustitem h3 { font-size: 16.5px; margin: 0 0 6px; }
.trust .trustitem p { font-size: 14.5px; line-height: 1.55; }
@media (max-width: 1099px) { .trust { grid-template-columns: minmax(0, 1fr); } .trust .trustintro h2 { max-width: 28ch; } }
@media (max-width: 699px) { .trust { border-radius: 22px; padding: 22px 16px; } .trust .trustgrid { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Footer (2026): one charcoal surface, a shared 6-column grid, quiet install group.
   ===================================================================== */
.sitefoot { --foot-bg: #17171a; --foot-fg: #f5f5f7; --foot-link: #b6b7c1; --foot-muted: #8e8f9a; --foot-line: #2b2b31; --foot-btn: #202024; --foot-btn-line: #34343b;
  margin-top: 88px; padding-block: 48px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--foot-bg); color: var(--foot-fg); font-size: 14.5px; color-scheme: dark; }
.sitefoot > .wrap { max-width: 1320px; margin: 0 auto; }
.footgrid { display: grid; grid-template-columns: minmax(0, 5fr) 220px; gap: 32px; align-items: start; padding-bottom: 32px; }
.footnav { display: grid; grid-template-columns: minmax(96px, .9fr) minmax(140px, 1.2fr) minmax(96px, .9fr) minmax(150px, 1.2fr) minmax(96px, .9fr); column-gap: 32px; row-gap: 32px; align-items: start; }
.footcol { min-width: 0; }
.footh { margin: 0 0 16px; font: 600 15px/20px var(--f-body); letter-spacing: -.005em; color: var(--foot-fg); text-transform: none; }
.footacc { display: none; }
.footlinks { list-style: none; margin: 0; padding: 0; }
.footlinks li { min-height: 32px; display: flex; align-items: center; }
.footlinks a { color: var(--foot-link); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; text-decoration-thickness: 1px; line-height: 1.45; padding-block: 5px;
  border-radius: 4px; transition: color var(--t-fast), text-decoration-color var(--t-fast); }
.footlinks a:hover { color: var(--foot-fg); text-decoration-color: currentColor; }
.sitefoot a:focus-visible, .sitefoot button:focus-visible, .langlist:focus-visible { outline: 2px solid #8b8fff; outline-offset: 2px; }

/* Install actions: one coordinated group, top aligned with the headings. */
.footinstall { display: grid; gap: 8px; align-content: start; }
.installbtn { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 12px; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--foot-btn-line); background: var(--foot-btn);
  color: var(--foot-fg); text-decoration: none; text-align: left; font: inherit; cursor: pointer; width: 100%; transition: background var(--t-fast), border-color var(--t-fast); }
.installbtn:hover { background: #28282d; border-color: #46464f; }
.installbtn:active { transform: scale(.98); }
.installico { display: grid; place-items: center; width: 24px; height: 24px; color: var(--foot-link); }
.installico svg { width: 20px; height: 20px; }
.installtext { display: grid; min-width: 0; line-height: 1.2; }
.installtext b { font-size: 14.5px; font-weight: 600; }
.installtext small { font-size: 12px; color: var(--foot-muted); }

/* Bottom utility row: same left and right edges as the grid. */
.footbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0; padding-block: 20px 22px; border-top: 1px solid var(--foot-line); font-size: 13.5px; }
.footcopy { margin: 0; color: var(--foot-muted); }
.footright { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.langwrap { position: relative; }
.langbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px 6px 10px; border-radius: 10px; border: 1px solid var(--foot-btn-line); background: var(--foot-btn); color: var(--foot-fg); font: 500 13.5px var(--f-body); cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.langbtn:hover { border-color: #46464f; background: #28282d; }
.langbtn svg { width: 17px; height: 17px; color: var(--foot-link); }
.langbtn .chev { margin-left: 2px; }
.langbtn[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-1px); }
.langlist { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; margin: 0; padding: 4px; list-style: none; border-radius: 12px; background: #222226; border: 1px solid var(--foot-btn-line); box-shadow: 0 16px 36px -12px rgba(0,0,0,.6); }
.langwrap.up .langlist { top: auto; bottom: calc(100% + 6px); }
.langlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 10px; border-radius: 8px; color: var(--foot-fg); cursor: pointer; }
.langlist li.active, .langlist li:hover { background: #2e2e34; }
.langlist .tick { width: 10px; height: 6px; border-left: 2px solid #8b8fff; border-bottom: 2px solid #8b8fff; transform: rotate(-45deg) translateY(-2px); visibility: hidden; }
.langlist [aria-selected="true"] .tick { visibility: visible; }

/* Tablet: three columns of groups, then the install row. */
@media (max-width: 1099px) {
  .footgrid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .footnav { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 36px; }
  .footinstall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Phones: accordions, then install actions, language and copyright. */
@media (max-width: 639px) {
  .sitefoot { padding-top: 16px; margin-top: 64px; }
  .footgrid { gap: 24px; padding-bottom: 24px; }
  .footnav { display: block; }
  .footcol { border-bottom: 1px solid var(--foot-line); }
  .footh { margin: 0; }
  .foothtext { display: none; }
  .footacc { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 4px; border: 0; background: none; color: var(--foot-fg); font: 600 15.5px var(--f-body); cursor: pointer; text-align: left; }
  .footacc .chev { transition: transform var(--t-fast); }
  .footacc[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-1px); }
  .footcol:not(.open) .footlinks { display: none; }
  .footlinks { padding: 0 0 10px 12px; }
  .footlinks li { min-height: 44px; }
  .footlinks a { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 0 4px; text-decoration: none; }
  .footinstall { grid-template-columns: minmax(0, 1fr); }
  .footbar { flex-direction: column; align-items: flex-start; }
  .footcopy { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .installbtn, .langbtn, .footlinks a, .footacc .chev { transition: none !important; } }
.sitefoot .footcol { display: block; gap: 0; }

/* Main action helpers */
.runhint { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.availnote { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c-optimize, #a85d00) 12%, var(--surface)); color: var(--fg); font-size: 13.5px; line-height: 1.45; border: 1px solid color-mix(in srgb, var(--c-optimize, #a85d00) 30%, transparent); }
.panel.done .dlmain { margin-top: 12px; min-height: 48px; font-size: 16px; }
.err .gate { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inspfoot .btn.wide:not(.primary) { background: var(--surface); }
.errlist { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.landerr .err { margin: 0; padding: 0; background: none; }

/* ================= Document pages: privacy, terms, cookies, security ================= */
.page.docpage { max-width: none; padding-block: 28px 24px; }
.dochero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 32px 56px; align-items: end;
  padding: clamp(28px, 4.4vw, 56px); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 24px;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%), var(--surface); }
.dochero .eyebrow { margin-bottom: 14px; }
.dochero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.04; margin: 0 0 16px; }
.dochero .lead { margin: 0; max-width: 58ch; font-size: clamp(16px, 1.5vw, 18.5px); line-height: 1.55; }
.docmeta { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); overflow: hidden; }
.docmeta > div { display: grid; grid-template-columns: 128px 1fr; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); align-items: baseline; }
.docmeta > div:first-child { border-top: 0; }
.docmeta dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.docmeta dd { margin: 0; font-size: 14.5px; font-weight: 500; }

.dochl { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dochl li { display: grid; gap: 6px; align-content: start; padding: 20px 22px 20px 56px; position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); max-width: none; }
.dochl li::before { content: ""; position: absolute; left: 20px; top: 21px; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft);
  -webkit-mask: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.dochl li::after { content: ""; position: absolute; left: 27px; top: 26px; width: 5px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dochl b { font-size: 15.5px; font-weight: 600; }
.dochl span { color: var(--muted); font-size: 14px; line-height: 1.5; }

.docbody { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.doctoc { position: sticky; top: calc(78px + env(safe-area-inset-top, 0px)); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 18px 12px 12px; }
.doctoc > p { margin: 0 10px 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.doctoc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.doctoc li { max-width: none; counter-increment: toc; }
.page .doctoc a { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 8px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; transition: background .15s, color .15s; }
.doctoc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--f-mono); font-size: 11px; padding-top: 2px; opacity: .7; }
.page .doctoc a:hover { color: var(--fg); background: var(--surface-2); }
.page .doctoc a[aria-current="true"] { color: var(--fg); background: var(--accent-soft); font-weight: 600; }
.page .doctoc a[aria-current="true"]::before { color: var(--accent); opacity: 1; }

.docmain { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); min-width: 0; }
.dsec { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 12px 48px; padding: clamp(22px, 2.8vw, 36px) clamp(20px, 3vw, 40px); border-top: 1px solid var(--line); scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); }
.dsec:first-child { border-top: 0; }
.dsec.wide { grid-template-columns: minmax(0, 1fr); }
.page .dsec h2 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; display: grid; gap: 8px; align-content: start; text-wrap: balance; }
.dnum { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; color: var(--accent); }
.dtext { min-width: 0; font-size: 16px; line-height: 1.7; }
.dtext > :first-child { margin-top: 0; } .dtext > :last-child { margin-bottom: 0; }
.page .dtext p, .page .dtext li { max-width: 76ch; }
.dtext ul:not(.dchips):not(.dchecks) { padding-left: 1.2em; display: grid; gap: 10px; }
.dtext ul:not(.dchips):not(.dchecks) li::marker { color: var(--accent); }
.dnote { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); font-size: 14.5px; }
.dchips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.page .dchips li { max-width: none; display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); line-height: 1.45; }
.dchips b { font-size: 15px; } .dchips span { color: var(--muted); font-size: 13.5px; }
.dchecks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.page .dchecks li { max-width: none; position: relative; padding: 14px 16px 14px 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 14.5px; line-height: 1.55; }
.dchecks li::before { content: ""; position: absolute; left: 16px; top: 16px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); }
.dchecks li::after { content: ""; position: absolute; left: 23px; top: 19.5px; width: 4px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dsec.wide h2 { grid-template-columns: auto 1fr; align-items: baseline; gap: 14px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.docpage .facts-table { display: table; font-size: 14.5px; line-height: 1.55; min-width: 560px; }
.docpage .facts-table th, .docpage .facts-table td { padding: 14px 18px; }
.docpage .facts-table thead th { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.docpage .facts-table tbody tr:last-child td { border-bottom: 0; }
.docpage .facts-table td:first-child { font-weight: 600; width: 26%; }
.docpage .facts-table code { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; }
.docpage .facts-table small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }

@media (max-width: 1100px) {
  .docbody { grid-template-columns: minmax(0, 1fr); }
  .doctoc { position: static; padding: 14px; }
  .doctoc ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: -2px; }
  .doctoc ol::-webkit-scrollbar { display: none; }
  .page .doctoc a { white-space: nowrap; display: flex; gap: 8px; border: 1px solid var(--line); background: var(--bg); padding: 7px 12px; border-radius: 999px; font-size: 13.5px; }
  .dsec { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 12px 32px; }
}
@media (max-width: 860px) {
  .dochero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .dochl { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dsec { grid-template-columns: minmax(0, 1fr); }
  .page .dsec h2 { grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; }
  .dchecks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .page.docpage { padding-top: 16px; }
  .dochero { border-radius: 20px; padding: 24px 20px; gap: 22px; }
  .docmeta > div { grid-template-columns: 1fr; gap: 2px; padding: 11px 14px; }
  .dochl li { padding: 16px 16px 16px 50px; }
  .dochl li::before { left: 16px; top: 17px; } .dochl li::after { left: 23px; top: 22px; }
  .docmain, .doctoc { border-radius: 16px; }
  .dsec { padding: 22px 18px; }
  .dtext { font-size: 15.5px; }
  .docpage .facts-table { min-width: 0; }
  .docpage .facts-table thead { display: none; }
  .docpage .facts-table, .docpage .facts-table tbody, .docpage .facts-table tr, .docpage .facts-table td { display: block; width: auto; }
  .docpage .facts-table tr { padding: 14px 16px; border-top: 1px solid var(--line); }
  .docpage .facts-table tr:first-child { border-top: 0; }
  .docpage .facts-table td { padding: 0; border: 0; }
  .docpage .facts-table td + td { margin-top: 6px; color: var(--muted); }
  .docpage .facts-table td[data-th]::before { content: attr(data-th); display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
}

/* Apps menu: link grid and theme row */
.apps > .applinks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.applinks a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--fg); }
.applinks a::after { content: "→"; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.applinks a:hover, .applinks a:focus-visible { background: var(--surface-2); color: var(--fg); }
.applinks a:hover::after, .applinks a:focus-visible::after { opacity: 1; transform: none; }
.apps > .themerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; padding: 12px 0 0; }
.apps > .themerow > span { font-size: 14px; font-weight: 500; color: var(--muted); }
.apps .themeseg { background: var(--surface-2); border: 1px solid var(--line); }
@media (max-width: 520px) { .apps > .applinks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dsec h2:focus { outline: none; }
@media (max-width: 560px) { .docpage .facts-table td:first-child { width: auto; } }

/* ================= Document viewer: Original / Preview, page and zoom controls ================= */
.ws .doc:has(> .viewer:not([hidden])) { padding: 12px; }
.viewer { display: grid; gap: 10px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.viewer[hidden] { display: none !important; }
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.vbar[hidden] { display: none; }
.vgroup { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.vgroup[hidden], .vseg[hidden], .voutsel[hidden], .vbtn[hidden] { display: none; }
.vseg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); gap: 2px; }
.vbtn { min-height: 34px; min-width: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: 500 13.5px var(--f-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.vbtn:hover:not(:disabled) { background: var(--surface-2); }
.vbtn:disabled { color: var(--muted); opacity: .5; cursor: default; }
.vbtn:focus-visible, .vpgin:focus-visible, .voutsel:focus-visible, .vscroll:focus-visible, .wstoggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vseg .vbtn[aria-pressed="true"], .vgroup .vbtn[aria-pressed="true"], .vtextbtn[aria-pressed="true"], .vexp[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 1px 2px rgba(17,17,26,.08); font-weight: 600; }
.vseg .vbtn[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.vpager .vbtn { font-size: 18px; padding: 0 6px; }
.vpgin { width: 3.4em; min-height: 30px; text-align: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--fg); font: 500 13.5px var(--f-body); font-variant-numeric: tabular-nums; }
.vpgof { font-size: 13px; color: var(--muted); padding: 0 6px 0 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vzoom { min-width: 3.4em; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.voutsel { min-height: 36px; max-width: min(320px, 100%); border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 500 13.5px var(--f-body); padding: 0 10px; }
.vexp { margin-left: auto; font-size: 17px; }
.vstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 14px; border-radius: 12px; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); }
.vstatus[hidden] { display: none; }
.vstatus .vstext { flex: 1 1 240px; min-width: 0; }
.vstatus.ready { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.vstatus.ready::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.vstatus.outdated { border-color: color-mix(in srgb, #f79009 55%, var(--line)); background: color-mix(in srgb, #f79009 9%, var(--surface)); }
.vstatus.error { border-color: color-mix(in srgb, var(--bad, #d92d20) 50%, var(--line)); background: color-mix(in srgb, var(--bad, #d92d20) 7%, var(--surface)); }
.vstatus.updating { color: var(--muted); }
.vcap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0 4px; font-size: 13px; color: var(--muted); }
.vcap:empty { display: none; }
.vcap .fname { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.vtag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.vtag.preview { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.vsrc { color: var(--fg); }
.vapprox, .vnote { flex-basis: 100%; font-size: 12.5px; }
.vapprox::before { content: "Approximate view · "; font-weight: 600; color: var(--fg); }
.vbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.vbody:has(.vtextpane:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); }
.vscroll { position: relative; overflow: auto; height: clamp(420px, calc(100vh - 250px), 1400px); border-radius: 14px; background: var(--canvas); overscroll-behavior: contain; scrollbar-width: thin; }
.vsheet { display: grid; justify-items: center; align-content: start; min-width: min-content; padding: 16px; }
.vcanvas, .vimg { display: block; max-width: none; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(17,17,26,.08), 0 2px 4px rgba(17,17,26,.06), 0 18px 40px -22px rgba(17,17,26,.4); }
.vmsg { padding: 60px 16px; text-align: center; }
.vdocwrap { width: min(100%, 860px); background: #fff; color: #1b1b1f; border-radius: 4px; padding: clamp(18px, 4vw, 48px); box-shadow: 0 0 0 1px rgba(17,17,26,.08), 0 18px 40px -22px rgba(17,17,26,.4); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.vdocwrap .hint { color: #5b5b66; }
.vdocx h1 { font-size: 26px; margin: 0 0 12px; } .vdocx h2 { font-size: 21px; margin: 18px 0 8px; } .vdocx h3, .vdocx h4 { font-size: 17px; margin: 14px 0 6px; }
.vdocx p { margin: 0 0 10px; } .vdocx li { margin: 0 0 4px 20px; }
.vtablewrap { overflow-x: auto; margin: 0 0 12px; }
.vdocwrap table { border-collapse: collapse; font-size: 13px; }
.vdocwrap td, .vdocwrap th { border: 1px solid #d0d0d8; padding: 4px 8px; vertical-align: top; white-space: pre-wrap; }
.vgrid th { background: #f2f2f6; color: #55555f; font-weight: 600; position: sticky; top: 0; }
.vgrid tr > th:first-child { position: sticky; left: 0; }
.vslide { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; padding: 24px; border: 1px solid #d0d0d8; border-radius: 6px; }
.vtextfile { margin: 0; white-space: pre-wrap; font: 13px/1.6 var(--f-mono); color: #1b1b1f; }
.vtextpane { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px 14px; height: clamp(420px, calc(100vh - 250px), 1400px); overflow: auto; min-width: 0; }
.vtextpane h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.vtextout { margin: 0; white-space: pre-wrap; font: 13.5px/1.6 var(--f-body); overflow-wrap: anywhere; }
/* Expanded reading view: the document fills the window; Escape or the same button returns. */
.viewer.expanded { position: fixed; inset: 0; z-index: 80; background: var(--bg); padding: max(10px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); grid-template-rows: auto auto auto minmax(0, 1fr); }
.viewer.expanded .vbar { position: static; }
.viewer.expanded .vscroll, .viewer.expanded .vtextpane { height: 100%; }
.viewer.expanded .vbody { min-height: 0; }
body.vexpanded { overflow: hidden; }
/* Edit / Preview result tabs for tools worked on directly on the page */
.stagetabs { display: flex; justify-content: center; }
.stagetabs[hidden] { display: none; }
.stagetabs .vbtn { min-height: 38px; padding: 0 16px; font-size: 14px; }
/* Fold-away panels (wide screens) */
.wshead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wstoggles { margin-left: auto; display: flex; gap: 6px; }
.wstoggle { min-height: 34px; padding: 0 12px 0 30px; position: relative; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 13px var(--f-body); cursor: pointer; }
.wstoggle::before { content: ""; position: absolute; left: 11px; top: 50%; width: 11px; height: 11px; margin-top: -6px; border-radius: 3px; border: 1.5px solid currentColor; }
.wstoggle[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); }
.wstoggle[aria-pressed="false"] { color: var(--muted); }
@media (min-width: 900px) {
  .ws.norail { grid-template-columns: minmax(0, 1fr) 344px; }
  .ws.noinsp { grid-template-columns: 232px minmax(0, 1fr); }
  .ws.norail.noinsp, .ws.nofiles.noinsp { grid-template-columns: minmax(0, 1fr); }
  .ws.norail > .rail, .ws.noinsp > .insp { display: none; }
}
@media (min-width: 900px) and (max-width: 1180px) { .ws.noinsp { grid-template-columns: 196px minmax(0, 1fr); } .ws.norail { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 899px) { .wstoggles { display: none; } }
/* Result pages in the rail */
.pagerailwrap > .railh { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pagerailwrap .pagerail { margin-top: 0; padding-top: 0; border-top: 0; }
.railgroup { display: grid; gap: 1px; margin: 10px 4px 6px; font-size: 12.5px; }
.railgroup span { color: var(--muted); overflow-wrap: anywhere; }
.pgsrc { font-size: 10.5px; color: var(--muted); line-height: 1.2; text-align: center; }
/* Review card for tools that send something */
.reviewcard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); }
.reviewcard[hidden] { display: none; }
.reviewcard h4 { margin: 0 0 8px; }
.reviewcard dl { margin: 0 0 8px; display: grid; gap: 8px; }
.reviewcard dt { font-size: 12px; color: var(--muted); }
.reviewcard dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .ws .doc:has(> .viewer:not([hidden])) { padding: 8px; }
  .vbar { gap: 6px; padding: 5px; }
  .vbar .vzoomg .vbtn:nth-child(4), .vbar .vzoomg .vbtn:nth-child(5) { padding: 0 8px; }
  .vscroll { height: clamp(360px, 68vh, 900px); }
  .vbody:has(.vtextpane:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .vtextpane { height: auto; max-height: 50vh; }
  .vexp { margin-left: 0; }
}
@media (max-width: 520px) {
  .vbar { display: flex; flex-wrap: wrap; gap: 6px; }
  .vbar > .vtextbtn { margin-left: auto; }
  .vbar > .vexp { margin-left: 0; }
  .vbar > .vseg:only-child, .vbar > .vexp:first-child { margin-left: auto; }
  .vbar > .voutsel { flex: 1 1 100%; max-width: none; order: 2; }
  .vbar > .vpager { order: 3; }
  .vbar > .vzoomg { order: 4; margin-left: auto; }
  .vpgin { width: 2.6em; min-height: 28px; }
  .vpgof { padding: 0 2px; }
  .vbtn { min-width: 28px; min-height: 32px; padding: 0 5px; }
  .vseg .vbtn { padding: 0 10px; }
  .vzoom { min-width: 2.6em; font-size: 12.5px; }
  .vgroup { gap: 0; }
  .vsheet { padding: 8px; }
}
.vpgin { -moz-appearance: textfield; } .vpgin::-webkit-inner-spin-button, .vpgin::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
button.cite { border: 0; font-family: var(--f-mono); font-size: 11.5px; line-height: inherit; cursor: pointer; } button.cite:hover { text-decoration: underline; } button.cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Signatures and stamps placed on the page are drafts until the file is saved. */
[data-draft] { outline: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
[data-draft]::before { content: attr(data-draft); position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; padding: 1px 6px; border-radius: 5px; background: var(--accent); color: #fff; font: 600 10.5px/1.5 var(--f-body); letter-spacing: .02em; white-space: nowrap; pointer-events: none; }

.vbtn .sm { display: none; }
@media (max-width: 520px) { .vbtn .lg { display: none; } .vbtn .sm { display: inline; } }
/* Phones: the document comes first; the file card and page strip follow it. */
@media (max-width: 899px) {
  .ws:not(.empty) > .doc { order: -1; }
  .vstatus { padding: 8px 12px; font-size: 13px; }
}
