/* =====================================================================
   Agent & Staff Governance — design system
   A restrained, document/ledger-inspired palette: warm paper surfaces,
   deep ink text, a single brass accent reserved for primary actions
   and focus states. One variable typeface used throughout; its width
   axis differentiates dense tabular contexts from display headings
   instead of introducing a second family.
   ===================================================================== */

@font-face {
  font-family: 'Instrument Sans Variable';
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 380 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans Variable';
  src: url('/fonts/instrument-sans-latin-wght-italic.woff2') format('woff2-variations');
  font-weight: 380 800;
  font-style: italic;
  font-display: swap;
}

/* Inter (the Enterprise theme's typeface), served locally like Instrument Sans. */
@font-face {
  font-family: 'Inter Variable';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Variable';
  src: url('/fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Base tokens. The signed-in company's theme (System → Themes, src/lib/themes.js)
   overrides these per company through <style id="company-theme">; the palette
   picker's other choices override them per person. */
:root {
  /* Color */
  --ink-900: #12182a;
  --ink-700: #3c4557;
  --ink-500: #5a6679;
  --ink-300: #9aa1b2;
  --paper-0: #faf9f5;
  --paper-100: #f2efe6;
  --paper-200: #eae5d6;
  --line: #ded8c6;
  --line-strong: #c3bca4;
  --white: #ffffff;

  --brass-700: #6e4a18;
  --brass-600: #8b5e1f;
  --on-sheet: #111;  /* ink on the paper sheet (letters): stays dark in every theme */
  --brass-500: #a5731f;
  --brass-100: #f3e6cc;
  --brass-050: #faf3e4;

  --green-600: #2e6b4e;
  --green-100: #e1efe6;
  --red-600: #a23b34;
  --red-100: #f6e4e1;
  --amber-600: #9c6b14;
  --amber-100: #f3e8ce;
  --blue-600: #33587a;
  --blue-100: #e5edf4;

  /* Theme-able surfaces (see "Themes" at the end of this file) */
  --inverse-bg: #12182a;       /* sidebar, toasts, active chips */
  --sidebar-fg: #c4c9d6;
  --sidebar-muted: #98a1b8;
  --sidebar-active: rgba(139, 94, 31, 0.35);
  --on-accent: #ffffff;
  --on-inverse: #ffffff;       /* strong text on the sidebar / dark chips */
  --inverse-line: rgba(255, 255, 255, 0.08);
  --inverse-hover: rgba(255, 255, 255, 0.06);

  /* Type scale (approx. 1.2 modular) */
  --fs-11: 0.6875rem;
  --fs-13: 0.8125rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-19: 1.1875rem;
  --fs-23: 1.4375rem;
  --fs-28: 1.75rem;
  --fs-34: 2.125rem;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(18, 24, 42, 0.06);
  --shadow-md: 0 6px 20px -6px rgba(18, 24, 42, 0.18);
  --shadow-lg: 0 16px 48px -12px rgba(18, 24, 42, 0.28);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;

  /* Where the menu sits and how much room it takes (docs/MENU_LAYOUT.md). The menu is on one side of the
     screen — left, right, top or bottom (html[data-nav]) — and everything that is fixed or sticks while the
     page scrolls keeps clear of it through these, never through a number of its own.
       --menu-w   width of a side menu (0 when the menu is not at a side, or slides over the page on a small screen)
       --menu-h   height of a top / bottom menu bar (0 otherwise)
       --notif-h  height of the top bar (page title, clocks, the notification bell) — it wraps on a phone
     public/js/nav-menu.js measures the three; the values here are what a page has before the script runs. */
  --menu-w: 0px;
  --menu-h: 0px;
  --notif-h: var(--topbar-h);
  --menu-left: 0px;
  --menu-right: 0px;
  --menu-top: 0px;
  --menu-bottom: 0px;
  --stick-top: calc(var(--notif-h) + var(--menu-top));   /* where something sticky may start */
  --stick-bottom: var(--menu-bottom);                    /* … and where it must end */

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Spacing scale (Phase 6): pages take a step of this scale, never a number of their own. In rem, so it follows
     the person's text size and the browser's zoom. */
  --space-1: 0.25rem;  /* 4px  */
  --space-2: 0.5rem;   /* 8px  */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --fs-12: 0.75rem;
  --fs-15: 0.9375rem;
  --fs-18: 1.125rem;
  --fs-22: 1.375rem;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  /* Paper: always white, in every theme and in dark — behind a scan, a signature or seal, a QR code, a logo, an
     e-mail or file preview — so the picture reads as it will print. Not a surface colour (that is --white). */
  --sheet: #ffffff;

  /* Other names pages used for the same colours (Phase 6, docs/07-design-and-behavior.md § Design tokens). They were
     never defined, so their light fall-back (#fff, #2563eb, …) showed in every theme, dark included. Each now
     follows the theme's own token; a page uses the token names above, these exist so old pages follow too. */
  --primary: var(--brass-600);
  --accent-500: var(--brass-600);
  --accent-50: var(--brass-050);
  --brand-050: var(--brass-050);
  --brand-100: var(--brass-100);
  --brand-300: var(--brass-500);
  --brand-600: var(--brass-600);
  --brand-700: var(--brass-700);
  --surface: var(--white);
  --surface-2: var(--paper-100);
  --bg: var(--paper-0);
  --paper-50: var(--paper-0);
  --paper-050: var(--paper-0);
  --border: var(--line);
  --line-soft: var(--line);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --ink-600: var(--ink-700);
  --ink-400: var(--ink-500);
  --danger: var(--red-600);
  --amber-50: var(--amber-100);
  --amber-500: var(--amber-600);
  --amber-700: var(--amber-600);
  --blue-700: var(--blue-600);
  --green-700: var(--green-600);
  /* Fixed in every theme: the GPS test console (a terminal look) and the print-design preview's field marks on paper. */
  --console-bg: #0b1020;
  --console-fg: #cfe3ff;
  --console-bad: #ff7b7b;
  --mark-field-bg: #fff1a8;
  --mark-field-line: #e8cf55;
  --mark-miss-bg: #ffd4d4;
  --mark-miss-line: #d9534f;
  /* Text on a solid state colour (a red, green or amber button or count): the surface colour — white in light, and
     dark in dark, where the state colours are light. */
  --on-state: var(--white);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: var(--font-size-base, 16px); }
body {
  margin: 0;
  font-family: var(--font-sans, 'Instrument Sans Variable', system-ui, sans-serif);
  font-variation-settings: 'wght' 420;
  color: var(--ink-900);
  background: var(--paper-0);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
  font-size: var(--fs-16);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

h1, h2, h3, h4 { margin: 0; font-variation-settings: 'wght' 620; letter-spacing: -0.01em; color: var(--ink-900); }
h1 { font-size: var(--fs-34); font-variation-settings: 'wght' 640, 'wdth' 108; }
h2 { font-size: var(--fs-23); }
h3 { font-size: var(--fs-19); }
p { margin: 0 0 0.75em; color: var(--ink-700); }
a { color: var(--brass-700); text-decoration: none; }
a:hover { text-decoration: underline; }
.alert .text-sm, .alert small, .alert code, .alert .text-muted { color: inherit; }
.captcha-question { margin: 0; font-size: var(--fs-14); color: var(--ink-900); font-variation-settings: 'wght' 560; }
/* Links inside text (a table cell, a sentence, a hint) are underlined, so they are not told apart by colour alone (WCAG 1.4.1). */
p a:not(.btn), li a:not(.btn), td a:not(.btn):not(.badge), .landing-foot a, .alert a:not(.btn), .field-hint a, .text-sm a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
small, .text-sm { font-size: var(--fs-13); color: var(--ink-500); }
.text-muted { color: var(--ink-500); }
::selection { background: var(--brass-100); }

:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; padding-bottom: var(--menu-bottom); }

/* The four positions of the menu. A side menu is part of the row, so the page is exactly as wide as what is left;
   a top menu is in the flow under the top bar; a bottom menu is fixed, and the shell keeps its height free. */
html[data-nav="sidebar"] { --menu-w: var(--sidebar-w); --menu-left: var(--menu-w); }
html[data-nav="rightbar"] { --menu-w: var(--sidebar-w); --menu-right: var(--menu-w); }
html[data-nav="topbar"] { --menu-h: 46px; --menu-top: var(--menu-h); }
html[data-nav="start"], html[data-nav="drill"] { --menu-h: var(--nm-bar-h, 52px); --menu-bottom: var(--menu-h); }
html[data-nav="rightbar"] .app-shell { flex-direction: row-reverse; }
html[data-nav="rightbar"] .collapse-btn svg { transform: rotate(180deg); }
html[data-nav="rightbar"] .sidebar.is-collapsed .collapse-btn svg { transform: none; }
@media (max-width: 960px) {
  /* The side menu slides over the page: it takes no room. */
  html[data-nav="sidebar"], html[data-nav="rightbar"] { --menu-w: 0px; }
  html[data-nav="rightbar"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  html[data-nav="rightbar"] .sidebar.is-mobile-open { transform: translateX(0); }
}
/* Inside the Request Centre's panel there is no menu and no top bar. */
body.is-embedded { --menu-w: 0px; --menu-h: 0px; --notif-h: 0px; --menu-left: 0px; --menu-right: 0px; --menu-top: 0px; --menu-bottom: 0px; --stick-top: 0px; --stick-bottom: 0px; }
@media print { :root { --menu-w: 0px; --menu-h: 0px; --notif-h: 0px; --menu-left: 0px; --menu-right: 0px; --menu-top: 0px; --menu-bottom: 0px; } .app-shell { padding-bottom: 0; } }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--inverse-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.2s var(--ease), flex-basis 0.2s var(--ease);
  overflow: hidden;
  z-index: 30;
}
.sidebar.is-collapsed { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--inverse-line, rgba(255,255,255,0.08));
  white-space: nowrap;
}
.sidebar-brand img { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: #fff; flex: none; }
.sidebar-brand .brand-name { font-size: var(--fs-14); font-variation-settings: 'wght' 600; color: var(--on-inverse, #fff); overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .brand-sub { font-size: var(--fs-11); color: var(--sidebar-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group { margin-bottom: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--sidebar-fg); font-size: var(--fs-14);
  cursor: pointer; white-space: nowrap; user-select: none;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-item:hover { background: var(--inverse-hover, rgba(255,255,255,0.06)); color: var(--on-inverse, #fff); text-decoration: none; }
.nav-item.is-active { background: var(--sidebar-active); color: var(--on-inverse, #fff); box-shadow: inset 3px 0 0 var(--brass-500); }
.nav-children { margin-left: 29px; margin-top: 2px; margin-bottom: 6px; border-left: 1px solid var(--inverse-line, rgba(255,255,255,0.1)); padding-left: 12px; }
.nav-children .nav-item { padding: 7px 10px; font-size: var(--fs-13); color: var(--sidebar-muted); }
.nav-children .nav-subhead { cursor: default; font-size: var(--fs-11); text-transform: uppercase; letter-spacing: .05em; opacity: .8; padding-top: 9px; }
.nav-children .nav-subhead:hover { background: transparent; }
.nav-children .nav-item.is-active { color: var(--on-inverse, #fff); background: transparent; font-variation-settings: 'wght' 600; }
.nav-toggle { width: 16px; height: 16px; margin-left: auto; opacity: 0.6; transition: transform 0.15s var(--ease); }
.nav-group.is-open .nav-toggle { transform: rotate(90deg); }
.nav-group:not(.is-open) .nav-children { display: none; }
.sidebar.is-collapsed .brand-sub,
.sidebar.is-collapsed .brand-name,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .nav-toggle,
.sidebar.is-collapsed .nav-children { display: none; }
.sidebar.is-collapsed .nav-item { justify-content: center; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--inverse-line, rgba(255,255,255,0.08)); }
.collapse-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: #98a1b8; font-size: var(--fs-13);
  padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer;
}
.collapse-btn:hover { background: var(--inverse-hover, rgba(255,255,255,0.06)); color: var(--on-inverse, #fff); }
.collapse-btn svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.sidebar.is-collapsed .collapse-btn svg { transform: rotate(180deg); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px; background: var(--paper-0);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-size: var(--fs-16); font-variation-settings: 'wght' 600; }
.topbar-spacer { flex: 1; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--ink-700); }
.mobile-menu-btn svg { width: 22px; height: 22px; }

.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); border: 1px solid transparent; background: none; cursor: pointer; color: var(--ink-700);
  position: relative;
}
.icon-btn:hover { background: var(--paper-100); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red-600); border: 1.5px solid var(--paper-0); }
.notif-count { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red-600); color: var(--paper-0); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; border: 1.5px solid var(--paper-0); } /* Count only (migration 295) */

.profile-menu { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 999px; }
.profile-trigger:hover { background: var(--paper-100); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brass-100); color: var(--brass-700);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-13); font-variation-settings: 'wght' 650;
  flex: none;
}
.profile-name { font-size: var(--fs-13); color: var(--ink-900); font-variation-settings: 'wght' 560; text-align: left; line-height: 1.25; }
.profile-role { display: block; font-size: 11px; color: var(--ink-500); font-variation-settings: 'wght' 420; }

.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 6px; z-index: 50;
  opacity: 0; transform: translateY(-4px) scale(0.98); pointer-events: none;
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
.dropdown-panel.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: var(--fs-14); color: var(--ink-700); cursor: pointer; }
.dropdown-item:hover { background: var(--paper-100); text-decoration: none; }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--line); margin: 5px 4px; }

.content { flex: 1; padding: 26px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }
.content.is-narrow { max-width: 760px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-28); }
.page-head .lede { color: var(--ink-500); font-size: var(--fs-14); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex: none; }
.breadcrumb { font-size: var(--fs-13); color: var(--ink-500); margin-bottom: 6px; }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb .sep { margin: 0 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: var(--fs-14); font-variation-settings: 'wght' 560;
  padding: 9px 16px; border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; transition: background 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease), transform 0.05s;
  line-height: 1.1;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brass-600); border-color: var(--brass-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brass-700); border-color: var(--brass-700); text-decoration: none; }
.btn-secondary { background: var(--white); border-color: var(--line-strong); color: var(--ink-900); }
.btn-secondary:hover:not(:disabled) { background: var(--paper-100); text-decoration: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-700); }
.btn-ghost:hover:not(:disabled) { background: var(--paper-100); text-decoration: none; }
.btn-danger { background: var(--white); border-color: var(--red-600); color: var(--red-600); }
.btn-danger:hover:not(:disabled) { background: var(--red-100); text-decoration: none; }
/* Page search (public/js/page-search.js) */
.page-search-kbd { font: inherit; font-size: 11px; color: var(--text-muted, #6b7280); border: 1px solid var(--border, #e5e7eb); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
@media (max-width: 900px) { .page-search-kbd { display: none; } }
.ps-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 55vh; overflow: auto; }
.ps-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.ps-list a:hover, .ps-list a.is-active { background: var(--surface-2, rgba(0, 0, 0, .05)); text-decoration: none; }
.ps-list .ps-where { font-size: 12px; color: var(--text-muted, #6b7280); }
.ps-list mark { background: transparent; color: inherit; font-weight: 700; text-decoration: underline; }
.btn-danger-solid { background: var(--red-600); border-color: var(--red-600); color: var(--on-state); }
.btn-danger-solid:hover:not(:disabled) { filter: brightness(0.9); text-decoration: none; }
.btn-sm { padding: 6px 11px; font-size: var(--fs-13); }
.btn-block { width: 100%; }
.btn-icon-only { padding: 8px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
label, .field-label { display: block; font-size: var(--fs-13); font-variation-settings: 'wght' 580; color: var(--ink-900); margin-bottom: 6px; }
.field-label .optional { color: var(--ink-500); font-variation-settings: 'wght' 400; }
.field-hint { font-size: var(--fs-13); color: var(--ink-500); margin-top: 5px; }
.field-error { font-size: var(--fs-13); color: var(--red-600); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.field-error svg { width: 13px; height: 13px; flex: none; }
.required-mark { color: var(--red-600); margin-left: 2px; }

.input, select.input, textarea.input {
  width: 100%; font-family: inherit; font-size: var(--fs-14); color: var(--ink-900);
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--white); transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.input::placeholder { color: var(--ink-300); }
.input:focus { outline: none; border-color: var(--brass-500); box-shadow: 0 0 0 3px var(--brass-100); }
.input[disabled], .input[readonly] { background: var(--paper-100); color: var(--ink-700); }
.field.has-error .input { border-color: var(--red-600); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px var(--red-100); }
textarea.input { resize: vertical; min-height: 84px; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 9px; height: 9px;
  border-right: 1.5px solid var(--ink-500); border-bottom: 1.5px solid var(--ink-500);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.select-wrap select { appearance: none; padding-right: 32px; }

.input-group { display: flex; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.input-group .input:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.input-group-addon {
  display: flex; align-items: center; padding: 0 12px; background: var(--paper-100);
  border: 1px solid var(--line-strong); border-right: none; color: var(--ink-500); font-size: var(--fs-13);
  border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md);
}
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 2px 0; }
.checkbox, .radio {
  appearance: none; width: 17px; height: 17px; border: 1.5px solid var(--line-strong); background: var(--white);
  flex: none; margin-top: 1px; cursor: pointer; position: relative; transition: all 0.12s var(--ease);
}
.checkbox { border-radius: 4px; }
.radio { border-radius: 50%; }
.checkbox:checked, .radio:checked { background: var(--brass-600); border-color: var(--brass-600); }
.checkbox:checked::after {
  content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(40deg);
}
.radio:checked::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.check-row label { margin: 0; font-size: var(--fs-14); font-variation-settings: 'wght' 440; color: var(--ink-700); cursor: pointer; }

.option-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.option-pill { position: relative; }
.option-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-pill span {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: var(--fs-14); color: var(--ink-700); cursor: pointer;
  transition: all 0.14s var(--ease);
}
.option-pill input:checked + span { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent, #fff); }
.option-pill input:focus-visible + span { outline: 2px solid var(--brass-500); outline-offset: 2px; }

fieldset.form-section { border: none; margin: 0 0 30px; padding: 0; }
.form-section-head { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.form-section-head h3 { display: flex; align-items: center; gap: 9px; }
.form-section-head .section-index {
  width: 22px; height: 22px; border-radius: 50%; background: var(--inverse-bg); color: var(--on-inverse, #fff);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.form-section-head p { margin: 4px 0 0; font-size: var(--fs-13); color: var(--ink-500); }

/* ---------- Stepper (registration wizard) ---------- */
.stepper { display: flex; align-items: center; margin-bottom: 34px; }
.step { display: flex; align-items: center; flex: 1; }
.step:last-child { flex: none; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-13);
  color: var(--ink-500); flex: none; background: var(--paper-0); font-variation-settings: 'wght' 600;
  transition: all 0.2s var(--ease);
}
.step.is-done .step-dot { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent, #fff); }
.step.is-current .step-dot { border-color: var(--brass-600); color: var(--brass-600); box-shadow: 0 0 0 4px var(--brass-100); }
.step-dot svg { width: 14px; height: 14px; }
.step-label { margin-left: 10px; font-size: var(--fs-13); color: var(--ink-500); white-space: nowrap; }
.step.is-current .step-label, .step.is-done .step-label { color: var(--ink-900); font-variation-settings: 'wght' 560; }
.step-line { flex: 1; height: 1px; background: var(--line-strong); margin: 0 14px; }
.step.is-done + .step .step-line, .step.is-done .step-line { background: var(--brass-600); }
@media (max-width: 720px) { .step-label { display: none; } }

.wizard-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Tables ---------- */
.table-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-500); }
.search-box .input { padding-left: 34px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--white); font-size: var(--fs-13); color: var(--ink-700); cursor: pointer;
}
.filter-chip.is-active { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--on-inverse, #fff); }
.toolbar-spacer { flex: 1; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); }
/* The table's own scroll box (both directions), so the column headings stay in view while the rows scroll. */
.table-scroll { overflow: auto; max-height: calc(100vh - var(--stick-top) - var(--stick-bottom) - 24px); max-height: calc(100dvh - var(--stick-top) - var(--stick-bottom) - 24px); }
.table-scroll > table.data-table > thead > tr > th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line); }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); min-width: 620px; }
table.data-table thead th {
  text-align: left; font-size: var(--fs-11); text-transform: none; letter-spacing: 0.01em;
  color: var(--ink-700); font-variation-settings: 'wght' 560; font-weight: 560; padding: 11px 16px;
  background: var(--paper-100); border-bottom: 1px solid var(--line); white-space: nowrap;
}
/* A group heading inside one table's body (File type & size per upload: places / Document Types / Document Categories). */
table.data-table tbody tr.table-group > th { text-align: left; padding: 10px 16px; background: var(--paper-100); color: var(--ink-900); font-weight: 600; border-bottom: 1px solid var(--line); }
table.data-table th.sortable { cursor: pointer; user-select: none; }
table.data-table th.sortable:hover { color: var(--ink-900); }
/* Sorting by a column heading (public/js/app.js): ▲ ascending, ▼ descending, a faint ↕ on a heading that sorts. */
table.data-table th.sortable::after { content: '↕'; margin-left: 6px; font-size: 10px; opacity: .35; }
table.data-table th.sortable[aria-sort="ascending"]::after { content: '▲'; opacity: .9; }
table.data-table th.sortable[aria-sort="descending"]::after { content: '▼'; opacity: .9; }
table.data-table th.sortable:focus-visible { outline: 2px solid var(--accent-500, currentColor); outline-offset: -2px; }
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-700); vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background 0.1s var(--ease); }
table.data-table tbody tr:nth-child(even) { background: var(--table-zebra, transparent); }
table.data-table tbody tr:hover { background: var(--paper-100); }
table.data-table td.cell-primary { color: var(--ink-900); font-variation-settings: 'wght' 560; }
table.data-table td.cell-num { font-variation-settings: 'wght' 460, 'wdth' 88; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--paper-100); font-size: var(--fs-13); color: var(--ink-500); }
.pagination-controls { display: flex; gap: 4px; }
.page-btn { width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--white); color: var(--ink-700); cursor: pointer; font-size: var(--fs-13); }
.page-btn:hover:not(:disabled) { background: var(--paper-100); }
.page-btn.is-active { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--on-inverse, #fff); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: var(--fs-11); font-variation-settings: 'wght' 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-neutral { background: var(--paper-200); color: var(--ink-700); }
/* Presence badges: soft, desaturated backgrounds with dark readable text. */
.badge-online { background: var(--color-success-bg, var(--green-100)); color: var(--color-success, var(--green-600)); }
.badge-busy { background: var(--color-warning-bg, var(--amber-100)); color: var(--color-warning, var(--amber-600)); }
.badge-offline { background: var(--color-offline-bg, var(--paper-200)); color: var(--color-offline, var(--ink-700)); }
.badge-online::before, .badge-busy::before, .badge-offline::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* ---------- Panels / cards (used sparingly) ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat-cell { background: var(--white); padding: 18px 20px; }
.stat-cell .stat-label { font-size: var(--fs-13); color: var(--ink-500); }
.stat-cell .stat-value { font-size: var(--fs-28); font-variation-settings: 'wght' 640, 'wdth' 106; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-cell .stat-delta { font-size: var(--fs-13); margin-top: 4px; }

.definition-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 24px; }
.definition-list dt { font-size: var(--fs-11); color: var(--ink-500); margin-bottom: 3px; }
.definition-list dd { margin: 0; font-size: var(--fs-14); color: var(--ink-900); font-variation-settings: 'wght' 520; }

/* ---------- Empty / loading / error states ---------- */
.empty-state { text-align: center; padding: 64px 24px; color: var(--ink-500); }
.empty-state svg { width: 40px; height: 40px; color: var(--line-strong); margin-bottom: 14px; }
.empty-state h3 { color: var(--ink-900); margin-bottom: 6px; }
.empty-state p { max-width: 380px; margin: 0 auto 18px; }

.skeleton { background: linear-gradient(100deg, var(--paper-100) 30%, var(--paper-200) 50%, var(--paper-100) 70%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 1px; }
.skeleton-line { height: 12px; border-radius: 3px; margin-bottom: 8px; }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); font-size: var(--fs-14); border: 1px solid; margin-bottom: 18px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-info { background: var(--blue-100); border-color: color-mix(in srgb, var(--blue-600) 28%, transparent); color: var(--blue-600); }
.alert-error { background: var(--red-100); border-color: color-mix(in srgb, var(--red-600) 28%, transparent); color: var(--red-600); }
.alert-success { background: var(--green-100); border-color: color-mix(in srgb, var(--green-600) 28%, transparent); color: var(--green-600); }
.alert-warning { background: var(--amber-100); border-color: color-mix(in srgb, var(--amber-600) 28%, transparent); color: var(--amber-600); }
.alert strong { display: block; margin-bottom: 2px; color: inherit; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 20, 34, 0.5); backdrop-filter: blur(1.5px);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 0.16s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop { overflow: hidden; max-width: 100vw; }
/* A notification shown as a window that must be answered (views/partials/notice-window.ejs): above every other window, no way round it. */
.notice-window-backdrop { position: fixed; inset: 0; background: rgba(16, 20, 34, 0.62); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 400; }
.notice-window-backdrop.hidden { display: none; }
.notice-window { background: var(--white); color: var(--ink-900); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(100%, 520px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.notice-window-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.notice-window-head h2 { font-size: var(--fs-19); flex: 1; margin: 0; overflow-wrap: anywhere; }
.notice-window-body { padding: 16px 20px; overflow: auto; }
.notice-window-body p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-window-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--paper-100); }
.notice-window-out { margin-right: auto; }
html.notice-window-open { overflow: hidden; }
/* The bell's own list would show the same notices beside the window: it waits until the window is answered. */
html.notice-window-open .notice-pop { visibility: hidden; }
/* While a picture or a PDF is being edited the notifications list waits: it lay over the editor's tools. It is back when the editor closes. */
html:has(#__pdfEditor.is-open) .notice-pop, html:has(#__cropModal.is-open) .notice-pop { visibility: hidden; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  /* Fits any screen (owner's Task 2, 2026-11-21): at most 90 % of the width and of the height, the body scrolling inside while
     the header and the buttons stay in view; full screen below 640 px (the media block further down). The person can still
     drag the bottom-right corner to resize it (maximise: the header button). */
  width: min(90vw, 720px); max-width: 90vw; max-height: 90vh; max-height: 90dvh;
  resize: both; overflow: hidden; min-width: min(300px, 100%); min-height: 160px; display: flex; flex-direction: column;
  transform: translateY(10px) scale(0.98); opacity: 0; transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal.modal-lg { width: min(90vw, 760px); }
.modal.modal-xl { width: min(90vw, 980px); }
.modal.is-max { width: calc(100vw - 16px) !important; height: calc(100dvh - 16px) !important; max-height: none; }
/* A titled group of fields inside a form or details panel (Applicant / Guardian / …). */
.form-group-title { font-size: var(--fs-14); font-weight: 700; color: var(--ink-700, #333); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.form-group-title:first-child { margin-top: 0; }
.modal-fit { background: none; border: none; cursor: pointer; color: var(--ink-500); padding: 4px; border-radius: 6px; margin-right: 2px; font-size: 15px; line-height: 1; }
.modal-fit:hover { background: var(--paper-100); color: var(--ink-900); }
@media (max-height: 760px) {
  .modal-head { padding: 12px 16px; } .modal-body { padding: 14px 16px; } .modal-foot { padding: 10px 16px; }
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); flex: 0 1 auto; min-height: 0; overflow-y: auto; } /* a long question in the header (the confirmation dialog) scrolls there: the buttons below stay in view */
.modal-head h2 { font-size: var(--fs-19); }
.modal-head p { margin: 3px 0 0; font-size: var(--fs-13); color: var(--ink-500); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--ink-500); padding: 4px; border-radius: 50%; }
.modal-close:hover { background: var(--paper-100); color: var(--ink-900); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; min-height: 0; }
/* A <form> around a modal's head / body / foot: it takes the modal's height so the body
   scrolls and the foot (Save / Submit) always stays in view. */
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
@media (max-height: 640px) {
  .modal-backdrop { padding: 8px; }
}
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex: none; }
.modal-foot.justify-between { justify-content: space-between; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; bottom: calc(var(--menu-bottom) + 20px); right: calc(var(--menu-right) + 20px); display: flex; flex-direction: column; gap: 10px; z-index: 200; width: min(360px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; background: var(--inverse-bg); color: var(--on-inverse, #fff);
  padding: 13px 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: var(--fs-14);
  animation: toast-in 0.22s var(--ease);
}
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast.toast-success svg { color: #7fcf9e; }
.toast.toast-error svg { color: #e39a93; }
.toast.toast-info svg { color: #9bc4e8; }
.toast-close { margin-left: auto; background: none; border: none; color: #98a1b8; cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.toast.is-leaving { animation: toast-out 0.16s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

/* ---------- Diff view (approval comparison) ---------- */
.diff-row { display: grid; grid-template-columns: 200px 1fr 1fr; gap: 0; border-bottom: 1px solid var(--line); font-size: var(--fs-14); }
.diff-row:last-child { border-bottom: none; }
.diff-cell { padding: 11px 14px; }
.diff-label { color: var(--ink-500); font-size: var(--fs-13); display: flex; align-items: center; }
.diff-before { color: var(--ink-500); background: var(--red-100); text-decoration: line-through; text-decoration-color: rgba(162,59,52,0.4); }
.diff-after { color: var(--green-600); background: var(--green-100); font-variation-settings: 'wght' 560; }
.diff-head { display: grid; grid-template-columns: 200px 1fr 1fr; font-size: var(--fs-11); color: var(--ink-500); padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--paper-100); }

/* ---------- Auth / landing ---------- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-visual {
  flex: 1.1; background: var(--inverse-bg); color: var(--on-inverse, #fff); display: flex; flex-direction: column;
  justify-content: space-between; padding: 48px; position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 30%, black, transparent 70%);
}
.auth-visual .mark { font-size: var(--fs-14); letter-spacing: 0.02em; color: #98a1b8; position: relative; }
.auth-visual .pitch { position: relative; max-width: 420px; }
.auth-visual .pitch h1 { color: var(--on-inverse, #fff); font-size: var(--fs-34); line-height: 1.15; }
.auth-visual .pitch p { color: #b7bdce; margin-top: 14px; font-size: var(--fs-14); }
.auth-visual .foot-note { position: relative; font-size: var(--fs-13); color: #7d859c; }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.auth-mobile-brand img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.auth-visual-company { position: relative; margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); }
.auth-visual-company-name { font-size: var(--fs-14); color: var(--on-inverse, #fff); font-variation-settings: 'wght' 600; }
.auth-visual-company-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; font-size: var(--fs-13); color: #98a1b8; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper-0); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-500); font-size: var(--fs-14); margin-bottom: 26px; }
.auth-switch { display: flex; gap: 4px; background: var(--paper-100); padding: 4px; border-radius: var(--radius-md); margin-bottom: 24px; }
.auth-switch a { flex: 1; text-align: center; padding: 8px; border-radius: 5px; font-size: var(--fs-13); color: var(--ink-500); font-variation-settings: 'wght' 560; }
.auth-switch a:hover { text-decoration: none; }
.auth-switch a.is-active { background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-sm); }
.captcha-box { display: flex; align-items: center; gap: 10px; background: var(--paper-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px; margin-bottom: 14px; }
.captcha-box img { border-radius: 4px; display: block; }
.otp-inputs { display: flex; gap: 8px; }
.otp-inputs .input { text-align: center; font-size: var(--fs-19); padding: 10px 0; font-variant-numeric: tabular-nums; }

/* ---------- Landing page ---------- */
.landing { min-height: 100vh; background: var(--paper-0); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; font-size: var(--fs-14); font-variation-settings: 'wght' 620; }
.landing-nav .brand svg { width: 22px; height: 22px; color: var(--brass-600); }
.landing-company-strip {
  display: flex; align-items: center; gap: 14px; max-width: 1100px; margin: 0 auto; padding: 0 40px 20px;
}
.landing-company-logo { width: 44px; height: 44px; border-radius: var(--radius-md); object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.landing-company-logo-fallback {
  display: flex; align-items: center; justify-content: center; background: var(--brass-050); color: var(--brass-700);
  font-size: var(--fs-14); font-variation-settings: 'wght' 640;
}
.landing-company-name { font-size: var(--fs-15); color: var(--ink-900); font-variation-settings: 'wght' 600; }
.landing-company-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: var(--fs-13); color: var(--ink-500); }
.landing-company-meta a { color: inherit; }
.landing-hero { max-width: 1100px; margin: 0 auto; padding: 64px 40px 40px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.landing-hero h1 { font-size: 2.6rem; line-height: 1.12; font-variation-settings: 'wght' 640, 'wdth' 106; }
.landing-hero .lede { font-size: var(--fs-16); color: var(--ink-500); margin: 18px 0 30px; max-width: 480px; }
.entry-cards { display: flex; flex-direction: column; gap: 14px; }
.entry-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--white); transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.entry-card:hover { border-color: var(--brass-500); box-shadow: var(--shadow-sm); text-decoration: none; }
.entry-card .entry-icon { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--brass-050); color: var(--brass-700); display: flex; align-items: center; justify-content: center; flex: none; }
.entry-card .entry-icon svg { width: 20px; height: 20px; }
.entry-card .entry-title { font-size: var(--fs-16); color: var(--ink-900); font-variation-settings: 'wght' 600; }
.entry-card .entry-desc { font-size: var(--fs-13); color: var(--ink-500); margin-top: 2px; }
.entry-card .entry-arrow { margin-left: auto; color: var(--ink-300); }
.landing-figure {
  aspect-ratio: 4/5; background: var(--inverse-bg); border-radius: var(--radius-lg); position: relative; overflow: hidden;
}
.landing-figure .ledger-lines { position: absolute; inset: 24px; display: flex; flex-direction: column; gap: 14px; }
.landing-figure .ledger-lines .lg-row { display: flex; align-items: center; gap: 10px; }
.landing-figure .lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass-500); flex: none; }
.landing-figure .lg-bar { height: 9px; border-radius: 3px; background: rgba(255,255,255,0.1); }
.landing-foot { text-align: center; padding: 30px; color: var(--ink-500); font-size: var(--fs-13); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 26px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.file-drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); padding: 22px;
  text-align: center; color: var(--ink-500); font-size: var(--fs-13); cursor: pointer; transition: all 0.14s var(--ease);
}
.file-drop:hover, .file-drop.is-dragover { border-color: var(--brass-500); background: var(--brass-050); }
.file-drop svg { width: 22px; height: 22px; margin-bottom: 8px; color: var(--ink-300); }
.file-preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-100); }
.file-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.file-preview .file-meta { flex: 1; min-width: 0; }
.file-preview .file-name { font-size: var(--fs-13); color: var(--ink-900); font-variation-settings: 'wght' 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .file-size { font-size: 11px; color: var(--ink-500); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100dvh; transform: translateX(-100%); transition: transform 0.2s var(--ease); width: 260px; flex-basis: 260px; }
  .sidebar.is-mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar.is-collapsed { width: 260px; flex-basis: 260px; }
  .sidebar.is-collapsed .brand-name, .sidebar.is-collapsed .brand-sub, .sidebar.is-collapsed .nav-label, .sidebar.is-collapsed .nav-toggle, .sidebar.is-collapsed .nav-children { display: block; }
  .sidebar.is-collapsed .nav-group:not(.is-open) .nav-children { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(16,20,34,0.45); z-index: 29; }
  .sidebar-scrim.is-open { display: block; }
  .content { padding: 18px 16px 40px; }
  .field-row, .field-row.cols-3 { grid-template-columns: 1fr; }
  .landing-hero { grid-template-columns: 1fr; padding: 40px 20px; }
  .landing-figure { display: none; }
  .landing-hero h1 { font-size: 2rem; }
  .auth-visual { display: none; } .auth-mobile-brand { display: flex; }
  .definition-list { grid-template-columns: 1fr 1fr; }
  .diff-row, .diff-head { grid-template-columns: 120px 1fr 1fr; font-size: var(--fs-13); }
}
@media (max-width: 520px) {
  .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .definition-list { grid-template-columns: 1fr; }
  .toast-region { left: calc(var(--menu-left) + 12px); right: calc(var(--menu-right) + 12px); width: auto; }
}

