/* Silent Eye operations console: Bootstrap 5 themed by its own variables (ui-design §5).
   No build step. One token block (the first :root): every colour, space, radius and type size is
   declared there and used by name everywhere else (NFR-10). Loaded after bootstrap.min.css. */

/* Inter, Latin, one variable file for every weight (decision 0041). `swap` shows the text at once in the
   system font and switches when the file arrives. The URL is relative to this stylesheet; the version is in the
   file name, so an upgrade is a new URL. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("vendor/inter-5.3.0-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colour. Brand maroon is the only accent; the status colours are for status only. 6-digit hex, because
     portal/tests/test_look.py and console/tests/test_stylesheet.py compute contrast from these lines. */
  --brand: #700808;
  --brand-rgb: 112, 8, 8;
  --brand-hover: #590606;
  --on-brand: #ffffff;
  --page: #f4f4f9;
  --surface: #ffffff;
  --text: #212529;
  /* Muted text needs 4.5:1 on the page grey as well as on white. */
  --text-muted: #5c636a;
  --border: #dee2e6;
  /* A control's edge needs 3:1 against the page and white (WCAG 1.4.11); Bootstrap's grey-300 is 1.2:1. */
  --control-border: #6c757d;
  /* Red text on the page grey needs a darker red than Bootstrap's to reach 4.5:1. */
  --danger-text: #b02a37;
  --neutral-text: #495057;
  --neutral-bg: #e9ecef;
  --info-text: #0a4a7a;
  --info-bg: #e1eefb;
  --ok-text: #0f5a26;
  --ok-bg: #e2f3e7;
  --warn-text: #6b4500;
  --warn-bg: #fdf1d6;
  /* The only shadow: a dialog lifted off the page. */
  --shadow-dialog: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);

  /* Space, radius and type scales. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  /* The size of a touch target (NFR-9). */
  --touch: 2.75rem;
  --tabs-height: 3.5rem; /* the phone's bottom tab bar */
  --sidebar-width: 15rem;

  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-danger-rgb: 176, 42, 55;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-hover);
  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-border-color: var(--border);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-font-sans-serif: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: var(--text-sm);
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-hover);
  --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
}

.card { --bs-card-border-radius: var(--radius-lg); --bs-card-border-color: var(--border); }
.modal { --bs-modal-border-radius: var(--radius-lg); }
.modal-content { box-shadow: var(--shadow-dialog); }

/* An icon from the sprite sits on the text line at the text's size and takes its colour (decision 0040). */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.tap-link, .btn { gap: var(--space-1); }

/* Every number lines up in columns (ui-design §5). */
.num, .table td.num, .table th.num, .stat-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Layout: sidebar, top bar, content (ui-design §4). */
.console { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; min-height: 100dvh; }
.console-nav { background: var(--surface); border-right: 1px solid var(--border); padding: var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.console-brand { font-weight: 600; color: var(--brand); padding: var(--space-1) var(--space-3) var(--space-4); text-decoration: none; display: flex; align-items: center; gap: var(--space-2); }
.console-brand .brand-logo { height: 2.25rem; width: auto; flex: none; }
.console-nav .nav-link { color: var(--text); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); display: flex; gap: var(--space-3); align-items: center; }
.console-nav .nav-link:hover { background: var(--page); }
.console-nav .nav-link.active { background: var(--brand); color: var(--on-brand); }
.console-nav .nav-admin { margin-top: auto; border-top: 1px solid var(--border); padding-top: var(--space-3); }
.console-main { min-width: 0; display: flex; flex-direction: column; }
.console-top { background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--space-2) var(--space-5); display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.console-content { padding: var(--space-5); }
.page-title { font-size: var(--text-lg); font-weight: 600; margin: 0 0 var(--space-4); }
.console-tabs { display: none; }

.toast-area { position: fixed; top: var(--space-4); right: var(--space-4); z-index: 1090; display: flex; flex-direction: column; gap: var(--space-2); }

