/* EnokiPDF — one board for every page of every file. Plain CSS, light + dark. */
:root {
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #1d1f21;
  --muted: #5d6166;
  --line: #dcd8cf;
  --accent: #0f5f5c;
  --accent-ink: #ffffff;
  --accent-soft: #d8ebe9;
  --danger: #b42318;
  --sel: #1c64f2;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.06);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191b; --panel: #212427; --ink: #eceae6; --muted: #a3a7ab; --line: #34383c;
    --accent: #3fb3ab; --accent-ink: #0d1514; --accent-soft: #1d3634; --danger: #ff7a6b;
    --sel: #6ea0ff; --card: #2a2d31; --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom);
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.save { display: flex; gap: 8px; align-items: center; }
#outName { width: 170px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pick { min-width: 0; flex: 0 1 160px; }
.pick input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 38px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; white-space: nowrap; touch-action: manipulation; flex-shrink: 0;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.icon { width: 38px; padding: 0; font-size: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.btn.big { min-height: 48px; padding: 10px 24px; font-size: 16px; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 44px; min-width: 250px; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column;
}
.menu button, .menu a {
  text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer;
  color: var(--ink); text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--accent-soft); }
.show-sm { display: none; }

/* ---------- file strip ---------- */
.strip {
  display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; border-bottom: 1px solid var(--line);
  background: var(--panel); scrollbar-width: thin;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 300px;
  padding: 4px 4px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
}
.chip .letter {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 700; font-size: 13px;
}
.chip button.name { border: 0; background: none; padding: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.chip .n { color: var(--muted); font-size: 13px; }
.chip button.x { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.chip button.x:hover { background: var(--line); color: var(--ink); }

/* ---------- banner ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.banner p { margin: 0; flex: 1; min-width: 200px; }

/* ---------- empty state ---------- */
.empty { display: grid; place-items: center; align-content: center; gap: 20px; padding: 48px 16px; }
.honor-card { width: min(640px, 100%); padding: 20px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: left; }
.honor-card h2 { font-size: 17px; margin: 0 0 8px; }
.honor-card p { font-size: 14.5px; line-height: 1.55; margin: 0 0 10px; color: var(--ink); }
.honor-card .honor-by { color: var(--muted); font-weight: 600; white-space: nowrap; }
.honor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; } .honor-actions .btn { text-decoration: none; }
.drop {
  width: min(640px, 100%); text-align: center; padding: 48px 24px; border: 2px dashed var(--line);
  border-radius: 18px; background: var(--panel);
}
.drop h1 { font-size: 26px; margin: 18px 0 8px; letter-spacing: -.01em; }
.drop p { color: var(--muted); margin: 0 auto 20px; max-width: 460px; }
.drop .fine { margin-top: 16px; font-size: 13px; }
.drop-art { position: relative; width: 120px; height: 90px; margin: 0 auto; }
.drop-art span {
  position: absolute; width: 56px; height: 74px; border-radius: 6px; border: 2px solid var(--ink); background: var(--panel);
  left: 32px; top: 8px;
}
.drop-art span:nth-child(1) { transform: rotate(-14deg) translate(-26px, 4px); border-color: #e8590c; }
.drop-art span:nth-child(2) { transform: rotate(10deg) translate(26px, 4px); border-color: #1c7ed6; }
.drop-art span:nth-child(3) { border-color: var(--accent); }
.resume { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.resume p { width: 100%; margin: 0 0 6px; color: var(--ink); }

/* ---------- board ---------- */
main { padding: 16px 16px 120px; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 26px;
  outline: none; position: relative;
}
.card {
  position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  border-radius: var(--radius); cursor: grab; touch-action: manipulation;
}
.card .thumb {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: transparent; border-radius: var(--radius); padding: 6px;
  border: 2px solid transparent; transition: border-color .12s, background .12s;
}
.card img, .card .ph {
  box-shadow: var(--shadow); background: #fff; transition: transform .18s ease; border-radius: 2px;
}
/* the tile is square, so a picture that fits it also fits after a quarter turn */
.card img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 14px); max-height: calc(100% - 14px); }
.card .ph { width: 72%; aspect-ratio: 8.5 / 11; background: var(--card); }
.card .ph.blank { background: #fff; outline: 1px dashed var(--line); }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; padding: 0 4px; font-size: 13px; }
.card .tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); font-weight: 600;
}
.card .tag i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: 10px; }
.card .pos { color: var(--muted); }
.card .edge { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 0 0 4px 4px; background: var(--c); opacity: .9; }
.card:hover .thumb { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.card.selected .thumb { border-color: var(--sel); background: color-mix(in srgb, var(--sel) 12%, transparent); }
.card.focus .thumb { outline: 2px dashed var(--sel); outline-offset: 2px; }
.card .check {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--sel); color: #fff; display: none; place-items: center; font-size: 14px; font-weight: 700;
}
.card.selected .check { display: grid; }
.card.dragging { opacity: .35; }
.card .more {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; opacity: 0; transition: opacity .12s;
  display: grid; place-items: center; font-size: 15px;
}
.card:hover .more, .card.selected .more, .card .more:focus-visible { opacity: 1; }
@media (hover: none) { .card .more { opacity: .9; } }

/* split marker: dashed line in the gap after the page */
.card.split::after {
  content: "✂"; position: absolute; right: -20px; top: 0; bottom: 30px; width: 14px;
  border-right: 2px dashed var(--danger); color: var(--danger); font-size: 14px; line-height: 1;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 2px;
}
.newfile { position: absolute; top: -18px; left: 6px; font-size: 11px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .04em; }

.cardmenu {
  position: absolute; z-index: 40; min-width: 210px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.cardmenu button { text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; }
.cardmenu button:hover { background: var(--accent-soft); }

/* drag visuals */
.indicator {
  position: absolute; width: 4px; border-radius: 2px; background: var(--sel); z-index: 15; pointer-events: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel) 25%, transparent);
}
.dragghost {
  position: fixed; z-index: 60; pointer-events: none; width: 110px; transform: translate(-50%, -60%) rotate(-3deg);
}
.dragghost img, .dragghost .ph { width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.25); background: #fff; display: block; border-radius: 3px; }
.dragghost .ph { aspect-ratio: 8.5/11; }
.dragghost b {
  position: absolute; top: -10px; right: -10px; min-width: 26px; height: 26px; border-radius: 13px; padding: 0 7px;
  background: var(--sel); color: #fff; display: grid; place-items: center; font-size: 13px;
}
.dropcover {
  position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, var(--accent) 22%, transparent);
  display: grid; place-items: center; pointer-events: none; border: 4px dashed var(--accent);
}
.dropcover p { background: var(--panel); padding: 14px 22px; border-radius: 12px; font-weight: 600; font-size: 18px; box-shadow: var(--shadow); }

/* ---------- selection bar ---------- */
.selbar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 25;
  display: flex; align-items: center; gap: 6px; padding: 8px; max-width: calc(100vw - 24px); overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  scrollbar-width: none;
}
.selbar .count { font-weight: 600; padding: 0 8px; white-space: nowrap; }
.selbar .btn { min-height: 36px; padding: 4px 10px; gap: 6px; }