/* Identity cards: larger applicant photo / company logo (dashboards, application page) */
.dash-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card { margin-bottom: 0; }
.dash-identity { display: flex; align-items: center; gap: 18px; }
.dash-photo { width: 112px; height: 112px; border-radius: var(--radius-lg); object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; background: var(--white); }
img.dash-logo { object-fit: contain; padding: 6px; box-sizing: border-box; }
.dash-photo-fallback { display: flex; align-items: center; justify-content: center; background: var(--brass-100); color: var(--brass-700); font-size: 32px; font-weight: 700; }
.dash-name { font-size: var(--fs-19); font-variation-settings: 'wght' 620; }
@media (max-width: 860px) { .dash-cards { grid-template-columns: 1fr; } .dash-photo { width: 88px; height: 88px; } }

/* Service desk timer */
.timer-face { font-variant-numeric: tabular-nums; font-size: 1.9rem; font-variation-settings: 'wght' 640; padding: 10px 16px; border-radius: var(--radius-md); background: var(--paper-100); border: 1px solid var(--line); min-width: 150px; text-align: center; }
.timer-face.timer-sm { font-size: var(--fs-14); padding: 4px 10px; min-width: 92px; }

.select-search { margin-bottom: 6px; }

/* Target progress */
.progress { height: 8px; border-radius: 999px; background: var(--paper-100); border: 1px solid var(--line); overflow: hidden; }
.progress-bar { height: 100%; background: var(--blue-600); border-radius: 999px; transition: width 0.3s var(--ease); }
.progress-bar.is-done { background: var(--green-600); }

/* =====================================================================
   Themes — chosen from the palette button in the top bar (stored in the
   "theme" cookie so the server renders <html data-theme> with no flash).
   Each theme only overrides tokens; components never name colours.
   ===================================================================== */
[data-theme="slate"] {
  --ink-900: #0f172a; --ink-700: #334155; --ink-500: #5a6679; --ink-300: #94a3b8;
  --paper-0: #f6f8fb; --paper-100: #eef2f7; --paper-200: #e2e8f0; --line: #e2e8f0; --line-strong: #cbd5e1;
  --brass-700: #3730a3; --brass-600: #4f46e5; --brass-500: #6366f1; --brass-100: #e0e7ff; --brass-050: #eef2ff;
  --inverse-bg: #111827; --sidebar-active: rgba(99, 102, 241, 0.32);
}
[data-theme="ocean"] {
  --ink-900: #0b2530; --ink-700: #2f4a55; --ink-500: #4f6671; --ink-300: #93a7af;
  --paper-0: #f4f9fa; --paper-100: #e8f2f4; --paper-200: #d9e9ec; --line: #d5e4e8; --line-strong: #b5ccd2;
  --brass-700: #0b5563; --brass-600: #0e7490; --brass-500: #0891b2; --brass-100: #cff4fc; --brass-050: #ecfeff;
  --inverse-bg: #0b2530; --sidebar-fg: #bcd3da; --sidebar-muted: #86a3ad; --sidebar-active: rgba(8, 145, 178, 0.35);
}
[data-theme="forest"] {
  --ink-900: #14231b; --ink-700: #37493f; --ink-500: #55655b; --ink-300: #9aa89f;
  --paper-0: #f6f8f4; --paper-100: #ecf1e8; --paper-200: #dfe7d9; --line: #dbe3d4; --line-strong: #bccab2;
  --brass-700: #1f5130; --brass-600: #2f6b3f; --brass-500: #3f8a52; --brass-100: #dcefdf; --brass-050: #eef7ef;
  --inverse-bg: #14231b; --sidebar-fg: #c3d1c7; --sidebar-muted: #8ea396; --sidebar-active: rgba(63, 138, 82, 0.38);
}
/* White: plain white surfaces, near-black text, one blue accent — the lightest, highest-contrast choice. */
[data-theme="white"] {
  --ink-900: #0f172a; --ink-700: #334155; --ink-500: #55607a; --ink-300: #98a2b3;
  --paper-0: #ffffff; --paper-100: #f5f6f8; --paper-200: #eceef2; --line: #e4e7ec; --line-strong: #cdd3dc;
  --white: #ffffff;
  --brass-700: #1e40af; --brass-600: #2563eb; --brass-500: #3b82f6; --brass-100: #dbeafe; --brass-050: #eff6ff;
  --inverse-bg: #1e293b; --sidebar-fg: #cbd5e1; --sidebar-muted: #94a3b8; --sidebar-active: rgba(59, 130, 246, 0.32);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06); --shadow-md: 0 6px 20px -8px rgba(15, 23, 42, 0.18); --shadow-lg: 0 18px 48px -14px rgba(15, 23, 42, 0.28);
}
/* Grey: neutral mid-grey surfaces with white cards — easy on the eyes in a bright office, no colour cast. */
[data-theme="grey"] {
  --ink-900: #1c2026; --ink-700: #3a424d; --ink-500: #56606c; --ink-300: #8f99a5;
  --paper-0: #d9dde2; --paper-100: #cfd4da; --paper-200: #c3c9d0; --line: #bcc3cb; --line-strong: #9da6b1;
  --white: #eef0f3;
  --brass-700: #27313f; --brass-600: #3d4b5f; --brass-500: #55657c; --brass-100: #c9d0d9; --brass-050: #e2e6eb;
  --inverse-bg: #2a3038; --sidebar-fg: #c9d0d9; --sidebar-muted: #97a1ad; --sidebar-active: rgba(160, 174, 192, 0.30);
  --green-100: #cfe5d6; --red-100: #ecd3d0; --amber-100: #ecdfc0; --blue-100: #cfdcec;
  --shadow-sm: 0 1px 2px rgba(28, 32, 38, 0.10); --shadow-md: 0 6px 20px -8px rgba(28, 32, 38, 0.28); --shadow-lg: 0 18px 48px -14px rgba(28, 32, 38, 0.38);
}
[data-theme="grey"] .input, [data-theme="grey"] select.input, [data-theme="grey"] textarea.input { background: #f6f7f9; }
[data-theme="dark"] {
  color-scheme: dark;
  --ink-900: #e7eaf1; --ink-700: #c1c7d3; --ink-500: #949cae; --ink-300: #677087;
  --paper-0: #0e121a; --paper-100: #151a24; --paper-200: #1d2330; --line: #283042; --line-strong: #394257;
  --white: #141924;
  --brass-700: #e3b066; --brass-600: #b8812e; --brass-500: #d49a45; --brass-100: #3a2c15; --brass-050: #231b0f;
  --green-600: #6cc392; --green-100: #142a1e; --red-600: #ec8c83; --red-100: #301816;
  --amber-600: #e2b45c; --amber-100: #2e2410; --blue-600: #92bbe4; --blue-100: #132233;
  --inverse-bg: #080b11; --sidebar-active: rgba(212, 154, 69, 0.28);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow-md: 0 6px 20px -6px rgba(0,0,0,0.6); --shadow-lg: 0 16px 48px -12px rgba(0,0,0,0.7);
}
[data-theme="dark"] .input, [data-theme="dark"] select.input { color: var(--ink-900); }
[data-theme="dark"] img.dash-photo { background: var(--paper-200); }

/* ---------- Fit and wrap, everywhere (the UI audit, docs/THEMES_AND_LAYOUT.md) ----------
   One set of rules instead of a fix per page: nothing is wider than what holds it, long words and links wrap,
   a window (modal) never leaves the screen and scrolls inside itself, and its buttons stay reachable. */
.field-row > * { min-width: 0; }                        /* a long value cannot stretch one column over the other */
.field, .panel, .table-wrap, .modal-body { min-width: 0; }
.input, select.input, textarea.input { max-width: 100%; }
select.input { text-overflow: ellipsis; }
.field-hint, .field-error, .text-sm, .lede, .alert, .rich, .modal-head p { overflow-wrap: anywhere; }
.rich img, .modal-body img, .panel img { max-width: 100%; height: auto; }
.modal-head { gap: 12px; }
.modal-head > div:first-child { min-width: 0; flex: 1; }
.modal-head h2 { overflow-wrap: anywhere; }
.modal-body { overflow-x: auto; overscroll-behavior: contain; }
.modal-foot { flex-wrap: wrap; }
.panel-head { gap: 8px 12px; flex-wrap: wrap; }
.panel-head > h2, .panel-head > h3 { min-width: 0; }
.page-head { gap: 12px; }
.page-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; } /* many buttons wrap instead of widening the page (P9-UI-3) */
table.data-table.data-table-fit { min-width: 0; }  /* a short list in a half-width panel: fits the panel (the 620 px floor is for full-width lists) */
.dropdown-panel { max-width: calc(100vw - 16px); max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.toolbar { flex-wrap: wrap; }
.kpi-grid { min-width: 0; }
.kpi .v { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .field-row.cols-4 { grid-template-columns: 1fr 1fr; }
  /* Below 640 px a window is the whole screen: its header and its buttons at the edges, the body scrolling between them. */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { width: 100vw !important; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; min-width: 0; border-radius: 0; resize: none; }
  .modal-head { padding: 14px 16px; } .modal-body { padding: 16px; } .modal-foot { padding: 12px 16px; }
  .modal-body > table.data-table, .modal-body > form > table.data-table { display: block; min-width: 0; max-width: 100%; overflow-x: auto; }   /* a list in a window scrolls inside itself */
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }       /* buttons large enough for a thumb, side by side or stacked */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .option-pills { gap: 6px; } .option-pill { flex: 1 1 auto; } .option-pill span { display: block; text-align: center; }
}
@media (max-width: 420px) { .field-row.cols-4 { grid-template-columns: 1fr; } }

/* New ticket: the chosen service, in full. */
.tk-service { border: 1px solid var(--line); background: var(--paper-100); border-radius: var(--radius-md); padding: 10px 14px; margin: -6px 0 18px; max-height: 220px; overflow-y: auto; overflow-wrap: anywhere; }
.tk-service-name { font-weight: 650; color: var(--ink-900); }
.tk-service-text { font-size: var(--fs-13); color: var(--ink-700); margin-top: 4px; }
.tk-service-text > :last-child { margin-bottom: 0; }

/* ---------- Polish shared by every theme ---------- */
.panel, .table-wrap, .stat-row { box-shadow: var(--shadow-sm); }
.data-table tbody tr { transition: background-color 0.12s var(--ease); }
.data-table tbody tr:hover { background: var(--paper-100); }
.btn { transition: background-color 0.14s var(--ease), border-color 0.14s var(--ease), box-shadow 0.14s var(--ease), transform 0.06s var(--ease); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { color: var(--on-accent); }
.page-head h1 { letter-spacing: -0.02em; }

/* ---------- Theme picker ---------- */
.theme-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px 12px; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; font-size: var(--fs-11); color: var(--ink-700); padding: 0; }
.theme-swatch i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); box-shadow: inset 0 0 0 3px var(--white); }
.theme-swatch.is-current i { border-color: var(--brass-600); }
.dropdown-label { padding: 10px 12px 0; font-size: var(--fs-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); }
.theme-float { position: fixed; right: 16px; bottom: 16px; z-index: 40; }
.theme-float .dropdown-panel { bottom: 46px; top: auto; right: 0; }

/* ---------- Staff work / idle timer (top bar) ---------- */
.work-timer { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: var(--fs-13); font-variant-numeric: tabular-nums; white-space: nowrap; }
.work-timer .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-600) 20%, transparent); }
.work-timer.is-idle .dot { background: var(--amber-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-600) 22%, transparent); animation: pulse 1.4s infinite; }
.work-timer .sep { width: 1px; height: 14px; background: var(--line); }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (max-width: 720px) { .work-timer .wt-label { display: none; } }
/* Idle is shown larger and highlighted so it is noticed (and worked down). */
.work-timer [data-wt="idle"] { font-size: var(--fs-14); padding: 1px 8px; border-radius: 999px; background: var(--amber-100); color: var(--amber-600); }
.work-timer.is-idle { border-color: color-mix(in srgb, var(--amber-600) 45%, transparent); background: color-mix(in srgb, var(--amber-100) 55%, var(--white)); }
.work-timer.is-idle [data-wt="idle"] { font-size: var(--fs-16); background: var(--amber-600); color: var(--on-state); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber-600) 22%, transparent); animation: idle-glow 2s ease-in-out infinite; }
.work-timer.is-idle .wt-label.wt-idle { color: var(--amber-600); font-weight: 600; }
@keyframes idle-glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--amber-600) 10%, transparent); } }

/* ---------- Automatic work timer (top bar; public/js/auto-timer.js, docs/WORK_TIMER.md) ---------- */
.auto-timer { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; margin-right: 6px; border: 1px solid color-mix(in srgb, var(--green-600) 45%, transparent); border-radius: 999px;
  background: var(--green-100); color: var(--green-600); font: inherit; font-size: var(--fs-13); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; max-width: 360px; }
.auto-timer:hover { border-color: var(--green-600); }
.auto-timer:focus-visible { outline: 2px solid var(--brass-600); outline-offset: 2px; }
.auto-timer .at-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; flex: none; }
.auto-timer .at-state { font-weight: 600; }
.auto-timer strong { color: var(--ink-900); }
.auto-timer .at-task { max-width: 160px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-700, #3b4656); }
.auto-timer .at-task:empty { display: none; }
.auto-timer.is-idle { border-color: color-mix(in srgb, var(--amber-600) 50%, transparent); background: var(--amber-100); color: var(--amber-600); }
.auto-timer.is-idle .at-dot { animation: none; }
.auto-timer.no-task .at-task { color: var(--amber-600); font-style: italic; }
@media (max-width: 720px) { .auto-timer .at-task, .auto-timer .at-state { display: none; } }
.at-now strong { font-size: var(--fs-18, 18px); font-variant-numeric: tabular-nums; }
/* My Work Timer / Work Timer pages */
.wt-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--paper-100, #f2efe8); border: 1px solid var(--line); }
.wt-bar > span { display: block; height: 100%; }
.wt-bar .b-work { background: var(--green-600); }
.wt-bar .b-counted { background: color-mix(in srgb, var(--green-600) 55%, var(--white)); }
.wt-bar .b-wait { background: var(--amber-600); }
.wt-bar .b-idle { background: color-mix(in srgb, var(--red-600) 55%, var(--white)); }
.wt-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-13); color: var(--ink-500, #5A6679); margin-top: 6px; }
.wt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.wt-row-idle td { background: color-mix(in srgb, var(--amber-100) 45%, transparent); }
.wt-row-break td { background: color-mix(in srgb, var(--paper-100, #f2efe8) 70%, transparent); }
/* Idle sign-out warning */
.idle-warn { position: fixed; left: 50%; bottom: calc(var(--menu-bottom) + 24px); transform: translateX(-50%); z-index: 3000; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--radius-md, 10px); background: var(--white); border: 1px solid var(--amber-600); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: var(--fs-14); }
.idle-warn strong { color: var(--amber-600); }
/* Never lose typed work (public/js/drafts.js, docs/DRAFTS.md): the "Restored" note and the no-network banner */
.draft-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.draft-offline { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2910; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--radius-md, 10px); background: var(--white); border: 1px solid var(--amber-600); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: var(--fs-14); }

/* ---------- Image cropper (every image upload) ---------- */
.cropper-stage { position: relative; background: var(--paper-200); border-radius: var(--radius-md); overflow: hidden; user-select: none; touch-action: none; display: flex; justify-content: center; }
.cropper-stage canvas { display: block; max-width: 100%; max-height: 56vh; }
.cropper-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10, 13, 20, 0.55); cursor: move; }
.cropper-box .h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brass-600); border-radius: 3px; }
.cropper-box .h.nw { left: -8px; top: -8px; cursor: nwse-resize; } .cropper-box .h.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.cropper-box .h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .cropper-box .h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.cropper-box .h.n { left: 50%; top: -8px; margin-left: -7px; cursor: ns-resize; } .cropper-box .h.s { left: 50%; bottom: -8px; margin-left: -7px; cursor: ns-resize; }
.cropper-box .h.w { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; } .cropper-box .h.e { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.cropper-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

/* ---------------- The image editor (public/js/app.js, docs/IMAGE_EDITOR.md) ---------------- */
.imged-main { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 14px; align-items: start; }
.imged-stage-wrap { min-width: 0; }
.imged-stagebar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.imged-side { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow-y: auto; padding-right: 4px; }
.imged-group { border: 1px solid var(--line); border-radius: var(--radius-md, 8px); padding: 10px 12px; background: var(--paper-0, var(--white)); }
.imged-group h3 { margin: 0 0 8px; font-size: var(--fs-14); color: var(--ink-700); }
.imged-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.imged-row + .imged-row, .imged-slider + .imged-row { margin-top: 8px; }
.imged-slider { display: block; margin-top: 8px; font-size: var(--fs-13, 13px); color: var(--ink-700); }
.imged-slider span { display: flex; justify-content: space-between; gap: 8px; }
.imged-slider b { font-variant-numeric: tabular-nums; color: var(--ink-900); }
.imged-slider input[type="range"] { width: 100%; margin-top: 2px; accent-color: var(--brass-600); }
.imged-slider input[type="range"]:disabled { opacity: 0.45; }
.imged .btn.is-on { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent, #fff); }
.imged-grid { position: absolute; inset: 0; display: none; pointer-events: none; }
.imged-grid.is-on { display: block; background-image: linear-gradient(to right, rgba(255,255,255,0.55) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.55) 1px, transparent 1px); background-size: 33.333% 33.333%; }
/* The canvas is shown at exactly its own pixel size (public/js/app.js sets it), so the crop
   frame — which is placed in those pixels — always lines up; the stage scrolls when zoomed in. */
/* The frame is placed from the stage's own edge, so the picture must start there too:
   centring it (the default) left the frame and the picture a gap apart. */
.imged .cropper-stage { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.imged .cropper-stage canvas { max-width: none; max-height: none; }
@media (max-width: 860px) {
  .imged-main { grid-template-columns: 1fr; }
  .imged-side { max-height: none; overflow: visible; }
}
.modal.modal-wide { width: min(90vw, 860px); }

/* ---------- Grouped page picker (User Access) ---------- */
.page-group { border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; }
.page-group-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--paper-100); font-variation-settings: 'wght' 600; font-size: var(--fs-14); cursor: pointer; }
.page-group-head .count { margin-left: auto; font-size: var(--fs-13); color: var(--ink-500); font-variation-settings: 'wght' 420; }
.page-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; padding: 10px 12px; }
.page-group-body label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-14); cursor: pointer; margin: 0; }