/* Three layouts (NFR-6, decision 0043): the sidebar with labels from 1100 px; an icon rail from 768 px, where a
   label stays in the page for a screen reader but is not drawn; under 768 px the sidebar is gone and a fixed
   bottom bar (Dashboard, Payroll, Payslips, Employees, More) takes its place. */
@media (max-width: 1099.98px) {
  .console { grid-template-columns: 4rem 1fr; }
  .console-nav .nav-label, .console-brand .brand-name {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .console-nav .nav-link { justify-content: center; padding-inline: var(--space-1); }
  .console-brand { justify-content: center; padding-inline: 0; }
}
@media (max-width: 767.98px) {
  .console { grid-template-columns: 1fr; }
  .console-nav { display: none; }
  /* The top bar stays in view and keeps clear of a notch; the bar below it keeps clear of the home indicator. */
  .console-top {
    position: sticky; top: 0; z-index: 1020;
    padding: calc(var(--space-2) + env(safe-area-inset-top)) calc(var(--space-3) + env(safe-area-inset-right))
      var(--space-2) calc(var(--space-3) + env(safe-area-inset-left));
    gap: var(--space-2);
  }
  /* One row of period and account: the period's select takes what is left, it does not fix a width. The sidebar's
     brand is not repeated here: the Dashboard tab goes home. */
  .console-top > div:first-child { flex: 1 1 0; min-width: 9rem; }
  .console-top form { flex: 1 1 auto; min-width: 0; }
  .console-top .form-select { flex: 1 1 auto; min-width: 0; padding-right: 1.75rem; }
  .console-content {
    padding: var(--space-4) calc(var(--space-4) + env(safe-area-inset-right))
      calc(var(--tabs-height) + env(safe-area-inset-bottom) + var(--space-5)) calc(var(--space-4) + env(safe-area-inset-left));
  }
  /* A focused control is scrolled clear of the bar, not left under it (WCAG 2.2, 2.4.11). */
  html { scroll-padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + var(--space-4)); scroll-padding-top: 4rem; }

  .console-tabs {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .console-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
    min-height: var(--tabs-height); padding: var(--space-1) 0;
    background: none; border: 0; color: var(--text-muted); font-size: var(--text-xs); text-decoration: none;
  }
  .console-tab .icon { width: 1.5rem; height: 1.5rem; }
  .console-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .console-tab.active { color: var(--brand); font-weight: 600; }
  /* A message sits above the bar, not under it. */
  .toast-area {
    top: auto; left: var(--space-4); right: var(--space-4);
    bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + var(--space-3));
  }
  /* The More sheet lists the sections the bar has no room for. */
  /* Without the script the More tab is a link to this sheet: the address shows it. */
  #console-more:target { visibility: visible; transform: none; }
  .console-more { display: flex; flex-direction: column; gap: var(--space-1); }
  .console-more .nav-link { color: var(--text); border-radius: var(--radius-sm); padding: var(--space-3); gap: var(--space-3); }
  .console-more .nav-link.active { background: var(--brand); color: var(--on-brand); }
  .offcanvas-body { padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
}
/* On the narrowest screens the period's label and the account's name are not drawn (a screen reader still has them). */
@media (max-width: 575.98px) {
  .period-label, .account-name, .top-action-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
}

/* Touch (NFR-9): a target is at least 44 px and a text input is 16 px, because iOS Safari zooms the page into
   any input set smaller. One query for both: a coarse pointer, or a narrow screen. The width alternative is
   deliberate, so a browser that does not know `pointer` still gets the rule (decision 0042). A link inside a
   sentence is exempt; a link on its own, a `.tap-link`, is not. */
@media (pointer: coarse), (max-width: 767.98px) {
  .btn, .form-control, .form-select, .nav-link, .dropdown-item, .tap-link, .tap-check {
    min-height: var(--touch);
  }
  .btn, .tap-link, .tap-check { display: inline-flex; align-items: center; }
  .btn { min-width: var(--touch); justify-content: center; }
  .nav-link, .dropdown-item { display: flex; align-items: center; }
  .tap-check, .top-action { min-width: var(--touch); justify-content: center; }
  .form-control, .form-select,
  .portal-form input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"]),
  .auth-card input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"]) {
    font-size: var(--text-base);
    min-height: var(--touch);
  }
  .form-check { min-height: var(--touch); display: flex; align-items: center; gap: var(--space-3); padding-left: 0; }
  .form-check .form-check-input { float: none; margin: 0; flex: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .console-nav .nav-link, .btn { transition: background-color 150ms ease, color 150ms ease; }
}

