/*
  Tenant Management. The approved mock-up's look: a dark navy sidebar, a white top bar and
  one card per job on a cool grey ground; review work opens in a right-hand panel.
  Plus Jakarta Sans throughout with tabular numbers. Light only.
*/
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #16213a;
  --ink-2: #3d485f;
  --muted: #6b7690;
  --line: #e4e9f2;
  --line-2: #eef1f7;
  --primary: #2457e6;
  --primary-hover: #1c48c4;
  --primary-soft: #e9efff;
  --navy: #0f1c3a;
  --navy-2: #172a54;
  --ok: #157f5a; --ok-soft: #e1f5ec;
  --warn: #9a5b00; --warn-soft: #fff0d3;
  --bad: #c2352c; --bad-soft: #fdeae8;
  --info: #0b6e8a; --info-soft: #e0f3f8;
  --violet: #5b3fd6; --violet-soft: #ece8fb;
  --shadow-1: 0 1px 2px rgba(22,33,58,.05), 0 1px 1px rgba(22,33,58,.03);
  --shadow-2: 0 8px 24px rgba(22,33,58,.08), 0 1px 2px rgba(22,33,58,.06);
  --shadow-3: 0 24px 64px rgba(22,33,58,.22);
  --r: 12px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(36,87,230,.45); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