/* ---------- Blocking document-request modal ---------- */
.modal-backdrop.is-blocking { backdrop-filter: blur(3px); }
/* Text typed with paragraphs, headings and lists (richText helper): Service Master descriptions. */
.rich p { margin: 0 0 .6em; } .rich h4, .rich h5, .rich h6 { margin: .9em 0 .35em; line-height: 1.25; }
.rich h4 { font-size: 1.1em; } .rich h5 { font-size: 1em; } .rich h6 { font-size: .92em; text-transform: uppercase; letter-spacing: .03em; }
.rich ul, .rich ol { margin: 0 0 .6em 1.3em; padding: 0; } .rich > :last-child { margin-bottom: 0; }
.req-list { display: flex; flex-direction: column; gap: 12px; }
.req-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; }
.req-item h3 { font-size: var(--fs-16); margin-bottom: 4px; }
.banner-strip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--radius-md); background: var(--amber-100); color: var(--amber-600); font-size: var(--fs-13); margin-bottom: 16px; }
.banner-strip svg { width: 16px; height: 16px; flex: none; }
.banner-strip a { color: inherit; text-decoration: underline; margin-left: auto; }

/* ---------- Helpers used by the newer pages ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi .k { font-size: var(--fs-13); color: var(--ink-500); }
.kpi .v { font-size: var(--fs-23); font-variation-settings: 'wght' 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--paper-100); border: 1px solid var(--line); font-size: var(--fs-13); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.check-grid label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-14); cursor: pointer; margin: 0; }
.pick-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; }
.pick-list label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--fs-14); cursor: pointer; margin: 0; border-bottom: 1px dashed var(--line); }
.pick-list label:last-child { border-bottom: none; }
.vitem { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px; background: var(--white); }
.vitem-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.vitem-head h3 { font-size: var(--fs-16); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--white); }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 6px 8px; font-size: var(--fs-13); color: var(--ink-700); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 12px; font-size: var(--fs-14); }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brass-600); border: 2px solid var(--white); }
.bar-track { height: 8px; border-radius: 999px; background: var(--paper-200); overflow: hidden; display: flex; min-width: 120px; }
.bar-track .work { background: var(--green-600); } .bar-track .idle { background: var(--amber-600); }
.letter-paper { background: #fff; color: #111; max-width: 800px; margin: 0 auto; padding: 48px 56px; border: 1px solid var(--line); box-shadow: var(--shadow-md); font-family: Georgia, 'Times New Roman', serif; font-size: 15px; line-height: 1.6; }
.letter-paper p, .letter-paper td, .letter-paper h1, .letter-paper h2, .letter-paper h3 { color: #111; }
.placeholder-list code { cursor: pointer; display: inline-block; margin: 2px; padding: 2px 6px; border-radius: 4px; background: var(--paper-100); border: 1px solid var(--line); font-size: 12px; }
@media print {
  .table-scroll { overflow: visible; max-height: none; }
  .sidebar, .topbar, .page-head, .no-print, .toast-region, .theme-float, .skip-link, .label-ask { display: none !important; }
  .content { padding: 0 !important; } .letter-paper { border: none; box-shadow: none; padding: 0; max-width: none; }
  body { background: #fff; }
}

/* ---------- Company portal (white-label entry page) ---------- */
.portal { min-height: 100vh; background: var(--paper-0); display: flex; flex-direction: column; }
.portal-hero { background: var(--inverse-bg); color: var(--on-inverse, #fff); padding: 48px 24px 88px; }
.portal-hero .inner, .portal-body { max-width: 1040px; margin: 0 auto; width: 100%; }
.portal-hero .brand { display: flex; align-items: center; gap: 16px; }
.portal-hero .brand img, .portal-hero .brand .mono { width: 64px; height: 64px; border-radius: 12px; background: #fff; object-fit: contain; flex: none; }
.portal-hero .brand .mono { display: flex; align-items: center; justify-content: center; color: #12182a; font-weight: 700; font-size: 22px; }
.portal-hero h1 { color: var(--on-inverse, #fff); font-size: var(--fs-28); }
.portal-hero p { color: var(--sidebar-fg); margin: 4px 0 0; }
.portal-body { padding: 0 24px 48px; margin-top: -48px; }
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.portal-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 8px; }
.portal-card svg { width: 26px; height: 26px; color: var(--brass-600); }
.portal-card h3 { font-size: var(--fs-19); }
.portal-card .btn { margin-top: auto; align-self: flex-start; }
/* Company branding on the public pages: large logo, name, punch line, clickable contacts (migration 076) */
.punch-line { font-size: 13.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-300, #e9c46a); margin: 6px 0 0; }
.portal-hero .brand-lg { align-items: flex-start; gap: 22px; }
.portal-hero .brand-lg img, .portal-hero .brand-lg .mono { width: 112px; height: 112px; border-radius: 16px; padding: 6px; font-size: 34px; }
.portal-hero .brand-lg h1 { font-size: var(--fs-34, 34px); line-height: 1.15; }
.portal-hero .hero-address { font-size: 16px; margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.portal-hero .hero-contacts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; font-size: 16px; }
.portal-hero .hero-contacts a, .portal-hero .hero-address { color: var(--on-inverse, #fff); }
.portal-hero .hero-contacts a { text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; }
.portal-hero svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.register-hero .portal-hero { padding-bottom: 36px; margin-bottom: 18px; }
@media (max-width: 640px) {
  .portal-hero .brand-lg { flex-direction: column; gap: 14px; }
  .portal-hero .brand-lg img, .portal-hero .brand-lg .mono { width: 84px; height: 84px; }
  .portal-hero .brand-lg h1 { font-size: 26px; }
  .portal-hero .hero-contacts, .portal-hero .hero-address { font-size: 15px; }
}
.auth-company { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.auth-company-logo { width: 140px; height: 140px; border-radius: 20px; background: #fff; object-fit: contain; padding: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.auth-company-logo.mono { display: flex; align-items: center; justify-content: center; color: #12182a; font-weight: 700; font-size: 44px; }
.auth-company-name { color: var(--on-inverse, #fff); font-size: var(--fs-34, 34px); line-height: 1.15; margin: 22px 0 0; }
.auth-company-full { color: #b7bdce; font-size: 15px; margin-top: 4px; }
.auth-company .punch-line { font-size: 14px; margin-top: 10px; }
.auth-company-details { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; font-size: 16.5px; color: #dfe3ee; }
.auth-company-details li { display: flex; gap: 10px; align-items: flex-start; }
.auth-company-details svg { width: 19px; height: 19px; flex: none; margin-top: 3px; color: var(--brass-300, #e9c46a); }
.auth-company-details a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.auth-mobile-brand { align-items: flex-start; gap: 14px; }
.auth-mobile-brand img, .auth-mobile-mono { width: 72px; height: 72px; border-radius: 14px; flex: none; }
.auth-mobile-mono { display: flex; align-items: center; justify-content: center; background: var(--inverse-bg); color: #fff; font-weight: 700; font-size: 24px; }
.auth-mobile-name { display: block; font-size: 22px; line-height: 1.2; }
.auth-mobile-brand .punch-line { color: var(--brass-600, #8b5e1f); font-size: 12px; margin-top: 4px; }
.auth-mobile-address { font-size: 14.5px; color: var(--ink-700, #334); margin-top: 6px; }
.auth-mobile-contacts { font-size: 15px; margin-top: 4px; }
/* Company registration / sign-in links (/join, /application/status, Registration & Sign-in Links) */
.join-body { max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.join-card { box-shadow: var(--shadow-md); }
.join-done-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green-100); color: var(--green-600); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.company-contact .panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-19); }
.reg-link { padding: 14px 0; border-top: 1px solid var(--line); }
.reg-link:first-of-type { border-top: 0; padding-top: 0; }
.reg-link textarea[data-snippet] { font-family: var(--font-mono, monospace); font-size: 12px; }

/* ---------- Document / photo viewer ---------- */
.modal.viewer-modal { max-width: none; width: calc(100vw - 32px); height: calc(100vh - 32px); height: calc(100dvh - 32px); max-height: none; display: flex; flex-direction: column; padding: 0; overflow: hidden; resize: none; }
.viewer-modal .dstage { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; }

/* ---------------- Document stage (public/js/app.js window.DocStage): the viewer, Documents → View / edit, bank account Check & approve.
   The picture's box has its real on-screen size (turned sides swapped, times the zoom) and sits in a scrolling area with
   margin:auto, so every edge can be reached with the scrollbars, the wheel, a drag or the arrow keys — a CSS transform alone
   grew no scrollbar and put a turned picture above the top where no scroll goes. ---------------- */
.dstage { display: flex; flex-direction: column; min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); overflow: hidden; background: var(--white); }
.dstage-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; background: var(--white); }
.dstage-title { flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dstage-title:empty, .dstage.is-compact .dstage-title { display: none; }
.dstage-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.dstage-zoom { min-width: 46px; text-align: center; font-size: var(--fs-13); font-variant-numeric: tabular-nums; color: var(--ink-700); }
.dstage-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; background: repeating-conic-gradient(var(--paper-100) 0 25%, var(--paper-200) 0 50%) 0 0 / 24px 24px; touch-action: none; overscroll-behavior: contain; cursor: grab; outline: none; }
.dstage-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--inverse-bg, #2563eb); }
.dstage-scroll.is-dragging { cursor: grabbing; }
.dstage-box { position: relative; flex: none; margin: auto; }
.dstage-box[hidden] { display: none; }
.dstage-box img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; transform-origin: center center; user-select: none; -webkit-user-drag: none; pointer-events: none; background: var(--white); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); }
.dstage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--white); }
.dstage iframe[hidden] { display: none; }
.dstage-msg { margin: auto; padding: 40px 12px; text-align: center; color: var(--ink-500); }
.dstage-msg[hidden] { display: none; }
.dstage:not(.is-image) [data-v="in"], .dstage:not(.is-image) [data-v="out"], .dstage:not(.is-image) [data-v="fit"], .dstage:not(.is-image) [data-v="actual"],
.dstage:not(.is-image) [data-v="rotl"], .dstage:not(.is-image) [data-v="rotate"], .dstage:not(.is-image) .dstage-zoom { display: none; }
.dstage-open:not([href]) { display: none; }
/* Inside a window the stage has a set height, so the window keeps its layout and the stage is what scrolls. */
.doc-review-pic .dstage-scroll, .acct-doc-view .dstage-scroll { height: min(70vh, 760px); }
.modal.is-max .doc-review-pic .dstage-scroll, .modal.is-max .acct-doc-view .dstage-scroll { height: calc(100dvh - 290px); }
@media (max-width: 860px) { .doc-review-pic .dstage-scroll, .acct-doc-view .dstage-scroll { height: 50vh; } }
.viewer-msg { color: var(--ink-500); }
.input.has-error { border-color: var(--red-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-600) 18%, transparent); }
img.dash-photo, img[data-zoomable] { cursor: zoom-in; }

/* ---------- Organisation tree (Hierarchy) ---------- */
.org-tree { padding: 8px 4px 16px; min-width: max-content; }
.org-tree ul { position: relative; display: flex; justify-content: center; padding: 22px 0 0; margin: 0; list-style: none; }
.org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 8px 0; }
.org-tree > ul { padding-top: 0; }
.org-tree > ul > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line-strong); }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line-strong); }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 22px; }
.org-tree > ul > li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--line-strong); border-radius: 0 6px 0 0; }
.org-tree li:first-child::after { border-radius: 6px 0 0 0; }
.org-tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); }
.org-tree li:only-child > .org-card::before { content: ''; position: absolute; top: -22px; left: 50%; height: 22px; border-left: 2px solid var(--line-strong); }
.org-tree > ul > li > .org-card::before { display: none; }
.org-tree li.is-collapsed > ul { display: none; }
.org-card { position: relative; min-width: 150px; max-width: 200px; padding: 10px 12px; border: 1px solid var(--line); border-top: 4px solid var(--ink-300); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-sm); text-align: center; }
.org-card.is-company { border-top-color: var(--brass-600); background: var(--brass-050); min-width: 220px; }
.org-card.is-staff { border-top-color: var(--blue-600); }
.org-card.is-agent { border-top-color: var(--green-600); }
.org-card.is-sub { border-top-color: var(--amber-600); }
.org-kind { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); }
.org-name { display: block; font-variation-settings: 'wght' 620; color: var(--ink-900); margin: 2px 0; }
.org-code { font-size: var(--fs-13); color: var(--ink-500); font-variant-numeric: tabular-nums; }
.org-toggle, .org-move { margin-top: 6px; border: 1px solid var(--line); background: var(--paper-100); color: var(--ink-700); border-radius: 999px; padding: 2px 9px; font-size: var(--fs-11); cursor: pointer; }
.org-move { display: block; margin: 6px auto 0; background: transparent; }
.org-toggle:hover, .org-move:hover { border-color: var(--brass-500); color: var(--brass-700); }
.org-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.org-dot.is-staff { background: var(--blue-600); } .org-dot.is-agent { background: var(--green-600); } .org-dot.is-sub { background: var(--amber-600); }
/* Additional superiors (migration 141): named on the card, managed in a window. */
.org-also { margin-top: 4px; font-size: var(--fs-11); line-height: 1.35; color: var(--blue-600); }
.org-also.is-below { color: var(--ink-500); }
.org-line-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.org-line-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-100); }

/* ---------- Top performers ---------- */
.top-panel .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.top-panel .panel-head svg { width: 20px; height: 20px; color: var(--amber-600); }
.top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.top-card { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--brass-050), var(--white)); }
.top-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--brass-500); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; }

/* ---------- Suggestion dropdown (branch search, etc.) ---------- */
.suggest { position: relative; }
.suggest-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 280px; overflow: auto; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.suggest-list.is-open { display: block; }
.suggest-item { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.suggest-item strong { font-size: var(--fs-14); font-variation-settings: 'wght' 560; }
.suggest-item span { font-size: var(--fs-13); color: var(--ink-500); }
.suggest-item.is-active, .suggest-item:hover { background: var(--brass-050); }
.suggest-empty { padding: 8px 12px; color: var(--ink-500); font-size: var(--fs-13); }

/* Report sharing: scope picker under each person in the share list */
#sharePeople .share-scope { padding: 0 0 6px 26px; border-bottom: 1px dashed var(--line); }
#sharePeople label { border-bottom: none; }

/* Cropper: page navigation for PDFs */
.cropper-pages { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

/* Notification pop-up (views/partials/notifications.ejs) */
.notice-pop { position: fixed; top: calc(var(--stick-top) + 12px); right: calc(var(--menu-right) + 20px); width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - var(--stick-top) - var(--stick-bottom) - 50px); display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); z-index: 2920; }
/* The notifications list is over EVERY part of a page (owner, 2026-11-27: it lay under the page's floating parts and hid
   items) — the toasts (200), the Private OCR button (2900), a sticky bar, a window. Above it only what must be: the
   Private OCR window (2950), the idle sign-out warning (3000), the busy layer. While a working window that fills the
   screen is open it waits (hidden, as for the must-answer window and the editors above): it may open by itself when new
   work comes. */
html.scn-open .notice-pop, html:has(.dt-backdrop) .notice-pop, html:has(#pocrOverlay) .notice-pop { visibility: hidden; }
.notice-pop.hidden { display: none; }
.notice-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notice-head strong { display: flex; align-items: center; gap: 8px; }
.notice-head svg { width: 16px; height: 16px; }
.notice-list { overflow: auto; }
.notice-item { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notice-title { font-variation-settings: 'wght' 600; margin-bottom: 2px; }
.notice-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.notice-foot { padding: 6px 12px; text-align: right; }
@media (max-width: 600px) { .notice-pop { top: auto; bottom: calc(var(--menu-bottom) + 16px); right: calc(var(--menu-right) + 16px); } }


/* ---------- Company theme management (views/admin/themes.ejs) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.theme-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.theme-card.is-default { border-color: var(--brass-600); box-shadow: 0 0 0 1px var(--brass-600), var(--shadow-sm); }
.theme-swatch-row { display: flex; gap: 4px; }
.theme-swatch-row i { flex: 1; height: 26px; border-radius: 4px; border: 1px solid rgba(15, 23, 42, 0.08); }
.theme-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .theme-editor { grid-template-columns: 1fr; } }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; flex: none; }
.color-field .input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.token-group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; margin-bottom: 12px; }
.token-group legend { font-size: var(--fs-13); color: var(--ink-500); padding: 0 6px; }
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.token-grid .field { margin-bottom: 0; }
/* The live preview gets its own variables from the server (.theme-preview{…}). */
.theme-preview { font-family: var(--font-sans); color: var(--ink-900); background: var(--paper-0); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: calc(var(--stick-top) + 8px); }
.theme-preview .pv-shell { display: grid; grid-template-columns: 120px 1fr; min-height: 360px; }
.theme-preview .pv-side { background: var(--inverse-bg); color: var(--sidebar-fg); padding: 12px 8px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.theme-preview .pv-side span { padding: 6px 8px; border-radius: var(--radius-sm); }
.theme-preview .pv-side span.is-active { background: var(--sidebar-active); color: var(--on-inverse, #fff); box-shadow: inset 3px 0 0 var(--brass-500); }
.theme-preview .pv-main { padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.theme-preview table.data-table { min-width: 0; }
.theme-preview .pv-busy { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.55); font-size: 13px; }
.theme-preview.is-loading .pv-busy { display: flex; }


/* ---------- Service requests waiting 5+ minutes (escalation) ---------- */
@keyframes attention-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.attention-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--red-100); color: var(--red-600);
  font-size: var(--fs-13); font-variation-settings: 'wght' 600; font-weight: 600; text-decoration: none; animation: attention-blink 1.2s ease-in-out infinite; white-space: nowrap; }
.attention-pill:hover { text-decoration: none; animation-play-state: paused; }
.attention-pill.hidden { display: none; }
.attention-pill svg { width: 15px; height: 15px; }
table.data-table tbody tr.is-attention { background: var(--red-100); }
table.data-table tbody tr.is-attention td:first-child { box-shadow: inset 3px 0 0 var(--red-600); }
table.data-table tbody tr.is-attention .attention-note { animation: attention-blink 1.2s ease-in-out infinite; }
.attention-note { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: var(--fs-11); color: var(--red-600); font-variation-settings: 'wght' 600; font-weight: 600; }
.attention-note svg { width: 13px; height: 13px; }

/* ---------- Request queue pop-up (staff) ---------- */
.queue-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); }
.queue-item.is-first { border-color: var(--brass-600); box-shadow: inset 3px 0 0 var(--brass-600); }
.queue-main { flex: 1; min-width: 0; }
.queue-title { font-weight: 600; }

.idle-hot { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--amber-100); color: var(--amber-600); font-weight: 600; }

/* ---------- Balance Shortage ---------- */
.bs-result { margin-top: 4px; }
.bs-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--fs-13); color: var(--ink-500, inherit); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.bs-verdict { display: inline-block; padding: 8px 14px; border-radius: var(--radius-md, 10px); font-size: var(--fs-16); font-weight: 600; font-variant-numeric: tabular-nums; }
.bs-verdict span { font-size: var(--fs-13); font-weight: 400; opacity: .85; }
.bs-verdict.is-zero { background: var(--green-100); color: var(--green-600); }
.bs-verdict.is-short { background: var(--blue-100); color: var(--blue-600); }
.bs-verdict.is-excess { background: var(--amber-100); color: var(--amber-600); }
.bs-card { border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 14px; margin-bottom: 12px; }
.bs-calc-table td:first-child { width: 45%; }
@media (max-width: 720px) { .bs-calc.cols-4 { grid-template-columns: 1fr 1fr; } }

/* ---------- People picker toolbar (app.js enhancePicker) ---------- */
.picker-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.picker-bar > .input[type=search] { flex: 1; min-width: 180px; }
.picker-all { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; font-size: var(--fs-13); }

/* ---------- Letter pad thumbnails ---------- */
.pad-thumb { position: relative; width: 210px; height: 297px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.pad-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.pad-thumb .pad-area { position: absolute; outline: 1.5px dashed var(--red-600); background: color-mix(in srgb, var(--red-600) 6%, transparent); }

/* ---------- Application status timeline ---------- */
.status-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.status-timeline li { position: relative; padding: 0 0 12px 10px; }
.status-timeline li::before { content: ''; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brass-600); }

/* ---------- Training acknowledgement ---------- */
.ack-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ack-row .ack-text { margin-bottom: 6px; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 10px; }

/* ---------- Declarations / consent text ---------- */
.consent-box { white-space: pre-wrap; font-size: var(--fs-13); line-height: 1.55; max-height: 260px; overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); background: var(--paper-100, #fafafa); }

/* ---------- Page work timer (staff top bar) ---------- */
.page-work { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); white-space: nowrap; }
.page-work button { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; color: var(--ink-900); }
.page-work button:hover { border-color: var(--brass-600); }
.page-work.is-running { padding: 3px 4px 3px 12px; border: 1px solid color-mix(in srgb, var(--green-600) 45%, transparent); border-radius: 999px; background: var(--green-100); color: var(--green-600); }
.page-work.is-over { border-color: color-mix(in srgb, var(--amber-600) 55%, transparent); background: var(--amber-100); color: var(--amber-600); }
.page-work .pw-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.page-work .pw-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* A request came in while the service timer runs: answer (open it) or Wait before the countdown ends. */
.page-work.is-alert { border-color: color-mix(in srgb, var(--red-600) 55%, transparent); background: var(--red-100, #fde8e8); color: var(--red-600); }
.page-work .pw-alert { font-weight: 600; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.page-work .pw-state { font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--amber-100); color: var(--amber-600); }
.page-work button[data-pw="wait"] { border-color: var(--red-600); color: var(--red-600); font-weight: 600; }
@media (max-width: 720px) { .page-work .pw-label { display: none; } .page-work .pw-alert { max-width: 140px; } }

/* ---------- Letter editor (public/js/letter-editor.js) ---------- */
.letter-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; }
.letter-toolbar-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }

/* ---- Document editor, Google-Docs style (public/js/letter-editor.js) ---- */
/* Sticks under the app's top bar while the page scrolls (inside a window: at its top). */
.docs-toolbar { position: sticky; top: calc(var(--stick-top) + 4px); z-index: 5; background: var(--paper-100, #f1f3f4); border: 1px solid var(--line); border-radius: 20px; padding: 4px 8px; gap: 2px; }
.modal .docs-toolbar { top: 0; }
.docs-toolbar .btn { min-width: 30px; justify-content: center; padding: 4px 7px; }
.docs-toolbar .btn.is-on { background: color-mix(in srgb, var(--blue-600, #1a73e8) 16%, transparent); color: var(--blue-600, #1a73e8); }
.docs-toolbar .docs-select { height: 30px; padding: 0 6px; font-size: 13px; background: transparent; border-color: transparent; }
.docs-toolbar .docs-select:hover { border-color: var(--line); background: var(--white); }
.docs-editor h1 { font-size: 20pt; margin: .4em 0 .3em; } .docs-editor h2 { font-size: 16pt; margin: .4em 0 .3em; } .docs-editor h3 { font-size: 13pt; margin: .4em 0 .3em; }
.docs-editor blockquote { margin: .4em 0 .4em 12mm; padding-left: 4mm; border-left: .8mm solid #ccc; }
/* Field chips — only while editing: on a printed / shown document they are plain text. */
[contenteditable="true"] .mf { display: inline-block; font-size: 0; line-height: 1.2; padding: 0 5px; margin: 0 1px; border-radius: 10px; background: #e8f0fe; box-shadow: inset 0 0 0 1px #aecbfa; vertical-align: baseline; cursor: default; user-select: all; }
[contenteditable="true"] .mf::before { content: attr(data-label); font-size: 11.5px; font-family: system-ui, sans-serif; color: #174ea6; white-space: nowrap; }
/* The label shows the field's own size, font, bold and italic (what prints): --mf-fs carries the size
   of the text around the field into it (a registered length inherits as px, so the chip's font-size 0
   does not touch it). */
@property --mf-fs { syntax: '<length>'; inherits: true; initial-value: 14px; }
[contenteditable="true"], [contenteditable="true"] :not(.mf) { --mf-fs: 1em; }
[contenteditable="true"] .mf::before { font-size: max(9px, calc(var(--mf-fs) * 0.85)); font-family: inherit; }
[contenteditable="true"] .mf.mf-if { background: #fef7e0; box-shadow: inset 0 0 0 1px #f9d77e; }
[contenteditable="true"] .mf.mf-if::before { color: #8a5a00; font-weight: 600; }
[contenteditable="true"] .mf.mf-miss { background: #fce8e6; box-shadow: inset 0 0 0 1px #f28b82; }
[contenteditable="true"] .mf.mf-miss::before { color: #a50e0e; }
[contenteditable="true"] .mf:not([data-label]) { font-size: inherit; }
[contenteditable="true"] .mf:not([data-label])::before { content: none; }
/* Editor + database panel side by side. */
.docs-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } } /* the paper scrolls in its canvas, the page does not (Phase 6 layouts) */
.docs-panel { position: sticky; top: calc(var(--stick-top) + 8px); border: 1px solid var(--line); border-radius: 10px; background: var(--white); display: flex; flex-direction: column; max-height: 78vh; overflow: hidden; }
.docs-panel-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px 6px; }
.docs-panel-search { margin: 0 10px 8px; width: auto; height: 32px; }
.docs-panel-body { overflow: auto; padding: 0 6px 10px; }
.docs-group { border-top: 1px solid var(--line); }
.docs-group-head { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 6px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-900); }
.docs-group-head:hover { background: var(--paper-100); }
.docs-col { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 18px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.docs-col:hover { background: #e8f0fe; color: #174ea6; }
.docs-group [data-table], .docs-group [data-if] { margin: 4px 0 6px 18px; }
.letter-table-menu { position: relative; }
.letter-table-menu > summary { list-style: none; cursor: pointer; }
.letter-table-menu > summary::-webkit-details-marker { display: none; }
.letter-table-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: 300px; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--paper-0, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); }
.letter-table-pop hr { border: none; border-top: 1px solid var(--line); margin: 2px 0; }
.letter-paper table td, .letter-paper table th { min-width: 24px; }
.letter-paper [data-page-break] { border-top: 1px dashed #aaa; margin: 10px 0; }
/* Stock order: the declaration shown before agreeing (Order Stock) */
.letter-paper.order-decl { max-height: 46vh; overflow: auto; padding: 20px 24px; font-size: 14px; box-shadow: none; }
/* A wording box that is edited in place keeps a focus mark even where its page took the paper's shadow away (Phase 6 keyboard). */
.letter-paper[contenteditable="true"]:focus-visible, .letter-paper[contenteditable="true"]:focus { outline: 2px solid var(--brass-600); outline-offset: 2px; }
.letter-sheet-wrap { overflow-x: auto; }
@media print {
  [data-page-break] { border: none !important; margin: 0 !important; }
}
.field-picker { position: relative; display: inline-block; }
.field-picker > summary { list-style: none; cursor: pointer; }
.field-picker > summary::-webkit-details-marker { display: none; }
.field-picker-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: min(460px, 90vw); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--paper-0, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); }
.field-picker-cols { max-height: 240px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
table.data-table tbody tr.is-subtotal td { background: var(--paper-100); }
.letter-color { position: relative; display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.letter-color:hover { background: var(--paper-100); }
.letter-color input[type=color] { width: 18px; height: 18px; padding: 0; border: none; background: none; cursor: pointer; }
.letter-zoom { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--paper-0, #fff); }
/* ---------- Print designs ---------- */
.design-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; border: 1px solid transparent; margin-bottom: 4px; }
.design-item:hover { background: var(--paper-100); }
.design-item.is-active { border-color: var(--line); background: var(--paper-100); }
.design-section { border-bottom: 1px solid var(--line); padding: 10px 0; }
.design-section > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
/* Print designs: a tiny page showing where the stamp space and the two signature lines go. */
.sign-explain { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.sign-explain-page { width: 150px; flex: none; aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: 4px; background: var(--white); padding: 8px; display: flex; flex-direction: column; gap: 5px; font-size: 9px; line-height: 1.2; color: var(--ink-500); }
.sign-explain-page .se-gap { height: 30%; border: 1px dashed var(--amber-600); background: var(--amber-100); display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 3px; }
.sign-explain-page .se-text { height: 5px; background: var(--paper-100); border-radius: 2px; }
.sign-explain-page .se-text.short { width: 60%; }
.sign-explain-page .se-sign { margin-top: auto; display: flex; justify-content: space-between; gap: 6px; }
.sign-explain-page .se-sign > div { width: 48%; display: flex; flex-direction: column; }
.sign-explain-page .se-sign > div:last-child { text-align: right; }
.sign-explain-page .se-img { min-height: 11px; }
.sign-explain-page .se-sign i { display: block; border-top: 1px solid var(--ink-700); margin: 2px 0; }
.design-canvas { overflow: auto; max-height: 75vh; background: repeating-conic-gradient(var(--paper-100) 0 25%, transparent 0 50%) 0 0 / 16px 16px; padding: 24px; border-radius: 8px; border: 1px solid var(--line); }
.design-sheet { margin: 0 auto !important; max-width: none !important; box-sizing: border-box; overflow: hidden; background-repeat: no-repeat; box-shadow: 0 2px 12px rgba(0,0,0,.18) !important; line-height: 1.35; }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kind-card { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.kind-card:has(input:checked) { border-color: var(--brand-600, #1f3a5f); background: var(--paper-100); }
.kind-card span { display: flex; flex-direction: column; } .kind-card small { color: var(--ink-500, #666); }

/* ---------- User Access: all pages grid ---------- */
.page-grid th.grid-col, .page-grid td.grid-col { text-align: center; min-width: 96px; }
.page-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--paper-0, #fff); }
.page-grid tr.grid-group td { background: var(--paper-100); position: sticky; top: 0; }
.page-grid td.is-off { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--paper-100) 6px 12px); opacity: .55; }

/* ---------- Letter pads ---------- */
.pad-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.pad-card { display: flex; gap: 14px; align-items: flex-start; }
/* ---------- Signatories ---------- */
.sig-thumb { position: relative; width: 190px; height: 110px; flex: 0 0 190px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px;
  background: repeating-conic-gradient(#f1f1f1 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.sig-thumb img { max-width: 170px; max-height: 90px; }
.sig-thumb img.seal { position: absolute; right: 4px; bottom: 4px; max-width: 54px; max-height: 54px; opacity: .85; }
.sig-preview { margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: repeating-conic-gradient(#f1f1f1 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.sig-preview img { max-width: 100%; max-height: 110px; }

.settle-options { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--paper-100); }

/* Transaction.txt (views/partials/bank-file-settings.ejs, public/js/bank-file.js): the sample lines exactly as written. */
.bf-sample { margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-100); font: 12.5px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; white-space: pre; overflow-x: auto; max-height: 280px; }
.bf-fields td, .bf-fields th { vertical-align: middle; }
.bf-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.bf-test-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--brass-050); border: 1px solid var(--brass-100); font-size: 12px; font-weight: 600; }

/* Letter / print-design editor: table tools shown while the cursor is in a table
   (public/js/letter-editor.js), and the cells selected for merging. */
.docs-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; flex-basis: 100%; margin-top: 4px; padding: 4px 6px; border-radius: var(--radius-md); background: var(--brass-050); border: 1px solid var(--brass-100); }
.docs-tablebar[hidden] { display: none; }
.docs-tb-label { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--brass-700); padding: 0 6px 0 2px; }
.docs-tablebar .btn { white-space: nowrap; }
[contenteditable="true"] td.lt-sel, [contenteditable="true"] th.lt-sel { background-color: rgba(37, 99, 235, 0.16) !important; outline: 2px solid #2563eb; outline-offset: -2px; }

/* Data table window (letter-editor.js dataTableDialog) */
.dt-backdrop { z-index: 2500; }
.dt-modal { width: min(880px, calc(100vw - 32px)); max-width: none; }
.dt-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 720px) { .dt-grid { grid-template-columns: 1fr; } }
.dt-cols { margin-top: 6px; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; }
.dt-group { border: 0; margin: 0 0 8px; padding: 0; }
.dt-group legend { font-size: var(--fs-11); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); padding: 4px 0; }
.dt-group .check-row { padding: 2px 0; }
.dt-order { margin: 6px 0 0; padding-left: 22px; max-height: 40vh; overflow: auto; }
.dt-order li { display: flex; align-items: center; gap: 4px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-13); }
.dt-order li span { flex: 1; min-width: 0; }
.dt-order li.text-muted { border: 0; display: list-item; }
/* "Print a row of column titles": each column's title, typed in the list (public/js/letter-editor.js). */
.dt-order .dt-col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dt-order .dt-col-main > span { flex: none; }
.dt-order .dt-title { padding: 4px 8px; font-size: var(--fs-13); }
.dt-order .dt-title-note { font-size: 11px; color: var(--ink-500, #6b7280); }

/* Top bar Dashboard button with the count of requests waiting (pendingSummary.js). */
.dash-link { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.dash-link .dash-count { padding: 1px 7px; font-size: 11px; }
.dash-link .dash-count::before { display: none; }
@media (max-width: 720px) { .dash-link-text { display: none; } }

/* SYSADMIN: the working company in the top bar (src/lib/adminCompany.js). */
.admin-company { min-width: 200px; max-width: 280px; }
.admin-company .input { height: 32px; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 720px) { .admin-company { min-width: 0; max-width: 150px; } }

/* Busy state while the server answers (public/js/app.js → Busy cursor). */
html.is-busy, html.is-busy *, html.is-busy-soft, html.is-busy-soft * { cursor: progress !important; }
.busy-layer { position: fixed; inset: 0; z-index: 2147483000; background: transparent; cursor: progress; }
.busy-layer[hidden] { display: none; }

/* Agent Contacts (views/agent/contacts.ejs): rows of today's contacts stand out. */
.data-table tr.is-today > td { background: var(--blue-100); }
.data-table tr.is-today > td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }

/* ---------- One report row on a single page (reports/run.ejs) ---------- */
table.data-table tbody tr.is-clickable { cursor: pointer; }
table.data-table tbody tr.is-clickable:focus-visible { outline: 2px solid var(--blue-600, #2563eb); outline-offset: -2px; }
.row-detail-bar { position: sticky; top: var(--stick-top); z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; margin-bottom: 8px; background: var(--paper-0, #fff); }
.row-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px 24px; margin: 0; }
.row-detail-grid dt { font-size: var(--fs-11); color: var(--ink-500, #666); margin-bottom: 2px; }
.row-detail-grid dd { margin: 0; color: var(--ink-900); overflow-wrap: anywhere; font-variation-settings: 'wght' 520; }
/* The row's person (src/lib/reportPerson.js): View details and their open Service Desk tickets. */
.row-person { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.row-person-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-person-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-100); color: var(--blue-600); }
.row-person-avatar svg { width: 20px; height: 20px; }
.row-person-who { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-person-who strong { font-size: var(--fs-16); color: var(--ink-900); overflow-wrap: anywhere; font-variation-settings: 'wght' 620; }
.row-person-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.row-person-tickets { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.row-person-tickets:empty { display: none; }
.row-person-tickets-head { font-size: var(--fs-13); color: var(--ink-700); font-variation-settings: 'wght' 600; }
.row-tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 8px; }
.row-ticket { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); color: inherit; text-decoration: none; background: var(--paper-0, #fff); transition: border-color .15s, background .15s; }
.row-ticket:hover, .row-ticket:focus-visible { border-color: var(--blue-600); background: var(--paper-100); text-decoration: none; }
.row-ticket:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.row-ticket-icon, .row-ticket-go { flex: none; display: inline-flex; color: var(--blue-600); }
.row-ticket-icon svg, .row-ticket-go svg { width: 18px; height: 18px; }
.row-ticket-go { color: var(--ink-500, #666); }
.row-ticket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-ticket-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-ticket-no { font-variation-settings: 'wght' 620; color: var(--ink-900); }
.row-ticket-meta { font-size: var(--fs-13); color: var(--ink-500, #666); overflow-wrap: anywhere; }
@media (max-width: 640px) { .row-person-acts { width: 100%; } .row-person-acts .btn { flex: 1 1 auto; justify-content: center; } }

/* Agreement editor: changed fields amber, fields still blank red-dashed (agreements/index.ejs) */
.input.is-changed { background: var(--amber-100, #fff4d6); border-color: var(--amber-600, #b7791f); }
.input.is-blank { border-style: dashed; border-color: var(--red-600, #c0392b); }
.btn-success { background: var(--green-600); border-color: var(--green-600); color: var(--on-state); }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); text-decoration: none; }

.docs-col .docs-copy { margin-left: auto; font-size: 11px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink-700); cursor: pointer; }
.docs-col .docs-copy:hover { background: #e8f0fe; color: #174ea6; border-color: #174ea6; }

.cond-builder { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0; background: var(--paper-100, #f6f7f8); }
.cond-builder .input { font-size: 12.5px; padding: 5px 8px; }


/* =====================================================================
   Obsidian Glass — deep charcoal surfaces, translucent blurred panels,
   electric-indigo actions and neon-cyan active states. Tokens only (like
   the other palettes); the glass treatment is the block below it.
   Contrast: text #eceefb on #10131c ≈ 15:1, secondary #a3a9c4 ≈ 7.5:1,
   white on the indigo button #5057e8 ≈ 5.3:1.
   ===================================================================== */
[data-theme="obsidian"] {
  color-scheme: dark;
  --ink-900: #eceefb; --ink-700: #cdd1e6; --ink-500: #a3a9c4; --ink-300: #6b7292;
  --paper-0: #0b0d12; --paper-100: #141826; --paper-200: #1c2133; --line: #262c45; --line-strong: #39416a;
  --white: #10131c;
  --brass-700: #aab0ff; --brass-600: #5057e8; --brass-500: #7b82ff; --brass-100: #1d2150; --brass-050: #151837;
  --green-600: #5ee0a0; --green-100: #0e2a20; --red-600: #ff9090; --red-100: #35161c;
  --amber-600: #f2c360; --amber-100: #30260f; --blue-600: #8fc4ff; --blue-100: #10243b;
  --inverse-bg: #07080c; --sidebar-fg: #aeb4d0; --sidebar-muted: #7a81a3; --sidebar-active: rgba(80, 87, 232, 0.34);
  --on-accent: #ffffff; --accent-cyan: #22e5ff;
  --glass-bg: rgba(20, 24, 38, 0.62); --glass-edge: rgba(150, 160, 255, 0.16); --glass-blur: blur(18px) saturate(1.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5); --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.65); --shadow-lg: 0 20px 56px -12px rgba(0,0,0,0.8);
}
[data-theme="obsidian"] body {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(80, 87, 232, 0.20), transparent 60%),
    radial-gradient(760px 480px at 100% 0%, rgba(34, 229, 255, 0.10), transparent 60%),
    var(--paper-0);
  background-attachment: fixed;
}
[data-theme="obsidian"] .panel, [data-theme="obsidian"] .table-wrap, [data-theme="obsidian"] .stat-row,
[data-theme="obsidian"] .topbar, [data-theme="obsidian"] .dropdown-panel {
  background: var(--glass-bg); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
[data-theme="obsidian"] .sidebar {
  background: rgba(9, 10, 16, 0.78); border-right: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
[data-theme="obsidian"] .panel, [data-theme="obsidian"] .table-wrap { transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
[data-theme="obsidian"] .panel:hover { border-color: rgba(150, 160, 255, 0.28); }
[data-theme="obsidian"] .input, [data-theme="obsidian"] select.input, [data-theme="obsidian"] textarea.input {
  color: var(--ink-900); background: rgba(8, 10, 16, 0.55); border-color: var(--line-strong);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
[data-theme="obsidian"] .input:focus, [data-theme="obsidian"] .input:focus-within { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(34, 229, 255, 0.2); }
[data-theme="obsidian"] .btn-primary { background: linear-gradient(135deg, #5057e8, #6c5ce7); border-color: transparent; color: #fff; }
[data-theme="obsidian"] .btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #6169f2, #7d6ef0); border-color: transparent; box-shadow: 0 0 0 3px rgba(80, 87, 232, 0.35); }
[data-theme="obsidian"] .btn:focus-visible, [data-theme="obsidian"] a:focus-visible, [data-theme="obsidian"] button:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
[data-theme="obsidian"] .data-table tbody tr:hover { background: rgba(80, 87, 232, 0.12); }
[data-theme="obsidian"] img.dash-photo { background: var(--paper-200); }
[data-theme="obsidian"] .nav-item.is-active, [data-theme="obsidian"] .nav-item[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent-cyan); }
[data-theme="obsidian"] .theme-swatch.is-current i { border-color: var(--accent-cyan); }
@media (prefers-reduced-transparency: reduce) {
  [data-theme="obsidian"] { --glass-bg: #141826; --glass-blur: none; }
  [data-theme="obsidian"] .sidebar { background: #090a10; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Phones: the name beside the avatar would widen the page; the avatar still opens the profile menu. */
@media (max-width: 520px) { .profile-name { display: none; } }

/* The full address as it reads (plot / building + village + post office + PIN): bold and highlighted so it can be checked and corrected. */
.full-address { margin: 4px 0 14px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--amber-100); border: 1px solid color-mix(in srgb, var(--amber-600) 30%, transparent); color: var(--ink-900); font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.full-address.is-empty { font-weight: 400; color: var(--ink-500); background: var(--paper-100); border-color: var(--line); }

/* Break button and "Are you still there?" (views/partials/break-widget.ejs) */
/* Private OCR (docs/PRIVATE_OCR.md): the floating button above the theme button, and the capture stage. */
/* Above every window (a document's review window is 100): it can be pressed while one is open. */
.pocr-fab { position: fixed; right: calc(var(--menu-right) + 16px); bottom: calc(var(--menu-bottom) + 64px); z-index: 2900; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-md); font: inherit; font-weight: 600; cursor: pointer; }
.pocr-fab:hover { border-color: var(--blue-600); }
@media print { .pocr-fab { display: none; } }
#privateOcrModal { z-index: 2950; }
.pocr-overlay { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; background: rgba(16, 20, 34, 0.72); }
.pocr-overlay-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-md); font-size: var(--fs-13); }
.pocr-overlay-actions { margin-left: auto; display: inline-flex; gap: 6px; }
.pocr-overlay-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.pocr-overlay-stage canvas { max-width: 100%; max-height: 100%; cursor: crosshair; touch-action: none; box-shadow: 0 0 0 1px var(--line-strong); }
.pocr-settings summary { cursor: pointer; }
/* Scan a serial number (docs/SERIAL_SCAN.md). */
.ss-btn { margin-top: 6px; }
.ss-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ss-stage { position: relative; margin-top: 10px; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.ss-stage video { display: block; width: 100%; max-height: 55vh; min-height: 220px; object-fit: cover; cursor: crosshair; }
.ss-aim { position: absolute; inset: 24% 8%; border: 3px solid rgba(255, 255, 255, 0.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); pointer-events: none; overflow: hidden; transition: border-color 0.15s; }
.ss-line { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: #e5484d; box-shadow: 0 0 8px #e5484d; animation: ss-sweep 1.8s ease-in-out infinite alternate; }
@keyframes ss-sweep { from { top: 12%; } to { top: 88%; } }
.ss-stage.ss-hit .ss-aim { border-color: #30a46c; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35), inset 0 0 0 999px rgba(48, 164, 108, 0.25); }
.ss-stage.ss-hit .ss-line { background: #30a46c; box-shadow: 0 0 8px #30a46c; }
.ss-focus { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border: 2px solid #ffd60a; border-radius: 50%; pointer-events: none; }
.ss-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center; }
.ss-tool { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ss-tool[aria-pressed="true"] { background: #ffd60a; color: #000; }
.ss-zoom { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 22px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: var(--fs-13); }
.ss-zoom input { width: 120px; }
.ss-read { padding-left: 18px; }
@media (prefers-reduced-motion: reduce) { .ss-line { animation: none; } }
/* The Good-morning window (docs/GOOD_MORNING.md): above the gate windows it explains. */
#gmModal.gm-above { z-index: 150; }
#gmModal .gm-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; margin-bottom: 6px; }
#gmModal .gm-item summary { cursor: pointer; }
#gmModal .gm-icon { font-size: 28px; line-height: 1; }
.pocr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pocr-canvas-wrap { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; touch-action: none; }
.pocr-canvas-wrap canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; }
.pocr-box { position: absolute; border: 2px solid var(--blue-600); background: color-mix(in srgb, var(--blue-600) 14%, transparent); pointer-events: none; }
.break-fab { position: fixed; left: calc(var(--menu-left) + 16px); bottom: calc(var(--menu-bottom) + 16px); z-index: 60; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-md); font: inherit; font-weight: 600; cursor: pointer; }
.break-fab:hover { background: var(--amber-100); }
.break-fab svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .break-fab span { display: none; } .break-fab { padding: 12px; } }
.idle-clock { font-size: 44px; font-weight: 700; text-align: center; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--red-600); }
/* "Working in other applications too?" — the offer to let the portal see the computer's activity (break-widget.js). */
.presence-offer { position: fixed; left: calc(var(--menu-left) + 16px); bottom: calc(var(--menu-bottom) + 72px); z-index: 60; width: min(380px, calc(100vw - var(--menu-w) - 32px)); padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--white); box-shadow: var(--shadow-md); font-size: var(--fs-13); color: var(--ink-700); }
.presence-offer-text { display: flex; gap: 10px; align-items: flex-start; }
.presence-offer-text svg { flex: none; width: 20px; height: 20px; color: var(--brass-600); margin-top: 2px; }
.presence-offer-text strong { display: block; color: var(--ink-900); margin-bottom: 2px; }
.presence-offer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media print { .presence-offer { display: none; } }
@media print { .break-fab { display: none; } }

/* Phones: the staff top bar (page title, status, three work clocks, buttons) wraps onto a second line instead of making the whole page wider than the screen. */
@media (max-width: 640px) {
  .topbar { height: auto; min-height: var(--topbar-h); flex: 0 0 auto; flex-wrap: wrap; padding: 6px 12px; gap: 6px 8px; }
  .topbar .work-timer, .topbar .page-work { flex-wrap: wrap; max-width: 100%; gap: 6px; }
  .topbar .page-work { white-space: normal; }
  .topbar .work-timer .sep { display: none; }
}
/* 200 % zoom and small laptops (a 1366 px screen at 200 % is 683 CSS px): the staff top bar with its status and work clock
   needs about 820 px, so up to 960 px it may wrap too — the bell and the profile menu were pushed off the screen (Phase 9).
   A laptop of 1024 – 1280 px: the staff and software admin bar (status, work clock, shortcuts) needs up to 1,255 px (Phase 6
   layouts crawl, 2026-11-29), so it may wrap up to 1280 px; it wraps only when it does not fit. */
@media (min-width: 641px) and (max-width: 1280px) {
  .topbar { height: auto; min-height: var(--topbar-h); flex: 0 0 auto; flex-wrap: wrap; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
}

/* Phones: a wide table or form that a view did not wrap in .table-scroll scrolls inside the content area; the top bar and the page itself keep the screen's width. */
@media (max-width: 720px) {
  .main-col { min-width: 0; }
  .content { overflow-x: auto; }
}

/* Documents: an expired one is red wherever it is looked at; the banner says how many. */
tr.doc-expired > td { background: color-mix(in srgb, var(--red-100) 70%, transparent); }
tr.doc-expired > td:first-child { box-shadow: inset 3px 0 0 var(--red-600); }
.doc-expiry-banner { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid; font-size: var(--fs-14); }
.doc-expiry-banner.is-expired { background: var(--red-100); border-color: color-mix(in srgb, var(--red-600) 35%, transparent); color: var(--red-600); }
.doc-expiry-banner.is-soon { background: var(--amber-100); border-color: color-mix(in srgb, var(--amber-600) 35%, transparent); color: var(--amber-600); }

/* ---------------- Inventory (Assign products, stock card, item history; docs/INVENTORY.md) ---------------- */
.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; }
/* Keyboard (Phase 6): the first Tab offers "Skip to the page" (layout.ejs), past the menu and the top bar. */
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 2900; }
.skip-link:focus { top: 8px; }
main.content:focus { outline: none; }
.link-btn { background: none; border: none; padding: 0; color: var(--brass-700); text-decoration: underline; cursor: pointer; font: inherit; }
.link-btn:hover { color: var(--ink-900); }
.filter-chip svg { width: 14px; height: 14px; }
.inv-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 6px; }
.inv-term { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 10px; background: var(--white); }
.inv-term.is-picked { border-color: var(--brass-600); box-shadow: inset 0 0 0 1px var(--brass-600); }
.inv-term-head { display: flex; justify-content: space-between; gap: 6px; font-variation-settings: 'wght' 600; color: var(--ink-900); }
.inv-term ul { margin: 4px 0 0; padding-left: 16px; }
.inv-term li { margin: 1px 0; }
.inv-warn { color: var(--amber-600); }
tr.inv-unavailable td { color: var(--ink-500); }

/* ---------------- GPS & Location (coordinate picker, live receiver, maps; docs/GPS_LOCATION.md) ---------------- */
.coords-box { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; background: var(--paper-0, var(--white)); }
.coords-box .coords-methods { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.gps-panel { margin-top: 10px; display: grid; gap: 10px; }
.gps-bridges { display: flex; flex-wrap: wrap; gap: 6px; }
.gps-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; background: var(--white); }
.gps-card.is-live { border-color: var(--green-600); box-shadow: inset 3px 0 0 var(--green-600); }
.gps-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.gps-dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 4px 14px; margin: 0 0 8px; font-size: var(--fs-13); }
.gps-dl dt { color: var(--ink-500); }
.gps-dl dd { margin: 0; color: var(--ink-900); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gps-why { color: var(--amber-600); }
.gps-map { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 340px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--paper-100); }
.gps-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gps-map-js { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.loc-method { border-left: 3px solid var(--line-strong, var(--line)); padding: 4px 0 4px 10px; margin-top: 6px; }
.loc-method.is-gps { border-left-color: var(--green-600); }
.loc-method.is-device { border-left-color: var(--brass-600); }
.loc-method.is-manual { border-left-color: var(--amber-600); }
.gps-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-28); letter-spacing: 0.08em; padding: 8px 14px; border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--radius-md); display: inline-block; background: var(--paper-100); }
.gps-cmd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-13); background: var(--paper-100); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) { .gps-dl { grid-template-columns: 1fr; } .gps-dl dt { margin-top: 4px; } }

/* GPS Settings (views/gps/settings.ejs): setting cards with switches */
.gps-set { max-width: 880px; display: grid; gap: 16px; }
.gps-set .panel + .panel { margin-top: 0; }
.set-card-head { margin-bottom: 14px; }
.set-card-head h2 { margin-bottom: 4px; }
.set-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.set-icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--paper-100); color: var(--ink-700); display: flex; align-items: center; justify-content: center; }
.set-icon svg { width: 20px; height: 20px; }
.set-title { font-size: var(--fs-15, 15px); font-variation-settings: 'wght' 600; color: var(--ink-900); }
.set-desc { font-size: var(--fs-13); color: var(--ink-500); margin-top: 2px; line-height: 1.45; }
.set-sub { border-top: 1px solid var(--line); padding-top: 14px; }
.set-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 6px; }
.set-more .set-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.set-fields .field { margin-bottom: 0; }
.set-fields .input-group .input { min-width: 0; }
.set-fields .input-group-addon { white-space: nowrap; }
.set-more summary { cursor: pointer; list-style-position: inside; }
.set-tools { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.set-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 4px; background: var(--paper-100); border-radius: var(--radius-md); }
.set-preview-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-strong, var(--line)); border-radius: var(--radius-md); background: var(--white); font-size: var(--fs-13); color: var(--ink-900); }
.set-preview-btn svg { width: 15px; height: 15px; }
.set-preview-btn.is-off { opacity: 0.45; text-decoration: line-through; }
.set-card.is-off .set-sub, .set-card.is-off .set-row { opacity: 0.55; }
.set-save { position: sticky; bottom: var(--stick-bottom); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06); }
#gpsDirty { color: var(--amber-600); font-variation-settings: 'wght' 600; }
.switch { position: relative; display: inline-flex; flex: none; width: 44px; height: 24px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--paper-200); border: 1px solid var(--line-strong, var(--line)); transition: background 0.15s, border-color 0.15s; }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--brass-600); border-color: var(--brass-600); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brass-600); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-track { opacity: 0.55; }
@media (max-width: 720px) {
  .set-fields, .set-more .set-fields { grid-template-columns: minmax(0, 1fr); }
  .set-row { grid-template-columns: minmax(0, 1fr) auto; }
  .set-icon { display: none; }
}
.link-btn.text-sm { font-size: var(--fs-13); }

/* ---------- Daily Work Report, Earnings Goals and the personal pop-ups (migration 155) ---------- */
.badge-purple { background: color-mix(in srgb, var(--blue-100) 55%, var(--red-100)); color: color-mix(in srgb, var(--blue-600) 60%, var(--red-600)); }
.dr-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.dr-days { position: sticky; top: calc(var(--stick-top) + 16px); max-height: calc(100vh - var(--stick-top) - var(--stick-bottom) - 40px); overflow: auto; }
.dr-day-list { list-style: none; margin: 0; padding: 0; }
.dr-day-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--radius-md); color: var(--ink-900); text-decoration: none; }
.dr-day-list a:hover { background: var(--paper-100); }
.dr-day-list a.is-current { background: var(--brass-050, var(--paper-200)); box-shadow: inset 3px 0 0 var(--brass-600); }
.dr-facts { display: grid; gap: 6px; }
.dr-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dr-insights { margin: 0; padding-left: 18px; }
.dr-insights li { margin-bottom: 6px; }
.eg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.eg-switches { display: grid; gap: 8px; }
.nudge-modal { max-width: 520px; }
.nudge-figures { margin-bottom: 12px; }
.nudge-bar { height: 10px; border-radius: 999px; background: var(--paper-200); overflow: hidden; margin-bottom: 4px; }
.nudge-bar span { display: block; height: 100%; background: var(--green-600); border-radius: 999px; }
.wsum-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.wsum-tile { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--paper-0, var(--white)); }
.wsum-value { font-size: var(--fs-19); font-variation-settings: 'wght' 650; font-variant-numeric: tabular-nums; }
.wsum-label { font-size: var(--fs-13); color: var(--ink-700); }
.wsum-note { font-size: var(--fs-11); color: var(--ink-500); }
.wsum-h { font-size: var(--fs-14); margin: 12px 0 4px; }
.wsum-list { margin: 0; padding-left: 18px; }
.wsum-list li { margin-bottom: 4px; }
@media (max-width: 900px) { .dr-layout, .dr-two { grid-template-columns: minmax(0, 1fr); } .dr-days { position: static; max-height: 240px; } }
@media print { .dr-days { display: none; } .dr-layout { display: block; } }

/* A page inside the Request Centre's panel (src/middleware/embed.js): the page alone. */
body.is-embedded .content { padding: 16px 18px 32px; max-width: none; }
body.is-embedded .app-shell { min-height: 0; }

/* ---------------- Activity Hub (views/activity/hub.ejs, docs/ACTIVITY_HUB.md) ---------------- */
.hub-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.hub-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0; color: var(--ink-700); text-decoration: none; font-size: var(--fs-14); margin-bottom: -1px; }
.hub-tab:hover { background: var(--paper-100); color: var(--ink-900); }
button.hub-tab { background: none; font: inherit; font-size: var(--fs-14); cursor: pointer; }
.hub-tab.is-active { background: var(--white); border-color: var(--line); color: var(--ink-900); font-weight: 600; }
.hub-filters { padding: 14px 16px; }
.hub-filter-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.hub-filter-row .field { margin-bottom: 0; min-width: 140px; }
.hub-filter-row .hub-wide { flex: 1 1 220px; }
.hub-filter-row .hub-go { min-width: 0; display: flex; gap: 6px; }
.kpi-main { border-color: var(--brass-500, var(--line-strong)); }
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: var(--line-strong); }
.kpi .hub-v-sm { font-size: var(--fs-18, 18px); }
.hub-table td.num, .hub-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-table .nowrap { white-space: nowrap; }
.hub-table tr.is-muted td { color: var(--ink-500); }
.hub-where { min-width: 160px; max-width: 260px; }
.hub-path { word-break: break-all; }
.hub-what { min-width: 220px; max-width: 420px; }
.hub-remark { margin-top: 4px; font-size: 12px; line-height: 1.45; }
.hub-decided { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--green-600); font-size: 12px; }
.hub-decided svg { width: 13px; height: 13px; }
.hub-h2 { font-size: var(--fs-18, 18px); margin: 6px 0 10px; }
.hub-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px 18px; align-items: end; }
.hub-rule-check { align-items: flex-start; margin-bottom: 6px; }
.hub-rule-go { display: flex; gap: 6px; flex-wrap: wrap; }
.hub-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; margin-top: 10px; }
.hub-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hub-tool { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); color: inherit; text-decoration: none; background: var(--white); }
.hub-tool:hover { border-color: var(--line-strong); background: var(--paper-100); }
.hub-pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 60vh; overflow: auto; background: var(--paper-100); padding: 12px; border-radius: var(--radius-md, 8px); margin: 0; }
.data-table td.cell-check, .data-table th.cell-check { width: 34px; }

/* Sub-row tables: each record is one <tbody class="rec"> whose own cells span its sub-rows.
   Used by the Report Designer's sub-row lists (views/reports/run.ejs) and by
   "Who was worked for, and what was done" (views/staff/work-report.ejs). */
table.data-table.has-sub tbody.rec tr { background: transparent; }
table.data-table.has-sub tbody.rec:nth-of-type(even) td { background: var(--table-zebra, transparent); }
table.data-table.has-sub tbody.rec:hover td { background: var(--paper-100); }
table.data-table.has-sub tbody.rec td { vertical-align: top; }
table.data-table.has-sub tbody.rec tr:last-child td { border-bottom: 1px solid var(--line); }
table.data-table.has-sub tbody.rec:last-child tr:last-child td { border-bottom: none; }
table.data-table.has-sub td.cell-sub { padding-top: 7px; padding-bottom: 7px; }
table.data-table.has-sub td.cell-sub.has-next { border-bottom: 1px dashed var(--line); }
table.data-table.has-sub td.nowrap { white-space: nowrap; }

/* The way back to the hub, on each detailed page it stands for (views/partials/hub-back.ejs) */
.hub-back { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); background: var(--paper-100); }
.hub-back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-900); text-decoration: none; font-weight: 600; font-size: var(--fs-14); padding: 3px 8px; margin: -3px -8px; border-radius: var(--radius-sm, 6px); }
.hub-back-link:hover { background: var(--white); text-decoration: underline; }
.hub-back-link svg { width: 16px; height: 16px; flex: none; }
.hub-back-here { color: var(--ink-600); font-size: var(--fs-13, 13px); }
.hub-back-here::before { content: "/"; margin-right: 8px; color: var(--ink-400, var(--ink-500)); }
@media print { .hub-back { display: none; } }
@media (max-width: 900px) { .hub-rules { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .hub-tab { padding: 8px 10px; font-size: 13px; }
  .hub-filter-row .field { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .hub-filter-row .hub-wide { flex-basis: 100%; }
}

/* ---------------- Bank account review window (views/partials/account-review.ejs) ---------------- */
.acct-review { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.acct-review-doc { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.acct-doc-view { min-width: 0; }
.acct-doc-none { padding: 48px 12px; text-align: center; width: 100%; }
.acct-holder-name { font-size: var(--fs-18, 18px); font-weight: 600; }
.acct-number-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); background: var(--white); }
.acct-number { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 26px; letter-spacing: 1.5px; font-variant-numeric: tabular-nums; word-break: break-all; margin: 2px 0 4px; }
.acct-number mark { background: var(--red-100); color: var(--red-600); border-radius: 3px; padding: 0 2px; }
.acct-check-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: 1px; }
.acct-check-result { margin-top: 6px; font-size: 13px; color: var(--ink-500); min-height: 18px; }
.acct-check-result.is-match { color: var(--green-600); font-weight: 600; }
.acct-check-result.is-mismatch { color: var(--red-600); font-weight: 600; }
.acct-edit summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-700); }
.acct-edit summary svg { width: 15px; height: 15px; }
.acct-review-foot { flex-wrap: wrap; }
@media (max-width: 860px) {
  .acct-review { grid-template-columns: 1fr; }
  .acct-number { font-size: 22px; }
}

