/* Fylunor — editor shell and per-editor surfaces */

#screen-editor.is-active {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr);   /* wide content scrolls inside, not out */
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* ---------- top bar ---------- */
.etop {
  display: flex; align-items: center; gap: var(--s3);
  padding: max(var(--s3), env(safe-area-inset-top)) var(--s4) var(--s3);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.etop-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.etop-title input {
  width: 100%; min-height: var(--tap-min); border: 0; background: none; outline: none;
  font-size: var(--fs-h3); font-weight: 640; letter-spacing: -.01em;
  padding: 2px 0; border-bottom: 1px solid transparent;
}
.etop-title input:focus { border-bottom-color: var(--accent); }
.etop-sub { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-3); }
.etop-sub #editor-state[data-tone="ok"] { color: var(--accent); }
.etop-sub #editor-state[data-tone="warn"] { color: var(--text-2); }
.etop-sub #editor-state[data-tone="danger"] { color: var(--danger); }
.etop-actions { display: flex; align-items: center; gap: var(--s2); }

/* ---------- tool row ---------- */
.etools {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s4);
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.etools::-webkit-scrollbar { display: none; }
.etools:empty { display: none; }
.etool-group { display: flex; align-items: center; gap: 3px; flex: none; }
.etool-group + .etool-group { padding-left: var(--s3); border-left: 1px solid var(--line); }

/* The toolbar scrolls horizontally, so these take a real --tap-min height
   rather than an overflowing pseudo hit area (§34). */
.etool {
  min-width: var(--tap-min); height: var(--tap-min); padding: 0 12px; border-radius: 11px;
  display: inline-grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 620; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.etool:hover { background: var(--surface-2); color: var(--text); }
.etool.on { background: var(--brand-grad); color: var(--on-accent); }
.etool svg { width: 18px; height: 18px; }

.etool-select {
  height: var(--tap-min); padding: 0 10px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-size: var(--fs-sm);
}
.etool-field { display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
/* A bare range input is ~16px tall. Give it the full target height and paint
   the visible track inside it, so the thumb stays easy to grab. */
.etool-field input[type="range"] {
  width: 92px; height: var(--tap-min); accent-color: var(--accent);
  background: none; appearance: none; -webkit-appearance: none;
}
.etool-field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--r-pill); background: var(--surface-2);
}
.etool-field input[type="range"]::-moz-range-track {
  height: 4px; border-radius: var(--r-pill); background: var(--surface-2);
}
.etool-field input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; margin-top: -7px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
}
.etool-field input[type="range"]::-moz-range-thumb {
  border: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
}
.etool-field output { min-width: 34px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.etool-note { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }

/* ---------- body ---------- */
.ebody { overflow: auto; position: relative; min-width: 0; min-height: 0; }

/* ---------- document ---------- */
.doc-page { padding: var(--s6) var(--s4) var(--s8); display: grid; justify-items: center; }
.doc-surface {
  width: min(100%, 720px); min-height: 60dvh; outline: none;
  padding: var(--s7) clamp(var(--s5), 5vw, 56px);
  background: var(--surface-solid); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: 16px; line-height: 1.7; color: var(--text);
}
:root[data-theme="dark"] .doc-surface { background: var(--bg-2); }
.doc-surface:focus { border-color: var(--accent-line); }
.doc-surface h1 { font-size: 30px; font-weight: 680; letter-spacing: -.02em; margin: .7em 0 .3em; }
.doc-surface h2 { font-size: 23px; font-weight: 660; margin: .8em 0 .3em; }
.doc-surface h3 { font-size: 19px; font-weight: 640; margin: .9em 0 .3em; }
.doc-surface p { margin: 0 0 .85em; }
.doc-surface ul, .doc-surface ol { margin: 0 0 .9em; padding-left: 1.4em; list-style: revert; }
.doc-surface li { margin-bottom: .3em; }
.doc-surface blockquote {
  margin: 0 0 .9em; padding: .5em 0 .5em 1em;
  border-left: 3px solid var(--accent); color: var(--text-2);
}
.doc-surface pre {
  background: var(--surface-2); padding: var(--s4); border-radius: var(--r-sm);
  overflow-x: auto; font-family: var(--font-mono); font-size: 14px;
}
.doc-surface a { color: var(--accent); }
.doc-status {
  position: sticky; bottom: 0; padding: var(--s2) var(--s5);
  font-size: var(--fs-xs); color: var(--text-3); text-align: right;
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-top: 1px solid var(--line);
}

/* ---------- spreadsheet ---------- */
.sheet-formula { flex: 1; min-width: 200px; gap: var(--s2); }
.sheet-ref {
  min-width: 46px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--fs-sm); font-weight: 660; font-variant-numeric: tabular-nums;
}
.sheet-input {
  flex: 1; min-width: 0; height: var(--tap-min); padding: 0 13px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  outline: none; font-size: var(--fs-sm);
}
.sheet-input:focus { border-color: var(--accent-line); }

