
/* ---------------------------------------------------------------------------
   Tokens
   --------------------------------------------------------------------------- */
:root {
  /* Cool neutral ramp */
  --n0:   #ffffff;
  --n25:  #fcfcfd;
  --n50:  #f8f9fb;
  --n100: #f1f3f7;
  --n150: #e9ecf2;
  --n200: #e2e6ee;
  --n300: #cfd5e1;
  --n400: #98a1b3;
  --n450: #7c8598;   /* decorative icons only — 3.71:1, clears the non-text bar */
  --n500: #6b7488;
  --n600: #4e5668;
  --n700: #373e4d;
  --n800: #232936;
  --n900: #141923;
  --n950: #0b0e15;

  /* One accent */
  --a50:  #eff4ff;
  --a100: #dce7ff;
  --a200: #bdd0ff;
  --a400: #6791f8;
  --a500: #3f6ff0;
  --a600: #2c55d6;
  --a700: #2343ab;

  /* Status. Every one of these is paired with a word in the markup —
     colour never carries state on its own. */
  --red-bg:#fef3f2; --red-br:#fecdca; --red-fg:#b42318; --red-dot:#d92d20;
  --amb-bg:#fffaeb; --amb-br:#fedf89; --amb-fg:#b54708; --amb-dot:#f79009;
  --blu-bg:#eff8ff; --blu-br:#b2ddff; --blu-fg:#175cd3; --blu-dot:#2e90fa;
  --grn-bg:#ecfdf3; --grn-br:#a9efc5; --grn-fg:#067647; --grn-dot:#17b26a;
  --gry-bg:#f8f9fb; --gry-br:#e2e6ee; --gry-fg:#5b6377; --gry-dot:#98a1b3;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Depth: every shadow carries an offset and a blur. */
  --sh1: 0 1px 2px rgba(13,18,28,.05), 0 1px 3px rgba(13,18,28,.08);
  --sh2: 0 2px 4px -2px rgba(13,18,28,.06), 0 4px 10px -2px rgba(13,18,28,.09);
  --sh3: 0 4px 8px -3px rgba(13,18,28,.06), 0 14px 24px -6px rgba(13,18,28,.12);
  --sh-inset: inset 0 1px 0 rgba(255,255,255,.7);

  --ring: 0 0 0 3px rgba(63,111,240,.28);
  /* The shade at a scroll container's edge, from the same ink as the shadows. */
  --edge: rgba(13,18,28,.10);

  --sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.16,1,.3,1);
  --dur: 180ms;

  --header-h: 56px;
  --page-max: 1240px;
}

/* ---------------------------------------------------------------------------
   Reset and browser surfaces.
   The parts nobody draws still carry the design.
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--n300) transparent;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--n800);
  background: var(--n50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--a600);
  font-feature-settings: "cv11", "ss01";
}

::selection { background: var(--a100); color: var(--a700); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--n300);
  border-radius: 99px;
  border: 3px solid var(--n50);
}
::-webkit-scrollbar-thumb:hover { background: var(--n400); }

/* Outline only. Setting a radius here squared off every pill and panel the
   moment a keyboard user reached it. */
:focus-visible {
  outline: 2px solid var(--a600);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

a {
  color: var(--a600);
  text-decoration-color: color-mix(in srgb, var(--a600) 32%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: var(--a600); }

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--n900);
  text-wrap: balance;
}
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.024em; }
h2 { font-size: 16px; line-height: 1.35; }
h3 { font-size: 14px; line-height: 1.4; }

p { text-wrap: pretty; }

img, svg { display: block; }
svg { flex: none; }

table { border-collapse: collapse; width: 100%; }

/* Every figure in this product is data. Align it. */
td, th, .num, time, .tnum, .strip-count { font-variant-numeric: tabular-nums; }

input, select, textarea, button { font: inherit; color: inherit; }

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: var(--n0);
  border-bottom: 1px solid var(--n200);
  position: sticky; top: 0; z-index: 40;
}
.topbar-in {
  max-width: var(--page-max); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 8px;
}

