/* Timesnap PDF — the tools hub, each tool's workspace, and the editor.
   Built on the site's own tokens (site.css): dark and light alike. */

body.pdf-app { min-height: 100vh; display: flex; flex-direction: column; }
.pdf-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; }
/* While editing, the editor fills the window under the header exactly. */
body.pdf-app.editing { height: 100vh; height: 100dvh; overflow: hidden; }
body.pdf-app.editing .pdf-main { max-width: none; padding: 0; min-height: 0; display: flex; flex-direction: column; }
body.pdf-app.editing .pdf-tool { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; }
body.pdf-app.editing .pdf-footer { display: none; }


/* ── Hub ─────────────────────────────────────────────────────────────── */
.pdf-hub { position: relative; text-align: center; padding: 56px 0 10px; }
.pdf-hub h1 { font-size: clamp(32px, 5.6vw, 56px); font-weight: 850; }
.hub-search { max-width: 520px; margin: 0 auto 26px; }
.hub-search input {
  width: 100%; padding: 14px 18px 14px 46px; border-radius: 14px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath fill='%238b95a5' d='M10 3a7 7 0 0 1 5.6 11.2l4.6 4.6a1 1 0 0 1-1.4 1.4l-4.6-4.6A7 7 0 1 1 10 3Zm0 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10Z'/%3E%3C/svg%3E") no-repeat 16px center;
  color: var(--text); border: 1px solid var(--line-2); font: 500 16px var(--font);
  box-shadow: var(--shadow);
}
.hub-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool-card {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: 16px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); text-decoration: none; }
.tool-card .tool-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tool-card .tool-icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-size: 15.5px; font-weight: 750; letter-spacing: -0.01em; }
.tool-card .tool-text { display: block; min-width: 0; }
.tool-card .tool-desc { display: block; margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tool-card .badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.tool-card.hidden-by-search { display: none; }
.hub-empty { text-align: center; color: var(--muted); padding: 20px; }
.hub-promises { list-style: none; padding: 0; margin: 46px auto 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 980px; text-align: left; }
.hub-promises li { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.hub-promises b { color: var(--text); }

/* Tool icon colours */
.c-green { background: linear-gradient(135deg, #22c55e, #10b981); }
.c-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.c-violet { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.c-pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.c-orange { background: linear-gradient(135deg, #f97316, #f59e0b); }
.c-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.c-teal { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.c-slate { background: linear-gradient(135deg, #64748b, #475569); }
.c-amber { background: linear-gradient(135deg, #eab308, #f97316); }

/* ── A tool's workspace ──────────────────────────────────────────────── */
.pdf-tool { padding: 26px 0 10px; }
.tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.tool-head .tool-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.tool-head .tool-icon svg { width: 26px; height: 26px; }
.tool-head h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 820; }
.tool-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; font-size: 14px; margin-bottom: 14px; }
.back-link:hover { color: var(--text); text-decoration: none; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 44px 18px; border-radius: 20px; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--blue) 40%, var(--line-2));
  background: color-mix(in srgb, var(--blue) 4%, var(--panel));
  transition: border-color .2s, background .2s, transform .2s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.drop.over { transform: scale(1.005); }
.drop .drop-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--accent); box-shadow: var(--shadow-sm); }
.drop .drop-icon svg { width: 30px; height: 30px; }
.drop strong { font-size: 19px; font-weight: 750; }
.drop span { color: var(--muted); font-size: 14px; }
.drop.compact { padding: 18px; flex-direction: row; gap: 12px; }
.drop.compact .drop-icon { width: 40px; height: 40px; border-radius: 12px; }
.drop.compact .drop-icon svg { width: 22px; height: 22px; }
.drop.compact strong { font-size: 15px; }

.panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.panel h2, .panel h3 { font-size: 15px; font-weight: 750; margin-bottom: 10px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.tool-layout > .side { position: sticky; top: 76px; display: grid; gap: 12px; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } .tool-layout > .side { position: static; } }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.input, .select, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 11px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); font: 500 14.5px var(--font);
}
.input:focus, .select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.45; }
.input.small { padding: 7px 9px; font-size: 13.5px; }
input[type="color"].swatch { width: 38px; height: 34px; padding: 2px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 11px; border-radius: 9px; font: 650 13px var(--font); cursor: pointer; }
.seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.seg.full { display: flex; } .seg.full button { flex: 1; }

.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btn.icon svg { width: 18px; height: 18px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-blue { background: var(--accent); color: var(--accent-ink); border: 0; }
.btn-blue:hover { filter: brightness(1.08); }
.btn-danger { color: var(--red); }
.btn.wide { width: 100%; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 14px; }

.note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.note.warn { color: var(--amber); }
.kpi { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi div { flex: 1; min-width: 110px; padding: 12px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); }
.kpi b { display: block; font-size: 18px; }
.kpi span { font-size: 12px; color: var(--muted); }
.saving { color: var(--green); font-weight: 800; }

/* Files list */
.file-list { display: grid; gap: 8px; }
.file-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--fill); border: 1px solid var(--line); }
.file-row .file-thumb { width: 44px; height: 56px; border-radius: 6px; background: #fff; flex: none; object-fit: cover; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .meta { font-size: 12.5px; color: var(--muted); }

/* Page thumbnails (organize, merge, split…) */
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.page-card {
  position: relative; border-radius: 14px; padding: 10px; background: var(--panel); border: 1.5px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 8px; user-select: none; transition: border-color .15s, transform .15s, opacity .15s;
}
.page-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.page-card.dragging { opacity: .4; }
.page-card.drop-before { box-shadow: -4px 0 0 var(--blue); }
.page-card.drop-after { box-shadow: 4px 0 0 var(--blue); }
.page-card.removed { opacity: .35; }
.page-card .page-canvas { width: 100%; aspect-ratio: 1 / 1.3; display: grid; place-items: center; overflow: hidden; }
.page-card canvas, .page-card img { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .28); transition: transform .2s; }
.page-card .page-no { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.page-card .page-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.page-card .page-tools button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--fill); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.page-card .page-tools button:hover { background: var(--fill-2); }
.page-card .page-tools svg { width: 15px; height: 15px; }
.page-card .page-src { position: absolute; z-index: 2; top: 8px; left: 8px; font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; color: #fff; }
.page-card .page-check { position: absolute; z-index: 2; top: 8px; right: 8px; width: 20px; height: 20px; accent-color: var(--blue); }

/* Progress overlay, modal */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(4, 6, 10, .55); backdrop-filter: blur(4px); padding: 16px; }
.overlay .progress-card { min-width: 280px; max-width: 420px; padding: 22px; border-radius: 18px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); text-align: center; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--fill-2); overflow: hidden; margin-top: 14px; }
.progress-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-radius: 20px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.modal h2 { font-size: 19px; margin-bottom: 10px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Result card after a tool runs */
.result-card { display: grid; gap: 12px; text-align: center; justify-items: center; padding: 26px; }
.result-card .ok-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.result-card .ok-icon svg { width: 34px; height: 34px; }
.result-card h2 { font-size: 22px; }

/* ── The editor (create / edit / sign) ───────────────────────────────── */
.ed { display: grid; grid-template-columns: 172px minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); flex: 1; min-height: 0; }
.ed-bar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; padding: 7px 10px; flex-wrap: wrap;
  background: var(--panel-solid); border-bottom: 1px solid var(--line-2); position: relative; z-index: 5;
}
.ed-bar .sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }
.ed-bar .grow { flex: 1; }
.doc-name { width: 190px; max-width: 30vw; padding: 7px 9px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text); font: 750 14px var(--font); text-overflow: ellipsis; }
.doc-name:hover { border-color: var(--line-2); }
.doc-name:focus { outline: none; border-color: var(--blue); background: var(--bg-2); }
.tbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--text); font: 650 13px var(--font); white-space: nowrap; text-decoration: none;
}
.tbtn:hover { background: var(--fill-2); text-decoration: none; }
.tbtn.on { background: color-mix(in srgb, var(--blue) 16%, transparent); border-color: color-mix(in srgb, var(--blue) 45%, transparent); color: var(--blue); }
.tbtn.accent { background: color-mix(in srgb, var(--blue) 12%, transparent); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.tbtn svg { width: 18px; height: 18px; flex: none; }
.tbtn > svg:last-child:not(:first-child) { width: 13px; height: 13px; margin-left: -3px; opacity: .7; }
.tbtn[disabled] { opacity: .35; pointer-events: none; }
.zoom-box { display: inline-flex; align-items: center; gap: 2px; }
.zoom-val { min-width: 54px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--fill); color: var(--text); font: 700 12.5px var(--font); cursor: pointer; font-variant-numeric: tabular-nums; }
.save-btn { margin-left: 6px; }
@media (max-width: 1240px) { .tbtn .lbl { display: none; } .tbtn > svg:last-child:not(:first-child) { display: none; } }