.entry-input { width: 5.5rem; margin-left: auto; }
.entry-input[readonly] { background-color: transparent; border-color: transparent; }
/* An error under the name would otherwise wrap to a word a line in the narrow name column. */
.entry-error { min-width: 11rem; }

.confirm-card { max-width: 40rem; }

/* The edge of every control is visible (ui-design §11). */
.form-control, .form-select, .form-check-input { border-color: var(--control-border); }

.btn-outline-danger {
  --bs-btn-color: var(--danger-text);
  --bs-btn-border-color: var(--danger-text);
  --bs-btn-hover-bg: var(--danger-text);
  --bs-btn-hover-border-color: var(--danger-text);
  --bs-btn-active-bg: var(--danger-text);
  --bs-btn-active-border-color: var(--danger-text);
}

/* The focus ring is always visible: 2 px brand with a white gap (ui-design §11, NFR-6). */
:focus-visible,
.nav-link:focus-visible, .btn:focus-visible,
.form-control:focus, .form-select:focus, .form-check-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: none; /* Bootstrap's own ring is a 25 % blue glow, about 1.3:1 on white */
}

/* Employee portal (work item 006, NFR-8): the same tokens, phone first. */
.portal-nav { background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-nav .navbar-brand { font-weight: 600; color: var(--brand); }
.portal-nav .nav-link { color: var(--text); padding-block: var(--space-3); }
.portal-nav .nav-link.active { color: var(--brand); font-weight: 600; }
.portal-nav .container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.portal-links { display: none; margin-inline-end: auto; }
.portal-links .nav-link { padding-inline: var(--space-3); }
.portal-account { display: flex; align-items: center; gap: var(--space-3); margin-inline-start: auto; }
@media (min-width: 768px) {
  .portal-links { display: flex; gap: var(--space-1); }
  .portal-account { margin-inline-start: 0; }
}
@media (max-width: 767.98px) {
  /* The four sections are in the bar at the foot; the top bar keeps the brand and Logout. The footer clears the bar. */
  .portal-nav { position: sticky; top: 0; z-index: 1020; padding-top: env(safe-area-inset-top); }
  .portal-foot { padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + var(--space-3)) !important; }
  .portal-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html { scroll-padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom) + var(--space-4)); scroll-padding-top: 4rem; }
}
.portal-main { padding-block: var(--space-5); }
.portal-narrow { max-width: 28rem; margin-inline: auto; }
.portal-foot { border-top: 1px solid var(--border); color: var(--text-muted); }

/* Django's own password forms render bare inputs; style them like .form-control. */
.portal-form input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"]) {
  display: block; width: 100%; padding: var(--space-2) var(--space-3); font: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
}
.portal-form .helptext, .portal-form ul { color: var(--text-muted); }
.portal-form .errorlist { color: var(--danger-text); list-style: none; padding: 0; margin: var(--space-1) 0 0; }