/* Bare mark, no tile. A gradient app-icon square next to a wordmark is the
   2020s default; the mark carries itself at this size. */
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 650; font-size: 16px; letter-spacing: -0.03em;
  color: var(--n900); text-decoration: none; padding-right: 6px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  color: var(--a600); display: inline-flex;
  /* The stroke's optical centre sits below its bounding box. */
  margin-top: -1px;
  transition: color var(--dur) var(--ease);
}
.brand:hover .brand-mark { color: var(--a500); }

/* One word, two tones. "Vaylo" carries the weight and the ink; "Compliance"
   recedes. No space between them — the single run is the identity. */
.brand-sub { font-weight: 450; color: var(--n500); }

/* Filled plate. Used where a loose stroke would disappear — the login lockup
   and anywhere the mark needs presence rather than restraint. */
.brand-plate {
  width: 30px; height: 30px; border-radius: var(--radius-md);
  background: var(--a600); color: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: var(--sh1);
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--n600);
  text-decoration: none; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a:hover { background: var(--n100); color: var(--n900); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--n100); color: var(--n900); }
.nav a svg { color: var(--n450); }
.nav a[aria-current="page"] svg { color: var(--a600); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.who {
  display: flex; align-items: center; gap: 9px;
  padding-left: 12px; border-left: 1px solid var(--n200);
}
.who-name { font-size: 13px; font-weight: 550; color: var(--n800); line-height: 1.2; }
.who-role { font-size: 11.5px; color: var(--n500); line-height: 1.2; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--n100); color: var(--n600);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 650; letter-spacing: .02em;
  border: 1px solid var(--n200);
}

.main { flex: 1; }
.page { max-width: var(--page-max); margin: 0 auto; padding: 28px 24px 72px; }

.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.page-head h1 { margin-bottom: 4px; }
.page-sub { color: var(--n500); font-size: 13.5px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.crumbs {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--n500); margin-bottom: 10px;
}
.crumbs a { color: var(--n500); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--n800); }
.crumbs svg { color: var(--n450); }

/* ---------------------------------------------------------------------------
   Surfaces
   --------------------------------------------------------------------------- */
.panel {
  background: var(--n0);
  border: 1px solid var(--n200);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh1);
}
.panel + .panel { margin-top: 20px; }

.panel-head {
  display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--n150);
}
.panel-head h2 { font-size: 14.5px; }
.panel-head .hint { color: var(--n500); font-size: 12.5px; }
.panel-head-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 18px; }
/* A panel that folds. The summary IS the panel head, so a closed panel reads
   as a single row and an open one is indistinguishable from a static panel. */
details.panel > summary { list-style: none; cursor: pointer; user-select: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary.panel-head { border-bottom: 1px solid transparent; }
details.panel[open] > summary.panel-head { border-bottom-color: var(--n150); }
details.panel > summary:hover { background: var(--n25); }
details.panel > summary:hover h2 { color: var(--a600); }
.panel-chev {
  margin-left: auto; color: var(--n450); display: inline-flex;
  transition: transform var(--dur) var(--ease);
}
details.panel[open] .panel-chev { transform: rotate(180deg); }
details.panel > summary:focus-visible { outline-offset: -2px; border-radius: var(--radius-lg); }

.panel-foot {
  padding: 12px 18px; border-top: 1px solid var(--n150);
  background: var(--n25); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12.5px; color: var(--n500);
}

/* ---------------------------------------------------------------------------
   Status strip — one segmented control, not four floating cards.
   Each segment filters the register below it.
   --------------------------------------------------------------------------- */
.strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--n0); border: 1px solid var(--n200);
  border-radius: var(--radius-lg); box-shadow: var(--sh1);
  overflow: hidden; margin-bottom: 20px;
}
.strip-seg {
  display: block; padding: 15px 18px 14px; text-decoration: none;
  border-left: 1px solid var(--n150); position: relative;
  transition: background var(--dur) var(--ease);
}
.strip-seg:first-child { border-left: none; }
.strip-seg:hover { background: var(--n25); text-decoration: none; }
.strip-seg::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: transparent; transition: background var(--dur) var(--ease);
}
.strip-seg[aria-current="true"] { background: var(--n25); }
.strip-seg[aria-current="true"]::after { background: var(--seg, var(--n400)); }