.kpi-link.is-on { border-color: var(--inverse-bg); box-shadow: 0 0 0 1px var(--inverse-bg) inset; }
.hub-tools .panel-head { flex-wrap: wrap; gap: 4px 12px; }
.hub-table td.cell-primary { min-width: 150px; }
.hub-log .hub-what { min-width: 200px; max-width: 340px; }
.hub-log .hub-where { min-width: 130px; max-width: 210px; }
.hub-path { font-size: 11px; }

/* Service Master: each link in its own box with its own tick box (views/services/master.ejs) */
.svc-linkbox { border: 1px solid var(--line); border-radius: var(--radius-md, 8px); padding: 10px 14px 12px; margin: 0 0 14px; min-width: 0; }
.svc-linkbox legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 600; font-size: var(--fs-14); color: var(--ink-700); }
.svc-linkbox legend svg { width: 15px; height: 15px; }
.svc-linkbox .field { margin-bottom: 10px; }
.svc-req { color: var(--red-600); margin-left: 2px; }
.svc-link-preview { margin-top: 8px; font-size: 12px; color: var(--ink-500); word-break: break-all; background: var(--paper-100); border-radius: 6px; padding: 6px 8px; }

/* My Verifications (views/verification/mine.ejs) */
.vconf-list { display: flex; flex-direction: column; gap: 12px; }
.vconf.is-open { border-color: var(--amber-600, var(--line-strong)); }
.vconf-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.vconf-title { font-weight: 600; }
.vconf-head svg { width: 14px; height: 14px; vertical-align: -2px; }
.vconf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Letter Monitoring (views/letters/monitoring.ejs): a letter past the reply days its type allows. */
.text-danger { color: var(--red-600); }
.text-success { color: var(--green-600); }
tr.is-overdue > td { background: var(--red-100); }
/* User Access and the page-limit picker: a sub-page (tab) sits under its page. */
.is-subpage-cell { padding-left: 28px; }
label.is-subpage-cell { padding-left: 22px; }

/* Uploaded files (migration 193, docs/FILE_DOWNLOAD_COPY.md): what the page hides or stops for a login without
   "File download" / "File copy". The server refuses the download itself; this is the page's half. */
html.no-file-download .dstage-open, html.no-file-download [data-file-download] { display: none !important; }
html.no-file-download .dstage img, html.no-file-copy .dstage img, html.no-file-download img[data-zoomable], html.no-file-copy img[data-zoomable] { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* Balance Shortage figures (public/js/balance-calc.js): a field with its ± button — a phone's number pad has no minus key. */
.bs-num { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.bs-num > .input { flex: 1 1 auto; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bs-num > .bs-sign { flex: 0 0 auto; padding: 0 10px; font-weight: 600; line-height: 1; }
.bs-num > .input.is-invalid { border-color: var(--red-600); }
/* On a phone the written-out calculation is read downwards: the line, then how it is worked out and its value —
   a three-column table there pushed the values off the screen. */
@media (max-width: 640px) {
  table.bs-calc-table { min-width: 0; width: 100%; display: block; }
  .bs-calc-table tbody { display: block; }
  .bs-calc-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 10px; align-items: baseline; }
  .bs-calc-table td { display: block; padding: 0; border: 0; background: none; }
  .bs-calc-table td:first-child { grid-column: 1 / -1; width: auto; }
  .bs-calc-table td:nth-child(2) { text-align: left; font-size: var(--fs-13); color: var(--ink-500, #64748b); overflow-wrap: anywhere; }
  .bs-calc-table td:nth-child(3) { text-align: right; white-space: nowrap; }
}

/* Unread mail notifications (src/lib/mail/unread.js): the count beside Mail in the menu, the dot on its group, the
   envelope on the top bar, the mark on those lines of the bell. */
.nav-count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--red-600); color: var(--on-state); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; flex: none; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-600); flex: none; margin-left: auto; }
.nav-dot + .nav-toggle { margin-left: 6px; }
.icon-btn.mail-unread { position: relative; color: var(--blue-600); text-decoration: none; width: auto; padding: 0 8px; gap: 4px; display: inline-flex; align-items: center; }
.mail-unread-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--red-600); color: var(--on-state); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.notice-item.is-mail { border-left: 3px solid var(--blue-600); background: var(--blue-100); }
.notice-item.is-mail .notice-title { font-variation-settings: 'wght' 700; }
.mail-unread-note { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--blue-100); color: var(--blue-600); font-size: var(--fs-13); }
select.has-unread { font-variation-settings: 'wght' 600; border-color: var(--blue-600); }
/* The automatic signature block in a message being written and in its settings window (public/js/mail.js). */
.mail-autosig { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 6px 0; cursor: default; user-select: none; opacity: .95; }
.mail-autosig-preview { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; color: #111; min-height: 48px; }
.mail-autosig img, .mail-autosig-preview img { max-width: 320px; max-height: 110px; }

/* "Are you still there?" with the agents to contact on its right (src/lib/idleContacts.js). */
.modal.idle-modal.has-side { width: min(100%, 940px); }
.idle-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.idle-modal.has-side .idle-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.idle-main { min-width: 0; }
.idle-side { min-width: 0; border-left: 1px solid var(--line); padding-left: 20px; }
.idle-side-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-bottom: 6px; font-size: var(--fs-16); }
.idle-agents { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.idle-agent { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.idle-agent-who { display: flex; flex-direction: column; min-width: 0; }
.idle-agent-ways { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
@media (max-width: 760px) {
  .idle-modal.has-side .idle-cols { grid-template-columns: minmax(0, 1fr); }
  .idle-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .idle-agents { max-height: 240px; }
}
.notice-item.is-staff-field { border-left: 3px solid var(--amber-600); }
.notice-item.is-staff-office { border-left: 3px solid var(--blue-600); }
/* Reminders (a deadline, a follow-up that is due, a task to approve) and messages about targets — docs/REMINDERS.md */
.notice-item.is-reminder { border-left: 3px solid var(--amber-600); }
.notice-item.is-performance { border-left: 3px solid var(--green-600); }

/* My pending work (views/partials/notifications.ejs, docs/WORK_ALLOCATION.md). */
.work-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.work-item:last-child { border-bottom: 0; }
.work-item-main { min-width: 0; overflow-wrap: anywhere; }
.work-item-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.work-item-slot { grid-column: 1 / -1; }
.notice-foot { display: flex; gap: 6px; flex-wrap: wrap; justify-content: space-between; }

/* T-MENU: menu order (views/admin/menus.ejs) */
.menu-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu-order-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.menu-order-item .grow { flex: 1; min-width: 0; }
.drag-handle { cursor: grab; color: var(--ink-500); display: inline-flex; }
[draggable="true"].is-dragging { opacity: .5; }
[draggable="true"].is-drag-over { outline: 2px dashed var(--brass-600); outline-offset: -2px; }

/* T-HELP: the ? panel of a page (views/partials/page-help.ejs). Tokens only, no colours. */
.page-help ol { padding-left: 1.25rem; }
.page-help ol li { margin-bottom: 4px; }
.page-help-visual { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
/* T-HELP: the Help Guide (views/help/index.ejs). Tokens only, no colours. */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-13); }
.help-item { padding: 14px 0; border-top: 1px solid var(--line); }
.help-item:first-of-type { border-top: none; }
.help-item h3 { font-size: var(--fs-16); margin-bottom: 4px; }
.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.help-dl dt { color: var(--ink-500); font-size: var(--fs-13); }
.help-dl dd { margin: 0; }
.help-label { color: var(--ink-500); font-size: var(--fs-13); margin: 8px 0 4px; }
.help-steps, .help-buttons { padding-left: 1.25rem; margin-bottom: 6px; }
.help-caution { color: var(--amber-600); font-size: var(--fs-13); }
.help-caution svg { width: 14px; height: 14px; vertical-align: -2px; }
.help-print-title { display: none; }
@media (max-width: 640px) { .help-dl { grid-template-columns: 1fr; } }
/* Programme 7.8: request guides, gate help ("Why am I seeing this?"), a window's own ? and Help Texts. Tokens only. */
.help-approver { border-left: 3px solid var(--line); padding-left: 12px; margin-top: 8px; }
.help-keywords { margin: 2px 0 6px; }
.gate-why { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; }
.gate-why summary { cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.gate-why-body { padding-top: 6px; }
.modal-help-btn { margin-left: auto; }
.modal-help { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 12px; margin-bottom: 12px; font-size: var(--fs-13); }
.modal-help ul { padding-left: 1.25rem; margin: 4px 0; }
.help-texts-list { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; }
.help-texts-list li { padding: 4px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.help-texts-list a.is-active { font-weight: 600; }
/* Setting guides (views/partials/setting-guide.ejs, docs/HELP_SYSTEM.md § Setting guides). Tokens only, no colours. */
.sg-panel { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px 10px; }
.sg-panel > summary { cursor: pointer; }
.setting-guide .sg-h { font-size: var(--fs-16); margin: 14px 0 6px; }
.sg-setting { padding: 10px 0; border-top: 1px solid var(--line); }
.sg-setting p { margin: 0 0 6px; }
.sg-options { width: 100%; border-collapse: collapse; font-size: var(--fs-13); margin: 4px 0 6px; table-layout: fixed; }
.sg-options th, .sg-options td { text-align: left; vertical-align: top; padding: 4px 8px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.sg-options th { color: var(--ink-500); font-weight: 600; }
.sg-options th:first-child, .sg-options td:first-child { width: 38%; }
.sg-dl { margin-top: 4px; }
@media (max-width: 640px) { .sg-options th:first-child, .sg-options td:first-child { width: 42%; } }
@media print {
  .help-print-title { display: block; }
  .help-item { break-inside: avoid; }
  .sg-setting { break-inside: avoid; }
  .sg-page { border: none; box-shadow: none; padding: 0; }
}

/* ---------------- The PDF editor (public/js/pdf-editor.js, docs/PDF_EDITOR.md) ---------------- */
.modal.modal-wide.pdfed { width: min(calc(100% - 24px), 1180px); }
.pdfed-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--paper-100); align-items: center; flex: none; }
.pdfed-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pdfed-group .lbl { font-size: var(--fs-11); color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.pdfed-bar .btn.is-on { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent); }
.pdfed-bar input[type="color"] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--white); cursor: pointer; }
.pdfed-bar select.pdfed-select { width: auto; max-width: 220px; min-width: 0; flex: 0 0 auto; padding: 5px 26px 5px 8px; font-size: var(--fs-13); height: auto; }
.pdfed-zoom { min-width: 44px; text-align: center; font-size: var(--fs-13); font-variant-numeric: tabular-nums; color: var(--ink-700); }
.pdfed-body { position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr); flex: 1 1 auto; min-height: 0; height: min(66vh, 760px); }
.pdfed-pages { overflow: auto; padding: 10px; border-right: 1px solid var(--line); background: var(--paper-100); display: flex; flex-direction: column; gap: 8px; }
.pdfed-thumb { flex: none; display: grid; justify-items: center; gap: 3px; padding: 5px; border: 2px solid transparent; border-radius: var(--radius-md); background: var(--white); color: var(--ink-700); font: inherit; font-size: var(--fs-11); cursor: pointer; }
.pdfed-thumb canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.pdfed-thumb.is-sel { border-color: var(--brass-600); }
.pdfed-thumb.is-cur { box-shadow: 0 0 0 2px var(--brass-600); color: var(--ink-900); font-weight: 600; }
.pdfed-stage { overflow: auto; padding: 16px; display: flex; background: var(--paper-200, var(--paper-100)); min-width: 0; }
.pdfed-sheet { position: relative; flex: none; margin: auto; background: #fff; box-shadow: var(--shadow-md); }
.pdfed-sheet > canvas { display: block; width: 100%; height: 100%; }
.pdfed-layer { position: absolute; inset: 0; overflow: hidden; touch-action: pan-x pan-y; }
.pdfed-layer.is-drawing { cursor: crosshair; touch-action: none; }
.pdfed-item { position: absolute; box-sizing: border-box; cursor: move; touch-action: none; }
.pdfed-item img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; pointer-events: none; user-select: none; }
.pdfed-item.k-hl { opacity: 0.38; mix-blend-mode: multiply; }
.pdfed-item.k-box { border: 2px solid; background: transparent; }
.pdfed-item.is-active { outline: 1.5px dashed var(--brass-600); outline-offset: 2px; opacity: 1; }
.pdfed-item.k-hl.is-active { opacity: 0.5; }
.pdfed-x { position: absolute; right: -11px; top: -11px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--red-600, #c62828); color: #fff; font: 700 14px/22px var(--font-sans, sans-serif); cursor: pointer; mix-blend-mode: normal; }
.pdfed-grip { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 3px; background: var(--brass-600); border: 2px solid #fff; cursor: nwse-resize; }
.pdfed-pen { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pdfed-pen polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: move; }
.pdfed-pen polyline.is-active { filter: drop-shadow(0 0 2px var(--brass-600)); }
.pdfed-crop { position: absolute; border: 2px dashed var(--brass-600); box-shadow: 0 0 0 9999px rgba(16, 20, 34, 0.45); pointer-events: none; }
.pdfed-drag { position: absolute; border: 1.5px dashed var(--brass-600); background: color-mix(in srgb, var(--brass-600) 14%, transparent); pointer-events: none; }
.pdfed-text { position: absolute; min-width: 80px; margin: 0; padding: 0 2px; border: 1px dashed var(--brass-600); border-radius: 0; background: rgba(255, 255, 255, 0.88); font-family: Arial, Helvetica, "Noto Sans", sans-serif; line-height: 1.25; white-space: pre; overflow: hidden; resize: none; outline: none; }
.pdfed-sign { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(16, 20, 34, 0.5); }
.pdfed-sign.hidden { display: none; }
.pdfed-sign-card { display: grid; gap: 10px; padding: 16px; width: min(600px, 100%); border-radius: var(--radius-lg); background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-lg); }
.pdfed-sign-card canvas { width: 100%; height: auto; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: #fff; touch-action: none; cursor: crosshair; }
.pdfed-sign-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pdfed-status { margin-right: auto; align-self: center; font-size: var(--fs-13); color: var(--ink-500); }
@media (max-width: 720px) {
  .pdfed-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 62vh; }
  .pdfed-pages { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .pdfed-thumb { flex: 0 0 72px; }
  .pdfed-bar { padding: 6px 10px; gap: 6px 10px; }
  .pdfed-stage { padding: 8px; }
}

/* Pre-Restart Cleanup lines (views/software/check-company.ejs, docs/PRE_CLEAN.md) */
.pc-lines { margin: 0; padding-left: 28px; display: grid; gap: 6px; }
.pc-line-box { display: flex; gap: 6px; align-items: center; }
.pc-line-box .input { flex: 1; min-width: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-13); }
.pc-line-tools { display: inline-flex; gap: 2px; flex: none; }

/* "How to make …" step lists (Integrations → Download keys): their own colour, numbering and size, so nothing
 around them (a theme, a muted parent, a list reset) can leave a step blank. Tokens only (docs/THEMES_AND_LAYOUT.md). */
.howto-steps { list-style: decimal outside; margin: 8px 0 0; padding-left: 1.6em; color: var(--ink-700); font-size: 13.5px; line-height: 1.55; }
.howto-steps > li { display: list-item; color: var(--ink-700); margin: 0 0 4px; visibility: visible; opacity: 1; text-indent: 0; overflow-wrap: anywhere; }
.howto-steps > li strong { color: var(--ink-900); }
.howto-steps code { font-size: 12.5px; }

/* OCR at an upload box and its review (public/js/ocr.js, docs/OCR.md). Tokens only. */
.ocr-hint { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius-md); font-size: 13px; color: var(--ink-700); background: var(--paper-100); }
.ocr-hint.hidden { display: none; }
.ocr-review { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .ocr-review { grid-template-columns: minmax(0, 1fr); } }
.ocr-page { position: relative; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; touch-action: none; user-select: none; background: var(--paper-100); }
.ocr-page img { display: block; width: 100%; height: auto; }
.ocr-box { position: absolute; border: 2px solid var(--blue-600); background: var(--blue-100); opacity: 0.45; pointer-events: none; }
.ocr-fields { max-height: 62vh; overflow: auto; padding-right: 4px; }
.ocr-field { border-left: 4px solid var(--line); padding-left: 10px; }
.ocr-field .ocr-level { font-size: 11.5px; font-weight: 600; margin-left: 6px; }
.ocr-level-good { border-left-color: var(--green-600); } .ocr-level-good .ocr-level { color: var(--green-600); }
.ocr-level-check { border-left-color: var(--amber-600); } .ocr-level-check .ocr-level { color: var(--amber-600); }
.ocr-level-poor, .ocr-level-wrong { border-left-color: var(--red-600); } .ocr-level-poor .ocr-level, .ocr-level-wrong .ocr-level { color: var(--red-600); }
.ocr-level-wrong .input { border-color: var(--red-600); }
.ocr-capturing { background: var(--blue-100); border-radius: var(--radius-md); }

/* ---- Communication Centre — WhatsApp & Telegram (docs/COMM_WHATSAPP_TELEGRAM.md § Phase 7): tokens only ---- */
.comm-ch { gap: 4px; }
.comm-ch::before { display: none; }
.comm-ch svg { width: 12px; height: 12px; }
.comm-ch-whatsapp { background: var(--green-100); color: var(--green-600); }
.comm-ch-telegram { background: var(--blue-100); color: var(--blue-600); }
.comm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.comm-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.comm-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.comm-qr { display: flex; justify-content: center; padding: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.comm-qr img { width: 260px; max-width: 100%; height: auto; image-rendering: pixelated; }
.comm-inbox { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; min-height: 360px; }
.comm-inbox-list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; max-height: 70vh; background: var(--white); }
.comm-inbox-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--ink-900); }
.comm-inbox-item:hover, .comm-inbox-item[aria-current="true"] { background: var(--surface-2); }
.comm-inbox-item.is-unread strong::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); margin-left: 6px; vertical-align: middle; }
.comm-inbox-item small { display: block; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-inbox-view { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; background: var(--white); white-space: pre-wrap; overflow-wrap: anywhere; }
.comm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); min-height: 42px; align-items: center; background: var(--white); }
.comm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.comm-chip button { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); padding: 0 2px; font: inherit; }
.comm-chips input { border: 0; outline: 0; flex: 1; min-width: 140px; font: inherit; background: transparent; color: var(--ink-900); }
.comm-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.comm-preview > div { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; background: var(--surface-2); }
.comm-tab-badge { margin-left: 4px; }
@media (max-width: 720px) { .comm-inbox { grid-template-columns: 1fr; } .comm-inbox-list { max-height: 40vh; } }

/* ---- The floating action bar of a detail page (public/js/action-bar.js, docs/ACTION_BAR.md): the page's own .page-actions,
   docked at the bottom-right once the head scrolls away; clear of the menu on any side (docs/MENU_LAYOUT.md). Tokens only. ---- */