/* ---------- toast, busy ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; display: flex; gap: 14px; align-items: center;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.busy { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.25); display: grid; place-items: center; }
.busy-box { background: var(--panel); padding: 22px 28px; border-radius: 14px; text-align: center; min-width: 240px; box-shadow: var(--shadow); }
.busy-box p { margin: 12px 0 0; }
.spinner { width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dialogs ---------- */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg { padding: 20px 22px; width: min(520px, calc(100vw - 34px)); }
.dlg h2 { margin: 0 0 8px; font-size: 19px; }
.dlg input[type=text], .dlg input[type=password], .dlg select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.dlg label { display: block; font-weight: 600; font-size: 14px; }
.dlg label select { margin-top: 4px; font-weight: 400; }
.dlg .check { display: flex; gap: 8px; align-items: baseline; font-weight: 400; margin: 14px 0 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.dlg-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; margin-top: 18px; flex-wrap: wrap; } /* main button is first in the HTML (Enter key) but shows on the right */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }
.pair-q { margin: 16px 0 8px; font-weight: 600; }
.pair-choices { display: grid; gap: 10px; }
.pair-choice {
  display: grid !important; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; cursor: pointer;
  padding: 12px; border: 2px solid var(--line); border-radius: 12px; font-weight: 400 !important;
}
.pair-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pair-choice input { grid-row: span 2; margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; }
.pc-title { font-weight: 700; }
.pc-sub { color: var(--muted); font-size: 13px; }
.pair-choice .pair-preview { grid-column: 1 / -1; }
.pair-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.pair-guess { margin: 10px 0 0; color: var(--muted); min-height: 1.4em; }
.pair-guess.found { color: var(--ink); }
.pair-preview { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 2px; }
.pair-preview .pp { flex: none; width: 58px; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.pair-preview .pp div { aspect-ratio: 8.5/11; border-radius: 3px; background: color-mix(in srgb, var(--c) 18%, var(--panel)); border: 2px solid var(--c); display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.pair-preview .pp img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pair-preview .pp small { display: block; font-weight: 400; color: var(--muted); }
.pp-zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0,0,0,.55); cursor: zoom-out; }
.pp-zoom img { max-width: min(90vw, 520px); max-height: 85vh; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.done-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.done-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.done-item span { flex: 1; min-width: 160px; overflow-wrap: anywhere; }

.preview { width: min(1000px, calc(100vw - 24px)); height: calc(100vh - 40px); }
.preview[open] { display: flex; flex-direction: column; }
.pv-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); gap: 8px; }
.pv-btns { display: flex; gap: 6px; }
.pv-body { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; min-height: 0; background: var(--bg); }
.pv-body canvas { max-width: calc(100% - 100px); max-height: 100%; box-shadow: var(--shadow); background: #fff; }
.pv-nav { width: 40px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 28px; cursor: pointer; flex: none; }

/* ---------- small screens ---------- */
/* typed selection moves into the ⋯ menu when the bar gets crowded */
.menu .show-md { display: none; }
.menu .show-id { display: none; }
@media (max-width: 1700px) { .hide-id { display: none !important; } .menu .show-id { display: block; } }
@media (max-width: 1250px) {
  .pick { display: none; }
  .menu .show-md { display: block; }
}
@media (max-width: 860px) {
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
  .save { width: 100%; }
  #outName { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 600px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  main { padding: 12px 12px 130px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 22px 18px; }
  .card.split::after { right: -14px; }
  /* selection bar: full width, two rows of five buttons, count + clear on top */
  .selbar {
    left: 8px; right: 8px; transform: none; max-width: none; overflow: visible;
    bottom: calc(8px + env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 6px; padding: 8px;
  }
  .selbar .count { flex: 1 0 calc(100% - 52px); padding: 0 4px; }
  .selbar [data-sel="clear"] { flex: 0 0 40px; padding: 0; }
  .selbar .btn:not([data-sel="clear"]) { flex: 1 0 calc(20% - 6px); min-width: 0; padding: 4px 0; font-size: 18px; flex-direction: column; gap: 0; line-height: 1.1; min-height: 50px; }
  .selbar .lbl { font-size: 11px; white-space: nowrap; }
  body.has-sel .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
  body.has-sel main { padding-bottom: 190px; }
  .row2 { grid-template-columns: 1fr; }
  .drop { padding: 32px 16px; }
  .drop h1 { font-size: 22px; }
  .pv-body canvas { max-width: calc(100% - 70px); }
  .pv-nav { width: 30px; }
}

/* ---------- find bar ---------- */
.findbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 16px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.findbar input { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.find-result { color: var(--muted); font-size: 14px; }
.card.found .thumb { box-shadow: 0 0 0 3px #f59f00 inset; }

/* ---------- busy progress ---------- */
.busy-box .bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 12px; overflow: hidden; }
.busy-box .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.busy-box #busyCancel { margin-top: 14px; }

/* ---------- cleanup review ---------- */
.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.cl-sec { margin-top: 16px; }
.cl-sec h3 { font-size: 15px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.cl-sec h3 .n { background: var(--accent-soft); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.cl-sec p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.cl-items { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.cl-item { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; font-weight: 400 !important; }
.cl-item .cl-th { width: 96px; height: 96px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; position: relative; }
.cl-item:has(input:checked) .cl-th { border-color: var(--accent); }
.cl-item img { max-width: 84px; max-height: 84px; background: #fff; box-shadow: var(--shadow); transition: transform .2s; }
.cl-item input { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; accent-color: var(--accent); z-index: 2; }
.cl-item .cl-l { text-align: center; line-height: 1.2; }
.cl-none { padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; margin-top: 12px; }

/* find: where the words are */
.pv-match { display: inline-flex; align-items: center; gap: 8px; padding: 2px 8px; border-radius: 10px; background: #fff3bf; color: #5c3c00; font-size: 14px; font-weight: 600; }
.pv-match .btn { min-height: 32px; }
.pv-top { flex-wrap: wrap; }
@media (prefers-color-scheme: dark) { .pv-match { background: #5c4a00; color: #fff3bf; } }

.showbadge {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  padding: 4px 10px; border-radius: 999px; border: 1px solid #e67700; background: #ffe066; color: #3d2c00;
  font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.18); white-space: nowrap;
}
.showbadge:hover { background: #ffd43b; }

/* share link panel under a file in the "ready" window */
.link-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin: -2px 0 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.link-box .check { margin: 0; }
.link-box p { margin: 0; }
.link-box > .btn { align-self: flex-start; }
.link-opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.link-opts .chip, .se-row .chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; color: inherit; }
.link-opts .chip.on, .se-row .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.link-row { display: flex; gap: 6px; }
.link-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; color: inherit; }
#dlgDone .dlg { width: min(620px, calc(100vw - 32px)); }

.done-item > span:first-child { min-width: 140px; }

/* phone: what to add */
.add-choices { display: flex; flex-direction: column; gap: 10px; }
.add-choices h2 { margin-bottom: 4px; }
.add-pick { justify-content: flex-start; text-align: left; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; font-size: 17px; font-weight: 600; }
.add-pick small { font-size: 13px; font-weight: 400; color: var(--muted); }

.linkbtn { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 6px 4px; font-size: 14px; }
.tip { display: flex; align-items: center; gap: 12px; margin: 12px 12px 0; padding: 12px 14px; border-radius: 12px;
  background: #e7f5ff; border: 1px solid #74c0fc; color: #0b3a5c; }
.tip p { margin: 0; flex: 1; font-size: 14px; line-height: 1.4; }
.tip .muted { color: #36607f; }
.tip-hand { font-size: 26px; animation: hold 1.6s ease-in-out infinite; }
@keyframes hold { 0%, 30% { transform: translateY(0); } 50% { transform: translateY(3px) scale(.92); } 75%, 100% { transform: translate(14px, 0); } }
@media (prefers-reduced-motion: reduce) { .tip-hand { animation: none; } }
@media (prefers-color-scheme: dark) { .tip { background: #0b3a5c; border-color: #1c7ed6; color: #e7f5ff; } .tip .muted { color: #a5d8ff; } }

/* ---------- Fill & Sign ---------- */
.fs { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; border-radius: 0; border: 0; padding: 0; }
.fs[open] { display: flex; flex-direction: column; }
.fs-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.fs-title { font-size: 17px; }
.fs-nav { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.fs-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.fs-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.fs-toolwrap { position: relative; border-bottom: 1px solid var(--line); }
.fs-tools { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: thin; }
/* more tools off to the side: that edge fades and a round arrow shows (tap it to scroll) */
.fs-toolwrap.more-r .fs-tools { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); }
.fs-toolwrap.more-l .fs-tools { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 64px), transparent); }
.fs-toolwrap.more-l.more-r .fs-tools { -webkit-mask-image: linear-gradient(to right, transparent, #000 64px, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to right, transparent, #000 64px, #000 calc(100% - 64px), transparent); }
.fs-more { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 0 2px; }
.fs-more.left { left: 4px; } .fs-more.right { right: 4px; }
.more-l .fs-more.left, .more-r .fs-more.right { display: block; }
.fs-tool { flex-direction: column; gap: 0; min-width: 70px; min-height: 52px; line-height: 1.1; }
.fs-tool b { font-size: 17px; }
.fs-tool span { font-size: 12px; }
.fs-tool.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fs-hint { margin: 6px 12px; font-size: 13px; color: var(--muted); }
.fs-stage { flex: 1; overflow: auto; background: var(--bg); padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; overscroll-behavior: contain; }
.fs-page { position: relative; flex: none; box-shadow: var(--shadow); background: #fff; touch-action: pan-x pan-y pinch-zoom; }
.fs-canvas { display: block; }
.fs-mark { position: absolute; box-sizing: border-box; cursor: move; color: #111; touch-action: none; }
.fs-mark.sel { outline: 2px dashed var(--sel); outline-offset: 2px; }
.fs-mark img { width: 100%; height: 100%; display: block; pointer-events: none; }
.fs-mark svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.fs-mark input { border: 0; background: transparent; padding: 0 2px; margin: 0; width: 100%; height: 100%; font-family: var(--fs-font, Helvetica, Arial, sans-serif); color: #111; outline: none; }
.fs-text:not(.sel) input:placeholder-shown, .fs-text.sel input { background: rgba(28,100,242,.07); }
.fs-white { background: #fff; outline: 1px dashed #bbb; }
.fs-redact { background: #000; }
.fs-redact.sel { outline: 2px solid var(--sel); outline-offset: 1px; }
.fs-dotfill { display: block; width: 100%; height: 100%; border-radius: 50%; background: #111; }
.fs-del { position: absolute; top: -14px; right: -14px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 13px; cursor: pointer; z-index: 2; }
.fs-size { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--sel); border: 2px solid #fff; cursor: nwse-resize; touch-action: none; z-index: 4; } /* above a small mark's wider grab area */
@media (pointer: coarse) { .fs-size { width: 26px; height: 26px; right: -13px; bottom: -13px; } }
.fs-picker { margin: 0 12px 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; max-width: 520px; box-shadow: var(--shadow); }
/* Who is signing: one row per person — tap the row to sign as them; Edit shows redo / delete */
.fs-pp-head { display: flex; align-items: center; justify-content: space-between; }
.fs-pp-head b { font-size: 15px; }
.fs-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; }
.fs-pick.on { border-color: var(--sel); box-shadow: 0 0 0 1px var(--sel) inset; }
.fs-pick-main { display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: none; cursor: pointer; padding: 4px; text-align: left; color: inherit; font: inherit; }
.fs-pp-radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.fs-pick.on .fs-pp-radio { background: var(--sel); border-color: var(--sel); }
.fs-pp-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fs-pp-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-pp-thumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fs-pp-thumbs img { height: 28px; max-width: 130px; object-fit: contain; object-position: left; background: #fff; border-radius: 4px; }
.fs-pp-thumbs img.fs-pp-init { height: 24px; max-width: 56px; }
.fs-pp-thumbs img.fs-pp-seal { height: 26px; width: 26px; }
.fs-pp-thumbs .small { font-size: 12px; }
.fs-pp-more { padding: 8px 4px; }
.fs-pp-edit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 2px 36px; }
.fs-pp-edit .btn { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.fs-pp-add { align-self: flex-start; }
.fs-picker > p { margin: 0; }
.sm-name { margin-bottom: 10px; }
.sm-name input { margin-top: 4px; }
.sm-tabs { display: flex; gap: 4px; margin: 6px 0 10px; border-bottom: 1px solid var(--line); }
.sm-tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); }
.sm-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.sm-padwrap { position: relative; height: 170px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
#smPad { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#smPadHint { position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: #9aa0a6; pointer-events: none; }
.sm-line { position: absolute; left: 24px; right: 24px; bottom: 36px; border-bottom: 1px solid #c8c8c8; pointer-events: none; }
.sm-typed { display: flex; flex-direction: column; gap: 8px; }
.sm-font { font-size: 40px; text-align: left; padding: 6px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; line-height: 1.3; overflow: hidden; white-space: nowrap; }
.sm-font.on { border-color: var(--accent); }
.sm-photoprev { margin-top: 10px; min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; background: #fff; padding: 8px; }
.sm-photoprev img { max-height: 120px; max-width: 100%; }
.sm-ink { margin-top: 10px; display: flex; gap: 6px; align-items: center; font-size: 14px; }
.sm-ink button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.sm-ink button.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.signbadge { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 12px; box-shadow: var(--shadow); z-index: 2; }
@media (max-width: 600px) { .fs-label { display: none; } .fs-tool { min-width: 60px; } }

/* medium-width windows: shorter button words so the top bar fits on one line */
@media (max-width: 2000px) { .topbar .long { display: none; } }  /* "⇄ Pair" — the full words only on very wide screens, so the bar stays one row */
.top-actions { flex-wrap: wrap; }

/* Fill & Sign: who is signing, move grip, maker errors */
.fs-signer { background: var(--panel); border-style: dashed; }
.fs-signer b { color: var(--sel); }
.linkbtn.danger { color: var(--danger); }
.fs-grip { position: absolute; left: -14px; top: -14px; width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: #fff; font-size: 14px; line-height: 24px; text-align: center; cursor: move; touch-action: none; user-select: none; z-index: 2; }
@media (pointer: coarse) { .fs-grip { width: 30px; height: 30px; line-height: 30px; left: -18px; top: -18px; } }
.fs-mark.fs-text, .fs-mark.fs-date { cursor: move; }
.fs-mark input:focus { cursor: text; background: rgba(255,240,150,.35); }
.sm-err { color: var(--danger); font-weight: 600; margin: 6px 0 0; }
#dlgPeople .fs-picker { margin: 0; border: 0; padding: 0; }

/* Fill & Sign: places to fill (suggestions) */
.fs-spot { position: absolute; box-sizing: border-box; border: 1.5px dashed #d99a00; background: rgba(255, 196, 0, .13); border-radius: 3px; cursor: pointer; z-index: 1; }
.fs-spot:hover { background: rgba(255, 196, 0, .3); }
.fs-spot { display: flex; align-items: center; }
.fs-spot-tag { margin-left: 3px; font: 600 10px/14px system-ui, sans-serif; background: #d99a00; color: #fff; padding: 0 5px; border-radius: 5px; white-space: nowrap; pointer-events: none; }
.fs-spotmenu { position: absolute; z-index: 3; display: flex; gap: 4px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); max-width: 260px; }
.fs-spotmenu .btn { padding: 4px 10px; min-height: 32px; }
.fs-spotinfo { margin-left: 8px; color: #8a6100; }
.fs-spotinfo .linkbtn { margin-left: 6px; }
.fs-all-list { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 40vh; overflow: auto; }
.fs-all-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.fs-all-row input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
@media (pointer: coarse) { .fs-spot-tag { font-size: 9px; line-height: 12px; padding: 0 4px; } }

/* Sign step by step */
.fs-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.fs-guide[hidden] { display: none; }
.fs-g-count { font: 600 12px system-ui, sans-serif; background: var(--sel); color: #fff; border-radius: 10px; padding: 2px 8px; }
.fs-g-text { flex: 1 1 220px; min-width: 0; }
.fs-g-choices { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fs-spot.cur { border: 2.5px solid #e08a00; background: rgba(255, 180, 0, .28); box-shadow: 0 0 0 4px rgba(255, 180, 0, .25); animation: fsPulse 1.4s ease-in-out infinite; z-index: 2; }
.fs-spot.dim { opacity: .35; }
@keyframes fsPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 180, 0, .12); } }
@media (prefers-reduced-motion: reduce) { .fs-spot.cur { animation: none; } }
.fs-stage.zoom { align-items: flex-start; }
.guiding .fs-toolwrap, .guiding .fs-hint { display: none; }
.fs-mark input { line-height: 1; padding-top: 0; padding-bottom: 0; }
.fs-mark input { display: block; box-sizing: border-box; }
.fs-mark.cover input { background: #fff; }

/* seal maker */
.sm-seal { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sm-sealprev { width: 140px; height: 140px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.sm-sealcanvas { width: 120px; height: 120px; }
.sm-sealopts { flex: 1; min-width: 180px; }
.fs-lang { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; font-size: 13px; }
.fs-lang select { font: inherit; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; max-width: 130px; }
.fs-spot.grid { border: 1px dotted rgba(217, 154, 0, .55); background: rgba(255, 196, 0, .05); }
.fs-spot.grid:hover { background: rgba(255, 196, 0, .25); }
.fs-copy { position: absolute; top: -14px; right: 16px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--sel); color: #fff; font-size: 13px; cursor: pointer; z-index: 2; }
@media (pointer: coarse) { .fs-copy { width: 30px; height: 30px; top: -17px; right: 20px; } }
.fs-showspots { padding: 3px 10px; min-height: 28px; font-size: 13px; }
/* yellow boxes: lighter, so the printed words under them stay readable; hovering one makes it clear */
.fs-spot { background: rgba(255, 196, 0, .07); }
.fs-spot-tag { opacity: .9; }
@media (hover: hover) { .fs-spot:hover { background: transparent; } .fs-spot:hover .fs-spot-tag { opacity: .25; } }
.fs-hidden { color: var(--muted, #777); }
.fs-spot.round { border-radius: 50%; }
.fs-mark svg ellipse { color: #111; }

/* selected mark: controls in a bar above it (not on top of a small mark), bigger grab area for small marks */
.fs-bar { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -8px); display: flex; gap: 6px; z-index: 3; white-space: nowrap; }
.fs-bar.below { bottom: auto; top: 100%; transform: translate(-50%, 8px); }
.fs-bar .fs-grip, .fs-bar .fs-copy, .fs-bar .fs-del, .fs-bar .fs-zoom { position: static; width: 28px; height: 28px; line-height: 28px; padding: 0; margin: 0; }
@media (pointer: coarse) { .fs-bar .fs-grip, .fs-bar .fs-copy, .fs-bar .fs-del, .fs-bar .fs-zoom { width: 34px; height: 34px; line-height: 34px; } }
.fs-mark.small::after { content: ''; position: absolute; inset: -10px; } /* grab a tick from just around it */
@media (pointer: coarse) { .fs-mark.small::after { inset: -14px; } }
.fs-mark.small .fs-size { right: -16px; bottom: -16px; }
@media (pointer: coarse) { .fs-mark.small .fs-size { right: -22px; bottom: -22px; } }

.fs-zoom { border-radius: 50%; border: 0; background: var(--sel); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; text-align: center; }

/* phones: Fill & Sign is the main thing people do with a loaded PDF — a visible button, not hidden in ⋯ */
@media (max-width: 700px) { .word-files { display: none; } }

/* phones: one row of buttons at the top — the name gives way to the icon, Redo moves into ⋯ */
.menu .show-xs { display: none; }
.word-step { display: none; }
@media (max-width: 600px) {
  .brand span { display: none; }
  .hide-xs { display: none !important; }
  .menu .show-xs { display: block; }
  .top-actions { flex-wrap: nowrap; flex: 1; }
  .topbar .save { flex-basis: 100%; }
  .top-actions .btn { padding: 6px 10px; }
  .menu-wrap { margin-left: auto; }
  /* Fill & Sign: page count without arrows (pages scroll), no title, short labels — one row */
  .fs-top { flex-wrap: nowrap; gap: 6px; }
  .fs-title, #fsPrev, #fsNext, .word-sign, .fs-label { display: none; }
  .word-step { display: inline !important; }
  .fs-nav { font-size: 14px; white-space: nowrap; }
  .fs-right { gap: 6px; }
  .fs-right .btn { padding: 6px 10px; }
}
@media (max-width: 360px) { .fs-nav { display: none; } .fs-right { margin-left: 0; flex: 1; justify-content: space-between; } }

/* the page a share link opens */
body.get .topbar .brand { color: inherit; text-decoration: none; }
.get-main { max-width: 560px; margin: 40px auto; padding: 0 16px; }
.get-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.get-card h1 { font-size: 20px; margin: 0 0 6px; overflow-wrap: anywhere; }
.get-card progress { width: 100%; }
.get-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.get-foot { margin-top: 16px; }
.get-pw { display: flex; gap: 8px; margin: 14px 0 6px; }
.get-pw input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; font: inherit; }
.get-err { color: var(--danger); margin: 6px 0 0; min-height: 1.2em; }
.dlg .link-pw { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.dlg .link-pw small { font-weight: 400; }
.dlg .link-pw input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; max-width: 280px; }

/* Hide private information: kinds, your own words, go */
.fs-priv-kinds { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fs-priv-kinds .check { display: flex; align-items: center; gap: 6px; margin: 0; }
.fs-priv-words { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 14px; }
.fs-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; color: var(--muted); }
.fs-priv-add { display: flex; gap: 6px; }
.fs-priv-add input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; font: inherit; }
.fs-priv-go { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shrink-note { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ID copy dialog */
.idc { width: min(720px, calc(100vw - 34px)); }
.idc-body { display: flex; gap: 20px; align-items: flex-start; margin-top: 12px; }
.idc-sheet { flex: none; padding: 10px; border-radius: 10px; background: var(--bg); }
.idc-sheet canvas { display: block; box-shadow: 0 1px 4px rgba(0,0,0,.25); background: #fff; }
.idc-opts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.idc-opts .link-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.idc-lbl { margin: 6px 0 0; font-weight: 700; font-size: 14px; }
.idc-opts .check { margin: 8px 0 0; }
#idcTrimNote { margin: 0; color: var(--muted); }
#idcSwap { align-self: flex-start; margin-top: 6px; }
@media (max-width: 600px) { .idc-body { flex-direction: column; align-items: center; } }

/* feedback */
.fb .link-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fb textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); resize: vertical; min-height: 110px; }
.fb .fb-email { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
.fb .fb-email input { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.fb .check.small { font-size: 13px; color: var(--muted); }
.done-rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 2px 0; font-size: 14px; }
.done-rate .linkbtn { font-size: 15px; }
.idc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; max-height: min(52vh, 420px); overflow-y: auto; padding: 4px; margin: 6px 0 4px; }
.idc-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; font: inherit; font-size: 12px; color: var(--muted); }
.idc-tile img { width: 76px; height: 96px; object-fit: contain; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.idc-tile.on { border-color: var(--accent); color: var(--ink); }
.idc-tile .n { position: absolute; top: 2px; right: 2px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.idc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
#idcKeepNote { margin: 0; }

.idc-left { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.idc-sheet { position: relative; }
#idcHandles { position: absolute; left: 10px; top: 10px; }
.idc-item { position: absolute; outline: 1px dashed #b8bec6; cursor: move; touch-action: none; }
.idc-item:hover, .idc-item:active { outline-color: var(--accent); }
.idc-rs { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.idc-mm { position: absolute; left: 50%; top: -20px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); opacity: 0; pointer-events: none; }
.idc-item:hover .idc-mm, .idc-item:active .idc-mm { opacity: 1; }
.idc-hint { margin: 0; text-align: center; max-width: 270px; }
#idcSides { margin-top: 2px; }
#idcSides .btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
#idcSides .btn.warn { border-color: #d98b00; background: #fff4dc; color: #6b4300; }
.idc-crop-wrap { position: relative; display: inline-block; margin: 6px 0; overflow: hidden; border-radius: 8px; touch-action: none; }
.idc-crop-wrap canvas { display: block; }
.idc-crop-box { position: absolute; border: 2px solid #fff; outline: 1px solid rgba(0,0,0,.4); box-shadow: 0 0 0 9999px rgba(0,0,0,.5); cursor: move; touch-action: none; }
.idc-crop-box .h { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.idc-crop-box .h[data-c="nw"] { left: -11px; top: -11px; cursor: nwse-resize; } .idc-crop-box .h[data-c="ne"] { right: -11px; top: -11px; cursor: nesw-resize; }
.idc-crop-box .h[data-c="sw"] { left: -11px; bottom: -11px; cursor: nesw-resize; } .idc-crop-box .h[data-c="se"] { right: -11px; bottom: -11px; cursor: nwse-resize; }
#idcCropView { text-align: center; } #idcCropView .dlg-actions { justify-content: center; flex-wrap: wrap; }
.idc-side { display: inline-flex; gap: 4px; }
#idcSides .btn.icon { min-width: 34px; padding: 0 8px; font-size: 17px; }

/* feedback: visible everywhere */
.fb-btn { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); font-weight: 700; }
.fb textarea { min-height: 54px; margin-bottom: 4px; }
.fb .idc-lbl { margin-top: 12px; }
.fb .link-opts { margin-bottom: 6px; }
.fb-biz { margin: 14px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.fb-biz p { margin: 0 0 6px; font-size: 14px; }
.fb-biz .check { margin: 0; font-size: 14px; }
@media (max-width: 600px) { .word-fb { display: none; } }
#dlgFeedback { max-height: calc(100dvh - 24px); overflow-y: auto; }
.fb-err { margin: 4px 0 0; color: var(--bad, #b42318); font-weight: 700; font-size: 14px; }
.fb-err:empty { display: none; }

/* the logo goes home; help */
.topbar a.brand { color: inherit; text-decoration: none; border-radius: 8px; }
.topbar a.brand:hover span { text-decoration: underline; text-underline-offset: 3px; }
#dlgHelp { max-height: calc(100dvh - 24px); overflow-y: auto; }
.help-dlg { width: min(760px, calc(100vw - 34px)); }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help-head h2 { margin: 0; }
.help-player { margin: 10px 0 4px; }
.help-player video { display: block; width: 100%; border-radius: 10px; background: #111; aspect-ratio: 1120 / 665; }
.help-player p { margin: 6px 2px 0; }
.help-vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.help-vid { display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; text-align: left; font: inherit; color: var(--ink); overflow: hidden; }
.help-vid:hover, .help-vid.on { border-color: var(--accent); }
.help-vid span.th { position: relative; display: block; aspect-ratio: 1120 / 665; background: #ddd center / cover; }
.help-vid span.th::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.help-vid b { font-size: 13.5px; padding: 0 8px; line-height: 1.25; }
.help-vid small { font-size: 12px; color: var(--muted); padding: 0 8px; }
.help-faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0; background: var(--panel); }
.help-faq summary { cursor: pointer; font-weight: 700; }
.help-faq ol { margin: 8px 0 4px 18px; padding: 0; color: var(--muted); }
.help-faq ol li { margin: 3px 0; }
.help-faq ol b { color: var(--ink); }
.help-faq .help-watch { margin-top: 4px; }
.help-more { margin-top: 12px; }

/* ID page: turn button on each side, texts on the page */
.idc-turn { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background: #fff; color: #222; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.idc-turn:hover, .idc-turn:focus-visible { background: var(--accent); color: var(--accent-ink); }
.idc-txt { position: absolute; outline: 1px dashed #b8bec6; cursor: move; touch-action: none; font-size: 10px; color: #8a8f96; text-align: center; }
.idc-txt:hover, .idc-txt:active { outline-color: var(--accent); }
.idc-txt.empty { background: rgba(0,0,0,.04); }
.idc-trow { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.idc-tin { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid var(--line, #ccc); border-radius: 8px; font: inherit; }
.idc-trow select { flex: none; width: auto; padding: 5px 2px; font-size: 14px; border-radius: 8px; font: inherit; }
.idc-trow .btn { flex: none; }

/* "What left this page" meter */
.meter-pill { position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 600 13px/1.2 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.meter-pill b { font-weight: 700; color: var(--ink); }
.meter-pill:hover { border-color: var(--accent); }
.meter-pill.flash { animation: meterflash 1.2s ease; }
@keyframes meterflash { 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); } }
@media (max-width: 600px) { .selbar:not([hidden]) ~ .meter-pill { display: none; } .meter-pill { left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); } }
@media print { .meter-pill { display: none; } }
.meter { width: min(560px, calc(100vw - 34px)); }
.meter-rows { display: grid; gap: 8px; margin: 14px 0; }
.meter-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.meter-row .ic { font-size: 20px; line-height: 1.2; } .meter-row .nm { font-weight: 700; } .meter-row .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-row .why { grid-column: 2 / 4; font-size: 14px; color: var(--muted); }
.meter-row.zero .amt { color: var(--good, #1e7b4f); }
.meter-check { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft, #dcefec); font-size: 14px; }
.meter-check p { margin: 4px 0 0; }

/* ID page window, tidied: tools above the preview, a short caption under it, few options beside it */
.idc-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.idc-cap { margin: 0; max-width: 350px; text-align: center; font-size: 13px; color: var(--muted); }
.idc-field { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; }
.idc-field .idc-lbl { margin: 0; }
.idc-field .idc-row { margin: 0; gap: 6px; }
.idc-opts { gap: 12px; padding-top: 38px; }
.idc-trimnote { margin: -4px 0 0 60px; color: var(--muted); }
.idc-trimnote:empty { display: none; }
.idc-more { border-top: 1px solid var(--line); padding-top: 10px; }
.idc-more summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.idc-more[open] summary { margin-bottom: 4px; }
.idc-more .check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
@media (max-width: 600px) { .idc-opts { padding-top: 0; width: 100%; } .idc-trimnote { margin-left: 0; } }
/* text on the preview */
.idc-txt { position: absolute; outline: 1px dashed transparent; cursor: move; touch-action: none; font-size: 10px; color: #8a8f96; text-align: center; line-height: 1; }
.idc-txt:hover { outline-color: #b8bec6; }
.idc-txt.empty { outline-color: var(--accent); background: rgba(0,0,0,.04); }
.idc-txt.sel { outline: 2px dashed var(--accent); outline-offset: 1px; }
.idc-trs { position: absolute; right: -8px; bottom: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: ew-resize; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.idc-under { position: relative; width: min(350px, 100%); min-height: 46px; display: flex; justify-content: center; }
.idc-tbar { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; gap: 4px; align-items: center; padding: 5px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.idc-tbar input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.idc-tbar .tb { flex: none; width: 34px; height: 32px; padding: 0; border-radius: 7px; border: 0; background: var(--accent); color: var(--accent-ink); font: 700 13px/1 inherit; font-family: inherit; cursor: pointer; }
.idc-tbar .tb.del { background: var(--danger); color: #fff; }

/* a close look at one side */
.idc-zoom { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); background: #fff; font-size: 13px; line-height: 1; cursor: zoom-in; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.idc-zoom:hover, .idc-zoom:focus-visible { background: var(--accent-soft); }
.idc-zoom-wrap { display: flex; justify-content: center; padding: 12px; border-radius: 12px; background: var(--bg); margin: 8px 0; }
.idc-zoom-wrap canvas { display: block; max-width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.25); border-radius: 4px; background: #fff; }
.idc-zoom-tip { margin: 0 0 4px; text-align: center; }

/* Business preview features: business details, form answers, business account */
.tag-preview { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #fff1dc; color: #8a4b00; }
.tag-preview.ok { background: #e3f3ea; color: #1e7b4f; }
.brand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; }
.brand-row .check { margin: 0; }
.brand-dlg { width: min(640px, calc(100vw - 34px)); }
.brand-grid { display: grid; grid-template-columns: 150px 1fr; gap: 16px; margin-top: 12px; }
@media (max-width: 600px) { .brand-grid { grid-template-columns: 1fr; } }
.brand-fields { display: grid; gap: 10px; }
.brand-fields label, .brand-logo { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.brand-fields input { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; width: 100%; }
.brand-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .brand-two { grid-template-columns: 1fr; } }
.brand-logo-box { display: grid; place-items: center; height: 100px; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; color: var(--muted); font-weight: 400; }
.brand-logo-box img { max-width: 100%; max-height: 96px; }
.brand-logo input[type=file] { font-size: 12px; font-weight: 400; max-width: 100%; }
.err { color: var(--danger); font-weight: 600; min-height: 1em; margin: 8px 0 0; }
.err:empty { display: none; }
.extract-dlg { width: min(860px, calc(100vw - 34px)); }
.ex-table-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.ex-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.ex-table th, .ex-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ex-table th { position: sticky; top: 0; background: var(--panel); }
.ex-table:empty { display: none; }
.acct-dlg { width: min(600px, calc(100vw - 34px)); }
.acct-dlg h3 { font-size: 15px; margin: 16px 0 6px; }
.acct-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.acct-team { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.acct-team li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acct-team li:last-child { border-bottom: 0; }
.acct-invite { display: flex; gap: 6px; margin-top: 8px; }
.acct-invite input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; }
.acct-link { margin-top: 8px; }
/* the link page: the sender's business */
.get-brand { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; background: var(--bg); text-align: left; }
.get-brand.verified { border-color: #1e7b4f; box-shadow: 0 0 0 1px #1e7b4f inset; }
.gb-top { display: flex; gap: 14px; align-items: center; }
.gb-logo { max-width: 110px; max-height: 60px; object-fit: contain; }
.gb-sent { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.gb-name { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.gb-line { margin: 2px 0 0; color: var(--muted); }
.gb-rows { display: grid; gap: 4px; margin-top: 10px; font-size: 15px; }
.gb-row { display: flex; gap: 8px; } .gb-k { flex: none; width: 22px; }
.gb-check { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.gb-check.ok { color: #1e7b4f; font-weight: 700; }

/* EnokiPDF Members */
.member-chip { border-style: dashed; }
.member-note { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.members-dlg, .links-dlg { width: min(560px, calc(100vw - 34px)); }
.mem-ok { padding: 10px 12px; border-radius: 10px; background: #e3f3ea; color: #1e7b4f; font-weight: 700; }
.mylinks { list-style: none; margin: 10px 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 50vh; overflow: auto; }
.mylinks li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mylinks li:last-child { border-bottom: 0; }
.devlist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
/* 🔔 business: opened links */
.bell-btn { position: relative; }
.bell-btn .n:empty { display: none; }
.bell-btn .n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #d93025; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.bell-list li.new { background: color-mix(in srgb, var(--accent, #2563eb) 8%, transparent); border-radius: 8px; }
.bell-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
/* business: a copy for each person, Bates numbers */
.done-biz { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 8px; }
.done-biz .btn { font-size: 13px; padding: 4px 10px; }
.stamp-box textarea { width: 100%; box-sizing: border-box; font: inherit; }
.stamp-box .mylinks li { display: flex; gap: 8px; align-items: center; }
.stamp-box .mylinks input { flex: 1; min-width: 0; }
.bates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 6px 0; }
.bates-f { display: flex; flex-direction: column; font-size: 13px; gap: 2px; }
.bates-f input, .bates-f select { width: 100%; box-sizing: border-box; }
.acct-link a.btn { text-decoration: none; color: inherit; }
.paid-ok { background: #e7f6ee; color: #0b6b3a; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.bill-row.warn { background: #fff4e5; border-color: #f3c27a; }
/* secure document requests: the client's upload page */
.req-note { white-space: pre-wrap; background: var(--bg); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; }
.req-items { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 10px; }
.req-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.req-item.has { border-color: #1e7b4f; }
.req-item.other { border-style: dashed; }
.req-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.req-check { width: 1.4em; text-align: center; font-weight: 700; color: #1e7b4f; }
.req-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.req-sent { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.req-name { display: grid; gap: 4px; margin-bottom: 14px; font-weight: 600; }
.req-name input { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: inherit; }
.req-closed { background: #fff4e5; border-radius: 10px; padding: 10px 12px; }
.get-card .btn.big { width: 100%; padding: 12px; font-size: 16px; }
.get-card h2 { font-size: 16px; margin: 16px 0 4px; }
/* 📥 document requests: the requester's inbox */
.req-dlg { max-width: 640px; }
.rec-code { font: 700 22px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; text-align: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; user-select: all; overflow-wrap: anywhere; }
.req-list .req-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; }
.req-list .req-row:hover { background: var(--bg); }
.req-pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #fff1dc; color: #8a4b00; white-space: nowrap; }
.req-pill.ok { background: #dcf5e8; color: #0b6b3a; }
.req-dlg textarea { width: 100%; box-sizing: border-box; font: inherit; }
.req-dlg .bates-f input { padding: 8px 10px; }
.bell-list li.go { cursor: pointer; }
.req-items.owner .req-sent li { padding: 3px 0; }
.req-dlg .bates-f input, .req-dlg .bates-f textarea, .req-dlg textarea { font-weight: 400; } .req-dlg .bates-f { margin-bottom: 8px; }
.how-looks { margin: 6px 0 10px; font-size: 14px; }
.how-looks summary { cursor: pointer; color: var(--accent); }
.how-looks ol { margin: 6px 0; padding-left: 20px; }
.email-signin { margin: 6px 0; }
.code-signin .code-in { font: 600 22px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; width: 9ch; text-align: center; } .code-signin .bates-f input { padding: 10px 12px; font-size: 16px; }
.code-in { font: 600 22px/1 ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: 4px; width: 10ch !important; flex: 0 0 auto !important; text-align: center; padding: 10px !important; }
/* who you're signed in as (business accounts) */
.acct-chip { max-width: 260px; font-size: 13px; padding: 6px 10px; }
.acct-chip .who { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .acct-chip { max-width: 140px; } }
/* /verify */
.verify-drop { display: grid; gap: 4px; place-items: center; border: 2px dashed var(--line); border-radius: 14px; padding: 28px 16px; margin: 14px 0; cursor: pointer; text-align: center; }
.verify-drop.over, .verify-drop:focus { border-color: var(--accent); outline: none; }
.verify-drop b { font-size: 17px; color: var(--accent); }
.verify-rec, .verify-no { border-radius: 12px; padding: 12px 14px; margin: 10px 0; border: 1px solid var(--line); }
.verify-ok .verify-rec { border-color: #1e7b4f; background: color-mix(in srgb, #1e7b4f 7%, transparent); }
.verify-rec.revoked, .verify-no { border-color: #b45309; background: color-mix(in srgb, #b45309 7%, transparent); }
.vr-head { font-weight: 700; font-size: 17px; margin: 0 0 8px; }
.verify-rec dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.verify-rec dt { color: var(--muted); }
.verify-rec dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.verify-code { margin-top: 10px; }
.file-warn { margin: 4px 0; padding: 6px 10px; border-radius: 8px; background: #fde8e8; color: #8b1a1a; font-size: 13px; }
.file-warn.soft { background: #fff4e5; color: #7a4100; }
.req-sent li.blocked { color: var(--muted); }

/* 💧 watermark + stamp style editor (v11) */
.wm-dlg { max-width: 760px; width: min(760px, calc(100vw - 32px)); }
.wm-dlg .chip { padding: 4px 10px; font-size: .9em; }
.wm-grid { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.wm-preview { position: sticky; top: 0; width: 220px; max-width: 100%; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.12); background: #fff; }
.wm-preview.small { width: 160px; }
@media (max-width: 640px) { .wm-grid { grid-template-columns: 1fr; } .wm-preview { justify-self: center; } }
.style-ed { margin: 6px 0; }
.se-more summary { cursor: pointer; font-size: .9em; color: var(--accent, #2d6cdf); margin: 4px 0; }
.se-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.se-k { min-width: 70px; }
.se-row input[type=range] { width: 140px; }
.se-row input.num { width: 64px; }
.se-row input[type=text] { flex: 1; min-width: 140px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.swatch.on { border-color: var(--accent, #2d6cdf); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 22px); grid-template-rows: 18px 28px; gap: 3px; padding: 4px; border: 1px solid var(--line, #d6d3cc); border-radius: 4px; background: #fff; }
.pos-grid .pos { width: 22px; height: 18px; min-height: 0; border: 1px solid #c9c5bd; border-radius: 3px; background: #f4f2ee; cursor: pointer; padding: 0; }
.pos-grid .pos:nth-child(n+4) { margin-top: 10px; }
.pos-grid .pos.on { background: var(--accent, #2d6cdf); border-color: var(--accent, #2d6cdf); }
.thumb { position: relative; }
.wmbadge { position: absolute; left: 50%; top: 50%; font: 700 11px/1 Helvetica, Arial, sans-serif; letter-spacing: .05em; white-space: nowrap; pointer-events: none; }
.acct-row.col { flex-direction: column; align-items: flex-start; gap: 6px; }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea), body.printing dialog { display: none !important; }
  body.printing #printArea { display: block; color: #000; font: 14pt/1.5 Helvetica, Arial, sans-serif; padding: 2cm; }
  body.printing #printArea .rec-code { font: 700 22pt/1.4 "Courier New", monospace; letter-spacing: .08em; border: 2px solid #000; padding: 12px 16px; display: inline-block; }
}
/* ⋯ menu: three short groups, the rest as small links at the foot (v12) */
.menu { max-height: calc(100vh - 120px); overflow-y: auto; min-width: 270px; }
.menu > button { white-space: nowrap; }
.menu-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b6b6b); padding: 10px 10px 2px; }
.menu-h:first-child, .menu > .show-sm + .menu-h { padding-top: 4px; }
.menu button, .menu a { padding: 7px 10px; }
.menu button[hidden] { display: none; }
.menu-foot { display: flex; flex-direction: column; }
.menu .menu-foot button, .menu .menu-foot a { white-space: nowrap; font-size: 14px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; }
/* sending a request link (v12) */
.send-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.send-panel p { margin: 0 0 8px; }
.send-panel .link-opts { flex-wrap: wrap; gap: 6px; }
.qr-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qr-row ol { margin: 4px 0 8px; padding-left: 18px; }
.qr-box canvas.qr { width: 210px; height: 210px; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--line); display: block; }
.qr-row > div:last-child { flex: 1; min-width: 220px; }
/* ⌫ Eraser (v17): the page's own colour; colour buttons on the selected one; drag-to-draw outline */
.fs-white { outline: 1px dashed rgba(0,0,0,.28); }
.fs-colours { display: inline-flex; gap: 6px; align-items: center; }
.fs-zoom.on { outline: 2px solid #fff; outline-offset: -2px; }
.fs-col { position: relative; display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--sel); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); cursor: pointer; }
.fs-col .fs-colin { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.fs-drawbox { outline: 2px dashed var(--sel, #2d6cdf); background: rgba(45,108,223,.08) !important; pointer-events: none; }
.fs-bar .fs-col { position: relative; overflow: hidden; }
.fs-misscheck { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
/* ▤ Fill & Sign page list (v23; wider in v24) */
.fs-body { flex: 1; display: flex; min-height: 0; }
.fs-strip { width: clamp(170px, 13vw, 240px); min-width: clamp(170px, 13vw, 240px); flex: none; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--line); background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; box-sizing: border-box; }
.fs-strip[hidden] { display: none; }
.fs-thumb { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 100%; padding: 5px; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--muted); font: 700 13px/1 inherit; box-sizing: border-box; }
.fs-thumb:hover { background: var(--accent-soft); }
.fs-thumb.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fs-thumb-pic { display: block; width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(0,0,0,.1); overflow: hidden; }
.fs-thumb-c { display: block; width: 100% !important; height: 100% !important; }
.fs-thumb-n { text-align: center; }
.fs-thumb-b { position: absolute; top: 9px; right: 9px; font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.fs-thumb-b:empty { display: none; }
.fs-thumb-b.done { background: var(--accent); color: var(--accent-ink); }
.fs-thumb-b.todo { background: #f6c443; color: #3a2c00; }
.fs-page-btn { border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.fs-page-btn:hover { background: var(--accent-soft); }
.fs-page-in { width: 4.2em; font: inherit; font-weight: 700; padding: 2px 4px; border: 1px solid var(--accent); border-radius: 6px; }
@media (max-width: 700px) { .fs-strip { width: 120px; min-width: 120px; padding: 8px 6px; gap: 10px; } }
.fs-strip-grip { flex: none; width: 7px; margin-left: -4px; cursor: col-resize; position: relative; z-index: 2; touch-action: none; }
.fs-strip-grip::after { content: ''; position: absolute; top: 50%; left: 2px; width: 3px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--line); }
.fs-strip-grip:hover::after, .fs-strip-grip.drag::after, .fs-strip-grip:focus-visible::after { background: var(--accent); }
.fs-strip-grip[hidden] { display: none; }
/* Your plan (v26) */
.bill-row .link-opts { margin-top: 4px; }
.founding-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fff3c4; color: #6b4e00; font-size: 12px; font-weight: 700; }
.plan-pick { width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: grid; gap: 6px; }
.plan-pick .seats { min-width: 1.6em; text-align: center; font-size: 16px; }
.plan-out { min-height: 1.3em; margin: 4px 0 0; }

/* Enoki badge (v35): grey for the free home version, in full colour for Pro & Team */
.enoki-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; margin-left: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; line-height: 1.05; }
.enoki-badge img { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); transition: filter .4s, transform .3s; }
.enoki-badge .eb-text { display: grid; text-align: left; }
.enoki-badge .eb-plan { font-size: 13px; color: inherit; } .enoki-badge .eb-sub { font-size: 11px; }
.enoki-badge:not(.pro) img, .honor-head img.grey { filter: grayscale(1) contrast(.9); opacity: .6; }
.enoki-badge:not(.pro):hover img { opacity: .85; }
.enoki-badge.pro { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); }
.enoki-badge.pro img { background: radial-gradient(circle at 50% 40%, #fff3d6, #ffd9a0); box-shadow: 0 0 0 2px #f6b37a; }
.enoki-badge.pro .eb-plan::after { content: ' ✦'; color: #e8a000; }
.enoki-badge.pro.hello img { animation: enokiHello .9s ease 2; }
@keyframes enokiHello { 30% { transform: rotate(-12deg) scale(1.08); } 60% { transform: rotate(10deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .enoki-badge.pro.hello img { animation: none; } }
@media (max-width: 860px) { .enoki-badge { padding: 2px; } .enoki-badge .eb-text { display: none; } .enoki-badge img { width: 30px; height: 30px; } }
.honor-dlg { width: min(560px, calc(100vw - 34px)); }
.honor-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; } .honor-head h2 { margin: 0 0 4px; font-size: 19px; } .honor-head p { margin: 0; font-size: 14px; }
.honor-head img { border-radius: 50%; background: var(--bg); flex: none; }
#honorDlgBody p { font-size: 15px; line-height: 1.55; }
a.btn { text-decoration: none; }
.honor-card h2 { display: flex; align-items: center; gap: 10px; } .honor-enoki { border-radius: 50%; background: var(--bg); filter: grayscale(1); opacity: .65; }
.signin-btn { font-weight: 700; color: var(--accent); white-space: nowrap; }
.honor-actions { align-items: center; } .honor-actions .linkbtn { margin-left: 6px; font-size: 14px; }
.honor-signin { margin: 0 0 10px; }
/* friendlier ⋯ menu (v40): an icon, a name and one line on what it does; Pro items marked for free users */
.menu { width: 330px; max-width: calc(100vw - 16px); }
.menu > button:has(.mt) { display: grid; grid-template-columns: 26px 1fr; gap: 0 8px; align-items: start; white-space: normal; padding: 8px 10px; }
.menu .mi { font-size: 17px; line-height: 1.3; text-align: center; width: 26px; flex: none; }
.menu .mt b { font-weight: 600; display: block; } .menu .mt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; margin-top: 1px; }
.menu-h-note { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); margin-left: 4px; }
.menu:not(.signed) [data-pro] b::after { content: 'Pro'; margin-left: 6px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: #fff1dc; color: #8a4b00; vertical-align: 1px; }
.menu.signed .menu-plans { display: none !important; }
@media (prefers-color-scheme: dark) { .menu:not(.signed) [data-pro] b::after { background: #33261a; color: #f5b56a; } }
.menu > button.show-sm:has(.mt), .menu > button.show-md:has(.mt), .menu > button.show-xs:has(.mt), .menu > button.show-id:has(.mt) { display: none; }
@media (max-width: 1700px) { .menu > button.show-id:has(.mt) { display: grid; } }
@media (max-width: 1250px) { .menu > button.show-md:has(.mt) { display: grid; } }
@media (max-width: 860px) { .menu > button.show-sm:has(.mt) { display: grid; } }
@media (max-width: 600px) { .menu > button.show-xs:has(.mt) { display: grid; } .menu { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; max-height: calc(100vh - 76px); } }
/* phones: the top row must fit — sign-in moves to grey Enoki's window and the ⋯ menu */
@media (max-width: 600px) { .signin-btn { display: none !important; } }
@media (max-width: 600px) { .word-fb { display: none; } .enoki-badge { margin-left: 0; } }
/* phones: the logo (peeking Enoki) is the way back to the home page; the plan shows as a word — Free, Pro ✦, Team ✦ —
   not a second (grey) cat; "Fill & Sign" is spelled out so it can't be read as signing in; Help and Feedback move into ⋯ */
.enoki-badge .eb-short { display: none; }
.menu .menu-quick { display: none; }  /* phones only: Help and Feedback at the top of ⋯ (their buttons leave the top row) */
@media (max-width: 600px) {
  .topbar .brand .brand-cat { width: 30px; height: auto; margin: -4px 0 -10px; }
  .enoki-badge { padding: 5px 10px; }
  .enoki-badge img, .enoki-badge .eb-text { display: none; }
  .enoki-badge .eb-short { display: inline; font-size: 13px; font-weight: 700; white-space: nowrap; }
  .topbar .help-btn, .topbar .fb-btn { display: none; }
  .menu .menu-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .menu .menu-quick button { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font: inherit; font-weight: 600; text-align: center; }
  .topbar .top-actions { gap: 5px; }
  .topbar { gap: 6px; }
}
@media (max-width: 380px) { .topbar .word-add { display: none; } .enoki-badge { padding: 5px 8px; } }

/* EnokiPDF wordmark: "PDF" in teal, like the logo */
.brand .brand-pdf { font-style: normal; color: var(--accent, #0f5f5c); }
/* Enoki peeks over his page and rests on the top bar's bottom line */
.topbar .brand { font-size: 20px; font-weight: 800; letter-spacing: -.02em; gap: 6px; }
.topbar .brand .brand-cat { align-self: flex-end; margin: -6px 0 -11px; }

/* nothing to download yet: no File name / Download PDF box (it would only push the toolbar onto a second row) */
body.board-empty .topbar .save { display: none; }
/* medium-wide screens: Feedback shows as 💬 (tooltip keeps the word), the find box is a little narrower, and ID page moves into ⋯ (below) */
@media (max-width: 1850px) { .topbar .word-fb { display: none; } .topbar .pick { flex-basis: 140px; } #outName { width: 150px; } }

/* sign-in, easy to find on every screen: the first thing in ⋯ while signed out, and a real button in the Home window */
.menu .menu-signin { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); color: var(--accent); font: inherit; font-size: 18px; text-align: left; cursor: pointer; }
.menu .menu-signin span { display: grid; font-size: 14px; color: var(--ink, inherit); } .menu .menu-signin b { color: var(--accent); } .menu .menu-signin small { color: var(--muted); font-size: 12px; }
.menu .menu-signin:hover { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.menu.signed .menu-signin { display: none; }
.honor-signin-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.honor-signin-box .signin-big { font-weight: 700; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.passkey-or { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }

/* the account window: title and ✕ stay at the top while it scrolls */
.acct-dlg .acct-top { position: sticky; top: -1px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px -4px 0; padding: 4px 4px 6px; background: var(--panel); }
.acct-dlg .acct-top h2 { margin: 0; }
.acct-dlg .acct-x { flex: none; font-size: 18px; }
.acct-dlg .acct-who { margin-top: 6px; }
.acct-dlg .acct-who .linkbtn { font-weight: 600; }

/* the owner's account history */
.acct-hist .hist-row { display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.acct-hist .hist-t { color: var(--muted); white-space: nowrap; } .acct-hist .hist-who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-hist > .btn { margin-top: 8px; }
@media (max-width: 600px) { .acct-hist .hist-row { grid-template-columns: 1fr; gap: 0; } .acct-hist .hist-what { font-size: 14px; } }
