
/* Layout: workbench — tool rail on the left, one work surface on the right; rail becomes a chip strip on phones */
:root {
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --ink: #111A2E;
  --muted: #5A6478;
  --line: #D3DAE5;
  --accent: #1F4FE0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1E8FF;
  --ok: #0E7F58;
  --danger: #BF3328;
  --shadow: 0 1px 2px rgba(17,26,46,.06), 0 6px 20px rgba(17,26,46,.06);
  --f-display: "Bricolage Grotesque", "Noto Sans SC", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C111D; --surface: #141B2C; --ink: #E6EBF5; --muted: #97A2B8; --line: #263049;
    --accent: #7391FF; --accent-ink: #0C111D; --accent-soft: #1C2750; --ok: #3EC48F; --danger: #FF7B6F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C111D; --surface: #141B2C; --ink: #E6EBF5; --muted: #97A2B8; --line: #263049;
  --accent: #7391FF; --accent-ink: #0C111D; --accent-soft: #1C2750; --ok: #3EC48F; --danger: #FF7B6F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 18px 40px; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 6px 18px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.logo { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.tag { color: var(--muted); font-size: 14px; }
.meters { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meter { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.meter b { font-family: var(--f-mono); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.meter small { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.meter.zero b { color: var(--ok); }
.lang { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }

/* body grid */
.grid { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 24px; margin-top: 22px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); }
.tool-btn { display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; text-align: left; border: 1px solid transparent; background: none; padding: 10px 12px; border-radius: var(--r); cursor: pointer; }
.tool-btn .ic { grid-row: span 2; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.tool-btn .ic svg { width: 16px; height: 16px; }
.tool-btn b { font-weight: 600; font-size: 15px; }
.tool-btn small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tool-btn:hover { background: var(--surface); }
.tool-btn[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.tool-btn[aria-selected="true"] .ic { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.panel h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
.panel .lead { color: var(--muted); margin: 6px 0 18px; }
.tool { display: flex; flex-direction: column; gap: 16px; }

/* dropzone */
.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; text-align: center; padding: 22px 16px; border: 1.5px dashed var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { font-weight: 600; }
.drop small { display: block; color: var(--muted); font-size: 13px; }
.drop .plus { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 22px; line-height: 1; flex: none; }

/* file list */
.files { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.files:empty { display: none; }
.file { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.file .num { font-family: var(--f-mono); color: var(--muted); font-size: 13px; text-align: center; }
.file .nm { min-width: 0; }
.file .nm div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file .meta { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.meta.err, .lock .err { color: var(--danger); }
.lock { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: 13.5px; }
.lock .txt { width: 180px; font-family: var(--f-body); }
.chip { display: inline-block; font-size: 11px; font-family: var(--f-body); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.acts { display: flex; gap: 4px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 15px; height: 15px; }

/* options */
.opts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg label span { display: block; padding: 7px 12px; cursor: pointer; font-size: 14px; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.txt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); min-width: 0; width: 220px; max-width: 100%; font-family: var(--f-mono); }
.note { font-size: 13.5px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 10px 12px; }

/* page grid */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.pages:empty { display: none; }
.pg { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.pg .sheet { aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; max-width: 100%; }
.pg canvas { max-width: 92%; max-height: 92%; box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; transition: transform .2s; }
.pg .cap { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.pg .cap b { color: var(--ink); font-weight: 500; }
.pg .acts { justify-content: space-between; }
.pg .icon-btn { width: 28px; height: 28px; }
.pg.del { opacity: .45; }
.pg.del .sheet { background: repeating-linear-gradient(45deg, transparent 0 8px, var(--line) 8px 9px); }
.pg.del .del-btn { color: var(--danger); border-color: var(--danger); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .sp { margin-left: auto; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* run + result */
.run-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 4px; }
.btn { border: 0; border-radius: 9px; padding: 11px 20px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 7px 12px; font-weight: 500; font-size: 14px; }
.status { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status.err { color: var(--danger); }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; width: 160px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.result { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--ok); border-radius: var(--r); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.result .ok { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: var(--surface); display: grid; place-items: center; }
.result .ok svg { width: 20px; height: 20px; }
.result .nm { min-width: 0; }
.result .nm div { font-weight: 600; overflow-wrap: anywhere; }
.result .meta { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* rail groups */
.rail { max-height: calc(100vh - 24px); overflow-y: auto; }
.rail-g { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.rail-g:first-child { padding-top: 0; }

/* range + color inputs */
input[type="range"] { accent-color: var(--accent); width: 160px; max-width: 100%; }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.field .val { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); text-transform: none; letter-spacing: 0; margin-left: 6px; }

/* watermark layout: options left, live preview right */
.split2 { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; align-items: start; }
.split2 .opts { flex-direction: column; align-items: flex-start; }
.preview { display: flex; flex-direction: column; gap: 6px; }
.preview canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.preview small { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }

/* signature maker: the pad is always white paper so ink reads in either theme */
.pad-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: #FFFFFF; overflow: hidden; }
.pad { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.pad-line { position: absolute; left: 20px; right: 20px; bottom: 40px; border-top: 1px dashed #C6CDD9; pointer-events: none; }
.pad-hint { position: absolute; left: 20px; bottom: 16px; color: #8A93A5; font-size: 13px; pointer-events: none; }
.pad-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.pad-tools .btn.ghost { background: #FFFFFF; color: #111A2E; border-color: #D3DAE5; }
.typed { min-height: 170px; display: flex; align-items: center; padding: 10px 24px 30px; font-family: "Caveat", "Brush Script MT", cursive; font-weight: 600; font-size: 64px; line-height: 1.1; overflow-wrap: anywhere; }
.sig-up { min-height: 170px; display: grid; place-items: center; padding: 12px; }
.sig-up img { max-height: 146px; }
.sig-up span { color: #8A93A5; font-size: 14px; }

/* signing stage */
.stage-nav { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.stage { background: var(--bg); border-radius: var(--r); padding: 14px; }
.stage-inner { position: relative; max-width: 620px; margin: 0 auto; line-height: 0; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); cursor: copy; }
.stage-inner canvas { display: block; width: 100%; height: auto; }
.place { position: absolute; outline: 1.5px dashed var(--accent); outline-offset: 2px; cursor: move; touch-action: none; line-height: 0; }
.place img { width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.place .h { position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; border-radius: 4px; background: var(--accent); border: 2px solid var(--surface); cursor: nwse-resize; touch-action: none; }
.place .d { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); background: var(--danger); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 2px; }
@media (pointer: coarse) {
  .place .h { width: 26px; height: 26px; right: -14px; bottom: -14px; border-radius: 6px; }
  .place .d { width: 30px; height: 30px; left: -15px; top: -15px; font-size: 16px; }
}
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

@media (max-width: 820px) {
  .rail { max-height: none; overflow-y: visible; }
  .rail-g { display: none; }
  .split2 { grid-template-columns: minmax(0,1fr); }
  .typed { font-size: 48px; }
}

.foot { margin-top: 26px; font-size: 13px; color: var(--muted); max-width: 70ch; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--shadow); }

@media (max-width: 820px) {
  .grid { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .rail { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .tool-btn { grid-template-columns: 26px auto; flex: none; padding: 8px 10px; white-space: nowrap; }
  .tool-btn .ic { grid-row: auto; width: 26px; height: 26px; }
  .tool-btn small { display: none; }
  .panel { padding: 18px 16px; }
  .meters { margin-left: 0; }
}
@media (max-width: 480px) {
  .result { grid-template-columns: 40px minmax(0,1fr); }
  .result .btn { grid-column: 1 / -1; }
  .pages { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* table preview under a PDF to Excel result */
.tpreview { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.tp-cap { font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tp-scroll { overflow-x: auto; }
.tpreview table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.tpreview th, .tpreview td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; max-width: 320px; }
.tpreview th { background: var(--bg); font-weight: 600; white-space: nowrap; }
.tpreview td.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tpreview tr:last-child td { border-bottom: 0; }
.tpreview td:not(.num) { min-width: 9em; }
.tpreview td:first-child { min-width: 0; white-space: nowrap; }
select.txt { font-family: var(--f-body); width: auto; min-width: 180px; padding-block: 7px; }

/* ---------- multi-page site: links, landing content, home, footer ---------- */
a.logo { color: inherit; text-decoration: none; }
a.lang { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
a.tool-btn { color: inherit; text-decoration: none; }
.tool-btn[aria-current="page"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.tool-btn[aria-current="page"] .ic { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.seo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 40px; margin-top: 36px; }
.seo h2 { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
.seo .howto ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.seo .howto li { counter-increment: step; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.seo .howto li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--f-mono); font-weight: 500; font-size: 14px; }
.seo .howto li span { padding-top: 4px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 13px 28px 13px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 20px; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--muted); max-width: 68ch; }
.related { grid-column: 1 / -1; }
.related .links { display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
.related a:hover { border-color: var(--accent); color: var(--accent); }
.related a { padding: 6px 14px 6px 6px; }
.related a .mk { width: 26px; height: 26px; border-radius: 7px; }
.related a .mk svg { width: 14px; height: 14px; }
.related a .mk .fmt b { font-size: 8px; } .related a .mk .fmt i { display: none; }

.site-foot { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 28px; font-size: 14px; }
.site-foot h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .fine { grid-column: 1 / -1; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* home */
.hero { padding-block: 42px 30px; display: grid; gap: 16px; max-width: 760px; }
.hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.02; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 60ch; }
.hero .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.hero .btn { text-decoration: none; display: inline-block; }
.proof { font-family: var(--f-mono); font-size: 13px; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); border-radius: 8px; padding: 9px 12px; background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.home-h2 { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; margin: 34px 0 16px; }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.why > div { padding: 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.why h3 { margin: 10px 0 6px; font-size: 16px; }
.why-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.why-ic svg { width: 19px; height: 19px; }
.why-wrap { margin-top: 34px; }
.why-wrap h2 { font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; margin: 0 0 14px; }
.why p { margin: 0; color: var(--muted); font-size: 14.5px; }
.home-faq { max-width: 760px; }
.doc { max-width: 720px; padding-block: 30px; }
.doc h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 7.5vw, 38px); letter-spacing: -.02em; margin: 0 0 8px; overflow-wrap: break-word; hyphens: auto; }
.doc p, .doc h2 { overflow-wrap: break-word; }
.doc h2 { font-size: 18px; margin: 26px 0 6px; }
.doc p { margin: 0; color: var(--muted); }
.doc .date { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

@media (max-width: 820px) {
  .seo { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hero { padding-block: 26px 18px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* language menu */
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 12px; font-weight: 600; font-size: 14px; user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-inline-start: 2px; opacity: .6; }
.langs[open] summary::after { transform: translateY(1px) rotate(225deg); }
.langs summary svg { width: 16px; height: 16px; color: var(--muted); }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px; width: 220px; max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr; }
.langs li a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.langs li a:hover { background: var(--bg); }
.langs li a[aria-current="true"] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.lang-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.lang-list a { color: var(--accent); text-decoration: none; }

/* right-to-left pages (Arabic): mirror the few spots that use physical sides */
[dir="rtl"] .faq summary { padding: 13px 0 13px 28px; }
[dir="rtl"] .faq summary::after { right: auto; left: 4px; }
[dir="rtl"] .tool-btn { text-align: right; }
[dir="rtl"] .meters { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pad-tools { right: auto; left: 10px; }
[dir="rtl"] .pad-line, [dir="rtl"] .pad-hint { direction: rtl; }
[dir="rtl"] .field .val { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .chip { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .toolbar .sp { margin-left: 0; margin-right: auto; }
[dir="rtl"] .file .meta, [dir="rtl"] .result .meta, [dir="rtl"] .meter b { direction: ltr; unicode-bidi: isolate; text-align: right; }
@media (max-width: 820px) { [dir="rtl"] .meters { margin-right: 0; } }

/* "Install app" button (shown only when the browser offers installation) */
.install { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 9px 12px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.install:hover { background: var(--accent); color: var(--accent-ink); }
.install svg { width: 16px; height: 16px; }
.install[hidden] { display: none; }

/* ---------- header with category menus ---------- */
.top { position: relative; flex-wrap: nowrap; gap: 8px 18px; }
.top .logo { flex: none; }
.top-r { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 9px 11px; border-radius: 8px; font-weight: 600; font-size: 14.5px; white-space: nowrap; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .55; margin-inline-start: 2px; }
.dd[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.dd > summary:hover, .dd[open] > summary { background: var(--surface); }
.dd > summary svg { width: 17px; height: 17px; }
.dd-panel { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(16, 24, 40, .16); padding: 8px; width: 290px; }
.dd-panel.two { width: 560px; }
.dd-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dd-panel.two ul { grid-template-columns: 1fr 1fr; }
.dd-panel a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14.5px; line-height: 1.25; }
.dd-panel a:hover { background: var(--bg); }
.dd-panel a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dd-g h3 { margin: 10px 8px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dd-g:first-child h3 { margin-top: 4px; }
.dd.mob { display: none; }

/* colour mark: format badge or tool icon on a coloured square */
.mk { --c: var(--accent); flex: none; width: 32px; height: 32px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; }
.mk svg { width: 17px; height: 17px; }
.mk .fmt { display: flex; flex-direction: column; align-items: center; line-height: 1; gap: 2px; }
.mk .fmt b { font-family: var(--f-mono); font-weight: 500; font-size: 9.5px; letter-spacing: .02em; }
.mk .fmt i { font-style: normal; font-size: 7.5px; opacity: .85; font-family: var(--f-mono); }

/* home tiles */
.tiles-group { margin-bottom: 24px; }
.tiles-group h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tile { --c: var(--accent); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.25;
  background: color-mix(in srgb, var(--c) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--c); transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 18%, transparent); }
.tile .mk { width: 44px; height: 44px; border-radius: 11px; }
.tile .mk svg { width: 22px; height: 22px; }
.tile .mk .fmt b { font-size: 12px; }
.tile .mk .fmt i { font-size: 9.5px; }
.tile b { font-weight: 600; }

/* full-width tool page */
.grid.solo { grid-template-columns: minmax(0, 1fr); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px 24px; margin-bottom: 18px; }
.panel-head > div:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; flex: 1 1 420px; min-width: 0; }
.panel-head .mk { width: 48px; height: 48px; border-radius: 12px; grid-row: span 2; align-self: start; }
.panel-head .mk svg { width: 24px; height: 24px; }
.panel-head .mk .fmt b { font-size: 12.5px; } .panel-head .mk .fmt i { font-size: 10px; }
.panel-head .lead { margin: 4px 0 0; max-width: 72ch; }
.panel-head .meters { margin: 0; }

@media (max-width: 1060px) {
  .dd > summary { padding: 9px 8px; font-size: 14px; }
}
@media (max-width: 900px) {
  .dd:not(.mob) { display: none; }
  .dd.mob { display: block; position: static; }
  .top { flex-wrap: wrap; }
  .mob .dd-panel { inset-inline: 0; width: auto; max-height: min(75vh, 640px); overflow-y: auto; }
  .mob .dd-panel ul { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .top { gap: 8px 10px; }
  .top .logo { font-size: 22px; }
  .top-r { margin-inline-start: auto; }
  .install span, .install { font-size: 13px; padding: 8px 10px; }
  .mob .dd-panel ul { grid-template-columns: 1fr; }
  .langs summary .ln { display: none; }
  .langs summary { padding: 9px 10px; }
  .top { flex-wrap: nowrap; }
  .dd.mob > summary { padding: 9px 8px; }
  .panel-head .meters { width: 100%; flex-wrap: nowrap; }
  .panel-head .meter { flex: 1; }
  .panel-head .meters { align-items: stretch; }
  .panel-head .mk { grid-row: auto; align-self: center; }
  .panel-head .lead { grid-column: 1 / -1; margin-top: 10px; }
  .panel-head .mk { width: 40px; height: 40px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

/* Server conversions: the only tools that upload say so before anything happens */
.upnote { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink); background: color-mix(in srgb, #E8A317 12%, var(--surface)); border: 1px solid color-mix(in srgb, #E8A317 45%, var(--line)); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.upnote svg { width: 20px; height: 20px; flex: none; color: #B87A00; margin-top: 1px; }
.meter.up b { color: #B87A00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .upnote svg, :root:not([data-theme="light"]) .meter.up b { color: #F2B84B; } }
:root[data-theme="dark"] .upnote svg, :root[data-theme="dark"] .meter.up b { color: #F2B84B; }
.cloud { display: inline-flex; flex: none; margin-inline-start: auto; color: var(--muted); font-style: normal; }
.cloud svg { width: 15px; height: 15px; }
.tile .cloud { align-self: flex-start; }

/* Compare PDF: two slots, then a side-by-side viewer */
.cmp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.cmp-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cmp-slot .drop { margin: 0; }
.cmp-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.cmp-tag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.cmp-tag.a { --c: #DC3340; } .cmp-tag.b { --c: #1A994D; }
.cmp-view { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.cmp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-pg { font-family: var(--f-mono); font-size: 13px; min-width: 7em; text-align: center; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-sheet { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; min-height: 200px; }
.cmp-sheet canvas { display: block; max-width: 100%; height: auto; }
.cmp-none { padding: 40px 16px; text-align: center; color: #5A6478; font-size: 14px; }
.cmp-list { margin: 0; padding: 0 0 0 1.6em; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; font-size: 14px; line-height: 1.5; }
.cmp-list li { cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.cmp-list li:hover { background: var(--bg); }
.cmp-list .cmp-p { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-inline-end: 8px; }
.cmp-list del, .cmp-list ins { text-decoration: none; padding: 1px 4px; border-radius: 4px; margin-inline-end: 6px; overflow-wrap: anywhere; }
.cmp-list del { background: rgba(220, 51, 64, .14); color: #A61E2A; text-decoration: line-through; }
.cmp-list ins { background: rgba(26, 153, 77, .14); color: #116B35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cmp-list del { color: #FF8A93; } :root:not([data-theme="light"]) .cmp-list ins { color: #6FE0A0; } }
:root[data-theme="dark"] .cmp-list del { color: #FF8A93; } :root[data-theme="dark"] .cmp-list ins { color: #6FE0A0; }
@media (max-width: 640px) { .cmp-pick, .cmp-cols { grid-template-columns: 1fr; } }
.cmp-list .cmp-ctx { color: var(--muted); margin-inline-end: 6px; }

/* ---------- guides (blog) ---------- */
.post p { color: var(--ink); line-height: 1.7; margin: 0 0 14px; }
.post h2 { font-size: 21px; margin: 32px 0 10px; }
.post ul, .post ol { margin: 0 0 16px; padding-left: 22px; line-height: 1.7; }
.post li { margin-bottom: 6px; overflow-wrap: break-word; }
.post a { color: var(--accent); }
.post code { font-family: var(--f-mono); font-size: .9em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.post del { color: var(--muted); }
.post .crumbs { margin: 0 0 6px; font-size: 14px; }
.post .crumbs a { color: var(--muted); text-decoration: none; }
.post .crumbs a:hover { color: var(--accent); }
.post .date { margin-bottom: 18px; }
.post .post-lead { font-size: 18px; color: var(--muted); margin-bottom: 22px; }
.post .post-tip { border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.post-cta { display: flex; align-items: center; gap: 14px; margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.post-cta > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-cta > div span { color: var(--muted); font-size: 14px; }
.post-cta .btn { text-decoration: none; color: #fff; white-space: nowrap; }
.post-list { display: grid; gap: 12px; }
.post-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); }
.post-card:hover { border-color: var(--accent); }
.post-card > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-card > div span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.post-more ul { padding-left: 20px; }
.guides { grid-column: 1 / -1; }
.guides ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.guides a { color: var(--accent); }
@media (max-width: 560px) { .post-cta { flex-wrap: wrap; } .post-cta .btn { width: 100%; text-align: center; } }