/* Absolutely positioned against .ebody so the scrollport has a definite size —
   an auto-sized wrapper here fails to establish one and the wide grid becomes
   unreachable rather than scrollable. */
.sheet-wrap { position: absolute; inset: 0; overflow: auto; }
table.sheetgrid { border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
table.sheetgrid th, table.sheetgrid td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 0 8px; height: 30px; min-width: 92px; max-width: 92px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
table.sheetgrid thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-3); color: var(--text-3);
  font-size: var(--fs-xs); font-weight: 650; text-align: center;
}
table.sheetgrid th.rowhead, table.sheetgrid th.corner {
  position: sticky; left: 0; z-index: 1;
  background: var(--bg-3); color: var(--text-3);
  min-width: 46px; max-width: 46px; text-align: center;
  font-size: var(--fs-xs); font-weight: 600;
}
table.sheetgrid th.corner { z-index: 3; }
table.sheetgrid td { background: var(--bg); cursor: cell; }
table.sheetgrid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sheetgrid td.err { color: var(--danger); }
table.sheetgrid td.on {
  outline: 2px solid var(--accent); outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

/* ---------- image ---------- */
.img-stage {
  display: grid; place-items: center; padding: var(--s5);
  min-height: calc(100% - 40px);
  background-image:
    linear-gradient(45deg, var(--surface) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}
.img-stage canvas {
  max-width: 100%; max-height: 68dvh; border-radius: var(--r-sm);
  box-shadow: var(--shadow-2); background: #fff;
}
.img-meta { padding: var(--s2) var(--s5); font-size: var(--fs-xs); color: var(--text-3); text-align: center; }

/* ---------- scanner ---------- */
.scan-stage { position: relative; background: #000; height: 100%; display: grid; place-items: center; overflow: hidden; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }
.scan-guide {
  position: absolute; inset: 9% 7%; border: 2px dashed rgba(255, 255, 255, .55);
  border-radius: var(--r-md); pointer-events: none;
}
.scan-fallback { position: absolute; display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s5); }
.scan-fallback .glyph { width: 54px; height: 54px; border-radius: 17px; }

.scan-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s4) max(var(--s5), env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
}
.scan-pages { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.scan-pages::-webkit-scrollbar { display: none; }
.scan-thumb { position: relative; flex: none; width: 40px; height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .3); }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scan-thumb span {
  position: absolute; right: 2px; bottom: 2px; font-size: 9px; font-weight: 700;
  background: rgba(0, 0, 0, .7); color: #fff; border-radius: 4px; padding: 0 4px;
}
.scan-shutter {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .28);
  transition: transform var(--t-fast) var(--ease);
}
.scan-shutter:active { transform: scale(.9); }
.scan-count { font-size: var(--fs-xs); color: #fff; text-align: right; opacity: .85; }
.seg-tools .etool { min-width: 52px; }

/* ---------- presentation ----------
   A rail of slides beside the one being edited. Layout is chosen, never
   dragged: the deck stays readable without anyone arranging boxes. */
.deck-stage { display: grid; grid-template-columns: 148px minmax(0, 1fr); height: 100%; min-height: 0; }
.deck-rail {
  overflow-y: auto; padding: var(--s3); display: grid; gap: var(--s2);
  align-content: start; border-right: 1px solid var(--line); background: var(--bg-2);
}
.deck-thumb {
  display: flex; gap: var(--s2); align-items: flex-start; text-align: left;
  padding: var(--s2) var(--s3); min-height: var(--tap-min);
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
}
.deck-thumb.on { border-color: var(--accent); background: var(--accent-soft); }
/* --text-2, not --text-3: at this size the quietest tone drops under AA. */
.deck-thumb .n { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); flex: none; padding-top: 1px; }
.deck-thumb-body { min-width: 0; display: grid; gap: 2px; }
.deck-thumb .t { font-size: var(--fs-xs); font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-thumb .d { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.deck-main { min-width: 0; overflow: auto; padding: var(--s6) var(--s5) var(--s8); display: grid; align-content: start; justify-items: center; }
.deck-slide {
  width: min(100%, 640px); aspect-ratio: 16 / 9; display: grid; gap: var(--s3);
  padding: var(--s6); border-radius: var(--r-md);
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
:root[data-theme="dark"] .deck-slide { background: var(--bg-2); }
.deck-slide[data-layout="title"], .deck-slide[data-layout="section"] { align-content: center; text-align: center; }
.deck-slide[data-layout="quote"] { align-content: center; }
.deck-title {
  border: 0; background: none; outline: none; width: 100%; min-height: var(--tap-min);
  color: var(--text);
  font-family: var(--font-brand); font-size: clamp(1.1rem, 3.4vw, 1.6rem); font-weight: 680; letter-spacing: -.02em;
}
.deck-slide[data-layout="title"] .deck-title,
.deck-slide[data-layout="section"] .deck-title { text-align: center; }
.deck-body {
  border: 0; background: none; outline: none; resize: none; width: 100%; flex: 1;
  min-height: 8em; color: var(--text-2); font: inherit; font-size: var(--fs-body); line-height: 1.6;
}
.deck-slide[data-layout="title"] .deck-body,
.deck-slide[data-layout="section"] .deck-body { text-align: center; min-height: 3em; }
.deck-slide[data-layout="quote"] .deck-body { font-size: var(--fs-h2); line-height: 1.45; color: var(--text); }
.deck-title::placeholder, .deck-body::placeholder { color: var(--text-3); }
.deck-hint { margin-top: var(--s3); font-size: var(--fs-xs); color: var(--text-3); text-align: center; }

@media (max-width: 640px) {
  .deck-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .deck-rail { grid-auto-flow: column; grid-auto-columns: 132px; overflow-x: auto; overflow-y: hidden;
               border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Present mode — its own layer, above everything including the navbar */
.present {
  position: fixed; inset: 0; z-index: 120; background: var(--bg);
  display: grid; grid-template-rows: minmax(0, 1fr) auto; outline: none;
}
.present-slide {
  display: grid; align-content: center; gap: var(--s5);
  padding: clamp(var(--s6), 6vw, 72px); overflow: auto;
}
.present-slide[data-layout="title"], .present-slide[data-layout="section"] { justify-items: center; text-align: center; }
.present-slide h2 { font-family: var(--font-brand); font-size: clamp(1.6rem, 5.5vw, 3rem); font-weight: 700; letter-spacing: -.025em; }
.present-slide p { font-size: clamp(1rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--text-2); }
.present-slide ul { display: grid; gap: var(--s4); padding-left: 1.2em; }
.present-slide li { font-size: clamp(1rem, 2.4vw, 1.5rem); line-height: 1.45; }
.present-slide[data-layout="quote"] p { font-size: clamp(1.2rem, 3.4vw, 2rem); color: var(--text); }
.present-bar {
  display: flex; align-items: center; justify-content: center; gap: var(--s4);
  padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-2);
}

/* ---------- form builder ---------- */
.form-page { padding: var(--s5) var(--s4) var(--s8); display: grid; justify-items: center; }
.form-page > div { width: min(100%, 640px); display: grid; gap: var(--s3); }
.q-card {
  padding: var(--s4); border-radius: var(--r-md); display: grid; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line);
}
.q-card.is-fill { gap: var(--s2); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.q-acts { display: flex; gap: 4px; }
.q-label, .q-input, .q-option input {
  width: 100%; min-height: var(--tap-min); padding: 0 var(--s3);
  border-radius: var(--r-sm); background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); outline: none; font: inherit; font-size: var(--fs-body);
}
.q-label { font-weight: 620; }
.q-label:focus, .q-input:focus, .q-option input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.q-area { min-height: 6em; padding: var(--s3); line-height: 1.55; resize: vertical; }
.q-options { display: grid; gap: var(--s2); padding-left: var(--s3); border-left: 2px solid var(--line); }
.q-option { display: flex; align-items: center; gap: var(--s2); }
.q-req {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap-min); padding: 0 var(--s3); border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 620; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--line);
}
.q-req.on { color: var(--on-accent); background: var(--brand-grad); border-color: transparent; }
.q-req svg { width: 14px; height: 14px; }
.q-ask { font-size: var(--fs-body); font-weight: 620; line-height: 1.45; }
.q-star { color: var(--danger); }
.q-choices { display: grid; gap: var(--s2); }
/* The whole label is the target — a radio is drawn small by the platform, but
   wrapping it makes the full row activate it, which is what gets tapped. */
.q-choice {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  min-height: var(--tap-min); font-size: var(--fs-body); cursor: pointer;
}
.q-choice input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.form-empty { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding: var(--s8) var(--s4); }
.form-empty .glyph { width: 52px; height: 52px; border-radius: 16px; }
.form-empty .glyph svg { width: 25px; height: 25px; }
.form-empty .t { font-size: var(--fs-h3); font-weight: 650; }
.form-empty .d { font-size: var(--fs-sm); color: var(--text-2); max-width: 40ch; line-height: 1.55; }

/* ---------- structured document editors (invoice, resume) ----------
   A long form on a page rather than a canvas: the layout is fixed and the PDF
   is generated from the data, so there is nothing to drag and nothing to
   misalign. */
.sheetdoc { padding: var(--s5) var(--s4) var(--s8); display: grid; justify-items: center; }
.sheetdoc > div { width: min(100%, 680px); display: grid; gap: var(--s4); }
.inv-block {
  padding: var(--s4); border-radius: var(--r-md); display: grid; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line);
}
.inv-block h3 { font-size: var(--fs-h3); font-weight: 650; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); }

