/* pdf tools — styles owned by the pdf work; keep area-specific rules here, shared tokens stay in style.css */

/* ── Fill & sign ─────────────────────────────────────── */
.fs [hidden] { display: none !important; }
.fs-tools { display: grid; gap: 6px; }
.fs-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fs-add { padding: 8px 14px; }
.fs-add .ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fs-add.on { background: var(--ink); color: var(--paper); }
.fs-datefmt { margin-left: auto; }
.fs-datefmt { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.tool .fs-datefmt select { width: auto; padding: 6px 10px; font-size: 14px; color: var(--ink); }
.fs-hint { min-height: 1.4em; }
.fs-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.fs-main:has(.fs-stage[hidden]) { display: none; }
.fs-stage { display: grid; gap: 10px; background: var(--soft); border-radius: 12px; padding: 14px; min-width: 0; }
.fs-nav { display: flex; gap: 10px; align-items: center; justify-content: center; }
.fs-nav .btn { padding: 7px 12px; }
.fs-pno { font-weight: 600; font-variant-numeric: tabular-nums; }
.fs-page { position: relative; width: 100%; max-width: 900px; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.fs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fs-layer { position: absolute; inset: 0; --s: 1; touch-action: manipulation; }
.fs-layer.placing { cursor: crosshair; }

/* form fields drawn on the page: a tinted box with what you typed */
.fs-w { position: absolute; border: 0; padding: 0 2px; margin: 0; background: rgba(36, 80, 200, .1); box-shadow: inset 0 -1px 0 rgba(36, 80, 200, .55);
  color: #0D1633; font: calc(var(--s) * 11px)/1 Helvetica, Arial, sans-serif; text-align: left; overflow: hidden; white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; }
.fs-w:hover { background: rgba(36, 80, 200, .2); }
.fs-w.checkbox, .fs-w.radio { justify-content: center; padding: 0; }
.fs-w.radio { border-radius: 50%; }
.fs-w .ic { width: 90%; height: 90%; fill: none; stroke: #0D1633; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fs-w.radio .ic { fill: #0D1633; stroke: none; width: 70%; height: 70%; }
.fs-w.flash { outline: 3px solid var(--yellow); }
.fs-w.signature { background: rgba(255, 198, 26, .18); }

/* things you placed */
.fs-item { position: absolute; touch-action: none; outline: 1px dashed transparent; outline-offset: 2px; }
.fs-item:hover, .fs-item:focus-within { outline-color: #9AA7AD; }
.fs-item.sel, .fs-item:focus-visible { outline: 2px solid var(--blue); }
.fs-item.image, .fs-item.check, .fs-item.cross { cursor: move; }
.fs-item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.fs-item > .ic { width: 100%; height: 100%; display: block; fill: none; stroke: #0D0D1A; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.fs-item.text { display: flex; align-items: flex-start; }
.tool .fs-item textarea { font: 1em/1.2 Helvetica, Arial, sans-serif; color: #0D0D1A; background: rgba(255, 198, 26, .12); border: 0; border-radius: 0; padding: 0;
  min-height: 0; min-width: 2ch; width: auto; resize: none; overflow: hidden; white-space: pre; field-sizing: content; font-weight: 400; }
.tool .fs-item textarea:focus { background: rgba(255, 198, 26, .25); }
.fs-grip { position: absolute; left: -14px; top: 0; bottom: 0; width: 12px; min-height: 14px; cursor: move; border-radius: 3px;
  background: radial-gradient(circle, #9AA7AD 1.2px, transparent 1.6px) 0 0 / 6px 6px; opacity: 0; }
.fs-item:hover .fs-grip, .fs-item.sel .fs-grip { opacity: 1; }
.fs-acts { position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; display: none; gap: 3px; white-space: nowrap; z-index: 2; }
.fs-item.sel .fs-acts { display: flex; }
.fs-acts button { border: 0; border-radius: 6px; height: 26px; min-width: 26px; padding: 0 6px; background: var(--ink); color: var(--paper); font: 600 12px var(--body); cursor: pointer; display: grid; place-items: center; }
.fs-acts .ic { width: 14px; height: 14px; }
.fs-rs { display: none; }
.fs-item.sel .fs-rs, .fs-item:hover .fs-rs { display: block; }

/* the form beside the page */
.fs-side { display: grid; gap: 12px; align-content: start; position: sticky; top: 0; max-height: calc(100vh - 220px); overflow: auto; padding: 2px 4px 2px 2px; }
.fs-h { margin: 4px 0 0; font: 700 17px var(--display); }
.fs-form { display: grid; gap: 12px; }
.fs-row { margin: 0; }
.fs-row:not(.fs-radio):has(> .check) { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fs-row label.f { font-weight: 600; }
.fs-lab { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; overflow-wrap: anywhere; }
.fs-radio { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fs-radio legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; width: 100%; display: flex; justify-content: space-between; }
.fs-where { border: 0; background: none; color: var(--muted); font: 500 12px var(--body); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.fs-where:hover { color: var(--ink); }
.tool .fs-form textarea { min-height: 80px; font: 14px/1.4 var(--body); }

/* signature */
.fs-sig { border: 2px solid var(--ink); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--panel); }
.fs-sig-head { display: flex; justify-content: space-between; align-items: center; }
.fs-sig .x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; }
.fs-sig .x .ic { width: 18px; height: 18px; }
.fs-sig .chips { display: flex; gap: 6px; }
.fs-sig .chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fs-sig-pad { display: grid; gap: 8px; }
.fs-padc { width: 100%; height: auto; aspect-ratio: 3 / 1; background: #fff; border: 2px dashed var(--line); border-radius: 10px; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(transparent calc(78% - 1px), #C9D1CF calc(78% - 1px), #C9D1CF 78%, transparent 78%); }
.fs-sig-type { display: grid; gap: 8px; }
.fs-fonts { display: grid; gap: 6px; }
.fs-font { border: 2px solid var(--line); background: #fff; color: #1B2A6B; border-radius: 10px; padding: 6px 12px; font-size: 30px; line-height: 1.3; text-align: left; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fs-font.on { border-color: var(--ink); }
.fs-sig-up { display: grid; gap: 8px; }
.fs-sig-up img { max-width: 100%; max-height: 110px; background: #fff; }
.fs-sig .note { font-size: 13px; }

/* spreadsheet */
.fs-batch { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 12px; }
.fs-batch[open] { gap: 12px; }
.fs-batch > * + * { margin-top: 10px; }
.fs-batch summary { font-weight: 700; cursor: pointer; }
.fs-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.fs-namecol { max-width: 320px; }
.fs-batch > .btn { justify-self: start; }
.fs-save { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0; border-top: 1px solid var(--line); z-index: 3; }
.fs-status { flex: 1 1 260px; }

@media (max-width: 860px) {
  .fs-main { grid-template-columns: 1fr; }
  .fs-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
  .fs-stage { padding: 8px; margin: 0 -4px; }
  .fs-add { padding: 8px 11px; }
  .fs-datefmt { margin-left: 0; }
  .fs-grip { left: -10px; width: 9px; }
  .fs-save { position: static; border-top: 0; padding: 0; }
  .tool .fs-save .check { font-size: 14px; }
}

/* ── Compress PDF ───────────────────────────────────── */
.cp [hidden] { display: none !important; }
.cp-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; align-items: start; }
.cp-opts .note { font-weight: 400; }
.cp-checks { display: grid; gap: 8px; }
.tool .cp-checks .check { align-items: flex-start; font-size: 14px; }
.cp-checks input { margin-top: 3px; flex: none; }
.cp-result { display: grid; gap: 12px; }
.cp-result:empty { display: none; }
.cp-sizes { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font-variant-numeric: tabular-nums; }
.cp-before { font: 600 22px var(--display); color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.cp-arrow { font: 600 22px var(--display); color: var(--muted); }
.cp-after { font: 700 34px/1.1 var(--display); letter-spacing: -.02em; }
.cp-bar { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; max-width: 520px; }
.cp-bar span { display: block; height: 100%; background: var(--local); border-radius: 99px; }
.cp-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.cp-warn { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  border: 1px solid color-mix(in srgb, #C99400 45%, var(--line)); background: color-mix(in srgb, var(--yellow) 14%, var(--panel)); }
.cp-miss { margin: 0; }