.ed-menu { position: fixed; z-index: 200; min-width: 200px; max-width: 320px; padding: 6px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 2px; }
.ed-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--text); font: 600 14px var(--font); text-align: left; cursor: pointer; }
.ed-menu button:hover, .ed-menu button:focus-visible { background: var(--fill-2); outline: none; }
.ed-menu svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.ed-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu-sig { height: 36px; max-width: 220px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 6px; }

/* Page thumbnails */
.ed-pages { overflow: auto; padding: 12px 10px; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ed-thumb { position: relative; border-radius: 12px; padding: 7px 7px 4px; border: 2px solid transparent; cursor: pointer; display: grid; justify-items: center; gap: 4px; }
.ed-thumb:hover { background: var(--fill); }
.ed-thumb.current { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.ed-thumb.dragging { opacity: .4; }
.ed-thumb.drop-before { box-shadow: 0 -3px 0 var(--blue); }
.ed-thumb.drop-after { box-shadow: 0 3px 0 var(--blue); }
.ed-thumb .n { font-size: 11.5px; font-weight: 750; color: var(--muted); font-variant-numeric: tabular-nums; }
.thumb-box { position: relative; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); border-radius: 2px; pointer-events: none; }
.thumb-box > canvas.thumb-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb-objs { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ed-thumb .mini { position: absolute; top: 3px; right: 3px; display: none; flex-direction: column; gap: 3px; }
.ed-thumb:hover .mini, .ed-thumb.current .mini { display: flex; }
.ed-thumb .mini button { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ed-thumb .mini button[disabled] { opacity: .35; }
.ed-thumb .mini svg { width: 13px; height: 13px; }
.thumb-add { display: grid; gap: 6px; width: 100%; padding-top: 4px; }
.thumb-add .btn { justify-content: center; gap: 6px; font-size: 12.5px; }

/* The pages */
.ed-stage { position: relative; overflow: auto; touch-action: pan-x pan-y; background: var(--stage); background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px); background-size: 18px 18px; outline: none; }
.ed-canvas { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 34px 32px 140px; min-width: min-content; }
.ed-page-wrap { position: relative; flex: none; }
.ed-page-label { position: absolute; top: -22px; left: 0; font-size: 11.5px; color: var(--muted); font-weight: 750; }
.ed-page { position: relative; box-shadow: 0 10px 34px rgba(0, 0, 0, .35); overflow: hidden; touch-action: pan-x pan-y; background: #fff; }
.ed-page.drop-target { outline: 3px dashed var(--blue); outline-offset: 4px; }
.ed-page .objs { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ed-page .objs > canvas.bg { position: absolute; left: 0; top: 0; pointer-events: none; }
.ed-page .ui { position: absolute; inset: 0; pointer-events: none; z-index: 10000; }
.ed-stage[data-tool="text"] .ed-page { cursor: text; }
.ed-stage[data-tool="rect"] .ed-page, .ed-stage[data-tool="ellipse"] .ed-page, .ed-stage[data-tool="line"] .ed-page, .ed-stage[data-tool="arrow"] .ed-page,
.ed-stage[data-tool="whiteout"] .ed-page, .ed-stage[data-tool="highlight"] .ed-page, .ed-stage[data-tool="pen"] .ed-page, .ed-stage[data-tool="marker"] .ed-page { cursor: crosshair; touch-action: none; }
.ed-stage[data-tool]:not([data-tool="select"]) .obj { pointer-events: none; }
body.ed-dragging { user-select: none; -webkit-user-select: none; }

.obj { position: absolute; transform-origin: 50% 50%; cursor: move; touch-action: none; }
.obj.locked { cursor: default; }
.ed-stage:not([data-tool]) .obj:not(.locked):not(.editing):hover,
.ed-stage[data-tool="select"] .obj:not(.locked):not(.editing):hover { outline: calc(1.5px / var(--z, 1)) solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 0; }
.obj img.content { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.obj .frame { position: absolute; inset: 0; box-sizing: border-box; pointer-events: none; }
.obj .tx {
  position: absolute; left: 0; top: 0; right: 0; box-sizing: border-box; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal;
  font-kerning: none; font-variant-ligatures: none; font-synthesis: none; font-weight: 400; font-style: normal;
  outline: none; user-select: none; -webkit-user-select: none; cursor: inherit; caret-color: #1d4ed8;
}
.obj.editing { cursor: text; }
.obj.editing .tx { user-select: text; -webkit-user-select: text; cursor: text; }
.obj svg.content { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.obj svg .hit { fill: none; stroke: transparent; pointer-events: none; }
.obj.line, .obj.path { pointer-events: none; }
.ed-stage:not([data-tool]) .obj svg .hit, .ed-stage[data-tool="select"] .obj svg .hit { pointer-events: stroke; cursor: move; }

/* Selection and guides (drawn over the page, not scaled) */
.sel-frame { position: absolute; border: 1.5px solid var(--blue); pointer-events: none; box-sizing: border-box; }
.sel-frame.group { border-style: dashed; }
.sel-frame.line { border: 0; }
.sel-frame.locked { border-style: dashed; border-color: var(--muted); }
.sel-frame.editing { border-style: dashed; }
.sel-frame .h { position: absolute; width: 12px; height: 12px; background: #fff; border: 1.5px solid var(--blue); border-radius: 4px; pointer-events: auto; touch-action: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sel-frame .h::after { content: ""; position: absolute; inset: -9px; }
.sel-frame .h.nw { left: -7px; top: -7px; cursor: nwse-resize; } .sel-frame .h.n { left: calc(50% - 6px); top: -7px; cursor: ns-resize; }
.sel-frame .h.ne { right: -7px; top: -7px; cursor: nesw-resize; } .sel-frame .h.e { right: -7px; top: calc(50% - 6px); cursor: ew-resize; }
.sel-frame .h.se { right: -7px; bottom: -7px; cursor: nwse-resize; } .sel-frame .h.s { left: calc(50% - 6px); bottom: -7px; cursor: ns-resize; }
.sel-frame .h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; } .sel-frame .h.w { left: -7px; top: calc(50% - 6px); cursor: ew-resize; }
.sel-frame .h.rot { left: calc(50% - 7px); top: -36px; width: 14px; height: 14px; border-radius: 50%; cursor: grab; }
.sel-frame .h.pt { width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); cursor: crosshair; }
.sel-frame .rot-stem { position: absolute; left: 50%; top: -23px; width: 1.5px; height: 16px; background: var(--blue); }
.snap { position: absolute; background: #ff3ea5; pointer-events: none; }
.snap.v { width: 1px; top: 0; bottom: 0; }
.snap.h { height: 1px; left: 0; right: 0; }
.margin-guide { position: absolute; border: 1px dashed color-mix(in srgb, var(--blue) 45%, transparent); pointer-events: none; }
.marquee { position: absolute; border: 1px solid var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); pointer-events: none; }
svg.live-draw { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.text-spot { position: absolute; pointer-events: auto; cursor: text; border-radius: 3px; border: 1px dashed color-mix(in srgb, var(--blue) 50%, transparent); background: color-mix(in srgb, var(--blue) 6%, transparent); }
.text-spot:hover { background: color-mix(in srgb, var(--blue) 18%, transparent); border-style: solid; }

/* Photo order: a numbered chip with small up/down buttons at the bottom of each photo */
.order { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: 999px; background: rgba(10, 12, 16, .8); color: #fff; pointer-events: auto; touch-action: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); user-select: none; }
.order b { min-width: 20px; text-align: center; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.order button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.order button:hover { background: rgba(255, 255, 255, .32); }
.order button[disabled] { opacity: .3; pointer-events: none; }
.order svg { width: 13px; height: 13px; }

/* The properties panel */
.ed-props { overflow: auto; border-left: 1px solid var(--line); background: var(--panel-solid); padding: 14px; display: grid; align-content: start; gap: 18px; }
.ed-props section { display: grid; gap: 10px; }
.ed-props h3 { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.props-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.props-head h2 { font-size: 17px; margin: 0; }
.ed-props .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-props label.mini { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.range-field { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.range-field .lbl { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.range-field .val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-field input { grid-column: 1 / -1; }
.size-row { display: flex; align-items: center; gap: 4px; }
.size-row .input { width: 62px; text-align: center; }
.size-row button, .icon-row button { height: 34px; min-width: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--fill); color: var(--text); cursor: pointer; display: inline-grid; place-items: center; }
.icon-row { display: flex; gap: 5px; flex-wrap: wrap; }
.icon-row button.on { background: color-mix(in srgb, var(--blue) 16%, transparent); border-color: color-mix(in srgb, var(--blue) 50%, transparent); color: var(--blue); }
.icon-row svg, .size-row svg { width: 17px; height: 17px; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.order-row b { font-size: 13px; font-variant-numeric: tabular-nums; }
.align-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.align-pad button { height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--fill); color: var(--text); cursor: pointer; display: grid; place-items: center; padding: 0; }
.align-pad button:hover { background: color-mix(in srgb, var(--blue) 14%, transparent); border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.align-pad svg { width: 18px; height: 18px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line-2); cursor: pointer; padding: 0; }
.swatches button.on { outline: 2px solid var(--blue); outline-offset: 1px; }
.swatches button.none { background: #fff linear-gradient(135deg, transparent 45%, #ef4444 45%, #ef4444 55%, transparent 55%); }
.swatches input.swatch { width: 30px; height: 26px; }
.layout-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.layout-presets.compact { grid-template-columns: repeat(7, 1fr); }
.layout-presets button { border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--fill); cursor: pointer; padding: 6px 4px 4px; display: grid; gap: 4px; justify-items: center; color: var(--muted); }
.layout-presets button:hover, .layout-presets button.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); }
.layout-presets .cells { position: relative; width: 100%; max-width: 34px; aspect-ratio: .74; border-radius: 3px; background: var(--bg-2); border: 1px solid var(--line-2); }
.layout-presets .cells i { position: absolute; box-sizing: border-box; border: 1.5px solid var(--bg-2); background: currentColor; opacity: .55; border-radius: 2px; }
.layout-presets .free-ico { display: grid; place-items: center; width: 100%; max-width: 34px; aspect-ratio: .74; }
.layout-presets small { font-size: 9.5px; font-weight: 750; line-height: 1.1; text-align: center; }

.ed-dock { display: none; }
@media (max-width: 980px) {
  body.pdf-app.editing .topbar { display: none; }
  .ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "bar" "stage" "pages" "props" "dock"; }
  .ed-bar { grid-area: bar; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; gap: 2px; padding: 6px 8px; }
  .ed-bar::-webkit-scrollbar { display: none; }
  .ed-bar .doc-name, .ed-bar .sep, .ed-bar .zoom-box { display: none; }
  .ed-bar .grow { flex: 1 0 8px; }
  .tbtn { flex: none; height: 40px; padding: 0 10px; }
  .tbtn .lbl { display: none; }
  .tbtn > svg:last-child:not(:first-child) { display: none; }
  .save-btn { position: sticky; right: 0; flex: none; margin-left: 4px; padding: 9px 14px; box-shadow: -10px 0 14px var(--panel-solid), var(--shadow-sm); }
  .ed-stage { grid-area: stage; }
  .ed-canvas { padding: 22px 14px 60px; gap: 26px; }
  .ed-pages { grid-area: pages; display: none; flex-direction: row; align-items: flex-start; border-right: 0; border-top: 1px solid var(--line); padding: 8px 10px; max-height: 150px; }
  .ed.show-pages .ed-pages { display: flex; }
  .ed-pages .ed-thumb { flex: none; zoom: 0.62; }
  .ed-pages .ed-thumb .mini { display: flex; }
  .thumb-add { width: auto; min-width: 150px; flex: none; }
  .ed-props { grid-area: props; display: none; border-left: 0; border-top: 1px solid var(--line); max-height: min(46vh, 440px); padding: 12px 14px 16px; }
  .ed.show-props .ed-props { display: grid; }
  .ed-dock { grid-area: dock; display: flex; gap: 6px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--panel-solid); border-top: 1px solid var(--line-2); }
  .ed-dock button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--text-2); font: 650 13.5px var(--font); cursor: pointer; }
  .ed-dock button.on { background: color-mix(in srgb, var(--blue) 12%, transparent); border-color: color-mix(in srgb, var(--blue) 35%, transparent); color: var(--blue); }
  .ed-dock svg { width: 18px; height: 18px; }
  .ed-dock .count { font-size: 11px; font-weight: 750; padding: 1px 6px; border-radius: 999px; background: var(--fill-2); }
  .ed-menu { max-height: 60vh; overflow: auto; }
}

/* Start screens */
.create-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .create-grid { grid-template-columns: 1fr; } }
.size-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.size-cards button { display: grid; justify-items: center; gap: 3px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--fill); color: var(--text); cursor: pointer; }
.size-cards button:hover, .size-cards button.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.size-cards .paper { display: block; background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); margin-bottom: 4px; }
.size-cards b { font-size: 13px; }
.size-cards small { font-size: 10.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.feature-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.feature-list li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.feature-list svg { color: var(--green); flex: none; }
.note.center, p.center { text-align: center; }
.name-row { display: flex; align-items: center; gap: 6px; }

/* Signature maker */
.sig-modal { width: min(640px, 100%); }
.sig-pad { width: 100%; height: 200px; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); touch-action: none; cursor: crosshair; display: block; }
.sig-typed { display: grid; gap: 8px; }
.sig-typed button { text-align: left; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: #111; font-size: 34px; line-height: 1.3; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-typed button.on { outline: 2.5px solid var(--blue); outline-offset: 1px; }
.sig-upload-preview { min-height: 120px; border-radius: 12px; border: 1px dashed var(--line-2); display: grid; place-items: center; padding: 12px; background: #fff repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.sig-upload-preview .note { color: #475569; text-align: center; }
.sig-upload-preview img { max-width: 100%; max-height: 170px; }

/* Photo editor */
.pe { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.pe-stage { position: relative; min-height: 420px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; padding: 16px; }
.pe-stage canvas { max-width: 100%; max-height: 70vh; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, .45); pointer-events: none; }
.crop-box::before { left: 33.3%; right: 33.3%; top: 0; bottom: 0; border-top: 0; border-bottom: 0; }
.crop-box::after { top: 33.3%; bottom: 33.3%; left: 0; right: 0; border-left: 0; border-right: 0; }
.crop-box .h { position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 4px; }
.crop-box .h.nw { left: -8px; top: -8px; cursor: nwse-resize; } .crop-box .h.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-box .h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .crop-box .h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.filter-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.filter-strip button { padding: 4px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--fill); cursor: pointer; display: grid; gap: 3px; color: var(--muted); font: 700 10.5px var(--font); }
.filter-strip button.on { border-color: var(--blue); color: var(--blue); }
.filter-strip canvas { width: 100%; border-radius: 6px; }
@media (max-width: 900px) { .pe { grid-template-columns: 1fr; } }

/* Page numbers, watermark, header & footer */
.stamp-preview { display: grid; place-items: center; min-height: 320px; padding: 16px; border-radius: 14px; background: var(--bg-2); }
.stamp-preview canvas { max-width: 100%; height: auto !important; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); background: #fff; }
.hf-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.align-pad button.on { background: color-mix(in srgb, var(--blue) 16%, transparent); border-color: color-mix(in srgb, var(--blue) 50%, transparent); color: var(--blue); }

/* Fill PDF form */
.form-pages { display: grid; gap: 18px; justify-items: center; }
.form-page { position: relative; width: 100%; max-width: 820px; container-type: inline-size; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.form-canvas canvas { display: block; width: 100% !important; height: auto !important; }
.form-layer { position: absolute; inset: 0; }
.ff { position: absolute; box-sizing: border-box; margin: 0; padding: 0 0.4cqw; font: 400 calc(var(--fs, 0.016) * 100cqw) var(--font); color: #111; background: color-mix(in srgb, var(--blue) 9%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 45%, transparent); border-radius: 2px; }
.ff:hover { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.ff:focus { outline: 2px solid var(--blue); outline-offset: 0; background: rgba(255, 255, 255, .95); }
.ff:disabled { background: transparent; border-color: transparent; }
textarea.ff { resize: none; padding-top: 0.2cqw; line-height: 1.25; }
select.ff { padding: 0 0.2cqw; }
.ff-check { appearance: auto; accent-color: #1d4ed8; background: transparent; border: 0; cursor: pointer; }

/* Photo editor additions */
.pe-stage { user-select: none; }
.pe-canvas { display: block; max-width: 100%; }
.pe-panel { align-content: start; max-height: calc(100vh - 140px); overflow: auto; position: sticky; top: 76px; }
.pe-panel section { display: grid; gap: 10px; }
.pe-panel h3 { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ratio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ratio-grid button { padding: 8px 4px; border-radius: 9px; border: 1.5px solid var(--line-2); background: var(--fill); color: var(--text); font: 700 12.5px var(--font); cursor: pointer; }
.ratio-grid button.on { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.filter-strip canvas { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.crop-box .h { cursor: pointer; }
@media (max-width: 900px) { .pe-panel { position: static; max-height: none; } }

/* Compare slider for compressors */
.compare { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.compare img { display: block; width: 100%; }
.compare .after { position: absolute; inset: 0; overflow: hidden; }
.compare .after img { width: auto; height: 100%; max-width: none; }

/* Ads */
.ad-slot { margin: 18px auto; min-height: 90px; max-width: 970px; display: grid; place-items: center; border-radius: 12px; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot ins { display: block; width: 100%; }

/* Footer: one quiet line */
.pdf-footer { border-top: 1px solid var(--line); padding: 18px 16px 26px; }
.pdf-footer .made-with { margin: 0; font-size: 12px; font-weight: 400; letter-spacing: .01em; color: var(--muted); opacity: .8; }
.pdf-footer .made-with a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.pdf-footer .made-with a:hover { color: var(--text); text-decoration-color: currentColor; }
.pdf-footer .heart { color: var(--text-2); margin: 0 1px; }
.pdf-footer .sep { margin: 0 8px; }

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(255, 69, 58, .6); }
.kbd { font: 600 11.5px var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--fill); }

/* The privacy page */
.legal { max-width: 760px; padding-top: 34px; }
.legal h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 850; margin-bottom: 6px; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.65; font-size: 15.5px; }
.legal ul, .legal ol { padding-left: 20px; display: grid; gap: 6px; }

/* The hub's group tabs: one group of tools at a time (swipe on phones). */
.tool-groups { text-align: left; display: block; margin-top: 4px; }
.group-tabs-wrap { display: flex; justify-content: center; margin: 0 0 22px; }
.group-tabs { position: relative; display: flex; gap: 2px; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; padding: 5px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tab { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 650 14px var(--font); cursor: pointer; scroll-snap-align: center; white-space: nowrap; transition: color .2s; }
.group-tab svg { width: 17px; height: 17px; flex: none; }
.group-tab:hover, .group-tab.on { color: var(--text); }
.group-tab.on svg { color: var(--blue); }
.group-tab small { font-size: 11px; font-weight: 750; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--fill-2); color: var(--muted); text-align: center; }
.group-tab.on small { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
.tab-ink { position: absolute; z-index: 0; left: 0; top: 5px; bottom: 5px; width: 0; border-radius: 10px; background: var(--panel-solid); box-shadow: var(--shadow-sm); border: 1px solid var(--line); transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s cubic-bezier(.2, .8, .2, 1); }
.pdf-hub.searching .tab-ink { opacity: 0; }
.pdf-hub.searching .group-tab.on { color: var(--muted); }
.tool-group { animation: group-in .25s ease-out; }
.tool-group + .tool-group { margin-top: 26px; }
.group-head { margin: 0 0 12px 2px; }
.group-head h2 { font-size: 13px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.group-head p { margin: 0; color: var(--muted); font-size: 14px; }
.tool-groups.one-group .group-head h2 { display: none; }
.pdf-hub.searching .group-head p { display: none; }
@keyframes group-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tool-group { animation: none; } .tab-ink { transition: none; } }

/* ── Fingers: bigger handles and buttons on touch screens ───────────────── */
@media (pointer: coarse) {
  .sel-frame .h { width: 18px; height: 18px; border-radius: 6px; }
  .sel-frame .h.nw { left: -10px; top: -10px; } .sel-frame .h.n { left: calc(50% - 9px); top: -10px; }
  .sel-frame .h.ne { right: -10px; top: -10px; } .sel-frame .h.e { right: -10px; top: calc(50% - 9px); }
  .sel-frame .h.se { right: -10px; bottom: -10px; } .sel-frame .h.s { left: calc(50% - 9px); bottom: -10px; }
  .sel-frame .h.sw { left: -10px; bottom: -10px; } .sel-frame .h.w { left: -10px; top: calc(50% - 9px); }
  .sel-frame .h.rot { left: calc(50% - 10px); top: -46px; width: 20px; height: 20px; }
  .sel-frame .h.pt { width: 22px; height: 22px; }
  .sel-frame .rot-stem { top: -27px; height: 18px; }
  .order { padding: 3px; gap: 2px; }
  .order button { width: 28px; height: 28px; }
  .order b { min-width: 22px; font-size: 13px; }
  .page-card .page-tools button { width: 34px; height: 34px; }
  .ed-thumb .mini button { width: 30px; height: 30px; }
}

/* ── Phones ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pdf-hub { padding: 26px 0 6px; }
  .pdf-hub .lede { font-size: 15.5px; margin: 12px auto 22px; }
  .hub-search { margin-bottom: 18px; }
  .hub-search input { padding: 12px 14px 12px 42px; font-size: 15px; background-position: 14px center; }
  .group-tabs-wrap { margin-bottom: 16px; }
  .group-tab { padding: 8px 12px; font-size: 13.5px; }
  .tool-card { padding: 14px; }
  .hub-promises { margin-top: 30px; }
  .pdf-tool { padding-top: 16px; }
  .back-link { margin-bottom: 10px; }
  .tool-head { gap: 12px; margin-bottom: 16px; }
  .tool-head .tool-icon { width: 42px; height: 42px; border-radius: 12px; }
  .tool-head .tool-icon svg { width: 22px; height: 22px; }
  .tool-head h1 { font-size: 24px; }
  .tool-head p { font-size: 13.5px; }
  .drop { padding: 30px 16px; border-radius: 16px; }
  .drop strong { font-size: 17px; }
  .panel { padding: 14px; border-radius: 16px; }
  .pages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-card { padding: 8px; border-radius: 12px; }
  .create-grid { gap: 12px; }
  .size-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .size-cards button { padding: 8px 4px; }
  .layout-presets.compact { grid-template-columns: repeat(4, 1fr); }
  .result-card { padding: 20px 14px; }
  .pe-stage { min-height: 260px; padding: 10px; border-radius: 14px; }
  .modal { padding: 16px; border-radius: 18px; }
  .kpi div { min-width: 0; }
}

/* Phones and small tablets: the main button stays in reach at the bottom. */
@media (max-width: 900px) {
  body.pdf-app:has(.tool-layout .side .btn-primary.big, .pe-panel .btn-primary.big) .pdf-main { padding-bottom: 100px; }
  .tool-layout .side .btn-primary.big, .pe-panel .btn-primary.big {
    position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 60;
    width: auto; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  }
  body.pdf-app:has(.tool-layout .side .btn-primary.big, .pe-panel .btn-primary.big) .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Tool pages: the heading, and the guide and questions under the tool ── */
.tool-intro { padding-top: 26px; }
.tool-intro + .pdf-tool { padding-top: 0; }
.tool-head-spacer { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.hub-promises svg { flex: none; margin-top: 1px; color: var(--blue); }
body.editing .tool-intro, body.editing .seo-content { display: none; }

.seo-content { max-width: 880px; margin: 64px auto 0; color: var(--text-2); }
.seo-content > section + section { margin-top: 44px; }
.seo-content h2 { font-size: clamp(21px, 2.6vw, 26px); font-weight: 800; color: var(--text); margin: 0 0 16px; }
.pdf-hub + .seo-content h2 + .how-grid { margin-bottom: 48px; }
.seo-content p { font-size: 16px; line-height: 1.7; margin: 0 0 14px; }
.how-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 10px; }
.how-steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 58px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); line-height: 1.55; }
.how-steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--accent-ink); background: var(--accent); }
.points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 18px; }
.points li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; }
.points svg { flex: none; margin-top: 2px; color: var(--green); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 48px; }
.how-item { padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.how-item h3 { font-size: 16.5px; color: var(--text); margin: 0 0 8px; }
.how-item p { font-size: 14.5px; line-height: 1.65; margin: 0; }
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 2px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.4; }
.faq-item summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-item p { margin: 0 2px 16px; font-size: 15px; }
.related { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.all-tools { margin-top: 16px; font-weight: 650; }
.footer-tools { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.9; }
.footer-tools a { color: var(--muted); }
.footer-tools a:hover { color: var(--text); }
@media (max-width: 640px) {
  .tool-intro { padding-top: 14px; }
  .seo-content { margin-top: 44px; }
  .seo-content p { font-size: 15px; }
  .how-steps li { padding: 12px 14px 12px 52px; }
  .how-steps li::before { left: 12px; top: 11px; width: 28px; height: 28px; }
}

/* ── The Excel editor ─────────────────────────────────────────────────── */
.xs { position: relative; flex: 1; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--panel-solid); }
.xs-bar { display: flex; align-items: center; gap: 2px; padding: 6px 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; background: var(--panel-solid); border-bottom: 1px solid var(--line-2); }
.xs-bar .sep { flex: none; width: 1px; height: 24px; background: var(--line-2); margin: 0 5px; }
.xs-bar .grow { flex: 1 0 8px; }
.xs-bar .tbtn { flex: none; position: relative; height: 34px; padding: 0 8px; }
.xs-bar .tbtn .dot { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 3px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-2); }
.xs-bar .doc-name { flex: none; width: 170px; }
.xs-select { flex: none; height: 34px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--fill); color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.xs-font { width: 118px; } .xs-size { width: 58px; } .xs-fmt { width: 150px; } .xs-zoom { width: 72px; }
.xs-bar .save-btn { flex: none; margin-left: 6px; position: sticky; right: 0; box-shadow: -12px 0 12px var(--panel-solid); }
.xs-fbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel-solid); border-bottom: 1px solid var(--line-2); }
.xs-name { flex: none; width: 104px; height: 32px; text-align: center; font: 650 13px var(--mono); border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); color: var(--text); }
.xs-name:focus, .xs-formula:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.xs-fbar .fx { flex: none; font: italic 700 15px Georgia, serif; color: var(--muted); padding: 0 2px; }
.xs-formula { flex: 1; min-width: 0; height: 32px; max-height: 120px; resize: none; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); color: var(--text); font: 14px/1.35 var(--font); overflow: hidden; white-space: pre; }
.xs-formula.editing { border-color: var(--blue); }
.xs-view { position: relative; min-height: 0; }
.xs-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--panel-solid); border-top: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.xs-tabs::-webkit-scrollbar { display: none; }
.xs-tabs button { flex: none; padding: 7px 14px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); font: 650 13px var(--font); white-space: nowrap; cursor: pointer; }
.xs-tabs button:hover { background: var(--fill-2); color: var(--text); }
.xs-tabs button.on { background: var(--fill); border-color: var(--line-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--blue); }
.xs-tabs .add { display: inline-grid; place-items: center; width: 34px; padding: 7px 0; border: 1px solid var(--line-2); }
.xs-find { position: absolute; right: 16px; top: 96px; z-index: 30; width: min(380px, calc(100% - 32px)); display: grid; gap: 8px; padding: 12px; }
.xs-find .row { flex-wrap: nowrap; }
.xs-find .input { flex: 1; min-width: 0; padding: 8px 10px; }
.xs-colors .swatches { display: grid; grid-template-columns: repeat(8, 24px); gap: 6px; padding: 4px; }
.xs-colors .btn { margin: 6px 4px 2px; }
.csv-preview { max-height: 440px; overflow: auto; margin: 0; padding: 12px; font: 12.5px/1.55 var(--mono); background: var(--bg-2); border-radius: 10px; color: var(--text-2); white-space: pre; }