.fld { display: grid; gap: 5px; min-width: 0; }
.fld > span { font-size: var(--fs-xs); font-weight: 620; color: var(--text-2); }
.fld input, .fld textarea {
  width: 100%; min-height: var(--tap-min); padding: 0 var(--s3);
  border-radius: var(--r-sm); background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); outline: none; font: inherit; font-size: var(--fs-body);
}
.fld textarea { padding: var(--s3); line-height: 1.55; resize: vertical; min-height: 4.5em; }
.fld input:focus, .fld textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Line items */
.inv-items { display: grid; gap: var(--s3); }
.inv-item {
  display: grid; gap: var(--s2);
  grid-template-columns: minmax(0, 1fr) 92px 110px;
  grid-template-areas: 'desc qty rate' 'total total total' 'acts acts acts';
  padding: var(--s3); border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line);
}
.inv-desc { grid-area: desc; }
.inv-item .inv-num:nth-of-type(2) { grid-area: qty; }
.inv-item .inv-num:nth-of-type(3) { grid-area: rate; }
.inv-line-total {
  grid-area: total; justify-self: end; align-self: center;
  font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums;
}
.inv-row-acts { grid-area: acts; display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 520px) {
  .inv-item { grid-template-columns: minmax(0, 1fr) 1fr; grid-template-areas: 'desc desc' 'qty rate' 'total total' 'acts acts'; }
}

