/* NEXUS document system — application chrome.
   The document itself is styled by app/render.php; this is only the tool
   around it. Dense, plain and quick to fill: the thing being designed is the
   document, not the form that produces it. */

/* THE TYPEFACE, SERVED BY US.
   Every page fetched this from fonts.googleapis.com — two preconnects and a
   render-blocking stylesheet on a third party, on phones on an office
   connection in the UAE. The files were already in assets/fonts and already
   declared for the printed sheet, which was deliberately made not to depend
   on reaching Google; the application itself still did. Same eight faces,
   same unicode ranges, no network but ours. */
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/ibm-plex-sans-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/ibm-plex-sans-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/ibm-plex-sans-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/ibm-plex-sans-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/*
 * Application chrome tokens only. Printed sheets use document.css /
 * render.php with their own --ink/--brand — do not assume these names
 * travel into PDFs.
 *
 * Semantic aliases follow the Nexus satellite contract (primary, muted,
 * destructive, …) while keeping Office’s navy bar, amber CTA and Plex.
 */
:root {
  /* Legacy Office names — kept so existing rules and inline styles keep working. */
  --ink:#0a1a2f;
  --brand:#2d5daa;          /* Office blue; close to Nexus primary 206 92% 36% */
  --sky:#56b4e4;
  --accent:#efa13c;         /* Office primary action (amber) — intentional */
  --muted:#667a94;
  --line:#dde5f0;
  --surface:#eef2f7;
  --field:#fff;
  --ok:#1c7c54;
  --bad:#b3261e;
  --sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;

  /* Semantic map (Nexus-aligned roles → Office values). */
  --background:var(--surface);
  --foreground:var(--ink);
  --card:var(--field);
  --card-foreground:var(--ink);
  --primary:var(--brand);
  --primary-foreground:#fff;
  --secondary:#f2f5f9;
  --secondary-foreground:var(--ink);
  --muted-foreground:var(--muted);
  --accent-foreground:var(--ink);
  --destructive:var(--bad);
  --destructive-foreground:#fff;
  --success:var(--ok);
  --warning:var(--accent);
  --border:var(--line);
  /* Concrete colour — never self-reference (var(--input-border) here made
     every form border invalid and effectively invisible). Strong enough that
     white fields stay visible on white panels and on --surface. */
  --input-border:#7f96b1;
  --input-border-hover:#5f7896;
  --ring:var(--brand);
  --nav:#0a1a2f;            /* Top bar — deliberately navy, not glass */
  --nav-muted:#8fa6c0;
  --nav-link:#a8bcd4;
  --nav-hover:#162942;
  --panel-hover:#f7f9fc;
  --danger-soft:#fdecea;
  --danger-border:#e6c3c0;
  --success-soft:#eef7f2;
  --success-border:#b2d8c6;
  --warning-soft:#fdf6e8;
  --primary-soft:#f0f5fb;
  --accent-hover:#e0912b;
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--sans);color:var(--foreground);background:var(--background);-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--primary)}
:focus-visible{outline:2px solid var(--ring);outline-offset:2px;border-radius:2px}

/* ── bar ─────────────────────────────────────────────────────────── */
/* INSTALLED ON A PHONE, THE PAGE STARTS AT THE VERY TOP OF THE SCREEN.
   The status bar is declared black-translucent, so iOS draws the clock and
   the battery OVER the page. With viewport-fit=cover on the viewport meta,
   env() finally reports the notch, and this puts the bar's own navy behind
   it — white text on navy, which is what the translucent setting was chosen
   for. Without the padding the first row of the bar sits under the clock. */
.bar{display:flex;align-items:center;gap:1.4rem;background:var(--nav);color:#fff;flex-wrap:wrap;
  padding:calc(.7rem + env(safe-area-inset-top)) calc(1.1rem + env(safe-area-inset-right))
          .7rem calc(1.1rem + env(safe-area-inset-left))}
.bar .lock{display:flex;align-items:center;gap:.45em;font-size:1.05rem;flex:none;text-decoration:none;color:#fff}
.bar .lock svg{width:1.2em;height:1.2em;display:block}
.bar .lock b{font-weight:700;letter-spacing:-.025em}
.bar .lock span{color:var(--nav-muted);font-weight:400}
.bar nav{display:flex;gap:.2rem;flex-wrap:wrap}
.bar nav a{color:var(--nav-link);text-decoration:none;padding:.4rem .7rem;border-radius:3px;font-size:.86rem}
.bar nav a:hover{color:#fff;background:var(--nav-hover)}
.bar nav a[aria-current]{background:var(--primary);color:var(--primary-foreground)}
.bar .me{margin-inline-start:auto;display:flex;align-items:center;gap:.8rem;font-size:.82rem;color:var(--nav-muted)}
.bar .me a{color:#cfdcea}

/* The home indicator sits over the foot of the page in standalone, and the
   last row of a register was under it. */
.wrap{max-width:74rem;margin:0 auto;
  padding:1.6rem calc(1.1rem + env(safe-area-inset-right))
          calc(4rem + env(safe-area-inset-bottom)) calc(1.1rem + env(safe-area-inset-left))}
.wrap.narrow{max-width:32rem}
h1{font-size:1.4rem;margin:0 0 .25rem;letter-spacing:-.015em;font-weight:650;color:var(--foreground)}
.sub{color:var(--muted-foreground);margin:0 0 1.4rem;font-size:.9rem;line-height:1.5;max-width:46rem}

/* Page title + primary actions — shared across admin and workspace lists. */
.head,.page-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;
  gap:.75rem 1.25rem;margin:0 0 1.25rem;padding-bottom:.85rem;border-bottom:1px solid var(--border)}
.head > div:first-child,.page-head > div:first-child{flex:1 1 16rem;min-width:0}
.head h1,.page-head h1{margin:0 0 .25rem}
.head .sub,.page-head .sub{margin:0;max-width:42rem}
.head .btns,.page-head .btns,.head-actions{flex:none;display:flex;flex-wrap:wrap;gap:.45rem;align-items:center}
.head .btns .btn.primary,.page-head .btns .btn.primary,.head-actions .btn.primary{order:1}

/* Breadcrumbs — only where a real parent → child path exists. */
.crumbs{margin:0 0 .65rem;font-size:.8rem;line-height:1.4;color:var(--muted-foreground)}
.crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:.2rem .15rem}
.crumbs li{display:inline-flex;align-items:center;gap:.35rem;max-width:100%}
.crumbs li:not(:last-child)::after{content:"›";color:var(--muted-foreground);opacity:.55;margin-inline-end:.1rem}
.crumbs a{color:var(--primary);text-decoration:none}
.crumbs a:hover{text-decoration:underline}
.crumbs [aria-current=page]{color:var(--foreground);font-weight:500}

/* ── flash / alerts ──────────────────────────────────────────────── */
.flash{margin:0 0 1.2rem;padding:.75rem .95rem;background:var(--card);border:1px solid var(--border);
  border-inline-start:3px solid var(--warning);border-radius:4px;
  font-size:.88rem;line-height:1.55;box-shadow:0 1px 2px rgba(10,26,47,.05);
  display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem}
.flash > span{flex:1 1 auto;min-width:0}
.flash .flash-dismiss{flex:none;background:none;border:0;padding:.1rem .35rem;margin:-.15rem -.25rem 0 0;
  color:var(--muted-foreground);cursor:pointer;font-size:1.1rem;line-height:1;border-radius:3px}
.flash .flash-dismiss:hover{color:var(--foreground);background:var(--secondary)}
.flash.ok{border-color:var(--success-border);border-inline-start-color:var(--success);background:var(--success-soft)}
.flash.warn{border-color:#e8d4a8;border-inline-start-color:var(--warning);background:var(--warning-soft)}
.flash.err{border-color:var(--danger-border);border-inline-start-color:var(--destructive);background:var(--danger-soft);color:#7a1c15}
.err{margin:0 0 1rem;padding:.75rem .95rem;background:var(--danger-soft);border:1px solid var(--danger-border);
  border-inline-start:3px solid var(--destructive);border-radius:4px;
  color:#7a1c15;font-size:.88rem}

/* ── panels ──────────────────────────────────────────────────────── */
.panel{background:var(--card);border:1px solid var(--border);border-radius:5px;padding:1.25rem 1.35rem;margin-bottom:1.25rem;
  box-shadow:0 1px 2px rgba(10,26,47,.04)}
.panel h2{margin:0 0 .95rem;font-size:.72rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--muted-foreground);
  padding-bottom:.55rem;border-bottom:1px solid var(--border)}

/* ── forms ───────────────────────────────────────────────────────── */
.f{display:block;margin-bottom:.9rem}
.f > span{display:block;font-size:.76rem;font-weight:550;color:#3d536a;margin-bottom:.3rem}
.f input,.f select,.f textarea{width:100%;background:var(--field);color:var(--foreground);
  border:1px solid var(--input-border);border-radius:4px;padding:.5rem .62rem;font-size:.88rem;
  line-height:1.35;min-height:2.4rem;box-shadow:inset 0 1px 1px rgba(10,26,47,.05)}
.f textarea{resize:vertical;line-height:1.55;min-height:5rem}
.f input::placeholder,.f textarea::placeholder{color:var(--muted-foreground);opacity:.85}
.f input:hover,.f select:hover,.f textarea:hover{border-color:var(--input-border-hover)}
.f input:focus,.f select:focus,.f textarea:focus,
.f input:focus-visible,.f select:focus-visible,.f textarea:focus-visible{
  outline:2px solid var(--ring);outline-offset:1px;border-color:var(--primary);box-shadow:0 0 0 3px rgba(45,93,170,.12)}
.f input[disabled],.f select[disabled],.f textarea[disabled],
.f input[readonly],.f textarea[readonly]{background:var(--secondary);color:var(--muted-foreground);
  border-color:#c5d0de;cursor:default;box-shadow:none}
.f input[aria-invalid=true],.f select[aria-invalid=true],.f textarea[aria-invalid=true],
.f input.is-invalid,.f select.is-invalid,.f textarea.is-invalid,
.f.err input,.f.err select,.f.err textarea{border-color:var(--destructive);background:var(--danger-soft);
  box-shadow:inset 0 0 0 1px rgba(179,38,30,.12)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.75rem}
@media(max-width:44rem){.row2,.row3{grid-template-columns:1fr}}
.hint{margin:.35rem 0 0;font-size:.76rem;line-height:1.5;color:var(--muted-foreground)}
.check{display:flex;align-items:center;gap:.45rem;margin:.65rem 0;font-size:.86rem}
.check input{width:auto;accent-color:var(--primary)}

/* ── buttons ─────────────────────────────────────────────────────── */
/* HIDDEN MEANS HIDDEN. The browser's own [hidden]{display:none} is a
   user-agent rule, and any author rule that sets display — .btn does — wins
   over it. So a hidden button was drawn anyway: the Share buttons ship hidden
   and are revealed by script only where a file can actually be shared, and on
   every desktop without that they stood there, visible and dead. Found by a
   screenshot disagreeing with the script that said the button was hidden. */
[hidden]{display:none !important}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;background:var(--card);border:1px solid var(--input-border);
  border-radius:4px;padding:.52rem .95rem;min-height:2.35rem;cursor:pointer;font-size:.86rem;line-height:1.25;text-decoration:none;color:var(--foreground);
  transition:border-color .12s ease,background-color .12s ease,color .12s ease,box-shadow .12s ease}
.btn svg{width:1.05em;height:1.05em;flex:none}
.btn:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}
.btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.btn:disabled,.btn[aria-disabled=true]{opacity:.45;cursor:default;pointer-events:none}
/* Primary = New/Create/Save (amber). Secondary = supporting. Danger = irreversible. */
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-foreground);font-weight:600;
  box-shadow:0 1px 2px rgba(122,70,10,.12)}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);color:var(--accent-foreground);
  box-shadow:0 2px 4px rgba(122,70,10,.16)}
