/* Layout and colours: the Digital Records mock (Downloads/digital_records_mock.html): a dark navy sidebar, teal for the
   current place and for what is done, navy for primary actions and chosen filters, amber for what waits, red for what
   is missing. Inter. Light only. */
:root {
  --navy: #1F3A5F; --navy-2: #2B4C78; --navy-3: #0F2744; --mint: #7FE3EA; --teal: #0E7C86; --teal-d: #0B6770; --lav: #CFE0F5;
  --bg: #F5F7FA; --card: #FFFFFF; --ink: #1A2433; --brand-ink: #1F3A5F; --mute: #5B6779; /* 4.9:1 or more on every background it sits on (WCAG AA) */
  --line: #E2E8F0; --line-soft: #EDF1F5; --line-strong: #B6C4D6; --soft: #E3F1F2; --hover: #F1F5F9;
  --nav-fg: #CFE0F5; --nav-minor: #9FB3CC;
  --ok: #15803D; --okbg: #DCFCE7; --warn: #B45309; --warnbg: #FEF3C7; --bad: #B91C1C; --badbg: #FEE2E2;
  --r: 12px; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font: 14px/1.55 Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); }

/* frame: sidebar + main */
.frame { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--navy-3); color: var(--nav-fg); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.01em; padding: 4px 10px 16px; display: flex; gap: 9px;
  align-items: center; text-decoration: none; }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--teal); color: #fff; display: inline-grid;
  place-items: center; font-style: normal; font-size: 14px; }