/* The grid itself: white like paper in both looks, as in Excel. */
.xl-view { position: relative; overflow: hidden; background: #fff; color: #000; user-select: none; -webkit-user-select: none; }
.xs-view.xl-view { min-height: 0; }
.h-row .xl-inner { width: 100%; }
.h-col .xl-inner { height: 100%; }
.xl-pane, .xl-head, .xl-corner { position: absolute; overflow: hidden; }
.xl-pane { background: #fff; }
.xl-pane.p-top { box-shadow: inset 0 -1px 0 #9aa6b4; }
.xl-pane.p-left, .xl-pane.p-corner { box-shadow: inset -1px 0 0 #9aa6b4; }
.xl-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.xl-inner { position: absolute; left: 0; top: 0; }
.xl-scroll { position: absolute; inset: 0; z-index: 5; overflow: auto; outline: none; }
.xl-spacer { pointer-events: none; }
.xc { position: absolute; box-sizing: border-box; }
.xt { position: absolute; left: 0; top: 0; height: 100%; box-sizing: border-box; display: flex; padding: 1px 3px; overflow: hidden; line-height: 1.2; }
.xl-head { background: #f2f4f7; z-index: 2; }
.hc, .hr { position: absolute; box-sizing: border-box; display: grid; place-items: center; font: 500 12px/1 "Segoe UI", Roboto, Arial, sans-serif; color: #5b6675; }
.hc { top: 0; height: 100%; border-right: 1px solid #dde2e8; border-bottom: 1px solid #cfd6df; }
.hr { left: 0; width: 100%; border-bottom: 1px solid #dde2e8; border-right: 1px solid #cfd6df; }
.hc.on, .hr.on { background: #dfe7f4; color: #1d4ed8; font-weight: 700; }
.hc.all, .hr.all { background: #2563eb; color: #fff; font-weight: 700; }
.xl-corner { z-index: 3; background: #eaedf1; border-right: 1px solid #cfd6df; border-bottom: 1px solid #cfd6df; }
.xl-sel { position: absolute; z-index: 5; box-sizing: border-box; border: 1px solid #2563eb; background: rgba(37, 99, 235, 0.09); pointer-events: none; }
.xl-sel.single { background: transparent; border: 0; }
.xl-act { position: absolute; z-index: 6; box-sizing: border-box; border: 2px solid #2563eb; pointer-events: none; }
.xl-editor { position: absolute; z-index: 8; display: none; box-sizing: border-box; margin: 0; padding: 1px 4px; border: 2px solid #2563eb; background: #fff; color: #000; resize: none; overflow: hidden; outline: none; white-space: pre; line-height: 1.2; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18); }

@media (max-width: 980px) {
  .xs-bar { scrollbar-width: none; }
  .xs-bar::-webkit-scrollbar { display: none; }
  .xs-bar .doc-name, .xs-bar .sep { display: none; }
  .xs-bar .save-btn { position: sticky; right: 0; box-shadow: -10px 0 14px var(--panel-solid), var(--shadow-sm); }
  .xs-fmt { width: 120px; }
  .xs-name { width: 74px; }
  .xs-find { top: 92px; right: 8px; }
}
.fine-print { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }

/* ── Ad blocker request (only while ads are live) ─────────────────────── */
html.ab-open body { overflow: hidden; }
.ab-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(10, 18, 34, 0.45); backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); overflow-y: auto; }
.ab-card { width: min(480px, 100%); padding: 24px 22px 16px; border-radius: 22px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(2, 6, 23, 0.35); display: grid; gap: 14px; text-align: center; animation: ab-in .25s ease-out; }
.ab-icon { justify-self: center; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #e11d48; background: color-mix(in srgb, #e11d48 12%, transparent); }
.ab-card h2 { font-size: 21px; margin: 0; }
.ab-lead { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.ab-block { text-align: left; display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--fill); border: 1px solid var(--line); }
.ab-block h3 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ab-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); font-size: 14.5px; line-height: 1.5; }
.ab-others summary { cursor: pointer; font-size: 13.5px; color: var(--blue); font-weight: 650; }
.ab-others ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.ab-browsers { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-browsers .btn { gap: 6px; }
.ab-browsers svg { transform: rotate(180deg); }
.ab-continue { justify-self: center; border: 0; background: none; color: var(--muted); font: 600 13px var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; }
.ab-continue:hover { color: var(--text); }
@keyframes ab-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ab-card { animation: none; } }