/* Totals */
.inv-totals { display: grid; gap: 6px; justify-self: end; min-width: 220px; }
.inv-totals > div { display: flex; justify-content: space-between; gap: var(--s5); font-size: var(--fs-sm); color: var(--text-2); }
.inv-totals b { font-variant-numeric: tabular-nums; color: var(--text); }
.inv-grand { padding-top: 6px; border-top: 1px solid var(--line-strong); font-size: var(--fs-h3) !important; }
.inv-grand span, .inv-grand b { font-weight: 700; color: var(--text) !important; }

/* Resume entries */
.cv-entry {
  display: grid; gap: var(--s3); padding: var(--s3);
  border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line);
}
.cv-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: var(--s2); align-items: end; }
@media (max-width: 520px) { .cv-link { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- pdf ---------- */
.pdf-stage { position: relative; height: 100%; display: grid; }
.pdf-stage iframe { width: 100%; height: 100%; border: 0; background: var(--bg-3); }
.pdf-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: var(--s3); text-align: center; background: var(--bg); padding: var(--s5);
}
.pdf-empty .glyph { width: 56px; height: 56px; border-radius: 18px; }

/* ---------- signature placement ---------- */
#screen-sign.is-active {
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.sign-body { position: relative; display: grid; place-items: start center; padding: var(--s4); }
.sign-stage { position: relative; }
.sign-canvas {
  /* Fit the whole page on screen so the signature box is never below the fold */
  display: block; max-width: 100%; width: auto; height: auto;
  max-height: calc(100dvh - 190px);
  border-radius: var(--r-sm); box-shadow: var(--shadow-2);
  background: #fff;
}
.sign-box {
  position: absolute; cursor: grab; touch-action: none;
  border: 1.5px dashed var(--accent);
  border-radius: 4px; background: var(--accent-soft);
}
.sign-box:active { cursor: grabbing; }
.sign-box img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.sign-handle {
  position: absolute; right: -9px; bottom: -9px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-grad); border: 2px solid var(--bg);
  cursor: nwse-resize; touch-action: none;
}

