/* WCF Group house style, taken from the Initial Disclosure Document and
   Privacy Notice: Helvetica/Arial, black headings, a coral rule, pink table
   headers, blue-grey shaded fields, and the Winchester red for actions. */

:root {
  --ink: #141414;
  --text: #262626;
  --muted: #5d5f63;
  --faint: #8a8d92;
  --line: #d7d7d7;
  --line-soft: #e8e8e8;
  --row: #f7f7f7;
  --head: #fdebea;
  --accent: #ec746f;          /* the coral rule */
  --brand: #d4123e;           /* Winchester red, darkened for contrast */
  --brand-hover: #b30e33;
  --brand-soft: #fff1f3;
  --field: #e3e8ef;           /* the shaded placeholder in the documents */
  --field-focus: #ffffff;
  --navy: #1e293b;
  --ok: #157347;
  --ok-soft: #e8f5ee;
  --warn: #9a5b00;
  --warn-soft: #fff6e5;
  --err: #b42318;
  --err-soft: #fef1f0;
  --desk: #e9eaed;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 4px 18px rgba(20, 20, 20, .07);
  --radius: 4px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sig: "Snell Roundhand", "Segoe Script", "Apple Chancery", "Brush Script MT", "URW Chancery L", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--desk);
}
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------ top bar */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 20;
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.topbar .logo { height: 40px; width: auto; display: block; }
.topbar .t { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.topbar .help { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.topbar .help a { color: var(--ink); font-weight: 700; text-decoration: none; }

/* ------------------------------------------------------------ step tracker */
.steps {
  max-width: 1080px; margin: 0 auto; padding: 14px 16px 0;
  display: flex; gap: 6px; list-style: none; overflow-x: auto; scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.steps li { flex: 1 1 0; min-width: 84px; }
.steps button {
  width: 100%; border: 0; background: none; padding: 0 0 8px; cursor: pointer; text-align: left;
  border-bottom: 3px solid #cfd2d6; color: var(--faint); font-size: 12.5px;
}
.steps button .n { font-weight: 700; margin-right: 4px; }
.steps li.done button { border-color: var(--accent); color: var(--muted); }
.steps li.current button { border-color: var(--brand); color: var(--ink); font-weight: 700; }
.steps button:disabled { cursor: default; }

/* ------------------------------------------------------------ the document */
.desk { max-width: 1080px; margin: 0 auto; padding: 18px 16px 120px; }
.paper {
  background: var(--paper);
  max-width: 860px; margin: 0 auto;
  box-shadow: var(--shadow);
  padding: 44px 56px 30px;
  min-height: 60vh;
}
.doc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.doc-head .logo { width: 150px; height: auto; margin-left: -8px; }
.doc-head .running { font-size: 12px; color: var(--muted); text-align: right; }
.doc-title { font-size: 26px; font-weight: 700; margin: 18px 0 2px; letter-spacing: -.2px; }
.doc-sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.rule { border: 0; border-top: 2px solid var(--accent); margin: 0 0 14px; }
.info-grid {
  display: grid; grid-template-columns: 120px 1fr 120px 1fr; gap: 4px 12px;
  font-size: 12.5px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 26px;
}
.info-grid dt { color: var(--muted); }
.info-grid dd { margin: 0; color: var(--ink); }

.sec-title { font-size: 19px; font-weight: 700; margin: 6px 0 8px; }
.lead { margin: 0 0 18px; color: var(--text); max-width: 68ch; }
.doc-foot {
  margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-size: 10.5px; color: var(--faint); display: flex; gap: 14px; justify-content: space-between;
}
.doc-foot .pg { white-space: nowrap; }

/* Field tables — the "Item | Details" tables of the documents */
.dtable { border: 1px solid var(--line); margin: 0 0 22px; }
.dtable .dhead {
  background: var(--head); border-bottom: 1.5px solid var(--accent);
  padding: 8px 12px; font-weight: 700; color: var(--ink); font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.frow {
  display: grid; grid-template-columns: minmax(200px, 38%) 1fr; gap: 0;
  border-top: 1px solid var(--line-soft);
}
.dhead + .frow, .dtable > .frow:first-child { border-top: 0; }
.frow:nth-of-type(even) { background: #fbfbfb; }
.flabel { padding: 11px 12px; font-size: 13.5px; color: var(--muted); }
.flabel .req { color: var(--brand); margin-left: 2px; }
.flabel .hint { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.fctl { padding: 7px 12px 9px; min-width: 0; }
.fctl .note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--accent); }
.frow.invalid .flabel { color: var(--err); }
.ferr { color: var(--err); font-size: 12.5px; margin-top: 4px; font-weight: 600; }

.inp, select.inp, textarea.inp {
  width: 100%; min-height: 38px;
  border: 1px solid transparent; border-bottom: 1px solid #b9c2cf;
  background: var(--field); border-radius: 2px;
  padding: 7px 9px; font-size: 15px; color: var(--ink);
  transition: background .12s, border-color .12s;
}
textarea.inp { resize: vertical; line-height: 1.45; }
.inp:hover { border-bottom-color: #8e99a8; }
.inp:focus { outline: none; background: var(--field-focus); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(212, 18, 62, .12); }
.frow.invalid .inp { border-bottom-color: var(--err); background: var(--err-soft); }
.inp-pre { display: flex; align-items: stretch; }
.inp-pre span {
  display: inline-flex; align-items: center; padding: 0 9px; background: #d5dce6; color: var(--muted);
  border-bottom: 1px solid #b9c2cf; font-size: 14px;
}
.inp-pre .inp { border-radius: 0 2px 2px 0; }
.inp-pre.suffix span { order: 2; }
.inp.w-s { max-width: 180px; }
.inp.w-m { max-width: 320px; }
.addr { display: grid; gap: 6px; }
.addr .row2 { display: grid; grid-template-columns: 1fr 140px; gap: 6px; }
.dur { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dur label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.dur .inp { width: 74px; }
.monthpick { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 110px); gap: 8px; }

.choices { display: flex; flex-direction: column; gap: 4px; padding-top: 3px; }
.choices.inline { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
.choice { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; font-size: 14.5px; color: var(--ink); }
.choice input { appearance: none; -webkit-appearance: none; margin: 2px 0 0; flex: 0 0 auto; width: 18px; height: 18px; border: 1.5px solid #8e99a8; background: #fff; display: grid; place-content: center; cursor: pointer; }
.choice input[type=radio] { border-radius: 50%; }
.choice input[type=checkbox] { border-radius: 2px; }
.choice input:checked { border-color: var(--brand); background: var(--brand); }
.choice input[type=radio]:checked { background: #fff; }
.choice input[type=radio]:checked::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.choice input[type=checkbox]:checked::before { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.choice input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.consent { background: var(--row); border: 1px solid var(--line-soft); padding: 10px 12px; border-radius: var(--radius); }
.consent .choice { font-size: 14px; line-height: 1.45; }

/* Find your company (Companies House) */
.chbox .ch-body { padding: 12px; }
.chbox .ch-lead { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.ch-field { position: relative; }
.ch-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 25; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 320px; overflow: auto;
}
.ch-results li { padding: 8px 12px; cursor: pointer; display: grid; gap: 1px; }
.ch-results li:hover, .ch-results li[aria-selected=true] { background: var(--brand-soft); }
.ch-results .ch-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.ch-results .ch-meta { font-size: 12.5px; color: var(--muted); }
.ch-status { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ch-status:empty { display: none; }
.ch-summary { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 13.5px; }
.ch-ok { display: flex; gap: 8px; align-items: flex-start; color: var(--ok); }
.ch-ok strong { color: var(--ink); }
.ch-warn { margin: 8px 0 0; padding: 8px 10px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); }
.ch-people p { margin: 8px 0 4px; }
.ch-people ul { margin: 0; padding-left: 18px; }
.ch-people .ch-note { color: var(--muted); font-size: 12.5px; }

/* Repeaters (people, existing finance) */
.rep-item .dhead .who { font-weight: 700; }
.rep-item .dhead .who small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.rep-add { margin: -8px 0 24px; }
.rep-err { margin: -14px 0 18px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #b5b5b5; background: #fafafa; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: rgba(0, 0, 0, .04); }
.btn.link { border: 0; background: none; color: var(--brand); padding: 4px 0; min-height: 0; font-weight: 600; }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.danger { color: var(--err); border-color: #f0c7c3; }
.btn.danger:hover { background: var(--err-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; flex: 0 0 auto; }

/* ------------------------------------------------------------ action bar */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.actionbar-in { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.actionbar .status { font-size: 12.5px; color: var(--muted); margin-right: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.actionbar .status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.actionbar .status.dirty .dot { background: #d1a000; }
.actionbar .status.err .dot { background: var(--err); }

/* ------------------------------------------------------------ welcome */
.welcome-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: start; }
.needs { background: var(--row); border: 1px solid var(--line-soft); padding: 16px 18px; }
.needs h3 { font-size: 15px; margin-bottom: 8px; }
.needs ul { margin: 0; padding-left: 18px; }
.needs li { margin: 4px 0; font-size: 14px; }
.facts { display: grid; gap: 10px; margin: 18px 0; }
.fact { display: flex; gap: 10px; font-size: 14px; }
.fact .ico { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }

/* ------------------------------------------------------------ uploads */
.upl { display: grid; gap: 8px; }
.drop {
  border: 1.5px dashed #b9c2cf; background: #f6f8fb; border-radius: var(--radius);
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted);
}
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.files li {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 8px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.files li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; color: var(--ink); }
.files li .sz { color: var(--faint); font-size: 12px; white-space: nowrap; }
.files li.busy { color: var(--muted); }
.files li .x { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 2px 6px; font-size: 18px; line-height: 1; }
.files li .x:hover { color: var(--err); }
.bar { height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; width: 80px; }
.bar i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .15s; }

/* ------------------------------------------------------------ review */
.rv-sec { margin-bottom: 26px; }
.rv-sec .sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rv-sec h2 { font-size: 17px; }
.rv-row { display: grid; grid-template-columns: minmax(200px, 38%) 1fr; border-top: 1px solid var(--line-soft); font-size: 14px; }
.rv-row:nth-of-type(even) { background: var(--row); }
.rv-row .k { padding: 8px 12px; color: var(--muted); }
.rv-row .v { padding: 8px 12px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-row .v.blank { color: var(--faint); }
.rv-row.bad .v { color: var(--err); font-weight: 600; }
.issues { background: var(--err-soft); border: 1px solid #f3c6c1; color: var(--err); padding: 12px 14px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.issues ul { margin: 6px 0 0; padding-left: 18px; }
.issues button { color: var(--err); text-decoration: underline; }

/* ------------------------------------------------------------ signing */
.signer-box { margin-bottom: 26px; }
.doc-card { border: 1px solid var(--line); margin-bottom: 26px; }
.doc-card > header {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px;
  background: var(--head); border-bottom: 1.5px solid var(--accent);
}
.doc-card .badge {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.doc-card.signed .badge { background: var(--ok); }
.doc-card h3 { font-size: 16px; }
.doc-card .meta { font-size: 12.5px; color: var(--muted); }
.doc-card .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.doc-card .body { padding: 14px 16px 16px; }
.doc-card .opened { font-size: 12.5px; color: var(--ok); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.doc-card .not-opened { font-size: 12.5px; color: var(--warn); font-weight: 600; }
.thumbs { display: flex; gap: 8px; margin: 2px 0 14px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { border: 1px solid var(--line); padding: 0; background: #fff; cursor: zoom-in; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.thumbs button:hover { border-color: var(--brand); }
.thumbs canvas { display: block; width: 86px; height: auto; }
.decl { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; }
.decl li { margin: 5px 0; }
.ack-list { display: grid; gap: 8px; margin-bottom: 16px; }

/* The signature block, drawn like the one on page 4 of the disclosure */
.sigblock { border: 1px solid var(--line); background: #fff; }
.sigblock .sb-head { background: var(--row); padding: 8px 12px; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.fieldshade { background: var(--field); padding: 1px 6px; border-radius: 2px; font-weight: inherit; }
.sigblock .sb-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; padding: 10px 12px 12px; }
.sigblock .sb-lbl { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.sigblock .sb-name { grid-column: 1 / -1; font-size: 13.5px; }
.sigfield {
  position: relative; width: 100%; height: 78px; border: 0; border-bottom: 1.5px solid var(--ink);
  background: #fffbe6; cursor: pointer; display: grid; place-items: center; padding: 0;
  outline: 2px dashed #e0b400; outline-offset: -2px; transition: background .15s;
}
button.sigfield:hover:not(:disabled) { background: #fff4bf; }
.sigfield .tag {
  position: absolute; left: -2px; top: 50%; transform: translate(-100%, -50%);
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 4px 8px 4px 7px; clip-path: polygon(0 0, 82% 0, 100% 50%, 82% 100%, 0 100%); padding-right: 14px;
}
.sigfield .cta { font-weight: 700; color: var(--ink); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.sigfield:disabled { background: #f4f4f4; outline-color: #cfcfcf; cursor: not-allowed; }
.sigfield:disabled .cta { color: var(--faint); font-weight: 600; font-size: 13px; text-align: center; padding: 0 10px; }
.sigfield:disabled .tag { background: #9a9a9a; }
.sigfield.done { background: #fff; outline: none; cursor: default; }
.sigfield.done img { max-height: 66px; max-width: 92%; }
.sigmeta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sigmeta .btn.link { font-size: 12px; }
.datefield { height: 78px; display: flex; align-items: flex-end; border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; font-size: 15px; color: var(--ink); }
.datefield.empty { color: var(--faint); }

.submit-box { border: 2px solid var(--ink); padding: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.submit-box p { margin: 0; flex: 1 1 280px; font-size: 14px; }

.done-hero { text-align: center; padding: 20px 0 10px; }
.done-hero .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; }
.done-hero h2 { font-size: 24px; margin-bottom: 6px; }
.next { counter-reset: n; list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.next li { counter-increment: n; display: flex; gap: 12px; font-size: 14.5px; }
.next li::before { content: counter(n); width: 24px; height: 24px; border-radius: 50%; background: var(--head); color: var(--ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: 0 0 auto; }

/* ------------------------------------------------------------ modal / viewer */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15, 18, 24, .58); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #fff; width: 100%; max-width: 580px; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); max-height: calc(100vh - 32px); overflow: auto; }
.dialog header { padding: 16px 20px 10px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.dialog header h2 { font-size: 18px; }
.dialog header .x { margin-left: auto; }
.dialog .dbody { padding: 16px 20px; }
.dialog footer { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected=true] { color: var(--ink); border-color: var(--brand); }
.padwrap { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 3px; touch-action: none; }
.padwrap canvas { display: block; width: 100%; height: 180px; cursor: crosshair; touch-action: none; }
.padwrap .baseline { position: absolute; left: 24px; right: 24px; bottom: 44px; border-top: 1px solid #c9c9c9; pointer-events: none; }
.padwrap .x-mark { position: absolute; left: 10px; bottom: 46px; color: #b0b0b0; font-size: 18px; pointer-events: none; }
.padwrap .hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b4b4b4; pointer-events: none; font-size: 15px; }
.typed-preview { border: 1px solid var(--line); height: 120px; display: grid; place-items: center; font-family: var(--sig); font-size: 46px; color: #111; overflow: hidden; white-space: nowrap; padding: 0 12px; }
.intent { font-size: 13px; color: var(--muted); margin-top: 12px; }

.viewer { position: fixed; inset: 0; z-index: 110; background: #52565c; display: flex; flex-direction: column; }
.viewer .vbar { background: #2c2f33; color: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.viewer .vbar .vt { font-weight: 700; font-size: 14px; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vbar .pc { font-size: 13px; color: #cfd3d8; white-space: nowrap; }
.viewer .vbar .btn { min-height: 34px; padding: 5px 12px; font-size: 13px; background: #44484e; color: #fff; border-color: #5b6067; }
.viewer .vbar .btn:hover { background: #575c63; }
.viewer .vbar .btn.primary { background: var(--brand); border-color: var(--brand); }
.viewer .vpages { flex: 1; overflow: auto; padding: 18px 12px 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.viewer .vpage { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); max-width: 100%; }
.viewer .vpage canvas { display: block; width: 100%; height: auto; }
.viewer .vend { color: #e7e9ec; font-size: 13px; text-align: center; }
.viewer .vfoot {
  background: #2c2f33; color: #fff; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid #44484e;
}
.viewer .vfoot .choice { color: #fff; font-size: 14.5px; flex: 1 1 320px; margin: 0; }
.viewer .vfoot .choice input:disabled { opacity: .45; cursor: not-allowed; }
.viewer .vfoot .choice:has(input:disabled) { color: #b9bdc3; cursor: not-allowed; }
.viewer .vfoot .vhint { font-size: 12.5px; color: #f3c46b; }
.viewer .vfoot .vhint:empty { display: none; }

.updatebar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 250;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 6px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .25); font-size: 14px; max-width: calc(100vw - 24px);
}
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px);
}
.toast.err { background: var(--err); }
.overlay { position: fixed; inset: 0; z-index: 150; background: rgba(255, 255, 255, .85); display: grid; place-items: center; text-align: center; font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ staff */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 { font-size: 24px; margin-right: auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line-soft); padding: 12px 14px; border-radius: var(--radius); cursor: pointer; text-align: left; }
.stat:hover { border-color: var(--line); }
.stat.on { border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.stat .lbl { font-size: 12.5px; color: var(--muted); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar .inp { max-width: 360px; background: #fff; border: 1px solid var(--line); }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1.5px solid var(--accent); background: var(--head); white-space: nowrap; }
table.list td { padding: 11px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover td { background: #fafafa; }
table.list .ref { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
table.list .co { font-weight: 600; color: var(--ink); }
table.list .sub { font-size: 12.5px; color: var(--muted); }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list .acts { text-align: right; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.sent { background: #eef1f5; color: #4b5563; }
.pill.in_progress { background: var(--warn-soft); color: var(--warn); }
.pill.submitted { background: var(--ok-soft); color: var(--ok); }
.pill.void { background: #f1f1f1; color: #777; }
.empty { padding: 50px 16px; text-align: center; color: var(--muted); }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--row); border: 1px solid var(--line); padding: 8px; border-radius: 3px; min-width: 0; }
.okmsg { background: var(--ok-soft); color: var(--ok); padding: 10px 12px; border-radius: var(--radius); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.errmsg { background: var(--err-soft); color: var(--err); padding: 10px 12px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; position: sticky; top: 76px; min-width: 0; }
.side > * { min-width: 0; }
.side .btns .btn { white-space: normal; text-align: center; }
.side .card { padding: 14px 16px; }
.side h3 { font-size: 14px; margin-bottom: 8px; }
.side .kv { display: grid; grid-template-columns: 96px 1fr; gap: 4px 8px; font-size: 13px; }
.side .kv dt { color: var(--muted); }
.side .kv dd { margin: 0; overflow-wrap: anywhere; }
.side .btns { display: grid; gap: 8px; }
.side textarea { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 3px; padding: 8px; font-size: 13.5px; }
.audit { list-style: none; margin: 0; padding: 0; font-size: 12.5px; max-height: 360px; overflow: auto; }
.audit li { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.audit li:first-child { border-top: 0; }
.audit time { display: block; color: var(--faint); font-size: 11.5px; }
.sigs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.sigcard { border: 1px solid var(--line); padding: 10px 12px; font-size: 12.5px; }
.sigcard .t { font-weight: 700; color: var(--ink); font-size: 13px; margin-bottom: 6px; }
.sigcard img { max-width: 100%; height: 50px; object-fit: contain; display: block; margin: 4px 0; }
.sigcard .m { color: var(--muted); }
.sigcard.missing { color: var(--faint); background: var(--row); }
.flist { list-style: none; margin: 0; padding: 0; }
.flist li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.flist li:first-child { border-top: 0; }
.flist .cat { font-size: 12px; color: var(--muted); min-width: 150px; }
.flist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-hint { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.doc-group { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 14px 0 6px; }
.doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.docrow {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: grab;
}
.docrow:hover { border-color: #b5b5b5; background: #fcfcfc; }
.docrow.dragging { opacity: .5; }
.docrow.primary { border-color: var(--accent); background: var(--brand-soft); }
.docrow .grip { color: #b5b5b5; font-size: 12px; letter-spacing: -2px; user-select: none; }
.docrow > .ico { color: var(--brand); }
.docinfo { flex: 1; min-width: 0; display: grid; }
.docname { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
.docname:hover { color: var(--brand); text-decoration: underline; }
.docmeta { font-size: 12px; color: var(--muted); }
.doc-hash { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); overflow-wrap: anywhere; }
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login .card { padding: 26px 24px; }
.login img { width: 170px; display: block; margin: 0 auto 14px; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar .t { display: none; }
  .topbar .logo { height: 34px; }
  .desk { padding: 10px 0 120px; }
  .paper { padding: 26px 16px 20px; box-shadow: none; }
  .doc-head .logo { width: 120px; }
  .doc-title { font-size: 22px; }
  .info-grid { grid-template-columns: 96px 1fr; }
  .frow, .rv-row { grid-template-columns: 1fr; }
  .flabel { padding: 10px 10px 0; color: var(--ink); font-weight: 600; }
  .fctl { padding: 6px 10px 12px; }
  .rv-row .k { padding: 8px 10px 0; font-size: 12.5px; }
  .rv-row .v { padding: 2px 10px 8px; }
  .welcome-grid { grid-template-columns: 1fr; }
  .addr .row2 { grid-template-columns: 1fr 120px; }
  .sigblock .sb-body { grid-template-columns: 1fr; }
  .sigfield .tag { display: none; }
  .doc-card > header { flex-wrap: wrap; }
  .doc-card .acts { margin-left: 0; width: 100%; justify-content: flex-start; }
  .actionbar-in { padding: 8px 12px; }
  .actionbar .btn { padding: 9px 12px; }
  .actionbar .btn .lbl { display: none; }
  .actionbar .btn.primary { flex: 0 1 auto; min-width: 0; }
  .actionbar .status .txt { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; }
  .side { position: static; }
  .sigs-grid { grid-template-columns: 1fr; }
  .hide-s { display: none; }
  .docrow { gap: 8px; padding: 8px; }
  .docrow .grip { display: none; }
  .docrow .btn.small { padding: 5px 8px; }
  .form-grid .two { grid-template-columns: 1fr; }
  .doc-foot { flex-direction: column; gap: 4px; }
}

@media print {
  .topbar, .steps, .actionbar, .no-print { display: none !important; }
  body { background: #fff; }
  .paper { box-shadow: none; padding: 0; }
}