.logo span { color: #7FE3EA; margin-left: -9px; }
#nav { display: flex; flex-direction: column; gap: 3px; }
.nav { background: none; border: 0; color: inherit; text-align: left; padding: 9px 12px; border-radius: 9px; display: flex;
  gap: 10px; align-items: center; text-decoration: none; font-weight: 600; cursor: pointer; }
.nav .ic { width: 18px; text-align: center; opacity: .9; }
.nav:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav.on { background: var(--teal); color: #fff; }
.nav .count { margin-left: auto; background: #7FE3EA; color: var(--navy-3); border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.nav-head { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--nav-minor); padding: 12px 12px 2px; }
.role { margin-top: auto; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 10px; font-size: 11px; }
.role .firm { color: #fff; font-weight: 700; font-size: 12px; }
.role .who { color: var(--nav-minor); word-break: break-all; }
.role select { width: 100%; margin-top: 6px; border-radius: 8px; border: 0; padding: 6px; background: #fff; color: var(--ink); font-size: 11px; }
.role .local { display: inline-block; background: var(--warn); color: #fff; border-radius: 6px; padding: 0 6px; font-weight: 800; font-size: 10px; margin-bottom: 4px; }
.main { padding: 24px 28px 60px; min-width: 0; max-width: 1240px; width: 100%; }

/* type */
h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; color: var(--brand-ink); }
h2 { font-size: 15px; margin: 22px 0 10px; color: var(--brand-ink); }
h3 { font-size: 14px; margin: 0 0 6px; color: var(--brand-ink); }
.src, .muted { color: var(--mute); font-size: 12px; }
.small { font-size: 11px; }
.lead { color: var(--mute); margin: 0 0 16px; }

/* top bar: search + upload */
.bar { display: flex; gap: 10px; align-items: center; margin: 14px 0 18px; flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 10px 14px; }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--soft); }
.search input { border: 0; outline: 0; flex: 1; background: none; }

/* buttons, pills, chips */
.btn { border: 1px solid var(--line-strong); background: #fff; color: var(--brand-ink); border-radius: 10px; min-height: 40px; padding: 0 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--hover); }
.btn.pri { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.pri:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 500; background: var(--soft); color: var(--teal); white-space: nowrap; }
.pill.ok { background: var(--okbg); color: var(--ok); } .pill.warn { background: var(--warnbg); color: var(--warn); }
.pill.bad { background: var(--badbg); color: var(--bad); } .pill.grey { background: #EEF2F6; color: #475569; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chk { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin: 0 6px 6px 0; border: 0; }
.chk.ok { background: var(--okbg); color: var(--ok); } .chk.no { background: var(--badbg); color: var(--bad); cursor: pointer; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: 0 2px 4px rgba(15, 30, 60, .04); }
.grid { display: grid; gap: 14px; } .g3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: default; }
.stat.link { cursor: pointer; } .stat.link:hover { border-color: var(--navy-2); }
.stat b { font-size: 23px; display: block; color: var(--brand-ink); font-weight: 800; } .stat span { color: var(--mute); font-size: 11px; }
.jobcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.jobcard:hover { border-color: var(--teal); box-shadow: 0 4px 14px rgba(15, 30, 60, .08); }
.meter { height: 6px; background: var(--line-soft); border-radius: 9px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--teal); }
.doc { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 8px; flex-wrap: wrap; }
.doc.link { cursor: pointer; } .doc.link:hover { border-color: var(--navy-2); }
.ico { width: 38px; height: 44px; border-radius: 6px; background: var(--soft); color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: 10px; flex: none; }
.doc .meta { flex: 1; min-width: 160px; max-width: none; } .doc .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .meta span { color: var(--mute); font-size: 11px; }
.lock { display: flex; gap: 12px; align-items: center; background: var(--warnbg); color: #7A4A06; border-radius: 12px; padding: 14px 16px; margin: 14px 0 16px; flex-wrap: wrap; }
.lock .ic { font-size: 21px; }
.callout { border-left: 4px solid var(--teal); background: var(--soft); padding: 12px 16px; border-radius: 8px; margin: 14px 0; }

/* tables */
.tablecard { padding: 4px 8px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click:hover { background: var(--hover); cursor: pointer; }

/* upload */
.drop { border: 2px dashed var(--line-strong); border-radius: 16px; padding: 34px; text-align: center; background: #fff; color: var(--mute); }
.drop.over { border-color: var(--teal); background: var(--soft); }
.drop b { color: var(--ink); font-size: 15px; display: block; margin-bottom: 6px; }
.q { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; margin-top: 10px; }
.q .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; align-items: flex-end; }
.q label { font-size: 10px; color: var(--mute); display: block; text-transform: uppercase; letter-spacing: .04em; }
.q select, .q input { min-width: 150px; max-width: 100%; }
.q.done { border-color: var(--ok); } .q.err { border-color: var(--bad); }

/* dialog, toast */
input, select, textarea { background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; max-width: 100%; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { min-height: 40px; }
textarea { padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
textarea { width: 100%; min-height: 80px; }
dialog { border: 0; border-radius: 16px; background: #fff; color: var(--ink); width: min(560px, calc(100vw - 32px)); padding: 22px;
  box-shadow: 0 16px 40px rgba(15, 30, 60, .25); }
dialog::backdrop { background: rgba(15, 30, 60, .45); }
dialog h2 { margin-top: 0; font-size: 17px; }
dialog label, .field-label { display: block; margin: 12px 0 6px; font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: .01em; }
dialog input, dialog select, dialog textarea { width: 100%; }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px;
  border-radius: 12px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; box-shadow: 0 8px 24px rgba(15, 30, 60, .3); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }

@media (max-width: 860px) {
  .frame { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  .nav-head { display: none; }
  .role { margin: 0; flex: 1 1 100%; }
  .main { padding: 18px 16px 50px; }
  .hide-sm { display: none; }
}

/* Find: tables beside the "needs sorting" pane */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.split > :only-child { grid-column: 1 / -1; }
.sortpane { position: sticky; top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  max-height: calc(100vh - 32px); overflow: auto; }
.sortpane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; color: var(--brand-ink); }
.count-pill { background: var(--warnbg); color: var(--warn); border-radius: 99px; padding: 0 9px; font-weight: 700; font-size: 11px; }
.sortcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sortcard select { width: 100%; }
.sortcard .sugg { text-align: left; white-space: normal; border-color: var(--teal); color: var(--teal); background: var(--soft); }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 8px; }
.tab-line { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font-weight: 600; color: var(--mute); cursor: pointer; }
.tab-line.on { color: var(--teal); border-bottom-color: var(--teal); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.match { color: var(--ok); }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .sortpane { position: static; max-height: none; } }
.nowrap { white-space: nowrap; }
th { white-space: nowrap; }

/* Upload: the batch as it runs, and what needs a person */
.batch { margin-top: 16px; }
.batch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.batch-head b { font-size: 15px; color: var(--brand-ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.tile { border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--line-soft); }
.tile b { font-size: 25px; line-height: 1.1; } .tile span { font-size: 11px; color: var(--mute); }
.tile.ok { background: var(--okbg); } .tile.ok b { color: var(--ok); }
.tile.warn { background: var(--warnbg); } .tile.warn b { color: var(--warn); }
.tile.bad { background: var(--badbg); } .tile.bad b { color: var(--bad); }
.tile.grey b { color: #475569; } .tile.zero { opacity: .55; } .tile .btn { margin-top: 6px; align-self: flex-start; }
.batch-jobs { margin-top: 10px; } .batch-jobs > summary { cursor: pointer; font-weight: 600; color: var(--brand-ink); padding: 6px 0; }
.batch-job { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: #fff; }
.batch-job > summary { display: flex; align-items: center; gap: 4px; padding: 8px 12px; cursor: pointer; flex-wrap: wrap; }
.batch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.ico.sm { width: 30px; height: 22px; font-size: 9px; border-radius: 5px; }
.needs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.needs-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }

/* Sorting one paper at a time */
.sorter { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.sorter-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--navy-3); color: #fff; flex-wrap: wrap; }
.sorter-head .src { color: #C8D3E3; }
.sorter-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 0; min-height: 0; }
.sorter-paper { width: 100%; height: 100%; border: 0; border-right: 1px solid var(--line); background: #fff; }
.sorter-side { overflow: auto; padding: 16px; }
.sorter-side h3 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.sorter-side input[type=search] { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 10px; }
.choice { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.choice.best { border: 2px solid var(--teal); box-shadow: 0 2px 10px rgba(14, 124, 134, .12); }
.choice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.why { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; } .why .pill { white-space: normal; }
.holds { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 6px; }
.holds .chk { background: var(--line-soft); color: var(--ink); font-weight: 500; }
.sorter-done { margin: auto; text-align: center; color: var(--ok); }
.sortcard.click { cursor: pointer; } .sortcard.click:hover { border-color: var(--navy-2); }
@media (max-width: 820px) {
  .sorter-body { grid-template-columns: 1fr; grid-template-rows: 45vh auto; overflow: auto; }
  .sorter-paper { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* A paper, opened over the page */
.viewer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 60; background: #fff; display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(15, 30, 60, .18); border-left: 1px solid var(--line); animation: slidein .18s ease-out; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.viewer iframe { flex: 1; border: 0; width: 100%; background: #F1F5F9; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.mate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 12px; cursor: pointer; }
.preset { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--lav); color: var(--brand-ink);
  border-radius: 12px; padding: 12px 16px; margin: 10px 0 14px; }
.why-list { margin: 0; padding-left: 16px; }
.why-list li { margin: 0; line-height: 1.4; }
.doc { flex-wrap: wrap; }
.parts { flex-basis: 100%; margin: 6px 0 0 44px; display: grid; gap: 6px; }
.part { display: flex; align-items: center; gap: 8px; }
.part .meta { flex: 1; min-width: 0; }
.part .ico.sm, .batch-row .ico.sm { width: 26px; height: 30px; font-size: 8px; }
.sorter:focus { outline: none; }
.paper-view { overflow: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--soft); }
.paper-view canvas, .paper-view img { max-width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* An upload that repeated files: its new files stand out */
.pill.new { background: var(--soft); color: var(--teal-d); border-color: var(--teal); font-weight: 600; }
.batch-row.is-new { background: var(--soft); box-shadow: inset 3px 0 0 var(--teal); }
.batch-job.has-new > summary { font-weight: 600; }
tr.is-new > td { background: var(--soft); }
tr.is-new > td:first-child { box-shadow: inset 3px 0 0 var(--teal); }

/* A field and its button on one line, the same height */
.field-row { display: flex; gap: 8px; align-items: stretch; }
.field-row > select, .field-row > input { flex: 1; min-width: 0; }
.small, .src.small { font-size: 12px; }

/* Phones: the Needs-you table becomes one card per paper (no sideways scrolling) */
@media (max-width: 600px) {
  .needs-box table, .needs-box tbody, .needs-box tr, .needs-box td { display: block; width: 100%; }
  .needs-box tr:first-child { display: none; }
  .needs-box tr.click { position: relative; padding: 12px 14px; border-top: 1px solid var(--line); }
  .needs-box tr.click > td { padding: 2px 0; border: 0; }
  .needs-box tr.click > td:first-child { padding-right: 70px; }
  .needs-box tr.click > td:last-child { position: absolute; top: 10px; right: 12px; width: auto; }
  .needs-box td.hide-sm { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .batch-row { padding: 8px 10px; }
  .field-row { flex-wrap: wrap; }
  .field-row > .btn { flex: 1 1 auto; }
}

/* Phones: Upload only. The drop box and the day's totals; no job lists, no sorting */
.phone-note { display: none; }
@media (max-width: 600px) {
  .phone-note { display: block; margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--soft); color: var(--teal-d); font-weight: 600; text-align: center; }
  .needs-box, .batch-jobs, .batch .lock, .tile .btn, .preset .btn { display: none !important; }
}

/* Find: one search box (no inner outline); job numbers on one line; the side pane a little narrower */
.search input, .search input:focus { outline: none; border: 0; box-shadow: none; padding: 0; }
.client-cell { min-width: 170px; }

/* Squared corners throughout: customs and finance are an ordered world. Corners are 2px at most; nothing is round. */
:root { --r: 2px; }
.btn, .btn.sm, .chip, .pill, .chk, .count-pill, .nav, .nav .count, .role, .role select, .role .local, .logo i, .search,
.card, .stat, .jobcard, .doc, .ico, .ico.sm, .lock, .callout, .drop, .q, input, select, textarea, dialog, #toast, .sortpane,
.sortcard, .tile, .batch-job, .choice, .phone-note, .preset, .meter, .meter i, .sorter-side input[type=search] { border-radius: 2px; }
.drop { border-radius: 0; }

/* Filters: square tags in a row; the chosen one filled */
.chip { padding: 5px 12px; border-color: var(--line-strong); font-weight: 500; }
.chip:hover { border-color: var(--navy-2); background: var(--hover); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.on:hover { background: var(--navy-2); }

/* Deleting: the warning, the acceptance, and a red button that stays off until both are done */
.danger-box { background: var(--badbg); color: #7F1D1D; margin: 12px 0; }
.accept { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.accept input { margin-top: 4px; width: 18px; height: 18px; }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-fill:hover { background: #991B1B; }
.btn.danger { border-color: #FCA5A5; }

/* Long lists (Admin): the bar above them */
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.list-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list-tools input[type=date] { min-height: 32px; }

/* Long file names: two lines at most, broken anywhere, never wider than their column; the whole name on hover */
.fname { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  word-break: break-word; min-width: 110px; max-width: 420px; }
li > .fname, span.fname { display: inline; -webkit-line-clamp: unset; }
.sorter-name { margin-left: 10px; display: inline-block; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
dialog h2 { overflow-wrap: anywhere; }
td .small, .lock .small { overflow-wrap: anywhere; }
.wrap-any { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-width: 120px; max-width: 220px; }
td .btn.sm { padding: 0 10px; }
/* Find has no side pane any more: one column, never wider than the page (its tables scroll inside their card if they must) */
.split, .split > :only-child { grid-template-columns: minmax(0, 1fr); min-width: 0; }
/* Laptops under 1100px: the least-needed columns step aside so the tables fit */
@media (max-width: 1100px) { .hide-md { display: none; } }
td.actions { white-space: nowrap; }
@media (max-width: 1100px) { td.actions { white-space: normal; } td.actions .btn { display: flex; width: 100%; margin: 0 0 4px; } }

a.btn { text-decoration: none; }
.role .signout { margin-top: 10px; background: transparent; color: var(--nav-fg); border-color: rgba(255, 255, 255, .25); }
.role .signout:hover { background: rgba(255, 255, 255, .08); }

/* Phones: one neat bar on top (the logo, Sign out, and who is signed in under them), no menu: there is only Upload */
@media (max-width: 600px) {
  .side { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    column-gap: 12px; row-gap: 0; padding: 12px 16px; height: auto; box-shadow: 0 2px 10px rgba(15, 30, 60, .25); }
  .side .logo { grid-column: 1; grid-row: 1; padding: 0; font-size: 16px; }
  .side .logo i { width: 26px; height: 26px; }
  #nav { display: none; }
  .role { display: contents; }
  .role .signout { grid-column: 2; grid-row: 1; margin: 0; min-height: 30px; }
  .role .local, .role .role-line { display: none; }
  .role .firm { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; }
  .role .who { grid-column: 1 / -1; font-size: 11px; color: var(--nav-minor); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .role select { grid-column: 1 / -1; margin-top: 8px; min-height: 32px; font-size: 11px; }
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 19px; }
  .lead { font-size: 13px; }
  .drop { padding: 22px 16px; }
  .drop .btn { flex: 1 1 auto; }
}

/* Bottom left: the profile link (who is signed in) and Sign out */
.profile-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 6px; margin: -6px; border-radius: 2px; }
.profile-link:hover { background: rgba(255, 255, 255, .08); }
.profile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profile-text .firm { color: #fff; font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text .who { color: var(--nav-minor); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-go { color: var(--nav-minor); font-size: 17px; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--teal); color: #fff; font-weight: 800; border-radius: 2px; }
.avatar.lg { width: 52px; height: 52px; font-size: 21px; }
.role .signout { display: flex; margin-top: 12px; }

/* Profile page */
.profile-card { max-width: 640px; }
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.profile-email { font-weight: 700; font-size: 16px; color: var(--brand-ink); }
.can-list { margin: 0; padding-left: 20px; } .can-list li { margin: 3px 0; }
.profile-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* The tour: the part lit up, the rest dimmed, a card beside it */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-spot { position: fixed; border: 2px solid var(--mint); box-shadow: 0 0 0 9999px rgba(10, 22, 40, .62); transition: all .2s ease; pointer-events: none; }
.tour-spot.none { left: 50%; top: 50%; width: 0; height: 0; border: 0; }
.tour-card { position: fixed; width: min(380px, calc(100vw - 24px)); background: #fff; border-top: 4px solid var(--teal); padding: 16px 18px 14px;
  box-shadow: 0 16px 40px rgba(10, 22, 40, .35); }
.tour-card h3 { margin: 4px 0 6px; font-size: 16px; color: var(--brand-ink); }
.tour-card p { margin: 0 0 14px; color: var(--ink); }
.tour-count { font-size: 11px; font-weight: 700; color: var(--teal); letter-spacing: .04em; text-transform: uppercase; }
.tour-buttons { display: flex; gap: 8px; align-items: center; }
.tour-skip { border-color: transparent; color: var(--mute); }

@media (max-width: 600px) {
  .profile-link { grid-column: 1 / -1; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .role .signout { display: inline-flex; margin: 0; }
  .avatar { width: 28px; height: 28px; }
}

/* Select boxes: our own arrow, set in from the right edge like the text on the left */
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.role select { padding-right: 30px; background-position: right 10px center; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* Shown between a tab click and its page: a thin moving line under the heading */
.loading-bar { height: 3px; margin-top: 14px; background: linear-gradient(90deg, transparent, var(--teal), transparent) 0 0 / 40% 100% no-repeat, var(--line);
  animation: loading 1s linear infinite; }
@keyframes loading { from { background-position: -40% 0, 0 0; } to { background-position: 140% 0, 0 0; } }

/* A job's evidence on a sorter card: one row per tier, the tier named on the left */
.evidence { margin: 10px 0 8px; border-top: 1px solid var(--line); }
.ev-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ev-tier { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding-top: 2px; }
.ev-decisive .ev-tier { color: var(--teal-d); }
.ev-against .ev-tier { color: #B42318; }
.ev-item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 1px 0; }
.ev-label { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ev-decisive .ev-label { color: var(--brand-ink); }
.ev-detail { color: var(--mute); font-size: 12px; }
.ev-none { color: var(--mute); font-size: 12px; }
.ev-note { font-size: 12px; color: var(--mute); padding: 7px 0 0; }

/* Square corners everywhere, always: the last word on rounding, so nothing added later can bring curves back */
*, *::before, *::after { border-radius: 0 !important; }

/* The paper being sorted: a framed document area, each page bordered on it */
.paper-view { border: 1px solid var(--line-strong); }
.paper-view canvas, .paper-view img { border: 1px solid var(--line-strong); box-shadow: none; }
@media (min-width: 901px) { .sorter-paper.paper-view { margin: 12px; width: calc(100% - 24px); height: calc(100% - 24px); } }
/* The GTassure mark beside the GTorganize name (GTorganize is part of GTassure) */
.logo img.mark { width: 28px; height: 28px; flex: none; display: block; }
@media (max-width: 600px) { .side .logo img.mark { width: 26px; height: 26px; } }

/* One palette with the sidebar and the sign-in page: main buttons and selected chips in the navy #0F2744 */
.btn.pri { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.btn.pri:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.pri:disabled { background: var(--navy-3); opacity: .45; }
.chip.on { background: var(--navy-3); border-color: var(--navy-3); }
.chip.on:hover { background: var(--navy-2); }

/* GTassure's palette (gtassure.com): indigo #17144a, mint #2ee6c5, pink #d94f8c, lavender #d8d6f2. Mint is too faint
   on white for text and outlines, so a deeper mint (#0a7363: 4.9:1 on the soft mint background, WCAG AA) carries it there. */
:root {
  --navy: #17144a; --navy-2: #2b2775; --navy-3: #17144a; --brand-ink: #17144a;
  --mint: #2ee6c5; --pink: #d94f8c; --lav: #d8d6f2;
  --teal: #0a7363; --teal-d: #08604f;
  --nav-fg: #d8d6f2; --nav-minor: #a9a5d6;
}
.nav.on { background: var(--mint); color: var(--navy-3); }
.nav .count { background: var(--mint); color: var(--navy-3); }
.nav.on .count { background: var(--navy-3); color: var(--mint); }
/* The name as GTassure writes its own: a small mint GT, then the word */
.logo { color: #fff; }
.logo sup { font-size: .5em; color: var(--mint); margin-right: 1px; vertical-align: super; line-height: 0; }
.logo span { color: #fff; margin-left: 0; }
/* The most likely job: a green box */
.choice.best { border: 2px solid var(--ok); box-shadow: none; }
.danger-box { padding: 12px 14px; border-left: 4px solid var(--bad); line-height: 1.5; }
/* The box and its sentence on one centre line */
.accept { align-items: center; }
.accept input { margin: 0; flex: none; }
/* A job's papers by type: a plain count */
.held-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.held-type { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 4px 10px; font-size: 12px; color: var(--ink); background: #fff; }
.held-type b { color: var(--brand-ink); }
.batch-open { padding: 6px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; font-weight: 600; }

/* Import and export, told apart at a glance (GTassure palette: indigo in, pink out; 4.5:1 or more) */
.pill.dir { font-weight: 600; border: 1px solid transparent; }
.pill.dir-imp { background: #E4E2F7; color: #2B2775; border-color: #C9C5EE; }
.pill.dir-exp { background: #FBE3EE; color: #9E2A5E; border-color: #F2C2D8; }
/* The job page's heading: the docket, its direction and Rename on one line */
.docket-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.docket-head h1 { margin: 0; }
.who-line { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* The docket page's right side: who is looking (name and role, coloured), then the access line and the buttons, all
   one width */
.docket-side { display: grid; gap: 8px; justify-items: stretch; align-content: start; min-width: 190px; }
.docket-side > * { width: 100%; justify-content: center; text-align: center; }
.docket-side .who-line { min-height: 44px; padding: 8px 16px; background: var(--navy); color: #fff; border: 1px solid var(--navy); flex-wrap: nowrap; }
.docket-side .who-name { font-weight: 700; color: #fff; }
.docket-side .who-line .pill.grey { background: var(--mint); color: var(--navy); border-color: var(--mint); font-weight: 600; }
/* Rename docket: a pencil beside the docket number */
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); background: var(--card);
  color: var(--navy); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--hover); }

/* Find's filters: each row named, then its choices; a type's chip says how many files hold it */
.filters { display: grid; gap: 14px; margin: 6px 0 12px; }
/* The label on its own line; its choices start under it, from the margin (and wrap back to the margin) */
.chips-label { flex: 0 0 100%; margin-bottom: 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.chip-n { display: inline-block; margin-left: 6px; padding: 0 5px; min-width: 18px; text-align: center; font-size: 11px; font-weight: 600;
  line-height: 16px; background: var(--line-soft); color: var(--mute); }
.chip.on .chip-n { background: rgba(255, 255, 255, .18); color: inherit; }
.filters .chips { margin-bottom: 0; }

/* A client's folder sections: heading, rows and buttons share one left and one right edge */
.card.folder { margin-bottom: 14px; padding: 16px 18px; }
.folder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.folder-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.folder-row .ico.sm { width: 34px; height: 34px; font-size: 9px; }
.folder-name { min-width: 0; }
.folder-name > span:first-child { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-actions { display: flex; gap: 6px; }
.folder-empty { margin: 4px 0 0; }
@media (max-width: 640px) { .folder-row { grid-template-columns: auto minmax(0, 1fr); } .folder-actions { grid-column: 1 / -1; } }

/* Documents that need a docket: a task with one button (amber edge), its list folded under it */
.needs-card { border-left: 3px solid var(--warn); padding: 16px 18px; margin-top: 16px; }
.needs-card h2 { margin: 0 0 4px; }
.needs-actions { margin: 12px 0 6px; }
/* The waiting documents by folder: where each came in, where the rest of its folder went */
.needs-list { display: grid; gap: 12px; margin-top: 14px; }
.needs-folder { border: 1px solid var(--line); background: #fff; padding: 12px 14px; }
.needs-folder-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.folder-path { min-width: 0; overflow-wrap: anywhere; }
.folder-went { margin-top: 10px; display: grid; gap: 6px; }
.folder-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); }
.folder-option.best { border-color: var(--ok); background: var(--okbg); }
.folder-none { margin: 8px 0 0; }
.folder-search { margin-top: 10px; }
.folder-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); }
.folder-found { display: grid; gap: 6px; margin-top: 6px; }
.needs-rows { margin-top: 10px; border-top: 1px solid var(--line-soft); }
.needs-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); }
.needs-file { min-width: 0; }
.needs-done { margin: 8px 0; }


/* Assigning one document: the left shows it (or a document that would go with it, with a way back) */
.sorter-view { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.sorter-view .paper-view { flex: 1; min-height: 0; }
.viewing-other { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--warnbg); color: var(--warn); font-size: 13px; }
/* The documents that go with it, clubbed by the number they share */
.card.mates { margin-top: 10px; padding: 14px 16px; }
.mates-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mates-all { margin-left: auto; font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.mates-group { border-top: 1px solid var(--line-soft); padding: 6px 0 4px; }
.mates-why { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); margin: 2px 0 4px; }
.mates-group:last-child .mates-why { color: var(--mute); }
.mate { grid-template-columns: auto auto minmax(0, 1fr) auto; cursor: default; padding: 3px 4px; }
.mate.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--teal); }
.mate-name { text-align: left; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--navy-2); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
/* Where it goes: the three sections */
/* The four sections, always on one line, equal widths, at every screen size: a long name wraps inside its own box */
.where-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.where-tab { text-align: left; padding: 8px 10px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; display: grid;
  align-content: start; gap: 2px; font: inherit; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .where-tabs { gap: 4px; } .where-tab { padding: 6px 7px; } .where-tab b { font-size: 12px; } .where-tab span { font-size: 10.5px; } }
.where-tab b { font-size: 13px; }
.where-tab span { font-size: 11px; color: var(--mute); }
.where-tab.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.where-tab.on span { color: #d8d6f2; }
.why-line { font-size: 12px; color: var(--mute); margin-top: 6px; }
.why-line.yes { color: var(--ok); font-weight: 600; }
.why-line.no { color: var(--bad); }
.sorter-side input[type=search] { margin-top: 4px; }

/* Top of the menu: the firm's logo (on white, as logos are drawn) and its name; GTorganize small at the foot */
.firm-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 16px; margin-bottom: 4px; color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .12); }
.firm-brand.has-logo { flex-direction: column; align-items: stretch; gap: 8px; }
.firm-logo { display: flex; align-items: center; justify-content: center; background: #fff; padding: 8px 10px; height: 60px; }
.firm-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.firm-initials { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: #fff; color: var(--navy-3); font-weight: 800; font-size: 15px; }
.firm-name { font-weight: 700; font-size: 14px; line-height: 1.25; color: #fff; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.firm-brand.has-logo .firm-name { font-size: 13px; }
.logo.product { padding: 12px 6px 0; font-size: 12px; font-weight: 700; gap: 6px; }
.logo.product span { color: var(--nav-fg); }
.logo.product .powered { font-weight: 500; font-size: 11px; margin-right: 2px; }
.logo.product:hover span { color: #fff; }
.logo.product img.mark { width: 18px; height: 18px; }
/* Profile and Firm logo: one column of cards, the same width and spacing */
.logo-card { margin-top: 16px; max-width: 640px; }
.logo-card h2 { margin: 0 0 6px; font-size: 16px; }
.logo-preview { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); background: #fff; min-height: 48px; display: flex; align-items: center; }
.logo-preview img { max-height: 60px; max-width: 260px; object-fit: contain; }
@media (max-width: 600px) {
  .firm-brand { grid-column: 1; grid-row: 1; padding: 0; margin: 0; border: 0; flex-direction: row; }
  .firm-brand.has-logo { flex-direction: row; align-items: center; }
  .firm-logo { height: 36px; padding: 4px 6px; max-width: 140px; }
  .firm-initials { width: 32px; height: 32px; font-size: 13px; }
  .firm-brand.has-logo .firm-name { display: none; }
  .logo.product { display: none; }
}
@media (max-width: 600px) { .role .profile-text .firm { border: 0; margin: 0; padding: 0; font-size: 13px; } }

/* Peeking inside a docket, in place */
.peek-toggle { margin-top: 8px; font-size: 12px; }
.peek { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); display: grid; gap: 6px; }
.peek .holds { margin: 0; }
.chk.same { background: var(--okbg); color: var(--ok); border-color: var(--ok); font-weight: 700; }
.peek-docs { max-height: 260px; overflow: auto; }

/* A job's mandatory documents: what is missing first (each one a way to add it), then what is in, then the rest */
.must-head { display: flex; align-items: center; gap: 10px; }
.must-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.must-label { flex: 0 0 64px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.held-type.missing { border: 1px dashed var(--warn); color: var(--warn); background: var(--warnbg); text-decoration: none; font-weight: 600; }
a.held-type.missing:hover { border-style: solid; }
.card.must.has-missing { border-left: 4px solid var(--warn); }

/* A type that was guessed: the person is asked to check it */
.type-unsure { margin-top: 10px; padding: 10px 12px; background: var(--warnbg); border-left: 3px solid var(--warn); font-size: 13px; display: grid; gap: 8px; justify-items: start; }
.type-unsure q { font-weight: 600; }
.type-unsure-line { display: inline-flex !important; gap: 10px; align-items: center; margin-top: 4px; }

/* Stray documents by email: the firm's address */
.mail-line { margin: 10px 0 0; }

/* What the docket buttons of a folder will move, changing as documents are ticked */
.needs-direction { margin: 8px 0 4px; padding: 7px 10px; background: var(--paper, #f4f5fa); border-left: 3px solid var(--navy); font-size: 13px; }
.needs-direction:empty { display: none; }

/* "Did you mean …?": a client or vendor already on the list, close to the name typed */
.did-you-mean { margin: 10px 0 4px; padding: 6px 10px; border-left: 3px solid var(--warn, #b7791f); background: #fff8e6; font-size: 13px; }

.folder-search-label { display: block; font-size: 12.5px; font-weight: 600; margin: 10px 0 4px; color: var(--ink); }

/* Loading placeholders (assign screen): grey shapes of what is coming, with a slow shimmer; still for reduced motion */
.skel { background: linear-gradient(90deg, var(--line-soft) 25%, #f7f9fb 45%, var(--line-soft) 65%); background-size: 300% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .skel-dot { animation: none; } }
.skel-wrap { padding: 16px; display: flex; flex-direction: column; gap: 10px; height: 100%; box-sizing: border-box; }
.skel-page { background: #fff; border: 1px solid var(--line); padding: 28px 26px; aspect-ratio: 1 / 1.3; max-height: 100%; width: 100%; max-width: 620px;
  margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 9px; overflow: hidden; }
.skel-line { height: 9px; }
.skel-line.tall { height: 14px; }
.skel-gap { height: 12px; }
.w30 { width: 30%; } .w35 { width: 35%; } .w40 { width: 40%; } .w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w70 { width: 70%; }
.w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w88 { width: 88%; } .w90 { width: 90%; } .w92 { width: 92%; } .w95 { width: 95%; } .w100 { width: 100%; }
.skel-side { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.skel-card { background: #fff; border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.skel-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.skel-tab { height: 44px; }
.skel-say { margin: 0; font-size: 13px; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.skel-wrap .skel-say { max-width: 620px; width: 100%; margin: 0 auto; }
.skel-dot { width: 8px; height: 8px; background: var(--teal, #0E7C86); animation: skel-pulse 1s ease-in-out infinite alternate; flex: none; }
@keyframes skel-pulse { from { opacity: .25; } to { opacity: 1; } }

/* A folder's docket search: its results drop down over the page, below the box */
.folder-search { position: relative; }
.folder-found.dropdown { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .14); max-height: 320px; overflow-y: auto; margin-top: 2px; }
.folder-found.dropdown[hidden] { display: none; }
.folder-found.dropdown .folder-option { border: 0; border-bottom: 1px solid var(--line-soft); margin: 0; padding: 8px 12px; }
.folder-found.dropdown .folder-option:last-child { border-bottom: 0; }
.folder-found.dropdown .folder-option:hover { background: var(--hover); }
.dropdown-note { margin: 0; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }

/* Sortable column headers: the whole header is the button; the arrow says how it is sorted */
.sort-head { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; }
.sort-head:hover { color: var(--ink); }
.sort-head:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sort-head .sort-mark { color: var(--line-strong); font-size: .9em; }
.sort-head.on, .sort-head.on .sort-mark { color: var(--ink); }
th.num .sort-head { justify-content: flex-end; }

/* A client's or vendor's sections: a clear header (title, count, who sees it), the section's colour along the top */
.card.folder { border-top: 3px solid var(--teal); }
.card.folder.folder-accounts { border-top-color: var(--navy); }
.card.folder.folder-vendor { border-top-color: var(--warn); }
.folder-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; align-items: center; }
.folder-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-pill { display: inline-block; min-width: 22px; padding: 1px 7px; font-size: 12px; font-weight: 700; text-align: center; background: var(--line-soft); color: var(--ink); border: 1px solid var(--line); }
.only-pill { font-size: 11px; font-weight: 600; }
.folder-note { margin: 4px 0 0; }
.folder-head + .folder-empty { margin-top: 10px; }

.more-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0 4px; }

/* The document viewer (GTorganize's own) and printing: documents are not printed from GTorganize */
.viewer-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.viewer-body .paper-view { flex: 1; }
.paper-view canvas { user-select: none; -webkit-user-drag: none; }
@media print { .paper-view, .viewer, .sorter { display: none !important; } }
/* Directors: download limits reached */
.alert-card { border-left: 4px solid var(--bad); margin-bottom: 14px; }
.alert-card h2 { margin: 0 0 4px; font-size: 16px; color: var(--bad); }
.alert-card table { width: 100%; margin-top: 8px; }

/* Ticking documents to download */
.pick-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); margin-top: 8px; }
.pick-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.pick-row:first-child { border-top: 0; }
.pick-row:has(input:disabled) { opacity: .5; cursor: default; }
/* The docket search box (its results drop down over the page) */
.folder-search-box { position: relative; }
/* "+ New docket": beside "Pick dockets", in the accent colour, so it does not read as part of a search */
.needs-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn.new-docket { background: var(--teal); color: #fff; border: 1.5px solid var(--teal); font-weight: 600; }
.btn.new-docket:hover { background: var(--teal-d); border-color: var(--teal-d); }

/* "Not a firm document": on each waiting document, and the directors' list of those set aside */
.needs-row-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.linkish.not-firm { color: var(--muted, #64748b); }
.linkish.not-firm:hover { color: var(--bad); }
.aside-card { border-left: 4px solid var(--bad); margin-bottom: 14px; }
.aside-card h2 { margin: 0 0 4px; font-size: 16px; }
.aside-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }

/* Staff: a firm's onboarding */
.ob-ready { font-weight: 600; color: var(--warn-ink, #92400e); }
.ob-ready.yes { color: var(--ok, #047857); }
.ob-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .ob-grid { grid-template-columns: 1fr; } }
.ob-steps h2, .ob-card h2 { margin: 0 0 10px; font-size: 16px; }
.ob-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); align-items: start; }
.ob-mark { width: 20px; height: 20px; border: 1.5px solid var(--line-strong); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.ob-step.done .ob-mark { background: var(--teal); border-color: var(--teal); color: #fff; }
.ob-step.skipped .ob-mark { color: var(--muted, #64748b); }
.ob-step.skipped b, .ob-step.done b { color: var(--muted, #64748b); }
.ob-step-actions { display: flex; gap: 6px; align-items: center; }
.ob-card { margin-bottom: 14px; }
.ob-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; margin-bottom: 12px; }
.ob-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.ob-field input, .ob-field textarea, .ob-row input, .ob-row select { padding: 7px 9px; border: 1px solid var(--line-strong); font: inherit; font-weight: 400; }
.ob-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.ob-row input[type=email] { flex: 1 1 180px; }
.ob-people { width: 100%; }
.ob-people td { padding: 6px 4px; border-top: 1px solid var(--line-soft); }

/* New docket form: a set value, shipment tiles, the client search */
input.fixed { background: var(--hover); color: var(--ink); font-weight: 600; cursor: default; }
input.fixed:focus { outline: none; box-shadow: none; }
.pick-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pick-tile { position: relative; display: flex; margin: 0; padding: 0; background: none; cursor: pointer; }
.pick-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-tile span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: 10px 8px; text-align: center; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; color: var(--ink); }
.pick-tile:hover span { border-color: var(--navy); }
.pick-tile input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.pick-tile input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: -4px; }
@media (max-width: 600px) { .pick-tiles { grid-template-columns: repeat(2, 1fr); } }
.client-field { position: relative; }
.client-list { border: 1px solid var(--line); border-top: 0; max-height: 260px; overflow-y: auto; background: #fff; }
.client-opt { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; color: var(--ink); cursor: pointer; }
.client-opt:last-child { border-bottom: 0; }
.client-opt:hover, .client-opt:focus { background: var(--hover); outline: none; }
.client-opt.new { color: var(--teal); font-weight: 600; }
.client-chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; }
.client-chosen .btn { margin-left: auto; }
.client-iec { margin-top: 10px; }
.client-field [hidden], .client-list:empty { display: none !important; }
.client-actions { margin-top: 8px; }
.client-new label { margin-top: 0; }
/* Forms open from a fixed top edge: a list opening inside one grows it downward, it does not jump up */
dialog:modal { margin-top: min(8vh, 64px); margin-bottom: auto; max-height: calc(100vh - min(8vh, 64px) - 16px); }
label .opt { font-weight: 400; }
.btn[hidden] { display: none; }
/* Docket page header: the docket, its client, its dates, each on its own line with room between */
.docket-top { display: flex; flex-direction: column; gap: 6px; }
.docket-client { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.docket-meta { font-size: 13px; }
.docket-waiting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ask-row[hidden] { display: none; }
/* An office file in the viewer: its cells or text, under the viewer's mark; not selectable */
.office-view { padding: 16px; background-repeat: repeat; user-select: none; -webkit-user-select: none; overflow: auto; }
.office-sheet + .office-sheet { margin-top: 18px; }
.office-cells { border-collapse: collapse; font-size: 12px; background: transparent; }
.office-cells td { border: 1px solid var(--line); padding: 4px 8px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.office-text { white-space: pre-wrap; font: 13px/1.5 Inter, system-ui, sans-serif; margin: 0; }

/* Staff page: months shown (6 or 12) */
.seg { display: inline-flex; gap: 6px; }
.cost-note { margin: 6px 0 10px; padding: 8px 12px; background: #fff7e6; border-left: 3px solid #b54708; font-size: 13px; max-width: 820px; }

/* Plan usage (directors' Usage tab; staff billing card) */
.ob-sub { font-size: 14px; margin: 18px 0 4px; }
.usage-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.usage-meter { background: #fff; border: 1px solid var(--line); padding: 14px 16px; }
.usage-meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted, #5b6476); }
.usage-meter-head b { color: var(--ink); font-size: 15px; }
.usage-track { height: 8px; background: #eef0f5; margin: 10px 0 6px; }
.usage-fill { height: 100%; background: var(--teal); }
.usage-meter.near .usage-fill { background: #d97706; }
.usage-meter.over .usage-fill { background: #b42318; }
.usage-alert { margin: 0 0 14px; padding: 10px 14px; background: #fff7e6; border-left: 3px solid #b54708; font-size: 14px; }

/* Membership (directors): the plans, prices struck through during the free week */
.member-status { margin: 4px 0 16px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.member-status.trial { border-left: 3px solid var(--teal); }
.member-status.ended { border-left: 3px solid #b54708; background: #fff7e6; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan-card { position: relative; background: #fff; border: 1px solid var(--line); padding: 18px; }
.plan-card.mine { border: 2px solid var(--teal); }
.plan-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.plan-price { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.plan-price s { color: var(--muted, #5b6476); font-size: 15px; }
.plan-price b { color: var(--teal-d); font-size: 20px; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.plan-periods { margin-top: 12px; width: 100%; border-top: 1px solid var(--line); font-size: 13px; }
.plan-periods td { padding: 4px 0; }
.plan-periods td.num { text-align: right; padding-right: 8px; }
.plan-mine { position: absolute; top: 12px; right: 12px; }
.docket-side .btn { min-height: 44px; }

/* A dialog field's note: clear of its box */
.field-hint { margin-top: 8px; }
/* Membership: each paying-ahead row on one line */
.plan-periods td { white-space: nowrap; }
/* Wide screens: pages use more of the width */
@media (min-width: 1700px) { .main { max-width: 1600px; } }
/* A document's name in a docket uses the row's width (two lines at most, the full name on hover) */
.doc .meta b.fname { max-width: none; white-space: normal; display: -webkit-box; }
/* The docket page's Back: its own size, above the docket's name */
.docket-top > .btn { display: inline-flex; width: auto; justify-self: start; align-self: flex-start; }

/* The top bar, on every page beside the side menu: a director's figures at the left (each opens what it counts), who is
   signed in at the right. For display: no actions of its own. */
.col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 8px 28px;
  background: #fff; border-bottom: 1px solid var(--line); }
.topbar:empty { display: none; }
.topbar .figures { display: flex; min-width: 0; overflow: hidden; }
.topbar .figure { display: flex; flex-direction: column; justify-content: center; padding: 2px 18px; border-left: 1px solid var(--line);
  color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar .figure:first-child { border-left: 0; padding-left: 0; }
.topbar a.figure:hover b { text-decoration: underline; }
.topbar .figure b { font-size: 18px; line-height: 1.2; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.topbar .figure span { font-size: 11px; color: var(--mute); }
.topbar .figure.warn b { color: var(--warn); }
.topbar .who-line { margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 12px 4px 4px;
  background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; }
.topbar .who-line .avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--teal); color: #fff; font-weight: 800; }
.topbar .who-line .who-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.topbar .who-line .pill { background: var(--mint); color: var(--navy); border-color: var(--mint); }
/* Narrower screens: the figures first; the name on hover */
@media (max-width: 1260px) { .topbar .who-line .who-name { display: none; } .topbar .figure { padding: 2px 12px; } }
@media (max-width: 760px) { .topbar { padding: 8px 16px; } .topbar .figures { display: none; } .topbar .who-line .who-name { display: inline; } }
/* A docket's own upload: what happened to each file */
.docket-adding { margin: 0 0 10px; padding: 10px 14px; border-left: 4px solid var(--teal); background: #fff; }
.docket-adding li { margin: 2px 0; }

/* The docket's header: where it sits, its name, its facts in one row (label over value) */
.crumbs { font-size: 12px; color: var(--mute); margin: 0 0 6px; }
.crumbs a { color: var(--mute); }
.crumbs a:hover { color: var(--navy); }
.docket-titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.docket-facts { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 12px 0 0; }
.docket-facts > div { min-width: 0; }
.docket-facts dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); margin: 0 0 2px; }
.docket-facts dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.docket-facts dd.docket-client { font-size: 14px; }
.icon-btn.change-docket { width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--mute); }
.icon-btn.change-docket:hover { border-color: var(--line-strong); background: var(--card); color: var(--navy); }
/* Anything that can be pressed shows the hand; something that is turned off does not */
button:not(:disabled), [role="button"], summary, label[for], select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
/* A missing document's "+ Bill of entry": a button that opens the file picker for this docket */
button.held-type { font: inherit; font-size: 12px; }
button.held-type.missing:hover { background: var(--warnbg); border-style: solid; }
/* Checkboxes and radios: the size of the text beside them, everywhere (a dialog's full-width inputs never squeeze them) */
input[type=checkbox], input[type=radio], dialog input[type=checkbox], dialog input[type=radio] {
  width: 1.15em; height: 1.15em; min-height: 0; margin: 0; flex: 0 0 auto; accent-color: var(--navy); }
.pick-row input[type=checkbox] { font-size: 15px; }

/* The top bar's figures: a small change against last month */
.topbar .figure b .change { font-size: 11px; font-weight: 700; margin-left: 6px; }
.topbar .figure b .change.up { color: var(--ok); }
.topbar .figure b .change.down { color: var(--bad); }
.topbar .figure[hidden] { display: none; }
/* The name opens the account menu */
.topbar .account { position: relative; margin-left: auto; flex: 0 0 auto; }
.topbar button.who-line { border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.topbar button.who-line:hover, .topbar button.who-line[aria-expanded="true"] { background: var(--navy-3); }
.topbar .who-line .caret { font-size: 11px; opacity: .8; }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 260px; background: #fff; border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(15, 39, 68, .18); padding: 6px 0; }
.account-menu[hidden] { display: none; }
.account-menu .account-who { padding: 8px 14px 10px; border-bottom: 1px solid var(--line); display: grid; }
.account-menu .account-who span { font-size: 12px; color: var(--mute); overflow-wrap: anywhere; }
.account-menu > a { display: block; padding: 9px 14px; color: var(--ink); text-decoration: none; }
.account-menu > a:hover { background: var(--hover, #F1F5F9); }
.account-menu > a.signout { border-top: 1px solid var(--line); color: var(--bad); }
.account-menu label { display: grid; gap: 4px; padding: 8px 14px; font-size: 12px; color: var(--mute); }
.account-menu label select { min-height: 34px; }
.account-menu .local { display: inline-block; background: var(--warn); color: #fff; padding: 0 6px; font-weight: 800; font-size: 10px; justify-self: start; }

/* The side menu: recent dockets under the pages; the foot holds "Powered by" and the fold */
.recent { margin-top: 14px; display: grid; gap: 2px; min-width: 0; }
.recent-item { display: grid; padding: 6px 12px; color: #E6E4F5; text-decoration: none; min-width: 0; }
.recent-item:hover, .recent-item.on { background: rgba(255, 255, 255, .1); }
.recent-name { font-size: 13px; font-weight: 600; color: #fff; }
.recent-party { font-size: 11px; color: var(--nav-minor); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fold { flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; font-size: 16px; line-height: 1; }
.fold:hover { background: rgba(255, 255, 255, .12); }
/* Folded: icons only, each page's name on hover; the pages get the room */
.frame.folded { grid-template-columns: 64px 1fr; }
.frame.folded .side { padding-left: 8px; padding-right: 8px; }
.frame.folded .firm-name, .frame.folded .nav .label, .frame.folded .recent, .frame.folded .logo.product { display: none; }
.frame.folded .nav { justify-content: center; padding-left: 0; padding-right: 0; }
.frame.folded .firm-brand { justify-content: center; }
.frame.folded .side-foot { justify-content: center; }
@media (max-width: 760px) { .fold, .recent { display: none; } }
