/* ==========================================================================
   TallyBox — design system
   ========================================================================== */
:root {
  --ink: #12141f;
  --ink-2: #3b3f52;
  --ink-3: #6b7084;
  --line: #e6e4dd;
  --line-2: #d8d5cc;
  --paper: #f7f6f2;
  --card: #ffffff;
  --brand: #f0452b;
  --brand-dark: #d1341c;
  --brand-soft: #fff0ec;
  --c-organize: #5b4ff0;
  --c-convert: #ea8a0c;
  --c-edit: #0e9f8e;
  --c-secure: #e2336b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 31, .06), 0 1px 1px rgba(18, 20, 31, .04);
  --shadow: 0 1px 2px rgba(18, 20, 31, .05), 0 8px 24px -6px rgba(18, 20, 31, .10);
  --shadow-lg: 0 2px 4px rgba(18, 20, 31, .05), 0 24px 48px -12px rgba(18, 20, 31, .18);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
.hidden { display: none !important; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.logo-mark { width: 34px; height: 34px; }
.logo span em { font-style: normal; color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--ink-2); transition: background .15s, color .15s; }
.nav-links a:hover { background: #fff; color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn svg { width: 26px; height: 26px; }

/* Tools dropdown */
.dropdown { position: relative; }
.dropdown > button { background: none; border: 0; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.dropdown > button:hover { background: #fff; color: var(--ink); }
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: -40px; width: 560px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .16s ease;
}
.dropdown.open .dropdown-panel { opacity: 1; visibility: visible; transform: none; }
.dropdown-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.dropdown-panel a:hover { background: var(--paper); color: var(--ink); }
.dropdown-panel .mini-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.dropdown-panel .mini-icon svg { width: 17px; height: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15.5px; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #f3a99c; box-shadow: none; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #262a3b; }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-lg { padding: 16px 30px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 76px 0 40px; text-align: center; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1; pointer-events: none;
}
.hero::before { width: 520px; height: 420px; background: #ffd2c6; top: -140px; left: calc(50% - 560px); }
.hero::after { width: 520px; height: 420px; background: #dcd8ff; top: -120px; right: calc(50% - 560px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 22px; height: 22px; border-radius: 50%; background: #e7f8ef; display: grid; place-items: center; }
.eyebrow .dot svg { width: 13px; height: 13px; color: #11a35a; }
.hero h1 { font-size: clamp(38px, 6.2vw, 68px); font-weight: 800; letter-spacing: -0.04em; margin: 22px auto 18px; max-width: 900px; }
.hero h1 .hl { color: var(--brand); position: relative; white-space: nowrap; }
.hero h1 .hl svg { position: absolute; left: 0; bottom: -10px; width: 100%; height: 14px; color: color-mix(in srgb, var(--brand) 35%, transparent); }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-3); max-width: 640px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust-row { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 34px; color: var(--ink-3); font-size: 14.5px; font-weight: 600; }
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row svg { width: 18px; height: 18px; color: var(--ink-2); }

/* ---------- Tool grid ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; margin: 0; }
.section-head p { color: var(--ink-3); margin: 6px 0 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; transition: all .15s;
}
.filter:hover { border-color: var(--ink-3); }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; min-height: 178px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tool-card h3 { font-size: 18px; font-weight: 750; margin: 4px 0 0; letter-spacing: -0.015em; }
.tool-card p { font-size: 14.5px; color: var(--ink-3); margin: 0; line-height: 1.5; }
.tool-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.tool-icon svg { width: 24px; height: 24px; }
.tool-card .arrow { position: absolute; top: 22px; right: 20px; width: 20px; height: 20px; color: var(--line-2); transition: color .18s, transform .18s; }
a.tool-card:hover .arrow { color: var(--ink); transform: translateX(3px); }
.tool-card.soon { opacity: .62; }
.badge { position: absolute; top: 20px; right: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 4px 9px; border-radius: 999px; background: var(--paper); color: var(--ink-3); border: 1px solid var(--line); }
.badge.new { background: #e9f9f0; color: #11834a; border-color: #c6eed7; }

.tint-organize { background: color-mix(in srgb, var(--c-organize) 12%, #fff); color: var(--c-organize); }
.tint-convert { background: color-mix(in srgb, var(--c-convert) 14%, #fff); color: var(--c-convert); }
.tint-edit { background: color-mix(in srgb, var(--c-edit) 13%, #fff); color: var(--c-edit); }
.tint-secure { background: color-mix(in srgb, var(--c-secure) 12%, #fff); color: var(--c-secure); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .f-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.feature .f-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--ink-3); font-size: 14.5px; margin: 0; }

.privacy-band {
  margin-top: 16px; border-radius: 22px; padding: 40px; color: #fff; background: var(--ink);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; position: relative; overflow: hidden;
}
.privacy-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(240,69,43,.55), transparent 70%); }
.privacy-band h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.privacy-band p { color: #b9bccb; margin: 0; }
.flow { display: flex; align-items: center; gap: 12px; justify-content: center; position: relative; z-index: 1; }
.flow .node { background: #1f2233; border: 1px solid #2f3348; border-radius: 14px; padding: 14px 16px; text-align: center; font-size: 13px; font-weight: 600; color: #d7d9e4; min-width: 96px; }
.flow .node svg { width: 26px; height: 26px; margin: 0 auto 6px; color: #fff; }
.flow .link { flex: 1; max-width: 60px; height: 2px; background: repeating-linear-gradient(90deg, #f0452b 0 6px, transparent 6px 12px); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 18px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: #fff; padding: 48px 0 28px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { color: var(--ink-2); font-weight: 500; }
.footer-grid a:hover { color: var(--brand); }
.footer-grid .about { color: var(--ink-3); max-width: 300px; margin-top: 12px; }
.footer-bottom { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }

/* ==========================================================================
   Tool pages
   ========================================================================== */
.tool-hero { text-align: center; padding: 44px 0 24px; }
.tool-hero .tool-icon { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto 16px; }
.tool-hero .tool-icon svg { width: 30px; height: 30px; }
.tool-hero h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 10px; }
.tool-hero p { color: var(--ink-3); font-size: 18px; max-width: 620px; margin: 0 auto; }

/* Dropzone */
.dropzone {
  position: relative; max-width: 760px; margin: 18px auto 0; padding: 54px 24px; text-align: center;
  background: #fff; border: 2px dashed var(--line-2); border-radius: 22px; transition: border-color .15s, background .15s, transform .15s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.dropzone .dz-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.dropzone .dz-icon svg { width: 30px; height: 30px; }
.dropzone .btn { pointer-events: none; }
.dropzone .dz-hint { margin: 14px 0 0; color: var(--ink-3); font-size: 14.5px; }
.dropzone .dz-safe { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #11834a; }
.dropzone .dz-safe svg { width: 15px; height: 15px; }
.dropzone input[type=file] { display: none; }

/* Workspace */
.workspace { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; margin-top: 10px; }
.work-main { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; min-height: 420px; }
.work-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.work-toolbar .info { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.work-toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.work-side { position: sticky; top: 88px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.work-side h3 { font-size: 18px; margin: 0; }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group > label, .opt-label { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.opt-row { display: flex; gap: 10px; align-items: center; }
.opt-row > * { flex: 1; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=color].input { padding: 4px; height: 42px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.seg button { border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* Position picker (3x3) */
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 132px; }
.pos-grid button { aspect-ratio: 1.3; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.pos-grid button::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.pos-grid button.active { border-color: var(--brand); background: var(--brand-soft); }
.pos-grid button.active::after { background: var(--brand); }
.pos-grid button:disabled { visibility: hidden; }

/* File cards (merge / images) */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.file-card, .page-card {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: box-shadow .15s, border-color .15s, opacity .15s, transform .15s;
  user-select: none;
}
.file-card[draggable=true], .page-card[draggable=true] { cursor: grab; }
.file-card:hover, .page-card:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.file-card.dragging, .page-card.dragging { opacity: .35; }
.file-card.drop-before, .page-card.drop-before { box-shadow: -4px 0 0 0 var(--brand); }
.file-card.drop-after, .page-card.drop-after { box-shadow: 4px 0 0 0 var(--brand); }
.file-card, .page-card { scroll-margin-top: 96px; }
.thumb { position: relative; width: 100%; aspect-ratio: 0.77; display: grid; place-items: center; overflow: hidden; }
.thumb canvas, .thumb img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 1px 3px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.04); background: #fff; transition: transform .25s ease; }
.thumb .skeleton { width: 80%; height: 90%; border-radius: 4px; background: linear-gradient(90deg, #eceae4 25%, #f6f5f1 50%, #eceae4 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.card-name { font-size: 13px; font-weight: 600; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 12px; color: var(--ink-3); margin-top: -6px; }
.card-tools { position: absolute; z-index: 3; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.file-card:hover .card-tools, .page-card:hover .card-tools, .card-tools:focus-within { opacity: 1; }
@media (hover: none) { .card-tools { opacity: 1; } }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn.danger:hover { color: #d11a2a; border-color: #d11a2a; }
.icon-btn svg { width: 16px; height: 16px; }
.page-num { position: absolute; z-index: 3; top: 8px; left: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.page-card.selectable { cursor: pointer; }
.page-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); }
.page-card.selected .page-num { background: var(--brand); }
.page-card .sel-check { position: absolute; z-index: 3; bottom: 44px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); display: grid; place-items: center; }
.page-card.selected .sel-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-card .sel-check svg { width: 14px; height: 14px; opacity: 0; }
.page-card.selected .sel-check svg { opacity: 1; }
.page-card.excluded { opacity: .4; }
.page-card.excluded .thumb canvas { filter: grayscale(1); }
.page-card.blank-page .thumb .blank { width: 77%; aspect-ratio: .707; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.range-group { outline: 2px dashed transparent; }

.add-card { border: 2px dashed var(--line-2); background: #fff; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 14px; transition: border-color .15s, color .15s; }
.add-card:hover { border-color: var(--brand); color: var(--brand); }
.add-card svg { width: 28px; height: 28px; }

/* Preview (single page) */
.preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.preview-stage { position: relative; display: inline-block; box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.05); background: #fff; line-height: 0; }
.preview-stage canvas { max-width: 100%; height: auto; }
.preview-stage .overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pager { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }

/* Signature placement */
.sign-layout .preview-stage { touch-action: none; }
.placed { position: absolute; border: 1.5px dashed transparent; cursor: move; touch-action: none; line-height: 0; }
.placed img { width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.placed:hover, .placed.active { border-color: var(--brand); background: rgba(240,69,43,.04); }
.placed .handle { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; cursor: nwse-resize; display: none; box-shadow: var(--shadow-sm); }
.placed .del { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid #fff; display: none; place-items: center; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.placed:hover .handle, .placed.active .handle { display: block; }
.placed:hover .del, .placed.active .del { display: grid; }
.sig-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sig-item { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; background: #fff; cursor: pointer; height: 64px; display: grid; place-items: center; position: relative; }
.sig-item:hover { border-color: var(--brand); }
.sig-item img { max-height: 46px; max-width: 100%; }
.sig-item .x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; border: 0; font-size: 12px; cursor: pointer; display: none; }
.sig-item:hover .x { display: block; }
.sign-tip { font-size: 13px; background: var(--paper); border-radius: 10px; padding: 10px 12px; color: var(--ink-2); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18,20,31,.5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--paper); }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 650; color: var(--ink-3); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }
.sig-pad { width: 100%; height: 220px; border: 1px dashed var(--line-2); border-radius: 12px; background: #fcfcfa; touch-action: none; cursor: crosshair; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
.font-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.font-choice { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; background: #fff; cursor: pointer; font-size: 28px; line-height: 1.2; height: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.font-choice.active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }

/* Busy overlay */
.busy { position: fixed; inset: 0; z-index: 120; background: rgba(247,246,242,.82); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade .15s; }
.busy-box { text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid #f3d3cc; border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-text { font-weight: 700; font-size: 18px; }
.busy-sub { color: var(--ink-3); font-size: 14px; margin-top: 4px; }
.progress { width: 260px; height: 6px; background: #eee9df; border-radius: 99px; overflow: hidden; margin: 14px auto 0; }
.progress > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }

/* Done */
.done-card { max-width: 620px; margin: 10px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 44px 30px; text-align: center; box-shadow: var(--shadow); }
.done-icon { width: 72px; height: 72px; border-radius: 50%; background: #e7f8ef; color: #11a35a; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .3s ease; }
.done-icon svg { width: 36px; height: 36px; }
.done-card h2 { font-size: 28px; font-weight: 800; }
.done-card .file-out { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--ink-2); margin: 4px 0 24px; max-width: 100%; }
.done-card .file-out span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.next-tools { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.next-tools p { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.next-tools .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 600; font-size: 14px; }
.chip:hover { border-color: var(--ink-3); }
.chip .mini-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.chip .mini-icon svg { width: 13px; height: 13px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: 90vw; }
.toast.error { background: #c4231a; }

/* How-to & SEO content */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .n { width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; }
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { color: var(--ink-3); font-size: 14.5px; margin: 0; }
.prose { max-width: 760px; margin: 0 auto; color: var(--ink-2); }
.prose h1 { font-size: 40px; font-weight: 800; color: var(--ink); }
.prose h2 { font-size: 22px; margin-top: 1.6em; color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* 404 */
.notfound { text-align: center; padding: 100px 0 40px; }
.notfound .big { font-size: 120px; font-weight: 800; letter-spacing: -0.05em; color: var(--brand); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .work-side { position: static; }
  .features { grid-template-columns: 1fr 1fr; }
  .privacy-band { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .dropdown { display: none; }
  .menu-btn { display: block; }
  .howto { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .dropzone { padding: 40px 18px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .work-main { padding: 14px; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .flow .node { min-width: 0; padding: 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   SEO / content components
   ========================================================================== */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 300; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { left: 12px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-hidden] { color: var(--line-2); }
.breadcrumb [aria-current] { color: var(--ink-3); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.tool-hero { padding-top: 22px; }
.dropdown-panel .all-link { grid-column: 1 / -1; justify-content: center; color: var(--brand); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.section-head.center { justify-content: center; text-align: center; }
ol.howto { list-style: none; padding: 0; margin: 0; }
.footer-grid-5 { grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; }
.footer-grid .f-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 14px; font-weight: 700; }

.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: 24px; font-weight: 800; color: var(--ink); margin: 1.6em 0 .6em; letter-spacing: -0.02em; }
.prose h3 { font-size: 19px; color: var(--ink); margin: 1.4em 0 .5em; }
.prose > :first-child, .prose-block:first-child h2 { margin-top: 0; }
.prose a { color: var(--brand-dark); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose strong { color: var(--ink); }
.prose code, .prose kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 40px 44px; max-width: 900px; margin: 0 auto; }
.content-2col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
.content-2col .prose h2 { margin-top: 0; }
.narrow { max-width: 780px; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform .18s, box-shadow .18s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.guide-card h3 { font-size: 18px; margin: 0; line-height: 1.3; }
.guide-card p { color: var(--ink-3); font-size: 14.5px; margin: 0; flex: 1; }
.g-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--c-organize); text-transform: uppercase; letter-spacing: .05em; }
.g-meta svg { width: 15px; height: 15px; }
.g-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--brand); }
.g-more svg { width: 16px; height: 16px; }

.article-head h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -0.035em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-3); font-size: 14px; font-weight: 600; margin: 0 0 18px; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 15px; height: 15px; }
.lead-p { font-size: 19px; line-height: 1.65; color: var(--ink-2); }
.cta-box { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 26px 0; box-shadow: var(--shadow-sm); }
.cta-box > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.cta-box strong { font-size: 16.5px; }
.cta-box span { color: var(--ink-3); font-size: 14px; }
.cta-box .tool-icon { flex: none; }
.faq-title { font-size: 24px; font-weight: 800; margin: 40px 0 16px; }
.contact-card { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 20px 0 10px; }
.contact-card > svg { width: 28px; height: 28px; color: var(--brand); flex: none; margin-top: 2px; }
.contact-card div { display: flex; flex-direction: column; gap: 2px; }
.contact-card a { font-size: 18px; }
.contact-card span { color: var(--ink-3); font-size: 14px; }

/* Ad slots: space is reserved so ads never shift the layout (good for Core Web Vitals) */
.ad-slot { margin: 28px auto; max-width: 970px; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-slot .ad-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.ad-slot ins { width: 100%; }

@media (max-width: 980px) {
  .content-2col { grid-template-columns: 1fr; gap: 10px; }
  .footer-grid-5 { grid-template-columns: 1fr 1fr; }
  .prose-card { padding: 28px 22px; }
}
@media (max-width: 560px) {
  .cta-box { flex-direction: column; align-items: flex-start; }
  .footer-grid-5 { grid-template-columns: 1fr; }
  .ad-slot { min-height: 250px; }
}