.page-actions.action-bar {
  position: fixed; z-index: 40;
  right: calc(var(--menu-right) + 16px); bottom: calc(var(--stick-bottom) + 16px);
  max-width: calc(100vw - var(--menu-left) - var(--menu-right) - 32px);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.action-bar-spot { flex: none; }
body.has-action-bar main.content { padding-bottom: calc(var(--action-bar-h, 56px) + 32px); }
@media (max-width: 720px) {
  .page-actions.action-bar { left: calc(var(--menu-left) + 8px); right: calc(var(--menu-right) + 8px); bottom: calc(var(--stick-bottom) + 8px); width: auto; max-width: none; justify-content: center; } /* the phone rule gives .page-actions width 100%: the bar takes its two sides instead */
  .page-actions.action-bar .btn { flex: 1 1 auto; }
}
@media print { .page-actions.action-bar { display: none; } }

/* ---- Configurable list views (public/js/list-view.js, docs/LIST_VIEWS.md): the Columns / Filters bar above every data table,
   its pop-overs and the filter boxes. Tokens only. ---- */
.lv-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 8px; position: relative; font-size: var(--fs-13); }
.lv-bar .lv-btn { font-weight: 500; }
.lv-count { display: inline-block; min-width: 1em; color: var(--ink-500); }
.lv-count:empty { display: none; }
.lv-filters { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.lv-filter { display: flex; flex-direction: column; gap: 2px; }
.lv-filter-name { font-size: var(--fs-11); color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; }
.lv-filter .input { min-width: 140px; max-width: 220px; padding: 4px 8px; font-size: var(--fs-13); }
.lv-reset { margin-left: auto; color: var(--ink-500); }
.lv-pop { position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 4px; min-width: 260px; max-width: min(92vw, 420px); max-height: min(70vh, 560px); overflow: auto; overscroll-behavior: contain;
  padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.lv-pop-title { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); margin: 4px 0 6px; }
.lv-list { display: flex; flex-direction: column; gap: 2px; }
.lv-item { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: var(--radius-sm); }
.lv-item:hover { background: var(--paper-100); }
.lv-check { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; font-size: var(--fs-13); color: var(--ink-700); }
.lv-move { width: 24px; height: 24px; font-size: 10px; line-height: 1; padding: 0; }
.lv-move:disabled { opacity: 0.35; cursor: default; }
.lv-more { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.lv-more > .lv-list { max-height: 260px; overflow-y: auto; }
.lv-more > .lv-hint { margin: 0 0 6px; }
.lv-find { width: 100%; margin-bottom: 6px; }
.lv-hint { margin: 8px 0 0; }
.lv-done { margin-top: 8px; }
.lv-hide { display: none !important; }
th.lv-extra, td.lv-extra { color: var(--ink-700); }
@media (max-width: 720px) { .lv-pop { left: 0; right: 0; max-width: none; } .lv-reset { margin-left: 0; } }
@media print { .lv-bar { display: none; } }
/* A list split into pages: how far the filter boxes reach (docs/LIST_VIEWS.md § Filters over every page). */
.lv-note { align-self: flex-end; padding-bottom: 6px; }
.lv-filter-server .lv-filter-name::after { content: " · every page"; text-transform: none; letter-spacing: 0; }

/* ---------------------------------------------------------------- Document scanner (docs/DOCUMENT_SCANNER.md) ----------------------------------------------------------------
   Full screen over everything while it is open (like a modal); colours from the theme's tokens only. */
html.scn-open, html.scn-open body { overflow: hidden; }
.scn { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: var(--white); color: var(--ink-900); font-size: var(--fs-14); }
.scn-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.scn-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scn-count { color: var(--ink-500); font-size: var(--fs-13); }
.scn-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; padding: 10px 14px; gap: 10px; }
.scn-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.scn-icon { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-100); color: var(--ink-900); font-size: 18px; cursor: pointer; }
.scn-icon.is-on { background: var(--amber-600); color: var(--white); }
.scn-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--white); color: var(--ink-700); cursor: pointer; font-size: var(--fs-13); }
.scn-chip.is-on, .scn-chip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }
.scn-cam { position: relative; flex: 1; min-height: 240px; background: var(--ink-900); border-radius: var(--radius-md); overflow: hidden; }
.scn-cam video { width: 100%; height: 100%; object-fit: contain; display: block; }
.scn-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scn-cam.scn-flash::after { content: ""; position: absolute; inset: 0; background: var(--white); opacity: 0.6; }
.scn-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: var(--white); font-size: var(--fs-13); white-space: nowrap; }
.scn-hint.is-warn { background: var(--amber-600); }
.scn-tools { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scn-zoom { flex: 1; min-width: 120px; }
.scn-shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid var(--blue-600); background: var(--white); cursor: pointer; }
.scn-shutter:disabled { opacity: 0.5; }
.scn-nocam { color: var(--white); padding: 24px; text-align: center; margin: auto; max-width: 420px; }
.scn-tabs { display: flex; gap: 8px; }
.scn-stage { position: relative; flex: 1; min-height: 260px; background: var(--paper-100); border-radius: var(--radius-md); overflow: hidden; }
.scn-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.scn-panel { display: flex; flex-direction: column; gap: 10px; }
.scn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scn-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.scn-chips .scn-chip { white-space: nowrap; }
.scn-chip.is-suggested:not(.is-on) { border-color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); }
.scn-suggest:not([hidden]) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scn-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 14px; }
.scn-slider { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-13); color: var(--ink-700); }
.scn-note { color: var(--ink-500); font-size: var(--fs-13); margin: 0; }
.scn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.scn-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px; background: var(--white); display: flex; flex-direction: column; gap: 6px; }
.scn-card.is-dragging { opacity: 0.6; outline: 2px dashed var(--blue-600); }
.scn-thumb { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--paper-100); border-radius: var(--radius-md); }
.scn-num { position: absolute; top: 12px; right: 12px; background: var(--ink-900); color: var(--white); border-radius: 999px; min-width: 24px; padding: 2px 8px; text-align: center; font-size: var(--fs-13); }
.scn-handle { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--white); cursor: grab; touch-action: none; font-size: 18px; }
.scn-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.scn-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.scn-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-13); color: var(--ink-700); }
.scn-prev { display: flex; flex-wrap: wrap; gap: 10px; }
.scn-prev .scn-thumb { width: 160px; }
.scn-pdf { width: 100%; min-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius-md); }
.scn-busy { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: var(--ink-900); color: var(--white); font-size: var(--fs-13); }
.scn-launch { margin-left: 6px; }
.scn-fallback { margin: 4px 0 0; font-size: var(--fs-13); color: var(--ink-700); } /* the browser cannot scan: the sentence (docs/CAMERA_SUPPORT.md) */
/* While the scanner is open: its own questions and messages above it, the floating page buttons hidden. */
html.scn-open #__confirm_modal { z-index: 450; }
html.scn-open .toast-region { z-index: 460; }
html.scn-open .pocr-fab, html.scn-open .break-fab { display: none; }
/* While a window of the page is open, the page's floating parts (the print bar of a print page, OCR, Break) step aside:
   on a phone they lay over the window's own buttons — Send → Save on a letter could not be pressed (owner LM-2 / LM-3). */
html:has(.modal-backdrop.is-open) .save-as, html:has(.modal-backdrop.is-open) .pocr-fab, html:has(.modal-backdrop.is-open) .break-fab { visibility: hidden; }
/* Filter kinds (docs/LIST_VIEWS.md § Kinds of filter box). */
.lv-filter select.input { min-width: 140px; }
.lv-range { display: inline-flex; align-items: center; gap: 4px; }
.lv-range .input { width: 120px; }
.lv-filter-date .lv-range .input { width: 150px; }
.lv-range-sep { color: var(--ink-500); }
.lv-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lv-filter-row .lv-kind { width: auto; min-width: 150px; font-size: var(--fs-13); padding-top: 2px; padding-bottom: 2px; }
.scn-ocr { display: flex; flex-direction: column; gap: 12px; }
.scn-ocr-text { width: 100%; min-height: 140px; font-family: inherit; }
/* The "Document type" of a file box (public/js/upload-kinds.js) and the Signature Scanner (public/js/signature-scanner.js). */
.upk-rule { margin-top: 4px; }
.upk-rule.is-error { color: var(--red-600); }
.upk-choose { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; max-width: 320px; }
.upk-label { font-size: var(--fs-13); color: var(--ink-700); }
.sgs-launch { margin: 6px 0 0 0; }
.sgs-body { display: flex; flex-direction: column; gap: 12px; }
.sgs-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sgs-status { margin: 0; color: var(--ink-500); font-size: var(--fs-13); }
.sgs-status.is-warn { color: var(--amber-600); }
.sgs-views { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sgs-views.is-one { grid-template-columns: 1fr; }
.sgs-fig { margin: 0; min-width: 0; }
.sgs-fig figcaption { font-size: var(--fs-13); color: var(--ink-500); margin-bottom: 4px; }
.sgs-stage { border: 1px dashed var(--line-strong); border-radius: var(--radius-md); min-height: 140px; display: flex; align-items: center; justify-content: center; padding: 8px; background: var(--paper-100); overflow: hidden; }
/* The paper a signature is judged on is white in every theme: that is how it prints. */
.sgs-stage.sgs-paper { background: #fff; }
.sgs-canvas { max-width: 100%; max-height: 38vh; display: block; color: var(--blue-600); }
.sgs-original { touch-action: none; cursor: crosshair; }
.sgs-body:not(.has-photo) .sgs-canvas { display: none; }
.sgs-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 16px; }
.sgs-control { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-13); color: var(--ink-700); }
.sgs-control.sgs-toggle { flex-direction: row; align-items: center; gap: 8px; }
.sgs-control.is-off { opacity: 0.5; }
.sgs-label { display: flex; justify-content: space-between; gap: 8px; }
.sgs-value { color: var(--ink-500); }
.sgs-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sgs-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); cursor: pointer; padding: 0; }
.sgs-swatch[aria-pressed="true"] { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.sgs-size { display: flex; align-items: center; gap: 8px; }
.sgs-size .input { max-width: 120px; }
.sgs-dims { color: var(--ink-500); }
.sgs-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .sgs-views { grid-template-columns: 1fr; } .sgs-canvas { max-height: 30vh; } .sgs-foot .btn { flex: 1 1 auto; } }
/* Take a photo with the device camera in the page (public/js/camera-shot.js; Verification Entry without the local drive). */
.cms-body { display: flex; flex-direction: column; gap: 10px; }
.cms-stage { background: var(--ink-900); border-radius: var(--radius-md); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.cms-video, .cms-shot { display: block; max-width: 100%; max-height: 60vh; }
.cms-video[hidden], .cms-shot[hidden], .cms .btn[hidden] { display: none; }
.cms-status { margin: 0; color: var(--ink-500); font-size: var(--fs-13); }
.cms-status.is-warn { color: var(--amber-600); }
.cms-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
input[data-photo-box][hidden] { display: none; }
/* Every open dropdown / submenu is above every other part of the page (owner, 2026-11-27: menus opened from the last
   item of a list were hidden or cut off). One layer (2930: above the notifications list, below the Private OCR window
   and the idle warning). A container that makes its own stacking context — the sticky top bar (20), the theme picker
   (40) — is lifted to that layer only while one of its dropdowns is open, so the panel is not trapped under the page.
   Each panel is kept on the screen by app.js keepOnScreen(): opened upward when there is no room below, aligned to
   the right when it would run off the right edge, and given the height that is left. */
:root { --layer-dropdown: 2930; }
.dropdown-panel.is-open, .cf-menu, .suggest-list.is-open { z-index: var(--layer-dropdown); }
.topbar:has(.dropdown-panel.is-open), .theme-float:has(.dropdown-panel.is-open) { z-index: var(--layer-dropdown); }
.dropdown-panel.is-up { top: auto; bottom: calc(100% + 8px); }
.dropdown-panel.is-left { right: auto; left: 0; }
.cf-menu.is-up, .suggest-list.is-up { top: auto; bottom: calc(100% + 4px); }
.cf-menu.is-right, .suggest-list.is-right { left: auto; right: 0; }
.cf-menu.is-fit, .dropdown-panel.is-fit, .suggest-list.is-fit { overflow-y: auto; overscroll-behavior: contain; }
/* WhatsApp / Telegram beside a contact number (migration 293; owner, 2026-11-27): a short tag to the right of each value. */
.channel-tag { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: middle; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--text-muted); }
.channel-tag-whatsapp { border-color: var(--green-600, var(--border)); color: var(--green-700, var(--text)); }
.channel-tag-telegram { border-color: var(--blue-600, var(--border)); color: var(--blue-700, var(--text)); }
.contact-channel { white-space: nowrap; }
/* The other dropdowns of the portal on the same layer (the same root cause, 2026-11-27): a list's Columns / Filters
   pop-over, the letter table and field pickers, the Approval workspace's type / person pickers. */
.lv-pop, details[open] > .letter-table-pop, details[open] > .field-picker-pop, .aq-pick[open] > .aq-pick-list { z-index: var(--layer-dropdown); }
.lv-pop.is-up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; }
.lv-pop.is-right { left: auto; right: 0; }
/* The Approval workspace's type / person pickers: a pop-over under their button (2026-11-27: the list was a block in the
   page and the notifications list lay over it). */
.aq-pick { position: relative; }
.aq-pick[open] > .aq-pick-list { position: absolute; top: calc(100% + 4px); left: 0; min-width: 260px; max-width: min(92vw, 460px); max-height: min(60vh, 460px); overflow: auto; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18)); }
/* A pop-over in a page area that creates no layer of its own still has to beat the fixed notifications list: the page is lifted
   while one is open (the same rule as the top bar). */
main.content:has(.aq-pick[open] > .aq-pick-list, .lv-pop, details[open] > .letter-table-pop, details[open] > .field-picker-pop, details[open] > .cf-menu) { position: relative; z-index: calc(var(--layer-dropdown) - 1); } /* one under the top bar's open menu, above the notifications list */

/* Live photos for field work (docs/LIVE_PHOTOS.md): the preview of the photo taken, and the bar that says what is kept on the phone. */
.live-photo-preview { max-width: 96px; max-height: 96px; border-radius: var(--radius-md); border: 1px solid var(--line); }
.photoq-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2900; max-width: 640px; margin: 0 auto; padding: 10px 14px; background: var(--white); border: 1px solid var(--amber-600); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.18)); font-size: .875rem; }
.photoq-bar p { margin: 0; }
.photoq-bar p + p { margin-top: 6px; }
.photoq-refused { color: var(--red-600, #b91c1c); }

/* Labels in the person's language (migration 348, docs/TRANSLATION.md). Hindi, Bengali and Odia words are often longer
   than the English and their vowel signs reach above and below the line: a menu name is cut with … instead of
   pushing the sidebar wider (the full name is in its tooltip and in page search), and buttons get the line height
   those scripts need. */
.nav-item .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item, .profile-name, .page-title { min-width: 0; overflow-wrap: anywhere; }
[data-ui-lang] .btn, [data-ui-lang] .nav-item, [data-ui-lang] .dropdown-item { line-height: 1.4; }
[data-ui-lang] .btn { white-space: normal; text-align: center; }
/* A crowded top bar (a staff member's work status and timers) in a longer script: Find a page, Dashboard and the work
   status may give way — their words cut with … only when the bar is full (the button keeps its icon and tooltip) — and
   the Ctrl K hint is left out, so the top bar and the page never reach past the right edge (test/label-layout.test.js).
   Only while another language is shown ([data-ui-lang]); English is drawn exactly as before. */
[data-ui-lang] .topbar .page-search-kbd { display: none; }
[data-ui-lang] .profile-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, never a letter per line */
[data-ui-lang] .topbar > .btn, [data-ui-lang] .topbar > #workStatus { min-width: 2.5em; flex-shrink: 1; }
[data-ui-lang] .topbar .dash-link-text, [data-ui-lang] .topbar > #workStatus { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-lang-row { cursor: default; flex-wrap: wrap; }
.label-lang-row select { flex: 1 1 120px; min-width: 0; width: auto; }
.label-ask { align-items: center; flex-wrap: wrap; }
.label-ask .label-ask-text { flex: 1 1 260px; min-width: 0; }
.label-ask select { width: auto; min-width: 140px; }

/* Employee engagement (Phase 8.2 / 8.3, docs/ENGAGEMENT.md): level badge, badge cards, the one-time level-up note.
   Theme tokens only (light and dark follow); the celebration is one short fade and lift, none with reduced motion. */
.eng-level { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--brass-500, var(--line));
  background: var(--brass-050); color: var(--brass-700); font-size: var(--fs-14, 0.875rem); font-variation-settings: 'wght' 560; }
.eng-level svg { width: 16px; height: 16px; }
.eng-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.eng-badge-card { padding: 16px; margin: 0; }
.eng-badge-card.is-retired { opacity: 0.6; }
.eng-badge-art { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--brass-500, var(--line)); background: var(--brass-050); color: var(--brass-700); overflow: hidden; }
.eng-badge-art svg { width: 26px; height: 26px; }
.eng-badge-art img { width: 100%; height: 100%; object-fit: contain; }
.eng-progress { height: 8px; border-radius: 999px; background: var(--paper-100); overflow: hidden; }
.eng-progress > span { display: block; height: 100%; background: var(--brass-600); border-radius: inherit; }
.eng-levelup { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--brass-500, var(--line));
  background: var(--brass-050); color: var(--ink-900); animation: eng-levelup 0.6s var(--ease, ease-out) both; }
.eng-levelup .eng-badge-art { animation: eng-glow 1.6s ease-out 0.3s 1 both; }
@keyframes eng-levelup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes eng-glow { 0% { box-shadow: 0 0 0 0 var(--brass-500, rgba(176,141,60,.5)); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .eng-levelup, .eng-levelup .eng-badge-art { animation: none; } }

/* My Day (programme 7.5, views/partials/my-day.ejs): one row per piece of work, its one button at the end. */
.my-day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.my-day-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.my-day-item:last-child { border-bottom: none; }
.my-day-name { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.my-day-pins { display: flex; flex-wrap: wrap; gap: 6px; }
/* SWADESI Game Zone (Phase 8B, docs/GAME_ZONE.md): a calm banking look, theme tokens only (light and dark follow), no motion. */
.gz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.gz-grid > .panel { margin: 0; min-width: 0; }
.gz-game, .gz-row, .gz-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gz-game:last-of-type, .gz-row:last-child, .gz-person:last-child { border-bottom: 0; }
.gz-room { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 12px; }
@media (max-width: 860px) { .gz-room { grid-template-columns: 1fr; } }
.gz-room > .panel { margin: 0; min-width: 0; }
.gz-board { overflow-x: auto; }
.gz-players { list-style: none; padding: 0; margin: 0 0 8px; }
.gz-players li { padding: 4px 0; }
.gz-ttt { display: grid; grid-template-columns: repeat(3, minmax(56px, 96px)); gap: 6px; }
.gz-cell { aspect-ratio: 1; font-size: 2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-900); cursor: pointer; }
.gz-cell:disabled { cursor: default; }
.gz-chess { display: grid; grid-template-columns: repeat(8, minmax(32px, 56px)); width: max-content; border: 1px solid var(--line); }
.gz-sq { aspect-ratio: 1; border: 0; font-size: clamp(1.2rem, 4vw, 2rem); line-height: 1; cursor: pointer; color: #111; padding: 0; }
.gz-sq.light { background: #eee6d3; } .gz-sq.dark { background: #b58863; }
.gz-sq.is-last { box-shadow: inset 0 0 0 3px rgba(181, 137, 0, .55); }
.gz-sq.is-pick { box-shadow: inset 0 0 0 3px var(--brass-600, #8a6d1d); }
.gz-sq.is-target { box-shadow: inset 0 0 0 3px #2e7d32; }
.gz-clock { margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.gz-clock .is-turn { font-weight: 700; text-decoration: underline; }
.gz-ludo-track { display: grid; grid-template-columns: repeat(13, minmax(20px, 1fr)); gap: 2px; }
.gz-ludo-cell { min-height: 26px; border: 1px solid var(--line); border-radius: 4px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1px; background: var(--surface); }
.gz-ludo-cell.is-safe { background: var(--surface-2); }
.gz-token { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .35); }
.gz-ludo-players { margin-top: 8px; display: grid; gap: 6px; }
.gz-ludo-p.is-turn { font-weight: 600; }
.gz-sudoku { display: grid; grid-template-columns: repeat(9, minmax(28px, 44px)); width: max-content; border: 2px solid var(--ink-700, var(--line)); }
.gz-sd { aspect-ratio: 1; width: 100%; text-align: center; font-size: 1.1rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-900); padding: 0; border-radius: 0; }
.gz-sd.is-given { font-weight: 700; background: var(--surface-2); }
.gz-sd.is-clash { color: #c62828; }
.gz-sd.b-bottom { border-bottom: 2px solid var(--ink-700, var(--line)); }
.gz-sd.b-right { border-right: 2px solid var(--ink-700, var(--line)); }
.gz-chat-log { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); }
.gz-msg { padding: 2px 0; overflow-wrap: anywhere; }
.gz-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }

/* =====================================================================
   Dashboard charts and the banking finish (owner, 2026-11-29; docs/DASHBOARD_CHARTS.md).
   The charts are drawn on the server (views/partials/charts/*.ejs) as HTML and inline SVG; every colour below is a token.
   Series: two fixed slots of a validated categorical palette (blue, orange; CVD ΔE 12.6 light / 12.8 dark against the
   white and the Core Banking dark surfaces), stepped separately for dark — never cycled, never a status colour.
   States: the theme's own green / amber / red / blue, plus one "serious" orange; each state also carries its name.
   ===================================================================== */
:root {
  --viz-1: #257de0;
  --viz-2: #f47230;
  --viz-good: var(--green-600);
  --viz-warn: var(--amber-600);
  --viz-serious: #e0662c;
  --viz-critical: var(--red-600);
  --viz-info: var(--blue-600);
  --viz-neutral: var(--ink-300);
  --viz-grid: var(--line);
  --viz-area: 0.12;
}
[data-theme="dark"], [data-theme="obsidian"], [data-theme="design"][data-mode="dark"] {
  --viz-1: #338ced;
  --viz-2: #e76624;
  --viz-serious: #f18a59;
  --viz-area: 0.18;
}

.viz-dash { margin-bottom: var(--space-5); }

/* KPI tiles */
.viz-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.viz-kpi {
  display: flex; flex-direction: column; gap: var(--space-1); min-width: 0;
  padding: calc(16px * var(--density, 1)) calc(18px * var(--density, 1));
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--ink-900); text-decoration: none; position: relative;
}
.viz-kpi-item { display: flex; min-width: 0; }
.viz-kpi-item > .viz-kpi { flex: 1 1 auto; }
a.viz-kpi:hover { text-decoration: none; border-color: var(--line-strong); }
a.viz-kpi:focus-visible { outline-offset: 2px; }
.viz-kpi.is-alert { border-left: 3px solid var(--viz-critical); }
.viz-kpi-top { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.viz-kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: var(--radius-md); background: var(--brass-050); color: var(--brass-600); }
.viz-kpi-icon svg { width: 16px; height: 16px; }
.viz-kpi-label { font-size: var(--fs-13); color: var(--ink-500); line-height: 1.3; overflow-wrap: anywhere; }
.viz-kpi-value { font-size: var(--fs-28); line-height: 1.15; font-variation-settings: 'wght' 650; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; margin-top: var(--space-1); }
.viz-kpi-sub { font-size: var(--fs-13); color: var(--ink-500); overflow-wrap: anywhere; }
.viz-kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--fs-12); color: var(--ink-500); }
.viz-delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: var(--fs-12); font-variation-settings: 'wght' 600; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--paper-100); color: var(--ink-700); }
.viz-delta svg { width: 14px; height: 14px; }
.viz-delta.is-good { background: var(--green-100); color: var(--green-600); }
.viz-delta.is-bad { background: var(--red-100); color: var(--red-600); }

/* The grid of chart cards: 12 columns on a wide screen, one on a phone */
.viz-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; gap: var(--space-4); align-items: start; }
.viz-card { margin: 0; min-width: 0; grid-column: span 6; }
.panel.viz-card + .panel.viz-card { margin-top: 0; }
.viz-span-4 { grid-column: span 4; } .viz-span-6 { grid-column: span 6; } .viz-span-8 { grid-column: span 8; } .viz-span-12 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .viz-span-4, .viz-span-6, .viz-span-8 { grid-column: span 6; } }
@media (max-width: 760px) { .viz-grid { grid-template-columns: minmax(0, 1fr); } .viz-span-4, .viz-span-6, .viz-span-8 { grid-column: 1 / -1; } }
.viz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.viz-head h2 { font-size: var(--fs-16); font-variation-settings: 'wght' 620; }
.viz-sub { margin: 2px 0 0; font-size: var(--fs-13); color: var(--ink-500); }
.viz-empty { margin: var(--space-4) 0; padding: var(--space-4); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-500); font-size: var(--fs-14); text-align: center; }

/* Legend: the series' / states' names, always in text inks */
.viz-legend { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--fs-13); color: var(--ink-700); }
.viz-legend li { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend strong { color: var(--ink-900); font-variant-numeric: tabular-nums; font-variation-settings: 'wght' 620; }
.viz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--viz-neutral); }
.viz-legend-list { flex-direction: column; gap: var(--space-2); margin: 0; min-width: 0; }
.viz-legend-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--space-2); }
.viz-legend-list li.is-zero { color: var(--ink-500); }
.viz-legend-list li.is-zero strong { color: var(--ink-500); font-variation-settings: 'wght' 450; }

/* Colour roles: a series slot or a state */
.viz-s1 { --c: var(--viz-1); } .viz-s2 { --c: var(--viz-2); }
.viz-r-good { --c: var(--viz-good); } .viz-r-warn { --c: var(--viz-warn); } .viz-r-serious { --c: var(--viz-serious); }
.viz-r-critical { --c: var(--viz-critical); } .viz-r-info { --c: var(--viz-info); } .viz-r-neutral { --c: var(--viz-neutral); }
.viz-key.is-off { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.viz-key[class*="viz-"], .viz-fill, .viz-seg { background: var(--c, var(--viz-neutral)); }

/* Plot area (line and columns): the axis labels in HTML, so they follow the text size and zoom */
.viz-plot { position: relative; height: 200px; margin-left: var(--viz-axis, 2.25rem); }
.viz-yaxis { position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--viz-axis, 2.25rem)); width: calc(var(--viz-axis, 2.25rem) - 0.35rem); pointer-events: none; }
.viz-yaxis span { position: absolute; right: 0; transform: translateY(-50%); font-size: var(--fs-11); color: var(--ink-500); font-variant-numeric: tabular-nums; }
.viz-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
line.viz-gl { stroke: var(--viz-grid); stroke-width: 1; }
line.viz-gl.is-base { stroke: var(--line-strong); }
.viz-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { fill: var(--c); opacity: var(--viz-area); stroke: none; }
.viz-dot { fill: none; stroke: var(--c); stroke-width: 8; stroke-linecap: round; }
.viz-hits { position: absolute; inset: 0; display: flex; }
.viz-hit { cursor: default; }
.viz-hits .viz-hit { flex: 1 1 0; border-radius: var(--radius-sm); }
.viz-hits .viz-hit:hover, .viz-hits .viz-hit:focus-visible, .viz-hits .viz-hit.is-hot { background: color-mix(in srgb, var(--ink-900) 7%, transparent); }
.viz-xaxis { display: flex; margin-left: var(--viz-axis, 2.25rem); margin-top: var(--space-2); }
.viz-xaxis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: var(--fs-11); color: var(--ink-500); white-space: nowrap; overflow: hidden; }
@media (max-width: 520px) { .viz-xaxis.is-dense span:nth-child(even) { visibility: hidden; } }