/* ---------- signature capture ---------- */
.sig-pad-wrap { position: relative; }
.sig-pad {
  display: block; width: 100%; height: 190px; touch-action: none;
  border-radius: var(--r-md); background: #FFFFFF;
  border: 1px solid var(--line-strong); cursor: crosshair;
}
.sig-baseline {
  position: absolute; left: 8%; right: 8%; bottom: 52px; height: 1px;
  background: rgba(36, 29, 20, .18); pointer-events: none;
}
.sig-fonts { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.sig-fonts button {
  padding: 8px 16px; border-radius: var(--r-md); font-size: 22px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.sig-fonts button.on { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.sig-preview {
  margin-top: var(--s3); min-height: 90px; display: grid; place-items: center;
  border-radius: var(--r-md); background: #FFFFFF; border: 1px solid var(--line-strong);
  color: var(--text); padding: var(--s3); overflow: hidden;
}
.sig-preview img { max-width: 100%; max-height: 130px; object-fit: contain; }

.sig-saved { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.sig-card {
  height: 90px; border-radius: var(--r-md); padding: var(--s2);
  background: #FFFFFF; border: 1px solid var(--line-strong);
  display: grid; place-items: center;
}
.sig-card:hover { border-color: var(--accent); }
.sig-card img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- password strength ---------- */
.pw-meter { display: flex; gap: 5px; margin-top: 9px; }
.pw-meter i { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--surface-2); transition: background var(--t-fast); }
.pw-meter i[data-on="true"][data-tone="danger"] { background: var(--danger); }
.pw-meter i[data-on="true"][data-tone="warn"]   { background: var(--text-2); }
.pw-meter i[data-on="true"][data-tone="ok"]     { background: var(--accent); }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  .doc-surface { padding: 64px 72px; }
  table.sheetgrid th, table.sheetgrid td { min-width: 112px; max-width: 112px; height: 32px; }
}
