/* Clarke & Wright client portal — design system.
   Palette taken from the brand mark: deep navy wordmark + amber ampersand. */
:root {
  --navy:       #1b2a52;
  --navy-700:   #243561;
  --navy-900:   #131f3d;
  --amber:      #f59e0b;
  --amber-600:  #e08e05;
  --amber-text: #9a5800;  /* amber for TEXT: 5.6:1 on white, 5.1:1 on #fef3e2 (the lighter ambers fail WCAG 4.5:1) */
  --ink:        #1f2937;
  --muted:      #4b5566;
  --line:       #e3e7f0;
  --bg:         #eef1f7;
  --card:       #ffffff;
  --ok-bg:      #e9f7ef;  --ok-fg:  #11703a;
  --in-bg:      #e8effc;  --in-fg:  #1d3f86;
  --err-bg:     #fdecec;  --err-fg: #a3231f;  --err-bd: #f0b6b3;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 10px 30px rgba(19,31,61,.10), 0 2px 6px rgba(19,31,61,.06);
  --serif:      Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans:       system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, #f7f9fd 0%, var(--bg) 70%);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--amber-text); text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.2; font-weight: 600; }

/* ---------- Auth (login / otp / sent / error) ---------- */
.auth {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth .card { width: 100%; max-width: 430px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 2.2rem;
}
.brand { display: block; }
.brand img { height: 58px; width: auto; display: block; }
.auth .brand { text-align: center; margin-bottom: 1.6rem; }
.auth .brand img { margin: 0 auto; }
.eyebrow {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber-text); margin: 0 0 .5rem;
}
.card h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
.card > p { margin: 0 0 1rem; color: var(--muted); }
.card > p.lead { color: var(--ink); }

/* ---------- App shell (dashboard / upload / case / search) ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(19,31,61,.03);
}
.topbar-inner {
  max-width: 920px; margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar .brand img { height: 36px; }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; font-size: .92rem; }
.topbar .who { color: var(--muted); }
.container { max-width: 920px; margin: 0 auto; padding: 2rem 1.25rem 1rem; }
.page-head { margin: 0 0 1.4rem; }
.page-head h1 { font-size: 1.7rem; margin: 0 0 .2rem; }
.page-head .sub { color: var(--muted); margin: 0; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem;
}
.panel + .panel { margin-top: 1.25rem; }

/* ---------- Forms ---------- */
.field { margin: 1.1rem 0; }
label { display: block; margin: 0 0 .35rem; font-weight: 600; font-size: .95rem; color: var(--navy-700); }
input[type=text], input[type=email], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: .7rem .8rem; font-size: 1rem; font-family: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cdd5e4; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(245,158,11,.25);
}
input[type=file] { padding: .55rem .6rem; background: #fbfcfe; }
.hint { color: var(--muted); font-size: .85rem; margin: .35rem 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer; border: 1px solid transparent;
  padding: .72rem 1.4rem; font: 600 1rem var(--sans); border-radius: var(--radius-sm);
  text-decoration: none; transition: background .15s, box-shadow .15s, transform .02s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(27,42,82,.25); }
.btn-primary:hover { background: var(--navy-900); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-ghost { background: #fff; color: var(--navy); border-color: #cdd5e4; }
.btn-ghost:hover { background: #f5f7fc; color: var(--navy); }
.btn-sm { padding: .45rem .9rem; font-size: .88rem; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0 0 1.1rem; font-size: .95rem; border: 1px solid transparent; }
.alert-error { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }
.alert-info  { background: var(--in-bg);  color: var(--in-fg); }
.alert-ok    { background: var(--ok-bg);  color: var(--ok-fg); }

/* ---------- Document table ---------- */
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td { text-align: left; padding: .8rem .6rem; border-bottom: 1px solid var(--line); }
.doc-table thead th { font: 700 .76rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc-table tbody tr:hover { background: #f7f9fd; }
.doc-table .fname { font-weight: 600; color: var(--navy); }
.doc-table .desc { color: var(--muted); font-size: .85rem; }
.doc-table td.num { color: var(--muted); white-space: nowrap; }

.badge { display: inline-block; font-size: .73rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; letter-spacing: .02em; }
.badge-in  { background: var(--in-bg); color: var(--in-fg); }
.badge-out { background: var(--ok-bg); color: var(--ok-fg); }

.empty {
  text-align: center; color: var(--muted);
  padding: 2.4rem 1.5rem; border: 1px dashed #c4cde0; border-radius: var(--radius); background: #fafbfe;
}
.empty .ico { font-size: 1.8rem; display: block; margin-bottom: .4rem; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 560px; margin: 1.8rem auto 0; padding: 0 1rem;
  text-align: center; color: var(--muted); font-size: .78rem; line-height: 1.5;
}
.site-footer .secure { color: var(--navy-700); font-weight: 600; }
.site-footer .reg { display: block; margin-top: .5rem; font-style: italic; opacity: .9; }
.site-footer .ipw { display: block; margin-top: .4rem; }
.app-footer { max-width: 920px; }

.muted { color: var(--muted); }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* one-time-code input */
input.otp { text-align: center; letter-spacing: .45em; font-size: 1.5rem; font-weight: 700; padding-left: .45em; }
/* remember-this-device checkbox row */
.check { display: flex; align-items: center; gap: .55rem; font-weight: 400; color: var(--ink); margin: 1rem 0 0; }
.check input { width: auto; }
/* misc layout bits used by app pages */
.actions-row { margin: 1.3rem 0; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.backlink { display: inline-block; margin-top: 1.4rem; font-weight: 600; }
.case-meta { color: var(--muted); font-size: .92rem; margin: .15rem 0 1.2rem; }
.case-meta strong { color: var(--navy-700); }
.send-panel { background: #f6f8fc; border-color: #dce4f2; }
.send-panel h2 { font-size: 1.05rem; margin: 0 0 .2rem; }
.btn-danger { background: #fff; color: #a3231f; border-color: #e6b7b4; }
.btn-danger:hover { background: #fdecec; color: #a3231f; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.or { text-align: center; color: var(--muted); font-size: .85rem; margin: 1.1rem 0 .9rem; }
.grow { flex: 1; min-width: 240px; }

@media (max-width: 540px) {
  .card { padding: 1.8rem 1.4rem; }
  .container { padding: 1.4rem 1rem; }
  .doc-table thead { display: none; }
  .doc-table td { display: block; border: 0; padding: .25rem .6rem; }
  .doc-table tbody tr { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .8rem; padding: .6rem .4rem; }
}

/* ---------- Audit log (admin) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; }
.filters .filter-field { margin: 0; }
.filters .filter-field label { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.filters select, .filters input[type=date] { width: auto; min-width: 9.5rem; }
.filters .filter-field.grow { flex: 1; min-width: 220px; }
.filters .filter-field.grow input { width: 100%; }
.filter-actions { display: flex; gap: .5rem; align-items: flex-end; }

.mono { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace; font-size: .85rem; }
.audit-table td { vertical-align: top; padding-top: .65rem; padding-bottom: .65rem; }

/* ---------- Folders + breadcrumbs + per-row actions ---------- */
.crumbs { font-size: .92rem; color: var(--muted); margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .25rem .35rem; align-items: center; }
.crumbs a { font-weight: 600; }
.crumbs .sep { color: var(--muted); }
.crumbs .here { color: var(--navy-700); font-weight: 600; }
.folder-list { list-style: none; margin: 0; padding: 0; }
.folder-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.folder-row:last-child { border-bottom: 0; }
.folder-row .fname { flex: 1; min-width: 160px; }
.folder-row .fname a { font-weight: 600; }
.new-folder { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.rowact { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rowmenu { display: inline-block; }
.rowmenu > summary { cursor: pointer; list-style: none; font-size: .82rem; font-weight: 600; color: var(--navy-700); padding: .25rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu[open] > summary { background: var(--in-bg); }
.rowmenu .menu-form { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.rowmenu .menu-form input[type=text], .rowmenu .menu-form input[type=email], .rowmenu .menu-form input[type=tel],
.rowmenu .menu-form select { width: auto; min-width: 12rem; }
.fname .orig { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }

/* ---------- Accessibility ----------
   Audience skews older, so prioritise keyboard focus, touch targets and motion. */
/* Skip-to-content link: hidden until focused, then pinned top-left. */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 1000;
  background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 700; transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: #fff; text-decoration: none; outline: 3px solid var(--amber); }

/* Strong, consistent keyboard focus ring on every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Comfortable touch targets (WCAG 2.5.5 / older users on phones). */
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.btn-sm { min-height: 38px; }
.rowmenu > summary { min-height: 38px; display: inline-flex; align-items: center; }

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.audit-table .desc { font-size: .78rem; }

.role-pill {
  display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .12rem .45rem; border-radius: 6px; margin-right: .35rem; vertical-align: middle;
  background: #eef1f7; color: var(--muted);
}
.role-pill.role-staff  { background: var(--in-bg);  color: var(--in-fg); }
.role-pill.role-admin  { background: #efe7fb;        color: #5b3aa6; }
.role-pill.role-client { background: var(--ok-bg);  color: var(--ok-fg); }
.role-pill.role-system { background: #fef3e2;        color: var(--amber-text); }

.badge-ok     { background: var(--ok-bg);  color: var(--ok-fg); }
.badge-fail   { background: var(--err-bg); color: var(--err-fg); }
.badge-denied { background: #fef3e2;       color: var(--amber-text); }

.meta summary { cursor: pointer; color: var(--navy); font-size: .82rem; font-weight: 600; }
.meta pre {
  margin: .4rem 0 0; padding: .6rem .7rem; background: #f7f9fd; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .78rem; max-width: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.pager-nav { display: flex; align-items: center; gap: .8rem; }

/* ---------- Sign-in fallbacks (voice call + staff-issued code) ---------- */

/* Replaces the inline margin the OTP/code submit buttons used to carry — the
   live CSP has no style-src 'unsafe-inline', so inline style="" is dropped. */
.btn-gap { margin-top: 1.3rem; }

/* Staff case screen: the "client can't get in?" helper panel. */
.signin-help { margin-top: 1.4rem; }
.signin-help h2 { font-size: 1.15rem; margin: 0 0 .35rem; }
.signin-help .hint { margin: 0 0 .9rem; }

/* The issued code, sized to be read aloud off the screen without squinting. */
.code-callout {
  background: var(--card);
  border: 1px solid var(--amber);
  border-left: 5px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  margin: 0 0 1.3rem;
  box-shadow: var(--shadow);
}
.code-label {
  margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.code-value {
  font-family: var(--serif);
  font-size: 2.6rem; line-height: 1.1; font-weight: 600;
  color: var(--navy); letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  margin: .35rem 0 .6rem;
}
.code-note { margin: 0 0 .35rem; font-size: .88rem; color: var(--muted); }
.code-note:last-child { margin-bottom: 0; }

@media (max-width: 540px) {
  .code-value { font-size: 2rem; }
}

/* Admin "view as" banner. Deliberately loud and above the brand bar: an admin
   who forgets whose seat they are in is the main risk this feature carries. */
.imp-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 1.1rem;
  background: #8a3d00;
  color: #fff;
  font-size: .93rem;
  line-height: 1.4;
}
.imp-banner b { font-weight: 700; }
.imp-banner .btn {
  background: #fff;
  color: #8a3d00;
  border: 1px solid #fff;
  font-weight: 600;
  white-space: nowrap;
}
.imp-banner .btn:hover { background: #ffe9d6; }
/* Utility classes that replace inline style="" attributes, which the CSP
   (style-src 'self') blocks, so those layouts were silently not applied. */
.inline-form { margin: 0; }
.section-h { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
.empty-tight { padding: 1rem; }
.hint-tight { margin: .1rem 0 .8rem; }
.grow-input { flex: 1; min-width: 240px; }
.sub-block { display: block; margin-bottom: .35rem; }
.full-width { width: 100%; }
.btn-gap { margin-top: 1.3rem; }
.gap-top { margin-top: 1.1rem; }
.check-label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.check-box { margin-top: .2rem; }
.btn.is-busy { opacity: .7; cursor: progress; }

@media (prefers-reduced-motion: no-preference) {
  .imp-banner { animation: imp-fade .25s ease-in; }
  @keyframes imp-fade { from { opacity: .4 } to { opacity: 1 } }
}

/* ---------- File picking (form[data-collect], see portal.js) ----------
 * Without JS: each label sits above its native file input, as before.
 * With JS (.js-collect): the inputs hide, the labels become buttons, and the
 * chosen files gather in .picked so several picks, from different folders or
 * several photos taken one at a time, go up in one send. */
.pick { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pick-or { display: none; }
.js-collect .pick input[type=file] {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.js-collect .pick-btn {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0; cursor: pointer;
  padding: .55rem 1.1rem; background: #fff; color: var(--navy);
  border: 1px solid #cdd5e4; border-radius: var(--radius-sm);
}
.js-collect .pick-btn:hover { background: #f5f7fc; }
.js-collect .pick:focus-within .pick-btn { box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.js-collect .pick-or { display: inline; font-size: .9rem; }
.pick-btn[hidden] { display: none; }
.picked { list-style: none; margin: .7rem 0 0; padding: 0; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.picked li { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem;
  border-top: 1px solid var(--line); font-size: .92rem; }
.picked li:first-child { border-top: 0; }
.picked .pname { overflow-wrap: anywhere; }
.picked .psize { margin-left: auto; color: var(--muted); white-space: nowrap; }
.picked-warn { color: #a3231f; font-weight: 600; }
.dropzone.is-drag { outline: 2px dashed var(--navy); outline-offset: 6px; border-radius: var(--radius-sm); }

/* ---------- Cover message box (staff send form) and messages ---------- */
.rte { border: 1px solid #cdd5e4; border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
.rte:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.rte-bar { display: flex; flex-wrap: wrap; gap: .3rem; padding: .4rem; border-bottom: 1px solid var(--line); background: #fbfcfe; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.rte-btn { font: 600 .85rem/1 var(--sans); color: var(--navy-700); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .45rem .65rem; min-height: 34px; cursor: pointer; }
.rte-btn:hover { background: var(--in-bg); }
.rte-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.rte-bold { font-weight: 800; }
.rte-italic { font-style: italic; }
.rte-underline { text-decoration: underline; }
.rte-area { min-height: 14rem; max-height: 32rem; overflow-y: auto; padding: .8rem .9rem; font-size: 1rem; line-height: 1.55; outline: none; }
.rte-area.is-empty::before { content: attr(data-placeholder); color: #9aa3b2; pointer-events: none; }
.rte-area p, .msg-body p { margin: 0 0 .8rem; }
.rte-area ul, .rte-area ol, .msg-body ul, .msg-body ol { margin: 0 0 .8rem; padding-left: 1.5rem; }
.rte-area a, .msg-body a { color: var(--navy); text-decoration: underline; }
.rte-count { margin: 0; padding: .35rem .9rem .5rem; min-height: 1.6rem; }

.msg-list { padding: .4rem 1.2rem; }
.msg { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.msg:last-child { border-bottom: 0; }
.msg > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .25rem .8rem; align-items: baseline; list-style: none; }
.msg > summary::-webkit-details-marker { display: none; }
.msg > summary::before { content: "\25B8"; color: var(--navy-700); width: .8rem; }
.msg[open] > summary::before { content: "\25BE"; }
.msg-who { font-weight: 700; color: var(--navy-700); }
.msg-when { color: var(--muted); font-size: .9rem; }
.msg-body { margin: .8rem 0 0 1.6rem; padding: .9rem 1rem; background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.msg-body > :last-child { margin-bottom: 0; }
.msg .hint { margin-left: 1.6rem; }
@media (max-width: 540px) {
  .msg-body, .msg .hint { margin-left: 0; }
  .rte-area { min-height: 11rem; }
}

/* ---------- Guides: staff (/s/guide) and client (/help) ---------- */
.topbar nav .nav-guide { font-weight: 600; color: var(--navy-700); white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .35rem; }
.topbar nav .nav-guide:hover { text-decoration: underline; }
.guide { max-width: 760px; }
.guide .panel { padding: 1.3rem 1.5rem; }
.guide section.panel { scroll-margin-top: 1rem; }
.guide h2 { font-size: 1.2rem; margin: 0 0 .7rem; }
.guide h3 { font-size: 1rem; margin: 0 0 .5rem; color: var(--navy-700); }
.guide p { margin: 0 0 .8rem; }
.guide ul, .guide ol { margin: 0 0 .8rem; padding-left: 1.4rem; }
.guide li { margin: 0 0 .45rem; }
.guide li ul { margin: .45rem 0 0; }
.guide > :last-child, .guide .panel > :last-child { margin-bottom: 0; }
.guide a:not(.btn) { text-decoration: underline; }
.guide-toc ol { columns: 2; column-gap: 2rem; margin: 0; }
.guide-toc li { break-inside: avoid; margin-bottom: .3rem; }
.guide-note { background: var(--in-bg); border-left: 4px solid var(--amber); border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 0 0 1.25rem; }
.guide .panel .guide-note { margin: .9rem 0 0; }
.guide-note p { margin: 0; }
.guide-note-ok { background: var(--ok-bg); border-left-color: var(--ok-fg); }
.guide-note-warn { background: #fef3e2; border-left-color: var(--amber-600); }
.guide-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 0 0 .4rem; }
.guide-cols > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; background: #fbfcfe; }
.guide-quote { margin: 0; padding: .9rem 1.1rem; background: #fbfcfe; border-left: 4px solid var(--navy); border-radius: var(--radius-sm); font-style: italic; }
.guide-faq dt { font-weight: 700; color: var(--navy-700); margin: .9rem 0 .25rem; }
.guide-faq dt:first-child { margin-top: 0; }
.guide-faq dd { margin: 0; }
.guide-steps li::marker { font-weight: 700; color: var(--navy-700); }
@media (max-width: 640px) {
  .guide-cols { grid-template-columns: 1fr; }
  .guide-toc ol { columns: 1; }
  .guide .panel { padding: 1.1rem 1.1rem; }
}
@media (max-width: 540px) {
  .topbar nav { gap: .4rem .8rem; flex-wrap: wrap; justify-content: flex-end; }
  .topbar .who { flex-basis: 100%; text-align: right; font-size: .85rem; overflow-wrap: anywhere; }
}

/* Workstation (DSE) self-assessment. dse-off hides a part only when script is
   running to show it again; with no script every part stays visible. */
.js .dse-off { display: none; }
.dse-intro { margin: 0; padding-left: 1.2rem; }
.dse-intro li { margin: .35rem 0; }
.dse-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.dse-form legend { font-weight: 600; color: var(--navy-700); padding: 0; margin-bottom: .4rem; }
.dse-where legend { margin-bottom: .2rem; }
.dse-q { padding: .85rem 0; border-top: 1px solid var(--line); }
.dse-q:first-of-type { border-top: 0; }
.dse-n { color: var(--muted); }
.dse-yn { display: flex; gap: 1.6rem; }
.dse-yn .check { margin: 0; }
.dse-note { margin: .6rem 0 0; }
.dse-errors { margin: .4rem 0 0; padding-left: 1.2rem; }
.dse-counts { display: flex; flex-wrap: wrap; gap: .5rem 2.2rem; }
.dse-counts b { font-size: 1.4rem; color: var(--navy); }
.dse-facts { margin: 0 0 1rem; display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
.dse-facts dt { color: var(--muted); }
.dse-facts dd { margin: 0; }
.dse-group-row { background: #f2f5fb; }
.dse-scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 1.2rem; }
.dse-mgrs { padding-left: 1.2rem; }
.dse-issue-form { margin-top: .6rem; }
/* The Mercian Accountants copy (PORTAL_EDITION=mercian): its blue and pink. */
body.firm-mercian { --navy: #223a7a; --navy-700: #2b448a; --navy-900: #182a5c; --amber: #ef4d6e; --amber-600: #d93e60; --amber-text: #b3294a; }

/* ---------- My cases (/s/my-cases) ---------- */
.mc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1.2rem 0 1rem; }
.mc-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.mc-num { display: block; font: 700 1.6rem/1.2 var(--sans); color: var(--navy); }
.mc-lbl { display: block; font-size: .82rem; color: var(--muted); }
.mc-sort { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }
.mc-sort a, .mc-sort strong { margin-left: .6rem; }
.mc-table td { vertical-align: top; }
.mc-who { display: block; }
.mc-cell { white-space: nowrap; }
.mc-matter { display: block; margin-bottom: .2rem; }
.mc-pill { display: inline-block; min-width: 2.8rem; text-align: center; font-size: .8rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px; background: var(--in-bg); color: var(--in-fg); }
.mc-pill.mc-up   { background: var(--ok-bg); color: var(--ok-fg); }
.mc-pill.mc-new  { background: var(--ok-bg); color: var(--ok-fg); }
.mc-pill.mc-down { background: #fef3e2; color: var(--amber-text); }
.mc-pill.mc-hold { background: var(--err-bg); color: var(--err-fg); }
.mc-pill.mc-done { background: var(--ok-fg); color: #fff; }
.mc-was { font-size: .74rem; color: var(--muted); margin-left: .25rem; }
.mc-bar { width: 4.5rem; height: .55rem; vertical-align: middle; accent-color: var(--navy); }
.mc-pct { font-size: .82rem; color: var(--muted); margin-left: .3rem; }
.mc-quiet .fname { color: var(--amber-text); }
.mc-links { white-space: nowrap; }
.mc-notes ol { margin: 0; padding-left: 1.2rem; font-size: .9rem; color: var(--muted); }
.mc-notes li { margin-bottom: .35rem; }
@media (max-width: 720px) {
  .mc-table td.mc-cell::before, .mc-table td.num::before { content: attr(data-label) ": "; font-size: .74rem; color: var(--muted); }
}
.mc-table td:first-child { min-width: 13rem; }
.mc-scroll { overflow-x: auto; }
.container-wide { max-width: 1280px; }