/* Columns (HTML): rounded data ends, a 2px gap between stacked segments */
.viz-gridlines { position: absolute; inset: 0; pointer-events: none; }
.viz-gridlines i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--viz-grid); }
.viz-gridlines i.is-base { border-top-color: var(--line-strong); }
.viz-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 4px; }
.viz-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 2px; border-radius: 4px 4px 0 0; }
.viz-seg { display: block; width: min(100%, 36px); margin: 0 auto; flex: none; }
.viz-col .viz-seg:last-child { border-radius: 4px 4px 0 0; }
.viz-col:hover, .viz-col:focus-visible, .viz-col.is-hot { background: var(--paper-100); }

/* Donut */
.viz-donut-wrap { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.viz-donut { position: relative; width: 148px; height: 148px; flex: none; margin: 0 auto; }
.viz-donut svg { width: 100%; height: 100%; display: block; }
.viz-ring { fill: none; stroke: none; }
.viz-arc { fill: none; stroke: var(--c); stroke-width: 5.2; transition: stroke-width 0.15s var(--ease); }
.viz-arc.is-hot { stroke-width: 6.4; }
.viz-donut-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; line-height: 1.1; }
.viz-donut-total strong { font-size: var(--fs-23); font-variation-settings: 'wght' 650; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.viz-donut-total span { font-size: var(--fs-12); color: var(--ink-500); }
.viz-donut-wrap .viz-legend-list { flex: 1 1 160px; }

/* Horizontal bars */
.viz-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.viz-bar-text { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-13); margin-bottom: 4px; }
.viz-bar-label { color: var(--ink-900); min-width: 0; overflow-wrap: anywhere; }
.viz-bar-figure { color: var(--ink-500); font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-bar-figure strong { color: var(--ink-900); font-variation-settings: 'wght' 620; }
.viz-track { height: 10px; border-radius: 999px; background: var(--paper-100); overflow: hidden; }
.viz-fill { display: block; height: 100%; border-radius: 999px; }
.viz-track:focus-visible { outline-offset: 3px; }

/* A month, one cell a day */
.viz-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.viz-month-head { font-size: var(--fs-11); color: var(--ink-500); text-align: center; padding-bottom: 2px; }
.viz-day { position: relative; min-height: 2.4rem; border-radius: var(--radius-sm); padding: 3px 5px; display: flex; justify-content: space-between; align-items: flex-start; font-size: var(--fs-11); color: var(--ink-900);
  background: color-mix(in srgb, var(--c, var(--viz-neutral)) 16%, var(--white)); box-shadow: inset 0 -3px 0 var(--c, var(--viz-neutral)); }
.viz-day b { font-weight: 500; font-variation-settings: 'wght' 500; }
.viz-day i { font-style: normal; font-size: var(--fs-13); font-variation-settings: 'wght' 650; font-weight: 650; }
.viz-day.is-future, .viz-day.is-off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-500); }
.viz-day.is-blank { background: transparent; box-shadow: none; }
.viz-day.is-hot { outline: 2px solid var(--ink-700); outline-offset: 1px; }

/* System health figures */
.viz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: var(--space-3); margin: 0; }
.viz-stats > div { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-0); }
.viz-stats > div.is-alert { border-left: 3px solid var(--viz-critical); }
.viz-stats dt { font-size: var(--fs-12); color: var(--ink-500); }
.viz-stats dd { margin: 2px 0 0; font-size: var(--fs-22); font-variation-settings: 'wght' 640; font-weight: 640; font-variant-numeric: tabular-nums; }

/* The figures as a table */
.viz-table { margin-top: var(--space-3); font-size: var(--fs-13); }
.viz-table summary { cursor: pointer; color: var(--ink-500); width: max-content; }
.viz-table summary:hover { color: var(--ink-900); }
.viz-table table.data-table { min-width: 0; margin-top: var(--space-2); }
.viz-table .table-scroll { max-height: 320px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.viz-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink-900); padding: 8px 16px; border-bottom: 1px solid var(--line); }
.viz-table td { padding: 8px 16px; }
.viz-table .cell-num { text-align: right; }

/* The tooltip (public/js/charts.js) */
.viz-tip { position: absolute; z-index: 1200; max-width: min(280px, calc(100vw - 16px)); padding: 7px 10px; border-radius: var(--radius-md); background: var(--inverse-bg); color: var(--on-inverse, #fff); font-size: var(--fs-12); line-height: 1.45; white-space: pre-line; box-shadow: var(--shadow-md); pointer-events: none; font-variant-numeric: tabular-nums; }
.viz-tip[hidden] { display: none; }

/* Forced colours and print: the marks keep their shape, the words carry the meaning */
@media (forced-colors: active) {
  .viz-key, .viz-fill, .viz-seg { forced-color-adjust: none; background: CanvasText; }
  .viz-line, .viz-dot, .viz-arc { stroke: CanvasText; }
  .viz-area { fill: none; }
  .viz-day { forced-color-adjust: none; background: Canvas; box-shadow: inset 0 0 0 1px CanvasText; color: CanvasText; }
}
@media print { .viz-table { display: none; } .viz-kpi, .viz-card { box-shadow: none; break-inside: avoid; } }

/* ---------- The banking finish of the shell (tokens only; every design and mode) ----------
   Quiet, dense and exact: the page title a step smaller, card titles at body weight scale, figures in tabular digits,
   a hairline under the top bar, sticky table headings in the panel colour. */
.panel-head > h2 { font-size: var(--fs-18); }
.page-head h1 { font-size: var(--fs-28); }
.topbar { box-shadow: 0 1px 0 var(--line); }
/* The page title in the top bar stays on one line (it broke one letter a line when the timers took the room) and ends in … */
.topbar .page-title { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.stat-cell .stat-value, .kpi .v, .badge, .viz-kpi-value { font-variant-numeric: tabular-nums; }
table.data-table td.cell-num { font-variant-numeric: tabular-nums; }

/* =====================================================================
   The banking look (owner, 2026-11-29: "the whole app looks like a modern banking interface";
   docs/07-design-and-behavior.md § The banking look). One component set for every design, colour theme and mode:
   tokens only — the default design (Core Banking — Modern) gives the navy shell and the blue accent, the other
   designs and colour themes keep their own colours and shape through the same tokens, and a theme's own rules
   further up (Obsidian Glass …) still win where they are more specific. Spacing that follows the density is in
   theme-studio.css (the numbers there, times --density).
   ===================================================================== */
:root {
  /* A field's edge reads against the surface (WCAG 1.4.11, 3 : 1): a step of the body ink into the hairline. */
  --field-line: color-mix(in srgb, var(--ink-500) 55%, var(--line-strong));
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brass-500) 32%, transparent);
  --row-hover: color-mix(in srgb, var(--brass-600) 6%, var(--white));
  /* The accent pressed / pointed at: darker, so the text on it keeps (and gains) its contrast in light and dark. */
  --accent-press: color-mix(in srgb, var(--brass-600) 84%, #000000);
}

/* Figures line up: tabular digits wherever numbers are compared. */
table.data-table, .kpi, .stat-cell, .definition-list dd, .badge, .pagination, .page-btn, .nav-count { font-variant-numeric: tabular-nums; }

/* ---- Shell: the top bar (white, a hairline under it) and the company's mark when the side menu is folded away ---- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink-900) 4%, transparent); gap: 12px; }
.topbar .page-title { font-size: var(--fs-16); font-weight: 650; font-variation-settings: 'wght' 650; letter-spacing: -0.01em; color: var(--ink-900); }
.topbar-brand { display: none; align-items: center; gap: 8px; min-width: 0; flex: none; color: var(--ink-900); text-decoration: none; }
.topbar-brand:hover { text-decoration: none; }
.topbar-brand img, .topbar-brand .brand-mark { width: 30px; height: 30px; }
.topbar-brand .topbar-brand-name { font-size: var(--fs-13); font-weight: 650; font-variation-settings: 'wght' 650; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) {
  html[data-nav="sidebar"] .topbar-brand, html[data-nav="rightbar"] .topbar-brand { display: inline-flex; }
}
@media (max-width: 520px) { .topbar-brand .topbar-brand-name { display: none; } .topbar { gap: 8px; } }
/* The name beside the avatar stays on one line (it broke one letter a line beside the staff work clocks). */
.profile-name { white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
/* Staff: the work clocks take the room — the buttons keep their icons, the page title keeps a few words. */
@media (max-width: 1600px) {
  .topbar:has(.work-timer, .auto-timer) .dash-link-text, .topbar:has(.work-timer, .auto-timer) .page-search-kbd, .topbar:has(.work-timer, .auto-timer) .profile-name { display: none; }
  .topbar:has(.work-timer, .auto-timer) .page-title { min-width: 6em; }
}
.profile-trigger { border: 1px solid transparent; }
.profile-trigger:hover { border-color: var(--line); }
.avatar { background: var(--brass-100); color: var(--brass-700); font-weight: 650; font-variation-settings: 'wght' 650; }

/* ---- Shell: the side menu — the company's mark, quiet items, one clear "you are here" ---- */
.sidebar { border-right: 1px solid var(--inverse-line); }
.sidebar-brand { gap: 12px; padding: 16px 16px 14px; }
.sidebar-brand img, .brand-mark { width: 36px; height: 36px; border-radius: var(--radius-md); flex: none; object-fit: contain; }
.brand-mark { display: flex; align-items: center; justify-content: center; background: var(--brass-600); color: var(--on-accent); font-size: var(--fs-13); font-weight: 700; font-variation-settings: 'wght' 700; letter-spacing: 0.02em; }
.sidebar-brand .brand-name { font-size: var(--fs-15); font-weight: 650; font-variation-settings: 'wght' 650; line-height: 1.25; }
.sidebar-brand .brand-sub { letter-spacing: 0.02em; }
.sidebar-nav { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--sidebar-muted) 45%, transparent) transparent; }
.nav-item { padding: 8px 12px; gap: 11px; transition: background-color 0.12s var(--ease), color 0.12s var(--ease); }
.nav-item svg { opacity: 0.78; }
.nav-item:hover svg, .nav-item.is-active svg { opacity: 1; }
.nav-item.is-active { font-weight: 600; font-variation-settings: 'wght' 600; }
.nav-children .nav-item:hover { color: var(--on-inverse); }
.nav-children .nav-item.is-active { background: var(--inverse-hover); box-shadow: inset 2px 0 0 var(--brass-500); }
.sidebar.is-collapsed .brand-mark, .sidebar.is-collapsed .sidebar-brand img { width: 32px; height: 32px; }

/* ---- Page header ---- */
.page-head h1 { font-weight: 650; font-variation-settings: 'wght' 650; line-height: 1.2; }
.page-head .lede { max-width: 80ch; }

/* ---- Cards and KPI-style summaries (the .kpi tiles lists already carry: their own counts, nothing new) ---- */
.panel { border-radius: var(--radius-lg); }
.panel-head > h2, .panel-head > h3 { font-weight: 620; font-variation-settings: 'wght' 620; letter-spacing: -0.005em; }
.kpi-grid { gap: var(--space-3); }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; border-radius: var(--radius-lg); }
.kpi .k { font-size: var(--fs-13); color: var(--ink-500); line-height: 1.3; }
.kpi .v { font-size: var(--fs-23); line-height: 1.2; color: var(--ink-900); font-weight: 650; font-variation-settings: 'wght' 650; letter-spacing: -0.01em; }
a.kpi, .kpi-link { transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease); }
a.kpi:hover, .kpi-link:hover { border-color: var(--brass-500); box-shadow: var(--shadow-md); text-decoration: none; }
.kpi-main { box-shadow: inset 3px 0 0 var(--brass-600), var(--shadow-sm); }
.stat-cell .stat-value { font-weight: 650; font-variation-settings: 'wght' 650; }

/* ---- Buttons: primary (solid accent), secondary (outlined), ghost, danger ---- */
.btn { font-weight: 600; font-variation-settings: 'wght' 600; }
.btn:focus-visible { outline: 2px solid var(--brass-500); outline-offset: 2px; }
.btn-primary { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink-900) 14%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-press); border-color: var(--accent-press); color: var(--on-accent); }
/* A person's own accent may carry dark text: pointing at it only lifts it, the colour stays. */
html[data-accent] .btn-primary:hover:not(:disabled) { background: var(--brass-600); border-color: var(--brass-600); box-shadow: var(--shadow-md); }
.btn-secondary { border-color: var(--field-line); box-shadow: 0 1px 1px color-mix(in srgb, var(--ink-900) 5%, transparent); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink-500); }
.btn-ghost:hover:not(:disabled) { color: var(--ink-900); }
.btn-danger { border-color: color-mix(in srgb, var(--red-600) 60%, var(--white)); }
.btn-danger:hover:not(:disabled) { border-color: var(--red-600); }

/* ---- Forms: labels, help text, error states ---- */
.input, select.input, textarea.input { border-color: var(--field-line); }
.input:hover:not(:focus):not([disabled]):not([readonly]) { border-color: var(--ink-500); }
/* a date / month / time field whose calendar button has the focus matches :focus-within only (Phase 6 keyboard walk) */
.input:focus, .input:focus-within { border-color: var(--brass-600); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"], .field.has-error .input { border-color: var(--red-600); }
.input[aria-invalid="true"]:focus, .input[aria-invalid="true"]:focus-within, .field.has-error .input:focus, .field.has-error .input:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-600) 22%, transparent); }
.field-error { font-weight: 560; font-variation-settings: 'wght' 560; }
.checkbox, .radio { border-color: var(--field-line); }
.checkbox:focus-visible, .radio:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--brass-600); }
input[type="number"].input, .input.num { font-variant-numeric: tabular-nums; }
/* A hint inside an empty field reads (measured 4.95 – 6.3 : 1 on the surface of every design, light and dark) and still looks unlike typed text. */
.input::placeholder { color: color-mix(in srgb, var(--ink-500) 70%, var(--ink-300)); }

/* ---- Filter chips: the chosen one in the accent, never a black block ---- */
.filter-chip { padding: 5px 12px; color: var(--ink-700); border-color: var(--line-strong); transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease), color 0.12s var(--ease); }
.filter-chip:hover { border-color: var(--ink-500); color: var(--ink-900); text-decoration: none; }
.filter-chip.is-active { background: var(--brass-050); border-color: var(--brass-600); color: var(--brass-700); font-weight: 600; font-variation-settings: 'wght' 600; box-shadow: inset 0 0 0 1px var(--brass-600); }

/* ---- Tabs: one underline style (the Activity Hub and pages with role="tablist") ---- */
.hub-tabs { gap: 2px; }
.hub-tab { border: 0; border-radius: 0; margin-bottom: -1px; color: var(--ink-500); font-weight: 560; font-variation-settings: 'wght' 560; box-shadow: inset 0 -2px 0 transparent; }
.hub-tab:hover { background: transparent; color: var(--ink-900); box-shadow: inset 0 -2px 0 var(--line-strong); text-decoration: none; }
.hub-tab.is-active { background: transparent; border: 0; color: var(--brass-700); font-weight: 650; font-variation-settings: 'wght' 650; box-shadow: inset 0 -2px 0 var(--brass-600); }

/* ---- Tables: hairlines, sticky headings, compact rows, numbers to the right ---- */
.table-wrap { border-radius: var(--radius-lg); }
table.data-table thead th { font-size: var(--fs-12); color: var(--ink-500); font-weight: 600; font-variation-settings: 'wght' 600; letter-spacing: 0.01em; border-bottom: 1px solid var(--line-strong); }
table.data-table tbody tr:hover { background: var(--row-hover); }
table.data-table td.cell-primary { color: var(--ink-900); font-weight: 600; font-variation-settings: 'wght' 600; }
/* public/js/app.js marks a column whose filled cells are all amounts, counts or percentages (heading and cells together). */
table.data-table th.is-num, table.data-table td.is-num { text-align: right; white-space: nowrap; }
table.data-table th.is-num.sortable::after { margin-left: 4px; }
.pagination { background: var(--white); }
.page-btn { width: auto; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-md); border-color: var(--line); }
.page-btn.is-active { background: var(--brass-600); border-color: var(--brass-600); color: var(--on-accent); font-weight: 650; font-variation-settings: 'wght' 650; }

/* ---- Status badges: pills with a dot and a hairline of their own colour ---- */
.badge { font-size: var(--fs-12); padding: 2px 9px; line-height: 1.45; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }

/* ---- Alerts: an accent edge on the left ---- */
.alert { border-left: 3px solid currentColor; }

/* ---- Empty states: the icon in a soft accent disc ---- */
.empty-state { padding: 52px 24px; }
.empty-state > svg { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: var(--brass-050); color: var(--brass-600); box-sizing: border-box; }

/* ---- Windows and menus that open ---- */
.modal { border: 1px solid var(--line); }
.modal-head h2 { font-size: var(--fs-18); font-weight: 650; font-variation-settings: 'wght' 650; }
.modal-foot { background: var(--paper-100); }
.dropdown-panel { box-shadow: var(--shadow-lg); }
.dropdown-item:hover { color: var(--ink-900); }

/* ---- Sign-in and public pages ---- */
.auth-card h2 { font-weight: 650; font-variation-settings: 'wght' 650; letter-spacing: -0.015em; }

/* ---- Form tabs (owner's T4, 2026-11-29): views/partials/ui/tabs.ejs + public/js/form-tabs.js ----
   A long form's fields grouped into tabs. Without the script every panel shows and the bar is hidden; in print every
   field shows and no tabs. The bar scrolls sideways on a phone (the page never does). */
:root {
  --form-tab-fg: var(--ink-500);
  --form-tab-fg-active: var(--ink-900);
  --form-tab-line: var(--line);
  --form-tab-active: var(--brass-600);
  --form-tab-mark: var(--red-600);
  --form-tab-bar-bg: var(--surface);
}
.form-tabs { min-width: 0; max-width: 100%; }
.form-tabs-bar { display: none; align-items: center; gap: 8px; border-bottom: 1px solid var(--form-tab-line); margin: 0 0 16px; background: var(--form-tab-bar-bg); }
.form-tabs.is-ready > .form-tabs-bar { display: flex; }
.modal-body .form-tabs.is-ready > .form-tabs-bar { position: sticky; top: -22px; z-index: 2; margin-top: -6px; padding-top: 6px; box-shadow: 0 -16px 0 var(--form-tab-bar-bg); }
.form-tabs-list { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; gap: 2px; }
.form-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--form-tab-fg); font: inherit; font-size: var(--fs-14); font-weight: 550; cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.form-tab:hover { color: var(--form-tab-fg-active); background: var(--surface-2); }
.form-tab.is-active { color: var(--form-tab-fg-active); border-bottom-color: var(--form-tab-active); }
.form-tab:focus-visible { outline: 2px solid var(--form-tab-active); outline-offset: -2px; }
.form-tab svg { width: 15px; height: 15px; }
.form-tab-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--form-tab-mark); flex: 0 0 auto; }
.form-tab-mark[hidden], .form-tab[hidden] { display: none; }
.form-tab.has-message { color: var(--form-tab-mark); }
.form-tabs-save { flex: 0 0 auto; margin-left: auto; }
.form-tabs.is-ready > .form-tab-panel:not(.is-active):not(.is-probe) { display: none; }
@media (max-width: 600px) { .form-tab { padding: 8px 10px; } }
@media print {
  .form-tabs-bar, .form-tabs.is-ready > .form-tabs-bar { display: none !important; }
  .form-tabs.is-ready > .form-tab-panel { display: block !important; }
}

/* ---- The dashboard's cards and chat look on every page (owner's T3, 2026-11-29; docs/07-design-and-behavior.md
   § The banking look → Cards and the chat look). Presentation only, tokens only: every page's panels and table cards take
   the dashboard tiles' soft shadow; notes, remarks, replies and timelines read as rounded message bubbles. A design
   whose --shadow-sm is none (CBS Classic) stays flat; Obsidian Glass keeps its own, more specific panel rules. ---- */
.panel, .table-wrap, .stat-row { box-shadow: var(--shadow-sm); }
.panel .panel, .panel .table-wrap, .panel .stat-row, .modal .panel, .modal .table-wrap, .modal .stat-row { box-shadow: none; }
.timeline li, .status-timeline li {
  margin: 0 0 8px 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg); overflow-wrap: anywhere;
}
.timeline li::before { left: -36px; top: 11px; }
.status-timeline li::before { left: -34px; top: 13px; }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.chat-item.is-mine { flex-direction: row-reverse; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--brass-100); color: var(--brass-700); font-size: var(--fs-13); font-weight: 650; font-variation-settings: 'wght' 650; }
.chat-bubble, .hub-remark, .comm-inbox-view [data-body] {
  display: block; max-width: 100%; padding: 8px 12px; background: var(--surface-2); color: var(--ink-900);
  border: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
  overflow-wrap: anywhere; white-space: pre-wrap; width: fit-content;
}
.chat-bubble.is-mine, .chat-item.is-mine .chat-bubble { background: var(--brass-050); border-color: var(--brass-100); border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-lg); }
.chat-bubble + .chat-bubble { margin-top: 6px; }
.chat-meta { display: block; font-size: var(--fs-12); color: var(--ink-500); margin-bottom: 2px; }
.hub-remark { padding: 3px 8px; white-space: normal; }
@media print {
  .panel, .table-wrap, .stat-row { box-shadow: none; }
  .timeline li, .status-timeline li, .chat-bubble, .hub-remark { background: none; }
}

/* ---- The dashboard's Congratulations board, own business block and highlight line (T9, views/partials/recognition.ejs,
   docs/RECOGNITION_BOARD.md). Tokens only; the line stands still as a plain list for reduced motion. ---- */
.rec-ticker { padding-top: 12px; padding-bottom: 12px; }
.rec-ticker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rec-ticker-head h2 { font-size: var(--fs-19); display: flex; align-items: center; gap: 6px; }
.rec-ticker-window { display: flex; overflow: hidden; max-width: 100%; border-radius: var(--radius-md); background: var(--brand-100); outline-offset: 2px; }
.rec-ticker-track { display: flex; flex-shrink: 0; min-width: 100%; gap: 32px; margin: 0; padding: 8px 32px 8px 12px; list-style: none; white-space: nowrap;
  animation: rec-scroll var(--rec-dur, 40s) linear infinite; }
.rec-ticker-window:hover .rec-ticker-track, .rec-ticker-window:focus-within .rec-ticker-track, .rec-ticker-window:focus .rec-ticker-track,
.rec-ticker-window.is-paused .rec-ticker-track { animation-play-state: paused; }
.rec-ticker-item { color: var(--ink-900); font-size: var(--fs-14); }
.rec-ticker-item::before { content: '•'; margin-right: 8px; color: var(--primary); }
.rec-ticker-item.is-cheer { font-weight: 600; }
.rec-ticker-item.is-nudge::before { color: var(--amber-600); }
@keyframes rec-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .rec-ticker-track { animation: none; flex-direction: column; gap: 4px; white-space: normal; flex-shrink: 1; padding: 8px 12px; }
  .rec-ticker-copy, .rec-ticker-pause { display: none; }
}
.rec-own-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.rec-own-score { display: flex; align-items: center; gap: 10px; }
.rec-own-num { font-size: var(--fs-34); font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.rec-own-parts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.rec-own-parts dt { font-size: 12px; color: var(--text-muted); }
.rec-own-parts dd { margin: 0; font-weight: 600; color: var(--ink-900); }
.rec-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; list-style: none; margin: 0 0 10px; padding: 0; }
.rec-tier { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.rec-tier strong { font-size: var(--fs-23); color: var(--ink-900); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.rec-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.rec-name { font-size: 13px; font-weight: 600; color: var(--ink-900); max-width: 100%; overflow-wrap: anywhere; }
.rec-photo-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.rec-photo-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.rec-photo { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--brass-100); background: var(--paper-0); }
.rec-photo-none { font-weight: 700; color: var(--ink-700); background: var(--brand-100); }
.rec-cap { position: absolute; top: -10px; right: -8px; font-size: 22px; line-height: 1; transform: rotate(12deg); }
.rec-modal-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.rec-modal-photo { width: min(320px, 100%); height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 64px; }
.rec-modal-photo[hidden] { display: none; }
.rec-ticker-pause .rec-ico-play, .rec-ticker-pause[aria-pressed="true"] .rec-ico-pause { display: none; }
.rec-ticker-pause[aria-pressed="true"] .rec-ico-play { display: inline-flex; }

/* ---------- Page components (T3 follow-up, 2026-11-29): the pages' own <style> blocks, moved here unchanged ----------
   Each group is one page's own pieces (prefixed names); a name another page also uses is scoped to its page (an id, a
   data-* hook or a class added to that page). Kept at the end of this file: the rules win as they did after the page's
   head. Tokens only. */

/* My tracking (/my/tracking) */
.tracked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: var(--space-3, 0.75rem); }
.tracked-card.is-off { opacity: 0.8; }
.tracked-card .panel-head h2 { display: flex; align-items: center; gap: 0.4rem; }

/* Company look (/admin/company-look) */
.look-swatch { width: 26px; height: 26px; flex: none; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--paper-100); }

/* Print designs (/admin/print-designs): the paper preview's field marks */
.design-sheet.mf-on .mf { background: var(--mark-field-bg); border-radius: 2px; box-shadow: 0 0 0 1px var(--mark-field-line); }
.design-sheet.mf-on .mf-miss { background: var(--mark-miss-bg); box-shadow: 0 0 0 1px var(--mark-miss-line); }

/* User Access (/admin/user-access): permission tables shown as cards — nothing needs sideways scrolling */
table.perm-cards, table.perm-cards tbody { display: block; width: 100%; }
table.perm-cards thead { display: none; }
table.perm-cards tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--radius-md, 10px); padding: 14px 16px; margin-bottom: 14px; background: var(--paper-50, transparent); }
/* .data-table: wins over the density layer's table.data-table td padding (theme-studio.css, loaded after this file) */
table.data-table.perm-cards td { display: block; padding: 0; border: 0; min-width: 0; }
table.perm-cards td.perm-name-cell { grid-column: 1 / -1; font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
table.perm-cards td.perm-name-cell .text-sm { margin: 0; }
table.perm-cards .perm-toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
table.perm-cards .perm-toggle:has(input:checked) { background: var(--accent-50, rgba(37, 99, 235, .08)); border-color: var(--accent-500); }
table.perm-cards .perm-field { display: block; font-size: 13px; }
table.perm-cards .perm-field > span { display: block; margin-bottom: 3px; color: var(--ink-500); }
table.perm-cards .perm-field select { width: 100%; min-width: 0 !important; }
table.perm-cards td.perm-scope { grid-column: span 2; }
table.perm-cards td.perm-band { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
table.perm-cards td.perm-band .perm-band-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
table.perm-cards td.perm-band .perm-label { font-size: 13px; color: var(--ink-700, inherit); }
.ov-group { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ov-group > h4 { font-size: 13px; margin: 0 0 6px; }
table.perm-cards td.perm-menu { align-self: end; }
table.perm-cards .perm-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--ink-500); }
table.perm-cards td.perm-actions { grid-column: 1 / -1; text-align: right; border-top: 1px solid var(--line); padding-top: 10px; }
table.perm-cards .scope-boxes { min-width: 0 !important; display: flex !important; flex-wrap: wrap; gap: 4px 18px !important; align-items: center; }
table.perm-cards .scope-boxes > span, table.perm-cards .scope-boxes > strong { flex-basis: 100%; margin-top: 2px !important; }
table.perm-cards td.perm-scope { grid-column: span 3; }
.perm-quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 10px; }
.ov-item { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); font-size: 13px; cursor: pointer; }
.ov-item.is-group .ov-label { color: var(--ink-500); }
.ov-item .btn { margin-left: auto; padding: 2px 8px; }
@media (max-width: 600px) { table.perm-cards td.perm-scope { grid-column: 1 / -1; } }
.ua-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.ua-tools .search-box { flex: 1; min-width: 220px; }
.panel[data-ua-section] > .panel-head .ua-fold { margin-left: auto; }
.panel[data-ua-section].is-folded > :not(.panel-head) { display: none !important; }
.ua-hit-none { display: none !important; }
.perm-band-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.perm-band-head .ua-band-all { margin-left: auto; padding: 2px 8px; }
.ua-imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
.ua-imp-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.ua-imp-row h4 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ua-imp-row h4 .ua-imp-actions { margin-left: auto; display: flex; gap: 6px; }