/* A label and its value, side by side where there is room, wrapping on a phone. */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.detail-list dt { font-weight: 600; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .detail-list { grid-template-columns: 1fr; gap: 0; }
  .detail-list dd { margin-bottom: var(--space-2); }
}
.net-pay { background: var(--brand); color: var(--on-brand); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; }
.net-pay .amount { font-size: var(--text-xl); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Sign-in pages (employee, staff, code, password reset): one centred card, no navigation, a flat page. */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--page); }
.auth-shell { margin: auto; width: 100%; max-width: 25rem; padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; align-items: stretch; }
.auth-brand { text-align: center; margin-bottom: var(--space-5); }
.auth-brand img { display: block; margin: 0 auto var(--space-3); height: 4rem; width: auto; }
.auth-brand-name { font-size: var(--text-lg); font-weight: 700; letter-spacing: 0.02em; color: var(--text); }
.auth-brand-sub { font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-top: 0.125rem; }
.auth-card { --bs-card-border-width: 1px; border-radius: var(--radius-lg); }
.auth-card .card-body { padding: var(--space-6) var(--space-5); }
.auth-title { font-size: var(--text-lg); font-weight: 600; margin: 0 0 var(--space-1); text-align: center; }
.auth-lead { text-align: center; color: var(--text-muted); margin: 0 0 var(--space-4); }
.auth-card .form-label { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.auth-card input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"]) {
  display: block; width: 100%; padding: var(--space-3); font: inherit; font-size: var(--text-base);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
}
.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18); outline: 0; }
.auth-card .btn { padding: var(--space-3) var(--space-4); font-weight: 600; border-radius: var(--radius-sm); }
.auth-card .errorlist { color: var(--danger-text); list-style: none; padding: 0; margin: var(--space-1) 0 0; }
.auth-card .alert { font-size: var(--text-sm); }
.auth-below { text-align: center; margin: var(--space-4) 0 0; }
.auth-below a { font-weight: 600; text-decoration: none; }
.auth-below a:hover { text-decoration: underline; }
.auth-below:empty { display: none; }
.auth-foot { text-align: center; color: var(--text-muted); font-size: var(--text-xs); margin: var(--space-5) 0 0; }
.auth-title { margin-bottom: var(--space-4); }
.auth-title:has(+ .auth-lead) { margin-bottom: var(--space-1); }

/* The totals above a table: a line on a wide screen, two columns on a phone. */
.totals-strip { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); align-items: baseline; }

/* Payroll workspace (FR-3.8.12, decision 0043). From 768 px it is one table. Under 768 px the same markup is laid
   out as a card for each entry: name and station on the left, net pay on the right, the five inputs two to a row
   with their labels, then basic, gross and deductions. Each cell names its column in `data-label`. */
.entries-table { background: var(--surface); }
.workspace-filters .filter-search { flex: 1 1 14rem; max-width: 22rem; }
/* The label of an input is the column heading above it, so on a wide screen it is not drawn (the screen reader has it). */
.entry-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.not-saved {
  display: inline-block; margin-left: var(--space-2); padding: 0 var(--space-2); border-radius: var(--radius-sm);
  background: var(--warn-bg); color: var(--warn-text); font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
}
@media (max-width: 767.98px) {
  .totals-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1) var(--space-4); }
  .totals-strip .num { white-space: normal; overflow-wrap: anywhere; }
  .totals-strip > :first-child { grid-column: 1 / -1; }
  .entries-wrap { overflow-x: visible; } /* a card does not scroll sideways: nothing in it is wider than the screen */
  .entries-table, .entries-table tbody { display: block; }
  .entries-table td.num { white-space: normal; overflow-wrap: anywhere; }
  .entries-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .entries-table.table tbody tr {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2) var(--space-3);
    padding: var(--space-3); margin-bottom: var(--space-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .entries-table.table tbody tr[data-unsaved] { border-color: var(--warn-text); }
  .entries-table.table td, .entries-table.table th[scope="row"] {
    display: block; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  .entries-table.table th[scope="row"] { grid-column: 1 / 4; grid-row: 1; font-size: var(--text-base); font-weight: 600; }
  .entries-table.table td[data-label="Station"] { grid-column: 1 / 4; grid-row: 2; color: var(--text-muted); }
  .entries-table.table td[data-field="net_pay"] { grid-column: 4 / 7; grid-row: 1 / 3; font-size: var(--text-lg); font-weight: 600; }
  .entries-table.table td.has-input, .entries-table.table td[data-field="days_worked"],
  .entries-table.table td[data-field="overtime"], .entries-table.table td[data-field="advances"],
  .entries-table.table td[data-field="uniform_deduction"], .entries-table.table td[data-field="other_deductions"] { grid-column: span 3; }
  .entries-table.table td[data-field="prorated_basic_salary"] { grid-column: 1 / 3; grid-row: 6; }
  .entries-table.table td[data-field="gross_pay"] { grid-column: 3 / 5; grid-row: 6; }
  .entries-table.table td[data-field="total_deductions"] { grid-column: 5 / 7; grid-row: 6; }
  /* A figure that is not an input names itself above its value; an input has a real label. */
  .entries-table td[data-field]:not(.has-input)::before {
    content: attr(data-label); display: block; font-size: var(--text-xs); font-weight: 400; color: var(--text-muted);
  }
  .entry-label {
    position: static; display: block; width: auto; height: auto; margin: 0 0 var(--space-1); overflow: visible;
    clip: auto; white-space: normal; font-size: var(--text-xs); color: var(--text-muted);
  }
  .entry-input { width: 100%; margin-left: 0; }
  .entry-error { min-width: 0; }
}

/* A confirmation (process, lock, create entries, new period): the sentence, the count and totals, then the buttons.
   Under 768 px the buttons are full width and stacked, Cancel first, so the default choice is the safe one. */
.confirm-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.confirm-month { width: auto; }
@media (max-width: 767.98px) {
  .confirm-card .card-body { padding: var(--space-4); }
  .confirm-actions { flex-direction: column; align-items: stretch; }
  .confirm-actions .btn { width: 100%; justify-content: center; }
  .confirm-month { width: 100%; }
}

/* "Sign in again" dialog (decision 0024): inside the screen, its buttons within reach (US1 AC6). */
.session-ended {
  width: 28rem; max-width: calc(100% - 2 * var(--space-4)); max-height: calc(100% - 2 * var(--space-4)); overflow: auto;
  padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog);
}
.session-ended-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 767.98px) {
  .session-ended-actions { flex-direction: column; }
  .session-ended-actions .btn { width: 100%; justify-content: center; }
}