.btn.secondary{background:var(--secondary);border-color:#c5d0de;color:var(--secondary-foreground)}
.btn.secondary:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-soft)}
.btn.dark{background:var(--nav);border-color:var(--nav);color:#fff}
.btn.dark:hover{background:var(--nav-hover);color:#fff;border-color:var(--nav-hover)}
.btn.quiet{color:var(--muted-foreground);border-color:var(--border);background:transparent}
.btn.quiet:hover{color:var(--destructive);border-color:var(--destructive);background:var(--danger-soft)}
.btn.danger{color:var(--destructive);border-color:var(--danger-border);background:var(--card)}
.btn.danger:hover{border-color:var(--destructive);color:var(--destructive);background:var(--danger-soft)}
.btns{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}

/* ── tables ──────────────────────────────────────────────────────── */
table.list{width:100%;border-collapse:collapse;background:var(--card);font-size:.88rem;
  border:1px solid var(--border);border-radius:5px;overflow:hidden}
table.list th{text-align:start;font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted-foreground);font-weight:600;padding:.72rem .7rem;border-bottom:1px solid var(--border);
  background:var(--secondary)}
table.list td{padding:.72rem .7rem;border-bottom:1px solid var(--border);vertical-align:top}
table.list tbody tr:last-child td{border-bottom:0}
table.list tr:hover td{background:var(--panel-hover)}
table.list .n{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}
table.list a{text-decoration:none;font-weight:500}
/* Nested inside a panel/block card — avoid a second outer frame. */
.panel > table.list,.panel table.list,.home .block table.list,.set-pane table.list{
  border:0;border-radius:0;background:transparent}
.mono{font-variant-numeric:tabular-nums}

/* Status is never colour alone — the word is always there too.
   Workflow names stay (draft, signed, …); semantic tones map to Phase 1 tokens. */
.tag{display:inline-block;font-size:.68rem;letter-spacing:.07em;text-transform:uppercase;
  padding:.18rem .48rem;border-radius:3px;border:1px solid;font-weight:600;line-height:1.2;
  color:var(--muted-foreground);border-color:var(--border);background:var(--secondary)}
.tag.draft,.tag.warn,.tag.warning{color:#6b5310;border-color:#e3cfa0;background:var(--warning-soft)}
.tag.submitted,.tag.info,.tag.informational{color:#1d4f8b;border-color:#b9cfe8;background:#eef4fb}
.tag.signed,.tag.ok,.tag.success{color:var(--success);border-color:var(--success-border);background:var(--success-soft)}
.tag.void,.tag.bad,.tag.error,.tag.destructive{color:var(--destructive);border-color:var(--danger-border);background:var(--danger-soft)}
.tag.superseded,.tag.neutral{color:#5b5b5b;border-color:#d2d2d2;background:#f3f3f3}

/* ── line-item editor ────────────────────────────────────────────── */
table.items{width:100%;border-collapse:collapse}
table.items th{font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
  font-weight:500;text-align:start;padding:0 .3rem .35rem 0}
table.items td{padding:0 .3rem .4rem 0;vertical-align:top}
table.items input,table.items select{width:100%;border:1px solid var(--input-border);border-radius:3px;
  padding:.38rem .42rem;font-size:.83rem;background:var(--field)}
table.items .n input{text-align:end}
.del{background:none;border:0;color:#b0bfd0;cursor:pointer;font-size:1.1rem;line-height:1;padding:.3rem}
.del:hover{color:var(--destructive)}
.add{margin-top:.4rem;background:none;border:1px dashed #b6c6d8;color:var(--primary);
  border-radius:3px;padding:.45rem .8rem;cursor:pointer;font-size:.82rem}
.add:hover{border-color:var(--primary);background:var(--primary-soft)}

/* ── preview stage ───────────────────────────────────────────────── */
.stage{background:#97a3b2;padding:1.4rem;overflow-x:auto}
.split{display:grid;grid-template-columns:23rem 1fr;gap:0;align-items:start}
@media(max-width:70rem){.split{grid-template-columns:1fr}}
.editorcol{padding:1.2rem 1.1rem;background:var(--panel-hover);border-inline-end:1px solid var(--border)}

/* ── audit trail ─────────────────────────────────────────────────── */
.trail{list-style:none;margin:0;padding:0;font-size:.85rem}
.trail li{padding:.55rem 0;border-bottom:1px solid var(--line);display:flex;gap:.7rem;flex-wrap:wrap}
.trail time{color:var(--muted);flex:none;font-variant-numeric:tabular-nums}
.trail b{font-weight:600}
.trail .who{color:var(--muted)}

/* ── the document centre ───────────────────────────────────────────────
   Direction is the first thing to read on a register row, so it gets a
   shape of its own rather than another grey word among grey words. */
.tag.in{background:#e8f0fb;color:#1d4a8f;border-color:#b9cfe8}
.tag.out{background:#eef3ea;color:#3d6127;border-color:#cfdcc4}
.tag.received,.tag.checked{background:#eef1f5;color:#42566e;border-color:#d3dde9}
.tag.approved,.tag.settled{background:#e8f2ea;color:#2f6b3d;border-color:#b2d8c6}
.tag.rejected{background:#fbeaea;color:#8f2222;border-color:#e6c3c0}
.tag.small,.btn.small{font-size:.72rem;padding:.18rem .48rem;min-height:0}

/* A panel that wants a decision from somebody, not just information. */
.panel.warn{border-inline-start:3px solid var(--accent);background:#fdf8f0}

.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.8rem}
@media (max-width:640px){.row3{grid-template-columns:1fr}}

.filelist{list-style:none;margin:.5rem 0 0;padding:0}
.filelist li{display:flex;align-items:center;gap:.5rem;padding:.35rem 0;
  border-bottom:1px solid var(--line)}
.filelist li:last-child{border-bottom:0}
.filelist small{color:var(--muted)}

/* ── grouped navigation ────────────────────────────────────────────────
   The bar outgrew a flat list once documents arrived from both directions.
   Three menus, named for what a person came to do: make something, find
   something, or check what needs them. */
.bar nav.menus{display:flex;gap:.15rem;position:relative}
.bar .m{position:relative}
.bar .mt{background:none;border:0;color:#a8bcd4;font:inherit;font-size:.86rem;
  padding:.4rem .75rem;border-radius:3px;cursor:pointer}
.bar .mt:hover{color:#fff;background:#162942}
.bar .m.open .mt{color:#fff;background:var(--brand)}
.bar .md{display:none;position:absolute;inset-inline-start:0;top:calc(100% + .35rem);
  min-width:15rem;background:#fff;border:1px solid var(--line);border-radius:5px;
  box-shadow:0 10px 30px rgba(16,32,54,.18);padding:.4rem;z-index:40}
.bar .m.open .md{display:block}
.bar .md a{display:block;color:var(--ink);padding:.42rem .6rem;border-radius:3px;
  font-size:.86rem;text-decoration:none}
.bar .md a:hover{background:#eef3f9;color:var(--brand)}
.bar .md .mh{margin:.45rem .6rem .15rem;font-size:.68rem;letter-spacing:.09em;
  text-transform:uppercase;color:var(--muted)}
.bar .md .mh:first-child{margin-top:.2rem}

.bar .search{margin-inline-start:auto;flex:0 1 20rem}
.bar .search input{width:100%;background:#162942;border:1px solid #24405f;color:#fff;
  border-radius:4px;padding:.4rem .7rem;font:inherit;font-size:.84rem}
.bar .search input::placeholder{color:#7f96b1}
.bar .search input:focus{outline:2px solid var(--brand);border-color:transparent}
.bar .me{margin-inline-start:1rem}

/* search results */
.hit{padding:.7rem 0;border-bottom:1px solid var(--line)}
.hit:last-child{border-bottom:0}
.hit .where{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.hit .what{font-weight:600}
.hit mark{background:#fdf0d5;color:inherit;padding:0 .1em}

/* ── the job-file control ──────────────────────────────────────────────
   A quiet row that only becomes a control when someone asks for one. Most
   documents belong to no job, and a picker that is always open is a picker
   that gets used by accident. */
.field.jobfield{display:grid;grid-template-columns:11rem 1fr;gap:.8rem;
  align-items:start;padding:.8rem 0 .1rem;border-top:1px solid var(--line);margin-top:.9rem}
.field.jobfield .lbl{font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);padding-top:.4rem}
.field.jobfield .jobval select{width:100%;max-width:26rem}
.field.jobfield .btns{margin-top:.5rem}
@media (max-width:640px){.field.jobfield{grid-template-columns:1fr}}

/* A button that reads as a link: the action is minor and must not compete
   with the document's own primary action. */
.linkish{background:none;border:0;padding:0;font:inherit;color:var(--brand);
  text-decoration:underline;cursor:pointer}
.linkish:hover{color:var(--ink)}

/* ══ NAVIGATION ══════════════════════════════════════════════════════════
   Areas, flat. Verb-named menus asked the reader to classify their intention
   before they could move; a person arriving at this system has a place in
   mind — the documents, this job, the licence — not a verb. */
.bar nav.areas{display:flex;gap:.1rem;flex-wrap:wrap}
.bar nav.areas a{color:#a8bcd4;text-decoration:none;padding:.42rem .8rem;
  border-radius:4px;font-size:.88rem;white-space:nowrap}
.bar nav.areas a:hover{color:#fff;background:#162942}
/* The current area is stated, not merely tinted: a busy person should be able
   to answer "where am I" without comparing shades. */
.bar nav.areas a[aria-current]{background:#fff;color:var(--ink);font-weight:600}

/* One primary action, apart from the areas, where the hand expects it. */
.bar .mt.primary{background:var(--accent);color:#12233b;font-weight:600;
  padding:.42rem .9rem}
.bar .mt.primary:hover{background:#f5b45c;color:#12233b}
.bar #newmenu .md,.bar #usermenu .md{inset-inline-start:auto;inset-inline-end:0}
.bar #usermenu .mt{color:#cfdcea}

/* ══ HOME ════════════════════════════════════════════════════════════════ */
.home .hello{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;
  margin-bottom:1.7rem;padding-bottom:1rem;border-bottom:1px solid var(--border)}
.home .hello h1{margin:0 0 .2rem;font-size:1.55rem}
.home .hello .sub{margin:0}
/* The pulse: the department's day in one line, louder than the date and
   quieter than the greeting. Green when there is nothing waiting, because a
   clean register is the thing this whole application is for. */
.home .pulse{margin:.15rem 0 .2rem;font-size:1rem;font-weight:600;color:var(--ink)}
.home .pulse.calm{color:var(--success)}

.home .block{margin-bottom:2rem;padding:1.05rem 1.15rem 1.15rem;background:var(--card);
  border:1px solid var(--border);border-radius:6px;box-shadow:0 1px 2px rgba(10,26,47,.04)}
.home .blockhead{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  border-bottom:1px solid var(--border);padding-bottom:.55rem;margin-bottom:.85rem}
.home .blockhead h2{margin:0;font-size:.74rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted-foreground);font-weight:600}
.home .more{font-size:.82rem;text-decoration:none;font-weight:500}
.home .calm{color:var(--muted-foreground);margin:0;padding:.65rem 0;font-size:.9rem}
/* The amount, where there is one. Two things of equal urgency are not
   equally expensive, and the list is now sorted by it. */
.home .attn .sum{font-style:normal;font-variant-numeric:tabular-nums;color:var(--muted);
  font-size:.82rem;margin-inline-start:.45rem}
.home .attn .note + .note{margin-top:.1rem}
/* The list settles as it arrives, a row at a time. Forty milliseconds apart
   is below the threshold at which it reads as an animation and above the one
   at which it reads as nothing — the page feels alive without performing. */
.home .attn li{animation:settle .22s ease-out both;animation-delay:var(--in,0ms)}
@keyframes settle{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.home .attn li{animation:none}}

/* The attention list. Rows, not cards: a card per item turns six small facts
   into six boxes to parse, and the whole point is to read them at a glance. */
.home ul.attn{list-style:none;margin:0;padding:0}
.home ul.attn li{border-bottom:1px solid var(--line)}
.home ul.attn li:last-child{border-bottom:0}
.home ul.attn a{display:grid;grid-template-columns:12rem 1fr auto;gap:1rem;
  align-items:baseline;padding:.68rem .2rem;text-decoration:none;color:inherit;
  border-inline-start:3px solid transparent}
.home ul.attn a:hover{background:var(--panel-hover)}
.home ul.attn .kind{font-size:.78rem;font-weight:600;color:var(--brand)}
/* Marks the rows sorted to the top because your name is on them. Not colour
   alone — it is a word. */
.home ul.attn .kind em.yours{font-style:normal;font-weight:500;font-size:.68rem;
  letter-spacing:.06em;text-transform:uppercase;color:var(--muted);
  border:1px solid var(--line);border-radius:2px;padding:0 .25em;margin-inline-start:.35em}
/* Sub-heads inside a panel on My desk: smaller than the panel's own h2, which
   is the band, and larger than a hint. */
.deskhead{margin:1.1rem 0 .5rem;font-size:.82rem;font-weight:600;color:#4a6076}
.panel > .deskhead:first-of-type{margin-top:0}
.home ul.attn .what{font-weight:500}
.home ul.attn .note{font-size:.8rem;color:var(--muted);text-align:end}
/* Urgency by position AND by a mark on the edge — never by colour alone. */
.home ul.attn li.rank0 a{border-inline-start-color:#b3261e}
.home ul.attn li.rank0 .kind{color:#b3261e}
.home ul.attn li.rank1 a{border-inline-start-color:var(--accent)}
@media (max-width:760px){
  .home ul.attn a{grid-template-columns:1fr}
  .home ul.attn .note{text-align:start}
}

/* Three figures, each a door. Not a KPI wall: no icons, no deltas, no charts —
   a number is here only because it changes what someone does next. */
.home .glance{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.home .glance a{display:block;padding:.95rem 1.05rem;border:1px solid var(--border);
  border-radius:6px;text-decoration:none;color:inherit;background:var(--card);
  transition:border-color .12s,box-shadow .12s}
.home .glance a:hover{border-color:var(--brand);box-shadow:0 1px 3px rgba(10,26,47,.07)}
.home .glance .g-l{display:block;font-size:.72rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted-foreground);font-weight:600}
.home .glance .g-n{display:block;font-size:1.5rem;font-weight:650;
  margin:.3rem 0 .12rem;font-variant-numeric:tabular-nums;color:var(--ink)}
.home .glance .g-s{display:block;font-size:.8rem;color:var(--muted-foreground)}
@media (max-width:760px){.home .glance{grid-template-columns:1fr}}

.home .starters{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem}
/* The glyph the register uses for the same document, so the shortcut and the
   row it will eventually produce are recognisably the same thing. The + badge
   says it makes one rather than finds one — the same badge, for the same
   reason, as the register's own row of starters. */
.home .starters a{display:grid;grid-template-columns:auto 1fr;column-gap:.7rem;
  align-items:start;padding:.9rem 1.05rem;border:1px solid var(--border);
  border-radius:6px;text-decoration:none;color:inherit;background:var(--card);
  transition:border-color .12s,background-color .12s,box-shadow .12s}
.home .starters a:hover{border-color:var(--brand);background:var(--panel-hover);
  box-shadow:0 1px 3px rgba(10,26,47,.06)}
/* The mark spans both rows so the title and its line of explanation sit
   beside it rather than under it. */
.home .starters .mk{grid-row:1 / span 2;position:relative;display:inline-flex;
  align-self:start;margin-top:.1rem}
.home .starters .dtype{width:1.8rem;height:1.8rem;border-radius:5px}
.home .starters .dtype svg{width:1.05rem;height:1.05rem}
.home .starters .mk::after{content:"+";position:absolute;inset-block-end:-.3rem;
  inset-inline-end:-.3rem;width:1rem;height:1rem;border-radius:50%;background:var(--brand);
  color:#fff;font-size:.72rem;line-height:1rem;text-align:center;font-weight:700}
.home .starters a:hover .mk::after{background:var(--ink)}
.home .starters b{display:block;font-size:.94rem}
.home .starters span{display:block;font-size:.79rem;color:var(--muted);margin-top:.15rem}
@media (max-width:900px){.home .starters{grid-template-columns:repeat(2,1fr)}}
@media (max-width:520px){.home .starters{grid-template-columns:1fr}}

/* A status must never wrap: a badge that breaks onto its own line makes one
   row taller than its neighbours, and an uneven table is a table nobody scans. */
.list td .tag,.list th .tag{white-space:nowrap}

/* A register row for a confidential document the reader may not open.
   The row STAYS — a register that appears to skip references teaches people it
   loses things, and the next thing they do is ask a colleague to email them a
   copy. It should not read as ordinary either. Quietened, and never by colour
   alone: the cells themselves say "restricted".
   views/register.php has marked these rows since confidentiality arrived; this
   is the rule it was asking for. */
.list tr.locked td{color:var(--muted);background:#fafbfd}
.list tr.locked td a{color:#4a6a95}
.home .block .list td{vertical-align:middle}
.home .block .list td:nth-child(6){white-space:nowrap;width:1%}
.home .block .list td:nth-child(7){white-space:nowrap;width:1%}
.home .block .list td:nth-child(5){white-space:nowrap}

/* ══ A BIGGER BAR, BUILT FOR A THUMB ═════════════════════════════════════
   Most of this system is used on the move — between a warehouse, a stand
   build and a meeting. Every target in the bar is at least 44px high, which
   is the smallest a finger reliably hits, and the type is large enough to
   read at arm's length in daylight. */
.bar{padding:calc(.55rem + env(safe-area-inset-top)) calc(1.1rem + env(safe-area-inset-right))
     .55rem calc(1.1rem + env(safe-area-inset-left));gap:1rem;min-height:60px}
.bar .lock{font-size:1.15rem}
.bar nav.areas a{padding:.62rem 1rem;font-size:.95rem;min-height:44px;
  display:flex;align-items:center}
.bar .mt{font-size:.95rem;padding:.62rem 1rem;min-height:44px}
.bar .mt.primary{padding:.62rem 1.15rem}
.bar .search input{padding:.6rem .85rem;font-size:.95rem;min-height:44px}
.bar .md a{padding:.62rem .7rem;font-size:.92rem;min-height:40px;display:flex;
  align-items:center}

/* ── PHONE ──────────────────────────────────────────────────────────────
   The areas stay on one line and scroll sideways rather than wrapping into a
   block that pushes the page down: a person on the move wants the same five
   places in the same order, not a menu that changes shape. */
@media (max-width:820px){
  /* Two rows, not three. At three the bar took a fifth of a phone screen
     before a single document appeared. Row one is search and the two actions;
     row two is the five places, scrolling sideways so they keep their order.

     AND IT KEEPS THE INSET. This shorthand used to write a flat .4rem over the
     safe-area padding set above — on a desk that changed nothing, because the
     inset is zero there, and on the phone it was the whole bug: New and NEXUS
     were drawn UNDER the Dynamic Island, with the clock sitting on top of the
     New button. The rule that mattered was the one nobody could see the effect
     of while writing it. */
  .bar{flex-wrap:wrap;
    padding:calc(.4rem + env(safe-area-inset-top)) calc(.6rem + env(safe-area-inset-right))
            .4rem calc(.6rem + env(safe-area-inset-left));
    gap:.4rem;row-gap:.35rem;min-height:0}
  .bar .lock{order:1;min-height:44px;font-size:1.02rem}
  .bar .lock span{display:none}              /* "Office"; the mark and NEXUS stay */
  .bar .search{display:none}                 /* becomes the button below */
  /* .bar a.searchbtn, not .bar .searchbtn: the rule that hides it by default is
     written later in this file, and at equal specificity the later rule wins.
     One extra element selector settles it wherever the two end up sitting. */
  .bar a.searchbtn{display:inline-flex;order:2;margin-inline-start:auto}
  .bar #newmenu{order:3}
  .bar #usermenu{order:4}
  .bar #usermenu .mt span:first-child{display:none}   /* the name; the caret stays */
  .bar #usermenu .mt{padding:.62rem .7rem}
  .bar nav.areas{order:5;flex:1 1 100%;overflow-x:auto;flex-wrap:nowrap;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
    margin-inline:-.6rem;padding-inline:.6rem}
  .bar nav.areas::-webkit-scrollbar{display:none}
  .bar nav.areas a{padding:.5rem .8rem;min-height:40px}
  .bar #newmenu .md,.bar #usermenu .md{inset-inline-end:0;min-width:14rem}
  /* Long action menus scroll within the phone viewport. */
  .bar #newmenu .md{max-height:calc(100vh - 5rem);overflow-y:auto;
    overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  @supports (height:100dvh){
    .bar #newmenu .md{max-height:calc(100dvh - 5rem)}
  }
}

/* The bar follows you down a long register — on a phone, scrolling back to the
   top to reach search or New is the difference between using it and not. */
@media (max-width:820px){
  .bar{position:sticky;top:0;z-index:50}
}

/* Tables become stacked blocks on a phone. A seven-column table at 375px is a
   horizontal scrollbar with data hidden inside it, which on the move means the
   information may as well not be there.

   WRITTEN AS `table.list td`, NOT `.list td`, AND THAT IS THE WHOLE OF IT.
   The row above sets padding and a bottom border through `table.list td`,
   which carries one more element than `.list td` and therefore won the cascade
   no matter that this block comes later. So every cell kept its border and its
   .7rem — the rows stacked, and each field arrived as its own fat bordered
   line, a form dump where a document should be. It looked deliberate enough
   that nobody questioned it; it was a specificity accident. */
@media (max-width:700px){
  table.list,table.list tbody,table.list tr,table.list td{display:block;width:auto}
  table.list thead{display:none}
  table.list tr{padding:.8rem .1rem;border-bottom:1px solid var(--line)}
  table.list tr:last-child{border-bottom:0}
  table.list td{padding:.12rem 0;border:0}
  table.list td:empty{display:none}
  table.list td.n{text-align:start}
  table.list th{display:block;padding:.12rem 0;border:0;font-size:.78rem}
}

/* Comfortable targets everywhere else on a phone, not just the bar. */
@media (max-width:700px){
  .btn{min-height:44px;display:inline-flex;align-items:center;padding:.6rem 1rem}
  .btn.small{min-height:36px;padding:.35rem .7rem}
  .f input,.f select,.f textarea{min-height:44px;font-size:16px}  /* 16px stops iOS zooming on focus */
}

/* ── OPEN TRAILS ───────────────────────────────────────────────────────── */
.home ul.trails{list-style:none;margin:0;padding:0}
.home ul.trails li{border-bottom:1px solid var(--line)}
.home ul.trails li:last-child{border-bottom:0}
.home ul.trails a{display:grid;grid-template-columns:9rem 1fr auto auto;gap:1rem;
  align-items:baseline;padding:.72rem .2rem;text-decoration:none;color:inherit}
.home ul.trails a:hover{background:#f6f9fc}
.home ul.trails .tstage{font-size:.78rem;font-weight:600;color:var(--brand)}
.home ul.trails .what{font-weight:500}
.home ul.trails .missing{font-size:.82rem;color:var(--muted)}
.home ul.trails .age{font-size:.8rem;color:var(--muted);white-space:nowrap;
  min-width:5.5rem;text-align:end}
@media (max-width:760px){
  .home ul.trails a{grid-template-columns:1fr auto;gap:.2rem .8rem;padding:.8rem .2rem}
  .home ul.trails .tstage{grid-column:1}
  .home ul.trails .age{grid-column:2;grid-row:1;text-align:end}
  .home ul.trails .what{grid-column:1/-1}
  .home ul.trails .missing{grid-column:1/-1}
}

/* The phone's search affordance. Hidden on anything with room for the field. */
.bar .searchbtn{display:none;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:4px;color:#a8bcd4}
.bar .searchbtn:hover{background:#162942;color:#fff}
.bar .searchbtn svg{width:21px;height:21px;fill:none;stroke:currentColor;
  stroke-width:2;stroke-linecap:round}

/* THE FILE LANDING. A tick and the file's name, for the second before the
   next screen — the answer to "did it take it?", given where the question was
   asked rather than on a page nobody chose to open. */
.drop.landed{border-color:#1c7a4a;background:#f2fbf6}
.drop.landed .mk::after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;
  background:#1c7a4a;color:#fff;border-radius:50%;font-size:1.1rem;font-weight:700;
  animation:landed .28s ease-out}
.drop.landed .mk{position:relative}
@keyframes landed{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){.drop.landed .mk::after{animation:none}}

/* THE COMMAND BAR. The bar's search field, with its answers under it. Dark
   like the bar it hangs from on a desk; on a phone the field becomes a sheet
   at the top of the screen, because a 20rem dropdown on a 375px screen is a
   dropdown nobody can read. */
.bar .search{position:relative}
.cmd{position:absolute;inset-inline:0;top:calc(100% + .4rem);z-index:70;
  background:#fff;border:1px solid var(--line);border-radius:6px;
  box-shadow:0 10px 34px rgba(10,26,47,.28);max-height:70vh;overflow:auto;padding:.3rem}
.cmd-group{margin:.4rem .55rem .15rem;font-size:.68rem;text-transform:uppercase;
  letter-spacing:.09em;color:var(--muted)}
.cmd-hit{display:flex;gap:.5rem;align-items:baseline;padding:.45rem .55rem;border-radius:4px;
  text-decoration:none;color:var(--ink)}
.cmd-hit:hover,.cmd-hit.on{background:#eef3fa}
.cmd-hit.act .cmd-what{color:var(--brand)}
.cmd-what{font-size:.88rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmd-sub{flex:1;min-width:0;font-size:.8rem;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmd-none{margin:0;padding:.7rem .6rem;font-size:.84rem;color:var(--muted)}
.cmd-none span{color:var(--muted);opacity:.8}
@media (max-width:820px){
  /* Opened by the button: the field takes the whole bar and its answers hang
     beneath it, because a 20rem dropdown on a 375px screen is unreadable. */
  body.searching .bar .search{display:block;order:5;flex:1 0 100%;position:relative}
  body.searching .bar .searchbtn{display:none}
  .cmd{position:absolute;inset-inline:0;top:calc(100% + .35rem);max-height:60vh}
}

/* The search page carries its own field, so search works when the bar's is
   hidden — and so a phone lands on something it can type into. */
.searchbox{width:100%;font-size:16px;padding:.75rem .9rem;min-height:48px;
  border:1px solid var(--line);border-radius:6px;margin-bottom:1.1rem}
.searchbox:focus{outline:2px solid var(--brand);border-color:transparent}

/* Opening a file from the Customers card: pick anybody in the book, or name a
   brand nobody has entered yet. A screen that tells somebody to go elsewhere
   to do the thing it is for is a screen with a hole in it. */
.openfile{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.7rem;margin:1rem 0 1.2rem;
  padding:.9rem 1rem;background:#fff;border:1px solid var(--line);border-radius:6px}
.openfile .f{margin:0;min-width:13rem}
.openfile select,.openfile input{border:1px solid var(--input-border);border-radius:4px;
  padding:.45rem .55rem;font:inherit;font-size:.9rem;background:var(--field);color:var(--ink)}
.openfile .or{color:var(--muted);font-size:.82rem;padding-bottom:.6rem}
@media (max-width:40rem){
  .openfile{flex-direction:column;align-items:stretch}
  .openfile .or{padding:0}
}

/* ══ RECORD FOLDERS ══════════════════════════════════════════════════════
   Cards over the company's papers, because two hundred rows ordered by expiry
   is the right answer to "what needs me" and the wrong shape for finding the
   tenancy. Each card carries its count AND what is due inside it: a folder
   that needs somebody says so on its face, which is the whole difference
   between this and a list of names on a shared drive. */
.folders{display:grid;gap:.8rem;margin:1.2rem 0;
  grid-template-columns:repeat(auto-fill,minmax(15rem,1fr))}
.folder{display:flex;flex-direction:column;gap:.35rem;padding:.9rem 1rem;
  background:#fff;border:1px solid var(--line);border-radius:6px;
  text-decoration:none;color:var(--ink)}
.folder:hover{border-color:var(--brand)}
.folder .f-top{display:flex;align-items:center;gap:.5rem;font-size:.98rem}
.folder .f-top svg{width:1.35rem;height:1.35rem;flex:none;fill:#8fb0da}
.folder .f-note{font-size:.8rem;color:var(--muted);line-height:1.4}
.folder .f-count{font-size:.82rem;color:var(--muted);margin-top:auto;padding-top:.3rem}
/* The one thing worth colouring here: the reason to open this folder today
   rather than next month. */
.folder .f-due{font-style:normal;font-weight:600;color:#a5411f;margin-inline-start:.45rem}
.folder.needs{border-color:#e6b8a6}
.folder.all .f-top svg{stroke:var(--muted);fill:none}
.folder.unfiled .f-top svg{fill:#c3cedd}

/* Making one is one press, so the control is a button and not a form. */
.newfolder{align-items:center;gap:.7rem;margin-bottom:1rem}
.newfolder .hint{max-width:34rem}

/* THE NAME, OPEN ON THE CARD, at the moment right after making it. */
.folder.naming{display:flex;flex-direction:column;gap:.4rem;border-color:var(--brand)}
.f-name{font-size:.98rem;font-weight:600;color:var(--ink);background:var(--field);
  border:1px solid var(--input-border);border-radius:4px;padding:.4rem .5rem;font-family:inherit}
.f-noteinput{font-size:.8rem;color:var(--ink);background:var(--field);
  border:1px solid var(--input-border);border-radius:4px;padding:.35rem .5rem;font-family:inherit}
.folder.naming .btns{display:flex;gap:.4rem;margin-top:.1rem}
/* Renaming is not opening: its own target, so pressing the card never means
   anything but "show me what is in it". */
.f-rename{position:absolute;inset-block-start:.5rem;inset-inline-end:.6rem;
  font-size:.72rem;color:var(--muted);opacity:0;cursor:pointer}
.folder{position:relative}
.folder:hover .f-rename,.f-rename:focus{opacity:1}
.f-rename:hover{color:var(--brand);text-decoration:underline}

/* Somewhere to put things, on the screens where the papers are. A strip, not
   the cards: here they are targets rather than destinations. */
.droprow{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:.9rem 0 .6rem}
.drop{font-size:.82rem;padding:.35rem .7rem;border-radius:999px;
  border:1px dashed var(--line);color:var(--ink);background:#fff}
.drop.out{border-style:solid;color:var(--muted)}
body.dragging .drop{border-color:var(--brand);color:var(--brand)}
.drop.over{background:var(--brand);border-color:var(--brand);color:#fff}

.pickable tbody tr[draggable]{cursor:grab}
.pickable .tick{width:2.2rem}
.pickable tbody tr:has(input[data-pick]:checked){background:#eef4fc}

/* The bar under the list. Quiet until something is ticked: a row of controls
   for an action nobody has started is a row of controls in the way.

   CALLED .movebar AND NOT .filing, WHICH IS WHAT IT WAS FOR HALF A DAY.
   `.filing` was already taken — it is the two-column layout on the received
   document screen, paper beside form — and naming this the same thing put
   `opacity:.55` and `form{display:flex}` onto that screen. It came back as
   "the colour goes blurry and the register details run out of the frame",
   which is exactly what those two declarations do to a page they were never
   meant for. A class name is global; a name that reads well in the file you
   are writing is not on its own a name that is free. */
.movebar{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin-top:.7rem;
  padding:.6rem .8rem;border:1px solid var(--line);border-radius:6px;background:#fff;
  opacity:.55}
.movebar.some{opacity:1;border-color:var(--brand)}
.movebar.empty{border-color:#c0553a}
.movebar form{display:flex;align-items:center;gap:.5rem;margin:0}
.movebar .f{margin:0}
.movebar select{border:1px solid var(--input-border);border-radius:4px;padding:.4rem .5rem;
  font:inherit;font-size:.86rem;background:var(--field);color:var(--ink)}
.movebar-lbl{font-size:.84rem;color:var(--muted)}
@media (max-width:40rem){.movebar-drag{display:none}}

/* ══ HOME: START, AND CONTROL ════════════════════════════════════════════ */
.home .starters-block{margin-bottom:1.4rem;padding:0;background:transparent;border:0;box-shadow:none}

/* CONTROL, IN A LINE. Three meters, a split bar and a year of months was a
   wall of measurement between the reader and the work — and most of it said
   "all accounted for" three ways. The line names only the exceptions, each a
   link to the documents behind it. The underline says it opens something
   without turning a sentence into a row of buttons. */
.oneline{margin:0;padding:.15rem 0 0;font-size:.94rem;line-height:1.75;color:var(--ink)}
.oneline a{color:inherit;text-decoration:none;border-block-end:1px solid var(--line)}
.oneline a:hover{color:var(--brand);border-color:var(--brand)}
.oneline b{font-weight:600;font-variant-numeric:tabular-nums}
.oneline .sep{color:var(--muted)}
/* WHAT NEEDS DOING SHOULD STILL LOOK LIKE IT.
   The cards these replaced shouted in amber and red, and dropping to a line
   should not quietly downgrade an overdue licence to a footnote. Colour is
   the second signal and never the only one: the words say "already out of
   date" whether or not anybody can see the red. */
.oneline a.due b{color:var(--accent)}
.oneline a.due{border-color:var(--accent)}
.oneline a.late b{color:var(--bad)}
.oneline a.late{border-color:var(--bad)}

/* What was taken off the top of the screen, one press down and closed. */
.home .deeper{margin-top:1.1rem}
.home .deeper > summary{display:inline-block;cursor:pointer;font-size:.76rem;
  letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.home .deeper > summary:hover{color:var(--ink)}
.home .deeper[open] > summary{margin-block-end:.2rem}

/* Proportion meters — Mail still carries two. The text carries the numbers;
   the bar only carries the shape, so nothing is communicated by length
   alone. */
.home .meters{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}
.home .meter{display:block;padding:.85rem 1rem;border:1px solid var(--line);
  border-radius:6px;background:#fff;text-decoration:none;color:inherit}
.home .meter:hover{border-color:var(--brand)}
.home .m-top{display:flex;justify-content:space-between;align-items:baseline;gap:.6rem}
.home .m-l{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.home .m-c{font-size:1.05rem;font-weight:600;font-variant-numeric:tabular-nums}
.home .m-bar{display:block;height:7px;border-radius:4px;background:#e6ecf3;margin:.55rem 0 .4rem;
  overflow:hidden}
.home .m-bar > span{display:block;height:100%;background:var(--brand);border-radius:4px}
.home .m-s{font-size:.8rem;color:var(--muted)}
@media (max-width:760px){.home .meters{grid-template-columns:1fr}}

/* One bar split by match state. Each segment is a link and states its own
   count, so the colour is a reinforcement and never the message. */
.home .split{display:flex;gap:3px;margin-top:1rem;border-radius:5px;overflow:hidden}
.home .split a{padding:.5rem .7rem;font-size:.82rem;text-decoration:none;color:#14304f;
  white-space:nowrap;text-align:center;min-width:0}
.home .split .s-ok{background:#dff0e3}
.home .split .s-warn{background:#fdeccd}
.home .split .s-bad{background:#f8dcda}
.home .split a:hover{filter:brightness(.96)}

/* Six months of volume. A chart only because the shape of the workload is
   read faster than six pairs of numbers. */
/* The chart is the one place a shape is read faster than numbers, so it gets
   real room: a year of months, tall enough that a quiet month and a busy one
   are told apart at a glance rather than squinted at. */
.home .spark{margin-top:1.4rem;border:1px solid var(--line);border-radius:6px;
  background:#fff;padding:1rem 1.1rem .8rem}
.home .sparkhead{display:flex;justify-content:space-between;align-items:baseline;
  gap:1rem;flex-wrap:wrap;margin:0 0 .9rem}
.home .sparkhead p{margin:0;font-size:.78rem;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted)}
.home .bars{display:flex;gap:.45rem;align-items:flex-end;height:190px}
.home .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:.3rem;
  height:100%;min-width:0}
.home .col .val{font-size:.74rem;color:var(--muted);font-variant-numeric:tabular-nums;
  height:1em;line-height:1}
.home .col.busiest .val{color:var(--ink);font-weight:600}
.home .stack{flex:1;width:100%;max-width:44px;display:flex;align-items:flex-end;
  justify-content:center;gap:3px}
.home .b-out,.home .b-in{width:46%;min-height:3px;border-radius:3px 3px 0 0}
.home .b-out{background:var(--brand)}
.home .b-in{background:#9dbbdd}
.home .col .lab{font-size:.74rem;color:var(--muted);white-space:nowrap}
.home .col.busiest .lab{color:var(--ink);font-weight:600}
.home .key{margin:0;font-size:.78rem;color:var(--muted);display:flex;
  align-items:center;gap:.35rem;text-transform:none;letter-spacing:0}
.home .key span{display:inline-block;width:9px;height:9px;border-radius:2px}
.home .key .k-out{background:var(--brand)}
.home .key .k-in{background:#9dbbdd;margin-inline-start:.9rem}

/* Recent is a log, and a log must not push the decisions off the screen: it
   is the last SIX documents now, the same six Needs you shows, with the whole
   register one press away in the header. The box stays — it is what makes the
   log read as a panel rather than as more page — and still scrolls if a row
   ever wraps taller than it looks. */
   The height cap it used to carry is gone with the forty rows that needed it.
   Six always fit; keeping the cap only bought a scrollbar INSIDE the page on a
   phone, where the rows stack tall and a box that scrolls within a page that
   scrolls is the worst of both. */
.home .scroller{border:1px solid var(--line);border-radius:6px;background:#fff}
.home .scroller table{margin:0}
.home .scroller td{padding-inline:.7rem}
.home .scroller tr:first-child td{border-top:0}
@media (max-width:700px){
  .home .bars{height:150px;gap:.3rem}
  .home .col .lab{font-size:.68rem}
}

/* The sign-out button in the name menu. In the Laravel build it is a form
   button rather than a link — a GET that signs you out can be fired by any
   page that manages to load a URL — and this makes it indistinguishable from
   the links beside it. */
.bar .md form{margin:0}
.bar .md form button{display:flex;align-items:center;width:100%;text-align:start;
  background:none;border:0;font:inherit;font-size:.92rem;color:var(--ink);
  padding:.62rem .7rem;min-height:40px;border-radius:3px;cursor:pointer}
.bar .md form button:hover{background:#eef3f9;color:var(--brand)}

/* An area whose screens are not ported yet: present, so the bar keeps the
   shape that was approved, but plainly not a door you can open. */
.bar .areas a[aria-disabled]{opacity:.42;cursor:default}
.bar .areas a[aria-disabled]:hover{color:inherit;background:none}

/* The document sheet shown inside the application rather than on the print
   page: the grey desk the paper sits on. */
.sheetwrap{background:#97a3b2;padding:1.4rem 0 2rem}

/* A menu entry whose screen is not ported yet. Same treatment as a disabled
   area in the bar: present, so the menu keeps its approved shape, but plainly
   not something you can open. */
.bar .md a[aria-disabled]{opacity:.42;cursor:default}
.bar .md a[aria-disabled]:hover{background:none;color:var(--ink)}

/* THE LETTER EDITOR.
   Deliberately plain: it is a box you type a letter into, not an application.
   The area is set in the document's own face and measure so what is on screen
   is close to what will print — the sheet under the form is the exact answer,
   and this only has to be near enough not to surprise. */
.rt-bar{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;padding:.4rem;
  border:1px solid var(--line);border-bottom:0;border-radius:4px 4px 0 0;background:#f7f9fc}
.rt-btn{min-width:2rem;height:2rem;padding:0 .45rem;border:1px solid transparent;background:none;
  border-radius:3px;cursor:pointer;font-size:.9rem;line-height:1;color:var(--ink)}
.rt-btn:hover{background:#e7eef7;border-color:var(--line)}
.rt-btn:disabled{opacity:.4;cursor:default}
.rt-sep{width:1px;height:1.3rem;background:var(--line);margin:0 .2rem}
.rt-style{height:2rem;border:1px solid var(--line);border-radius:3px;background:#fff;
  font:inherit;font-size:.82rem;padding:0 .4rem}
.rt-area{min-height:22rem;padding:1rem 1.1rem;border:1px solid var(--line);border-radius:0 0 4px 4px;
  background:#fff;overflow-wrap:break-word;line-height:1.55}
.rt-area:focus{outline:2px solid var(--brand);outline-offset:-2px}
.rt-area p{margin:0 0 .7rem}
.rt-area h3{margin:1rem 0 .4rem;font-size:1.02rem}
.rt-area small{color:var(--muted)}
.rt-area ul,.rt-area ol{margin:0 0 .7rem;padding-inline-start:1.4rem}
.rt-area table{width:100%;border-collapse:collapse;margin:0 0 .8rem}
.rt-area th,.rt-area td{border:1px solid var(--line);padding:.35rem .5rem;text-align:start}
.rt-area th{background:#f2f6fb;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;
  color:var(--muted)}
.rt-area figure{margin:0 0 .8rem}
.rt-area figure img{display:block;max-width:100%;height:auto}
.rt-area figure.w-small img{width:30%}
.rt-area figure.w-half img{width:55%}
.rt-area figure.w-full img{width:100%}
.rt-area figcaption{margin-top:.25rem;font-size:.8rem;color:var(--muted)}
.rt-area .ta-center{text-align:center}
.rt-area .ta-end{text-align:end}
.rt-area .ta-justify{text-align:justify}
.rt-note{margin:.4rem 0 0;padding:.45rem .6rem;border-radius:3px;background:#fdecea;
  color:#8a1c13;font-size:.84rem}
.rt-area table{table-layout:fixed}
.rt-area td > p:only-child,.rt-area th > p:only-child{margin:0}

/* Opening a job file from inside a document. Closed by default: most documents
   belong to no job, and a control that is always open is one that gets used by
   accident. The summary is a button to the eye because it behaves like one. */
.njob { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .7rem }
.njob > summary { cursor: pointer; font-weight: 600; color: var(--ink);
                  list-style: none; display: inline-flex; align-items: center; gap: .4rem }
.njob > summary::-webkit-details-marker { display: none }
.njob > summary::before { content: "＋"; font-weight: 700; color: var(--accent) }
.njob > summary:hover { text-decoration: underline }
.njob[open] > summary { margin-bottom: .2rem }

/* Picking a table's size the way Word does: a grid you point at, not a prompt
   (refused outright in some embedded browsers) and not two number boxes. */
.rt-bar{position:relative}
.rt-grid{position:absolute;z-index:20;top:100%;inset-inline-start:0;margin-top:.3rem;
         background:#fff;border:1px solid var(--line);border-radius:4px;
         padding:.5rem;box-shadow:0 6px 20px rgba(10,26,47,.16)}
.rt-grid-cells{display:grid;grid-template-columns:repeat(8,1.15rem);gap:2px}
.rt-grid-cell{width:1.15rem;height:1.15rem;padding:0;cursor:pointer;
              border:1px solid var(--line);background:var(--field);border-radius:2px}
.rt-grid-cell.on{background:var(--accent);border-color:var(--accent)}
.rt-grid-cell:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.rt-grid-lbl{margin-top:.4rem;font-size:.78rem;color:var(--muted);text-align:center}

/* Rows and columns of a table that already exists. Hidden unless the caret is
   in one, so the main toolbar is not six buttons that are dead most of the time. */
.rt-tbar{display:flex;flex-wrap:wrap;gap:.3rem;padding:.4rem .5rem;
         border:1px solid var(--line);border-top:0;background:var(--surface)}
.rt-tbar[hidden]{display:none}
.rt-btn.small{font-size:.78rem;padding:.2rem .45rem;width:auto}

/* Asking for a signature over WhatsApp. Sits with the document's actions
   rather than in a panel of its own: it is one of the things you do to a
   draft, not a feature. */
.askwa{display:inline-flex;align-items:center;gap:.35rem;flex-wrap:wrap;margin-inline-start:.4rem}
.askwa .hint{margin:0}
/* The glyph carries the meaning; the name says who. Green only on the mark —
   a whole green button in a row of grey ones reads as the primary action, and
   the primary action here is signing, not messaging. */
.btn.wa{display:inline-flex;align-items:center;gap:.35rem}
.btn.wa svg{width:1.05em;height:1.05em;flex:none}
.btn.wa:hover{border-color:#25D366}

/* A job file read as trails. The chain is a list because it IS ordered — the
   order the business happened in — and a reader follows it downwards. */
.trail{border:1px solid var(--line);border-radius:4px;margin:.9rem 0;padding:.5rem .7rem}

/* THE VALUE CHAIN. Stages left to right on a desk, joined by a line; each a
   numbered node over a card. The current stage is the loud one, done stages
   are filled, the ones ahead are outlines. On a phone it stands on end. */
.valuechain{list-style:none;margin:0 0 .6rem;padding:0;display:grid;gap:.6rem;
  grid-auto-flow:column;grid-auto-columns:minmax(11rem,1fr);position:relative;
  overflow-x:auto;padding-bottom:.4rem}
/* auto 1fr: the knot row keeps its height and the card takes the rest.
   Left to share the column's height equally, the cards in the shorter
   columns began halfway down the page while the tall one began at the top —
   which is how it shipped, and how it was seen. */
.valuechain .link{position:relative;display:grid;grid-template-rows:auto 1fr;gap:.45rem;min-width:0;
  align-content:start}
.whichway{margin:.9rem 0 .3rem;font-size:.74rem;text-transform:uppercase;letter-spacing:.08em}
.valuechain .knot{position:relative;height:1.7rem;display:flex;align-items:center}
.valuechain .knot span{width:1.7rem;height:1.7rem;border-radius:50%;display:grid;place-items:center;
  font-size:.78rem;font-weight:700;background:#fff;border:2px solid var(--line);color:var(--muted);
  position:relative;z-index:1}
/* the line through the nodes */
.valuechain .link:not(:last-child) .knot::after{content:"";position:absolute;inset-inline-start:1.7rem;
  inset-inline-end:-.6rem;top:calc(50% - 1px);height:2px;background:var(--line)}
.valuechain .link.done .knot span{background:var(--brand);border-color:var(--brand);color:#fff}
/* Passed through: reached by what came after it, without a paper of its own.
   A ring rather than a fill, so it reads as "implied" at a glance. */
.valuechain .link.passed .knot span{background:#fff;border-color:var(--brand);color:var(--brand)}
.valuechain .link.done .knot::after,.valuechain .link.passed .knot::after{background:var(--brand)}
.valuechain .link.current .knot span{background:var(--accent);border-color:var(--accent);color:var(--ink)}
.valuechain .link.end .knot span{background:var(--bad);border-color:var(--bad);color:#fff}
/* Superseded is not a failure: it is the hand-over to the next revision. */
.valuechain .link.end.superseded .knot span{background:var(--muted);border-color:var(--muted)}
.valuechain .link.end.superseded .box{border-color:var(--muted)}
.revline{margin:.9rem 0 .35rem;font-size:.82rem;display:flex;gap:.5rem;align-items:center}
.revline.here b{color:var(--ink)}
.valuechain + .revline{margin-top:1.1rem}
.valuechain .box{border:1px solid var(--line);border-radius:6px;padding:.65rem .75rem;background:#fff;min-height:4.4rem}
.valuechain .link.ahead .box{background:transparent;border-style:dashed}
.valuechain .link.current .box{border-color:var(--accent);box-shadow:0 0 0 2px rgba(239,161,60,.25)}
.valuechain .link.end .box{border-color:var(--bad)}
.valuechain h3{margin:0 0 .25rem;font-size:.86rem;font-weight:700;color:var(--ink)}
.valuechain .link.ahead h3{color:var(--muted);font-weight:600}
.valuechain .reachedby{margin:0;font-size:.78rem;color:var(--muted);display:flex;gap:.4rem;flex-wrap:wrap}
.valuechain .reachedby b{color:var(--ink);font-weight:600}
.valuechain .entries{list-style:none;margin:.5rem 0 0;padding:.45rem 0 0;border-top:1px dashed var(--line);
  font-size:.76rem;display:grid;gap:.3rem}
.valuechain .entries b{font-weight:600}
.valuechain .entries .who,.valuechain .entries time{color:var(--muted)}
.valuechain .entries .facts{display:block;color:var(--muted);word-break:break-word}
.valuechain .box > .facts{margin:.3rem 0 0;font-size:.78rem;color:var(--muted)}
.rawtrail summary{cursor:pointer;font-size:.8rem;margin-top:.2rem}
.rawtrail .trail{margin-top:.6rem}
/* A job's trail as a chain: the cards hold documents rather than lines. */
.jobchain .box{min-height:5rem}
.jobchain .docline{margin:.3rem 0 0;display:flex;gap:.35rem;flex-wrap:wrap;align-items:center;font-size:.78rem}
.jobchain .gap{margin:.35rem 0 0;padding:.35rem .5rem;border-radius:3px;font-size:.78rem;
  background:#fff8ec;color:#7a5210;border-inline-start:3px solid var(--accent)}
.jobchain .link.ahead .box{background:#fff}
.extras{margin:.2rem 0 .6rem;font-size:.8rem;display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.extras > span{display:inline-flex;gap:.3rem;align-items:center}
.stagetag{font-size:.74rem;padding:.12rem .45rem;border-radius:3px;background:#e6ecf5;color:var(--ink);white-space:nowrap}
@media (max-width:52rem){
  .valuechain{grid-auto-flow:row;grid-auto-columns:auto;overflow:visible}
  .valuechain .link{grid-template-columns:1.7rem 1fr;gap:.6rem;align-items:start}
  .valuechain .knot{height:auto;align-items:start;padding-top:.3rem}
  .valuechain .link:not(:last-child) .knot::after{inset:auto;top:2.1rem;bottom:-.7rem;left:calc(.85rem - 1px);
    width:2px;height:auto}
}
.chain{list-style:none;margin:0;padding:0}
.chain li{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;
          padding:.4rem 0;border-bottom:1px solid var(--surface)}
.chain li:last-child{border-bottom:0}
.chain li + li:not(.gap){position:relative;padding-inline-start:1.1rem}
.chain li + li:not(.gap)::before{content:"↳";position:absolute;inset-inline-start:0;color:var(--muted)}
/* A gap is the point of the screen, so it is the one thing here with colour. */
.chain li.gap,tr.gap td{background:#fff8ec;color:#7a5210;border-inline-start:3px solid var(--accent);
                        padding-inline-start:.6rem;font-size:.85rem}
.chain li.gap{border-radius:2px;margin:.2rem 0}
h3.loose{margin:1.4rem 0 .4rem;font-size:.8rem;text-transform:uppercase;
         letter-spacing:.06em;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* A filed document, opened over the page instead of in a tab you then have to
   find your way back from. Big, because the thing being read is a scan of an
   A4 page and anything smaller is a thumbnail. */
.filebox{width:min(92vw,60rem);height:min(88vh,52rem);padding:0;border:0;border-radius:6px;
         box-shadow:0 24px 60px rgba(10,26,47,.32);overflow:hidden}
.filebox::backdrop{background:rgba(10,26,47,.55)}
.filebox header{display:flex;align-items:center;gap:1rem;justify-content:space-between;
                padding:.6rem .8rem;background:var(--ink);color:#fff;flex-wrap:wrap}
.filebox header .name{font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filebox header .btns{display:flex;gap:.35rem;flex-wrap:wrap}
.filebox header .btn{background:#fff}
.filebox iframe{display:block;width:100%;height:calc(100% - 5.4rem);border:0;background:var(--surface)}
.filebox .note{margin:0;padding:.45rem .8rem;background:var(--surface);font-size:.78rem}
@media (max-width:40rem){
  .filebox{width:100vw;height:100vh;max-width:none;border-radius:0}
  .filebox iframe{height:calc(100% - 7rem)}
}

/* ── SEARCH STANDS ALONE; THE COLUMNS NARROW THEMSELVES ────────────────────
   A panel holding two dropdowns was a box of chrome around almost nothing.
   Narrowing by a column belongs in that column's heading, where a spreadsheet
   has taught everybody to look. Search keeps its own place: it is not a
   column — it reads our reference, theirs, the party and the subject at once. */
/* position:relative because the suggestion panel is absolute and hangs from
   the form. Without it the panel measures itself against whatever ancestor
   happens to be positioned and lands somewhere else on the page entirely. */
/* Empty list — dense, not a marketing card. */
.empty-state{margin:0 0 1.1rem;padding:1.1rem 1.15rem;background:var(--card);border:1px dashed #b7c5d6;
  border-radius:5px;font-size:.9rem;color:var(--muted-foreground);line-height:1.55;text-align:start}
.empty-state p{margin:0}
.empty-state p + p{margin-top:.4rem}

.hunt{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;margin-bottom:.85rem;
      position:relative;padding:.65rem .75rem;background:var(--card);border:1px solid var(--border);
      border-radius:5px;box-shadow:0 1px 2px rgba(10,26,47,.03)}
.hunt input[type=search]{flex:1 1 20rem;min-width:0;border:1px solid var(--input-border);border-radius:4px;
                         padding:.52rem .65rem;font-size:.9rem;background:var(--field);color:var(--foreground);
                         min-height:2.35rem;box-shadow:inset 0 1px 1px rgba(10,26,47,.05)}
.hunt input[type=search]:hover,.hunt select:hover{border-color:var(--input-border-hover)}
.hunt input[type=search]:focus-visible,.hunt select:focus-visible{outline:2px solid var(--ring);outline-offset:1px;
  border-color:var(--primary);box-shadow:0 0 0 3px rgba(45,93,170,.12)}
.hunt select{border:1px solid var(--input-border);border-radius:4px;padding:.5rem .55rem;
             font-size:.85rem;background:var(--field);color:var(--foreground);min-height:2.35rem;
             box-shadow:inset 0 1px 1px rgba(10,26,47,.05)}
.hunt select.on{border-color:var(--primary);color:var(--primary);background:var(--primary-soft);font-weight:600}
.hunt .clear{font-size:.82rem;color:var(--muted-foreground);background:var(--secondary);border:1px solid var(--border);
             padding:.4rem .65rem;cursor:pointer;text-decoration:none;border-radius:4px;min-height:2.35rem}
.hunt .clear:hover{color:var(--destructive);border-color:var(--danger-border);background:var(--danger-soft)}

/* Shared list pager — range, page size, prev/next. */
.pager-bar{display:flex;flex-wrap:wrap;gap:.65rem 1rem;align-items:center;justify-content:space-between;
           margin:1rem 0 1.5rem;padding:.7rem 0 0;border-top:1px solid var(--border)}
.pager-range{margin:0;font-size:.85rem;color:var(--muted-foreground)}
.pager-size select{border:1px solid var(--input-border);border-radius:4px;padding:.4rem .5rem;font:inherit;background:var(--field);
  min-height:2.1rem}
.pager-size select:focus-visible{outline:2px solid var(--ring);outline-offset:1px}
.pager-btns{display:flex;align-items:center;gap:.4rem}
.pager-page{font-size:.82rem;color:var(--muted-foreground);min-width:3.5rem;text-align:center}
.btn.small.off{opacity:.45;pointer-events:none;cursor:default}
.clip{display:inline-block;max-width:18rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
td.clip,td .clip{max-width:16rem}

/* The heading holds the control that narrows it. Selects are quiet until
   used, so a column that is filtering looks different from one that is not. */
.reg thead th.filt{padding-block-end:.45rem}
.reg thead th.filt span{display:block;margin-bottom:.2rem}
.reg thead th.filt select{width:100%;max-width:11rem;border:1px solid transparent;
                          background:transparent;border-radius:3px;padding:.15rem .2rem;
                          font-size:.78rem;font-weight:500;color:var(--muted);
                          text-transform:none;letter-spacing:0}
.reg thead th.filt select:hover{border-color:var(--input-border);background:var(--field)}
.reg thead th.filt select:focus{border-color:var(--brand);background:#fff;color:var(--ink)}
/* Narrowed is a state, so it looks like one rather than reading the same as
   "all of them". */
.reg thead th.filt select.on{color:var(--brand);border-color:#c6d6ec;background:#fff}

/* ── THE REGISTER: A TABLE ON A DESK, CARDS ON A PHONE ─────────────────────
   One markup, two shapes. The cells carry their own labels and this folds
   them under 52rem, so the register stays readable on the screen most of it
   is actually read on — without a second template that has to be kept in
   step with the first. */

/* What kind of document, and which way it went. Direction is the tint, and
   never only the tint: the accessible name says it in words. */
.dtype{display:inline-flex;align-items:center;justify-content:center;flex:none;
       width:2rem;height:2rem;border-radius:5px;border:1px solid}
.dtype svg{width:1.15rem;height:1.15rem}
.dtype-out{background:#eef3ea;border-color:#cfdcc4;color:#3d6127}
.dtype-in{background:#e8f0fb;border-color:#c6d6ec;color:#1d4a8f}
/* A job file's kind mark is untinted: the folder has no direction, and its one
   other fact is already a word in the status column. */
.dtype-job{background:var(--surface);border-color:#d3dde9;color:#42566e}

.docid{display:flex;align-items:flex-start;gap:.6rem}
.docid > span{display:flex;flex-direction:column;gap:.05rem;min-width:0}
.docid .muted{color:var(--muted);font-size:.74rem}
.docid a{word-break:break-all}
/* The type in words. On a desk the glyph carries it; on a phone, where the
   glyph is smaller and the hurry is greater, the word is welcome.
   THIS IS THE QUIET ONE — records, the customer file and the contact book all
   put the kind UNDER the name, where it is a footnote to it. */
.reg .docid .kind{display:none}

/* WHERE THE KIND LEADS THE CELL, it is a different job and needs a different
   size. Seven glyphs carrying "is this an invoice or a delivery note" on their
   own is fine once you have learned them, and this application is used by
   people who have not. Only the register marks it lead — styling plain .kind
   for this made the type shout over the title on three other screens. */
.reg .docid .kind.lead{display:block;font-size:.86rem;font-weight:600;
                       color:var(--ink);letter-spacing:.01em}

/* THE NAME SOMEBODY ACTUALLY REMEMBERS, IN THE PLACE THEY LOOK FIRST.
   Nobody scanning this list is hunting for NEXUS:QTN:2026:0001. They are
   hunting for Gulf Cable, or for the Food Africa stand — so the party now
   holds the first column, where the reference used to sit, and the reference
   has the second, quiet in its monospace. The comment saying this has been
   here for a while; the layout had not caught up with it. */
.reg td.who{font-weight:600;color:var(--ink)}
.reg .docid .who{font-weight:500;color:var(--ink);font-size:.92rem;
                 text-decoration:none;word-break:break-word}
.reg .docid .who:hover{color:var(--brand)}
.reg td.ref{white-space:nowrap}
.reg td.ref .mono{font-size:.82rem;color:var(--muted)}
.reg td.ref .mono:hover{color:var(--brand)}

.found{align-self:center;color:var(--muted);font-size:.8rem;white-space:nowrap}

@media (max-width:52rem){
  /* `table.list td` outranks `.reg td`, so every override here has to be
     written at the same weight or the cells keep their table borders and the
     card grows a hairline under each field. */
  /* THE HEADINGS DO NOT EXIST HERE — the table is cards. So the two filters
     that live in them come out as a strip of their own, rather than being
     clipped away with the rest of the header and leaving a phone with no way
     to narrow anything. The words are hidden; the controls are not. */
  /* Written as `table.reg thead ...`, not `.reg thead ...`: the card rule for
     `table.reg tr` carries the same weight and comes later, so at equal
     specificity it won — the filters inherited the card's white box and lost
     their row layout, which is what the first attempt looked like. */
  table.reg thead{position:static;width:auto;height:auto;overflow:visible;clip:auto;display:block}
  table.reg thead tr{display:flex;gap:.4rem;background:none;border:0;border-radius:0;
                     padding:0;margin:0 0 .6rem}
  table.reg thead th{display:none}
  table.reg thead th.filt{display:block;flex:1 1 0;min-width:0;padding:0;border:0}
  table.reg thead th.filt span{position:absolute;width:1px;height:1px;overflow:hidden;
                               clip:rect(0 0 0 0)}
  table.reg thead th.filt select{width:100%;max-width:none;border-color:var(--input-border);
                                 background:var(--field);padding:.45rem .5rem;font-size:.85rem;
                                 color:var(--ink)}
  table.reg,table.reg tbody,table.reg tr{display:block;width:100%}
  table.reg{background:none;border-collapse:separate;border-spacing:0;font-size:.9rem}
  table.reg tr{background:#fff;border:1px solid var(--line);border-radius:6px;
               padding:.7rem .85rem;margin-bottom:.55rem}
  table.reg tr:hover td{background:none}
  table.reg td{display:block;border:0;padding:0;width:auto}

  /* The kind and the party lead the card and name themselves — no label
     saying "party" over the word Gulf Cable. */

  /* Quiet lines under the name: when and where it stands, then the reference,
     where it is filed and what it is worth. Separate rows for each made a
     card as tall as a phone for six short facts. */
  table.reg td[data-label="Date"],
  table.reg td[data-label="Status"]{display:inline-block;padding-top:.4rem;
                                     margin-inline-end:.9rem;vertical-align:middle}
  table.reg td[data-label="Reference"],
  table.reg td[data-label="Job"],
  table.reg td[data-label="Total"]{display:inline-block;padding-top:.35rem;
                                    margin-inline-end:1rem;color:var(--muted);font-size:.82rem}
  table.reg td[data-label="Date"]{color:var(--muted);font-size:.82rem}
  table.reg td[data-label="Reference"]::before,
  table.reg td[data-label="Job"]::before,
  table.reg td[data-label="Total"]::before{font-size:.66rem;letter-spacing:.08em;
                                            text-transform:uppercase;margin-inline-end:.25rem}
  table.reg td[data-label="Reference"]::before{content:"Ref"}
  table.reg td[data-label="Job"]::before{content:"Job"}
  table.reg td[data-label="Total"]::before{content:"Total"}
  table.reg td[data-label="Total"]{text-align:start}

  .reg .docid .kind{display:block}
}

/* ── WHAT NEEDS DOING, IN ONE BAND ─────────────────────────────────────────
   Four full-width tables stacked on each other pushed the register below the
   fold: the screen led with its exceptions and buried the thing it is named
   after. Cards earn their place here — each is a separate group of objects
   with its own action, which is the test the charter sets. */
.needs{display:grid;gap:.7rem;margin-bottom:1.2rem;
      grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}
.needs-card{background:#fff;border:1px solid var(--line);border-radius:6px;
           padding:.75rem .85rem;border-inline-start:3px solid var(--line)}
.needs-card.accent{border-inline-start-color:var(--accent)}
.needs-card.bad{border-inline-start-color:var(--bad)}
.needs-card h2{margin:0 0 .5rem;font-size:.72rem;letter-spacing:.09em;text-transform:uppercase;
              color:var(--muted);display:flex;justify-content:space-between;gap:.5rem}
.needs-card h2 span{color:var(--ink);font-size:.95rem;letter-spacing:0;font-weight:700}
.needs-card ul{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.needs-card li{display:grid;gap:.1rem;font-size:.86rem;min-width:0}
.needs-card li a{font-weight:500;text-decoration:none;overflow:hidden;text-overflow:ellipsis;
                white-space:nowrap}
.needs-card li small{color:var(--muted);font-size:.76rem}
.needs-card li form{margin-top:.25rem;display:flex;gap:.3rem}
/* A badge in here is a badge and not a bar. The list is a grid, so a child
   with no width of its own fills the column — which made "expired" read as a
   red rule across the card. */
.needs-card li .tag{justify-self:start}
.needs-card .more{margin:.5rem 0 0;font-size:.76rem;color:var(--muted)}

/* ── WHICH HALF OF THE REGISTER ────────────────────────────────────────────
   A CONTROL, NOT A BILLBOARD.

   Measured on a phone before this changed: three of these stood 291px tall —
   a third of the screen — to carry three numbers, and Contacts has four of
   them. With the exception cards above and the search below, the first
   DOCUMENT on a screen called Documents began at 863px, past the bottom of an
   812px phone. You scrolled a whole screen of furniture to reach the register.

   The glyph stays: it is how "we sent it" and "it arrived" are told apart at
   a glance, and it is the part people recognise. What goes is the sentence
   under the label — "Everything issued and everything received" beneath a
   card already labelled All documents was explaining the word "all". It
   teaches on the first visit and is read past on every visit after, and it
   was costing two thirds of the height to do it. The sentence is not thrown
   away: it is the link's accessible name now, so a screen reader still gets
   it while the screen does not spend a third of itself on it.

   THE PHONE AND THE DESK ANSWER THIS DIFFERENTLY, so they are allowed to.
   Across a desk there is width going spare: the glyph sits at one end, the
   name and its sentence in the middle, the count at the other, and the row is
   one line tall. On a phone that width does not exist — three cards laid out
   that way stood 291px, a third of the screen, and Contacts has four of them.
   There they stack: glyph, short label, count, centred, in a third of the
   height. Same markup, same class, one question asked of two screens.

   Used by the register, job files, contacts and the records tabs — one change
   on four screens. */
.sides{display:flex;gap:.65rem;margin-bottom:1.05rem}
.side{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:.8rem;
      text-decoration:none;color:var(--ink);background:var(--card);
      border:1px solid var(--border);border-radius:7px;padding:.85rem 1rem;
      transition:border-color .12s,box-shadow .12s,background-color .12s;
      box-shadow:0 1px 2px rgba(10,26,47,.03)}
.side:hover{border-color:#a8bbd2;box-shadow:0 2px 5px rgba(10,26,47,.08)}
/* Chosen is said by ground and border, never by colour alone — aria-current
   says it in words to anything that can see neither. */
.side.on{border-color:var(--brand);background:var(--primary-soft);box-shadow:0 0 0 1px rgba(45,93,170,.12)}
.side-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;
           width:2.4rem;height:2.4rem;border-radius:7px;border:1px solid}
.side-mark svg{width:1.3rem;height:1.3rem}
.side-mark.out{background:#eef3ea;border-color:#cfdcc4;color:#3d6127}
.side-mark.in{background:#e8f0fb;border-color:#c6d6ec;color:#1d4a8f}
/* Everything: neither side's colour, because it is not a side. */
.side-mark.all{background:var(--surface);border-color:#d3dde9;color:#42566e}
/* A job file has two states and no direction. These are the swatches its own
   status tags already use on that screen — NOT the register's green and blue,
   which mean "we sent it" and "it arrived". Borrowing those would teach a
   folder to look like a direction. */
.side-mark.live{background:#eef4fb;border-color:#b9cfe8;color:#1d4f8b}
.side-mark.shut{background:#eef7f2;border-color:#b2d8c6;color:#2f6b3d}
.side-say{display:grid;gap:.1rem;min-width:0}
.side-say b{font-size:.95rem;font-weight:600}
.side-say small{color:var(--muted);font-size:.78rem}
.side.on .side-say b{color:var(--brand)}
.side-n{margin-inline-start:auto;font-size:1.35rem;font-weight:700;
        font-variant-numeric:tabular-nums;color:var(--muted)}
.side.on .side-n{color:var(--brand)}

/* WHICH HALF OF THE REGISTER, ON A PHONE.
   IMMEDIATELY AFTER THE RULES IT OVERRIDES, and that is not tidiness. This
   block first sat with the register's other narrow-screen rules a hundred
   lines earlier — before the declarations above — so the desk's padding and
   its .8rem gap won on source order and the "compact" cards came out 139px
   instead of 57px, taller than the ones they replaced. A media query does not
   outrank anything; it only wins by being later.

   The desk layout is 97px a card here, and three of them put the first
   document past the bottom of the screen. Stacked and centred they are a
   third of that, and the sentence goes: it explains on the first visit and is
   read past on every visit after. The link's accessible name still carries
   it. */
@media (max-width:52rem){
  .sides{gap:.4rem;margin-bottom:.9rem}
  .side{flex-direction:column;align-items:center;gap:.15rem;padding:.55rem .3rem}
  .side:hover{box-shadow:none}
  .side-mark{width:1.9rem;height:1.9rem}
  .side-mark svg{width:1.05rem;height:1.05rem}
  .side-say{display:block;text-align:center;max-width:100%}
  .side-say b{display:block;font-size:.78rem;font-weight:500;color:var(--muted);
              white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side-say small{display:none}
  .side-n{margin-inline-start:0;font-size:1.05rem;color:var(--ink)}
}

/* The cards above FILTER. These MAKE something — and they used to look the
   same: a glyph and a type name, with no way to tell "show me the invoices"
   from "start an invoice". The plus on the corner is what says it, and the
   row label says it in a word. */
.make{margin-bottom:1.1rem}
.make-lbl{display:block;margin-bottom:.35rem;font-size:.68rem;letter-spacing:.09em;
          text-transform:uppercase;color:var(--muted)}
.make .btns{gap:.4rem;flex-wrap:wrap}
.make .btn{display:inline-flex;align-items:center;gap:.45rem;padding-inline-start:.35rem}
.make .mk{position:relative;display:inline-flex;flex:none}
.make .dtype{width:1.5rem;height:1.5rem;border-radius:4px}
.make .dtype svg{width:.9rem;height:.9rem}
/* Small, and on the outside corner, so it reads as "add one of these" rather
   than as part of the document mark itself. */
.make .mk::after{content:"+";position:absolute;inset-block-end:-.28rem;inset-inline-end:-.28rem;
                 width:.85rem;height:.85rem;border-radius:50%;background:var(--brand);color:#fff;
                 font-size:.68rem;font-weight:700;line-height:.8rem;text-align:center;
                 border:1.5px solid #fff}
.make .btn:hover .mk::after{background:var(--ink)}

/* A heading that orders by itself. Quiet until it is the one in use, so five
   arrows do not compete for the eye — the charter's warning about badge and
   icon proliferation applies to little marks in headings too. */
.sortby{display:inline-flex;align-items:center;gap:.25rem;color:inherit;text-decoration:none;
        font:inherit;letter-spacing:inherit;text-transform:inherit}
.sortby span[aria-hidden]{opacity:.3;font-size:.85em}
.sortby:hover span[aria-hidden]{opacity:.7}
.sortby.on{color:var(--brand)}
.sortby.on span[aria-hidden]{opacity:1}
.reg thead th.n .sortby{justify-content:flex-end}

/* ── THE PAPER THEY SENT, WHERE OUR SHEET GOES ─────────────────────────────
   A document we issued shows its sheet on the page below its details. This
   one hid its file behind a viewer, so "read the document" was two different
   gestures depending on which way the paper travelled. Same errand, same
   shape: the sheet's own stage colours, and a page-sized frame. */
.paper{margin:1.4rem 0;border-radius:6px;overflow:hidden;background:var(--ink)}
.paper-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;
           flex-wrap:wrap;padding:.6rem .8rem;color:#fff}
.paper-bar b{font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.paper-bar .btns{gap:.35rem;flex-wrap:wrap}
.paper-bar .btn{background:#fff}
.paper iframe,.paper img{display:block;width:100%;height:min(85vh,58rem);border:0;
  background:var(--surface)}
/* A photograph is not a page. Left to itself an image is drawn at whatever
   size the camera took it — a delivery note snapped on a phone filled four
   frames and showed its top-left corner. Contain fits the whole paper. */
.paper img{object-fit:contain}
/* EVERY PAGE, one under the other, each fitted to the frame. Drawn by paper.js
   in place of the iframe, which on an iPhone showed the first page and no way
   to the second. */
.paper .pages{height:min(85vh,58rem);overflow:auto;background:var(--surface);
  padding:10px;display:flex;flex-direction:column;align-items:center;gap:10px;
  scroll-snap-type:y proximity;-webkit-overflow-scrolling:touch}
.paper .sheet{flex:0 0 auto;background:#fff;box-shadow:0 2px 12px rgba(10,26,47,.2);
  scroll-snap-align:start}
.paper .sheet canvas{display:block;width:100%;height:100%}
.paper .paper-say{font-size:.78rem;color:#c9d3e0;white-space:nowrap}
.paper .paper-missing{background:var(--surface);padding:2.2rem 1.4rem;text-align:center;color:var(--ink)}
.paper .paper-missing p{margin:.3rem auto;max-width:36rem}
.paper .paper-say[hidden]{display:none}
@media (max-width:52rem){
  .paper iframe,.paper img,.paper .pages{height:min(70vh,40rem)}
}
@media print{
  /* The register's furniture never prints; the file is the document. */
  .paper-bar{display:none}
  .paper{margin:0;background:none}
}

/* ── ONE PRIMARY ACTION ────────────────────────────────────────────────────
   Eleven controls used to sit in one row, all the same size. A row where
   everything is equally loud has no primary action at all — the reader has to
   read eleven labels to find the one thing the document is waiting for. */
.acts{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;margin-bottom:1rem}
.acts form{display:inline}
.btn.big{padding:.6rem 1.15rem;font-size:.95rem}
/* Going back is not an action on the document. */
.btn.quiet{margin-inline-start:auto;border-color:transparent;background:none;color:var(--muted)}
.btn.quiet:hover{border-color:var(--line);background:#fff}

/* Asking somebody to sign is a message, not a change to the document, so it
   sits beside the actions rather than among them. */
.ask{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;margin:0 0 1rem}
.ask > span{font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}

/* What cannot be undone is behind a deliberate press. Voiding withdraws a
   document the customer may be holding; deleting takes one out of the
   register. Neither belongs one slip of a finger from Print. */
/* WITHDRAW OR REMOVE — A LABEL, NOT A DOOR.
   This was a <details> and the two controls inside it were invisible until
   somebody guessed that a grey line of text opened. Reported as "I cannot find
   the void button" and "I cannot find delete": both existed, both worked, and
   nothing on the screen said so. The deliberate press that guards them is the
   panel each one opens — a reason for a void, a reason AND the password for a
   deletion — not the fact that you could not see them. */
.grave{margin:0 0 1.2rem}
.gravehead{margin:0 0 .45rem;font-size:.8rem;color:var(--muted)}
.gravehead::before{content:"⚠";opacity:.6;margin-inline-end:.35rem}
.grave .btns{gap:.4rem}

/* STAMPING SOMEBODY ELSE'S PAPER.
   The page is a canvas drawn by pdf.js; the marks are ordinary elements on top
   of it. Positions are held as fractions of the page and turned back into
   pixels on every draw, so a resized window or a phone does not move them. */
.stamper{margin:1rem 0}
.stamper-bar{display:flex;align-items:center;justify-content:space-between;gap:.8rem;
  flex-wrap:wrap;padding:.6rem .8rem;background:var(--ink);color:#fff;border-radius:6px 6px 0 0}
.stamper-bar .btn{background:#fff}
.stamper-bar .btn.primary{background:var(--accent);color:var(--ink)}
.stamper-bar .pager{display:flex;align-items:center;gap:.5rem;font-size:.85rem}
.stamper-bar .where{font-variant-numeric:tabular-nums}
.stamper-page{padding:1rem;background:#97a3b2;border-radius:0 0 6px 6px;overflow:auto}
.stamper .sheetwrap{position:relative;margin:0 auto;width:max-content;
  box-shadow:0 6px 28px rgba(10,26,47,.32)}
.stamper canvas.page{display:block;background:#fff}
.stamper .marks{position:absolute;inset-block-start:0;inset-inline-start:0}

.stamper .mark{position:absolute;cursor:grab;touch-action:none;
  outline:1px dashed rgba(45,93,170,.7);outline-offset:2px}
.stamper .mark.held{cursor:grabbing;outline-style:solid}
.stamper .mark img{display:block;width:100%;height:auto;pointer-events:none}

/* TYPED INTO THE PAGE, WHERE IT WILL BE.
   Filling in a form is a matter of lining an answer up with the line it
   belongs on, so the words are typed in place, in the typeface and at the size
   the file will get. Helvetica first because that is literally what is written
   into the PDF — the screen and the file agree about the shape of the letters
   as well as about where they sit. */
.stamper .mark.text{cursor:default}
.stamper .mark.text .ink{font-family:Helvetica,Arial,sans-serif;line-height:1.2;
  color:#0a1a2f;white-space:pre;min-width:1.2em;outline:none;
  /* The mark turns touch handling off so it can be dragged; the words turn it
     back on so a finger can put the cursor between two of them. */
  touch-action:auto;cursor:text}
.stamper .mark.text .ink:empty::before{content:"type here";color:#8b9bb0}
/* Its own handle, because pressing the middle of a text box has to put the
   cursor there rather than pick the box up. */
.stamper .mark .movegrip{position:absolute;inset-block-start:-6px;inset-inline-start:-6px;
  width:14px;height:14px;border-radius:3px;background:var(--brand);border:2px solid #fff;
  cursor:grab;touch-action:none}
.stamper .mark.held .movegrip{cursor:grabbing}
/* The handle and the remove button are the only two things on a mark, and both
   sit outside it: over the top they would cover the thing being placed. */
.stamper .mark .grip{position:absolute;inset-block-end:-6px;inset-inline-end:-6px;
  width:14px;height:14px;border-radius:3px;background:var(--brand);border:2px solid #fff;
  cursor:nwse-resize;touch-action:none}
.stamper .mark .off{position:absolute;inset-block-start:-10px;inset-inline-end:-10px;
  width:20px;height:20px;border-radius:50%;border:2px solid #fff;background:var(--bad);
  color:#fff;font-size:.8rem;line-height:16px;padding:0;cursor:pointer}
.stamper-say{margin-top:.6rem}
@media (max-width:52rem){
  .stamper-bar{justify-content:flex-start}
  .stamper-page{padding:.5rem}
}

/* FILING WHAT ARRIVED, WITH IT ON SCREEN.
   The paper and the fields side by side, because the whole reason for taking
   the file first is reading the reference and the amounts off it while typing
   them. Stacked on a narrow screen with the paper first: it is the thing being
   read, and a form above it would push it off the bottom. */
.filing{display:grid;gap:1.1rem;align-items:start}
.filing .paper{margin:0}
/* STACKED, THE PAPER MUST NOT FILL THE SCREEN.
   At its usual height the next thing on the page starts a whole viewport down,
   so the question you are there to answer is somewhere below the fold and the
   screen looks like it is only a document viewer. */
.filing .paper iframe,.filing .paper img{height:min(52vh,30rem)}
/* And while the question is WHICH KIND of document this is, the question comes
   first: the paper is what you consult to answer it, not the answer. */
.filing.asking .filing-paper{order:2}
.filing-paper .hint{margin:.5rem 0 0}
/* A button that reads as a link. "Use a different file" is a change of mind,
   not an action worth a button's weight beside Save. */
.linky{border:0;background:none;padding:0;font:inherit;color:var(--brand);
  text-decoration:underline;cursor:pointer}
@media (min-width:66rem){
  .filing{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}
  /* Held still while the form is scrolled. */
  .filing-paper{position:sticky;inset-block-start:1rem}
  .filing .paper iframe,.filing .paper img{height:min(76vh,46rem)}
}

/* WHAT DID THEY SEND. One row each, a glyph and a sentence, because the answer
   is read off the paper beside it rather than recalled. */
/* One step back up the cascade. Quiet, because going back is not the thing
   somebody came to do — but always there, because guessing wrong at the first
   card should cost one press. */
.pickback{display:inline-block;margin:0 0 .6rem;font-size:.82rem;color:var(--muted)}
.pickback:hover{color:var(--brand)}
.pickkind{display:grid;gap:.45rem}
.pickkind a{display:flex;align-items:center;gap:.7rem;text-decoration:none;color:var(--ink);
  border:1px solid var(--line);border-radius:6px;padding:.6rem .75rem;background:#fff}
.pickkind a:hover{border-color:var(--brand);background:#f6f9fc}
.pickkind b{display:block;font-size:.94rem}
.pickkind small{display:block;color:var(--muted);font-size:.78rem}

/* DROPPING SOMETHING ONTO THE HOME PAGE FILES IT.
   Sits in the row of starters rather than above them: filing is the commonest
   thing anybody does here, but what NEEDS a person must stay in sight, and a
   banner across the top pushes it under the fold. */
.home .drop{display:grid;justify-items:center;text-align:center;gap:.15rem;
  border:1.5px dashed #a8bbd2;border-radius:9px;background:var(--card);
  padding:2.2rem 1.25rem;color:var(--ink);cursor:pointer;
  transition:border-color .12s,background .12s,box-shadow .12s}
.home .drop:hover{box-shadow:0 1px 4px rgba(10,26,47,.06)}
.home .drop .mk{margin-bottom:.45rem}
.home .drop .dtype{width:2.7rem;height:2.7rem;border-radius:8px}
.home .drop .dtype svg{width:1.5rem;height:1.5rem}
.home .drop .mk::after{width:1.15rem;height:1.15rem;font-size:.82rem;line-height:1.15rem}
.home .drop b{font-size:1.08rem}
.home .drop .say{max-width:34rem;font-size:.85rem;color:var(--muted);line-height:1.45}
.home .drop:hover,.home .drop.over{border-color:var(--brand);background:#f2f7fd}
/* Solid while something is being dragged over it: a dashed edge reads as
   "empty", and at the moment of dropping it is anything but. */
.home .drop.over{border-style:solid}
.home .drop input[type=file]{display:none}
/* The + badge from the register's own starters, so "this makes something"
   reads the same here as it does there. */
.home .drop .mk{position:relative;display:inline-flex}
.home .drop .mk::after{content:"+";position:absolute;inset-block-end:-.3rem;
  inset-inline-end:-.3rem;border-radius:50%;background:var(--brand);color:#fff;
  text-align:center;font-weight:700}
/* WHILE IT IS GOING.
   A bar drawn along the bottom edge of the panel itself rather than a separate
   widget: the thing that is working is the thing you dropped it on. The width
   comes from --sent, which the script sets from the browser's own count of
   bytes actually delivered — not from a timer pretending. */
.home .drop.busy{pointer-events:none;position:relative;overflow:hidden;
  border-style:solid;border-color:var(--brand);background:#f2f7fd}
.home .drop.busy::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;
  height:3px;width:var(--sent,0%);background:var(--brand);transition:width .18s ease-out}
/* The invitation stops inviting while it is busy. */
.home .drop.busy b{color:var(--muted)}

/* THE PEN. A box to sign in, not a form field — the border says "write here"
   and the crosshair says the pointer will leave a mark. touch-action stops a
   finger scrolling the page while it is drawing, which otherwise makes signing
   on a phone impossible rather than merely awkward. */
.signpad{display:block;width:100%;height:11rem;margin:.2rem 0 .9rem;
  border:1px dashed #c3d2e6;border-radius:6px;background:#fff;
  cursor:crosshair;touch-action:none}
.signpad:hover{border-color:var(--brand)}

/* DELETING A FILE, ASKED FOR PROPERLY.
   A disclosure on the paper's own bar. It was a prompt behind a viewer popup,
   which is two reasons nobody found it: it was not on the screen, and the one
   place it was could only be reached by opening something else. */
/* Recording a delivery: the same disclosure shape as deleting a file, which
   is the shape this application uses whenever a press needs a sentence of
   explanation before it.

   IT IS NOT A BUTTON. The question is asked by whatever hands the document
   over — Save as PDF, Share, Print — which opens this from the script. What
   stays on the screen is a line saying how the document went, or, once three
   days have passed with no answer, that nothing says it went at all. Until
   then `.silent` holds no space: an empty inline-block still draws a line box,
   which put a stray blank row under the actions of every signed document.
   (Not `.quiet` — that already means a muted BUTTON, and one word meaning two
   things in one stylesheet is how the wrong rule gets edited.) */
.delivered{position:relative;display:inline-block;margin-block:0 1rem}
/* NEVER HIDDEN. This carried .silent — display:none — until the document was
   three days old, so anything handed over on the day it was signed could not
   be recorded at all and its trail could never close. The three-day rule
   still decides when the register starts ASKING; it has no business deciding
   whether you may answer. */
.delivered summary{list-style:none;cursor:pointer;display:inline-block}
/* Overdue says so on the button rather than in a second line of text: the
   register has started asking, and the thing it is asking about is the thing
   you press. */
.delivered summary.overdue{border-color:var(--accent);color:var(--accent)}
.delivered summary::-webkit-details-marker{display:none}
.delivered summary::-webkit-details-marker{display:none}
.delivered form{position:absolute;inset-inline-start:0;inset-block-start:calc(100% + .4rem);
  z-index:30;width:min(24rem,86vw);display:grid;gap:.5rem;padding:.85rem;
  background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:6px;
  box-shadow:0 6px 24px rgba(10,26,47,.18);text-align:start}
.delivered form:focus{outline:none}
.delivered form p{margin:0;font-size:.82rem;color:var(--muted);line-height:1.45}
.delivered label{display:grid;gap:.2rem;font-size:.78rem;color:var(--muted)}
.delivered input{border:1px solid var(--input-border);border-radius:4px;padding:.45rem .55rem;
  font:inherit;font-size:.86rem;color:var(--ink);background:var(--field)}
/* The answer itself: one press per route, none of them chosen in advance. */
.delivered .ask-how{font-size:.78rem;color:var(--muted)}
.delivered .ways{display:flex;flex-wrap:wrap;gap:.35rem}
/* .btn.quiet pushes itself right with an auto margin, which is for a row
   of actions; here it would leave Not yet stranded off on its own. */
.delivered [data-close-delivery]{margin-inline-start:0}
@media (max-width:40rem){
  .delivered form{position:fixed;inset-inline:0;inset-block-end:0;inset-block-start:auto;
    width:auto;max-height:80vh;overflow:auto;border-radius:12px 12px 0 0;
    padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));z-index:60}
  .delivered[open]::before{content:"";position:fixed;inset:0;background:rgba(10,26,47,.45);z-index:59}
  .delivered input{font-size:16px}
  /* Thumb-sized, and wide enough that the two-word routes do not wrap. */
  .delivered .ways .btn{flex:1 1 8rem;padding-block:.6rem;text-align:center}
}

.killfile{position:relative}
.killfile summary{list-style:none;cursor:pointer;display:inline-block}
.killfile summary::-webkit-details-marker{display:none}
.killfile form{position:absolute;inset-inline-end:0;inset-block-start:calc(100% + .4rem);
  z-index:30;width:min(22rem,80vw);display:grid;gap:.5rem;padding:.8rem;
  background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:6px;
  box-shadow:0 6px 24px rgba(10,26,47,.18)}
.killfile form p{margin:0;font-size:.8rem;color:var(--muted);line-height:1.45}
.killfile label{display:grid;gap:.2rem;font-size:.78rem;color:var(--muted)}
.killfile input{border:1px solid var(--input-border);border-radius:4px;padding:.45rem .55rem;
  font:inherit;font-size:.86rem;color:var(--ink)}
.killfile input:focus{outline:2px solid var(--brand);outline-offset:1px}
/* ON A PHONE IT IS A SHEET, NOT A POPOVER.
   Anchored under its button it was clipped by whatever held the button — the
   paper panel hides its overflow and a table cell has no room — so on a phone
   the reason box and the password box were half off the screen and could not
   be scrolled to. Fixed to the foot of the screen it is always whole, above
   the keyboard, and the same on every page it appears on. */
@media (max-width:40rem){
  .killfile form{position:fixed;inset-inline:0;inset-block-end:0;inset-block-start:auto;
    width:auto;max-height:80vh;overflow:auto;border-radius:12px 12px 0 0;
    padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow:0 -8px 30px rgba(10,26,47,.28);z-index:60}
  .killfile[open]::before{content:"";position:fixed;inset:0;background:rgba(10,26,47,.45);z-index:59}
  .killfile input{font-size:16px}  /* under 16px iOS zooms the page to the field */
}

/* WAITING FOR THE PAPER. A line of words with the count drawn under it, in the
   panel's own place — not a spinner, which says only that something is
   happening and never how much is left. */
.stamper-wait{position:relative;margin:0 0 1rem;padding:.85rem 1rem;
  border:1px solid var(--line);border-radius:6px;background:#fff;
  font-size:.9rem;color:var(--muted);overflow:hidden}
.stamper-wait::after{content:"";position:absolute;inset-block-end:0;inset-inline-start:0;
  height:3px;width:var(--sent,0%);background:var(--brand);transition:width .2s ease-out}

/* Making somebody without leaving the paper behind. Sits under the list it is
   an alternative to, laid out so the name is the wide field and the rest is
   one press. */
.pickmake{display:grid;gap:.55rem;margin-top:.2rem}
.pickmake .f{margin:0}
@media (min-width:34rem){
  .pickmake{grid-template-columns:1fr 11rem auto;align-items:end}
}

/* A message body, shown as the text it is. Wrapped rather than scrolled
   sideways, because a quoted reply chain is long lines and nothing else. */
.mailbody{margin:0;white-space:pre-wrap;word-break:break-word;font:inherit;
  font-size:.88rem;line-height:1.5;color:var(--ink);max-height:34rem;overflow:auto}

/* Writing one. Wide enough to see a paragraph, and the subject and addresses
   above it in the order a message is actually filled in. */
.write{display:grid;gap:.9rem;max-width:46rem}
.write textarea{min-height:14rem;resize:vertical;line-height:1.5}

/* ── MAIL ───────────────────────────────────────────────────────────────────
   A mail client has settled shape: a rail of mailboxes and folders down the
   side, and a line per message — who, what, when — with the unread ones
   louder than the rest. A register table was the wrong shape for it; nobody
   reads their inbox in ruled columns under a header row.

   The rail runs the height of the screen on a desk and is a strip of chips
   across the top on a phone, with Write first: a compose button below the
   fold is a compose button nobody finds. The page heading sits over the list,
   not over the rail, so what you are reading and what it is called line up. */
.mailwrap{max-width:84rem}
.mailbox{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;margin-bottom:1.2rem}
/* A GRID ITEM WILL NOT SHRINK BELOW ITS CONTENTS UNLESS IT IS TOLD TO —
   without this the longest subject sets the width and the dates on the end
   of every row are off the side of the screen. */
.mailbox > *{min-width:0}
.micon{display:block;flex:none;width:1.05rem;height:1.05rem}

/* The rail. */
.mrail{display:flex;align-items:center;gap:.4rem;overflow-x:auto;padding-bottom:.3rem;
  -webkit-overflow-scrolling:touch}
.mwrite{flex:none;justify-content:center;border-radius:8px;padding:.5rem 1rem;font-size:.9rem;
  box-shadow:0 1px 2px rgba(10,26,47,.12)}
.mwrite .micon{width:1rem;height:1rem}
.mgroup{display:flex;align-items:center;gap:.3rem;flex:none}
.mgroup-h{display:none}
.mf{display:flex;align-items:center;gap:.55rem;flex:none;padding:.42rem .7rem;border-radius:7px;
  text-decoration:none;color:#33475e;font-size:.87rem;white-space:nowrap;min-height:2.2rem}
.mf .micon{color:var(--muted)}
.mf-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
.mf:hover{background:#e4ebf4;color:var(--ink)}
.mf.on{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(10,26,47,.08),0 0 0 1px var(--line)}
.mf.on .micon{color:var(--brand)}
.mf .badge{margin-inline-start:auto}
@media (min-width:52rem){
  .mailbox{grid-template-columns:14rem minmax(0,1fr);gap:1.6rem;align-items:start}
  .mrail{position:sticky;top:1rem;flex-direction:column;align-items:stretch;gap:1.1rem;
    overflow:visible;padding:0}
  .mgroup{flex-direction:column;align-items:stretch;gap:1px}
  .mgroup-h{display:block;margin:0 0 .3rem;padding-inline:.7rem;font-size:.66rem;font-weight:600;
    letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
  .mf-name{flex:1}
  /* What the REGISTER knows, as against what the mail server knows: below a
     line, asked once a week where the folders are asked all day. */
  .mours{border-top:1px solid var(--line);padding-top:.9rem}
}

/* The heading over the list, with the search beside it. */
.mtop{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:.4rem}
.mtop h1{margin:0}
.mmain > .mtop{align-items:flex-end;gap:.8rem 1.2rem;margin-bottom:1rem}
.mtop-title{min-width:0}
.mmain > .mtop h1{font-size:1.45rem;letter-spacing:-.01em}
.mmain > .mtop .sub{margin:.2rem 0 0;overflow-wrap:anywhere}
.msearch{display:flex;align-items:center;gap:.4rem;flex:1 1 18rem;max-width:28rem;margin:0}
.msearch-box{position:relative;flex:1;min-width:0;display:flex;align-items:center}
.msearch-box input{width:100%;background:#fff;border:1px solid var(--input-border);border-radius:8px;
  padding:.5rem 2.1rem .5rem 2.15rem;font-size:.88rem;color:var(--ink);-webkit-appearance:none;appearance:none}
.msearch-box input::-webkit-search-cancel-button{-webkit-appearance:none}
.msearch-box input:focus{outline:2px solid var(--brand);outline-offset:0;border-color:transparent}
.msearch-i{position:absolute;inset-inline-start:.7rem;color:var(--muted);pointer-events:none}
.msearch-x{position:absolute;inset-inline-end:.35rem;display:flex;align-items:center;justify-content:center;
  width:1.6rem;height:1.6rem;border-radius:50%;color:var(--muted)}
.msearch-x:hover{background:var(--surface);color:var(--ink)}
.msearch-x .micon{width:.85rem;height:.85rem}
.msearch .btn{padding-block:.45rem}

/* THE LIST, IN ONE PANE: the bar that acts on picked messages on top, the
   rows, and a line underneath saying how true the list is. */
.mpane{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;
  box-shadow:0 1px 2px rgba(10,26,47,.04)}
.mlist{list-style:none;margin:0;padding:0}
.mrow{display:flex;align-items:center;position:relative;background:#fbfcfe}
.mrow + .mrow{border-top:1px solid #edf1f6}
.mrow > a{flex:1;min-width:0;display:flex;align-items:center;gap:.75rem;
  padding:.55rem .9rem .55rem .3rem;text-decoration:none;color:var(--muted)}
.mrow > a:focus-visible{outline-offset:-2px}
.mrow:hover{background:#f3f7fc}

/* UNREAD IS A DOT, A WEIGHT AND A WHITER ROW — and the dot holds its space on
   every row, so nothing shifts sideways when a message is read. Read is
   plain: the subject is the message's title, but once read it carries no
   weight at all, because 500 against 700 is a difference you have to look for. */
.mdot{flex:none;width:.5rem;height:.5rem;border-radius:50%;margin-inline-start:.8rem;background:transparent}
.mtick + .mdot{margin-inline-start:0}
.mrow.unread{background:#fff}
.mrow.unread .mdot{background:var(--brand)}
.mrow.unread .mwho,.mrow.unread .mtext b{font-weight:700;color:var(--ink)}
.mrow.unread .mwhen{color:var(--ink);font-weight:600}

/* WHO, AT A GLANCE: a letter in a circle, the same tint for the same name. */
.mava{display:inline-flex;align-items:center;justify-content:center;flex:none;width:2rem;height:2rem;
  border-radius:50%;font-size:.8rem;font-weight:600;line-height:1;letter-spacing:0}
.mava.small{width:1.4rem;height:1.4rem;font-size:.66rem}
.mava.t0{background:#e3ecf9;color:#2d5daa}
.mava.t1{background:#e1f1ea;color:#1c6b49}
.mava.t2{background:#f5ebdd;color:#87531a}
.mava.t3{background:#ece6f5;color:#5b3f8f}
.mava.t4{background:#dff0f6;color:#1d6984}
.mava.t5{background:#f5e5e7;color:#953342}

/* The sender at a fixed width so the subjects line up down the page, which is
   what makes a list scannable rather than a wall. */
.mwho{flex:0 0 11rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:.88rem;color:#4a6076}
/* A line that is a whole conversation says how many, the way Gmail does. */
.mwho.has-more{display:flex;gap:.4rem;align-items:center}
.mnames{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mmore{flex:none;font-size:.7rem;font-weight:600;color:var(--muted);background:var(--surface);
  border-radius:10px;padding:0 .45rem;line-height:1.5}
.mtext{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.88rem}
.mtext b{font-weight:400;color:var(--ink)}
.mmeta{flex:none;display:flex;align-items:center;gap:.55rem;font-size:.78rem;color:var(--muted)}
.mwhen{white-space:nowrap;font-variant-numeric:tabular-nums;min-width:3.4rem;text-align:end}
.mclip{display:inline-flex;color:var(--muted)}
.mclip .micon{width:.95rem;height:.95rem}
/* WHICH MAILBOX A MESSAGE ARRIVED AT, in a merged list. Quiet: it answers a
   question you only ask about some of the rows. */
.mtag{font-size:.7rem;color:#4a6076;background:var(--surface);border-radius:4px;padding:.05rem .4rem;
  white-space:nowrap}
/* A MAILING, STILL THERE AND STILL BOLD IF UNREAD — just not shouting. Bulk
   mail says so in its own headers; a count that includes the newsletter is a
   count people learn to ignore. */
.mrow.auto .mdot,.mrow.unread.auto .mdot{background:#c6d2e2}
.mrow.auto .mwho{color:var(--muted)}
.mrow.auto .mava{opacity:.6}

/* THE TICK IS ITS OWN TARGET, not a corner of the row: a finger reaching for
   a message must not land on a delete. */
.mtick{flex:none;display:flex;align-items:center;justify-content:center;width:2.6rem;align-self:stretch;cursor:pointer}
.mtick input,.mpick-all input{width:1rem;height:1rem;margin:0;accent-color:var(--brand)}

/* DELETE, BESIDE THE ROW AND NOT INSIDE THE LINK. Revealed by hover on a desk;
   on a phone, where there is no hover, deleting is done on the message. */
.mkill{flex:none;margin:0;padding-inline-end:.5rem;opacity:0}
.mrow:hover .mkill,.mkill:focus-within{opacity:1}
.mtool-i{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:0;
  border-radius:6px;background:none;color:var(--muted);cursor:pointer}
.mtool-i:hover{background:#fdecea;color:var(--bad)}

/* The row being opened says so where the finger is, so a slow mailbox does
   not look like a tap that missed. */
.mrow.opening{opacity:.55}
.mrow.opening .mwhen{visibility:hidden}
.mrow.opening .mmeta::after{content:"Opening…";font-size:.74rem;color:var(--muted);
  position:absolute;inset-inline-end:.9rem}

/* THE BAR THAT ACTS ON WHAT YOU PICKED. There whether or not anything is
   picked — a bar that comes and goes is one nobody learns the position of —
   and lit while something is. */
.mpick-bar{display:flex;align-items:center;flex-wrap:wrap;gap:.2rem;min-height:2.75rem;
  padding:.3rem .6rem .3rem 0;border-bottom:1px solid var(--line);background:#fafbfd;transition:background .12s}
.mpick-bar.some{background:#eef4fc}
.mpick-all{display:flex;align-items:center;justify-content:center;width:2.6rem;align-self:stretch;cursor:pointer}
.mpick-n{font-size:.78rem;font-weight:600;color:var(--brand);margin-inline-end:.35rem;white-space:nowrap}
.mpick-n:empty{display:none}
.mpick-acts{display:flex;align-items:center;flex-wrap:wrap;gap:.15rem}
.mpick-move{display:inline-flex;align-items:center;gap:.25rem;margin-inline-start:.25rem;
  padding-inline-start:.45rem;border-inline-start:1px solid var(--line)}
.mpick-to{max-width:10rem;font-size:.78rem;padding:.25rem .4rem;border:1px solid var(--input-border);border-radius:6px;
  background:#fff;color:var(--ink)}
.btn.mtool{background:none;border-color:transparent;color:#4a6076;padding:.3rem .55rem;gap:.35rem}
.btn.mtool:hover{background:#e4ebf4;border-color:transparent;color:var(--ink)}
.btn.mtool .micon{width:.95rem;height:.95rem}
.btn.mtool[value="trash"]:hover{background:#fdecea;color:var(--bad)}

/* WHEN THIS WAS TRUE. A list that is always instant can quietly be an hour old
   if every check behind it has been failing. */
.mfoot{margin:0;padding:.65rem .95rem;border-top:1px solid var(--line);background:#fafbfd;
  font-size:.76rem;line-height:1.5;color:var(--muted)}

/* Nothing here, said plainly and in the middle. */
.mempty{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:2.6rem 1.2rem;text-align:center}
.mempty-i{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;
  background:var(--surface);color:var(--muted)}
.mempty-i .micon{width:1.4rem;height:1.4rem}
.mempty h2{margin:.3rem 0 0;font-size:1rem;letter-spacing:0;text-transform:none;color:var(--ink)}
.mempty .hint{margin:0 0 .4rem;max-width:26rem}

/* WAITING FOR A MAILBOX TO ANSWER: the shape of the list, greyed, and a line of
   words. A spinner insists that something is wrong with the waiting. */
.mghost .mrow{gap:.8rem;padding:.8rem .95rem;background:#fff}
.mghost-ava{flex:none;width:2rem;height:2rem;border-radius:50%;background:#edf1f6}
.mghost-line{flex:1;height:.65rem;border-radius:4px;
  background:linear-gradient(90deg,#edf1f6 0%,#f7f9fb 50%,#edf1f6 100%);background-size:200% 100%;
  animation:mghost 1.4s ease-in-out infinite}
.mghost .mrow:nth-child(2n) .mghost-line{max-width:62%}
@keyframes mghost{from{background-position:100% 0}to{background-position:-100% 0}}
@media (prefers-reduced-motion:reduce){.mghost-line{animation:none}}

/* NEW MAIL, WAITING TO BE ASKED FOR. Only shown to somebody scrolled into the
   list: redrawing the rows under a reader moves the one they were reaching for. */
.mnew{display:flex;align-items:center;justify-content:center;width:100%;margin:0 0 .7rem;padding:.5rem .8rem;
  border:1px solid #c9d9f0;border-radius:8px;background:#eef4fc;color:var(--brand);
  font:inherit;font-size:.86rem;font-weight:600;cursor:pointer}
.mnew:hover{border-color:var(--brand)}

/* ── A BOX PER MAILBOX ─────────────────────────────────────────────────────
   The merged stream was tried and reported back: "the tagging clearly says
   which email it is for, but we cannot read it because we list everything
   together." One column, two where there is width for two lists that can
   still be read, because boxes side by side are what make them boxes. */
.boxes-view{display:flex;align-items:center;justify-content:space-between;gap:.7rem 1rem;flex-wrap:wrap;margin:0 0 1rem}
.mseg{display:inline-flex;gap:2px;padding:3px;background:#e4ebf4;border-radius:9px}
.mseg-o{padding:.35rem .8rem;border-radius:7px;font-size:.82rem;color:#4a6076;text-decoration:none;white-space:nowrap}
.mseg-o:hover{color:var(--ink)}
.mseg-o.on{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(10,26,47,.1)}
.boxes-check{display:flex;align-items:center;justify-content:flex-end;gap:.6rem;flex-wrap:wrap}
.boxes-check .hint{margin:0;font-size:.8rem}
.boxes{display:grid;gap:1rem}
@media (min-width:80rem){.boxes{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* ONE MAILBOX IS THE WHOLE PAGE, not half of it. A box alone took one of two
   columns and scrolled inside itself beside an empty half; and the odd box
   out at the end of a set spans the row rather than leaving a hole. */
.boxes > .mbox:only-child,.boxes > .mbox:last-child:nth-child(odd){grid-column:1 / -1}
/* And alone it has nothing to share the screen with, so it does not scroll
   inside itself: the page does. */
.boxes > .mbox:only-child .mbox-body .mlist{max-height:none;overflow:visible}

.mbox{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:10px;
  overflow:hidden;box-shadow:0 1px 2px rgba(10,26,47,.04)}
.mbox-head{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem .7rem;margin:0;
  padding:.7rem .8rem .7rem .6rem;border-bottom:1px solid var(--line)}
/* THE NAME DOES NOT GIVE WAY TO THE BUTTONS: they are only findable once you
   know which mailbox you are looking at. Narrow, the head wraps instead. */
.mbox-name{flex:1 1 9rem;min-width:7rem;margin:0;font:inherit}
.mbox-fold{display:flex;align-items:center;gap:.6rem;width:100%;padding:0;border:0;border-radius:6px;
  background:none;font:inherit;color:var(--ink);text-align:start;cursor:pointer}
.mbox-caret{flex:none;width:.9rem;color:var(--muted);font-size:.85rem;text-align:center;transition:transform .12s}
.mbox[data-folded] .mbox-caret{transform:rotate(-90deg)}
.mbox-id{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.mbox-who{font-weight:600;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mbox-addr{font-size:.76rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* THE COUNT SURVIVES THE FOLD: a box can be put out of sight, the fact that
   something is waiting in it cannot. */
.mbox-counts{display:flex;align-items:center;gap:.45rem;flex:none}
.mbox-counts:empty{display:none}
.mbox-n{font-size:.74rem;font-variant-numeric:tabular-nums;color:var(--muted)}
.mbox-n.unread{padding:.12rem .55rem;border-radius:999px;background:#fdf0dc;color:#7a4300;font-weight:600}
.mbox-auto{font-size:.72rem;color:var(--muted);font-variant-numeric:tabular-nums}
.mbox-do{display:flex;align-items:center;gap:.3rem;flex:none;margin-inline-start:auto}
.mbox-do form{margin:0}
.mbox[data-folded] .mbox-head{border-bottom:0}
.mbox[data-folded] .mbox-body{display:none}
.mbox-body{display:flex;flex-direction:column;flex:1}
/* EACH BOX SCROLLS ITSELF, so four mailboxes are still on one screen. Not a
   whole number of rows: half a row at the fold says there is more. */
.mbox-body .mlist{max-height:22rem;overflow-y:auto;overscroll-behavior:contain}
@media (max-width:52rem){.mbox-body .mlist{max-height:60vh}}
.mbox .mrow .mava{width:1.75rem;height:1.75rem;font-size:.74rem}
.mbox .mwho{flex-basis:8.5rem}
.mbox-none{margin:0;padding:1.3rem .9rem;text-align:center}
.mbox-bad{margin:0;padding:.55rem .8rem;background:#fdf3ea;border-bottom:1px solid #f3dcc3;color:#8a4b00;font-size:.8rem}
.mbox-foot{display:flex;justify-content:space-between;align-items:center;gap:.8rem;margin-top:auto;
  padding:.45rem .8rem;border-top:1px solid var(--line);background:#fafbfd;font-size:.76rem}
.mbox-at{color:var(--muted);white-space:nowrap}
.mbox.checking .mbox-at{color:var(--accent)}
.mbox.checking .mbox-at::before{content:"checking… "}
.mbox-off{margin:0}
.mbox-off-b{padding:.2rem 0;border:0;background:none;font:inherit;font-size:.76rem;color:var(--muted);cursor:pointer;
  text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:2px}
.mbox-off-b:hover{color:var(--bad);text-decoration-color:currentColor}
.boxes-add{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.8rem;margin:1rem 0 0}
.boxes-all{font-size:.84rem}
/* Adding one, where the others are. */
.mbox-add{margin-top:1rem;max-width:34rem}
.mbox-add .mbox-head{padding-inline-start:.9rem}
.mbox-add .mbox-body{padding:.9rem}
.mbox-add .f{margin-bottom:.7rem}

/* ONE MESSAGE, OPENED. The actions on one quiet row, the way back first; the
   subject is the page's heading rather than a card of its own. */
.macts{flex-wrap:wrap;align-items:center;gap:.4rem;margin-bottom:1rem}
.macts form{margin:0}
.macts .btn .micon{width:1rem;height:1rem}
.btn.mback{border-color:transparent;background:none;color:#4a6076;padding-inline-start:.35rem}
.btn.mback:hover{border-color:transparent;background:#e4ebf4;color:var(--ink)}
.mhead{margin-bottom:.9rem;padding:0 0 .9rem;border-bottom:1px solid var(--line)}
.mhead h2{margin:0 0 .35rem;font-size:1.3rem;line-height:1.3;color:var(--ink);font-weight:600;
  letter-spacing:-.005em;text-transform:none}
.mhead .line{display:flex;gap:.4rem .9rem;flex-wrap:wrap;align-items:center;font-size:.84rem;color:var(--muted)}
.mhead .line b{color:var(--ink);font-weight:600}
.mhead-files{display:inline-flex;align-items:center;gap:.3rem}
.mhead-files .micon{width:.95rem;height:.95rem}
.bclip .micon{display:inline-block;width:.85rem;height:.85rem;vertical-align:-.1em}

/* The mail screens' own panels, a touch rounder to sit with the list. */
.mmain .panel{border-radius:10px}
.mset-h{margin:2rem 0 .7rem;font-size:.8rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}

/* ATTACHED: one line per file — what kind, what it is called and how big,
   and the three things done with it on the end. */
.mfiles{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.mfile{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding:.55rem .65rem;
  border:1px solid var(--line);border-radius:8px;background:#fff}
.mfile-kind{flex:none;display:flex;align-items:center;justify-content:center;width:2.4rem;height:2.4rem;
  border-radius:6px;background:#fbeceb;color:#9b2c24;font-size:.62rem;font-weight:700;letter-spacing:.04em}
.mfile-id{flex:1 1 12rem;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.mfile-id b{font-size:.86rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mfile-id small{font-size:.74rem}

/* WRITING ONE, LAID OUT LIKE A MESSAGE. Who it is from, to and about, each a
   quiet line with its name on the left — the addresses become pills inside
   the line as they are typed — then the words, then Send. */
.panel.mcompose{padding:0;overflow:hidden;border-radius:10px;max-width:52rem;gap:0}
.panel.mcompose > :not(.mfields):not(.mcompose-foot){margin-inline:.95rem}
.panel.mcompose > .aidraft,.panel.mcompose > .richtext{margin-top:.9rem}
.mcompose > .hint{margin-block:.6rem 0}
.mfields{border-bottom:1px solid var(--line)}
.mfield{display:flex;align-items:center;flex-wrap:wrap;gap:.3rem .4rem;margin:0;padding:.3rem .95rem;min-height:2.75rem}
.mfield + .mfield{border-top:1px solid #edf1f6}
.mfield:focus-within{background:#fcfdff}
.f.mfield > span{flex:0 0 4.5rem;margin:0;font-size:.8rem;font-weight:500;color:var(--muted)}
.f.mfield input,.f.mfield select{order:2;flex:1 1 10rem;width:auto;min-width:8rem;
  padding:.35rem .2rem;border:0;border-radius:4px;background:transparent;font-size:.9rem}
.f.mfield input:focus,.f.mfield select:focus{outline:none;background:#f3f7fc}
.mfield .pills{display:contents}
.mfield .pill{order:1}
.mfield-v{font-size:.9rem;font-weight:500}
.mcompose-foot{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-top:.9rem;padding:.7rem .95rem;
  border-top:1px solid var(--line);background:#fafbfd}
.mcompose-foot .btn.mcancel{margin-inline-start:auto;border-color:transparent;background:none;color:var(--muted)}
.mcompose-foot .btn.mcancel:hover{background:#e4ebf4;color:var(--ink)}
.mattach{display:inline-flex;align-items:center;gap:.5rem;min-width:0;flex:0 1 auto}
.mattach .btn{position:relative;cursor:pointer}
.mattach-in{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}
.mattach .btn:focus-within{outline:2px solid var(--brand);outline-offset:2px}
.mattach-names{max-width:22rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem;color:var(--ink)}
.mattach .hint{font-size:.74rem}
/* In the reply bubble the bubble is the panel: the fields and the foot run to
   its edges. */
.bubble.writing .mfields{margin-inline:-.95rem;border-top:1px solid var(--line);background:#fff}
.bubble.writing .mcompose > .richtext{margin-top:.8rem}
.bubble.writing .mcompose-foot{margin-inline:-.95rem;margin-bottom:-.9rem;border-radius:0 0 14px 14px}

@media (max-width:40rem){
  /* A PHONE ROW IS TWO LINES: the sender and the time on top, the subject under
     them, wrapping to two lines — 8.5rem of name and an ellipsis is not a
     mailbox anybody can read on a phone. */
  .mrow > a{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.7rem;row-gap:.1rem;
    padding-block:.7rem}
  .mrow > a .mava{grid-row:1 / span 2;align-self:start}
  .mwho,.mbox .mwho{grid-column:2;grid-row:1}
  .mmeta{grid-column:3;grid-row:1}
  .mtext{grid-column:2 / 4;grid-row:2;white-space:normal;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .mkill{display:none}
  .mattach .hint{display:none}
  /* The picking bar on one line: the drawings stay, the words are read out. */
  .mpick-bar .mtool-l{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .mpick-bar .btn.mtool{padding:.35rem .5rem}
  .mpick-move{margin-inline-start:0;padding-inline-start:0;border:0}
  .mmain > .mtop h1{font-size:1.25rem}
  .msearch{max-width:none}
}

/* ── A SUBLINE, IN THE EDITOR ──────────────────────────────────────────────
   It belongs to the line above it, so it is indented under it and quieter
   than it. "Extra detail (optional)" was one box per line; a line that needed
   three things said about it — a royal suite, a junior suite, nine deluxe
   rooms — had one place to say them, and they ended up crammed into a
   description or spilled onto the next line as if they were separate items. */
.items .subrow > td{padding-block:.15rem}
.items .subrow .subtext{width:100%;font-size:.8rem;color:var(--muted);
  padding-inline-start:1.1rem;background:transparent;border-style:dashed}
.items .subrow .subtext:focus{background:var(--field);border-style:solid;color:var(--ink)}
/* Under the sublines it belongs to, indented with them, so a line reads as
   one group: the line, what it includes, and the way to add another. */
.items .subadd > td{padding-block:.1rem .5rem}
.items .subadd .addsub{margin-inline-start:1.1rem}
.items .addsub{margin-top:.25rem;padding:.1rem .35rem;font-size:.72rem;
  background:none;border:1px dashed var(--line);border-radius:3px;
  color:var(--muted);cursor:pointer}
.items .addsub:hover{border-color:var(--brand);color:var(--brand)}

/* A ROW THAT HAS JUST APPEARED, SAYING SO.
   "+ Section" was reported as doing nothing. It was adding the row it was
   written to add — at the bottom of a long form, right beside the button that
   made it, so nothing moved and nothing was seen to happen. A new empty
   heading also looks exactly like the blank line already there: it takes no
   number, because an empty heading ends a section rather than opening one.
   A second of colour is the difference between a control that works and a
   control that is believed to work. */
.items tr.justadded > td{animation:justadded 1.2s ease-out}
@keyframes justadded{from{background:#fdf3e0}to{background:transparent}}
@media (prefers-reduced-motion:reduce){
  .items tr.justadded > td{animation:none;background:#fdf3e0}
}

/* The two controls that add rows, under the table they add to. Section first:
   a schedule is built by naming a part of it and then filling that part. */
.itemtools{display:flex;gap:.5rem;align-items:center;margin-top:.6rem}
.numsw{margin-top:.7rem}

/* A KEY, WHOLE AND COPYABLE. It is shown once and it is long, so it wraps
   rather than scrolls — a key with its end cut off looks like a key. And the
   button sits beside it rather than under it, because what somebody reaches
   for is the thing next to what they were reading. */
.keyline{display:block;flex:1;min-width:0;margin:.2rem 0;padding:.6rem .7rem;background:#fff;
  border:1px solid var(--line);border-radius:6px;
  font:.74rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:pre-wrap;word-break:break-all;overflow-wrap:anywhere}
.copyrow{display:flex;align-items:flex-start;gap:.4rem;margin:.2rem 0}
.copyrow .btn{flex:none;margin-top:.2rem}
.copyrow .btn.done{border-color:var(--good,#2e7d5b);color:var(--good,#2e7d5b)}

/* LOOK, KEEP, FILE — three small things on one row, wrapping rather than
   pushing the filename off the screen on a phone. */
.fpills{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.3rem}
.fpills form{margin:0}

/* SOMETHING IS HAPPENING, SAID HONESTLY — AND SAID LOUDLY ENOUGH TO SEE.
   The first version was a three-pixel line at the top of the page, and on a
   phone it was a line nobody noticed: the tap seemed to have done nothing.
   Now the bar is the thickness of a finger's edge in NEXUS orange, and opening
   a message also puts a card in the middle of the screen with a ring that
   turns. Still no percentage, because opening one message is one IMAP fetch
   and the browser receives nothing until it is done — a number there would
   be invented. But "it is moving" is true, so it is shown. */
.busybar{position:fixed;top:0;left:0;right:0;height:6px;z-index:60;pointer-events:none;
  background:linear-gradient(90deg,transparent 0%,var(--accent) 25%,#ffc46b 50%,var(--accent) 75%,transparent 100%);
  background-size:50% 100%;background-repeat:no-repeat;
  animation:busybar .9s ease-in-out infinite;opacity:0;transition:opacity .15s}
.busybar.on{opacity:1}
@keyframes busybar{0%{background-position:-50% 0}100%{background-position:150% 0}}

/* THE CARD. Over the list, not instead of it — the mail stays visible and
   dimmed behind, so nobody wonders whether the page went away. */
.veil{position:fixed;inset:0;z-index:59;display:flex;align-items:center;justify-content:center;
  background:rgba(10,26,47,.28);opacity:0;pointer-events:none;transition:opacity .18s}
.veil.on{opacity:1;pointer-events:auto}
.veil-card{display:flex;flex-direction:column;align-items:center;gap:.8rem;
  min-width:14rem;max-width:80vw;padding:1.4rem 1.6rem;background:#fff;border-radius:12px;
  box-shadow:0 10px 30px rgba(10,26,47,.25);text-align:center}
.veil-card b{font-size:1rem;color:var(--ink)}
.veil-card small{color:var(--muted);font-size:.82rem}
/* A ring that turns, in the company's orange. Two arcs so it reads as motion
   and not as a static circle. */
.veil-ring{width:3rem;height:3rem;border-radius:50%;
  border:4px solid rgba(239,161,60,.22);border-top-color:var(--accent);border-right-color:var(--accent);
  animation:veilspin .8s linear infinite}
@keyframes veilspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
  .busybar{animation:none;background:var(--accent);background-size:100% 100%}
  .veil-ring{animation:none;border-color:var(--accent)}
}

/* A CONVERSATION AS BUBBLES.
   Asked for in those words. Theirs on the left, ours on the right, each one
   a line until it is opened; the message that was pressed is open and marked,
   and the reply is written in a bubble of its own at the bottom — so writing
   is not done on top of a page of quoted history, and neither is reading. */
.convo{display:flex;flex-direction:column;gap:.55rem;margin-bottom:1.2rem}
/* ON A WIDE SCREEN THE CONVERSATION SCROLLS INSIDE ITS OWN BOX, so the
   rail, the Reply/Forward/Delete row and the subject card stay where they
   are while a long thread is read. Asked for in those words. The height is
   set to the viewport by a line of script; this is the fallback. On a phone
   the page scrolls as one, because a box scrolling inside a page is what a
   thumb fights. */
@media (min-width:48rem){
  .convo{overflow:auto;max-height:calc(100vh - 16rem);min-height:14rem;padding:.15rem .4rem .15rem .15rem;
    margin-bottom:0;overscroll-behavior:contain;scroll-behavior:smooth}
  .convo > .bubble{flex:none}
}
.bubble{max-width:86%;min-width:0;align-self:flex-start;background:#fff;border:1px solid var(--line);
  border-radius:14px 14px 14px 4px;box-shadow:0 1px 2px rgba(10,26,47,.04)}
.bubble.you{align-self:flex-end;background:#e9f0fb;border-color:#c9d9f0;border-radius:14px 14px 4px 14px}
.bubble.now{max-width:100%;width:100%;border-color:var(--accent);box-shadow:0 0 0 2px rgba(239,161,60,.18)}
.bubble.writing{max-width:100%;width:100%;background:#fff8ee;border-color:#f3c98b}
.bubble > summary{display:grid;grid-template-columns:auto 1fr;column-gap:.65rem;align-items:center;
  padding:.6rem .85rem;cursor:pointer;list-style:none;min-width:0}
.bubble > summary::-webkit-details-marker{display:none}
.bava{grid-row:1/3;width:2rem;height:2rem;border-radius:50%;background:var(--brand);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem;flex:none}
.bubble.you .bava{background:var(--accent);color:var(--ink)}
.bmeta{display:flex;gap:.5rem;align-items:baseline;flex-wrap:wrap;font-size:.85rem;min-width:0}
.bwho{color:var(--ink);font-weight:600}
.bubble.unread .bwho{font-weight:800}
.bwhen,.baddr{color:var(--muted);font-size:.78rem;font-variant-numeric:tabular-nums}
.bclip{font-size:.8rem}
.bsub{grid-column:2;color:var(--muted);font-size:.82rem;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bubble[open] > summary .bsub{white-space:normal}
.bubble.now > summary .bsub{color:var(--ink)}
.bubble.writing > summary .bsub{color:var(--ink);font-style:italic}
.bbox{color:var(--muted);font-size:.78rem}
/* Arabic mail reads right-to-left, paragraph by paragraph, on its own. */
.mailbody{unicode-bidi:plaintext}
.rt-area p{unicode-bidi:plaintext}
/* DRAFT WITH AI: a small form above the reply, never inside it. */
.aidraft{background:#fff;border:1px dashed #f3c98b;border-radius:6px;padding:.7rem .85rem;margin:0 0 1rem}
.aidraft .f{margin:0 0 .5rem}
.aidraft textarea{width:100%;min-height:3.2rem;resize:vertical}
.aidraft-row{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.aidraft-row select{max-width:11rem}
.aidraft-said{margin:0;flex:1 1 12rem}

.bbody{padding:.2rem .95rem .9rem 3.5rem}
.bbody .mailbody{max-height:none}
.battached{margin-top:.9rem;border-top:1px solid var(--line);padding-top:.7rem}
.battached h3{margin:0 0 .5rem;font-size:.72rem;font-weight:600;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted)}
.bubble.writing .bbody{padding-left:.95rem}
.bubble.writing .write{max-width:none}
.bubble.writing .rt-area{min-height:12rem}
.convo-all{font-size:.8rem}

/* WHAT A MESSAGE QUOTED BACK, folded behind a dots pill the way every mail
   client folds it. The same fold under the reply editor says what will go
   underneath the words. */
.quoted{margin-top:.7rem;border-top:1px dashed var(--line);padding-top:.45rem}
.quoted > summary{cursor:pointer;color:var(--muted);font-size:.78rem;list-style:none;
  display:inline-flex;gap:.45rem;align-items:center}
.quoted > summary::-webkit-details-marker{display:none}
.quoted > summary::before{content:"\22EF";display:inline-block;background:var(--surface);
  border:1px solid var(--line);border-radius:10px;padding:0 .55rem;font-weight:700;
  color:var(--ink);line-height:1.3}
.quoted[open] > summary::before{content:"\2013"}
.quoted .mailbody{margin-top:.5rem;color:var(--muted);border-inline-start:3px solid var(--line);
  padding-inline-start:.7rem}

@media (max-width:40rem){
  .bubble{max-width:94%}
  .bbody{padding-left:.85rem}
}

/* HOW MANY ARE WAITING, BESIDE THE NAME.
   On Mail in the bar it is answered from any screen in the application; in the
   rail it says WHICH mailbox needs somebody. Small, and never the loudest
   thing on the bar — it is a count, not an alarm. */
.badge{display:inline-block;min-width:1.1rem;margin-inline-start:.35rem;padding:0 .3rem;
  border-radius:999px;background:var(--accent);color:#fff;font-size:.68rem;font-weight:700;
  line-height:1.5;text-align:center;vertical-align:middle;font-variant-numeric:tabular-nums}
.areas a[aria-current] .badge{background:var(--brand)}

/* ── ADDRESSES, AS THINGS RATHER THAN PUNCTUATION ──────────────────────────
   A typed address becomes something you can see and take off again, so a
   message to six people can be checked before it is sent rather than read as
   one long line with commas in it. The plain field underneath still posts the
   same comma-separated line — this is a nicer way to build it, not a
   different thing. */
.pills{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}
.pills:empty{display:none}
.pill{display:inline-flex;align-items:center;gap:.3rem;padding:.15rem .3rem .15rem .5rem;
  border:1px solid #c6d6ec;border-radius:999px;background:#eef3fa;
  font-size:.8rem;color:var(--ink);max-width:100%}
.pill-off{border:0;background:none;padding:0 .15rem;font-size:.9rem;line-height:1;
  color:var(--muted);cursor:pointer}
.pill-off:hover{color:var(--bad)}

/* "Not in the list? Open a new job file" is a button, as asked — a summary
   underneath, so it works without a script. */
.njob > summary.btn{list-style:none;display:inline-flex;margin:.2rem 0 .4rem;font-weight:600}
.njob > summary.btn:hover{text-decoration:none}
.njob > summary.btn::-webkit-details-marker{display:none}
.njob[open] > summary.btn{background:var(--ink);border-color:var(--ink);color:#fff}

/* Confidential is a standing, not a lapse: its own quiet tag, so a
   confidential in-date paper no longer wears the colour of an expired one. */
.tag.conf{background:var(--surface);color:var(--muted);border:1px solid var(--line)}
.blockhead h2 small{font-weight:400;letter-spacing:0;text-transform:none;font-size:.8rem}

/* THE MESSAGE AS DESIGNED, in a frame under the words. */
.designed{margin:0 0 .9rem}
.designed > summary{list-style:none;display:inline-flex}
.designed > summary::-webkit-details-marker{display:none}
.designed[open] > summary{background:var(--ink);border-color:var(--ink);color:#fff}
.designed-bar{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin:.6rem 0 .4rem}
.designed-bar .hint{margin:0;flex:1 1 16rem}
.designed iframe{display:block;width:100%;height:32rem;border:1px solid var(--line);border-radius:6px;background:#fff}
/* Grown to its content by app.js, so a long mailing is read in one scroll
   rather than in a small window of its own. */
.designed[open] iframe{height:auto;min-height:15rem}
.designed[open]{border-bottom:1px solid var(--line);padding-bottom:.9rem}

/* WHICH COMPANY — said beside the type in the register, only when there is
   more than one company to tell apart. */
.cotag{display:inline-block;margin-inline-end:.35rem;padding:0 .3rem;border:1px solid var(--line);
  border-radius:3px;font-size:.62rem;letter-spacing:.06em;color:var(--brand);background:#fff}
.signsfor .check{display:flex;gap:.4rem;align-items:center}

/* ── SETTINGS: ONE THING AT A TIME ──────────────────────────────────────────
   A table of contents on the left and the part being set on the right, so
   the catalogue is one press away rather than a few thousand pixels down.
   On a phone the contents become a strip across the top. */
.settings .set-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  margin-bottom:1.3rem;padding-bottom:.9rem;border-bottom:1px solid var(--border)}
.settings .set-head h1{margin-bottom:.2rem}
.settings .set-head .sub{margin:0;max-width:40rem}
.set-co{display:flex;flex-direction:column;gap:.25rem;min-width:15rem}
.set-co > span{font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:500}
.set-co select{background:#fff;border:1px solid var(--input-border);border-radius:3px;padding:.5rem .6rem;font:inherit;font-size:.9rem;
  font-weight:500;color:var(--ink)}
/* THE COMPANY BEING SET — its mark, its name, and the four facts that decide
   whether its documents come out right, each a way to the part that sets it. */
.set-banner{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.4rem 1rem;align-items:center;
  margin-bottom:1.2rem;padding:1rem 1.2rem;background:#fff;border:1px solid var(--line);border-radius:4px}
.set-mark{width:3.4rem;height:3.4rem;display:flex;align-items:center;justify-content:center;border-radius:4px;
  background:var(--surface);overflow:hidden}
.set-mark img{max-width:100%;max-height:100%;object-fit:contain}
.set-mark .mono{font-size:.72rem;font-weight:600;color:var(--brand);letter-spacing:.04em}
.set-who h2{margin:0;font-size:1.05rem;letter-spacing:0;text-transform:none;color:var(--ink)}
.set-who p{margin:.1rem 0 0;font-size:.8rem;color:var(--muted)}
.set-who .mono{color:var(--brand)}
.set-who .tag{margin-inline-start:.4rem}
.set-facts{grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.4rem 1.2rem;
  margin:.6rem 0 0;padding-top:.7rem;border-top:1px solid var(--line)}
.set-facts dt{font-size:.66rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:600}
.set-facts dd{margin:.15rem 0 0;font-size:.84rem;min-width:0}
.set-facts dd a{color:var(--ink);text-decoration:none;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.set-facts dd a:hover{color:var(--brand);text-decoration:underline}
.set-facts .bad dd a{color:var(--bad);font-weight:500}
.set-facts .bad dt::after{content:" ●";color:var(--bad)}
/* The form beside the page it prints on. */
.set-split{display:grid;grid-template-columns:minmax(0,1fr) 17rem;gap:1.6rem;align-items:start}
.set-lh{margin:0;position:sticky;top:5rem}
.set-lh-sheet{background:#fff;border:1px solid var(--line);box-shadow:0 1px 3px rgba(10,26,47,.08);
  aspect-ratio:210/150;padding:1rem .9rem;font-size:.56rem;line-height:1.45;color:var(--ink);overflow:hidden}
.set-lh-top{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start}
.set-lh-logo{max-height:1.6rem;max-width:45%;object-fit:contain}
.set-lh-word{font-size:.8rem;letter-spacing:.06em;color:var(--brand)}
.set-lh-addr{display:flex;flex-direction:column;text-align:end;min-width:0}
.set-lh-addr span{color:#4a6076;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.set-lh-reg{margin:.5rem 0 0;padding-top:.35rem;border-top:1px solid var(--line);color:var(--muted)}
.set-lh-body{margin-top:.9rem;display:flex;flex-direction:column;gap:.35rem}
.set-lh-body i{display:block;height:.3rem;border-radius:2px;background:var(--surface)}
.set-lh-body i.short{width:60%}
.set-lh figcaption{margin-top:.4rem;font-size:.72rem}
@media (max-width:60rem){
  .set-split{grid-template-columns:1fr}
  .set-lh{position:static;max-width:20rem}
  .set-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.set-grid{display:grid;grid-template-columns:15.5rem minmax(0,1fr);gap:1.5rem;align-items:start}
.set-nav{position:sticky;top:4.5rem;display:flex;flex-direction:column;gap:2px;padding:.55rem;
  background:var(--card);border:1px solid var(--border);border-radius:6px;box-shadow:0 1px 2px rgba(10,26,47,.04)}
.set-group{margin:.85rem .55rem .25rem;font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600}
.set-group:first-child{margin-top:.15rem}
.set-link{display:flex;flex-direction:column;gap:.05rem;padding:.52rem .7rem;border-radius:4px;border-inline-start:3px solid transparent;
  color:var(--ink);text-decoration:none;font-size:.88rem}
.set-link small{font-size:.72rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.set-link:hover{background:var(--panel-hover)}
.set-link.on{background:var(--primary-soft);border-inline-start-color:var(--brand);color:var(--brand);font-weight:600}
.set-link .set-flag{color:var(--bad);font-weight:500}
.set-pane{background:var(--card);border:1px solid var(--border);border-radius:6px;padding:1.45rem 1.65rem 1.7rem;min-width:0;
  box-shadow:0 1px 2px rgba(10,26,47,.04)}
.set-title{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  border-bottom:1px solid var(--border);padding-bottom:.75rem;margin-bottom:1.05rem}
.set-title h2{margin:0;font-size:1.15rem;letter-spacing:0;text-transform:none;color:var(--ink)}
.set-scope{font-size:.76rem;color:var(--muted)}
.set-scope .mono{color:var(--brand)}
.set-lead{margin:0 0 1.1rem;font-size:.88rem;line-height:1.55;color:#4a6076;max-width:46rem}
.set-lead.bad{color:var(--bad);font-weight:500}
.set-status{margin:0 0 1.1rem;padding:.6rem .8rem;border-radius:4px;background:var(--surface);font-size:.84rem}
.set-status.due{background:#fdf1ef;color:var(--bad)}
.set-form{margin:0}
.set-form + .set-form{margin-top:1.6rem;padding-top:1.3rem;border-top:1px solid var(--line)}
.set-form h3{margin:0 0 .7rem;font-size:.92rem}
.set-form > .btns{margin-top:1rem}
.set-block{border:0;margin:0 0 1.3rem;padding:0}
.set-block legend{padding:0;margin-bottom:.55rem;font-size:.7rem;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:600}
.set-checks{display:flex;flex-wrap:wrap;gap:.2rem 1.4rem}
.set-checks .check{margin:.25rem 0}
.set-indent{margin:-.3rem 0 .9rem 1.6rem}
.why{margin:.6rem 0 0}
.why > summary{cursor:pointer;font-size:.76rem;color:var(--brand);list-style:none;display:inline-block}
.why > summary::-webkit-details-marker{display:none}
.why > summary::before{content:"▸ ";color:var(--muted)}
.why[open] > summary::before{content:"▾ "}
.why > .hint,.why > dl{margin-top:.4rem;max-width:46rem}
.set-tokens{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:.3rem 1.2rem;font-size:.78rem;color:var(--muted)}
.set-tokens div{display:flex;gap:.5rem}
.set-tokens dt code{color:var(--ink)}
.set-tokens dd{margin:0}
.set-scroll{overflow-x:auto}
.set-two{display:grid;grid-template-columns:1fr 1fr;gap:1.6rem}
.set-two .set-form + .set-form{margin-top:0;padding-top:0;border-top:0}
.set-preview{display:flex;align-items:center;justify-content:center;min-height:7rem;margin-bottom:.6rem;padding:.8rem;
  border:1px dashed var(--line);border-radius:4px;background:#fafcfe}
.set-logo{max-height:4rem;max-width:100%;object-fit:contain}
.set-stamp{width:6rem;height:6rem;object-fit:contain}
.brand-crop{margin:.7rem 0 0;max-width:100%;overflow:hidden}
.brand-crop-frame{position:relative;width:100%;max-width:min(100%,22rem);margin:0 auto;border:2px solid var(--brand);
  border-radius:4px;background:#0a1a2f;overflow:hidden!important;box-sizing:border-box;
  touch-action:none;user-select:none;cursor:grab;contain:strict;isolation:isolate}
.brand-crop-frame:active{cursor:grabbing}
.brand-crop-frame.square{max-width:min(100%,14rem)}
/* Canvas is laid out ONLY by the frame. Bitmap width/height attributes must not enlarge it. */
.brand-crop-canvas{position:absolute;inset:0;display:block;width:100%!important;height:100%!important;
  max-width:100%!important;max-height:100%!important;object-fit:fill;
  touch-action:none;user-select:none;background:#0a1a2f;pointer-events:none}
.brand-crop-zoom-f{margin-top:.7rem;max-width:18rem;margin-inline:auto}
.brand-crop-zoom-row{display:flex;align-items:center;gap:.45rem;margin-bottom:.35rem;font-size:.88rem;font-weight:600}
.brand-crop-zoom-row > span{flex:1}
.brand-crop-zoom-btn{padding:.2rem .55rem;font-size:.78rem;line-height:1.2}
.brand-crop-zoom-f input[type=range]{width:100%;display:block}
.brand-crop-zoom-hint{display:block;margin-top:.25rem}
.brand-crop-preview{margin-top:.6rem;min-height:5.5rem;max-width:100%;overflow:hidden}
.brand-crop-preview img{max-width:100%;max-height:8rem;width:auto;height:auto;object-fit:contain}
.set-cos{margin-bottom:0}
@media (max-width:820px){
  .set-grid{grid-template-columns:1fr;gap:.8rem}
  .set-nav{position:static;flex-direction:row;overflow-x:auto;gap:.3rem;padding-bottom:.3rem;-webkit-overflow-scrolling:touch}
  .set-group{display:none}
  .set-link{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:.4rem .8rem;background:#fff}
  .set-link small{display:none}
  .set-link.on{border-color:var(--brand)}
  .set-pane{padding:1.1rem 1rem 1.2rem}
  .set-two{grid-template-columns:1fr}
  .set-co{min-width:0;width:100%}
}
.set-identity{margin-top:1.6rem!important;padding:1.25rem 1.4rem!important;border:1px solid var(--line);border-radius:5px;background:#fff}
.set-identity-heading{margin-bottom:1rem}
.set-identity-heading h3{margin:0;font-size:1rem}
.set-identity-heading p{margin:.2rem 0 0;color:var(--muted);font-size:.8rem}
.set-identity .f>span{font-size:.8rem;color:var(--muted);font-weight:500}
.set-identity .btns{justify-content:flex-end}

/* ── ISSUING A DOCUMENT ──────────────────────────────────────────────────────
   What it is and what to do next at the top; the form on the left in the
   order the work happens; the document itself on the right, kept in view,
   as it will print. Below 80rem the preview follows the form. */
.wrap.editor{max-width:96rem}
.ed-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  margin-bottom:1.2rem;padding-bottom:1rem;border-bottom:1px solid var(--line)}
.ed-head h1{margin:.15rem 0 .2rem;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.ed-head h1 .tag{font-size:.62rem}
.ed-head .sub{margin:0}
.ed-head .sub .mono{color:var(--brand)}
.ed-back{font-size:.8rem;color:var(--muted);text-decoration:none}
.ed-back:hover{color:var(--brand)}
.ed-acts{margin:0}
.ed-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,30rem);gap:1.6rem;align-items:start}
.ed-form{background:#fff;border:1px solid var(--line);border-radius:4px;min-width:0}
.ed-sec{padding:1.3rem 1.5rem 1.1rem;border-top:1px solid var(--line)}
.ed-sec:first-of-type{border-top:0}
.ed-sec > h2{margin:0 0 1rem;font-size:1rem;letter-spacing:0;text-transform:none;color:var(--ink)}
.ed-sec .check small{margin-inline-start:.3rem}
.ed-note{margin:0 0 .9rem;padding:.55rem .8rem;border-radius:4px;background:var(--surface);font-size:.84rem;color:#4a6076}
.ed-more{margin:.4rem 0 .9rem;border:1px solid var(--line);border-radius:4px;background:#fafcfe}
.ed-more > summary{cursor:pointer;padding:.55rem .8rem;font-size:.84rem;color:var(--ink);list-style:none}
.ed-more > summary::-webkit-details-marker{display:none}
.ed-more > summary::before{content:"▸ ";color:var(--muted)}
.ed-more[open] > summary::before{content:"▾ "}
.ed-more[open] > summary{border-bottom:1px solid var(--line)}
.ed-more > :not(summary){margin-inline:.8rem}
.ed-more > :last-child{margin-bottom:.8rem}
.ed-more > .row2,.ed-more > .row3,.ed-more > .f{margin-top:.8rem}
.ed-sec .itemtools{margin-top:.6rem}
.ed-foot{margin:0;padding:1rem 1.5rem;border-top:1px solid var(--line);background:#fafcfe;border-radius:0 0 4px 4px}
.ed-preview{position:sticky;top:5rem;min-width:0;max-height:calc(100vh - 6rem);overflow-y:auto;overscroll-behavior:contain}
.ed-preview-head{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 .5rem;font-size:.72rem;
  letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:600}
.ed-preview-head small{text-transform:none;letter-spacing:0;font-weight:400}
.ed-fit{border-radius:4px;overflow:hidden}
.ed-fit .stage{max-height:none}
.ed-jump{display:none}
@media (max-width:80rem){
  .ed-jump{display:inline-flex}
  .ed-split{grid-template-columns:1fr}
  .ed-preview{position:static;max-height:none;overflow:visible}
}
@media (max-width:820px){
  .ed-sec{padding:1rem 1rem .9rem}
  .ed-foot{padding:.9rem 1rem}
  .ed-acts{width:100%}
}

/* Searchable people pickers (department HOD + members). */
.upick{margin:.85rem 0 1rem;position:relative}
.upick .f-label{display:block;font-size:.78rem;font-weight:600;color:var(--muted);margin:0 0 .35rem}
.upick .f-label small{font-weight:400;color:var(--muted)}
.upick-field{position:relative}
.upick-field input[type=search]{width:100%;border:1px solid var(--input-border);border-radius:4px;padding:.55rem .65rem;font:inherit}
.upick-field input[type=search]:focus{outline:2px solid color-mix(in srgb, var(--brand) 35%, transparent);border-color:var(--brand)}
.upick-list{position:absolute;z-index:40;left:0;right:0;top:calc(100% + 2px);max-height:16rem;overflow:auto;
  background:#fff;border:1px solid var(--input-border);border-radius:4px;box-shadow:0 8px 24px rgba(15,35,60,.12)}
.upick-opt{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;width:100%;text-align:left;
  border:0;background:transparent;padding:.55rem .7rem;cursor:pointer;font:inherit;color:inherit}
.upick-opt:hover,.upick-opt.on{background:#f0f5fb}
.upick-name{font-weight:600}
.upick-meta{font-size:.78rem;color:var(--muted)}
.upick-state{margin:0;padding:.65rem .7rem;font-size:.82rem;color:var(--muted)}
.upick-state.err{color:#a12828}
.upick-chips,.upick-selected{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;margin:0 0 .45rem;min-height:1.8rem}
.upick-chip{display:inline-flex;align-items:center;gap:.25rem;max-width:100%;
  background:#eef3f9;border:1px solid #d5e0ec;border-radius:999px;padding:.2rem .45rem .2rem .65rem;font-size:.82rem}
.upick-chip.sole{border-radius:6px}
.upick-chip b{font-weight:600}
.upick-x{border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:1.05rem;line-height:1;padding:.1rem .25rem;border-radius:3px}
.upick-x:hover{color:#a12828;background:#f8e8e8}
.upick.off{opacity:.72;pointer-events:none}
.dept-group .blockhead{display:flex;justify-content:space-between;align-items:baseline;gap:.75rem;flex-wrap:wrap}
.dept-form{scroll-margin-top:5rem}
@media (max-width:640px){
  .dept-list thead{display:none}
  .dept-list tr{display:block;border-bottom:1px solid var(--line);padding:.6rem 0}
  .dept-list td{display:flex;justify-content:space-between;gap:.75rem;border:0;padding:.15rem 0}
  .dept-list td::before{content:attr(data-label);color:var(--muted);font-size:.78rem}
  .dept-list td.n{justify-content:space-between}
}