/* All agents / staff (/agents): the hierarchy rows */
.tree-toggle { width: 22px; height: 22px; padding: 0; margin-right: 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--white); color: var(--ink-700); font: 700 14px/1 system-ui, sans-serif; cursor: pointer; vertical-align: middle; }
.tree-toggle:hover { background: var(--paper-100); }
.tree-spacer { display: inline-block; width: 28px; }
#peopleTable[data-list="people"] tr.row-link { cursor: pointer; }
#peopleTable[data-list="people"] tr.row-link:focus-visible { outline: 2px solid var(--brass-600); outline-offset: -2px; }
#peopleTable[data-list="people"] tr.is-child td:first-child { border-left: 3px solid var(--brass-500); }
#peopleTable[data-list="people"] tr.is-child { background: color-mix(in srgb, var(--paper-100) 55%, transparent); }
#peopleTable[data-list="people"] tr[hidden] { display: none; }
#peopleTable[data-list="people"] td:first-child { white-space: nowrap; }
.branch-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: end; }
.branch-filters .field { margin: 0; }

/* Staff mapping (/agents/staff-mapping) and Meetings (/meetings): the filter box */
.sm-order { display: block; margin-top: 2px; }
.sm-filters, .mt-filters { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 14px 4px; margin: 0 0 10px; background: var(--paper-100); min-width: 0; }
.sm-filters legend, .mt-filters legend { padding: 0 6px; }
.sm-filter-grid, .mt-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.sm-filter-grid .field, .mt-filter-grid .field { margin-bottom: 8px; min-width: 0; }
.sm-filter-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 8px; }
.sm-pickbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.sm-pickbar .sm-show { width: auto; }
.sm-pickbar .sm-show .input { padding-top: 6px; padding-bottom: 6px; }
.sm-counts { margin-left: auto; color: var(--ink-700); }
/* Staff Mapping → Hierarchy report (views/agent/staff-mapping-hierarchy.ejs) */
.hier-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip-btn { cursor: pointer; font: inherit; font-size: var(--fs-13); color: var(--ink-900); }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--brass-600); }
.hier-name { display: inline-flex; align-items: center; gap: 4px; padding-left: calc(var(--hier-depth, 0) * 18px); }
.hier-toggle { width: 26px; height: 26px; flex: none; }
.hier-leaf { display: inline-block; width: 26px; flex: none; }
#hierTable td.num, #hierTable th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#hierAgents .panel-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#hierAgents .sm-show { width: auto; margin-left: auto; }
@media (max-width: 720px) { .hier-name { padding-left: calc(var(--hier-depth, 0) * 10px); } #hierTable th:nth-child(2), #hierTable td:nth-child(2) { display: none; } }
.rule-impact { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-100); padding: 10px 14px; margin: 4px 0 12px; font-size: var(--fs-14); }
.rule-impact ul { margin: 6px 0 0; padding-left: 18px; }
.rule-impact li { margin: 2px 0; }
.rule-impact .ri-warn { color: var(--amber-600); }
.rule-impact details { margin-top: 6px; }
.rule-impact summary { cursor: pointer; color: var(--ink-700); }
.rule-impact .ri-list { max-height: 220px; overflow: auto; margin-top: 4px; }
.rule-impact .ri-list div { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.rule-impact .ri-list div:last-child { border-bottom: none; }
.mv { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 12px 10px; margin: 0 0 12px; min-width: 0; }
.mv legend { padding: 0 6px; }
.mv-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.mv-bar .mv-search { flex: 1 1 220px; min-width: 0; }
.mv-bar .mv-show { width: auto; flex: 0 0 auto; }
.mv-all { display: inline-flex; gap: 6px; align-items: center; margin: 0; cursor: pointer; font-size: var(--fs-14); }
.mv-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px 10px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 14px; align-content: start; }
.mv-list label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; margin: 0; cursor: pointer; font-size: var(--fs-14); border-bottom: 1px dashed var(--line); min-width: 0; }
.mv-list label span { overflow-wrap: anywhere; }
.mv-list label .mv-n { color: var(--ink-700); white-space: nowrap; }
.mv-list .mv-none, .mv-list .mv-more { grid-column: 1 / -1; color: var(--ink-700); font-size: var(--fs-14); padding: 8px 0; }
.rule-replace { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 12px; font-size: var(--fs-14); cursor: pointer; }
.rule-editing { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.rules-sub { margin-top: 14px; }
.rules-sub > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.rules-sub .rules-search { max-width: 320px; margin: 8px 0; }
tr.is-editing td { background: var(--brass-100, var(--paper-200)); }
.chip .chip-rule { font-size: 11px; color: var(--ink-500, var(--ink-700)); white-space: nowrap; }
@media (max-width: 720px) { .sm-filter-grid { grid-template-columns: minmax(0, 1fr); } .sm-counts { margin-left: 0; width: 100%; } .mt-filter-grid { grid-template-columns: 1fr; } }

/* Unverified e-mails (/agents/unverified-emails) */
.ue-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.ue-filters .field { margin: 0; }
.ue-bulk { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 12px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.ue-progress { display: flex; flex-wrap: wrap; gap: 4px; }
#ueTable td { vertical-align: top; }
#ueTable td.ue-person { min-width: 180px; }
#ueTable td.ue-person .badge { margin-top: 6px; }
#ueTable td.ue-when { white-space: nowrap; }
#ueTable td.ue-decision { min-width: 250px; max-width: 320px; }
.ue-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ue-actions:empty { display: none; }

/* E-mail lists (/email-lists) */
.email-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.email-layout .list-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.email-layout .list-item.is-active { background: var(--surface-2); font-weight: 600; }
@media (max-width: 860px) { .email-layout { grid-template-columns: 1fr; } .email-layout .hide-sm { display: none; } }

/* GPS test (/gps/test): the console keeps a terminal look in every theme */
.gt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.gt-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.gt-facts dt { color: var(--ink-500); }
.gt-facts dd { margin: 0; font-weight: 500; word-break: break-word; }
.gt-console { background: var(--console-bg); color: var(--console-fg); font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; padding: 10px 12px; border-radius: 8px; height: 260px; overflow: auto; white-space: pre; margin: 0 0 8px; }
.gt-bad { color: var(--console-bad); }
.gt-help details { border-top: 1px solid var(--line); padding: 10px 0; }
.gt-help details:first-child { border-top: 0; }
.gt-help summary { cursor: pointer; }
.gt-help ol { margin: 8px 0 0 18px; }

/* HR / payroll settings (/payroll/settings) */
.method-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 10px; }
.method-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; cursor: pointer; background: var(--white); }
.method-card:has(input:checked) { border-color: var(--brass-600); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brass-600) 25%, transparent); }
.method-card .mc-title { display: block; margin-bottom: 4px; font-weight: 650; }
.method-card ul { margin: 6px 0 0 16px; padding: 0; }
[data-std-only].is-muted { opacity: .55; }
.pay-example { border-left: 3px solid var(--brass-600); background: var(--paper-100); padding: 10px 12px; border-radius: 6px; }
#hrForm.is-person-scope .loc-company { display: none; }

/* Imports (/imports) */
.portal-card[data-upload-card].is-target { outline: 3px solid var(--brass-600); outline-offset: 2px; transition: outline-color .3s; }
/* .portal-card svg (the card's big icon) would make the icons inside buttons large and the button's own colour */
.portal-card[data-upload-card] .btn svg, .portal-card[data-upload-card] .seg-opt svg { width: 15px; height: 15px; color: currentColor; }
.upload-mode { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); overflow: hidden; max-width: 100%; }
.upload-mode .seg-opt { display: flex; position: relative; }
.upload-mode .seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.upload-mode .seg-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer; font-size: var(--fs-13, 13px); }
.upload-mode .seg-opt span svg { width: 15px; height: 15px; }
.upload-mode .seg-opt input:checked + span { background: var(--brass-600); color: var(--on-accent); }
.upload-mode .seg-opt input[value="replace"]:checked + span { background: var(--red-600); }
.upload-mode .seg-opt input:focus-visible + span { outline: 2px solid var(--brass-600); outline-offset: -2px; }
.import-out { margin-top: 8px; display: grid; gap: 6px; }
.import-errors { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); }
.import-errors table { width: 100%; border-collapse: collapse; }
.import-errors th, .import-errors td { padding: 4px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.import-errors th { position: sticky; top: 0; background: var(--paper-100); font-weight: 600; }
.import-errors td:first-child { white-space: nowrap; width: 1%; }
.modal-list { max-height: 200px; overflow: auto; margin: 4px 0 0; padding-left: 18px; }

/* A report's rows (/reports/:id) */
.file-thumb { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-100); cursor: zoom-in; overflow: hidden; position: relative; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb .file-thumb-doc { display: none; font-size: 11px; font-weight: 600; color: var(--ink-700); text-align: center; padding: 2px; }
.file-thumb.is-doc .file-thumb-doc { display: block; }
.file-thumb.is-doc img { display: none; }
#fileBody { text-align: center; min-height: 200px; max-height: 72vh; overflow: auto; }
#fileBody img { max-width: 100%; max-height: 70vh; border-radius: 6px; }
#fileBody iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet); }
/* Sub-row lists (.data-table.has-sub above): on a report a sub-row opens its record, like the row above it. */
table.data-table.has-sub.is-report-run tr.sub-row { cursor: pointer; }
/* The designer's filters: a list of ticks under a heading that says what is ticked. */
.field-row.cf-filters { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.cf-field { position: relative; min-width: 0; }
.cf-field.cf-date { grid-column: span 2; }
.cf-pick { position: relative; }
.cf-pick > summary { list-style: none; cursor: pointer; display: block; padding-right: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; user-select: none; }
.cf-pick > summary::-webkit-details-marker { display: none; }
.cf-pick > summary::after { content: ''; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--ink-500); border-bottom: 2px solid var(--ink-500); transform: translateY(-70%) rotate(45deg); }
.cf-pick[open] > summary::after { transform: translateY(-20%) rotate(225deg); }
.cf-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(360px, calc(100vw - 32px)); background: var(--white); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.14)); padding: 8px; }
.cf-menu .cf-find { margin-bottom: 6px; }
.cf-opts { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.cf-opt { display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-weight: 400; }
.cf-opt:hover { background: var(--paper-100); }
.cf-opt[hidden] { display: none; }
.cf-acts { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.cf-dates { display: flex; gap: 6px; align-items: center; }
.cf-dates .input { min-width: 0; }
@media (max-width: 640px) { .field-row.cf-filters { grid-template-columns: 1fr; } .cf-field.cf-date { grid-column: auto; } .cf-menu { width: 100%; max-width: none; } }
.row-detail-grid dd .sub-line { display: block; }
.row-detail-grid dd .sub-line + .sub-line { border-top: 1px dashed var(--line); padding-top: 2px; margin-top: 2px; }

/* Request Centre (/requests) */
.rc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-tab { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; color: inherit; }
.rc-tab[aria-selected="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent); font-weight: 600; }
.rc-tab svg { width: 16px; height: 16px; }
/* Category tick boxes: All, Profile change, Service Desk … (more than one may be ticked; none = All). */
.rc-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rc-cat { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; font-size: 13.5px; background: var(--surface); user-select: none; }
.rc-cat:hover { border-color: var(--primary); }
.rc-cat.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); font-weight: 600; }
.rc-cat.is-empty { opacity: .6; }
.rc-cat input { margin: 0; }
.rc-cat .badge { font-weight: 500; }
.rc-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rc-filters .input[type="search"] { flex: 1; min-width: 220px; }
.rc-list { display: grid; gap: 8px; }
.rc-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.rc-row:hover { border-color: var(--primary); }
.rc-row .rc-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.rc-row .rc-ic svg { width: 18px; height: 18px; }
.rc-row .rc-t { font-weight: 600; overflow-wrap: anywhere; }
.rc-row .rc-m { font-size: 12.5px; color: var(--ink-500); overflow-wrap: anywhere; }
.rc-row .rc-a { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rc-start { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rc-start button { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.rc-start button:hover { border-color: var(--primary); }
.rc-drawer { position: fixed; inset: 0; z-index: 1200; }
.rc-drawer[hidden] { display: none; }
.rc-drawer-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); }
.rc-drawer-box { position: absolute; top: 0; right: 0; bottom: 0; width: min(1100px, 92vw); background: var(--bg); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0, 0, 0, .18); }
.rc-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.rc-drawer-head h2 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rcFrame { flex: 1; width: 100%; border: 0; background: var(--bg); }
@media (max-width: 720px) { .rc-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; } .rc-cat { flex: none; } .rc-drawer-box { width: 100vw; } .rc-row { grid-template-columns: 30px minmax(0, 1fr); } .rc-row .rc-a { grid-column: 1 / -1; justify-content: flex-start; } }

/* Service Desk (/services/desk) and a ticket (/services/tickets/:id) */
.desk-tickets tr.row-link { cursor: pointer; }
.desk-tickets tr.row-link:hover > td { background: var(--paper-100); }
.desk-words { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; max-width: 360px; font-size: 13px; color: var(--ink-900); }
.desk-words svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--ink-500); }
.desk-words span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.ticket-words .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.ticket-words .panel-head h2 svg { width: 18px; height: 18px; color: var(--ink-500); }
.ticket-words-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; margin: 0; }
.ticket-reopen { margin-top: 8px; }
.desk-report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.desk-report { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); color: var(--ink-900); text-decoration: none; min-width: 0; transition: border-color .12s, background .12s; }
.desk-report:hover, .desk-report:focus-visible { border-color: var(--blue-600); background: var(--paper-100); }
.desk-report-icon { flex: none; color: var(--blue-600); display: inline-flex; }
.desk-report-icon svg, .desk-report-go svg { width: 18px; height: 18px; }
.desk-report-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.desk-report-text strong, .desk-report-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-report-go { flex: none; color: var(--ink-500); display: inline-flex; }

/* SMTP settings (/settings/smtp): Automatic / Manual */
.smtp-mode.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.smtp-mode .seg-opt { display: flex; }
.smtp-mode .seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.smtp-mode .seg-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.smtp-mode .seg-opt span svg { width: 16px; height: 16px; }
.smtp-mode .seg-opt input:checked + span { background: var(--primary); color: var(--on-accent); }
.smtp-mode .seg-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }

/* Settlement (/settlement): the bank-file check */
.bc-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-100); margin-bottom: 10px; font-size: 14px; }
tr.bc-match > td { background: var(--green-100); }
tr.bc-mismatch > td { background: var(--red-100); }
tr.bc-not-found > td, tr.bc-duplicate > td, tr.bc-not-in-bank > td { background: var(--amber-100); }

/* Find a setting (/setup/find) */
.sf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sf-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); color: var(--ink-900); text-decoration: none; }
.sf-item:hover, .sf-item:focus-visible { background: var(--paper-100); }
.sf-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf-sep { color: var(--ink-500); }
.sf-page { font-weight: 600; }
.sf-keys { color: var(--ink-700); }
.sf-item mark { background: var(--paper-100); color: inherit; font-weight: 700; }

/* Staff & agent signatures (/signatures) */
table[data-list-table="signaturePeople"] .sig-thumb { border: 1px dashed var(--line); background: var(--sheet); padding: 2px 4px; border-radius: 6px; cursor: zoom-in; line-height: 0; }
table[data-list-table="signaturePeople"] .sig-thumb img { max-height: 44px; max-width: 160px; display: block; }
table[data-list-table="signaturePeople"] .sig-thumb img.is-seal { height: 48px; max-height: none; }
.sig-new { margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.sig-view { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.sig-view figure { margin: 0; flex: 1; min-width: 220px; }
.sig-view figcaption { font-size: 12px; color: var(--ink-500); margin-bottom: 4px; }
.sig-view .sig-paper { background: var(--sheet); border: 1px dashed var(--line); border-radius: 8px; min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 10px; }
.sig-view .sig-paper img { max-width: 100%; max-height: 220px; }
.sig-view .sig-none { color: var(--ink-500); font-size: 13px; }

/* Software check (/software/check), My computer set-up (/my/software), a software test (/software/test/:id) */
.sc-bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.sc-fill { height: 100%; width: 0; transition: width .4s; background: var(--ink-300); }
.sc-fill.sc-pending { background: var(--ink-300); } .sc-fill.sc-running { background: var(--blue-600); } .sc-fill.sc-installed { background: var(--green-600); } .sc-fill.sc-failed { background: var(--red-600); }
.sc-cell + .sc-cell { margin-top: 6px; }
.sw-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; }
@media (max-width: 960px) { .sw-grid { grid-template-columns: 1fr; } }
.sw-steps { margin: 0 0 12px 18px; display: grid; gap: 12px; }
.sw-dev { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.sw-dev-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.sw-chip { display: inline-flex; gap: 4px; align-items: center; margin: 2px 6px 2px 0; }
.sw-test-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }

/* To-Do & Tasks (/todo) */
.tm { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.tm.has-drawer { grid-template-columns: 220px minmax(0, 1fr) minmax(300px, 380px); }
.tm-nav { position: sticky; top: calc(var(--stick-top) + 8px); display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-0); }
.tm-list { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--ink-700); text-decoration: none; font-size: var(--fs-14); }
.tm-list:hover { background: var(--paper-100); }
.tm-list.is-active { background: var(--brass-050); color: var(--ink-900); font-weight: 600; }
.tm-list svg { width: 18px; height: 18px; flex: none; }
.tm-list span:first-of-type { flex: 1; }
.tm-count { font-size: var(--fs-13); color: var(--ink-500); font-weight: 500; }
.tm-count.is-late { color: var(--red-600); font-weight: 700; }
.tm-sep { border-top: 1px solid var(--line); margin: 6px 4px; }
.tm-main { min-width: 0; }
.tm-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tm-head h2 { margin: 0; font-size: var(--fs-23); }
.tm-head .tm-date { color: var(--ink-500); font-size: var(--fs-14); }
.tm-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.tm-tools .input { max-width: 260px; }
.tm-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-0); margin-bottom: 12px; }
.tm-add .input { flex: 1 1 240px; min-width: 0; }
.tm-chip { border: 1px solid var(--line); background: var(--paper-0); color: var(--ink-700); border-radius: 999px; padding: 3px 10px; font-size: var(--fs-13); cursor: pointer; }
.tm-chip.is-on { background: var(--brass-100); border-color: var(--brass-500); color: var(--ink-900); }
.tm-items { display: flex; flex-direction: column; gap: 6px; }
.tm-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-0); cursor: pointer; }
.tm-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.tm-item.is-selected { border-color: var(--brass-500); box-shadow: var(--shadow-sm); }
.tm-item.is-attention { border-left: 4px solid var(--red-600); background: var(--red-100); }
.tm-item.is-final .tm-title { text-decoration: line-through; color: var(--ink-500); }
.tm-body { flex: 1; min-width: 0; }
.tm-title { font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.tm-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: var(--fs-13); color: var(--ink-500); }
.tm-meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.tm-side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tm-star { background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-500); padding: 2px; /* 4.5:1 or better in light and dark (Phase 6 contrast check) */ }
.tm-star.is-on { color: var(--brass-600); }
.tm-star[disabled] { cursor: default; }
.tm-drawer { position: sticky; top: calc(var(--stick-top) + 8px); max-height: calc(100vh - var(--stick-top) - var(--stick-bottom) - 24px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-0); padding: 14px 16px; }
.tm-drawer h3 { margin: 0 0 4px; font-size: var(--fs-19); overflow-wrap: anywhere; }
.tm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: var(--fs-14); margin: 10px 0; }
.tm-dl dt { color: var(--ink-500); }
.tm-dl dd { margin: 0; overflow-wrap: anywhere; }
.tm-tl { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.tm-tl li { position: relative; padding: 0 0 12px 10px; }
.tm-tl li::before { content: ''; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper-0); border: 2px solid var(--brass-500); }
.tm-tl .tm-when { font-size: var(--fs-13); color: var(--ink-500); }
@media (max-width: 1100px) { .tm.has-drawer { grid-template-columns: 200px minmax(0, 1fr); } .tm.has-drawer .tm-drawer { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 760px) { .tm, .tm.has-drawer { grid-template-columns: minmax(0, 1fr); } .tm-nav { position: static; flex-direction: row; flex-wrap: wrap; } .tm-sep { display: none; } }

/* Verification master (/verification/master) */
.vflag-list { display: grid; gap: 6px; }
.vflag-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }

/* ---------- Shared boxes (T3 follow-up, 2026-11-29): what pages used to draw with inline style="…" ----------
   One class per pattern, tokens only; a page names the class instead of repeating the box. */
/* A list of ticks or names that scrolls inside its own frame (people to send to, items to choose). */
.scroll-box { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); padding: 6px 10px; }
.scroll-box.is-short { max-height: 200px; }
.scroll-box.is-medium { max-height: 240px; }
.scroll-box.is-tall { max-height: 260px; }
.scroll-box.check-list { background: transparent; } /* To-Do's service / document ticks: no fill of their own */
.scroll-box.tr-list { background: transparent; border-radius: 8px; padding: 6px 8px; } /* a terminal request's product / terminal lists */
/* A framed group inside a form or a card. */
.outline-box { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; }
.outline-box.is-compact { padding: 10px 12px; }
.outline-box.is-roomy { border-radius: 10px; padding: 14px; }
/* A fieldset that only groups (no frame, no spacing of its own). */
.fieldset-plain { border: 0; padding: 0; margin: 0; }
.fieldset-plain.is-spaced { margin-bottom: 12px; }
/* A row ruled off from the one above (or below). */
.rule-top { border-top: 1px solid var(--line); padding-top: 12px; }
.rule-row { border-top: 1px solid var(--line); padding: 8px 0; }
.rule-row.is-loose { padding: 10px 0; }
.rule-bottom { border-bottom: 1px solid var(--line); }
.rule-left { border-left: 1px solid var(--line); padding-left: 20px; }
/* A picture, a QR code or a preview on white paper in a thin frame. */
.img-frame { border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.frame-preview { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.frame-preview.is-half { height: 46vh; }
.photo-frame { width: 96px; height: 120px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-2); }
.logo-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: contain; background: var(--sheet); border: 1px solid var(--line); }
.logo-thumb.is-initials { border: 0; background: var(--brass-100); color: var(--brass-700); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.brand-logo { width: 26px; height: 26px; border-radius: 6px; object-fit: contain; background: var(--sheet); }
.brand-logo.is-sm { width: 22px; height: 22px; border-radius: 5px; vertical-align: -5px; margin-right: 8px; }
.brand-logo.is-lg { width: 28px; height: 28px; }
.sig-frame { background: var(--sheet); border: 1px dashed var(--line); }
.sig-frame.is-signature { max-height: 80px; max-width: 240px; }
.sig-frame.is-seal { height: 96px; }
.visit-thumb { max-width: 96px; max-height: 96px; border-radius: 6px; cursor: zoom-in; }
.entry-photo { max-width: 260px; border-radius: var(--radius-md); border: 1px solid var(--line); margin-top: 10px; }
.camera-frame { max-width: 100%; max-height: 260px; border-radius: var(--radius-md); background: var(--ink-900); }
/* A panel sunk into the page (paper colour, no shadow); a declaration's text scrolls inside it. */
.panel.is-sunken { background: var(--paper-100); box-shadow: none; }
/* .panel.: wins over the density layer's .panel padding (theme-studio.css, loaded after this file) */
.panel.decl-text { max-height: 240px; overflow: auto; font-size: 13px; line-height: 1.5; padding: 12px 14px; }
.panel.decl-text.is-short { max-height: 200px; padding: 10px 12px; }
.panel.decl-text.is-tall { max-height: 320px; font-size: 14px; line-height: 1.55; padding: 14px 16px; }
.decl-preview { max-height: 460px; overflow: auto; font-size: 14px; line-height: 1.5; }
/* A panel marked on its left edge, or framed in the danger colour. */
/* :hover too — a theme's panel hover colour (Obsidian) must not repaint the marked edge */
.panel.edge-amber, .panel.edge-amber:hover { border-left: 4px solid var(--amber-600); }
.panel.edge-amber-soft, .panel.edge-amber-soft:hover { border-left: 4px solid var(--amber-500); }
.panel.edge-red, .panel.edge-red:hover { border-left: 4px solid var(--red-600); }
.panel.edge-danger, .panel.edge-danger:hover { border-color: var(--danger); }
a.panel.is-link { text-decoration: none; color: inherit; }
.panel.is-floating { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 360px; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.2)); }
.portal-card.is-soft { box-shadow: var(--shadow-sm); }
.banner-strip.is-alert { background: var(--red-100); border-color: var(--red-600); color: var(--text); }
/* The round picture over an error or a done message. */
.state-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; background: var(--paper-200); color: var(--ink-500); }
.state-icon.is-danger { background: var(--red-100); color: var(--red-600); }
.state-icon.is-warn { background: var(--amber-100); color: var(--amber-600); }
.state-icon.is-ok { width: 56px; height: 56px; background: var(--green-100); color: var(--green-600); }
.sub.error-detail { font-family: monospace; font-size: 12px; background: var(--paper-100); padding: 10px; border-radius: 6px; text-align: left; overflow: auto; }
/* Small pieces. */
.dropdown-item.is-btn, .dropdown-item.is-btn:hover { width: 100%; border: none; background: none; text-align: left; cursor: pointer; }
.dropdown-item.is-btn.is-danger { color: var(--red-600); }
.page-btn.is-gap, .page-btn.is-gap:hover { border: none; background: none; }
input.color-input { width: 48px; height: 36px; padding: 0; border: none; }
.design-section.is-plain { border: none; }
.modal-foot.is-bare { padding: 0; border: 0; }
table.data-table td.total-cell { font-weight: 700; border-top: 2px solid var(--line-strong); }
table.data-table td.total-cell.is-num { text-align: right; }
.send-track { height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; }
.send-fill { height: 6px; background: var(--primary); border-radius: 3px; }