.strip-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--n500); margin-bottom: 7px;
}
/* The count and its qualifier share one line — "2 Past the due date" — which
   reads tighter than a stack and keeps all four segments the same height.
   Both are declared inline on purpose; this is not a missing display rule. */
.strip-count {
  display: inline; font-size: 27px; font-weight: 620; letter-spacing: -0.03em;
  line-height: 1; color: var(--n900);
}
.strip-count.zero { color: var(--n500); font-weight: 500; }
.strip-note { display: inline; font-size: 12px; color: var(--n500); margin-left: 3px; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot, var(--n400)); flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--n400)) 16%, transparent);
}
.seg-overdue { --seg: var(--red-dot); --dot: var(--red-dot); }
.seg-due     { --seg: var(--amb-dot); --dot: var(--amb-dot); }
.seg-upcoming{ --seg: var(--blu-dot); --dot: var(--blu-dot); }
.seg-ok      { --seg: var(--grn-dot); --dot: var(--grn-dot); }

/* ---------------------------------------------------------------------------
   Matrix — the whole estate on one grid.
   --------------------------------------------------------------------------- */
/* The matrix is wider than a phone and that is correct — it is a matrix.
   Shade the right edge while there is more to reach, so the scroll is
   discoverable rather than a cut-off column nobody knows to chase. */
.matrix-wrap, .scroller {
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--n0) 30%, transparent) left / 32px 100% no-repeat,
    linear-gradient(to left, var(--n0) 30%, transparent) right / 32px 100% no-repeat,
    linear-gradient(to right, var(--edge), transparent) left / 10px 100% no-repeat,
    linear-gradient(to left, var(--edge), transparent) right / 10px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.matrix { min-width: 900px; }
/* Sticky identity column: on a phone the grid scrolls, and six anonymous
   columns are useless if you cannot see which building you are reading. */
.matrix thead th.mx-site, .matrix .mx-site-cell {
  position: sticky; left: 0; z-index: 2; background: var(--n0);
}
.matrix thead th.mx-site { background: var(--n0); }
.matrix tbody tr:hover .mx-site-cell { background: var(--n25); }
.matrix thead th.mx-site::after, .matrix .mx-site-cell::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: -1px; width: 1px;
  background: var(--n200);
}

.matrix thead th {
  padding: 10px 8px; text-align: left; vertical-align: bottom;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--n500);
  border-bottom: 1px solid var(--n200); white-space: nowrap;
}
.matrix thead th.mx-site { padding-left: 18px; width: 300px; }
.matrix thead th.mx-disc { text-align: center; width: 104px; }
.matrix thead th .std {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0; text-transform: none; color: var(--n500);
  font-weight: 450; margin-top: 3px;
}

.matrix tbody tr { border-bottom: 1px solid var(--n150); }
.matrix tbody tr:last-child { border-bottom: none; }
.matrix tbody tr:hover { background: var(--n25); }

.mx-site-cell { padding: 12px 8px 12px 18px; }
.mx-site-name {
  font-size: 13.5px; text-decoration: none; display: block;
}
/* All three sites share their first 31 characters. The branch is the only
   token that tells them apart, so it carries the weight and the group name
   recedes — otherwise the eye gives up before reaching it. */
