  /* MSET Sign — styled to the MSET UI Style spec (build 2026.07). Shared primitives
     (tokens, buttons, cards, inputs, selects, badges, tabs, toast, waiting) follow the
     house style; the signing-specific components (placed fields, sign marks, wizard steps,
     PDF reader) keep their behaviour and are recoloured to the same palette.
     NB: the app's CSP forbids injected <style> elements — ALL CSS lives in this file. */
  :root{
    --ink:#0A1628;--ink-3:#16304A;--sage-50:#F5F3ED;--sage-100:#ECE8DB;
    --forest:#1B4A22;--emerald:#5BA364;--emerald-bright:#7EC389;--emerald-deep:#3B7D44;
    --seal:#B8934A;--danger:#C0533B;--warn:#8A6E2E;--muted:#6B7F94;--muted-soft:#9AA7B6;
    --line:rgba(10,22,40,.08);--line-strong:rgba(10,22,40,.16);
    /* spec surfaces: warm page + card, hairline dividers */
    --page:#EDEAE2;--card:#FAF8F3;--card-bd:#E6E2D8;--hover:#EFEAE0;--hairline:#efece3;
    --ink-l:#36433d;      /* body ink on light */  --head-l:#16302A;   /* heading ink */
    --label:#54708a;      /* mono-caps micro-label */
    --field-bg:rgba(126,195,137,.13);
    --shadow:0 1px 3px rgba(10,22,40,.05),0 12px 32px rgba(10,22,40,.08);
    --display:'Fraunces',Georgia,serif;--body:'Plus Jakarta Sans',system-ui,sans-serif;
    --mono:'JetBrains Mono',ui-monospace,monospace;
  }
  *{box-sizing:border-box}
  body{margin:0;background:var(--page);color:var(--ink-l);font-family:var(--body);font-size:14px;line-height:1.5;display:flex;flex-direction:column;min-height:100vh}
  h1,h2,h3{font-family:var(--display);font-weight:500;margin:0;color:var(--head-l)}
  a{color:var(--emerald-deep)}
  /* mono-caps micro-label — the system signature */
  .mlabel{font:600 10px/1 var(--mono);letter-spacing:.09em;text-transform:uppercase;color:var(--label)}
  .shell{flex:1;display:flex;min-height:0}
  /* topbar — full-width dark chrome: brand (left) + account avatar (right) */
  .topbar{flex:none;height:58px;display:flex;align-items:center;gap:16px;padding:0 22px;background:var(--ink);border-bottom:1px solid rgba(255,255,255,.08);position:sticky;top:0;z-index:20}
  .topbar.hidden{display:none}
  .acct-btn{margin-left:auto;border:0;background:none;padding:0;cursor:pointer;border-radius:50%;line-height:0}
  .acct-ava{display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--ink-3);color:var(--sage-50);font:600 12px/1 var(--body);letter-spacing:.03em;border:1px solid rgba(255,255,255,.14)}
  .acct-btn:hover .acct-ava{filter:brightness(1.15)}
  .acct-btn:focus-visible{outline:2px solid var(--emerald-bright);outline-offset:2px}
  /* account popover (opens from the avatar) */
  .acct-pop{position:fixed;z-index:240;min-width:256px;background:var(--card);border:1px solid var(--card-bd);border-radius:14px;box-shadow:0 16px 40px rgba(10,22,40,.28);padding:6px}
  .acct-head{display:flex;align-items:center;gap:11px;padding:8px 10px 10px}
  .acct-head .acct-ava{width:38px;height:38px;font-size:13px;background:var(--forest);border:0;flex:none}
  .acct-name{font-weight:600;font-size:13.5px;color:var(--head-l);line-height:1.2}
  .acct-sub{font-size:11.5px;color:var(--muted);margin-top:2px}
  .acct-sep{height:1px;background:var(--card-bd);margin:4px 2px}
  .acct-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:5px 10px;font-size:12px}
  .acct-row .k{color:var(--muted)}
  .acct-row .v{color:var(--ink-l);font-weight:600}
  .acct-btns{display:flex;flex-direction:column;gap:8px;padding:8px 6px 4px}
  .acct-btns .mbtn{width:100%;justify-content:center}
  .acct-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:none;cursor:pointer;padding:9px 10px;border-radius:9px;font:600 13px/1 var(--body);color:var(--ink-l)}
  .acct-item .g{width:16px;text-align:center;color:var(--muted);font-size:13px}
  .acct-item:hover{background:var(--hover)}
  .acct-item.danger{color:var(--danger)} .acct-item.danger .g{color:var(--danger)}
  /* sidebar — dark chrome, below the topbar */
  #sidebar{width:300px;flex:0 0 300px;background:var(--ink);color:#cdd5e3;display:flex;flex-direction:column;position:sticky;top:58px;height:calc(100vh - 58px);padding:16px 16px;border-right:1px solid rgba(255,255,255,.08)}
  #sidebar.hidden{display:none}
  /* wordmark lockup — verbatim from mset-transcribe.css (.wordmark/.dot/.tag), tokens mapped
     to Sign's identical values: --display=Fraunces, --sage-50=#F5F3ED, --emerald-bright=#7EC389 */
  .sb-brand{display:flex;align-items:center;gap:11px;color:var(--sage-50)}
  .sb-brand svg{width:30px;height:30px}
  .sb-brand .brand-wm{display:flex;align-items:baseline;gap:9px}
  .sb-brand .wordmark{font-family:var(--display);font-style:italic;font-weight:500;font-size:21px;letter-spacing:-.01em;color:var(--sage-50);line-height:1}
  .sb-brand .wordmark .dot{display:inline-block;width:.2em;height:.2em;background:var(--emerald-bright);border-radius:50%;vertical-align:.12em;margin-left:.06em}
  .sb-brand .tag{font-family:var(--mono);font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:rgba(255,255,255,.42);padding-bottom:1px}
  .sb-who{font-size:11.5px;color:var(--muted-soft);margin:0 6px 8px;line-height:1.4}
  /* sidebar CTA — New document, in the "New transcript" style: full-width green pill up top */
  /* verbatim .btn-new from mset-transcribe.css: solid --sage fill, --ink text, 11px pad */
  .sb-cta{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;margin:0 0 10px;padding:11px;border:0;border-radius:999px;background:var(--emerald);color:var(--ink);font-family:var(--body);font-weight:600;font-size:13px;cursor:pointer;transition:background .2s,transform .2s}
  .sb-cta:hover{background:var(--emerald-bright);transform:translateY(-1px)}
  .sb-nav{display:flex;flex-direction:column;gap:2px}
  .sb-nav a{position:relative;display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:9px;color:rgba(255,255,255,.74);text-decoration:none;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .18s}
  .sb-nav a .g{width:16px;text-align:center;color:var(--sage-pale,#9BD7A4);font-size:13px;opacity:.9}
  .sb-nav a:hover{background:rgba(255,255,255,.05);color:#fff}
  /* selected — verbatim Transcribe values: sage-green tint bg + a 3px rounded #7EC389 bar */
  .sb-nav a.active{background:rgba(126,195,137,.10);color:var(--sage-50);font-weight:600}
  .sb-nav a.active::after{content:"";position:absolute;left:4px;top:8px;bottom:8px;width:3px;border-radius:2px;background:var(--emerald-bright)}
  .sb-nav a.active .g{color:var(--emerald-bright);opacity:1}
  .sb-nav a.dis{color:#5c6883;cursor:default}
  .sb-nav a.dis:hover{background:transparent}
  .sb-nav a .soon{margin-left:auto;font:600 9px/1 var(--mono);letter-spacing:.08em;text-transform:uppercase;background:#1b2740;color:#8896ad;padding:3px 6px;border-radius:999px}
  /* footer — verbatim rhythm from mset-transcribe.css (.lib-foot / .privacy / .app-version) */
  .sb-foot{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding-top:11px}
  .sb-foot>a{display:block;padding:9px 11px;border-radius:9px;color:var(--muted-soft);font-size:13px;cursor:pointer}
  .sb-foot>a:hover{background:rgba(255,255,255,.05);color:#fff}
  .sb-meta{margin:0}
  .sb-meta #sbVer{display:block;margin-top:9px;font-family:var(--mono);font-size:9.5px;letter-spacing:.06em;color:rgba(255,255,255,.34);cursor:pointer}
  .sb-meta #sbVer:hover{color:rgba(255,255,255,.6)}
  .sb-priv{display:flex;align-items:center;gap:7px;font-family:var(--mono);font-size:10px;letter-spacing:.01em;color:rgba(255,255,255,.46)}
  .sb-priv span{white-space:nowrap}
  .sb-priv svg{flex:0 0 auto}
  #main{flex:1;min-width:0}
  .wrap{max-width:920px;margin:30px auto;padding:0 28px}
  /* Subscription-term bar: a persistent notice above the view when a term is enforced and
     lapsed (read-only/export-only) or a trial. Aligns with .wrap's content column. */
  #termBar{max-width:920px;margin:20px auto -8px;padding:0 28px}
  .termbar{border-radius:10px;padding:11px 15px;font-size:13.5px;line-height:1.5;border:1px solid var(--line);border-left-width:4px}
  .termbar.info{background:#F0F5F1;border-left-color:var(--brand,#3B7D44);color:#2C4A33}
  .termbar.warn{background:#FBF4E6;border-left-color:var(--warn);color:#6E5820}
  .termbar.danger{background:#FBECE7;border-left-color:var(--danger);color:#8F3324}

  /* ---------- buttons: ONE metric, variants change colour only (pill) ---------- */
  .btn,.mbtn{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;
    height:36px;padding:0 18px;border-radius:999px;cursor:pointer;border:0;
    font-family:var(--body);font-weight:600;font-size:13px;line-height:1;white-space:nowrap;box-sizing:border-box}
  .btn,.mbtn-p{background:var(--forest);color:var(--sage-50)}          /* primary — ONE per view */
  .btn.sub,.mbtn-t{border:1px solid #cfe0d4;background:#fff;color:var(--forest)}  /* tinted secondary */
  .mbtn-s{border:1px solid var(--card-bd);background:#fff;color:var(--ink-l)}     /* neutral (Cancel) */
  .mbtn-m{border:1px solid var(--card-bd);background:#fff;color:#556a82}           /* muted */
  .btn.danger,.mbtn-danger{background:var(--danger);color:#fff;border:0}
  .btn.lg{width:100%;height:40px;padding:0 22px;font-size:14px}
  .mbtn-sm{height:28px;padding:0 13px;font-size:11px}
  .btn:disabled,.mbtn:disabled{opacity:.5;cursor:default}
  .btn:not(:disabled):hover,.mbtn:not(:disabled):hover{filter:brightness(.96)}

  /* ---------- cards, labels, inputs ---------- */
  /* lone auth screens (sign in / signup / reset / MFA): centre the heading+card
     block in the viewport instead of hugging the left edge of .wrap (UI fixes,
     2026-07-27) */
  .authwrap{margin:0 auto}
  .card{background:var(--card);border:1px solid var(--card-bd);border-radius:14px;padding:16px 18px;margin-bottom:14px}
  .card h3{font:600 10px/1 var(--mono);letter-spacing:.09em;text-transform:uppercase;color:var(--label);margin:0 0 12px}
  .h{font-family:var(--display);font-size:26px;color:var(--head-l);margin:0 0 18px;position:relative;padding-bottom:10px}
  .h::after{content:"";position:absolute;left:0;bottom:0;width:46px;height:3px;border-radius:3px;background:var(--emerald-bright)}
  label{display:block;font-size:11.5px;color:var(--muted);margin:0 0 5px;font-weight:500;letter-spacing:.04em}
  input[type=text],input[type=email],input[type=password],textarea{width:100%;border:1px solid var(--card-bd);border-radius:8px;padding:9px 11px;font-family:var(--body);font-size:13.5px;color:var(--ink-l);background:#fff;margin-bottom:14px}
  input:focus,textarea:focus{outline:2px solid var(--emerald-deep);outline-offset:2px;border-color:#cfe0d4}
  input[type=file]{width:100%;border:1px solid var(--card-bd);border-radius:8px;background:#fff;font-size:13px;color:var(--muted);padding:8px 10px;margin-bottom:6px}
  input[type=file]::file-selector-button{margin-right:14px;border:1px solid var(--line-strong);background:var(--sage-50);color:var(--ink);padding:7px 15px;border-radius:999px;cursor:pointer;font-family:var(--body);font-weight:600;font-size:12.5px}
  input[type=file]::file-selector-button:hover{filter:brightness(.97)}
  .err{color:var(--danger);font-size:13px;margin:-6px 0 12px;min-height:16px}
  /* collapse the reserved error space when there's no error, so cards don't carry dead
     space under their last row (retention, brand, etc.) */
  .err:empty{min-height:0;margin:0!important}

  /* ---------- selects: field-pill + custom panel (native picker suppressed in JS) ---------- */
  select,select.msel-field{appearance:none;-webkit-appearance:none;-moz-appearance:none;width:100%;height:36px;
    padding:0 32px 0 14px;border-radius:999px;border:1px solid #DCD5C3;color:var(--ink-l);
    background:#F6F2E7 url("data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22><path d=%22M1 1l4 4 4-4%22 stroke=%22%239AA7B6%22 stroke-width=%221.6%22 fill=%22none%22 stroke-linecap=%22round%22/></svg>") no-repeat right 13px center;
    font-family:var(--body);font-weight:600;font-size:12.5px;line-height:34px;cursor:pointer;margin-bottom:14px;box-sizing:border-box}
  select:focus{outline:2px solid var(--emerald-deep);outline-offset:2px}
  .msel-panel{position:fixed;z-index:400;background:var(--card);border:1px solid #DCD5C3;border-radius:6px 6px 18px 18px;box-shadow:0 16px 40px rgba(10,22,40,.25);padding:5px;box-sizing:border-box}
  .msel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px;margin-bottom:4px;cursor:pointer;font-family:var(--body);font-weight:600;font-size:12.5px;line-height:1;color:var(--ink-l);border-bottom:1px solid #E7E0CE}
  .msel-head .msel-caret{color:#9AA7B6;font-size:10px}
  .msel-panel .msel-opt{padding:9px 26px 9px 12px;border-radius:9px;cursor:pointer;font-family:var(--body);font-weight:500;font-size:12.5px;line-height:1.4;color:var(--ink-l);white-space:nowrap;position:relative}
  .msel-panel .msel-opt:last-child{border-radius:9px 9px 14px 14px}
  .msel-panel .msel-opt:hover{background:var(--hover)}
  .msel-panel .msel-opt.msel-on{font-weight:700}
  .msel-panel .msel-opt.msel-on:after{content:"✓";position:absolute;right:10px;color:var(--emerald-deep)}

  /* ---------- toast (dark card, bottom-right) — our replacement for alert() ---------- */
  .mset-toast{position:fixed;right:22px;bottom:22px;z-index:500;width:320px;max-width:88vw;
    background:#16302A;color:var(--sage-50);border-radius:13px;padding:14px 16px 14px 17px;
    box-shadow:0 18px 50px rgba(7,15,28,.5);border-left:3px solid var(--forest);
    opacity:0;transform:translateY(10px);transition:opacity .22s ease,transform .22s ease}
  .mset-toast.on{opacity:1;transform:none}
  .mset-toast.t-err{border-left-color:var(--danger)}
  .mset-toast .trow{display:flex;align-items:flex-start;gap:10px}
  .mset-toast .tdot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--forest);margin-top:5px}
  .mset-toast.t-err .tdot{background:var(--danger)}
  .mset-toast .tbody{flex:1;min-width:0}
  .mset-toast .tt{font-size:13px;font-weight:600;line-height:1.35}
  .mset-toast .td{font-size:11.5px;color:#B7C3BC;margin-top:3px;line-height:1.45}
  .mset-toast .tact{margin-top:9px;font:600 11px/1 var(--mono);letter-spacing:.05em;color:var(--sage-pale,#9BD7A4);background:none;border:1px solid #3d5a50;border-radius:999px;padding:6px 13px;cursor:pointer}
  .mset-toast .tx{flex:none;background:none;border:0;color:#7d8c84;cursor:pointer;font-size:16px;line-height:1;padding:0 2px}

  /* ---------- waiting = moving: rolling dots ---------- */
  .mset-dots span{animation:msetBlink 1.3s infinite;opacity:.2}
  .mset-dots span:nth-child(2){animation-delay:.22s}
  .mset-dots span:nth-child(3){animation-delay:.44s}
  @keyframes msetBlink{0%,70%,100%{opacity:.2}30%{opacity:1}}

  /* Dashboard control strip: search grows, filter + New document are fixed, all one height. */
  .toolbar{margin-bottom:14px}
  .toolbar .tb{height:40px;margin:0}
  .toolbar input.tb{flex:1;min-width:0;margin-bottom:0}
  .toolbar select.tb{flex:0 0 176px;width:176px;line-height:38px}
  .toolbar .btn.tb{flex:0 0 auto;padding:0 18px;white-space:nowrap}
  /* Files chosen in the wizard — our own list, so individual files can be removed. */
  .picked{border:1px solid var(--card-bd);border-radius:11px;background:var(--sage-50);overflow:hidden}
  .prow{display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:13px;border-top:1px solid var(--line)}
  .prow:first-child{border-top:none}
  .prow .pn{color:var(--muted);font-variant-numeric:tabular-nums;flex:0 0 auto}
  .prow .pf{font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:55%}
  .prow .rm{flex:0 0 26px;width:26px;height:26px;font-size:12px}
  table{width:100%;border-collapse:collapse;font-size:14px}
  th{text-align:left;color:var(--label);font:600 10px/1 var(--mono);text-transform:uppercase;letter-spacing:.09em;padding:9px 10px;border-bottom:1px solid var(--line)}
  td{padding:12px 10px;border-bottom:1px solid var(--hairline)}
  tr.clk:hover{background:var(--hover);cursor:pointer}
  /* status badges — pill, mono, the spec status trio */
  .pill{display:inline-flex;align-items:center;gap:6px;font:600 10.5px/1 var(--mono);letter-spacing:.03em;padding:5px 11px;border-radius:999px}
  .pill::before{content:"";width:7px;height:7px;border-radius:50%}
  .pill.completed,.pill.signed,.pill.admin{background:#E7F0E8;color:var(--forest);border:1px solid #cfe0d4} .pill.completed::before,.pill.signed::before,.pill.admin::before{background:var(--emerald-deep)}
  .pill.in_progress,.pill.sent{background:#E7F0E8;color:var(--emerald-deep);border:1px solid #cfe0d4} .pill.in_progress::before,.pill.sent::before{background:var(--emerald-bright)}
  .pill.draft,.pill.member{background:#eceef1;color:var(--muted);border:1px solid #dfe3e8} .pill.draft::before,.pill.member::before{background:var(--muted)}
  .pill.declined,.pill.bounced{background:#FBECE7;color:#B0392A;border:1px solid #EBD4C0} .pill.declined::before,.pill.bounced::before{background:var(--danger)}
  .pill.pending,.pill.notified,.pill.opened{background:#FBF3E0;color:#8A6E2E;border:1px solid #E3D5AE} .pill.pending::before,.pill.notified::before,.pill.opened::before{background:var(--seal)}
  /* retention countdown badge — amber like pending: urgent, not an error */
  .pill.retwarn{background:#FBF3E0;color:#8A6E2E;border:1px solid #E3D5AE} .pill.retwarn::before{background:var(--seal)}
  .muted{color:var(--muted)} .small{font-size:13px}
  .row{display:flex;gap:10px;align-items:center}.right{justify-content:flex-end}
  .signer-row{display:flex;gap:10px;margin-bottom:10px;align-items:center}.signer-row input{margin-bottom:0}
  .rm{flex:0 0 32px;width:32px;height:32px;border-radius:999px;border:1px solid var(--card-bd);background:#fff;color:var(--danger);cursor:pointer;font-size:15px;display:flex;align-items:center;justify-content:center}
  .rm:hover{background:#FBECE7;border-color:#EBD4C0}.rm:disabled{opacity:.35;cursor:not-allowed}
  .links{background:var(--sage-50);border:1px solid var(--line);border-radius:12px;padding:14px;margin-top:14px}.links a{word-break:break-all}
  .steps{display:flex;align-items:center;margin-bottom:22px}
  .steps .s{font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:8px}
  .steps .s .n{width:24px;height:24px;border-radius:50%;border:1.5px solid var(--line-strong);display:flex;align-items:center;justify-content:center;font-size:12px}
  .steps .s.on{color:var(--ink);font-weight:600}.steps .s.on .n{background:var(--ink);border-color:var(--ink);color:#fff}
  .steps .s.done .n{background:var(--emerald-deep);border-color:var(--emerald-deep);color:#fff}
  .steps .bar{width:46px;height:2px;background:var(--line-strong);margin:0 14px;border-radius:2px}
  .tip{font-size:12px;color:var(--ink-l);background:#FBF3E0;border:1px solid #E3D5AE;border-left:3px solid var(--seal);border-radius:9px;padding:11px 13px;margin-top:14px}
  /* tabs — underline pattern */
  .tabs{display:flex;gap:4px;border-bottom:2px solid var(--card-bd);margin-bottom:14px;flex-wrap:wrap;background:none;padding:0}
  .tab{flex:0 0 auto;text-align:center;font-weight:600;font-size:13px;padding:10px 15px;border:0;background:none;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;border-radius:0}
  .tab.on{color:var(--head-l);background:none;box-shadow:none;border-bottom-color:var(--emerald-deep)}
  .tab:focus-visible{outline:2px solid var(--emerald-deep);outline-offset:2px}
  #pad{width:100%;height:150px;border:1px solid var(--line);border-radius:12px;background:#fff;touch-action:none;display:block;cursor:crosshair}
  .typed{font-family:'Caveat',cursive;font-size:40px;color:var(--ink);height:150px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:12px}
  .check{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--ink-3);margin:14px 0;cursor:pointer}
  .check .box{width:18px;height:18px;border:1.5px solid var(--emerald-deep);border-radius:5px;flex:0 0 18px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;background:#fff}
  .check.on .box{background:var(--emerald-deep)}
  .done-ico{width:70px;height:70px;border-radius:50%;background:#E7F0E8;color:var(--emerald-deep);font-size:34px;display:flex;align-items:center;justify-content:center;margin:10px auto 14px}
  .center{text-align:center}
  .ev{font-size:12.5px;color:var(--ink-3);padding:5px 0;border-top:1px solid var(--line)}.ev:first-child{border-top:none}
  .ev .t{color:var(--muted);display:inline-block;min-width:150px}
  .palette{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;align-items:center}
  .fchip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--card-bd);border-radius:999px;padding:7px 13px;font-size:13px;background:#fff;cursor:grab;font-weight:500}
  .fchip:hover{border-color:var(--emerald)}
  #pdfpages{max-height:70vh;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:12px;background:var(--sage-50)}
  .pageblock{position:relative;margin:0 auto 16px;background:#fff;box-shadow:var(--shadow)}
  .pageblock canvas{display:block;max-width:100%}
  .droplayer{position:absolute;inset:0}
  .plabel{position:absolute;top:5px;right:7px;font-size:11px;color:var(--muted);background:rgba(255,255,255,.8);padding:1px 6px;border-radius:8px}
  /* placed fields — brand colour per type via --fc */
  .placed{position:absolute;border:1.5px solid var(--fc,var(--emerald-deep));background:var(--field-bg);border-radius:8px;box-shadow:0 1px 2px rgba(10,22,40,.06);cursor:move;box-sizing:border-box;min-width:44px;min-height:26px;transition:box-shadow .15s ease,background .15s ease}
  .placed:hover{box-shadow:0 4px 14px rgba(10,22,40,.15)}
  .placed.t-signature{--fc:#3B7D44;--fcs:rgba(126,195,137,.18)}
  .placed.t-name{--fc:#16304A;--fcs:rgba(22,48,74,.12)}
  .placed.t-date{--fc:#B8934A;--fcs:rgba(184,147,74,.16)}
  .placed.t-reason{--fc:#1B4A22;--fcs:rgba(27,74,34,.14)}
  .placed.t-initials{--fc:#2F6D7A;--fcs:rgba(47,109,122,.13);min-width:40px}
  .placed.t-text{--fc:#5A4B8C;--fcs:rgba(90,75,140,.13)}
  .docsep{margin:18px 0 8px;font:600 10px/1 var(--mono);color:var(--label);text-transform:uppercase;letter-spacing:.09em}
  .placed.t-checkbox{--fc:#0A1628;--fcs:rgba(10,22,40,.10);min-width:30px;min-height:24px}
  .placed .lbl{position:absolute;top:-9px;left:7px;height:17px;padding:0 7px;background:var(--fc);color:#fff;font-size:9.5px;font-weight:600;letter-spacing:.01em;border-radius:5px;display:inline-flex;align-items:center;gap:4px;white-space:nowrap;max-width:calc(100% - 14px);overflow:hidden;text-overflow:ellipsis;pointer-events:none;box-shadow:0 1px 3px rgba(10,22,40,.20)}
  .placed .hint{position:absolute;inset:0;padding:0 7px;display:flex;align-items:center;color:var(--fc);opacity:.8;font-size:11px;font-weight:500;pointer-events:none;white-space:nowrap;overflow:hidden}
  .placed .hint.left{justify-content:flex-start;text-align:left}
  .placed .hint.mid{justify-content:flex-start;text-align:left}
  .placed.t-signature .hint{font-family:'Caveat',cursive;font-size:19px;opacity:.45}
  .guide{position:absolute;pointer-events:none;z-index:4}
  .guide-v{top:0;bottom:0;width:0;border-left:1px dashed var(--emerald-deep);opacity:.7}
  .guide-h{left:0;right:0;height:0;border-top:1px dashed var(--emerald-deep);opacity:.7}
  .guide.g-left{border-left:2px solid var(--emerald-deep);opacity:1}
  .guide.g-xpage{border-left-style:dotted;border-top-style:dotted;opacity:.6}
  .placed .x{position:absolute;top:-9px;right:-9px;width:18px;height:18px;background:#fff;border:1px solid var(--line-strong);border-radius:50%;color:var(--muted);font-weight:600;font-size:10px;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 1px 4px rgba(10,22,40,.16);opacity:0;transform:scale(.85);pointer-events:none;transition:opacity .12s ease,transform .12s ease,background .12s ease,color .12s ease}
  .placed:hover .x{opacity:1;transform:scale(1);pointer-events:auto}
  .placed .x:hover{background:var(--danger);color:#fff;border-color:var(--danger)}
  .placed .rsz{position:absolute;right:2px;bottom:2px;width:10px;height:10px;cursor:nwse-resize;opacity:0;pointer-events:none;transition:opacity .12s ease}
  .placed:hover .rsz{opacity:.9;pointer-events:auto}
  .placed .rsz::after{content:"";position:absolute;right:0;bottom:0;width:9px;height:9px;border-right:2px solid var(--fc);border-bottom:2px solid var(--fc);border-radius:0 0 3px 0}
  /* Our own text-prompt / confirm dialog — native browser chrome reads as if the page crashed. */
  /* ---------- layer stack (§6) — low → high; scrims are rgba(7,15,28,.5), position:fixed inset:0 ----------
     Any dialog that can be opened from another dialog gets a HIGHER z than its parent.
       210  docked pages (full-screen sub-views)      — reserved, not used in Sign yet
       240  account popover (.acct-pop)
       255  secondary scrims (aux dialogs)            — reserved
       260  Settings (.modal-ov.ov-settings)
       270  standard modal dialogs (.modal-ov)        — System status, confirm, What's new
       400  custom select panel (.msel-panel)
       470  command palette                          — reserved, not used in Sign yet
       475  help sheet (.modal-ov.ov-help)           — the Guide
       500  toasts (.mset-toast, always on top)
     ------------------------------------------------------------------------------------------------------ */
  .modal-ov{position:fixed;inset:0;z-index:270;background:rgba(7,15,28,.5);display:flex;align-items:center;justify-content:center;padding:22px}
  .modal-ov.ov-settings{z-index:260}          /* Settings sits below dialogs it can open (Status) */
  .modal-ov.ov-help{z-index:475}              /* Guide / help sheet — above everything but toasts */
  .modal-card{background:var(--card);border:1px solid var(--card-bd);border-radius:16px;box-shadow:0 24px 70px rgba(10,22,40,.45);padding:24px 26px;width:100%;max-width:430px}
  .modal-card h3{font-family:var(--display);font-size:19px;color:var(--head-l);margin:0 0 14px}
  .modal-card input{margin-bottom:16px}
  /* Dialog footer convention: CENTERED row; secondary (.mbtn-s) first, primary (.mbtn-p) last;
     a lone Close is still centered here. */
  .modal-foot{display:flex;gap:10px;justify-content:center;margin-top:20px}
  /* Large scrolling dialog shell for Settings / System status (fixed head ✕ + scroll body + centered foot) */
  .app-modal{position:relative;background:var(--card);border:1px solid var(--card-bd);border-radius:16px;box-shadow:0 24px 70px rgba(10,22,40,.45);width:100%;max-width:660px;max-height:88vh;display:flex;flex-direction:column;overflow:hidden}
  .app-modal-body{overflow:auto;padding:22px 26px 6px;flex:1;overscroll-behavior:contain}
  .app-modal-body>h2:first-child{margin-top:0}
  .app-modal-body .card:last-child{margin-bottom:2px}
  .app-modal-foot{flex:none;display:flex;gap:10px;justify-content:center;padding:14px 26px 20px;border-top:1px solid var(--line)}
  /* --- SIGNER: the document reader --- */
  .msg{background:var(--sage-50);border:1px solid var(--line);border-left:3px solid var(--emerald);border-radius:9px;padding:10px 12px;margin:0 0 14px}
  .signdoc{max-height:60vh;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--sage-50);overscroll-behavior:contain}
  .signdoc.fb{max-height:none;background:#fff;padding:0}
  .fbbox{padding:16px}
  .docend{text-align:center;font-size:12px;color:var(--muted);padding:4px 0 2px}
  .marklayer{position:absolute;inset:0;pointer-events:none}
  .sigmark{position:absolute;box-sizing:border-box;border:1.5px dashed var(--fc,var(--emerald-deep));
           background:var(--fcs,rgba(126,195,137,.16));border-radius:10px;pointer-events:none;
           min-width:44px;min-height:22px}
  .sigmark .mk{position:absolute;top:-9px;left:6px;max-width:96%;background:var(--fc,var(--emerald-deep));
               color:#fff;font-size:9.5px;font-weight:600;padding:1px 7px;border-radius:9px;
               white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sigmark.t-signature{--fc:#3B7D44;--fcs:rgba(126,195,137,.18)}
  .sigmark.t-name{--fc:#16304A;--fcs:rgba(22,48,74,.12)}
  .sigmark.t-date{--fc:#B8934A;--fcs:rgba(184,147,74,.16)}
  .sigmark.t-reason{--fc:#1B4A22;--fcs:rgba(27,74,34,.14)}
  .sigmark.t-initials{--fc:#2F6D7A;--fcs:rgba(47,109,122,.13)}
  .sigmark.t-text{--fc:#5A4B8C;--fcs:rgba(90,75,140,.13)}
  .sigmark.t-checkbox{--fc:#0A1628;--fcs:rgba(10,22,40,.10)}
  .placed.t-role,.sigmark.t-role{--fc:#8C5A2B;--fcs:rgba(140,90,43,.14)}
  .readgate{margin:12px 0 2px;font-size:12.5px;color:var(--ink-l);background:#FBF3E0;border:1px solid #E3D5AE;
            border-left:3px solid var(--seal);border-radius:9px;padding:9px 12px}
  .readgate.done{background:#E7F0E8;border-color:#cfe0d4;border-left-color:var(--emerald-deep);color:var(--forest)}
  .kv{font-size:14px;line-height:2}.kv b{color:var(--muted);font-weight:500;display:inline-block;min-width:90px}
  .entries{margin:8px 0 4px;padding:9px 12px;border-radius:9px;background:var(--sage-50);border:1px solid var(--line)}
  .entries div{padding:1px 0}