/* Every other table (decision 0043): the same markup as a card under 768 px. A cell names its column in `data-label`;
   the cell that is the card's title (`reflow-title`) and the ones that need no name (`no-label`) do not show it. */
.tap-check { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.status-badge { display: inline-flex; align-items: center; gap: var(--space-1); }
/* A figure in a definition list may wrap at a large text size rather than push the page sideways. */
dd.num { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.form-select { max-width: 100%; }
.stat-value { font-size: clamp(1.0625rem, 4.6vw, 1.5rem); overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 767.98px) {
  .filters > div { flex: 1 1 10rem; }
  .filters .form-select, .filters .form-control { width: 100%; }
  .reflow, .reflow tbody { display: block; }
  .reflow thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .reflow tbody tr {
    display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3);
    margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .reflow td {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3);
    padding: var(--space-1) 0; border: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; background: none;
  }
  .reflow td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--text-sm); text-align: left; flex: none; }
  .reflow td.no-label::before { content: none; }
  .reflow td.reflow-title { font-weight: 600; text-align: left; justify-content: flex-start; }
  .reflow td.reflow-check + td.reflow-title { grid-column: 2; grid-row: 1; }
  .reflow td.reflow-check { grid-column: 1; grid-row: 1; padding: 0; }
  .reflow td.reflow-block { flex-direction: column; align-items: stretch; text-align: left; }
  .reflow td.reflow-actions { justify-content: flex-start; flex-wrap: wrap; text-align: left; padding-top: var(--space-2); }
  .reflow td[colspan] { display: block; text-align: left; }
  .reflow td[colspan]::before { content: none; }
  .reflow td .tap-link { margin-left: var(--space-3); }
}

/* Forced high contrast (Windows contrast themes): the system drops backgrounds and glows, so the current section is
   underlined and the focused sign-in input gets a ring. Colours are left to the system. */
@media (forced-colors: active) {
  .console-nav .nav-link.active, .console-more .nav-link.active, .console-tab.active, .portal-nav .nav-link.active {
    text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 2px;
  }
  .auth-card input:focus { outline: 2px solid; outline-offset: 2px; }
}