.site-branch { font-weight: 620; color: var(--n900); }
.site-group { font-weight: 450; color: var(--n500); }
.mx-site-name:hover .site-branch { color: var(--a600); }
.mx-site-name:hover { color: var(--a600); text-decoration: none; }
.mx-site-meta { font-size: 12px; color: var(--n500); margin-top: 2px; }
.mx-ref {
  font-family: var(--mono); font-size: 11px; color: var(--n600);
  background: var(--n100); border-radius: 4px; padding: 1px 5px;
}

.mx-cell { padding: 8px 6px; text-align: center; }
.cellbtn {
  display: block; width: 100%; padding: 7px 6px 6px;
  border: 1px solid var(--n200); border-radius: var(--radius);
  background: var(--n0); text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              opacity var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.cellbtn:hover {
  text-decoration: none; box-shadow: var(--sh2); transform: translateY(-1px);
}
.cellbtn .cs {
  display: block; font-size: 10.5px; font-weight: 650; letter-spacing: .03em;
  text-transform: uppercase; margin-bottom: 2px; white-space: nowrap;
}
.cellbtn .cd {
  display: block; font-size: 12px; color: var(--n600); white-space: nowrap;
}

.cellbtn.st-overdue    { background: var(--red-bg); border-color: var(--red-br); }
.cellbtn.st-overdue .cs{ color: var(--red-fg); }
.cellbtn.st-due        { background: var(--amb-bg); border-color: var(--amb-br); }
.cellbtn.st-due .cs    { color: var(--amb-fg); }
.cellbtn.st-upcoming   { background: var(--blu-bg); border-color: var(--blu-br); }
.cellbtn.st-upcoming .cs{ color: var(--blu-fg); }
.cellbtn.st-ok .cs     { color: var(--grn-fg); }
.cellbtn.st-unrecorded { background: var(--gry-bg); border-style: dashed; }
.cellbtn.st-unrecorded .cs { color: var(--gry-fg); }

/* The one authored motion: filtering dims what falls out of scope
   rather than removing it, so the estate never loses its shape. */
.cellbtn.dimmed { opacity: .28; filter: saturate(.15); }
.matrix tbody tr.dimmed { opacity: .42; }

/* ---------------------------------------------------------------------------
   Badges and pills
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 7px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.st-overdue    { background: var(--red-bg); border-color: var(--red-br); color: var(--red-fg); --dot: var(--red-dot); }
.badge.st-due        { background: var(--amb-bg); border-color: var(--amb-br); color: var(--amb-fg); --dot: var(--amb-dot); }
.badge.st-upcoming   { background: var(--blu-bg); border-color: var(--blu-br); color: var(--blu-fg); --dot: var(--blu-dot); }
.badge.st-ok         { background: var(--grn-bg); border-color: var(--grn-br); color: var(--grn-fg); --dot: var(--grn-dot); }
.badge.st-unrecorded { background: var(--gry-bg); border-color: var(--gry-br); color: var(--gry-fg); --dot: var(--gry-dot); }
.badge .dot { width: 6px; height: 6px; box-shadow: none; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 550;
  background: var(--n100); color: var(--n600); border: 1px solid var(--n200);
}
.tag.mono { font-family: var(--mono); font-size: 11px; font-weight: 450; }

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 550; letter-spacing: -0.005em;
  border: 1px solid var(--n200); background: var(--n0); color: var(--n800);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sh1);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: var(--n50); border-color: var(--n300); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn svg { color: var(--n500); }

.btn-primary {
  background: linear-gradient(180deg, var(--a500), var(--a600));
  border-color: var(--a700); color: #fff;
  box-shadow: var(--sh1), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--a500), var(--a700)); border-color: var(--a700); }
.btn-primary svg { color: rgba(255,255,255,.85); }

.btn-danger { color: var(--red-fg); border-color: var(--red-br); background: var(--n0); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-dot); }
.btn-danger svg { color: var(--red-fg); }

.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--n100); border-color: transparent; }

.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 10px 18px; font-size: 14.5px; }
.btn-block { width: 100%; }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; box-shadow: none; transform: none;
}
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy .spin { display: inline-block; }
.spin {
  display: none; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.field { margin-bottom: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label.lbl {
  display: block; font-size: 12.5px; font-weight: 560;
  color: var(--n700); margin-bottom: 5px;
}
.lbl .opt { color: var(--n500); font-weight: 450; }

.input, .select, .textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--n300); border-radius: var(--radius);
  background: var(--n0); color: var(--n900); font-size: 13.5px;
  box-shadow: 0 1px 2px rgba(13,18,28,.04);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--n400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--a500); box-shadow: var(--ring);
}
.input::placeholder, .textarea::placeholder { color: var(--n500); }
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--n100); color: var(--n500); cursor: not-allowed;
}
.textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7488' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8 10 12.5 14.5 8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
/* A native date field sits a few pixels shorter than a text input and brings
   the OS calendar button with it. Match the box, theme the button. */
input[type="date"].input {
  min-height: 38px; line-height: 1.35;
}
input[type="date"].input::-webkit-calendar-picker-indicator {
  width: 15px; height: 15px; padding: 3px; margin-right: -2px;
  border-radius: 5px; opacity: .5; cursor: pointer;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}
input[type="date"].input::-webkit-calendar-picker-indicator:hover {
  opacity: 1; background: var(--n100);
}

/* File picker. The native control renders "Choose File / No file chosen" in
   OS metrics next to buttons that were drawn — the loudest assembled-not-built
   tell on the form the evaluator actually clicks into. */
.filepick {
  display: flex; align-items: center; gap: 11px; padding: 7px 9px;
  border: 1px dashed var(--n300); border-radius: var(--radius);
  background: var(--n25); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.filepick:hover { border-color: var(--a400); background: var(--a50); }
.filepick-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--n300); background: var(--n0);
  font-size: 12.5px; font-weight: 550; color: var(--n800);
  box-shadow: var(--sh1);
}
.filepick-btn svg { color: var(--n500); }
.filepick-name {
  font-size: 12.5px; color: var(--n500); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filepick-name.has-file { color: var(--n800); font-weight: 500; }
.filepick input:focus-visible + .filepick-btn {
  outline: 2px solid var(--a600); outline-offset: 2px;
}

.help { font-size: 12px; color: var(--n500); margin-top: 5px; }
.err-text { font-size: 12px; color: var(--red-fg); margin-top: 5px; font-weight: 500; }
.input[aria-invalid="true"] { border-color: var(--red-dot); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217,45,32,.2); }