svg { flex: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- Shell ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; height: 60px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 240px; padding-inline: 20px; font-weight: 800; font-size: 1rem; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); text-decoration: none; }
/* The Build Sync logo (skyline mark and wordmark, _BuildSyncLogo): the mark in the brand blue, the name in ink. */
.brand .bsl { gap: 8px; color: var(--ink); font-size: 1rem; }
.brand .bsl .bsl-mark { height: 1.55em; color: var(--primary); }
.brand .staff { margin-left: 4px; padding: 3px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.search-slot { min-width: 0; }
.search { position: relative; max-width: 520px; margin-left: 20px; }
.search input { width: 100%; min-width: 0; height: 38px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s; }
.search input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,230,.12); outline: none; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search > svg { position: absolute; left: 13px; top: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.results { position: absolute; top: 46px; left: 0; right: 0; z-index: 30; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.results .option { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.results .option:hover, .results .option[aria-selected="true"] { background: var(--primary-soft); }
.results .option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results small { flex: none; color: var(--muted); }
.results .status { padding: 12px; color: var(--muted); text-align: center; }
.account { position: relative; }
.avatar { margin-right: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: .78rem; border: 0; letter-spacing: .02em; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100% - 60px); }
.side { background: var(--navy); padding-block: 14px 24px; }
.side a { display: flex; align-items: center; gap: 12px; margin: 2px 12px; padding: 10px 12px; border-radius: 9px; color: #b7c3dd; text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .12s, color .12s; }
.side a svg { width: 18px; height: 18px; color: #7f8fb3; }
.side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.side a[aria-current="page"] svg { color: #8fb0ff; }
.side .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #ffc531; color: #3b2a00; font-size: .72rem; font-weight: 800; text-align: center; }
.side a:focus-visible { outline-color: rgba(143,176,255,.8); }
main { padding-block: 26px 56px; padding-inline: 32px; min-width: 0; }
main:focus { outline: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.page-head h1 { font-size: 1.55rem; }
.page-head h2 { font-size: 1.2rem; }
.page-head p { margin: 5px 0 0; color: var(--muted); max-width: 72ch; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; border: 0; background: none; padding: 0; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none; }
.back:hover { color: var(--primary); }
.back svg { width: 16px; height: 16px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-1); transition: background .12s, border-color .12s, transform .12s, box-shadow .12s; }
.btn:hover { border-color: #cbd4e4; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(36,87,230,.28); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #f3c3be; }
.btn.link { border-color: transparent; background: none; box-shadow: none; color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Filter chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .86rem; color: var(--ink-2); transition: background .12s, border-color .12s; }
button.chip:hover { border-color: #cbd4e4; }
.chip b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: .74rem; font-weight: 700; text-align: center; }
.chip[aria-pressed="true"], .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] b, .chip.on b { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Card + grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.toolbar .grow { flex: 1; color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; text-align: left; padding: 10px 16px; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; }
td strong { font-weight: 600; }
tbody tr[data-panel], tbody tr[data-href] { cursor: pointer; transition: background .1s; }
tbody tr[data-panel]:hover, tbody tr[data-href]:hover, tbody tr[data-panel]:focus-visible, tbody tr[data-href]:focus-visible { background: #f5f8ff; }
tbody tr:focus-visible { outline-offset: -3px; }
td.go { width: 40px; color: #b3bccd; }
tbody tr:hover td.go { color: var(--primary); }
td.go svg { width: 16px; height: 16px; display: block; }
td.num, th.num { text-align: right; }
.who > div { min-width: 0; }
.toolbar input[type="search"] { height: 36px; width: min(300px, 100%); padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.toolbar input[type="search"]:focus { background: var(--surface); border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.toolbar form { display: contents; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pager { display: flex; align-items: center; gap: 6px; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-weight: 600; text-decoration: none; }
.pager a:hover { border-color: #cbd4e4; color: var(--primary); }
.pager [aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager .gap { border: 0; background: none; min-width: 0; padding: 0 2px; }
a.chip { text-decoration: none; }
a.chip:hover { border-color: #cbd4e4; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ini { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: .74rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--primary); }
.ini.round { border-radius: 50%; }
.title-row .ini { width: 40px; height: 40px; border-radius: 11px; font-size: .82rem; }
.hue-0 { background: #2457e6; } .hue-1 { background: #0b6e8a; } .hue-2 { background: #5b3fd6; } .hue-3 { background: #157f5a; }
.hue-4 { background: #b3541e; } .hue-5 { background: #8a2b6b; } .hue-6 { background: #1f6f8b; } .hue-7 { background: #6b4e16; }
.foot { padding: 10px 16px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ---------- Empty state ---------- */
.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 56px 24px 60px; text-align: center; }
.empty-state .mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty-state .mark svg { width: 26px; height: 26px; }
.empty-state h2 { font-size: 1.05rem; }
.empty-state p { margin: 0; max-width: 60ch; color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.pill.plain::before { display: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 20px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; text-decoration: none; transition: color .12s; }
.tab:hover { color: var(--ink); }
.tab b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: .72rem; text-align: center; }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab[aria-selected="true"] b, .tab[aria-current="page"] b { background: var(--primary-soft); color: var(--primary); }

/* ---------- Facts ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.fact { padding: 16px 18px; }
.fact > span { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.fact > strong { display: block; margin-top: 6px; font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.fact small { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; }

/* ---------- Overview ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.card h2 { font-size: .95rem; padding: 13px 16px; border-bottom: 1px solid var(--line); }
#main > .card + .card, #main > .facts + .card { margin-top: 14px; }
a.pill { text-decoration: none; }
a.pill:hover { filter: brightness(.96); }
.block h3 label { display: inline; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; }
.list { margin: 0; padding: 0; list-style: none; }
.list > li { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; transition: background .1s; }
.list > li:last-child { border-bottom: 0; }
.list > li:hover, .list > li:focus-visible { background: #f5f8ff; }
.list .grow { flex: 1; min-width: 0; }
.list small { display: block; color: var(--muted); }
.list svg { width: 16px; height: 16px; color: #b3bccd; }
.actions { display: grid; gap: 8px; padding: 14px 16px; }
.actions .btn { justify-content: flex-start; }
.card-body { padding: 16px 20px; }
.setting-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .grow { flex: 1; min-width: 220px; }
.setting-row strong { display: block; }
.setting-row small { display: block; color: var(--muted); }
.section-title { margin: 22px 0 10px; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 20px; }
.form .wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .84rem; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid #d4dbe7; border-radius: 9px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field .hint { margin-top: 5px; color: var(--muted); font-size: .8rem; }
.field .label { display: block; margin-bottom: 6px; padding: 0; font-weight: 600; font-size: .84rem; color: var(--ink-2); }
fieldset.field, fieldset.block { margin: 0; padding: 0; border: 0; min-width: 0; }
.field .check, .field label.check { display: flex; margin-bottom: 0; font-weight: 400; font-size: inherit; color: inherit; }
.field input[type="checkbox"], .field input[type="radio"] { flex: none; width: 17px; height: 17px; min-height: 0; padding: 0; margin: 2px 0 0; border: 0; box-shadow: none; }
.field .check span { font-weight: 600; }
.section-notice { margin: 0 0 14px; }
.card > h2 + .form { padding-top: 16px; }
.field .field-error { display: block; margin-top: 5px; color: var(--bad); font-size: .8rem; font-weight: 600; }
.field .field-error:empty { display: none; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--primary); }
.check small { display: block; color: var(--muted); font-weight: 400; }
.notice { padding: 11px 13px; border-radius: 9px; background: var(--warn-soft); color: #6b4300; font-size: .88rem; border: 1px solid #f4dfae; }
.notice.info { background: var(--primary-soft); color: #173a99; border-color: #cddaff; }
.notice.error { background: var(--bad-soft); color: #8a1c12; border-color: #f3c3be; }
.notice.ok { background: var(--ok-soft); color: #0f5c41; border-color: #b9e6d2; }

/* ---------- Panel ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15,28,58,.45); backdrop-filter: blur(2px); }
.panel { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-3); animation: slide .2s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel header .grow { flex: 1; min-width: 0; }
.panel header h2 { font-size: 1.15rem; }
.panel header p { margin: 4px 0 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel .x { border: 0; background: var(--surface-2); border-radius: 8px; padding: 6px; color: var(--muted); }
.panel .x:hover { background: var(--line-2); color: var(--ink); }
.panel .x svg { width: 18px; height: 18px; }
.panel .body { flex: 1; overflow-y: auto; padding: 20px 22px; display: grid; grid-auto-rows: max-content; gap: 20px; align-content: start; }
.panel footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.panel footer .grow { flex: 1; }
.block h3 { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
dl.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 9px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.panel > form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.panel .body > .notice, .panel .body > p { margin: 0; }
.panel .body .field + .field { margin-top: 12px; }
.panel footer .btn.link { height: 38px; }
.diff { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; font-size: .9rem; }
.diff .h { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.diff .old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.diff .new { color: var(--ok); font-weight: 600; overflow-wrap: anywhere; }
.rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rows > div, .rows > label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.rows > div:last-child, .rows > label:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows small { display: block; color: var(--muted); }
.rows select { height: 34px; border: 1px solid #d4dbe7; border-radius: 8px; padding: 0 8px; background: var(--surface); }
.reason { width: 100%; min-height: 72px; padding: 9px 11px; border: 1px solid #d4dbe7; border-radius: 9px; background: var(--surface); resize: vertical; }
.reason:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.reason[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--bad); }
.field-error { margin-top: 6px; color: var(--bad); font-size: .84rem; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--line-2); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.check > span { font-weight: 600; }
.check input[type="radio"] { border-radius: 50%; }
.check select { margin-top: 6px; width: 100%; min-height: 34px; border: 1px solid #d4dbe7; border-radius: 8px; padding: 0 8px; background: var(--surface); font-weight: 400; }
.confirm-bar { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 10px; }
.confirm-bar .grow { flex: 1; min-width: 180px; font-weight: 600; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: #a82b23; border-color: #a82b23; }
.stack { display: grid; gap: 12px; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-list { display: grid; gap: 2px; }
.choice-list .check { padding: 6px 0; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.two-col .wide { grid-column: 1 / -1; }
body.panel-open { overflow: hidden; }

/* ---------- Avatar menu ---------- */
.menu { position: absolute; right: 20px; top: 44px; z-index: 30; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.menu .who-am-i { padding: 8px 10px; color: var(--muted); font-size: .84rem; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who-am-i strong { display: block; color: var(--ink); }
.menu form { margin: 0; }
.menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 60; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: var(--shadow-2); font-weight: 500; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; }

/* ---------- Sign-in: brand panel + form, like the company sign-in ---------- */
.signin { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.signin-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 44px 56px; color: #dfe6f6; background: var(--navy); }
.signin-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(55% 45% at 12% 100%, rgba(36,87,230,.6), transparent 70%),
  radial-gradient(45% 40% at 96% 88%, rgba(11,127,138,.4), transparent 70%); }
.signin-brand::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent); }
.bsl { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 1.55rem; letter-spacing: -.02em; line-height: 1; }
.bsl .bsl-mark { height: 1.5em; width: auto; }
.bsl .bsl-word { font-weight: 800; }
.signin-brand h1 { margin: auto 0 16px; max-width: 12ch; font-size: clamp(2.2rem, 3.6vw, 3.3rem); line-height: 1.04; letter-spacing: -.025em; color: #fff; }
.signin-brand h1 span { background: linear-gradient(transparent 60%, rgba(255,197,49,.85) 60% 92%, transparent 92%); }
.signin-brand .lead { max-width: 46ch; margin: 0 0 30px; font-size: 1.05rem; color: #c3cee6; }
.signin-points { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 12px; }
.signin-points li { position: relative; padding-left: 32px; color: #dfe6f6; }
.signin-points li::before { content: "\2713"; position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 6px; background: #ffc531; color: #16213a; font-size: .8rem; font-weight: 800; display: grid; place-items: center; }
.signin-brand small { margin-top: 36px; color: #8b99bd; }
.signin-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.signin form, .signin .signin-form { width: min(400px, 100%); display: grid; gap: 14px; }
.signin .signin-form form { width: 100%; }
.signin .eyebrow { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.signin h2 { font-size: 1.9rem; letter-spacing: -.025em; }
.signin p { margin: 0; color: var(--muted); }
.signin .field input { height: 44px; border-radius: 10px; }
.signin .field input.pin { letter-spacing: .5em; font-size: 1.2rem; font-weight: 700; text-align: center; }
.signin .row { display: flex; justify-content: space-between; align-items: baseline; }
.signin .row a, .signin .links a { font-size: .86rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.signin .row a:hover, .signin .links a:hover { text-decoration: underline; }
.signin .btn { justify-content: center; height: 46px; margin-top: 6px; border-radius: 999px; font-size: .98rem; }
.signin .btn.link { height: auto; margin: 0; padding: 0; border: 0; font-size: .86rem; font-weight: 600; }
.signin .note { font-size: .82rem; color: var(--muted); }
.signin .links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; }
.signin .bsl-small { display: none; margin-bottom: 8px; }
.signin .bsl-small .bsl { color: var(--ink); font-size: 1.3rem; }

.error-page { display: grid; gap: 12px; justify-items: start; max-width: 560px; margin: 80px auto; padding: 0 24px; }
.error-page p { margin: 0; color: var(--muted); }

/* ---------- Page header actions, compact facts ---------- */
.readiness { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 12px 18px; margin-bottom: 14px; }
.readiness > div { display: inline-flex; align-items: center; gap: 10px; }
.readiness > div > span:first-child { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.facts-compact .fact > strong { font-size: 1.1rem; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fact .fact-text { font-size: 1rem; line-height: 1.35; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#main .split + .card, #main .facts + .split, #main .split + .muted, .settings-content > .card + .split, .settings-content > .split + .card { margin-top: 14px; }
.settings-content > .facts + .card { margin-top: 0; }

/* ---------- Settings sub-navigation ---------- */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-content { min-width: 0; }
.subnav { display: grid; gap: 2px; padding: 8px; position: sticky; top: 76px; }
.subnav a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; transition: background .12s, color .12s; }
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }

/* ---------- Grids: filters in the toolbar, long text ---------- */
.toolbar.filters { gap: 10px 12px; }
.toolbar.filters input[type="search"] { width: min(220px, 100%); }
.toolbar.filters select { max-width: 190px; }
.toolbar select, .inline-form select { height: 36px; max-width: 220px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.inline-form select { max-width: 280px; }
.toolbar select:focus, .inline-form select:focus, .inline-field input:focus { background: var(--surface); border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .84rem; }
.inline-field input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--ink); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.report-controls { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.report-controls .chips { margin-bottom: 0; }
td.wide-cell { min-width: 280px; }
td .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
td.value-cell { max-width: 280px; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .84rem; }
.error-text { color: var(--bad); }
.issue-title { display: block; margin-top: 6px; }
.toolbar .notice { margin: 0; }
.report-note { margin: 10px 2px 0; font-size: .84rem; }

/* ---------- Panels: fieldsets as the body, images, detail links ---------- */
.panel fieldset.body { margin: 0; border: 0; min-width: 0; }
.panel .body > p.muted { font-size: .88rem; }
.card-image img { display: block; max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 6px; object-fit: cover; }
.kv-link { margin-left: 10px; font-size: .84rem; font-weight: 600; text-decoration: none; }
.kv-link:hover { text-decoration: underline; }
pre.changes { margin: 0; padding: 12px; max-height: 260px; overflow: auto; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font: .8rem/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.rows > div > small { margin-left: auto; }

/* ---------- Share bars (part of a whole) ---------- */
.share-list { display: grid; }
.share { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.share:last-child { border-bottom: 0; }
.share .grow { flex: 1; min-width: 0; }
.share small { display: block; color: var(--muted); font-size: .8rem; }
.share .num { min-width: 36px; text-align: right; }
.share-bar { width: 120px; height: 8px; flex: none; }
.share-track { fill: var(--line-2); }
.share-fill { fill: var(--primary); }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); margin: 0; }
.card-foot .grow { flex: 1; min-width: 180px; font-size: .86rem; }
.card-foot .notice { flex: 1 1 100%; }

/* ---------- Column charts (one series, drawn on the server) ---------- */
.chart { margin: 0; }
.chart figcaption { margin-bottom: 8px; font-weight: 700; font-size: .95rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick { fill: var(--muted); font: 600 11px var(--font); font-variant-numeric: tabular-nums; }
.chart-bar path { fill: var(--primary); transition: fill .1s; }
.chart-hit { fill: transparent; }
.chart-bar:hover path { fill: var(--primary-hover); }
.chart-bar:hover .chart-hit { fill: var(--primary-soft); fill-opacity: .6; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .84rem; }
.chart-table table { margin-top: 8px; }
.chart-table td, .chart-table th { padding: 6px 10px; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .brand { min-width: 0; padding-inline: 16px; }
  .brand .staff { display: none; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { display: flex; align-items: center; overflow-x: auto; padding: 8px; }
  .avatar { margin-right: 16px; }
  .menu { right: 16px; }
  .side a { margin: 0 4px; white-space: nowrap; }
  .side .count { margin-left: 6px; }
  main { padding-inline: 16px; }
  .facts, .facts-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form, .split, .split.even, .two-col, .settings { grid-template-columns: 1fr; }
  .subnav { position: static; display: flex; overflow-x: auto; }
  .subnav a { white-space: nowrap; }
  .share-bar { width: 72px; }
  .diff { grid-template-columns: 1fr 1fr; }
  .diff .field-name { grid-column: 1 / -1; }
  dl.kv { grid-template-columns: 1fr; }
  .search { margin-left: 8px; }
  .signin { grid-template-columns: 1fr; }
  .signin-brand { display: none; }
  .signin .bsl-small { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } .btn, .chip, .tab, .side a, tbody tr, .list > li { transition: none; } }

/* ---------- View as company: the support views card and the hand-over page ---------- */
.support-views { margin-top: 14px; }
.support-views .list > li { cursor: default; flex-wrap: wrap; }
.support-views .list > li:hover { background: none; }
.support-views .list form { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.support-views .list small { overflow-wrap: anywhere; }
.handover .btn.primary { margin-top: 4px; }
.handover-note { font-size: .86rem; }
.open-support-views { margin: 0 0 14px; }
.support-views .toolbar > strong.grow { color: var(--ink); font-weight: 700; font-size: .95rem; }

/* =====================================================================================
   Polish (the approved mock-up of 2 Oct 2026), P1 to P20: each block names the audit
   point it answers. P18 drew the company app's sign-in, which keeps its own styles in
   the company app, so it is not repeated here.
   ===================================================================================== */

/* P1. Two-column panel fields line up. Cause today: ".panel .body .field + .field" gives
   every field after the first a 12px top margin, so in a .two-col grid the first row is
   12px out (Legal details, Billing details). Grids space their own rows. */
.panel .body .two-col > .field + .field,
.panel .body .two-col > .field { margin-top: 0; }
.two-col { align-items: start; }

/* P2. Empty lists say what happened and offer the next step. */
.empty .empty-title { display: block; margin-bottom: 4px; color: var(--ink); font-size: .98rem; font-weight: 700; }
.empty .next { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.empty-state .next { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* P3. One validation style: the field turns red and says what to do under it; two or more
   problems also get one line at the top. No browser "Please fill out this field". */
.field textarea[aria-invalid="true"], .field select[aria-invalid="true"],
.datefield.invalid input, .multi.invalid { border-color: var(--bad); }
.field [aria-invalid="true"]:focus, .datefield.invalid input:focus, .multi.invalid:focus-within { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(194,53,44,.12); }
.signin .field input[aria-invalid="true"] { border-color: var(--bad); }
.field-error::before { content: ""; display: inline-block; width: 13px; height: 13px; margin: 0 6px -2px 0; border-radius: 50%; background: var(--bad); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 5h2v7h-2V7Zm0 9h2v2h-2v-2Z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1 5h2v7h-2V7Zm0 9h2v2h-2v-2Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.field .optional { color: var(--muted); font-weight: 500; }

/* P4. Selects look like the inputs next to them (the time zone, plan, status). */
.field select { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; }
.field select:disabled, .field input:disabled, .field textarea:disabled { background-color: var(--surface-2); color: var(--ink-2); }

/* P5. A value that can't be changed reads as text, not as a greyed-out box. */
.field .static { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; font-weight: 600; }

/* P6. Dates: one format, "2 Oct 2026", in the text and in the inputs. The input takes typing
   ("2 Oct 2026", "2/10/2026", "2026-10-02") and has a calendar that shows the same format. */
.datefield { position: relative; }
.datefield input { width: 100%; padding-right: 40px; }
.datefield .cal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.datefield .cal-btn:hover { background: var(--primary-soft); color: var(--primary); }
.datefield .cal-btn svg { width: 17px; height: 17px; }
.inline-field .datefield input { width: 150px; }
.cal-pop { position: fixed; z-index: 80; width: 292px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); color: var(--ink); font-weight: 500; font-size: .9rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-head strong { font-size: .95rem; }
.cal-head button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.cal-head button:hover { background: var(--primary-soft); color: var(--primary); }
.cal-head svg { width: 16px; height: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-grid .dow { padding: 4px 0; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cal-grid button { height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-grid button:hover, .cal-grid button:focus-visible { background: var(--primary-soft); color: var(--primary); }
.cal-grid button.out { color: #aab3c5; }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-grid button[aria-selected="true"] { background: var(--primary); color: #fff; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.cal-foot button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; color: var(--primary); font-weight: 700; font-size: .84rem; }
.cal-foot button:hover { background: var(--primary-soft); }

/* P7. Many choices (19 trades): a searchable multi-select instead of a wall of checkboxes. */
.multi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 5px 6px; border: 1px solid #d4dbe7; border-radius: 9px; background: var(--surface); cursor: text; transition: border-color .12s, box-shadow .12s; }
.multi:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.multi .tag { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; background: var(--primary-soft); color: var(--primary); }
.multi .tag button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; }
.multi .tag button:hover { background: rgba(36,87,230,.14); }
.multi .tag svg { width: 12px; height: 12px; }
.multi input { flex: 1 1 140px; min-width: 120px; height: 30px; padding: 0 6px; border: 0; outline: 0; background: none; box-shadow: none; }
.field .multi input { min-height: 0; border: 0; box-shadow: none; }
.multi-list { margin-top: 6px; max-height: 232px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.multi-list [role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.multi-list [role="option"]:hover, .multi-list [role="option"].active { background: var(--primary-soft); }
.multi-list [role="option"] .box { flex: none; width: 17px; height: 17px; border: 1.5px solid #b9c3d6; border-radius: 5px; display: grid; place-items: center; color: #fff; }
.multi-list [role="option"][aria-selected="true"] .box { background: var(--primary); border-color: var(--primary); }
.multi-list [role="option"] .box svg { width: 12px; height: 12px; }
.multi-list .none { padding: 10px; color: var(--muted); }

/* P8. Panel footers keep to one row: the rarer actions go in a "More" menu. */
.panel footer { flex-wrap: nowrap; align-items: center; }
.panel footer .grow { min-width: 0; }
.more { position: relative; }
.more > .btn svg { width: 15px; height: 15px; }
.more-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; min-width: 270px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.more-menu button, .more-menu a { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-weight: 600; color: var(--ink); text-decoration: none; }
.more-menu button:hover, .more-menu a:hover, .more-menu button:focus-visible { background: var(--surface-2); }
.more-menu small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.more-menu .danger { color: var(--bad); }
.more-menu hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--line-2); }
.panel footer .confirm-bar { flex-wrap: nowrap; }
.panel footer .confirm-bar .grow { min-width: 0; }

/* P9. Read-only panels (a locked role) show values as text and ticks, with Close only. */
.ticks { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ticks > div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.ticks > div:last-child { border-bottom: 0; }
.ticks svg { width: 16px; height: 16px; color: var(--ok); }
.pill .lock { width: 11px; height: 11px; margin-right: -2px; }
.pill.plain .lock { display: inline-block; }

/* P10. Rows that scroll sideways show it: the edge fades while there is more, and the
   current item is scrolled into view (side menu on phones, company tabs, chips, settings). */
[data-cue] { scrollbar-width: none; }
[data-cue]::-webkit-scrollbar { display: none; }
[data-cue].cue-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
[data-cue].cue-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px); mask-image: linear-gradient(90deg, transparent, #000 56px); }
[data-cue].cue-l.cue-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.side-band { min-width: 0; background: var(--navy); }
.chips.one-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.chips.one-row .chip { flex: none; padding: 0 10px 0 12px; gap: 6px; }
.chips.one-row { gap: 6px; }
.subnav-list { display: grid; gap: 2px; }
.subnav .sub { display: grid; gap: 1px; margin: 2px 0 6px 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.subnav .sub a { padding: 6px 10px; font-size: .86rem; font-weight: 500; color: var(--muted); }
.subnav .sub a:hover { color: var(--ink); }
.subnav .sub a[aria-current="true"] { color: var(--primary); background: none; font-weight: 700; }

/* P11. Activity log: runs of page views by one person fold into one row you can open. */
tr.group .count-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
tr.group td.go svg { transition: transform .15s; }
tr.group[aria-expanded="true"] td.go svg { transform: rotate(90deg); }
tr.child td { background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; font-size: .88rem; }
tr.child td:first-child { padding-left: 28px; }
.when-range { display: block; color: var(--muted); font-size: .8rem; }

/* P12. Platform settings: groups you open, a search, On/Off instead of "True". */
.set-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.set-tools .grow { flex: 1; }
.set-tools input[type="search"] { height: 38px; width: min(320px, 100%); padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7690' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px; }
.set-tools input[type="search"]:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(36,87,230,.12); }
.set-group { scroll-margin-top: 76px; }
.set-group + .set-group, .set-group + .card, .set-group + .split { margin-top: 10px; }
.set-group > h3 { margin: 0; font-size: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.set-toggle { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: none; text-align: left; }
.set-toggle:hover { background: var(--surface-2); }
.set-toggle .grow { flex: 1; min-width: 0; }
.set-toggle strong { display: block; font-size: .98rem; }
.set-toggle small { display: block; color: var(--muted); font-weight: 400; }
.set-toggle .n { color: var(--muted); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.set-toggle > svg { width: 18px; height: 18px; color: #9aa5ba; transition: transform .15s; }
.set-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.set-group .set-rows { border-top: 1px solid var(--line); }
.mark-text { background: #fff3c4; border-radius: 3px; }
.value-plain { font-weight: 600; }

/* P13. Compliance documents on the Directory listing tab: the date that matters, big. */
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.doc { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.doc > span:first-child { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.doc .doc-date { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.doc small { color: var(--muted); font-size: .84rem; }
.doc .btn { justify-self: start; margin-top: 10px; }
.doc.attention { border-color: #f4dfae; box-shadow: inset 4px 0 0 #f0b43c, var(--shadow-1); }
.status-strip { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 12px 18px; }
.status-strip > div { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-strip > div > span:first-child { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.form-foot.with-reason { align-items: flex-end; }
.form-foot.with-reason .field { flex: 1; max-width: 560px; margin-right: auto; }
.form-foot.with-reason .field label { margin-bottom: 4px; }

/* P14. Choices with a line about each (a person's role), instead of a bare select. */
.choice-cards { display: grid; gap: 8px; }
.choice-cards .check { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.choice-cards .check:has(input:checked) { border-color: var(--primary); background: #f5f8ff; box-shadow: inset 0 0 0 1px var(--primary); }

/* P15. Card head with an action on the right (Subscription's panels, Feature access). */
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { padding: 0; border: 0; flex: 1; min-width: 160px; }
.card-head small { display: block; color: var(--muted); font-weight: 400; font-size: .84rem; margin-top: 2px; }
#main > .card + .split, #main > .docs + .card, .settings-content > .card + .card, .settings-content > .card + .set-group { margin-top: 14px; }
#main > .notice + .facts { margin-top: 0; }
.kv-card { padding: 16px 20px; }

/* P16. The not-found page sits in the shell, so the menu and search stay. */
.lost { max-width: 640px; }
.lost code { padding: 1px 6px; border-radius: 6px; background: var(--line-2); font-size: .86rem; }

/* P17. Support view ended: Tenant Management's font and tokens, on the company app. */
.support-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.support-card { width: min(560px, 100%); padding: 28px 30px 30px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid #ffc531; border-radius: 14px; box-shadow: var(--shadow-2); display: grid; gap: 14px; }
.support-card .eyebrow { display: inline-flex; width: fit-content; padding: 4px 10px; border-radius: 999px; background: #fff3c4; color: #6b4a00; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.support-card h1 { font-size: 1.5rem; }
.support-card p { margin: 0; color: var(--ink-2); }
.support-card dl.kv { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.support-card .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* P19. Phones: tables become stacked rows (nothing is cut off at the right), the search
   box keeps to its space, panels use the full width. */
@media (max-width: 900px) {
  .side { padding: 8px; }
  .subnav .sub { display: none; }
  .subnav-list { display: flex; overflow-x: auto; gap: 2px; }
  .subnav { display: block; padding: 6px; }
}
@media (max-width: 640px) {
  main { padding-block: 18px 48px; }
  .page-head h1 { font-size: 1.35rem; }
  .brand { gap: 8px; padding-inline: 12px; font-size: .95rem; }
  .search { margin-left: 4px; }
  .search-slot { margin-right: 10px; }
  .avatar { margin-right: 12px; }
  .chips:not(.wrap) { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chips:not(.wrap) .chip { flex: none; }
  table.phone-rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.phone-rows, table.phone-rows tbody { display: block; }
  table.phone-rows tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 13px 44px 13px 16px; border-bottom: 1px solid var(--line-2); }
  table.phone-rows tbody tr:last-child { border-bottom: 0; }
  table.phone-rows td { display: block; padding: 0; border: 0; }
  table.phone-rows td.main { flex: 1 1 100%; order: -1; min-width: 0; }
  table.phone-rows td.wide-cell { min-width: 0; }
  table.phone-rows td.value-cell { max-width: none; }
  table.phone-rows td.go { position: absolute; right: 12px; top: 50%; width: auto; transform: translateY(-50%); }
  table.phone-rows td.num { text-align: left; }
  table.phone-rows td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .82rem; font-weight: 600; }
  table.phone-rows td.blank { display: none; }
  table.phone-rows tr.child td:first-child { padding-left: 0; }
  table.phone-rows tr.child { background: var(--surface-2); padding-left: 28px; }
  table.phone-rows tr.child td { background: none; }
  .docs { grid-template-columns: 1fr; }
  .form-foot.with-reason { flex-wrap: wrap; }
  .form-foot.with-reason .field { flex: 1 1 100%; max-width: none; }
  .form-foot.with-reason .btn { margin-left: auto; }
  .panel header { padding: 16px 16px; }
  .panel .body { padding: 16px; }
  .panel footer { padding: 12px 16px; }
  .more-menu { min-width: 250px; }
  .set-toggle { padding: 12px 14px; }
  .set-toggle small { display: none; }
  .facts { gap: 10px; }
  .fact { padding: 14px 14px; }
  .support-card { padding: 22px 20px 24px; }
  .inline-field .datefield input { width: 132px; }
  .toolbar.filters input[type="search"], .toolbar.filters select { width: 100%; max-width: none; flex: 1 1 100%; }
  .toolbar.filters .inline-field { flex: 1 1 100%; }
  .toolbar.filters .inline-field > :first-child { min-width: 0; }
  .toolbar.filters .inline-field .datefield { flex: 1; }
  .toolbar.filters .inline-field .datefield input { width: 100%; }
}

/* P20. Small joins: page buttons as buttons, a note between cards. */
.pager button { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-weight: 600; }
.pager button:hover { border-color: #cbd4e4; color: var(--primary); }
#main > .report-note + .card, #main > .card + .report-note + .card { margin-top: 14px; }
.foot .sep { color: #b3bccd; margin: 0 4px; }
.static-note { color: var(--muted); font-size: .84rem; }
.panel header h2:focus { outline: none; }
.panel header p a { font-weight: 600; text-decoration: none; }
.panel header p a:hover { text-decoration: underline; }
.preview-line { margin-top: 6px; color: var(--muted); font-size: .84rem; }
.preview-line strong { color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-weight: 600; }

/* ---------- The polish as built: the pieces the server and admin.js draw ---------- */
span.datefield { display: block; }
.inline-field span.datefield { display: inline-block; }
.datefield .cal-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.datefield input[readonly] { background: var(--surface-2); }
.more-menu button:disabled { opacity: .5; cursor: not-allowed; }
.more-menu form { margin: 0; }
.panel header p .head-link { font-weight: 600; text-decoration: none; }
.panel header p .head-link:hover { text-decoration: underline; }
.empty .next .btn { font-size: .9rem; }
tr.child[hidden] { display: none; }
tr.group { cursor: pointer; }
tr.group:hover, tr.group:focus-visible { background: #f5f8ff; }
.set-group .empty { padding: 28px 16px; }
.set-jump { scroll-margin-top: 76px; }
.static-value { margin: 0; font-weight: 600; }
.static-note { margin: 0; }
.ticks > div > span { min-width: 0; }
.signin .field .field-error { margin-top: 6px; }
.signin form[aria-busy="true"] .btn.primary { opacity: .8; }
.lost .empty-state h1 { font-size: 1.2rem; }
.block .static-note, .block .hint + .static-note { margin-top: 10px; }
.block > .two-col + .static-note, .block > .two-col + p.muted { margin: 10px 0 0; font-size: .84rem; }
.choice-cards .check > span .pill { margin-left: 6px; vertical-align: 1px; }
fieldset.block > .hint { margin-top: 8px; }
/* A button that reads as a link in a sentence (a notice pointing to another panel). */
.btn.link.inline { display: inline; height: auto; padding: 0; border: 0; font: inherit; font-weight: 600; vertical-align: baseline; white-space: normal; }
.btn.link.inline:hover { background: none; text-decoration: underline; }

/* ---------- Notifications: the bell beside the avatar, the account menu's link, the
   Notifications page (docs/notifications.md). The popup itself is notifications.css. ---------- */
.account { display: flex; align-items: center; gap: 6px; }
.bell { position: static; }
.bell-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink-2); transition: background .12s, color .12s; }
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.bell-btn svg { width: 20px; height: 20px; }
.bell-count { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; border: 2px solid var(--surface); background: var(--bad); color: #fff; font-size: .66rem; font-weight: 800; line-height: 14px; text-align: center; }
.bell-menu { position: absolute; right: 20px; top: 50px; z-index: 30; width: min(390px, calc(100vw - 32px)); display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 80px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-head strong { font-size: .95rem; }
.bell-read-all { border: 0; background: none; padding: 4px 6px; border-radius: 7px; color: var(--primary); font-weight: 700; font-size: .84rem; }
.bell-read-all:hover { background: var(--primary-soft); }
.bell-list { flex: 1; min-height: 0; overflow-y: auto; }
.bell-items { margin: 0; padding: 0; list-style: none; }
.bell-items li + li { border-top: 1px solid var(--line-2); }
.bell-item { display: grid; gap: 3px; padding: 12px 16px; color: var(--ink); text-decoration: none; transition: background .1s; }
.bell-item:hover, .bell-item:focus-visible { background: #f5f8ff; }
.bell-item:focus-visible { outline-offset: -3px; }
.bell-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bell-item-head small { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.bell-item strong { font-weight: 700; overflow-wrap: anywhere; }
.bell-item-text { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-more { padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .82rem; text-align: center; }
.bell-empty { display: grid; justify-items: center; gap: 6px; padding: 30px 24px 32px; text-align: center; }
.bell-empty .mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.bell-empty .mark svg { width: 22px; height: 22px; }
.bell-empty p { margin: 0; max-width: 34ch; color: var(--muted); font-size: .86rem; }
.bell-foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.bell-foot a { font-weight: 700; font-size: .84rem; text-decoration: none; }
.bell-foot a:hover { text-decoration: underline; }
.menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; text-decoration: none; }
.menu a:hover, .menu a:focus-visible { background: var(--surface-2); }

.notify-settings { align-items: start; }
.notify-settings .card-head h2 small { margin-top: 2px; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px 16px; }
.notify-notes { display: grid; gap: 10px; padding: 0 20px 20px; }
.notify-note { display: flex; gap: 10px; align-items: flex-start; }
.notify-note svg { width: 18px; height: 18px; margin-top: 1px; }
.notify-note.emphasis { box-shadow: inset 4px 0 0 var(--primary); }
.notify-settings .card-foot { border-top: 1px solid var(--line); }
.switch { position: relative; display: inline-flex; flex: none; width: 44px; height: 26px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { width: 100%; height: 100%; border-radius: 999px; background: #cfd6e3; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22,33,58,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(36,87,230,.45); outline-offset: 2px; }
.switch input:disabled + span { opacity: .55; }

@media (max-width: 900px) {
  .bell-menu { right: 16px; }
}
@media (max-width: 640px) {
  .account { gap: 2px; }
  .bell-btn { width: 36px; height: 36px; }
  .bell-menu { position: fixed; left: 8px; right: 8px; top: calc(60px + env(safe-area-inset-top, 0px)); width: auto; max-height: calc(100vh - 76px - env(safe-area-inset-top, 0px)); }
  .bell-item { padding: 12px 14px; }
  .notify-actions { padding: 14px 16px 14px; }
  .notify-actions .btn { flex: 1 1 100%; justify-content: center; }
  .notify-notes { padding: 0 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { .switch span, .switch span::after, .bell-btn, .bell-item { transition: none; } }