:root {
  --footer-h: 96px;   /* desktop footer bar height — sidebars end above it */
  --teal: #10b981;
  --teal-bright: #34d399;
  --em: #10b981;
  --em-d: #059669;
  --em-dk: #047857;
  --em-soft: #ecfdf5;
  --em-tint: #d1fae5;
  --bg: #eef2f0;
  --bar: #ffffff;
  --paper-bg: #eaefed;
  --ink: #1f2a30;
  --mut: #5d6b71;
  --mut2: #8b979c;
  --line: #e7ece9;
  --line2: #d6ded9;
  --danger: #dc2626;
  --sbw: 306px;           /* Pages sidebar width — adjustable by dragging */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper-bg);
  color: var(--ink);
  display: flex; flex-direction: column;
  overscroll-behavior: none;
}
/* headings match the homepage typeface */
h1, h2, h3, .lcard-head h3, .dz-text, .help-head h3, .upcard h3 { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -.018em; }
.hidden { display: none !important; }

/* ── Top bar ─────────────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; gap: 8px;
  background: #0f1b2e; color: #e7edf3;
  padding: 15px 14px 15px 0;   /* +14px overall header height (7px top + 7px bottom) */
  position: sticky; top: 0; z-index: 1900000000;   /* above footers so the floating dock (its child) is never clipped */
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,.5);
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: .3px; font-size: 15px; white-space: nowrap; cursor: pointer; color: #fff; }
.brand:hover { opacity: .82; }
.brand:active { opacity: .65; }
.brand-ez { color: #34d399; }
.brand-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg,#10b981,#059669); color: #fff; font-size: 11px; font-weight: 900; margin-right: 8px; flex: 0 0 auto; }

/* Dark top toolbar — scoped overrides so the light footer buttons are unaffected */
#topbar .tb-btn { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.15); color: #e7edf3; }
#topbar .tb-btn:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
#topbar .tb-btn.primary { background: var(--em); border-color: var(--em); color: #fff; }
#topbar .tb-btn.primary:hover { background: var(--em-d); border-color: var(--em-d); color: #fff; box-shadow: 0 0 0 2px rgba(16,185,129,.3); }
#topbar .tb-btn.primary.on { background: #34d399; border-color: #34d399; color: #04231d; box-shadow: 0 0 0 2px rgba(52,211,153,.4); }
#topbar .pagenav input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e7edf3; }
#topbar #zoomPct, #topbar #fontSize { color: #aebccb; }
#topbar .hist-tb { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
#topbar .hist-tb button { color: #e7edf3; }
#topbar .hist-tb button:active { background: rgba(255,255,255,.12); }
#topbar .savestate { color: #4ade80; }
#topbar .savestate.saving { color: #fbbf24; }
.doc-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
/* three-zone toolbar: brand+saved pinned left, tools centered, right spacer balances */
.tb-left { display: flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; justify-content: flex-start; }
.tb-center { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; flex: 0 1 auto; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 0; }
/* "More" overflow — desktop shows zoom/page-nav/undo inline; mobile tucks them behind ⋯ */
.more-btn { display: none; font-weight: 800; }
.more-tools { display: contents; }
@media (max-width: 760px) {
  .more-btn { display: inline-flex; }
  .more-tools { display: none; position: absolute; top: calc(100% + 5px); right: 8px; z-index: 70;
    flex-direction: column; align-items: stretch; gap: 9px; padding: 11px;
    background: #16243a; border: 1px solid rgba(255,255,255,.12); border-radius: 13px;
    box-shadow: 0 22px 48px -16px rgba(0,0,0,.65); }
  #topbar.more-open .more-tools { display: flex; }
  .more-tools .pagenav, .more-tools .zoomctl, .more-tools .hist-tb { justify-content: center; }
}
@media (max-width: 760px) {
  /* brand on its own centered row, tools packed compactly into ~2 even rows */
  #topbar { gap: 5px; padding: 6px 8px; }
  .tb-left { flex: 1 1 100%; justify-content: center; }
  .tb-center { flex: 1 1 100%; gap: 5px; }
  .tb-right { display: none; }
  #topbar .tb-btn { padding: 8px 11px; }
  .pagenav { gap: 2px; font-size: 12px; }
  .pagenav input { width: 40px; padding: 5px 4px; }
  .zoomctl { gap: 2px; }
  #zoomPct { min-width: 34px; font-size: 11px; }
}

.tb-btn {
  background: #fff; color: var(--ink); border: 1px solid var(--line2);
  border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; touch-action: manipulation;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.tb-btn:active { transform: scale(.96); }
.tb-btn:hover { background: var(--bg); border-color: var(--mut2); }
.tb-btn.sq { padding: 7px 9px; min-width: 34px; }
/* Text box / Add image / Draw sign — primary tools (flat emerald) */
.tb-btn.primary { background: var(--em); border-color: var(--em); color: #fff; font-weight: 400; }
.tb-btn.primary:hover { background: var(--em-d); border-color: var(--em-d); color: #fff; box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.tb-btn.primary.on { background: var(--em-dk); border-color: var(--em-dk); color: #fff; box-shadow: 0 0 0 2px rgba(16,185,129,.35); }
/* Download — strongest CTA (emerald gradient, matches homepage) */
.tb-btn.accent { background: linear-gradient(135deg,#10b981,#059669); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(16,185,129,.8); }
.tb-btn.accent:hover { filter: brightness(1.05); box-shadow: 0 12px 22px -10px rgba(16,185,129,.9); }
/* Save As — emerald outline (distinct from Download) */
.tb-btn.saveas { background: #fff; border: 1.5px solid var(--em); color: var(--em-dk); }
.tb-btn.saveas:hover { background: var(--em-soft); border-color: var(--em-d); color: var(--em-dk); box-shadow: 0 0 0 2px rgba(16,185,129,.18); }
.tb-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.pagenav { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.pagenav input {
  width: 52px; background: #fff; border: 1px solid var(--line2); color: var(--ink);
  border-radius: 8px; padding: 6px 6px; font-size: 13px; text-align: center;
}
.zoomctl { display: flex; align-items: center; gap: 4px; font-size: 12px; }
#zoomPct { min-width: 40px; text-align: center; color: var(--mut); }
.seltools { display: flex; align-items: center; gap: 4px; font-size: 13px; }
#fontSize { min-width: 22px; text-align: center; color: var(--mut); }
.savestate { font-size: 12px; color: var(--em-d); font-weight: 600; }
.savestate.saving { color: #d97706; }

/* ── Viewer / pages ──────────────────────────────────────── */
#viewer { flex: 1; overflow-y: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#pages {
  padding: 16px 8px 120px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  /* width:max-content keeps zoomed-in pages fully scrollable (flex centering
     alone makes the left edge unreachable once content overflows) */
  width: max-content; min-width: 100%; box-sizing: border-box;
}

.fab-reset {
  position: fixed; bottom: 24px; right: 16px; z-index: 65;
  background: #fff; color: var(--em-dk); border: 1.5px solid var(--em);
  border-radius: 999px; padding: 12px 18px; font-size: 14px; font-weight: 800;
  box-shadow: 0 10px 28px -12px rgba(16,40,34,.4); cursor: pointer;
}
.fab-reset:active { transform: scale(.95); }

.fab-hist {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 65; display: flex; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px; box-shadow: 0 10px 28px -12px rgba(16,40,34,.4);
}
.fab-hist button {
  width: 52px; height: 46px; border-radius: 999px; border: none;
  background: transparent; color: var(--ink); font-size: 21px; cursor: pointer;
}
.fab-hist button:active { background: var(--bg); }
.fab-hist button:disabled { opacity: .3; }

.fab-mic {
  position: fixed; bottom: 24px; left: 16px; z-index: 65;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399); color: #fff;
  border: none; font-size: 24px; box-shadow: 0 4px 18px rgba(16,185,129,.4);
  cursor: pointer;
}
.fab-mic:active { transform: scale(.93); }

.fab-wiz {
  position: fixed; bottom: 30px; left: 86px; z-index: 65;
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
  border: none; border-radius: 999px; padding: 13px 18px;
  font-size: 14px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 18px rgba(124,58,237,.45);
}
.fab-wiz:active { transform: scale(.95); }

#wizardModal .ezcard { max-width: 720px; }
.wiz-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wiz-head h3 { margin: 0 !important; }
.wiz-voicebtn { background: none; border: none; color: var(--em); font-size: 14px; font-weight: 800; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background .14s; }
.wiz-voicebtn:hover { background: var(--em-soft); }
/* 12-col track: default half (2/row); quarter/third/twothird/full for fine layout. */
#wizFields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; }
.wiz-field { grid-column: span 6; margin: 0 0 13px; min-width: 0; }
.wiz-field.wiz-quarter  { grid-column: span 3; }
.wiz-field.wiz-third    { grid-column: span 4; }
.wiz-field.wiz-half     { grid-column: span 6; }
.wiz-field.wiz-twothird { grid-column: span 8; }
.wiz-field.wiz-full     { grid-column: span 12; }
.wiz-field:has(.wiz-choice), .wiz-field.wiz-wide { grid-column: span 12; }
.wiz-field label { display: block; font-size: 13px; font-weight: 700; color: #0f172a; margin: 0 0 5px; }
.wiz-field input { margin: 0; }
.wiz-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.wiz-note { margin: 2px 0 14px; padding: 10px 13px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; color: #92700f; font-size: 12.5px; line-height: 1.45; }
/* Collapsible conditional field group (e.g. notice address) — smooth reveal. */
.wiz-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; max-height: 520px; opacity: 1; overflow: hidden; transition: max-height .36s cubic-bezier(.22,.61,.36,1), opacity .28s ease, margin .28s ease; }
.wiz-group.wiz-collapsed { max-height: 0; opacity: 0; margin: 0; pointer-events: none; }
/* Stepper: progress dots + step title */
.wiz-stepbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; }
/* on the heading line, the stepper sits to the far right with no extra margins */
.wiz-head .wiz-stepbar { margin: 0 0 0 auto; }
.wiz-dots { display: flex; gap: 6px; }
.wiz-dot { width: 22px; height: 5px; border-radius: 999px; background: #e2e8f0; transition: background .2s; }
.wiz-dot.on { background: var(--em); }
.wiz-dot.done { background: #6ee7b7; }
.wiz-steptitle { font-size: 12.5px; font-weight: 800; color: var(--mut2); letter-spacing: .2px; }
/* Upload-attachment button (e.g. liability insurance) */
.wiz-upload { width: 100%; text-align: left; padding: 12px 14px; border: 1.5px dashed var(--em-tint, #6ee7b7); border-radius: 11px; background: var(--em-soft, #ecfdf5); color: var(--em-dk, #065f46); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .14s, border-color .14s; }
.wiz-upload:hover { background: #d1fae5; border-color: var(--em); }
/* Wizard step slide-in (reuses the picker keyframes) */
#wizFields.step-fwd { animation: stepFwd .3s cubic-bezier(.22,.61,.36,1); }
#wizFields.step-back { animation: stepBack .3s cubic-bezier(.22,.61,.36,1); }
/* Required-field validation highlight */
.wiz-field.wiz-missing input { border-color: #ef4444 !important; background: #fef2f2; }
.wiz-field.wiz-missing label { color: #dc2626; }
.wiz-field.wiz-missing .wiz-choice button { border-color: #fca5a5; }
.wiz-field.wiz-missing label::after { content: " *"; color: #ef4444; font-weight: 800; }
@media (max-width: 560px) { .wiz-field, .wiz-field.wiz-quarter, .wiz-field.wiz-third, .wiz-field.wiz-half, .wiz-field.wiz-twothird, .wiz-field.wiz-full { grid-column: span 12; } }
.wiz-choice button {
  flex: 1; min-width: 90px; padding: 11px; border-radius: 10px;
  border: 1.5px solid #cbd5e1; background: #f8fafc; color: #334155;
  font-weight: 700; cursor: pointer;
}
.wiz-choice button.on { background: #334155; border-color: #334155; color: #fff; }
/* Half-width choice fields sit two-per-row (e.g. Add tenants? / Add landlords?). */
.wiz-field.wiz-half:has(.wiz-choice) { grid-column: span 6; }

.addpagebar {
  position: sticky; bottom: 0; z-index: 50000000;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  padding: 25px 30px; margin-top: 10px;
  background: #fff; border-top: 1px solid #eef1f4;
  box-shadow: 0 -10px 34px -6px rgba(16,40,34,.20);
}
/* Footer action buttons — premium rounded-rectangles, subtle weight */
.fbtn { display: inline-flex; align-items: center; gap: 9px; border-radius: 11px; padding: 13px 24px; font-size: 14px; font-weight: 600; letter-spacing: 0; cursor: pointer; border: 1.5px solid transparent; white-space: nowrap; line-height: 1; transition: filter .14s, box-shadow .14s, background .14s, border-color .14s; }
.fbtn .fi { font-size: 16px; line-height: 1; }
.fbtn:active { transform: scale(.98); }
.fbtn:disabled { opacity: .5; cursor: default; filter: none; box-shadow: none; animation: none; }
/* cute little bounce on hover (footer + placement-bar buttons) */
.fbtn:hover { animation: fbtnBounce .42s cubic-bezier(.28,.84,.42,1); }
/* same cute bounce on the top header nav buttons */
.tb-btn:hover { animation: fbtnBounce .42s cubic-bezier(.28,.84,.42,1); }
@keyframes fbtnBounce {
  0% { transform: translateY(0); }
  28% { transform: translateY(-5px); }
  52% { transform: translateY(0); }
  72% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
.fbtn-ghost { background: #fff; border-color: #dde2e8; color: #3a4654; box-shadow: 0 2px 6px -3px rgba(15,23,42,.18); }
.merge-dd { position: relative; display: inline-flex; }
.merge-caret { font-size: 11px; opacity: .55; margin-left: -3px; transition: transform .15s; }
.merge-dd.open .merge-caret { transform: rotate(180deg); }
.merge-menu { position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 172px; background: #fff; border: 1px solid #dde2e8; border-radius: 13px; box-shadow: 0 20px 46px -14px rgba(15,23,42,.42); padding: 6px; z-index: 2000000001; display: flex; flex-direction: column; gap: 2px; animation: mmpop .14s ease; }
@keyframes mmpop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.merge-menu.hidden { display: none; }
.merge-mi { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-radius: 9px; padding: 11px 13px; font-size: 14px; font-weight: 600; color: #3a4654; cursor: pointer; text-align: left; font-family: inherit; }
.merge-mi:hover { background: #f1f5f4; }
.merge-mi .fi { font-size: 16px; line-height: 1; }

/* ── "＋ Add" dropdown (top bar) — consolidates Text Box / Image / Signature / etc. ── */
.add-dd { position: relative; display: inline-flex; }
.add-caret { font-size: 16px; line-height: 1; opacity: 1; margin-left: 2px; transition: transform .15s; }
.add-dd.open .add-caret { transform: rotate(180deg); }
/* Closed state. The centering translateX(-50%) MUST live inside every transform
   value (open + closed) so the menu never un-centers mid-animation. We animate
   opacity + transform and use visibility (not display:none) so close animates too. */
.addmenu { position: absolute; top: calc(100% + 8px); left: 50%; transform-origin: top center;
  transform: translateX(-50%) translateY(-6px) scale(.97);
  min-width: 226px; background: #fff; border: 1px solid #e2e7ee; border-radius: 14px;
  box-shadow: 0 26px 60px -18px rgba(15,23,42,.45), 0 0 0 1px rgba(15,23,42,.03);
  padding: 7px; z-index: 2000000001; display: flex; flex-direction: column; gap: 1px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .19s cubic-bezier(.2,.85,.25,1), visibility 0s linear .19s; }
.addmenu.open { opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity .15s ease, transform .19s cubic-bezier(.2,.85,.25,1), visibility 0s; }
/* hidden class still hard-hides if ever applied (kept for safety) */
.addmenu.hidden { display: none; }
.addmenu-sec { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #9aa6b2; text-transform: none; padding: 8px 12px 5px; }
.addmenu-div { height: 1px; background: #eef1f5; margin: 6px 8px 2px; }
.addmenu-item { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: none; border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 600; color: #303a46; cursor: pointer; text-align: left; font-family: inherit; transition: background .12s ease; }
.addmenu-item:hover { background: #f1f5f4; }
.addmenu-item .ami-ic { font-size: 16px; line-height: 1; width: 20px; text-align: center; color: #5b6772; flex: 0 0 auto; }
.fbtn-ghost:hover { background: #f6f8fa; border-color: #cbd2db; }
.fbtn-wiz { background: #119a72; color: #fff; box-shadow: 0 6px 16px -8px rgba(17,154,114,.7); }
.fbtn-wiz:hover { filter: brightness(1.06); box-shadow: 0 10px 20px -8px rgba(17,154,114,.85); }
.fbtn-fill { background: #1fae63; color: #fff; box-shadow: 0 6px 16px -8px rgba(31,174,99,.7); }
.fbtn-fill:hover { filter: brightness(1.06); box-shadow: 0 10px 20px -8px rgba(31,174,99,.85); }
.fbtn-gold { background: #fff; border-color: #e0b13a; color: #8a6a1e; box-shadow: 0 2px 6px -3px rgba(212,160,23,.3); }
.fbtn-gold .fi { color: #d4a017; }
.fbtn-gold:hover { background: #fffbf0; box-shadow: 0 0 0 2px rgba(212,160,23,.18); }
.fbtn-orange { background: #e0871e; color: #fff; box-shadow: 0 6px 16px -8px rgba(224,135,30,.7); }
.fbtn-orange:hover { filter: brightness(1.06); box-shadow: 0 10px 20px -8px rgba(224,135,30,.85); }
/* Same emerald as the ＋ Add button (var(--em)) — used by the Send for Signing button. */
.fbtn-green { background: var(--em); color: #fff; box-shadow: 0 6px 16px -8px rgba(16,185,129,.7); }
.fbtn-green:hover { background: var(--em-d); filter: brightness(1.02); box-shadow: 0 10px 20px -8px rgba(16,185,129,.85); }
/* Desktop: footer is a full-width bar that sits OVER the Pages sidebar + guided-fill
   sidebar (both end above it); modals (2e9) still cover it. */
@media (min-width: 621px) {
  .addpagebar { position: fixed; left: 0; right: 0; bottom: 0; margin-top: 0; z-index: 1800000000; }
  .page-sidebar { bottom: var(--footer-h); }
  .gfx-panel { bottom: var(--footer-h) !important; }
  #pages { padding-bottom: calc(var(--footer-h) + 48px); }
}

/* ── Floating control dock: page-nav + zoom + undo/redo, hovering over the
   white footer (desktop). Repositions the EXISTING #moreTools node via CSS
   only — no DOM moves, no JS changes. Mobile (≤760px) keeps the ⋯ popover. ── */
@media (min-width: 761px) {
  #topbar .more-btn { display: none !important; }
  #moreTools {
    display: flex !important;
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--footer-h) - 18px);     /* lower edge overlaps the footer top */
    z-index: 1900000000;                        /* above every footer bar (footer + placebar = 1.8e9) */
    align-items: center; gap: 4px;
    padding: 8px 15px; margin: 0;
    background: #1e2a3d;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    box-shadow: 0 16px 36px -12px rgba(8,15,30,.6);
    color: #fff;
  }
  #moreTools .pagenav,
  #moreTools .zoomctl,
  #moreTools .hist-tb { display: flex; align-items: center; gap: 5px; }
  /* thin divider before zoom + before undo/redo groups */
  #moreTools .zoomctl, #moreTools .hist-tb { position: relative; margin-left: 8px; padding-left: 12px; }
  #moreTools .zoomctl::before, #moreTools .hist-tb::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 1px; height: 18px; background: rgba(255,255,255,.14);
  }
  #moreTools .pagenav { color: #cdd8e6; font-size: 15px; }
  #moreTools .pagenav input {
    width: 46px; text-align: center; background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 7px; padding: 4px 5px; font-size: 15px;
  }
  #moreTools #pageCount { color: #93a3b8; font-size: 15px; }
  #moreTools #zoomPct { color: #cdd8e6; font-size: 15px; min-width: 46px; text-align: center; }
  #moreTools .tb-btn.sq {
    background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
    color: #fff; border-radius: 8px; min-width: 30px; padding: 5px 8px; font-size: 16px;
  }
  #moreTools .tb-btn.sq:hover { background: rgba(255,255,255,.2); }
  #moreTools .hist-tb { background: transparent !important; border: none !important; }
  #moreTools .hist-tb button {
    background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
    color: #fff; border-radius: 8px; min-width: 30px; padding: 5px 9px; font-size: 16px;
  }
  #moreTools .hist-tb button:hover:not(:disabled) { background: rgba(255,255,255,.2); }
  #moreTools .hist-tb button:disabled { opacity: .38; }
}
.addpagebar .df-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addpagebar .df-right { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
/* Save / sign / download → bordered icon-over-label cards (match the mobile design) */
.addpagebar .df-right .tb-btn {
  flex-direction: column; gap: 5px; padding: 11px 10px; min-width: 96px; border-radius: 14px;
  background: #fff !important; border: 1px solid var(--line) !important; color: var(--ink) !important;
  box-shadow: none !important; font-size: 11.5px; font-weight: 700;
}
.addpagebar .df-right .tb-btn:hover { border-color: var(--em-tint) !important; box-shadow: 0 6px 16px -8px rgba(15,23,42,.22) !important; transform: none; }
.addpagebar .df-right .dfi { font-size: 22px; line-height: 1; }
.addpagebar .df-right .lbl { display: block; white-space: nowrap; }
@media (max-width: 620px) {
  .addpagebar { justify-content: center; gap: 10px; }
  .addpagebar .df-left { width: 100%; }
  .addpagebar .df-left .ap-btn { flex: 1; text-align: center; }
  .addpagebar .df-right { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .addpagebar .df-right .tb-btn { min-width: 0; }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE BOTTOM SHEET (≤620px) — iOS-style rounded tool palette.
   Repositions the EXISTING DOM (.tb-center + #addPageBar) with CSS
   only; no nodes moved, no ids/classes renamed, no JS behavior change.
   Stacking (bottom→top): tool row (.tb-center) at bottom:0, then the
   pills + cards (#addPageBar) stacked directly above it as one
   continuous white sheet. z-index 5e7 = above page elements
   (~1e6 max) but below topbar/placebar (1e9) and modals (2e9).
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 620px) {
  :root { --sheet-tool-h: 78px; }   /* height reserved for the bottom tool row */

  /* — Top bar shrinks to brand + Saved + account — */
  #topbar { gap: 6px; padding: 8px 10px; flex-wrap: nowrap; }
  #topbar .tb-left { flex: 1 1 auto; justify-content: flex-start; min-width: 0; }
  #topbar .tb-right { display: flex !important; flex: 0 0 auto; }   /* re-show account (760px hid it) */
  #topbar .brand { font-size: 14px; }

  /* — Tool row → fixed rounded bottom sheet, icon-over-label — */
  .tb-center {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50000000;
    flex: 0 0 auto !important; flex-wrap: nowrap; justify-content: flex-start;
    gap: 4px; margin: 0;
    height: var(--sheet-tool-h);
    padding: 14px 12px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px -14px rgba(15,40,34,.4);
    overflow-x: auto; overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  /* grey drag-handle pill centered at the very top of the sheet */
  .tb-center::before {
    content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    width: 38px; height: 4px; border-radius: 999px; background: #d6ded9;
  }
  /* #btnOpen + the #docTools row both flow as columns in one scroll strip */
  .tb-center > #btnOpen,
  .tb-center .doc-tools { flex: 0 0 auto; }
  .doc-tools { flex-wrap: nowrap !important; gap: 4px; justify-content: flex-start; }

  /* each tool = icon over a small label */
  .tb-center .tb-btn {
    flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-width: 56px; padding: 4px 6px;
    font-size: 19px; line-height: 1.05;
    background: transparent !important; border-color: transparent !important;
    color: var(--ink) !important; box-shadow: none !important;
  }
  .tb-center .tb-btn.primary,
  .tb-center .tb-btn.more-btn { background: transparent !important; color: var(--ink) !important; }
  .tb-center .tb-btn.primary.on,
  #topbar .tb-center #btnTextSelect.ts-on {
    background: var(--em-soft) !important; border-radius: 12px;
    color: var(--em-dk) !important; box-shadow: 0 0 0 1.5px rgba(16,185,129,.3) !important;
  }
  /* show the labels again (560px rule hides them) — small caption under the icon */
  .tb-center .tb-btn .lbl {
    display: block !important; font-size: 10px; font-weight: 600;
    color: var(--mut); white-space: nowrap; line-height: 1;
  }
  .more-btn { display: inline-flex !important; }   /* keep "More" available */

  /* More popover + select-tools must open UPWARD, clear of the sheet.
     .tb-center is now their fixed offset parent, so bottom-anchor them. */
  .more-tools {
    position: absolute; bottom: calc(100% + 10px); top: auto;
    right: 10px; left: auto; z-index: 51000000;
    flex-direction: column; align-items: stretch; gap: 9px; padding: 11px;
    background: #16243a; border: 1px solid rgba(255,255,255,.12); border-radius: 13px;
    box-shadow: 0 22px 48px -16px rgba(0,0,0,.65);
  }
  #topbar.more-open .more-tools { display: flex; }
  .seltools {
    position: absolute; bottom: calc(100% + 10px); top: auto;
    left: 50%; transform: translateX(-50%); z-index: 51000000;
    background: #fff; border: 1px solid var(--line); border-radius: 13px;
    padding: 8px 10px; box-shadow: 0 22px 48px -16px rgba(15,40,34,.4);
    gap: 6px; flex-wrap: nowrap;
  }

  /* — #addPageBar → fixed, stacked directly ABOVE the tool row; pills wrap 2-up — */
  .addpagebar {
    position: fixed; left: 0; right: 0; bottom: var(--sheet-tool-h); top: auto;
    z-index: 50000000; margin: 0;
    display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 8px;
    padding: 12px 12px 10px;
    background: #fff;
    border-top: none; border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px -16px rgba(15,40,34,.28);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .addpagebar .fbtn { flex: 1 1 calc(50% - 8px); justify-content: center; padding: 10px 8px; font-size: 12.5px; }

  /* keep document content clear of the fixed sheet (footer pills + tool row). */
  #pages { padding-bottom: calc(var(--sheet-tool-h) + 230px); }
  #landing { padding-bottom: calc(var(--sheet-tool-h) + 80px); }
}

/* Undo/redo, now inline in the top toolbar */
.hist-tb { display: inline-flex; gap: 2px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.hist-tb.hidden { display: none; }
.hist-tb button { width: 34px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--ink); font-size: 16px; cursor: pointer; }
.hist-tb button:active { background: var(--line2); }
.hist-tb button:disabled { opacity: .3; cursor: default; }
.addpagebar .apb-label { color: var(--mut); font-size: 13.5px; font-weight: 700; }
.ap-btn {
  background: #fff; color: var(--em-dk); border: 1.5px solid var(--em);
  border-radius: 999px; padding: 10px 16px; font-size: 13.5px; font-weight: 800; cursor: pointer;
  transition: background .14s ease, box-shadow .14s ease;
}
.ap-btn:hover { background: var(--em-soft); box-shadow: 0 0 0 2px rgba(16,185,129,.16); }
.ap-btn:active { transform: scale(.96); }
.ap-paste { background: #fff; color: #6d28d9; border-color: #7c3aed; }
.ap-paste:hover { background: #f5f3ff; box-shadow: 0 0 0 2px rgba(124,58,237,.16); }
.ap-merge { background: #fff; color: var(--em-dk); border-color: var(--em); }
.ap-merge:hover { background: var(--em-soft); box-shadow: 0 0 0 2px rgba(16,185,129,.16); }
/* Fill by talking — the standout footer action that reopens the guided wizard */
.ap-talk { position: relative; background: linear-gradient(135deg,#10b981,#059669); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(16,185,129,.8); }
.ap-talk:hover { background: linear-gradient(135deg,#10b981,#059669); filter: brightness(1.06); box-shadow: 0 12px 24px -10px rgba(16,185,129,.9); }
/* fly-down-and-slam entrance when the user dismisses the "fields ready" card */
.ft-slam { animation: ft-slam .62s cubic-bezier(.18,.7,.2,1.05); transform-origin: bottom center; }
@keyframes ft-slam {
  0%   { opacity: 0; transform: translateY(-300px) scale(1.3); }
  55%  { opacity: 1; transform: translateY(0) scale(1.3); }
  70%  { transform: translateY(0) scale(.82, 1.2); }
  84%  { transform: translateY(0) scale(1.08, .92); }
  100% { transform: translateY(0) scale(1); }
}
.ft-slam::after { content: ""; position: absolute; inset: -2px; border-radius: 999px; pointer-events: none; animation: ft-ring .62s ease-out; }
@keyframes ft-ring {
  0%, 52% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
  60%     { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  100%    { box-shadow: 0 0 0 26px rgba(16,185,129,0); }
}
@media (prefers-reduced-motion: reduce) { .ft-slam, .ft-slam::after { animation: none; } }

/* Mic FAB removed — the footer "Fill by talking" button replaces it */
.fab-mic { display: none !important; }
.merge-selall { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; transition: background .14s; }
.merge-selall:hover { background: var(--em-soft); border-color: var(--em-tint); }
.merge-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; max-height: 320px; overflow-y: auto; margin: 10px 0 14px; padding: 4px 2px; }
.mthumb { position: relative; padding: 0; border: 2px solid var(--line); border-radius: 9px; overflow: hidden; cursor: pointer; background: #f1f5f9; transition: border-color .12s, box-shadow .12s, opacity .12s; }
.mthumb canvas { width: 100%; display: block; }
.mthumb:not(.on) { opacity: .5; }
.mthumb.on { border-color: var(--em); box-shadow: 0 0 0 2px rgba(16,185,129,.22); }
.mthumb-num { position: absolute; top: 5px; left: 5px; background: rgba(15,23,42,.72); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.mthumb-chk { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; border-radius: 50%; background: var(--em); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.mthumb.on .mthumb-chk { opacity: 1; }
.merge-after { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.merge-after select { flex: 1; padding: 11px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; color: #0f172a; background: #fff; }

.imgbox { position: absolute; box-sizing: border-box; outline: 1.5px solid rgba(16,185,129,.55); z-index: 8; }
.imgbox img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; user-select: none; cursor: move; touch-action: none; }
.imgbox .img-scalehint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 10; pointer-events: none; background: rgba(15,23,42,.78); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .2px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
/* Toolbar sits just above the box (not over the center) so it never covers the
   image/signature. The 8px gap is TRANSPARENT PADDING that belongs to the bar's
   hover area — so moving the cursor from the image up to the bar never crosses a
   dead zone that would hide it. */
.imgbox .ib-bar { position: absolute; top: 0; left: 50%; transform: translate(-50%, -100%); padding-bottom: 8px; display: flex; flex-wrap: nowrap; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .14s; z-index: 12; }
/* Toolbar buttons never shrink/wrap — the bar is always one line / fixed height, even on tiny initials. */
.imgbox .ib-bar button { flex: 0 0 auto; white-space: nowrap; }
.imgbox .ib-mod { background: #eef2f6; color: #1f2a37; border: none; border-radius: 6px; font-size: 12px; line-height: 1; padding: 5px 9px; cursor: pointer; display: inline-flex; align-items: center; font-weight: 700; white-space: nowrap; transition: filter .12s ease, box-shadow .12s ease; }
/* Fallback: too close to the page top → flip the toolbar below the box (gap padding on top instead). */
.imgbox.ib-bar-below .ib-bar { top: 100%; transform: translate(-50%, 0); padding-bottom: 0; padding-top: 8px; }
.imgbox:hover .ib-bar, .imgbox .ib-bar:hover { opacity: 1; pointer-events: auto; }
.imgbox .ib-grip, .imgbox .ib-del, .imgbox .ib-link, .imgbox .ib-vid, .imgbox .ib-dup, .imgbox .ib-up, .imgbox .ib-down { border: none; color: #fff; border-radius: 6px; font-size: 12px; line-height: 1; padding: 5px 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; transition: filter .12s ease, box-shadow .12s ease; }
.imgbox .ib-up, .imgbox .ib-down { background: #334155; font-weight: 800; }
/* Subtle bouncy + lighter-background hover on the image/signature toolbar icons.
   fbtnBounce is a translateY bounce (no scale), safe on these flex buttons. */
.imgbox .ib-bar button:hover { filter: brightness(1.13); box-shadow: 0 4px 12px -4px rgba(0,0,0,.4); animation: fbtnBounce .42s cubic-bezier(.28,.84,.42,1); }
/* Rotate handles are positioned with transforms, so a transform bounce would
   un-center them — give them a transform-free lift instead. */
.imgbox .ib-rot { transition: background .12s ease, box-shadow .12s ease, filter .12s ease; }
.imgbox .ib-rot:hover { background: var(--em-dk); filter: brightness(1.1); box-shadow: 0 3px 10px -3px rgba(0,0,0,.5); }
.imgbox .ib-dup { background: #0f766e; }
.imgbox .ib-grip { background: #0f172a; cursor: move; touch-action: none; }
.imgbox .ib-del { background: #b91c1c; }
.imgbox .ib-link { background: #0891b2; }
.imgbox .ib-vid { background: #7c3aed; }
.imgbox.has-url .ib-link { background: #15803d; }
.imgbox.has-video .ib-vid { background: #b45309; }
/* subtle badge so it's obvious an image carries a link */
.imgbox.has-url::after { content: "🔗"; position: absolute; left: 6px; bottom: 6px; font-size: 18px; opacity: .4; pointer-events: none; }
/* clickable play overlay shown on images that carry a video */
.imgbox .ib-playbtn { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff;
  font-size: 19px; cursor: pointer; align-items: center; justify-content: center; padding-left: 3px; }
.imgbox.has-video .ib-playbtn { display: flex; }
.imgbox .ib-playbtn:hover { background: rgba(0,0,0,.78); }

/* Video player popup */
.video-wrap { position: relative; width: min(92vw, 920px); }
.video-close { position: absolute; top: -42px; right: 0; background: rgba(255,255,255,.16); color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.video-frame-box { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.video-frame-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.imgbox .ib-resize { position: absolute; right: -8px; bottom: -8px; width: 17px; height: 17px; background: #10b981; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; touch-action: none; }
/* Edge-midpoint rotate handles — appear on hover; grab to spin (snaps 45°, Shift = free). */
.imgbox .ib-rot { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #0f172a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; cursor: grab; opacity: 0; transition: opacity .12s; z-index: 11; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.imgbox:hover .ib-rot, .imgbox .ib-rot:active { opacity: 1; }
.imgbox .ib-rot:active { cursor: grabbing; }
.imgbox .ib-rot-t { top: -12px; left: 50%; transform: translateX(-50%); }
.imgbox .ib-rot-b { bottom: -12px; left: 50%; transform: translateX(-50%); }
.imgbox .ib-rot-l { left: -12px; top: 50%; transform: translateY(-50%); }
.imgbox .ib-rot-r { right: -12px; top: 50%; transform: translateY(-50%); }

.signpad { width: 100%; height: 200px; display: block; margin: 0 0 12px; background: #fff; border: 1px dashed #94a3b8; border-radius: 12px; touch-action: none; cursor: crosshair; }
.arrears-ta {
  width: 100%; min-height: 200px; resize: vertical; box-sizing: border-box;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5;
  padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; margin: 0 0 12px; color: #0f172a;
}
.page-extra { outline: 2px dashed #7c3aed55; }
.page-del {
  position: absolute; top: 6px; right: 6px; z-index: 6;
  background: rgba(185,28,28,.92); color: #fff; border: none;
  border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 500; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .12s;
}
.page:hover .page-del { opacity: 1; pointer-events: auto; }
.page-del:active { transform: scale(.95); }

/* Pages sidebar */
.page-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sbw); z-index: 60;
  background: #fff; border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .18s ease;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px -16px rgba(16,40,34,.3);
}
body.sidebar-open .page-sidebar { transform: none; }
body.sidebar-open #viewer { margin-left: var(--sbw); }
/* keep the logo flush to the very left edge even while the Pages panel is open */
body.sidebar-open #topbar { padding-left: 0; }

/* Mobile: the Pages sidebar FLOATS over the PDF (no shrinking / reflow). */
.sb-backdrop { display: none; }
@media (max-width: 760px) {
  body.sidebar-open #viewer { margin-left: 0; }            /* PDF keeps full size behind it */
  body.sidebar-open #topbar { padding-left: 6px; }
  .page-sidebar { width: min(84vw, 320px); box-shadow: 8px 0 34px -8px rgba(0,0,0,.45); }
  .sb-resize { display: none; }                            /* no drag-resize on mobile */
  body.sidebar-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(15,27,46,.45); }
}
body.sb-resizing { cursor: ew-resize; user-select: none; }
body.sb-resizing .page-sidebar { transition: none; }

/* drag handle on the sidebar's right edge */
.sb-resize {
  position: absolute; top: 0; right: -3px; bottom: 0; width: 12px; z-index: 62;
  cursor: ew-resize; display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.sb-resize::before { content: ""; position: absolute; top: 0; bottom: 0; right: 5px; width: 2px; background: var(--line); transition: background .14s ease; }
.sb-resize:hover::before, body.sb-resizing .sb-resize::before { background: var(--em); }
.sb-grip {
  position: relative; z-index: 1; background: #fff; border: 1px solid var(--line2);
  color: var(--mut); border-radius: 7px; width: 18px; height: 38px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  box-shadow: 0 4px 12px -6px rgba(16,40,34,.4); transition: color .14s ease, border-color .14s ease;
}
.sb-resize:hover .sb-grip, body.sb-resizing .sb-grip { color: var(--em-dk); border-color: var(--em); }

/* Smart Form Tools — collapsible LTB Automation Suite panel (forms only) */
.sft { border-bottom: 1px solid var(--line); padding: 10px 12px 12px; background: var(--em-soft); }
.sft > summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 12.5px; color: var(--em-dk); display: flex; align-items: center; gap: 6px; padding: 4px 2px; letter-spacing: .02em; }
.sft > summary::-webkit-details-marker { display: none; }
.sft > summary::after { content: "▾"; margin-left: auto; color: var(--em-d); transition: transform .15s ease; }
.sft[open] > summary::after { transform: rotate(180deg); }
.sft-body { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.sft-btn { width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--em); color: var(--em-dk); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .14s ease, box-shadow .14s ease, transform .08s ease; }
.sft-btn:hover { background: var(--em-soft); box-shadow: 0 0 0 2px rgba(16,185,129,.16); }
.sft-btn:active { transform: scale(.97); }
.sft-btn.paste { border-color: #7c3aed; color: #6d28d9; }
.sft-btn.paste:hover { background: #f5f3ff; box-shadow: 0 0 0 2px rgba(124,58,237,.16); }
.ps-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px; color: var(--ink); font-weight: 800; font-size: 14px; }
.ps-close { background: none; border: none; color: var(--mut); font-size: 15px; cursor: pointer; }
.ps-hint { padding: 0 12px 8px; color: var(--mut2); font-size: 11px; line-height: 1.4; }
.thumb-list { flex: 1; overflow-y: auto; padding: 6px 8px 80px; display: flex; flex-direction: column; gap: 8px; }
.thumb {
  position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: flex; flex-direction: column; align-items: center; cursor: grab;
  touch-action: none; user-select: none;
}
.thumb:active { cursor: grabbing; }
/* dragged thumb lifts off the list — scaled, shadowed, riding above its neighbours */
.thumb.dragging {
  outline: 2px solid var(--em); cursor: grabbing; z-index: 6;
  transform: scale(1.045);
  box-shadow: 0 20px 44px -12px rgba(4,47,46,.55), 0 4px 12px -4px rgba(4,47,46,.35);
  transition: transform .16s cubic-bezier(.22,.61,.36,1), box-shadow .16s ease;
}
/* the dark "hold & drag" overlay stays up the WHOLE time — pressing AND dragging */
.thumb.pressing::after,
.thumb.dragging::after {
  content: "HOLD & DRAG TO CHANGE ORDER";
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 14px; border-radius: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; line-height: 1.4;
  color: #fff; background: rgba(4,47,46,.62);
  pointer-events: none; animation: thumbhint .12s ease;
}
.thumb.dragging::after { content: "RELEASE TO DROP HERE"; background: rgba(4,47,46,.74); }
/* little settle-pop when it lands */
.thumb.landed { animation: thumbLand .32s cubic-bezier(.22,.9,.32,1.2); }
@keyframes thumbLand { 0% { transform: scale(1.045); } 45% { transform: scale(.975); } 100% { transform: scale(1); } }
@keyframes thumbhint { from { opacity: 0; } to { opacity: 1; } }
.thumb .th-canvas { width: 100%; height: auto; border: 1px solid var(--line2); border-radius: 4px; background: #fff; pointer-events: none; }
.thumb .th-num { position: absolute; top: 4px; left: 6px; background: var(--em-dk); color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 1px 6px; z-index: 2; }
.thumb .th-handle { position: absolute; top: 4px; right: 6px; color: var(--mut2); font-size: 15px; cursor: grab; touch-action: none; z-index: 2; padding: 0 2px; }
.thumb .th-label { margin-top: 4px; color: var(--mut); font-size: 11px; font-weight: 700; }
.thumb .th-del { position: absolute; bottom: 6px; right: 6px; background: rgba(185,28,28,.92); color: #fff; border: none; border-radius: 9px; font-size: 24px; line-height: 1; padding: 6px 12px; cursor: pointer; z-index: 3; opacity: 0; transition: opacity .14s, transform .12s, background .12s; }
.thumb:hover .th-del { opacity: 1; }
.thumb .th-del:hover { background: rgba(185,28,28,1); transform: scale(1.08); }
/* Extract this page as its own PDF — appears on hover, bottom-left */
.thumb .th-extract { position: absolute; bottom: 6px; left: 6px; z-index: 3; opacity: 0; transition: opacity .14s, transform .12s, background .12s; display: inline-flex; align-items: center; gap: 4px; background: #0f766e; color: #fff; border: none; border-radius: 9px; font-size: 12px; font-weight: 700; padding: 8px 11px; cursor: pointer; white-space: nowrap; box-shadow: 0 5px 14px -5px rgba(4,47,46,.55); }
.thumb:hover .th-extract { opacity: 1; }
.thumb .th-extract:hover { background: #0b5d56; transform: translateY(-1px); }
.fab-mic.rec { background: linear-gradient(135deg, #b91c1c, #ef4444); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5);} 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0);} }

.vtranscript {
  min-height: 90px; max-height: 200px; overflow-y: auto;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 12px; font-size: 14.5px; color: #0f172a; line-height: 1.5; margin-bottom: 6px;
}
.vtranscript .interim { color: #94a3b8; }

.rv-field { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rv-field label { flex: 0 0 38%; font-size: 12.5px; font-weight: 700; color: #334155; }
.rv-field input { flex: 1; margin-bottom: 0 !important; }
.rv-field .rv-skip { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 15px; }
.rv-note { font-size: 11.5px; color: #b45309; margin: -4px 0 8px 38%; }
.rv-unplaced { font-size: 11.5px; color: #64748b; margin: -4px 0 8px 38%; }
.rv-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px; }

.page {
  position: relative; background: #fff;
  box-shadow: 0 6px 22px -10px rgba(16,40,34,.28), 0 0 0 1px rgba(16,40,34,.04);
  flex-shrink: 0;
}
.page canvas { display: block; width: 100%; height: 100%; }
.page .pageno {
  position: absolute; top: -1px; left: -1px; background: #0f172acc; color: #cbd5e1;
  font-size: 10px; padding: 2px 7px; border-radius: 0 0 8px 0; pointer-events: none;
}
.overlay { position: absolute; inset: 0; }

/* ── Selectable text layer (🔤 Select text) ──────────────────────────────── */
.text-layer { position: absolute; inset: 0; overflow: hidden; line-height: 1; text-align: initial; pointer-events: none; z-index: 7; }
.text-layer span { position: absolute; white-space: pre; color: transparent; transform-origin: 0 0; cursor: text; }
.text-layer span::selection { background: rgba(45,212,191,.45); }
body.textselect .text-layer { pointer-events: auto; }
body.textselect .overlay { pointer-events: none; }      /* let selection through to the text layer */
body.textselect .page { cursor: text; }
/* Active "Highlight Text" mode — clearly filled so it's obvious you're in highlighting mode. */
#topbar #btnTextSelect.ts-on { background: #f59e0b; border-color: #f59e0b; color: #1f1300; font-weight: 700; box-shadow: 0 0 0 2px rgba(245,158,11,.4); }
#topbar #btnTextSelect.ts-on:hover { background: #fbbf24; border-color: #fbbf24; color: #1f1300; }
body.drawmode .overlay, body.placing .overlay { cursor: crosshair; touch-action: none; }

/* ── Text boxes ──────────────────────────────────────────── */
/* Fillable text boxes: a subtle green tint + green dashed outline so empty
   "type here" zones stand out against the document (was a faint grey dash). */
.tbox {
  position: absolute; background: rgba(16,185,129,.06);
  outline: 1.5px dashed rgba(16,185,129,.45);
  border-radius: 2px;
}
.tbox.sel { outline: 2px solid var(--em); background: rgba(16,185,129,.05); z-index: 5; }
.tbox-text {
  width: 100%; height: 100%; outline: none; overflow: hidden;
  color: #111; line-height: 1.25; padding: 2px 3px;
  word-break: break-word; white-space: pre-wrap; cursor: text;
}
.tbox-bar {
  position: absolute; top: -30px; left: -2px; display: none; align-items: center; gap: 4px;
}
.tbox.sel .tbox-bar { display: flex; }
.tbox-grip, .tbox-del, .tbox-dup, .tbox-shape, .tbox-fill, .tbox-fg, .tbox-up, .tbox-down {
  width: 28px; height: 26px; border-radius: 7px; border: none; font-size: 13px;
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.tbox-grip { background: var(--em); color: #fff; cursor: grab; touch-action: none; }
.tbox-up, .tbox-down { background: #334155; color: #fff; cursor: pointer; font-weight: 800; }
.tbox-up:hover, .tbox-down:hover { filter: brightness(1.2); }
.tbox-del  { background: var(--danger); color: #fff; cursor: pointer; }
.tbox-dup  { background: var(--em-dk); color: #fff; cursor: pointer; }
.tbox-shape { background: #475569; color: #fff; cursor: pointer; }
.tbox-fill  { background: #0891b2; color: #fff; cursor: pointer; }
.tbox-fg    { background: #7c3aed; color: #fff; cursor: pointer; font-weight: 800; }
/* a box given a fill colour or circle shape gets a real border so the shape reads
   (outline can't follow border-radius) */
.tbox.tbox-styled { outline: none; border: 1px solid rgba(100,116,139,.55); }
.tbox.tbox-styled.sel { border-color: var(--em); box-shadow: 0 0 0 2px rgba(16,185,129,.18); }
/* colour modal swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; transition: transform .1s; }
.swatch:hover { transform: scale(1.1); }
.colorrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.colorrow input[type=color] { width: 44px; height: 36px; padding: 0; border: 1px solid #cbd5e1; border-radius: 8px; background: none; cursor: pointer; }
.colorrow-lbl { flex: 1; font-size: 13.5px; color: #64748b; }
.tbox-resize {
  position: absolute; right: -9px; bottom: -9px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--em); border: 2px solid #fff;
  cursor: nwse-resize; display: none; touch-action: none;
}
.tbox.sel .tbox-resize { display: block; }
.ghostbox { position: absolute; background: #14b8a622; outline: 2px dashed var(--em); pointer-events: none; z-index: 9; }

/* ── Landing (editor start screen) ───────────────────────── */
/* ════════════════════════════════════════════════════════════════
   LANDING REDESIGN — homepage-style white nav + premium 2×2 card grid
   ════════════════════════════════════════════════════════════════ */
body.landing-mode, body.landing-mode #viewer { background: #fff; }
/* swap chrome: on the landing the dark topbar is hidden and the white nav shows
   (explicit rules beat the .hidden class, which can't override an #id selector) */
#landingNav { display: none; }
body.landing-mode #landingNav { display: block; }
body.landing-mode #topbar { display: none !important; }

/* White homepage nav (shown only on the landing) */
.lnav { position: sticky; top: 0; z-index: 1000000000; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lnav-wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; gap: 24px; }
.lnav-brand { display: flex; align-items: center; gap: 10px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; cursor: pointer; }
.lnav-logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#059669,#34d399); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 6px 16px -6px rgba(16,185,129,.6); }
.lnav-brand .ez { color: var(--em-dk); }
.lnav-links { display: flex; align-items: center; gap: 24px; margin-left: 6px; font-size: 14.5px; font-weight: 500; }
.lnav-links a { color: var(--mut); text-decoration: none; transition: color .15s; }
.lnav-links a:hover { color: var(--ink); }
.lnav-space { flex: 1; }
.lnav-dd { position: relative; }
.lnav-dd-btn { background: none; border: none; font-family: inherit; font-size: 14.5px; font-weight: 500; color: var(--mut); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 5px; }
.lnav-dd-btn:hover { color: var(--ink); }
.dd-caret { font-size: 10px; }
.lnav-dd-menu { position: absolute; top: calc(100% + 14px); left: -12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(16,40,34,.4); padding: 6px; min-width: 165px; z-index: 60; display: flex; flex-direction: column; }
.lnav-dd-menu.hidden { display: none; }
.lnav-dd-menu a { padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.lnav-dd-menu a:hover { background: var(--em-soft); color: var(--em-dk); }
.lnav-convert .lnav-conv-ic { font-size: 14px; }
.lnav-convert.hidden { display: none; }
.lbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 11px; font-weight: 600; font-size: 14.5px; padding: 10px 17px; cursor: pointer; border: 1px solid transparent; transition: transform .16s, box-shadow .16s, background .16s, border-color .16s; font-family: inherit; line-height: 1; }
.lbtn-primary { background: linear-gradient(135deg,#10b981,#059669); color: #fff; box-shadow: 0 10px 22px -10px rgba(16,185,129,.7); }
.lbtn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(16,185,129,.85); }
.lbtn-ghost { background: #fff; border: 1px solid var(--line2); color: var(--ink); }
.lbtn-ghost:hover { background: #f6f8f7; border-color: var(--mut2); }
.lnav-acct.is-in { border-color: var(--em-tint); background: var(--em-soft); color: var(--em-dk); }
/* Tighter spacing between the 3 right-side nav buttons (Convert / Open PDF / Sign in): halve the 24px wrap gap */
@media (min-width: 561px) { .lnav-wrap #lnavUpload, .lnav-wrap .acct-wrap { margin-left: -12px; } }
/* Pro: crown badge + gold treatment on the account button */
.pro-crown { display: none; }
body.is-pro .acct-ic { display: none; }
body.is-pro .pro-crown { display: inline; filter: drop-shadow(0 1px 2px rgba(180,120,0,.4)); }
body.is-pro .lnav-acct { background: linear-gradient(135deg,#fffaf0,#fdf0c9) !important; border-color: #f0c64f !important; color: #8a5a00 !important; box-shadow: 0 6px 16px -8px rgba(234,179,8,.55); }
body.is-pro #lnavAcctLbl, body.is-pro #acctLbl { font-weight: 700; }
body.is-pro #topbar .acct-btn { background: linear-gradient(135deg, rgba(234,179,8,.24), rgba(234,179,8,.1)); border-color: rgba(234,179,8,.6); color: #fde68a; }
/* Account quick-jump dropdown */
.acct-wrap { position: relative; }
.acct-caret { font-size: 11px; opacity: .65; margin-left: 1px; }
.acct-menu { position: fixed; min-width: 234px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 24px 56px -18px rgba(16,40,34,.42); padding: 6px; z-index: 1000000050; animation: amPop .16s ease; }
.acct-menu.hidden { display: none; }
@keyframes amPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.am-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; font-family: inherit; }
.am-item:hover { background: var(--em-soft); color: var(--em-dk); }
.am-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.am-account { color: var(--mut); }
.am-signout { color: #b91c1c; }
.am-signout:hover { background: #fef2f2; color: #dc2626; }
/* Mobile: account button = profile icon (+ crown if Pro) only */
@media (max-width: 600px) {
  #lnavAcctLbl, .acct-caret { display: none; }
  .lnav-acct { padding: 9px 12px; }
  .acct-menu { min-width: 210px; }
}
/* Mobile landing: let the drop card size to content so drag & drop renders cleanly */
@media (max-width: 560px) {
  #landing.lstage { padding: 16px 12px 70px; }
  .lcard { padding: 16px; }
  .lcard-drop, #recentFilesCard { min-height: auto; }
  #dropzone { padding: 26px 14px; }
  .dz-text { font-size: 17px; }
  .lgrid, .lgrid-sig { gap: 14px; }
}
@media (max-width: 860px) { .lnav-links { display: none; } }
@media (max-width: 560px) { .lnav-wrap { gap: 10px; padding: 0 14px; } .lnav-brand span:last-child { display: none; } }

/* Landing stage + faded intro line */
#landing.lstage { max-width: 1140px; margin: 0 auto; padding: 19px 24px 72px; color: var(--ink); }
.lintro { color: var(--mut2); font-size: 14px; line-height: 1.6; max-width: none; margin: 0 0 22px; }
.lintro b { color: var(--em-dk); font-weight: 700; }

/* CONVERT ANYTHING carousel — identical to the homepage (auto-scroll marquee) */
.appcar { margin: 0 0 13px; }
.appcar-h { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(18px,2.4vw,24px); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--em-dk); text-align: center; margin: 0 0 14px; }
.cvcar { position: relative; overflow: hidden; }
.cvtrack { display: flex; gap: 12px; width: max-content; padding: 4px 2px; animation: cvscroll 120s linear infinite; will-change: transform; }
.cvcar:hover .cvtrack { animation-play-state: paused; }
@keyframes cvscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cvcard { flex: 0 0 auto; width: 206px; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; text-decoration: none; color: var(--ink); box-shadow: 0 14px 30px -24px rgba(16,40,34,.4); transition: transform .15s, border-color .15s, box-shadow .15s; }
.cvcard:hover { transform: translateY(-2px); border-color: var(--em); box-shadow: 0 18px 40px -20px rgba(16,185,129,.45); }
.cvcard-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 8px 18px -8px rgba(16,40,34,.45); }
.cvcard-t { font-weight: 800; font-size: 14.5px; flex: 1; line-height: 1.18; }
.cvcard-tok { color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .03em; font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1; }

/* Quick PDF tool buttons (above the grid) with a premium hover bounce */
.ltools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 0 0 22px; }
@media (max-width: 1100px) { .ltools { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .ltools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .ltools { grid-template-columns: 1fr; } }
.ltool { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; cursor: pointer; font-family: inherit; box-shadow: 0 14px 34px -22px rgba(16,40,34,.3); transition: transform .16s, box-shadow .16s, border-color .16s; }
.ltool:hover { border-color: var(--em-tint); box-shadow: 0 22px 44px -20px rgba(16,185,129,.45); animation: ltoolBounce .45s cubic-bezier(.28,.84,.42,1); }
.ltool:active { transform: scale(.98); }
.ltool:disabled { opacity: .6; cursor: progress; animation: none; }
@keyframes ltoolBounce { 0% { transform: translateY(0); } 26% { transform: translateY(-7px); } 50% { transform: translateY(0); } 70% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
.ltool-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg,#10b981,#34d399); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px -8px rgba(16,185,129,.8); }
.ltool-t { flex: 1; text-align: left; font-weight: 800; font-size: 17px; color: var(--ink); }
.ltool-arrow { color: var(--mut2); font-size: 22px; font-weight: 700; }
.ltool:hover .ltool-arrow { color: var(--em); }
/* arriving from a homepage tool button — pulse to say "click here" */
.ltool.tool-pulse { animation: ltoolAttn 1.3s ease 2; border-color: var(--em); }
@keyframes ltoolAttn { 0%,100% { box-shadow: 0 14px 34px -22px rgba(16,40,34,.3); } 50% { box-shadow: 0 0 0 4px rgba(16,185,129,.3), 0 18px 40px -16px rgba(16,185,129,.6); } }

/* "Convert Files" mega-menu launcher */
.convert-more { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 22px; background: linear-gradient(135deg,#0f1b2e,#13243d); color: #e7edf3; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 14px 18px; cursor: pointer; font-family: inherit; box-shadow: 0 16px 38px -22px rgba(8,15,30,.6); transition: transform .16s, box-shadow .16s; }
.convert-more:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -20px rgba(8,15,30,.7); }
.cm-ic { font-size: 22px; flex: 0 0 auto; }
.cm-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.cm-txt b { font-size: 16px; font-family: 'Plus Jakarta Sans', sans-serif; }
.cm-txt small { font-size: 12.5px; color: #aebccb; }
.cm-arrow { color: #34d399; font-size: 24px; font-weight: 700; }
/* Convert modal */
.ezcard.convcard { max-width: 640px; width: 94vw; max-height: 88vh; overflow-y: auto; position: relative; padding: 28px 28px 24px; }
.convcard h3 { font-size: 23px; margin: 0 0 4px; color: var(--ink); }
.conv-sub { color: var(--mut); font-size: 14px; margin: 0 0 18px; }
.conv-group { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--em-dk); margin: 16px 2px 8px; }
.conv-group:first-child { margin-top: 0; }
.conv-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .conv-row { grid-template-columns: repeat(2, 1fr); } }
.conv-tile { position: relative; display: block; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 12px; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: center; text-decoration: none; transition: border-color .14s, background .14s, transform .12s; }
.conv-tile:hover { border-color: var(--em); background: var(--em-soft); color: var(--em-dk); transform: translateY(-1px); }
.conv-tile.soon { opacity: .62; }
.conv-tile.soon:hover { border-color: var(--line); background: #fff; color: var(--ink); transform: none; }
.conv-soon { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; color: var(--mut2); margin-top: 2px; }
/* ── Usage history modal ── */
.ezcard.histcard { max-width: 560px; width: 94vw; max-height: 86vh; overflow-y: auto; position: relative; padding: 26px 26px 22px; }
.hist-head h3 { font-size: 20px; margin: 0 0 4px; }
.hist-sub { font-size: 13.5px; color: var(--mut); margin: 0 0 16px; line-height: 1.5; }
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist-empty { text-align: center; color: var(--mut2); font-size: 14px; padding: 28px 10px; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.hist-row:hover { border-color: var(--line2); }
.hist-main { flex: 1; min-width: 0; }
.hist-tool { font-size: 14px; font-weight: 800; color: var(--ink); }
.hist-meta { font-size: 12px; color: var(--mut); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hist-dl, .hist-del { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; transition: background .14s, border-color .14s; }
.hist-dl:hover { background: var(--em-soft); border-color: var(--em); }
.hist-del:hover { background: #fef2f2; border-color: #fecaca; }
.hist-gone { width: 32px; text-align: center; color: var(--mut2); }
/* ── "Save your history" nudge ── */
.ezcard.histnudge { max-width: 420px; width: 92vw; position: relative; text-align: center; padding: 30px 28px 24px; }
.hn-ic { font-size: 40px; margin-bottom: 8px; }
.histnudge h3 { font-size: 22px; margin: 0 0 8px; }
.hn-sub { font-size: 14px; color: var(--mut); line-height: 1.55; margin: 0 0 16px; }
.hn-feats { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; display: inline-block; }
.hn-feats li { font-size: 13.5px; color: var(--ink); padding: 5px 0 5px 26px; position: relative; }
.hn-feats li::before { content: "✓"; position: absolute; left: 4px; color: var(--em-d); font-weight: 800; }
.hn-cta { width: 100%; padding: 13px; font-size: 15px; }
.hn-later { display: block; width: 100%; margin-top: 10px; background: none; border: none; color: var(--mut); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.hn-later:hover { color: var(--ink); }

/* 2×2 responsive card grid — top-align cards in each row */
/* All landing rows: cards in the same row share one height + aligned tops (stretch). */
.lgrid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 22px; align-items: stretch; }
.lgrid > .lcard, .lgrid-sig > .lcard { height: 100%; align-self: stretch; margin-top: 0; }
.lgrid-sig { margin-top: 22px; align-items: start; } .lgrid-sig > .lcard { align-self: start; height: auto; }
@media (max-width: 820px) { .lgrid, .lgrid-sig { grid-template-columns: 1fr; } }
/* nav anchors never get an underline (sign page uses <a> buttons) */
.lnav a, .lbtn, .lnav-brand { text-decoration: none; }
/* anchor row-1 height to the drop card so Recent matches it and scrolls (~3 visible) */
.lcard-drop, #recentFilesCard { min-height: 232px; }

/* Card shell — flex column so a scrolling list fills the card to match its partner */
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 22px 54px -30px rgba(16,40,34,.24); transition: transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column; }
.lcard:hover { box-shadow: 0 30px 60px -28px rgba(16,40,34,.3); }
.lcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lcard-head h3 { font-size: 18px; margin: 0; color: var(--ink); }
.lcard-scroll { flex: 1 1 auto; min-height: 0; max-height: 244px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.lcard-scroll .recent { margin-bottom: 0; }

/* Training & Tutorials card */
.lcard-train .train-thumb { position: relative; display: block; flex: 1 1 auto; min-height: 230px; border-radius: 14px; overflow: hidden; cursor: pointer; background: #0b0f14; }
.lcard-train .train-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.lcard-train .train-thumb:hover img { transform: scale(1.05); }
.lcard-train .train-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.train-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--em-d); font-size: 24px; display: grid; place-items: center; padding-left: 5px; box-shadow: 0 12px 30px -8px rgba(0,0,0,.5); z-index: 2; transition: transform .18s ease, background .18s; }
.lcard-train .train-thumb:hover .train-play { transform: translate(-50%,-50%) scale(1.1); background: #fff; }
.train-cap { position: absolute; left: 16px; bottom: 14px; z-index: 2; color: #fff; font-weight: 700; font-size: 14.5px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }

/* Drop card */
.lcard-drop { background: linear-gradient(180deg,#fbfdfc,#fff); display: flex; flex-direction: column; gap: 16px; }
#dropzone { border: 2px dashed var(--em-tint); border-radius: 16px; padding: 22px 20px; text-align: center; cursor: pointer; background: var(--em-soft); transition: transform .18s ease, background .15s, border-color .15s, box-shadow .18s; }
#dropzone.over, #dropzone:hover { background: #fff; border-color: var(--em); transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(16,185,129,.45), inset 0 0 0 4px rgba(16,185,129,.06); }
.dz-icon { width: 50px; height: 50px; margin: 0 auto 10px; border-radius: 14px; background: linear-gradient(135deg,#10b981,#34d399); display: grid; place-items: center; color: #fff; box-shadow: 0 14px 28px -12px rgba(16,185,129,.8); transition: transform .18s; }
#dropzone:hover .dz-icon { transform: scale(1.06) rotate(-2deg); }
.dz-text { font-size: 19px; font-weight: 700; color: var(--ink); }
.dz-sub { font-size: 13.5px; color: var(--mut); margin-top: 5px; }
.dz-fmts { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.dz-fmts span { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--em-dk); background: #fff; border: 1px solid var(--em-tint); padding: 5px 11px; border-radius: 8px; }

/* Browse-tenancy-forms button (inside the drop card) */
.formpick-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line2); border-radius: 14px; padding: 14px; cursor: pointer; transition: background .14s, border-color .14s, transform .16s, box-shadow .16s; }
.formpick-btn:hover { background: var(--em-soft); border-color: var(--em-tint); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(16,185,129,.5); }
.formpick-btn:active { transform: translateY(0); }
.fpb-ic { font-size: 24px; }
.fpb-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fpb-txt b { font-size: 15px; }
.fpb-txt small { color: var(--mut2); font-size: 12.5px; }
.fpb-arrow { color: var(--em); font-size: 26px; font-weight: 700; }

/* WOW: staggered card reveal each time the landing appears */
.lstage .lanim { opacity: 0; transform: translateY(22px); }
.lstage.reveal .lanim { animation: lcardIn .56s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: calc(var(--d, 0) * .09s); }
@keyframes lcardIn { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lstage .lanim { opacity: 1; transform: none; } .lstage.reveal .lanim { animation: none; } }

.ezcard.formsheet { max-width: 880px; width: 94vw; background: #fff; border: 1px solid var(--line); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.fs-head { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px 54px 12px; min-height: 32px; }
.fs-head h3 { color: var(--ink) !important; margin: 0 !important; font-size: 16.5px !important; text-align: center; }
.fs-close { position: absolute; right: 16px; top: 14px; background: var(--bg); border: none; color: var(--mut); width: 32px; height: 32px; border-radius: 50%; font-size: 14px; cursor: pointer; }
.fs-back { position: absolute; left: 16px; top: 14px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); width: 32px; height: 32px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; transition: background .14s; }
.fs-back:hover { background: var(--em-soft); border-color: var(--em-tint); }
.fs-lead { margin: 0 18px 6px; color: var(--mut2); font-size: 13px; text-align: center; }
#provGrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; padding: 8px 16px 20px; }
.prov-card { position: relative; aspect-ratio: 1 / 1; text-align: left; padding: 0; background: #0b0f14; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; color: #fff; transition: transform .16s ease, box-shadow .16s ease, border-color .16s; }
.prov-card:hover { transform: translateY(-4px); box-shadow: 0 18px 42px rgba(15,23,42,.22); border-color: var(--em-tint); }
.prov-art-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .4s ease, filter .2s ease; }
.prov-card:hover .prov-art-bg { transform: scale(1.06); }
.prov-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.30) 60%, rgba(0,0,0,.80) 100%); }
.prov-art-bg.mtn {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='xMidYMax slice'><polygon points='0,200 90,70 150,120 220,40 300,110 360,60 400,120 400,200' fill='%23234b5e'/><polygon points='200,40 230,70 215,72 245,105 155,105 185,72 170,70' fill='%23f1f6f8'/><polygon points='90,70 120,100 105,102 130,130 50,130 78,102 60,100' fill='%23eef4f6'/></svg>") bottom/cover no-repeat,
    linear-gradient(180deg, #cfe6f0 0%, #7fb4cb 50%, #3c7d97 100%);
}
/* Coming-soon placeholder art for provinces without imagery yet. */
.prov-art-bg.qc {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='xMidYMax slice'><rect x='150' y='40' width='100' height='120' fill='%23ffffff' opacity='0.10'/><polygon points='0,200 70,120 130,150 200,90 270,140 340,100 400,150 400,200' fill='%231e3a8a' opacity='0.55'/></svg>") bottom/cover no-repeat,
    linear-gradient(140deg, #2563eb 0%, #1e3a8a 100%);
}
.prov-art-bg.mb {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='xMidYMax slice'><polygon points='0,200 0,150 400,120 400,200' fill='%23166534' opacity='0.55'/><circle cx='320' cy='60' r='26' fill='%23fde68a' opacity='0.5'/></svg>") bottom/cover no-repeat,
    linear-gradient(140deg, #22c55e 0%, #15803d 100%);
}
.prov-art-bg.sk {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='xMidYMax slice'><polygon points='0,200 0,160 400,135 400,200' fill='%23854d0e' opacity='0.5'/><circle cx='330' cy='55' r='30' fill='%23fbbf24' opacity='0.55'/></svg>") bottom/cover no-repeat,
    linear-gradient(140deg, #f59e0b 0%, #b45309 100%);
}
.prov-overlay { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 14px 16px 16px; }
.prov-name { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .2px; line-height: 1.05; text-shadow: 0 2px 14px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.55); transition: transform .16s ease; }
.prov-card:hover .prov-name { transform: translateY(-2px); }
.prov-tag { position: absolute; left: 12px; top: 12px; z-index: 2; background: rgba(255,255,255,.95); color: #0f172a; font-size: 11px; font-weight: 800; letter-spacing: .3px; padding: 5px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.prov-soon { cursor: default; }
.prov-soon .prov-art-bg { filter: grayscale(.3) brightness(.82); }
.prov-soon:hover { transform: none; box-shadow: 0 6px 18px rgba(15,23,42,.1); }
.prov-soon:hover .prov-art-bg { transform: none; }
.prov-ribbon { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.94); color: #b45309; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.fl-soon { grid-column: 1 / -1; text-align: center; padding: 34px 24px 42px; }
.fl-soon-ic { font-size: 40px; }
.fl-soon h4 { margin: 12px 0 6px; font-size: 17px; color: var(--ink); }
.fl-soon p { margin: 0 auto; max-width: 430px; color: var(--mut2); font-size: 13px; line-height: 1.55; }
#catGrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; padding: 8px 16px 22px; }
.cat-card { position: relative; aspect-ratio: 1 / 1; text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; color: #fff; transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15,23,42,.18); border-color: var(--em-tint); }
.cat-bg { position: absolute; inset: 0; transition: filter .2s ease; }
.cat-card:hover .cat-bg { filter: saturate(1.08) brightness(1.05); }
.cat-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.42) 100%); }
.cat-overlay { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 13px 15px 15px; }
.cat-label { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .2px; line-height: 1.12; text-shadow: 0 2px 10px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.5); transition: transform .15s ease; }
.cat-card:hover .cat-label { transform: translateY(-2px); }
.cat-meta { margin-top: 4px; color: rgba(255,255,255,.92); font-size: 12px; line-height: 1.35; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.cat-lease {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='62' height='62' viewBox='0 0 64 64' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 7h18l12 12v34a4 4 0 0 1-4 4H18a4 4 0 0 1-4-4V11a4 4 0 0 1 4-4z'/><path d='M36 7v12h12'/><path d='M22 32h20M22 40h20M22 48h12'/></svg>") center 34%/58px no-repeat,
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.16), rgba(255,255,255,0) 62%),
    linear-gradient(140deg, #0f766e 0%, #0a5751 100%);
}
.cat-evict {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='66' height='66' viewBox='0 0 72 64' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 30 30 12l21 18'/><path d='M15 27v24h30V27'/><path d='M26 51V37h8v14'/><path d='M52 40h13'/><path d='M60 34l6 6-6 6'/></svg>") center 36%/64px no-repeat,
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.16), rgba(255,255,255,0) 62%),
    linear-gradient(140deg, #c2620a 0%, #9a4c08 100%);
}
.cat-notices {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='66' height='66' viewBox='0 0 64 56' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='12' width='46' height='34' rx='5'/><path d='M9 17l23 16 23-16'/></svg>") center 38%/60px no-repeat,
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.16), rgba(255,255,255,0) 62%),
    linear-gradient(140deg, #2563eb 0%, #1d4ed8 100%);
}
@media (max-width: 640px) { #provGrid, #catGrid { grid-template-columns: 1fr; } }
#formList { overflow-y: auto; padding: 4px 14px 18px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-content: start; }
.fl-group { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--mut2); margin: 16px 6px 8px; }
.form-row {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 7px; cursor: pointer; color: var(--ink);
  transition: background .14s, border-color .14s;
}
@media (max-width: 640px) {
  #formList { grid-template-columns: 1fr; }
}
.form-row:hover { background: var(--em-soft); border-color: var(--em-tint); }
.form-row:active { border-color: var(--em); background: var(--em-soft); }
.form-badge {
  flex: 0 0 52px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
}
.form-row .fr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.form-row .fr-txt b { font-size: 13.5px; line-height: 1.25; }
.form-row .fr-txt small { color: var(--mut2); font-size: 11.5px; line-height: 1.3; }

#recents { margin-top: 38px; }
#recents h2 { font-size: 17px; color: var(--ink); }
.recent {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer; transition: border-color .14s, box-shadow .14s;
}
.recent:hover { border-color: var(--em); box-shadow: 0 8px 20px -14px rgba(16,40,34,.3); }
.recent .ric { position: relative; flex: 0 0 auto; width: 48px; height: 62px; border-radius: 6px; overflow: hidden; background: #f1f5f9; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.recent .ric-cv { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent .ric-star { position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%; background: #d4a017; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.recent .rmain { flex: 1; min-width: 0; overflow: hidden; }
.recent .rname { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .rsub { font-size: 11.5px; color: var(--mut2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .rren { background: none; border: none; color: var(--mut2); font-size: 21px; cursor: pointer; padding: 6px 8px; border-radius: 8px; transition: color .12s, background .12s; }
.recent .rren:hover { color: var(--em); background: var(--em-soft); }
.recent .rdel { background: none; border: none; color: var(--mut2); font-size: 22px; cursor: pointer; padding: 6px 8px; border-radius: 8px; transition: color .12s, background .12s; }
.recent .rdel:hover { color: var(--danger); background: #fef2f2; }
.recent.saved { border-color: var(--em-tint); background: linear-gradient(0deg, var(--em-soft), #fff); }
.recent.saved .ric { color: #d4a017; }
.recent-group { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--mut2); margin: 4px 2px 10px; }
.recent-group + .recent { margin-top: 0; }
.tb-btn.savemine { background: #fff; border: 1.5px solid #d4a017; color: #92700f; }
.tb-btn.savemine:hover { background: #fffbeb; border-color: #b8860b; color: #92700f; box-shadow: 0 0 0 2px rgba(212,160,23,.22); }
/* Premium modal reveal — backdrop fades, card pops up */
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(16px) scale(.965); } to { opacity: 1; transform: none; } }
.padmodal:not(.hidden) { animation: modalFade .2s ease; }
.padmodal:not(.hidden) > .ezcard { animation: modalPop .36s cubic-bezier(.22,.61,.36,1); }
/* when a modal is flying out of its button, JS drives the motion — skip the CSS pop AND fade */
.padmodal.flyin:not(.hidden) { animation: none; }
.padmodal.flyin:not(.hidden) > .ezcard { animation: none; }
@media (prefers-reduced-motion: reduce) { .padmodal:not(.hidden), .padmodal:not(.hidden) > .ezcard { animation: none; } }
/* Name / rename document modal */
.ezcard.namecard { max-width: 460px; position: relative; }
.nm-x { position: absolute; top: 14px; right: 14px; background: var(--bg); border: none; color: var(--mut); width: 30px; height: 30px; border-radius: 50%; font-size: 13px; cursor: pointer; transition: background .14s, color .14s; }
.nm-x:hover { background: #eef2f1; color: var(--ink); }
.name-help { color: var(--mut2); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.namecard input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 15px; outline: none; transition: border-color .14s; }
.namecard input:focus { border-color: var(--em); box-shadow: 0 0 0 3px rgba(16,185,129,.14); }
.name-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.nm-ghost { background: var(--bg); border: 1px solid var(--line); color: var(--ink); padding: 10px 18px; border-radius: 11px; font-weight: 700; font-size: 14px; cursor: pointer; }
.nm-ghost:hover { background: #eef2f1; }
.nm-primary { background: var(--em); border: none; color: #fff; padding: 10px 22px; border-radius: 11px; font-weight: 800; font-size: 14px; cursor: pointer; transition: background .14s; }
.nm-primary:hover { background: var(--em-d); }
/* Account + profile modals */
.ezcard.acctcard, .ezcard.profilecard { position: relative; max-width: 600px; }
/* ── clean sign-in / sign-up modal ── */
#acctModal .ezcard.acctcard { max-width: 410px; padding: 32px 30px 28px; }
.acct-hero { text-align: center; margin-bottom: 20px; }
.acct-logo { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg,#10b981,#059669); color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 0 12px 26px -10px rgba(16,185,129,.7); font-family: 'Plus Jakarta Sans', sans-serif; }
#acctSignedOut h3 { font-size: 21px; text-align: center; margin: 0; }
.acct-sub { color: var(--mut); font-size: 13.5px; text-align: center; margin: 7px auto 0; max-width: 320px; line-height: 1.5; }
.acct-field { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; margin-top: 11px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.acct-field:focus-within { border-color: var(--em); box-shadow: 0 0 0 4px var(--em-soft); }
.acct-ic { font-size: 14px; flex: 0 0 auto; opacity: .7; }
.acct-field input { flex: 1; border: none; outline: none; background: none; padding: 13px 0; font-size: 15px; font-family: inherit; color: var(--ink); }
.acct-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--ink); }
.acct-primary { width: 100%; margin-top: 16px; background: linear-gradient(135deg,#10b981,#059669); color: #fff; border: none; border-radius: 12px; padding: 14px; font-weight: 800; font-size: 15px; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; box-shadow: 0 12px 26px -12px rgba(16,185,129,.7); transition: transform .15s, box-shadow .15s; }
.acct-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 34px -12px rgba(16,185,129,.85); }
.acct-or { display: flex; align-items: center; gap: 12px; color: var(--mut2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin: 16px 0; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-secondary { width: 100%; background: #fff; color: var(--em-dk); border: 1.5px solid var(--em-tint); border-radius: 12px; padding: 13px; font-weight: 800; font-size: 14.5px; cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif; transition: background .15s, border-color .15s; }
.acct-secondary:hover { background: var(--em-soft); border-color: var(--em); }
#acctSignedOut .eserr:empty { display: none; }
#acctSignedOut .eserr { margin-top: 10px; }
#profFields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; }
#profFields .wiz-field { margin: 0 0 12px; }
#profFields .wiz-field label { display: block; font-size: 13px; font-weight: 700; color: #0f172a; margin: 0 0 5px; }
#acctSyncStatus { color: var(--em); font-weight: 700; }
.acct-verify { margin: 0 0 14px; padding: 10px 13px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; color: #92700f; font-size: 13px; line-height: 1.45; }
.acct-verify .linklike { color: #92700f; font-weight: 800; text-decoration: underline; }
.tb-btn.acct-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #e2e8f0; }
.tb-btn.acct-btn:hover { background: rgba(255,255,255,.16); }
/* Premium step transitions in the forms picker */
@keyframes stepFwd  { from { opacity: 0; transform: translateX(28px); }  to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes stepFade { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes cardRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.step-fwd  { animation: stepFwd  .32s cubic-bezier(.22,.61,.36,1); }
.step-back { animation: stepBack .32s cubic-bezier(.22,.61,.36,1); }
.step-fade { animation: stepFade .34s cubic-bezier(.22,.61,.36,1); }
.step-fwd .prov-card, .step-fade .prov-card, .step-fwd .cat-card, .step-fade .cat-card { animation: cardRise .42s both cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) {
  .step-fwd, .step-back, .step-fade, .step-fwd .prov-card, .step-fade .prov-card, .step-fwd .cat-card, .step-fade .cat-card { animation: none; }
}
.credit { text-align: center; margin-top: 50px; color: var(--mut2); font-size: 13px; font-weight: 700; }
.credit span { color: #b59410; }

/* ── E-signature ─────────────────────────────────────────── */
.tb-btn.esign { background: #d97706; border-color: #d97706; color: #fff; }
.tb-btn.esign:hover { background: #b45309; border-color: #b45309; color: #fff; box-shadow: 0 0 0 2px rgba(245,158,11,.3); }
.padmodal { position: fixed; inset: 0; z-index: 2000000000; background: rgba(15,23,30,.55); display: flex; align-items: center; justify-content: center; padding: 14px; }

/* ── Quick-tool processing / result modal — premium holographic spinner ── */
.toolmodal { background: rgba(8,18,26,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.toolmodal .toolcard { max-width: 430px; width: 92vw; text-align: center; padding: 34px 30px 28px; position: relative; }
.toolmodal .tool-result { display: none; }
.toolmodal.done .tool-proc { display: none; }
.toolmodal.done .tool-result { display: block; animation: toolPop .4s cubic-bezier(.22,.9,.32,1.2); }
@keyframes toolPop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.tool-holo { position: relative; width: 132px; height: 132px; margin: 4px auto 24px; }
.tool-holo::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(16,185,129,.22), transparent 66%); animation: holoPulse 2.4s ease-in-out infinite; }
.holo-ring { position: absolute; border-radius: 50%; }
.holo-ring.r1 { inset: 0; border: 3px solid transparent; border-top-color: #10b981; border-right-color: #6ee7b7; animation: holoSpin 1.1s linear infinite; }
.holo-ring.r2 { inset: 15px; border: 3px solid transparent; border-bottom-color: #059669; border-left-color: #a7f3d0; animation: holoSpin 1.7s linear infinite reverse; }
.holo-ring.r3 { inset: 30px; border: 2px dashed rgba(16,185,129,.45); animation: holoSpin 3.2s linear infinite; }
.holo-scan { position: absolute; inset: 6px; border-radius: 50%; overflow: hidden; }
.holo-scan::before { content: ""; position: absolute; left: 0; right: 0; height: 38%; top: -38%; background: linear-gradient(180deg, rgba(52,211,153,0), rgba(52,211,153,.38)); animation: holoScan 1.8s ease-in-out infinite; }
.holo-core { position: absolute; inset: 42px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #5eead4, #059669); box-shadow: 0 0 32px 5px rgba(16,185,129,.55), inset 0 0 18px rgba(255,255,255,.5); display: grid; place-items: center; color: #fff; font-size: 22px; animation: holoPulse 1.8s ease-in-out infinite; }
@keyframes holoSpin { to { transform: rotate(360deg); } }
@keyframes holoPulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.07); opacity: 1; } }
@keyframes holoScan { 0% { top: -38%; } 100% { top: 100%; } }
.toolcard h3 { font-size: 21px; margin: 0 0 6px; color: var(--ink); }
.tool-file { color: var(--mut); font-size: 13.5px; margin: 0 0 18px; word-break: break-all; }
.tool-bar { height: 9px; background: #eef2f0; border-radius: 999px; overflow: hidden; margin: 0 4px 12px; }
.tool-bar-fill { height: 100%; width: 4%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #34d399); box-shadow: 0 0 12px rgba(16,185,129,.6); transition: width .35s cubic-bezier(.22,.61,.36,1); }
.tool-status { color: var(--ink); font-weight: 700; font-size: 14.5px; min-height: 20px; margin: 0; }
.tool-reassure { color: var(--mut2); font-size: 12px; margin: 14px 0 0; line-height: 1.45; }
.tool-check { width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 16px; background: linear-gradient(135deg, #10b981, #059669); display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(16,185,129,.7); animation: toolCheck .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes toolCheck { 0% { transform: scale(0) rotate(-25deg); } 60% { transform: scale(1.15) rotate(0); } 100% { transform: scale(1); } }
.tool-stats { margin: 6px 0 20px; text-align: left; }
.ts-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 14.5px; color: var(--mut); }
.ts-row b { color: var(--ink); font-weight: 800; font-size: 15px; }
.ts-row b.ts-good { color: var(--em-d); }
.ts-badge.ok { margin-top: 14px; text-align: center; background: var(--em-soft); color: var(--em-dk); border: 1px solid var(--em-tint); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 13.5px; }
.ts-note { margin-top: 12px; color: var(--mut); font-size: 13px; line-height: 1.5; }
.tool-result .nm-primary { width: 100%; padding: 13px; font-size: 15px; }
/* "Got it" gate — explanation shown while the spinner keeps spinning */
.tool-gate { display: none; }
.toolmodal.gating #toolProgress { display: none; }
.toolmodal.gating .tool-gate { display: block; animation: toolPop .3s cubic-bezier(.22,.9,.32,1.2); }
.tool-gate-msg { color: var(--ink); font-size: 14.5px; line-height: 1.55; margin: 4px 0 16px; }
.tool-gate .nm-primary { width: 100%; padding: 12px; font-size: 15px; }

/* ── Upgrade to Pro modal ──────────────────────────────────────────────── */
.ezcard.upcard { max-width: 420px; width: 92vw; position: relative; text-align: center; padding: 30px 28px 24px; }
.up-badge { display: inline-block; background: linear-gradient(135deg,#10b981,#059669); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 1.5px; padding: 5px 13px; border-radius: 999px; margin: 0 0 12px; box-shadow: 0 8px 18px -8px rgba(16,185,129,.8); }
.upcard h3 { font-size: 23px; margin: 0 0 6px; color: var(--ink); }
.up-sub { color: var(--mut); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.up-feats { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; }
.up-feats li { position: relative; padding: 8px 0 8px 28px; font-size: 14.5px; color: var(--ink); border-bottom: 1px dashed var(--line); }
.up-feats li:last-child { border-bottom: none; }
.up-feats li::before { content: "✓"; position: absolute; left: 2px; top: 8px; color: var(--em-d); font-weight: 900; }
.up-soon { font-size: 10px; font-weight: 800; letter-spacing: .5px; color: var(--em-dk); background: var(--em-soft); border: 1px solid var(--em-tint); padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.up-price { margin: 0 0 16px; }
.up-price b { font-size: 34px; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--ink); }
.up-price span { color: var(--mut); font-size: 15px; }
.up-cta { width: 100%; padding: 14px; font-size: 15.5px; }
.up-cta:disabled { opacity: .55; cursor: default; }
.up-foot { color: var(--mut2); font-size: 12px; margin: 12px 0 0; }

/* ── Post-download "sign in to sync" nudge ─────────────────────────────── */
.dl-nudge { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(22px); z-index: 1950000000; display: flex; align-items: center; gap: 12px; max-width: 470px; width: calc(100% - 32px); background: #0f1b2e; color: #e7edf3; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 14px; box-shadow: 0 22px 54px -16px rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .26s ease, transform .26s ease; }
.dl-nudge.dl-show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.dln-ic { font-size: 22px; flex: 0 0 auto; }
.dln-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.dln-txt b { font-size: 14px; }
.dln-txt span { font-size: 12.5px; color: #aebccb; }
.dln-cta { flex: 0 0 auto; background: linear-gradient(135deg,#10b981,#059669); color: #fff; border: none; border-radius: 9px; padding: 9px 14px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.dln-cta:hover { filter: brightness(1.08); }
.dln-x { flex: 0 0 auto; background: none; border: none; color: #8b979c; font-size: 14px; cursor: pointer; padding: 4px; }
.dln-x:hover { color: #fff; }

/* ── Guided tour (spotlight coach-marks) ───────────────────────────────── */
.tour { position: fixed; inset: 0; z-index: 2000000200; }
.tour.hidden { display: none; }
.tour-hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(8,14,26,.66); transition: top .32s cubic-bezier(.22,.61,.36,1), left .32s cubic-bezier(.22,.61,.36,1), width .32s cubic-bezier(.22,.61,.36,1), height .32s cubic-bezier(.22,.61,.36,1); pointer-events: none; }
.tour-pop { position: absolute; width: 300px; max-width: calc(100vw - 28px); background: #fff; border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 26px 64px -18px rgba(8,15,30,.65); transition: top .32s cubic-bezier(.22,.61,.36,1), left .32s cubic-bezier(.22,.61,.36,1); }
.tour-step { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--em-dk); text-transform: uppercase; margin-bottom: 4px; }
.tour-pop h4 { margin: 0 0 5px; font-size: 16px; color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; }
.tour-pop p { margin: 0 0 14px; font-size: 13.5px; color: var(--mut); line-height: 1.5; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-skip { background: none; border: none; color: var(--mut2); font-size: 13px; cursor: pointer; font-weight: 600; padding: 4px; }
.tour-skip:hover { color: var(--ink); }
.tour-next { background: linear-gradient(135deg,#10b981,#059669); color: #fff; border: none; border-radius: 9px; padding: 9px 16px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.tour-next:hover { filter: brightness(1.07); }
.tour-arrow { position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); border-radius: 2px; }

/* ── Page-transition veil (white screen + logo between page loads) ─────── */
.page-veil { position: fixed; inset: 0; z-index: 2147483646; background: #fff; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity .5s ease; }
.page-veil.hide { opacity: 0; pointer-events: none; }
.page-veil .pv-brand { display: flex; align-items: center; gap: 12px; font-family: 'Plus Jakarta Sans', -apple-system, sans-serif; font-weight: 800; font-size: 26px; color: #16202a; animation: pvPulse 1.4s ease-in-out infinite; }
.pv-logo { width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg,#059669,#34d399); display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 900; box-shadow: 0 10px 24px -8px rgba(16,185,129,.7); }
.pv-ez { color: #047857; }
@keyframes pvPulse { 0%,100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.05); opacity: 1; } }

/* ── Shortcuts & gestures help modal — large, friendly, blurred backdrop ── */
.helpkeys-modal { background: rgba(13,21,30,.46); -webkit-backdrop-filter: blur(9px) saturate(1.05); backdrop-filter: blur(9px) saturate(1.05); }
.ezcard.helpcard { max-width: 780px; width: 95vw; max-height: 90vh; overflow-y: auto; position: relative; padding: 32px 34px 26px; }
.help-head h3 { font-size: 27px; line-height: 1.15; margin: 0 0 8px; color: var(--ink); }
.help-head p { color: var(--mut); font-size: 15.5px; margin: 0 0 22px; }
.help-cols { display: flex; flex-direction: column; }
.help-col-head { display: grid; grid-template-columns: 1.5fr 1.1fr 1.1fr; gap: 16px; padding: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--mut2); border-bottom: 2px solid var(--line); }
.help-row { display: grid; grid-template-columns: 1.5fr 1.1fr 1.1fr; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.help-row:last-child { border-bottom: none; }
.hr-act b { display: block; font-size: 16.5px; color: var(--ink); }
.hr-act span { display: block; font-size: 13px; color: var(--mut); margin-top: 3px; line-height: 1.35; }
.hr-mac, .hr-ios { font-size: 14px; color: var(--ink); line-height: 1.9; }
.help-row kbd, .help-foot kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 28px; padding: 0 8px; margin: 1px; background: #f3f5f9; border: 1px solid #cfd7e1; border-bottom-width: 2.5px; border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 800; color: #1f2937; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.help-foot { margin: 18px 0 2px; color: var(--mut); font-size: 13.5px; background: var(--bg); border-radius: 10px; padding: 12px 14px; }
@media (max-width: 640px) {
  .ezcard.helpcard { padding: 26px 20px 20px; }
  .help-col-head { display: none; }
  .help-row { grid-template-columns: 1fr; gap: 7px; padding: 16px 0; }
  .hr-mac, .hr-ios { line-height: 1.7; }
  .hr-mac::before { content: "💻 "; }
  .hr-ios::before { content: "📱 "; }
}
.ezcard { background: #fff; border-radius: 18px; width: 100%; max-width: 540px; padding: 22px; max-height: 88vh; overflow-y: auto; box-shadow: 0 30px 80px -20px rgba(16,40,34,.5); }
/* Modal close X (top-right) */
.ez-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none; background: #eef2f6; color: #475569; font-size: 15px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .12s ease, color .12s ease, transform .08s ease; z-index: 2; }
.ez-x:hover { background: #e2e8f0; color: #0f172a; }
.ez-x:active { transform: scale(.92); }
.ezcard h3 { margin: 0 0 6px; color: #0f172a; font-size: 18px; }
.essub { color: #64748b; font-size: 13.5px; margin: 0 0 14px; line-height: 1.5; }
.ezcard input {
  width: 100%; box-sizing: border-box; padding: 12px; font-size: 15px;
  border: 1px solid #cbd5e1; border-radius: 10px; margin-bottom: 10px;
}
.bigbtn { background: linear-gradient(135deg,#10b981,#059669); border: none; color: #fff; font-size: 15px; font-weight: 800; padding: 13px 22px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.bigbtn:disabled { opacity: .5; }
.bigbtn.w100 { width: 100%; }
.ghost { background: #f1f5f9; color: #334155; border: none; padding: 11px 18px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.eserr { color: #dc2626; font-size: 13px; margin-top: 8px; min-height: 16px; }
.esactions { margin-top: 14px; text-align: right; }
.es-addwrap { text-align: center; margin: 15px 0; }
.signer-row { display: flex; gap: 8px; margin-bottom: 8px; }
.signer-row input { margin-bottom: 0; }
.signer-row .rm { background: none; border: none; color: #94a3b8; font-size: 17px; cursor: pointer; }
.linklike { background: none; border: none; color: var(--em-dk); font-weight: 700; cursor: pointer; font-size: 13.5px; padding: 6px 0; }

/* Placement bar — same banner as the footer; chips + buttons together on one
   row, with the hint underneath. */
.placebar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1800000000;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 18px 30px calc(16px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid #eef1f4;
  box-shadow: 0 -10px 34px -6px rgba(16,40,34,.20);
}
.pb-main { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pb-chips { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pb-actions { display: flex; align-items: center; gap: 12px; }
.pb-hint { color: var(--mut2); font-size: 12.5px; text-align: center; }
/* Bar morph animation (footer ⇄ placement bar) */
.bar-out { animation: barOut .24s ease forwards; pointer-events: none; }
.bar-in { animation: barIn .32s cubic-bezier(.2,.85,.25,1); }
@keyframes barOut { to { opacity: 0; transform: translateY(12px); } }
@keyframes barIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 999px; padding: 8px 12px 8px 9px; font-size: 13px; font-weight: 700;
  background: #6b7280; color: #fff;
}
.pb-chip.on { background: #4b5563; box-shadow: 0 0 0 2px rgba(75,85,99,.25); }
.pb-chip .pbc-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.28); color: #fff; font-size: 11.5px; font-weight: 800; }
.pb-chip .pbc-name { cursor: pointer; }
.pb-chip .pbc-edit, .pb-chip .pbc-x { width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(255,255,255,.22); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.pb-chip .pbc-edit:hover { background: var(--em); color: #fff; }
.pb-chip .pbc-x:hover { background: var(--danger); color: #fff; }

.sigbox {
  position: absolute; border: 2px dashed; border-radius: 4px; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; cursor: move; touch-action: none;
  text-align: center; padding: 2px;
}
.sigbox .sb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sigbox .sb-resize { position: absolute; right: -8px; bottom: -8px; width: 17px; height: 17px; background: currentColor; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; touch-action: none; z-index: 6; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sigbox .sb-del {
  position: absolute; top: -12px; right: -12px; width: 26px; height: 26px; z-index: 6;
  border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid #fff;
  font-size: 12px; cursor: pointer; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.sigreq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.sigreq .srtop { display: flex; align-items: center; gap: 10px; }
.sigreq .srname { font-weight: 700; font-size: 14px; flex: 1; color: var(--ink); }
.srbadge { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.srbadge.completed { background: var(--em-tint); color: var(--em-dk); }
.srbadge.sent, .srbadge.partially_signed { background: #fef3c7; color: #b45309; }
.sigreq .srsigner { margin-top: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sigreq .sr-who { display: flex; flex-direction: column; min-width: 0; }
.sigreq .sr-name { font-weight: 800; font-size: 13.5px; color: var(--ink); }
.sigreq .sr-mail { font-size: 12px; color: var(--mut2); word-break: break-all; }
.sigreq .sr-act { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sigreq .sr-stat { font-size: 15px; line-height: 1; color: var(--mut2); }
.sigreq .sr-stat.on { color: var(--em-d); font-weight: 900; }
.sigreq .srsigner .copy { background: #fff; border: 1px solid var(--line2); color: var(--mut); border-radius: 6px; font-size: 11px; padding: 3px 9px; cursor: pointer; white-space: nowrap; }
.sigreq .dlfinal { margin-top: 10px; display: inline-block; background: linear-gradient(135deg,#10b981,#059669); color: #fff; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer; }
#sigRequests { margin-top: 38px; }
#sigRequests h2 { font-size: 17px; color: var(--ink); display: flex; justify-content: space-between; align-items: baseline; }

/* ── Hint overlay — large, centered on screen ────────────── */
#hint {
  position: fixed; left: 50%; top: 88px; bottom: auto; transform: translateX(-50%);
  background: rgba(4, 47, 46, .97); color: #ccfbf1;
  border: 1.5px solid var(--teal-bright);
  padding: 11px 24px; border-radius: 12px; z-index: 2000000001;
  font-size: 16px; font-weight: 700; line-height: 1.35; text-align: center;
  max-width: min(94vw, 620px); width: max-content;
  /* Wrap onto a 2nd line instead of truncating; balance lines so we never leave a 1-word widow. */
  white-space: normal; overflow-wrap: break-word; text-wrap: balance;
  box-shadow: 0 14px 36px -12px rgba(0,0,0,.55);
  opacity: 1; pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
  animation: hintslide .3s cubic-bezier(.2,.85,.25,1);
}
#hint.fade { opacity: 0; transform: translateX(-50%) translateY(10px); }
@keyframes hintslide {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 560px) {
  .tb-btn .lbl { display: none; }
  #topbar { padding: 6px 8px; gap: 6px; }
  .brand { font-size: 13px; }
  .hero h1 { font-size: 27px; }
}

/* Instant JS tooltip (data-tip) — zero-delay, styled, sits above everything. */
.ez-tip {
  position: fixed; transform: translate(-50%, -100%);
  background: #0f172a; color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .08s ease;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.5); z-index: 2147483647;
}
.ez-tip.on { opacity: 1; }

/* ── Full searchable Help & Guide modal ─────────────────────────────────── */
.ph-modal { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px); padding: 20px; }
.ph-modal.hidden { display: none; }
.ph-card { width: min(1000px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; }
.ph-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.ph-head h1 { font-size: 19px; font-weight: 800; margin: 0; color: #0f172a; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
.ph-x { border: none; background: #f1f5f9; color: #334155; width: 34px; height: 34px; border-radius: 9px; font-size: 16px; cursor: pointer; }
.ph-x:hover { background: #e2e8f0; }
.ph-searchwrap { position: relative; padding: 12px 20px; border-bottom: 1px solid #eef2f7; }
#phSearch { width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 15px; border: 1.5px solid #cbd5e1;
  border-radius: 11px; outline: none; background: #f8fafc; color: #0f172a; }
#phSearch:focus { border-color: #0f766e; background: #fff; box-shadow: 0 0 0 3px rgba(15,118,110,.14); }
.ph-results { position: absolute; left: 20px; right: 20px; top: calc(100% - 4px); z-index: 5;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.28);
  max-height: 340px; overflow-y: auto; padding: 6px; }
.ph-results.hidden { display: none; }
.ph-res { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ph-res:hover { background: #f0fdfa; }
.ph-res-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #0f766e; }
.ph-res-h { font-size: 14px; color: #0f172a; }
.ph-res-h mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.ph-nores { padding: 12px; color: #64748b; font-size: 14px; }
.ph-wrap { display: flex; min-height: 0; flex: 1; }
.ph-nav { flex: 0 0 220px; border-right: 1px solid #eef2f7; padding: 12px 10px; overflow-y: auto; background: #fafcfe; }
.ph-link { display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: #334155; font-weight: 600; margin-bottom: 2px; }
.ph-link:hover { background: #eef6f5; color: #0f172a; }
.ph-link.active { background: #0f766e; color: #fff; }
.ph-body { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 26px 40px; color: #1e293b; line-height: 1.6; }
.ph-body h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; color: #0f172a; font-family: 'Plus Jakarta Sans','Inter',sans-serif; }
.ph-body h3 { font-size: 15.5px; font-weight: 700; margin: 20px 0 4px; color: #0f766e; }
.ph-body p { margin: 4px 0 10px; font-size: 14.5px; }
.ph-lede { font-size: 15.5px !important; color: #475569; margin-bottom: 10px !important; }
.ph-body a { color: #0f766e; font-weight: 600; }
.ph-body kbd { display: inline-block; background: #0f172a; color: #fff; border-radius: 5px; padding: 1px 6px;
  font-size: 12px; font-family: ui-monospace, monospace; margin: 0 1px; }
.ph-keys { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.ph-keys th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e2e8f0; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .03em; color: #64748b; }
.ph-keys td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.ph-keys td:first-child { width: 42%; }
.ph-flash { animation: phFlash 1.5s ease; border-radius: 6px; }
@keyframes phFlash { 0%,100% { background: transparent; } 20% { background: #fef3c7; } }
@media (max-width: 640px) {
  .ph-wrap { flex-direction: column; }
  .ph-nav { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; border-right: none; border-bottom: 1px solid #eef2f7; }
  .ph-link { white-space: nowrap; margin-bottom: 0; }
  .ph-card { max-height: 94vh; }
}

/* ── Dashboard toggle: Recently Opened / My Documents / My Signatures ───── */
#dashDock { padding-top: 18px; }
.dash-toggle { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-tab { font-family: inherit; font-size: 14px; font-weight: 700; padding: 9px 18px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.dash-tab:hover { border-color: #94a3b8; }
.dash-tab.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.dash-tab.hidden { display: none; }
.dash-panel.hidden { display: none; }
.dash-empty { color: #64748b; font-size: 14px; padding: 20px 4px; text-align: center; }

/* ── My Signatures card: locked placeholder for guests, enabled once signed in ── */
.mysig-card.is-locked .lcard-scroll,
.mysig-card.is-locked #mySigEmpty { display: none; }
.mysig-card.is-locked .lcard-head h3 { color: #94a3b8; }
.mysig-lock { display: none; }
.mysig-card.is-locked .mysig-lock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px 14px; min-height: 120px; color: #94a3b8; font-size: 14px; text-align: center; line-height: 1.45; }
.mysig-lock-ic { font-size: 30px; opacity: .85; }

/* ── Usage history modal: larger + premium (matches the app's card modals) ── */
.ezcard.histcard { max-width: 720px; padding: 32px 34px 28px; border-radius: 20px; }
.hist-head { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.hist-head h3 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.02em; }
.hist-sub { font-size: 15px; margin: 0; line-height: 1.55; }
.hist-list { gap: 10px; }
.hist-row { padding: 15px 16px; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,40,34,.03); transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease; }
.hist-row:hover { border-color: var(--em); box-shadow: 0 10px 24px -14px rgba(16,40,34,.28); transform: translateY(-1px); }
.hist-tool { font-size: 15px; }
.hist-meta { font-size: 12.5px; margin-top: 3px; }
.hist-actions { gap: 8px; }
.hist-dl, .hist-del { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
.hist-empty { padding: 40px 10px; font-size: 15px; }

/* ── Contact us modal form ── */
.contact-sub { margin: -2px 0 16px; color: #64748b; font-size: 13.5px; line-height: 1.5; }
.contact-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px; font-family: inherit; border: 1px solid #cbd5e1; border-radius: 11px; background: #fff; color: #0f172a; outline: none; transition: border-color .14s, box-shadow .14s; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--em); box-shadow: 0 0 0 3px rgba(16,185,129,.14); }
.contact-form textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.contact-form select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; cursor: pointer; }

/* ── Guest "device-only" note in the Save-as modal ── */
.name-devnote { margin: 12px 0 2px; font-size: 12.5px; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 12px; line-height: 1.5; }
.name-devnote .ndn-ic { opacity: .85; }
.name-devnote a { color: var(--em-dk); font-weight: 700; }
.name-devnote.hidden { display: none; }

/* ── Delete-my-account link ── */
.acct-delete-link { display: block; margin: 14px auto 0; background: none; border: none; color: #dc2626; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; opacity: .85; }
.acct-delete-link:hover { opacity: 1; text-decoration: underline; }