.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--n400); }
.searchbox .input { padding-left: 33px; }

.filebox {
  display: flex; align-items: center; gap: 12px; padding: 13px;
  border: 1px dashed var(--n300); border-radius: var(--radius);
  background: var(--n25);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.filebox:hover { border-color: var(--a400); background: var(--a50); }
.filebox input[type="file"] { font-size: 12.5px; min-width: 0; }
.filebox input[type="file"]::file-selector-button {
  font: inherit; font-size: 12.5px; font-weight: 550; margin-right: 10px;
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--n300); background: var(--n0); color: var(--n800); cursor: pointer;
}
.filebox input[type="file"]::file-selector-button:hover { background: var(--n50); }

/* ---------------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------------- */
.tbl thead th {
  padding: 9px 14px; text-align: left;
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--n500);
  border-bottom: 1px solid var(--n200); background: var(--n25);
  white-space: nowrap;
}
.tbl thead th:first-child { padding-left: 18px; }
.tbl thead th:last-child { padding-right: 18px; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--n150); vertical-align: top; }
.tbl tbody td:first-child { padding-left: 18px; }
.tbl tbody td:last-child { padding-right: 18px; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--n25); }
.tbl .right { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.t-strong { font-weight: 550; color: var(--n900); }
.t-muted { color: var(--n500); font-size: 12.5px; }

/* ---------------------------------------------------------------------------
   Attention list
   --------------------------------------------------------------------------- */
.att { display: flex; flex-direction: column; }
.att-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--n150);
  text-decoration: none; color: inherit;
  transition: background var(--dur) var(--ease);
}
.att-row:last-child { border-bottom: none; }
.att-row:hover { background: var(--n25); text-decoration: none; }
.att-rule { width: 1px; align-self: stretch; background: var(--n200); flex: none; }
.att-row.st-overdue .att-rule { background: var(--red-dot); }
.att-row.st-due .att-rule { background: var(--amb-dot); }
.att-row.st-upcoming .att-rule { background: var(--blu-dot); }
.att-row.st-unrecorded .att-rule { background: var(--gry-dot); }
.att-main { min-width: 0; flex: 1; }
.att-title { font-weight: 560; color: var(--n900); font-size: 13.5px; }
.att-meta { display: block; font-size: 12.5px; color: var(--n500); margin-top: 1px; }
.att-when { text-align: right; white-space: nowrap; }
.att-date { font-size: 13px; font-weight: 550; color: var(--n800); }
.att-rel { font-size: 12px; margin-top: 1px; }
.att-row.st-overdue .att-rel { color: var(--red-fg); font-weight: 550; }
.att-row.st-due .att-rel { color: var(--amb-fg); font-weight: 550; }
.att-row.st-upcoming .att-rel { color: var(--n500); }
.att-row.st-unrecorded .att-rel { color: var(--n500); }
.att-go { color: var(--n450); flex: none; }
.att-row:hover .att-go { color: var(--n600); }

