/* Hillier PM - layout follows the Nav Bar reference: white header, navy main nav with orange active
   section, light sub-tab bar with orange underline, cream page with orange-barred headings. */
:root {
  --navy: #002b6b;
  --navy-2: #0b3a82;
  --orange: #e8650a;
  --orange-soft: #fbe3d1;
  --cream: #fdf4ec;
  --paper: #fffdf9;
  --line: #e6ddd3;
  --line-2: #d7ccbf;
  --ink: #111827;
  --muted: #6b7280;
  --tab-on: #efe8e0;
  --good: #1f7a3a;
  --good-bg: #e3f3e7;
  --warn: #9a5b00;
  --warn-bg: #fff1d6;
  --bad: #b42318;
  --bad-bg: #fde4e1;
  --neutral-bg: #eef0f3;
  --radius: 6px;
  --gutter: clamp(12px, 2vw, 32px);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Segoe UI Black", "Arial Black", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--cream); }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
code { font-family: Consolas, ui-monospace, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.bad { color: var(--bad); font-weight: 600; }
.good { color: var(--good); }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.topbar { background: var(--paper); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px var(--gutter); min-height: 66px; }
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { font: 900 26px/1.1 var(--font-head); color: var(--navy); letter-spacing: -0.3px; white-space: nowrap; text-decoration: none; flex: none; }
a.brand:hover { text-decoration: none; color: var(--navy); }
.brand .brand-pm { color: var(--orange); }
/* the stacked-floors mark in place of the dash: cap height, sitting on the baseline, orange like "PM" */
.brand .brand-floors { display: inline-block; height: 0.72em; width: 0.432em; margin: 0 0.06em 0 0.08em; vertical-align: 0; fill: currentColor; }
.brand .brand-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.brand.brand-dark, a.brand.brand-dark:hover { color: #fff; }
.brand-sep { width: 1px; height: 30px; background: var(--line-2); flex: none; }
.login-card .brand { display: inline-block; font-size: 30px; margin-bottom: 2px; }
@media (max-width: 640px) { .brand { font-size: 20px; } .brand-sep { height: 22px; } .topbar-left { gap: 10px; } }
.project-switch { position: relative; min-width: 0; }
.project-name { font: 900 26px/1.1 var(--font-head); color: var(--ink); background: none; border: 0; padding: 4px 0;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; letter-spacing: -0.3px; text-align: left; }
.project-name svg { color: var(--muted); flex: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.search { position: relative; display: flex; align-items: center; gap: 8px; background: #fbf3ea; border: 1px solid var(--line-2);
  border-radius: 4px; padding: 0 12px; height: 38px; width: min(300px, 40vw); color: var(--ink); }
.search input { border: 0; background: transparent; outline: none; font: inherit; width: 100%; }
.search-results { top: 42px; left: 0; right: 0; max-height: 60vh; overflow: auto; }
.search-results a { display: block; }
.search-results small { color: var(--muted); display: block; font-size: 11.5px; }
.search-results a.hl { background: var(--tab-on); }
.avatar-wrap { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.avatar > span { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font: 700 11.5px var(--font); }
.avatar.sm { width: 24px; height: 24px; border: 0; font: 700 10px var(--font); color: #fff; display: inline-grid;
  vertical-align: middle; background: var(--navy); border-radius: 50%; }

.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 280px; background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; }
.menu.right { left: auto; right: 0; }
.menu a { display: block; padding: 7px 10px; border-radius: 4px; color: var(--ink); }
.menu a:hover, .menu a.on { background: var(--tab-on); text-decoration: none; }
.menu .menu-form { margin: 0; }
.menu .menu-link { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 4px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.menu .menu-link:hover { background: var(--tab-on); }
.menu .code { color: var(--muted); font-size: 12px; margin-right: 6px; }
.menu-label { padding: 6px 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- navigation ---------- */
.mainnav { background: var(--navy); }
.nav-inner { display: flex; gap: 0; padding: 0 max(0px, calc(var(--gutter) - 16px)); overflow-x: auto; scrollbar-width: thin; }
.mainnav a { color: #fff; font-weight: 700; font-size: 13.5px; line-height: 20px; white-space: nowrap; padding: 11px 11px; display: block; border: 2px solid transparent; }
.mainnav a:hover { background: var(--navy-2); text-decoration: none; }
.mainnav a.active { background: var(--orange); border-color: #ffb27a; color: #1a0f05; }
.mainnav .nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--orange);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; vertical-align: 1px; }
.mainnav a.active .nav-badge { background: var(--navy); }
.subnav .nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--orange);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; vertical-align: 1px; }
.subnav { background: var(--paper); border-bottom: 1px solid var(--line-2); }
.subnav.empty { height: 6px; }
/* 20px line + 22px padding + 3px underline + the bar's 1px border = 46px, the main nav's height */
.subnav a { color: var(--ink); line-height: 20px; white-space: nowrap; padding: 11px 16px; display: block; border-bottom: 3px solid transparent; }
.subnav a:hover { background: #f7f0e8; text-decoration: none; }
.subnav a.active { background: var(--tab-on); border-bottom-color: var(--orange); }

/* ---------- page ---------- */
.page { padding: 15px var(--gutter) 64px; }
.page-head { border-left: 4px solid var(--orange); padding: 2px 0 2px 24px; margin: 0 0 20px; }
.page-head h1 { font: 900 30px/1.2 var(--font-head); letter-spacing: -0.4px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); max-width: 900px; }
.page-head.with-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head .actions-below { flex: 0 0 100%; }
.page-head .actions-below .actions-right { margin-left: auto; }
.crumbs { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 14px; border: 1px solid; }
.flash-ok { background: var(--good-bg); border-color: #b6dfc2; color: var(--good); }
.flash-error { background: var(--bad-bg); border-color: #f5b8b1; color: var(--bad); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 18px; }
.card h2 { font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.card h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.card-head h2 { margin-bottom: 0; }
.purpose { margin: 4px 0 0; color: var(--muted); max-width: 950px; font-size: 13px; }
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 10px; background: var(--neutral-bg);
  color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 13.5px var(--font); padding: 7px 14px; border-radius: 4px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f7f0e8; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }

.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 14px var(--font); box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.confirm-dialog::backdrop { background: rgba(0, 43, 107, .35); }
.confirm-dialog h3 { margin: 0 0 8px; color: var(--navy); font-size: 16px; }
.confirm-dialog p { margin: 0 0 18px; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.add-option-dialog .field { display: grid; gap: 4px; margin: 0 0 18px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
/* sub-sub tabs (pills) sit immediately below the sub-tab bar, above the page heading */
.page:has(> .pills) { display: flex; flex-direction: column; }
.page > .pills { order: -1; margin: -10px 0 16px; align-self: flex-start; }
.pill-tab { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 13px; }
.pill-tab:hover { text-decoration: none; border-color: var(--orange); }
.pill-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--warn-bg);
  color: var(--warn); white-space: nowrap; }
.pill.big { font: 600 13px var(--font); padding: 3px 12px; letter-spacing: 0; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-neutral { background: var(--neutral-bg); color: #374151; }
.pill-closed { background: var(--neutral-bg); color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-2); vertical-align: middle; }

/* ---------- registers ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 360px; }
.toolbar .count { margin-left: auto; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-2); border-radius: 4px; padding: 7px 9px;
  background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange-soft); border-color: var(--orange); }
textarea { width: 100%; resize: vertical; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }

/* a security's Security Scope: the contract line items it is held against, grouped by contract */
.security-scope { display: grid; gap: 10px; }
.security-scope-contract { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0; display: grid; gap: 4px; }
.security-scope-contract[hidden] { display: none; }
.security-scope-contract legend { font-weight: 600; padding: 0 4px; }
.security-scope p[hidden] { display: none; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { text-align: left; font-weight: 600; color: #374151; background: #faf6f1; border-bottom: 1px solid var(--line-2);
  padding: 8px 10px; white-space: nowrap; }
.grid th a { color: inherit; }
.grid .col-head { display: flex; align-items: center; gap: 4px; }
.grid th.num .col-head { justify-content: flex-end; }
.grid .col-head a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.col-filter-btn { flex: none; display: inline-flex; padding: 2px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; }
.col-filter-btn:hover, .col-filter-btn[aria-expanded=true] { background: var(--line); color: #374151; }
.col-filter-btn.on { color: var(--orange); }
.grid .col-filter { display: block; width: 100%; min-width: 70px; box-sizing: border-box; margin-top: 4px; padding: 3px 6px; font-size: 12.5px; font-weight: 400; }
.grid td { padding: 8px 10px; border-bottom: 1px solid #f0e9e1; vertical-align: top; }
.grid tbody tr[data-href] { cursor: pointer; }
.grid tbody tr:hover { background: #fdf8f3; }
.grid tr.closed td { color: var(--muted); }
.grid tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); border-bottom: 0; }
.grid.compact td, .grid.compact th { padding: 6px 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.row-link { font-weight: 600; }
/* table tools (static/grid.js): search, columns, selection, resizing, editing cells */
.grid-new { margin: 0 0 8px; }
.grid-tools { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 8px; }
.grid-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.grid-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.grid-search { flex: 0 1 260px; min-width: 0; padding: 5px 9px; }
.grid-menu-wrap { position: relative; }
.sel-info[hidden] + .grid-menu-wrap { margin-left: auto; }
.grid-cols { min-width: 240px; }
.grid-col-list { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; padding: 0 6px; }
.grid-col-list label { padding: 3px 4px; border-radius: 4px; }
.grid-col-list label:hover { background: var(--tab-on); }
.grid-col-foot { display: flex; gap: 6px; padding: 8px 6px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.sel-info { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; padding: 3px 4px 3px 10px;
  background: var(--orange-soft); border-radius: var(--radius); }
.sel-info strong { font-size: 13px; margin-right: 4px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: #f5b8b1; }
.grid th.sel, .grid td.sel { width: 34px; padding-right: 0; cursor: pointer; }
.grid .sel input { margin: 0; cursor: pointer; }
.grid tbody tr.selected { background: #fdf0e4; }
.grid th { position: relative; }
/* Documents register: Title column opens wide by default */
table.grid[data-table="documents"] th[data-col="title"] { min-width: 378px; }
/* Client Approvals register: fits the page without scrolling sideways - narrow columns whose text wraps, Title and Tag comment share the rest */
table.grid[data-table="client_approvals"] { table-layout: fixed; min-width: 640px; }
table.grid[data-table="client_approvals"] th { width: 92px; padding: 8px; white-space: normal; }
table.grid[data-table="client_approvals"] td { padding: 8px; overflow-wrap: anywhere; }
table.grid[data-table="client_approvals"] td .pill { white-space: normal; }
table.grid[data-table="client_approvals"] th[data-col="title"], table.grid[data-table="client_approvals"] th[data-col="tag_comment"] { width: auto; }
.col-resize { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; z-index: 1; touch-action: none; }
.col-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; border-left: 1px solid var(--line-2); }
.col-resize:hover::after, .grid.resizing .col-resize::after { border-left: 2px solid var(--orange); top: 0; bottom: 0; }
.grid.resizing { user-select: none; }
/* saved column widths set a pixel width on the table (grid.js); min-width keeps it filling the page */
.grid.sized { table-layout: fixed; min-width: 100%; }
.grid.sized th, .grid.sized td { overflow: hidden; text-overflow: ellipsis; }
.grid.editing td.editable { cursor: text; box-shadow: inset 0 0 0 1px transparent; }
.grid.editing td.editable:hover { box-shadow: inset 0 0 0 1px var(--orange); background: #fff; }
.grid.editing tbody tr[data-href] { cursor: default; }
.grid td.is-editing { padding: 3px 4px; background: #fff; overflow: visible; }
.cell-editor input, .cell-editor select, .cell-editor textarea { width: 100%; min-width: 90px; padding: 4px 6px; font-size: 13px; }
.cell-error { color: var(--bad); font-size: 12px; font-weight: 600; margin-top: 2px; white-space: normal; }
.grid td.cell-saved { background: var(--good-bg); transition: background .6s; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.pager a { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 4px; }
.pager a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---------- record ---------- */
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.fd dt { font-size: 12px; color: var(--muted); }
.fd dd { margin: 2px 0 0; font-weight: 500; word-break: break-word; }
.fd.empty dd { color: #b8b0a6; font-weight: 400; }
.doc-preview-actions { display: flex; gap: 6px; flex-shrink: 0; }
.doc-preview h2 { word-break: break-word; }
.doc-preview-view { position: relative; height: calc(100vh - 230px); min-height: 480px; display: flex; align-items: center; justify-content: center; background: #f3f4f6; border: 1px solid var(--line); border-radius: 4px; overflow: auto; }
.doc-preview-view iframe { width: 100%; height: 100%; border: 0; }
.doc-preview-view img { max-width: 100%; max-height: 100%; object-fit: contain; }
.doc-preview-none { padding: 36px 16px; text-align: center; color: var(--muted); }
.doc-details .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.record-layout.has-rail { grid-template-columns: 340px minmax(0, 1fr) 380px; }
.doc-revisions { padding: 12px; }
.doc-revisions .card-head { gap: 6px; align-items: center; }
.doc-revisions h2 { font-size: 14px; flex-wrap: nowrap; gap: 5px; }
.doc-revisions ol { list-style: none; margin: 0 -4px; padding: 0; max-height: calc(100vh - 230px); overflow-y: auto; }
.doc-revisions li + li { border-top: 1px solid var(--line); }
.doc-revisions li a { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 7px 6px; color: inherit; text-decoration: none; }
.doc-revisions li a:hover { background: var(--cream); }
.doc-revisions li.selected a { background: var(--tab-on); box-shadow: inset 3px 0 0 var(--orange); }
.doc-rev-note { margin: 0 0 12px; padding: 8px 12px; background: var(--tab-on); border-left: 3px solid var(--orange); border-radius: 4px; }
.doc-preview-view .doc-rev-note { position: absolute; top: 12px; left: 12px; z-index: 1; margin: 0; max-width: calc(100% - 24px); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.doc-preview-view:has(iframe) .doc-rev-note { top: 68px; } /* below the browser's PDF toolbar, so its buttons stay usable */
.doc-revisions .rev-top, .doc-revisions .rev-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; width: 100%; }
.doc-revisions .rev-status, .doc-revisions .rev-ref { min-width: 0; overflow-wrap: anywhere; }
.doc-revisions .rev-status { font-weight: 600; }
.doc-revisions .rev-top strong, .doc-revisions .rev-date { flex: none; white-space: nowrap; }
.doc-revisions .rev-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.long-field { margin-top: 16px; padding-top: 12px; border-top: 1px solid #f0e9e1; }
.long-field h3 { font-size: 12px; color: var(--muted); font-weight: 600; }
.long-field p { margin: 4px 0 8px; overflow-wrap: anywhere; }
.calc .fd dd { font-size: 15px; font-weight: 700; }
details.notes { margin-top: 14px; font-size: 13px; }
details.notes summary { cursor: pointer; color: var(--navy-2); }
details.notes li { margin: 4px 0; }
.child.collapsed { padding-top: 12px; padding-bottom: 12px; }
.child.collapsed .card-head { margin: 0; }
.child.collapsed h2 { font-size: 14px; color: #374151; font-weight: 600; }
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; margin: 0 0 18px; }
.child-grid > .card { margin: 0; min-width: 0; }
.child-grid > .card:not(.collapsed) { grid-column: 1 / -1; }

.timeline, .history, .files { list-style: none; margin: 0 0 12px; padding: 0; }
.timeline li { border-left: 2px solid var(--orange-soft); padding: 0 0 14px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.timeline .who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.timeline time, .history time { color: var(--muted); font-size: 12px; }
.timeline .body p { margin: 4px 0; }
.timeline .file { display: block; font-size: 12.5px; }
.history li { padding: 6px 0; border-bottom: 1px solid #f3ede6; font-size: 13px; }
.files li { padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.files li > a { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.files li > .muted { white-space: nowrap; }
.timeline .file-row { display: flex; align-items: center; gap: 6px; }
.file-del { margin: 0; flex: none; }
.bin { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.bin:hover, .bin:focus-visible { background: var(--bad-bg); border-color: #f5b8b1; color: var(--bad); }
.comment-form .row, form.row, .inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.comment-form input[type=file], form.row input[type=file] { flex: 1 1 160px; font-size: 12px; }
.comment-form input[type=text] { flex: 1 1 140px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 22px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-weight: 600; font-size: 13px; }
.field input, .field select { width: 100%; }
.field .help { font-size: 12px; color: var(--muted); }
.field .static-value { padding: 6px 0; }
.field [data-min-cover] .help { margin-top: 12px; } /* new insurance: line up with the help under the neighbouring inputs */
.field input::placeholder { color: var(--muted); opacity: .7; }
.field select.is-empty { color: var(--muted); }
.field select.is-empty option { color: var(--ink); }
/* type-or-pick drop-down (macros Input kind "combo"): looks like the select boxes, the arrow opens the list */
.field input.combo { padding-right: 28px; background: #fff no-repeat right 9px center / 10px 6px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23374151' stroke-width='1.5'/%3E%3C/svg%3E"); }
.field input.combo::placeholder { color: var(--muted); opacity: 1; }
.field input.combo::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
.combo-wrap { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; margin: 0; padding: 4px 0; list-style: none;
  max-height: 240px; overflow-y: auto; background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.combo-list li { padding: 6px 9px; cursor: pointer; }
.combo-list li.on { font-weight: 600; }
.combo-list li:hover, .combo-list li.hl { background: var(--tab-on); }
.rev-step { position: relative; }
.field .rev-step input { padding-right: 30px; }
.rev-arrows { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 22px; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.rev-arrows button { flex: 1 1 0; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 8px; line-height: 1; cursor: pointer; }
.rev-arrows button + button { border-top: 1px solid var(--line); }
.rev-arrows button:hover { color: var(--ink); background: var(--paper); }
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--paper); padding: 14px; display: grid; gap: 8px; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--orange); background: var(--orange-soft); }
.dropzone-hint { font-size: 13px; color: var(--muted); }
.dropzone-list { margin: 0; padding: 0; list-style: none; font-size: 13px; display: grid; gap: 4px; }
.dropzone-list:empty { display: none; }
.dropzone-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dropzone-list li span { min-width: 0; overflow-wrap: anywhere; }
.dropzone-remove { flex: none; border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.dropzone-remove:hover { color: var(--bad); text-decoration: underline; }
.dropzone-title { display: block; width: 100%; margin-top: 8px; }
/* new insurance: the certificate's proposed name - the fixed part (not editable) then the title box */
.cert-name { display: flex; align-items: stretch; margin-top: 8px; }
.cert-name-fixed { flex: none; max-width: 60%; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--neutral-bg); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; user-select: none; }
.cert-name .dropzone-title { flex: 1; min-width: 0; margin-top: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
@media (max-width: 640px) {
  .cert-name { flex-direction: column; }
  .cert-name-fixed { max-width: none; white-space: normal; padding: 6px 10px; border-right: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .cert-name .dropzone-title { border-radius: 0 0 var(--radius) var(--radius); }
}
.field .error { font-size: 12px; color: var(--bad); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.req { color: var(--orange); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.form.narrow { max-width: 460px; }
.form.narrow .field { margin-bottom: 12px; }
[data-du] [hidden] { display: none; }
.du-summary { margin: 14px 0 0; font-size: 13.5px; }
.du-summary:empty { display: none; }
.du-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.du-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.du-table th, .du-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.du-table.du-update td { text-align: left; vertical-align: middle; }
.du-table td.du-file { overflow-wrap: anywhere; min-width: 180px; }
.du-table td.du-doc { overflow-wrap: anywhere; min-width: 180px; }
.du-table td.du-drop { border: 2px dashed var(--line-2); background: var(--paper); transition: border-color .15s, background .15s; }
.du-table td.du-drop.over { border-color: var(--orange); background: var(--orange-soft); }
.du-drop label { display: grid; gap: 4px; cursor: pointer; }
.du-drop input[type=file] { width: 100%; min-width: 0; font-size: 12px; }
.du-table td.du-title { min-width: 432px; }
.du-table th.du-remove-cell, .du-table td.du-remove-cell { width: 1%; padding-right: 0; }
.du-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: var(--bad); color: #fff; cursor: pointer; }
.du-remove:hover { filter: brightness(.88); }
.du-remove:disabled { opacity: .4; cursor: default; filter: none; }
.du-table td.du-part { white-space: nowrap; }
.du-table th.du-project, .du-table td.du-project { width: 1%; white-space: nowrap; }
.du-table input[readonly] { background: transparent; border-color: transparent; }
.du-table tr.du-flag td { background: var(--warn-bg); }
.du-table tr.du-flag .du-check { color: var(--warn); font-weight: 600; }
.du-table tr.du-problem td { color: var(--muted); }
.du-table tr.du-problem .du-check { color: var(--bad); font-weight: 600; }
.du-table .du-done { color: var(--good); font-weight: 600; }
.du-table .du-fail { color: var(--bad); font-weight: 600; }
.du-check div + div { margin-top: 3px; }
.du-check input[type=checkbox] { width: auto; margin-right: 6px; vertical-align: middle; }
.du-table input[type=text], .du-table input[type=date], .du-table select { width: 100%; min-width: 72px; padding: 4px 6px; color: var(--ink); }
.du-table select, .du-table input[type=date] { min-width: 130px; }
.du-table td.du-part select { width: auto; min-width: 110px; max-width: 170px; }
.du-table td.du-part:has(> select) { width: 1%; padding-right: 4px; }
.du-table th.du-narrow, .du-table td.du-narrow { width: 1%; }
.du-table td.du-narrow input[type=text] { min-width: 56px; }
.du-table th.du-status, .du-table td.du-status, .du-table th.du-date, .du-table td.du-date { width: 1%; }
.du-table td.du-status select { width: 110px; min-width: 0; }
.du-table td.du-date input[type=date] { width: 116px; min-width: 0; }
.du-table th.du-fill { width: 100%; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-top: 3px solid var(--navy); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font: 800 26px/1.25 var(--font); font-variant-numeric: tabular-nums; margin: 4px 0; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.kpi-good { border-top-color: var(--good); }
.kpi.kpi-warn { border-top-color: var(--orange); }
.kpi.kpi-bad { border-top-color: var(--bad); }
.kpis.ins-summary { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.meter { height: 8px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--orange); }
.meter.small { display: inline-block; width: 80px; height: 6px; vertical-align: middle; margin: 0 6px 0 0; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.counter { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid;
  grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; color: var(--ink); }
.counter:hover { border-color: var(--orange); text-decoration: none; }
.counter .n { font: 800 30px/1 var(--font); grid-row: span 2; color: var(--navy); }
.counter .l { font-weight: 600; }
.counter .pill { justify-self: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.heat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; }
.heat-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color: var(--muted); }
.heat-x { grid-column: 2; text-align: center; font-size: 12px; color: var(--muted); }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; max-width: 420px; }
.heatmap th { font-size: 12px; color: var(--muted); font-weight: 600; width: 20px; }
.heatmap td { height: 40px; text-align: center; font-weight: 800; font-size: 15px; border-radius: 4px; color: #1a1a1a; }
.r-low { background: #cfe9d6; } .r-medium { background: #fbe7a1; } .r-high { background: #f8c08f; } .r-extreme { background: #f19a91; }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: 160px 1fr 110px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.bar { height: 12px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--navy); }
.bar span.neg { background: var(--orange); }
.bv { text-align: right; font-variant-numeric: tabular-nums; }
.columns { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 8px; border-bottom: 1px solid var(--line-2); }
.columns .col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.columns .stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.columns .stack span { width: 40%; max-width: 22px; border-radius: 3px 3px 0 0; }
.c1 { background: var(--navy); } .c2 { background: var(--orange); }
.columns .cl { font-size: 11.5px; color: var(--muted); padding: 4px 0 2px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }

/* ---------- portfolio ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius);
  padding: 18px 20px; color: var(--ink); display: block; }
.project-card:hover { border-left-color: var(--orange); text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.project-card h2 { font: 800 19px/1.25 var(--font); margin: 6px 0 4px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; }
.pc-top .code { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 0; }
.pc-stats dt { font-size: 11.5px; color: var(--muted); }
.pc-stats dd { margin: 0; font-weight: 700; }

/* ---------- plans ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; font-size: 13px; }
.plan-section { padding: 14px 0; border-bottom: 1px solid #f3ede6; }
.plan-section h3 { font-size: 16px; margin-bottom: 6px; }
.plan-section p { margin: 6px 0; }
.plan-section-edit { margin: 18px 0; }
.plan-section-edit .row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.heading-input { flex: 1; font-weight: 700; }
.num-badge { background: var(--navy); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }

/* ---------- admin / model ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.admin-grid h3.admin-sub { margin: 12px 0 4px; font-size: 14px; }
.admin-grid h3.admin-sub:first-of-type { margin-top: 4px; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #f3ede6; }
.model-table { border-bottom: 1px solid #f3ede6; padding: 6px 0; }
.model-table summary { cursor: pointer; }
.model-table table { margin: 8px 0 12px; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--navy); padding: 16px; }
.login-card { width: min(400px, 100%); border-top: 5px solid var(--orange); padding: 28px; }
.login-card h1 { font: 900 28px var(--font-head); }
.login-card .field { margin: 14px 0; }

@media (max-width: 1100px) {
  .record-layout, .record-layout.has-rail, .grid-2 { grid-template-columns: 1fr; }
  .doc-revisions ol { max-height: 220px; }
}
/* Edit Naming Convention page */
.dn-banner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; }
.dn-number { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; min-width: 0; }
.dn-token { display: inline-flex; flex-direction: column; align-items: center; }
.dn-token b { font: 900 34px/1.15 var(--font-head); color: var(--navy); overflow-wrap: anywhere; }
.dn-token small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dn-mark { font: 900 34px/1.15 var(--font-head); color: var(--orange); }
.dn-sep { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dn-cols { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; }
.dn-col { flex: 1 0 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.dn-col.is-off .dn-body { opacity: .5; }
.dn-col-head { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--cream); }
.dn-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.dn-move { display: inline-flex; gap: 2px; }
.dn-move .btn { padding: 2px 6px; font-size: 11px; }
.dn-on { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; }
.dn-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.dn-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.dn-sub-row { display: flex; justify-content: space-between; padding: 0 44px 0 26px; }
.dn-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dn-opts li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dn-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.dn-code { width: 72px; flex: none; }
.dn-code.wide { width: 100%; }
.dn-help { margin: 0; font-size: 12px; color: var(--muted); }
.dn-none { margin: 0; font-size: 12px; }
.dn-opts:empty { display: none; }
.dn-opts li.dn-new { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.dn-new-label { flex: 1 1 0; min-width: 0; width: 0; }
.dn-new .dn-code { width: 56px; }
.dn-opts li > .dn-opt { flex: 1; }
.btn.small.dn-del { flex: none; display: inline-flex; align-items: center; padding: 2px; font-size: 11px; line-height: 1; color: var(--bad); }
.btn.small.dn-del:hover { background: var(--bad-bg); border-color: #f5b8b1; }
.dn-removed .btn.small.dn-del { color: var(--ink); }
.dn-removed .btn.small.dn-del:hover { background: #f7f0e8; border-color: var(--line-2); }
.dn-del .dn-restore,.dn-removed .dn-del .dn-bin { display: none; }
.dn-removed .dn-del .dn-restore { display: inline; }
.dn-removed .dn-opt { color: var(--muted); text-decoration: line-through; }
.dn-removed .dn-code { opacity: .5; }
.dn-new-role { flex: 0 0 100%; min-width: 0; }
.dn-add { align-self: flex-start; }
.dn-sub-row.dn-view-sub { padding: 0; }
.dn-view-code { flex: none; font-size: 13px; font-weight: 600; }

@media (max-width: 640px) {
  .dn-token b, .dn-mark { font-size: 24px; }
  .topbar-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .project-name { font-size: 20px; }
  .search { width: auto; flex: 1; }
  .topbar-right { width: 100%; }
  .page-head h1 { font-size: 24px; }
  .bars li { grid-template-columns: 110px 1fr 90px; }
  .pc-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-search { flex: 1 1 100%; }
  .sel-info { margin-left: 0; width: 100%; }
}

/* end / expiry dates: our own picker with "1 year" above the calendar (app.ts, input[data-quick-year]) */
input[data-quick-year] { cursor: pointer; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 6.5h12M5 1.5v3M11 1.5v3'/%3E%3C/svg%3E") no-repeat right 8px center; }
input[data-quick-year]::-webkit-calendar-picker-indicator { display: none; }
.qy-pop { position: fixed; z-index: 1000; width: 260px; max-width: calc(100vw - 8px); box-sizing: border-box; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(17, 24, 39, .16); padding: 8px; font: 13px var(--font); color: var(--ink); }
.qy-pop[hidden] { display: none; }
.qy-pop button { font: inherit; color: inherit; background: none; border: 0; border-radius: 4px; padding: 0; min-height: 0; cursor: pointer; }
.qy-pop .qy-quick { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; margin-bottom: 8px; background: var(--cream); border: 1px solid var(--line); }
.qy-pop .qy-quick:hover { border-color: var(--orange); }
.qy-quick span { color: var(--muted); }
.qy-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 4px; }
.qy-pop .qy-head button { width: 28px; height: 28px; font-size: 18px; }
.qy-pop .qy-head button:hover, .qy-pop .qy-grid button:hover, .qy-pop .qy-foot button:hover { background: var(--tab-on); }
.qy-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.qy-wd { color: var(--muted); font-size: 11px; padding: 4px 0; }
.qy-pop .qy-grid button { height: 30px; }
.qy-pop .qy-grid button.today { font-weight: 700; color: var(--orange); }
.qy-pop .qy-grid button.on, .qy-pop .qy-grid button.on:hover { background: var(--navy); color: #fff; }
.qy-foot { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.qy-pop .qy-foot button { padding: 4px 8px; color: var(--navy); font-weight: 600; }
/* Administrator groups with grouped tabs: the tab's pages, then its records */
.admin-pills .pill-sep { align-self: center; margin: 0 2px 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Administrator › Platform › Storage (modules/platform/storage.tsx) */
.st .st-checks { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.st .st-choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.st .st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 12px; margin-bottom: 12px; }
.st .st-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.st .kpi-sub { margin-top: 4px; }
.st td.num, .st th.num { text-align: right; white-space: nowrap; }
.st .card-head form { margin: 0; }

/* a hub's second row: the gathered page's own sub-tabs (My Workplace › Resourcing › Timesheets) */
.subnav-2 .subnav { background: #faf6f1; border-top: 1px solid var(--line); }
.subnav-2 .subnav a { padding: 8px 14px; font-size: 13px; }

/* View as (the platform owner only - modules/view-as): the switch in the middle of the title bar, the preview strip */
.topbar-center { flex: 0 0 auto; display: flex; justify-content: center; }
.viewas { position: relative; }
.viewas-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px dashed var(--line-2); border-radius: 18px; background: #fff;
  color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.viewas-btn:hover { border-color: var(--orange); }
.viewas-btn strong { font-weight: 700; color: var(--navy); }
.viewas-btn.on { border-style: solid; border-color: var(--orange); background: #fff4ea; }
.viewas-btn.on strong { color: #b04b00; }
.viewas-label { color: var(--muted); }
.viewas-ico { display: inline-flex; line-height: 0; }
.viewas-menu { left: 50%; transform: translateX(-50%); min-width: 290px; }
.viewas-menu .menu-label small { color: var(--muted); font-weight: 400; }
.viewas-form { margin: 0; }
.viewas-form .menu-link { display: flex; align-items: center; gap: 4px; }
.viewas-form .menu-link.on { background: var(--tab-on); font-weight: 700; }
.viewas-form .menu-link small { color: var(--muted); font-weight: 400; }
.viewas-tick { display: inline-block; width: 18px; color: var(--orange); font-weight: 800; }
.viewas-banner { background: #fff4ea; border-bottom: 2px solid var(--orange); color: #5a2a00; font-size: 13.5px; }
.viewas-banner-inner { padding: 7px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.viewas-banner a { color: #8a3a00; font-weight: 600; }
.viewas-banner .viewas-live { font-weight: 600; }
.viewas-banner .viewas-back { margin: 0 0 0 auto; }
@media (max-width: 900px) { .viewas-label { display: none; } .topbar-center { order: 3; flex-basis: 100%; } }
@media print { .topbar-center, .viewas-banner { display: none; } }
/* room for the View-as switch beside a long project name: the title scales down a little */
.topbar-inner:has(.topbar-center) .project-name { font-size: clamp(18px, 1.5vw, 26px); }
.seal-changes { margin: 6px 0 0 18px; color: var(--bad); font-size: 13px; }
/* Formal approvals (module formal-approvals) */
.fa-form label { display: block; margin: 6px 0; }
.fa-form .fa-approvers { border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 10px; margin: 8px 0; }
.fa-form .fa-approvers .row { display: flex; gap: 6px; margin: 4px 0; }
.fa-consent { background: var(--neutral-bg); border-left: 3px solid var(--navy); padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.fa-files { margin: 0; padding-left: 18px; }
@media print { .fa-cert .btn, .topbar, .mainnav, nav, header.site { display: none !important; } }
.btn.dash-danger, .dash-danger { color: var(--bad); }

/* Two-factor set-up: the authenticator app's QR code (28 Nov 2026) - white around it so phone cameras read it in dark mode too */
.tf-qr { margin: 8px 0; }
.tf-qr img { display: block; width: 200px; height: 200px; padding: 8px; background: #fff; border: 1px solid #d0d5dd; border-radius: 6px; image-rendering: pixelated; }