/* ---------------------------------------------------------------------------
   Discipline list on the site page
   --------------------------------------------------------------------------- */
.disc-row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding: 15px 18px; border-bottom: 1px solid var(--n150);
  align-items: center;
}
.disc-row:last-child { border-bottom: none; }
.disc-row:hover { background: var(--n25); }
.disc-name {
  display: flex; align-items: center; gap: 9px;
  font-weight: 560; font-size: 13.5px; color: var(--n900);
}
.disc-std {
  font-family: var(--mono); font-size: 10.5px; color: var(--n600);
  background: var(--n100); border: 1px solid var(--n200);
  border-radius: 4px; padding: 0 5px;
}
.disc-facts {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  font-size: 12.5px; color: var(--n500); margin-top: 5px;
}
.disc-facts b { color: var(--n700); font-weight: 550; }
.disc-end { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------------------
   Notices
   --------------------------------------------------------------------------- */
.notice {
  display: flex; gap: 11px; padding: 12px 14px;
  border: 1px solid var(--n200); border-radius: var(--radius-md);
  background: var(--n25); font-size: 13px; color: var(--n700);
  margin-bottom: 18px;
}
.notice svg { flex: none; margin-top: 1px; color: var(--n500); }
.notice b { color: var(--n900); font-weight: 600; }
.notice.ok    { background: var(--grn-bg); border-color: var(--grn-br); color: #05603a; }
.notice.ok svg, .notice.ok b { color: #05603a; }
.notice.warn  { background: var(--amb-bg); border-color: var(--amb-br); color: #93370d; }
.notice.warn svg, .notice.warn b { color: #93370d; }
.notice.bad   { background: var(--red-bg); border-color: var(--red-br); color: #912018; }
.notice.bad svg, .notice.bad b { color: #912018; }
.notice.info  { background: var(--blu-bg); border-color: var(--blu-br); color: #194185; }
.notice.info svg, .notice.info b { color: #194185; }

.empty { padding: 44px 24px; text-align: center; }
.empty-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md); margin: 0 auto 13px;
  background: var(--n100); color: var(--n400);
  display: grid; place-items: center; border: 1px solid var(--n200);
}
.empty h3 { margin-bottom: 4px; }
.empty p { color: var(--n500); font-size: 13px; max-width: 42ch; margin: 0 auto; }

/* ---------------------------------------------------------------------------
   Login
   --------------------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(900px 500px at 50% -10%, var(--a50), transparent 65%),
    var(--n50);
}
.auth { width: 100%; max-width: 388px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 22px; font-weight: 650; font-size: 16px;
  letter-spacing: -0.03em; color: var(--n900);
}
.auth-card {
  background: var(--n0); border: 1px solid var(--n200);
  border-radius: var(--radius-lg); box-shadow: var(--sh3); padding: 26px 24px 24px;
}
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .page-sub { margin-bottom: 20px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--n500); }
.auth-family { margin-top: 8px; font-size: 11.5px; color: var(--n450); letter-spacing: .01em; }

/* ---------------------------------------------------------------------------
   Email preview
   --------------------------------------------------------------------------- */
.mailframe {
  width: 100%; height: 640px; border: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: #f3f4f6; display: block;
}
.mail-meta {
  display: grid; grid-template-columns: 78px 1fr; gap: 4px 14px;
  font-size: 12.5px; padding: 14px 18px; border-bottom: 1px solid var(--n150);
  background: var(--n25);
}
.mail-meta dt { color: var(--n500); font-weight: 550; }
.mail-meta dd { color: var(--n800); margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------------- */
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.stack-sm > * + * { margin-top: 9px; }
.mt-20 { margin-top: 20px; }
.muted { color: var(--n500); }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--n0); border: 1px solid var(--n300); border-radius: var(--radius);
  padding: 9px 14px; font-weight: 550; box-shadow: var(--sh2);
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: 12px; }

.demo-flag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--amb-fg); background: var(--amb-bg);
  border: 1px solid var(--amb-br); border-radius: 5px; padding: 2px 7px;
}

.footer {
  border-top: 1px solid var(--n200); background: var(--n0);
  padding: 18px 24px; font-size: 12.5px; color: var(--n500);
}
.footer-in {
  max-width: var(--page-max); margin: 0 auto;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.footer-in .sep { color: var(--n300); }

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip-seg:nth-child(3) { border-left: none; }
  .strip-seg:nth-child(n+3) { border-top: 1px solid var(--n150); }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page { padding: 20px 15px 56px; }
  .topbar-in { padding: 0 15px; }
  .nav { margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 7px 9px; }
  .who-name, .who-role { display: none; }
  .who { padding-left: 8px; }
  .strip-count { font-size: 22px; }
  .disc-row { grid-template-columns: 1fr; }
  .disc-end { justify-content: space-between; }
  /* flex-wrap alone does not save this: the badge and the date keep their
     intrinsic widths and crush the title to ~90px, wrapping every site name
     over seven lines. An explicit grid gives the title the full width and
     drops the metadata onto its own row. */
  .att-row {
    display: grid; flex-wrap: nowrap;
    grid-template-columns: 1px 1fr auto;
    grid-template-areas: "rule main go" "rule meta go";
    gap: 6px 12px; align-items: center; padding: 14px 15px;
  }
  .att-rule { grid-area: rule; }
  .att-main { grid-area: main; }
  .att-row > .badge { grid-area: meta; justify-self: start; }
  .att-when {
    grid-area: meta; justify-self: end; text-align: right;
    display: flex; align-items: baseline; gap: 7px;
  }
  .att-when br { display: none; }
  .att-go { grid-area: go; }

  .page-head-actions { width: 100%; margin-left: 0; }
  .page-head-actions .btn { flex: 1; }

  /* Data tables keep their shape and scroll, rather than breaking a filename
     over five lines in a 70px column. */
  .tbl { min-width: 620px; }

  /* The sticky identity column is right on a desktop and wrong on a phone: at
     300px it holds three quarters of the viewport and leaves no grid to scroll.
     Down here it carries the branch name only. */
  .matrix thead th.mx-site, .matrix .mx-site-cell { width: 132px; max-width: 132px; }
  .matrix thead th.mx-site { padding-left: 12px; }
  .mx-site-cell { padding-left: 12px; padding-right: 6px; }
  .mx-site-cell .site-group, .mx-site-cell .mx-site-meta { display: none; }
  .mx-site-name { font-size: 12.5px; line-height: 1.35; }

  /* The head's hint is a desktop luxury; on a phone the heading and the
     control it belongs to are what matter. */
  .panel-head .hint { display: none; }
  .panel-head-end { margin-left: 0; width: 100%; }
  .panel-head-end .searchbox { width: 100%; }
  .panel-head-end .searchbox .input { width: 100% !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
   Compliance pack — a document, not a screen. Print is the primary medium.
   --------------------------------------------------------------------------- */
.pack-body { background: var(--n100); }
.pack {
  max-width: 900px; margin: 28px auto 60px; background: var(--n0);
  border: 1px solid var(--n200); border-radius: var(--radius-lg);
  box-shadow: var(--sh2); padding: 36px 44px 32px;
}
.pack-toolbar { display: flex; justify-content: space-between; gap: 10px; margin: -8px 0 24px; }
.pack-head {
  display: flex; justify-content: space-between; gap: 28px; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 2px solid var(--n900); margin-bottom: 18px;
}
.pack-brand {
  display: flex; align-items: center; gap: 7px;
  font-weight: 650; font-size: 13.5px; letter-spacing: -0.03em;
  color: var(--n900); margin-bottom: 14px;
}
.pack-brand svg { width: 17px; height: 17px; }
.pack-brand span { font-weight: 450; color: var(--n500); }
.pack h1 { font-size: 22px; margin-bottom: 6px; }
.pack-sub { font-size: 16px; font-weight: 600; color: var(--n900); }
.pack-addr { font-size: 13px; color: var(--n500); margin-top: 2px; }
.pack-meta {
  display: grid; grid-template-columns: auto auto; gap: 5px 14px; font-size: 12.5px;
  flex: none; margin: 0;
}
.pack-meta dt { color: var(--n500); font-weight: 550; }
.pack-meta dd { margin: 0; color: var(--n800); text-align: right; }
.pack-summary { font-size: 14px; color: var(--n800); margin: 0 0 22px; line-height: 1.6; }
.pack h2 {
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--n500); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--n200);
}
.pack h3 { font-size: 13.5px; margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.pack-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pack-table th {
  text-align: left; font-size: 10.5px; font-weight: 650; letter-spacing: .05em;
  text-transform: uppercase; color: var(--n500); padding: 6px 8px 7px;
  border-bottom: 1px solid var(--n200);
}
.pack-table td { padding: 9px 8px; border-bottom: 1px solid var(--n150); vertical-align: top; }
/* A standards number or an interval split across two lines reads as two
   things. Keep the short tokens whole; the notes column can absorb the width. */
.pack-table td.mono, .pack-table td.keep { white-space: nowrap; }
.pack-table tr:last-child td { border-bottom: none; }
.pack-history { font-size: 12px; }
.pack-muted { color: var(--n500); font-size: 11.5px; margin-top: 2px; }
.pack-warn { color: var(--amb-fg); font-weight: 600; font-size: 11.5px; margin-top: 2px; }
.pack-foot {
  margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--n200);
  font-size: 11px; color: var(--n500); line-height: 1.6;
}
.pack-foot > div + div { margin-top: 4px; }
.pack-demo { color: var(--red-fg); font-weight: 600; }

/* Remedials state on the item history and site pages */
.rem-open { color: var(--amb-fg); font-weight: 600; font-size: 12px; }
.rem-closed { color: var(--n500); font-size: 12px; }

@media print {
  .no-print, .pack-toolbar { display: none !important; }
  .pack-body { background: #fff; }
  .pack {
    max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; border-radius: 0;
  }
  .pack-table { page-break-inside: auto; }
  .pack-table tr { page-break-inside: avoid; }
  .pack h2, .pack h3 { page-break-after: avoid; }
  .badge { border: 1px solid currentColor; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge .dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 16mm 14mm; }
}

@media print {
  .topbar, .footer, .page-head-actions, .btn { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; break-inside: avoid; }
}
