/* CornerPost — staff UI, v2 (docs/ui-v2-design-spec.md)

   The design system for every page rendered in the shell, explorer's included.
   A 64px top bar over one content area; cards inset 24px; five palettes, each a
   complete token set on :root[data-theme=…]. Screens never hard-code a color —
   they read tokens. The server renders data-theme on <html> from the user's
   preference (enforcement.context.ui_state), so there is no flash of the
   default palette on load.

   Class names from v1 (.panel, .table, .btn.ghost, .kv, .zform, .stamp .tab/.ref,
   .legend*, .seg-btn) are kept and restyled on the v2 tokens: explorer's band
   editor and several enforcement pages still use them, and renaming them would
   be churn with no user-visible gain.
*/

/* ---------- Type: Public Sans, vendored (OFL) ---------- */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/public-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/public-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/public-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/public-sans-700.woff2") format("woff2"); }

/* ---------- Palettes ----------
   Contrast, checked per palette (see docs/ui-v2-plan.md for the method):
   --muted ≥ 5.2:1 on --ground and --surface; --accent ≥ 5.5:1 on --surface and
   under --on-accent; --field-line (form-control borders) ≥ 3.3:1 on both
   grounds for SC 1.4.11 — --line is decorative only and never a control's
   sole boundary. */
:root,
:root[data-theme="parchment"] {
  --ground: #f4f2ec; --surface: #ffffff; --ink: #1b2436; --muted: #5f6576;
  --line: #e4e0d6; --field-line: #8a8474; --hover: #f6f4ee;
  --accent: #4f5bd5; --accent-strong: #3a44ad; --on-accent: #ffffff;
  --soft: #e7e9fb; --soft-ink: #343ea3;
  --deep: #1b2436; --on-deep: #ffffff; --on-deep-muted: #b9c0d0;
  --shadow: 0 12px 32px rgba(27,36,54,.14), 0 2px 6px rgba(27,36,54,.06);
  --card-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.05);
  --pop-shadow: 0 24px 60px rgba(0,0,0,.22);
  --scrim: rgba(27,36,54,.38);
  color-scheme: light;
}
:root[data-theme="slate"] {
  --ground: #eef1f4; --surface: #ffffff; --ink: #15202b; --muted: #56616e;
  --line: #d8dde3; --field-line: #7b8591; --hover: #f3f5f8;
  --accent: #0e6a87; --accent-strong: #0a5068; --on-accent: #ffffff;
  --soft: #dcedf3; --soft-ink: #0a4f65;
  --deep: #15202b; --on-deep: #ffffff; --on-deep-muted: #b3bdc9;
  --shadow: 0 12px 32px rgba(21,32,43,.14), 0 2px 6px rgba(21,32,43,.06);
}
:root[data-theme="fieldstone"] {
  --ground: #f0efe8; --surface: #ffffff; --ink: #1e2a21; --muted: #5a6356;
  --line: #dcdacd; --field-line: #80806f; --hover: #f5f4ef;
  --accent: #2e6a3e; --accent-strong: #22502f; --on-accent: #ffffff;
  --soft: #e0ece3; --soft-ink: #224f2e;
  --deep: #1e2a21; --on-deep: #ffffff; --on-deep-muted: #b8c2b6;
  --shadow: 0 12px 32px rgba(30,42,33,.14), 0 2px 6px rgba(30,42,33,.06);
}
:root[data-theme="brick"] {
  --ground: #f5efea; --surface: #ffffff; --ink: #2a1d18; --muted: #6a5b53;
  --line: #e6dbd1; --field-line: #8e7f75; --hover: #f8f4f0;
  --accent: #a13f29; --accent-strong: #7c2f1f; --on-accent: #ffffff;
  --soft: #f4e2dc; --soft-ink: #7c2f1f;
  --deep: #2a1d18; --on-deep: #ffffff; --on-deep-muted: #cdbdb5;
  --shadow: 0 12px 32px rgba(42,29,24,.14), 0 2px 6px rgba(42,29,24,.06);
}
/* Night is designed, not inverted: its own ground/surface/accent, and card
   shadows dropped in favour of borders (a shadow on near-black reads as mud). */
:root[data-theme="night"] {
  --ground: #10141b; --surface: #1a2029; --ink: #e6e9ef; --muted: #9aa3b1;
  --line: #2b3341; --field-line: #6b7587; --hover: #222a35;
  --accent: #8e97ff; --accent-strong: #b0b6ff; --on-accent: #10141b;
  --soft: #2a3052; --soft-ink: #cdd2ff;
  --deep: #0a0d12; --on-deep: #e6e9ef; --on-deep-muted: #9aa3b1;
  --shadow: 0 16px 40px rgba(0,0,0,.5);
  --card-shadow: none;
  --pop-shadow: 0 24px 60px rgba(0,0,0,.6);
  --scrim: rgba(6,9,14,.62);
  color-scheme: dark;
}

/* Status colors: a reserved set, separate from the palettes, keyed on stored
   status *codes* by the `theme` filter (templatetags/cp.py) so pills survive
   localization. Always paired with a word — never color alone. */
:root {
  --st-open: #2f6df0;      --st-open-ink: #1f4fb8;      --st-open-bg: rgba(47,109,240,.12);
  --st-invest: #d98a1f;    --st-invest-ink: #8a5410;    --st-invest-bg: rgba(217,138,31,.12);
  --st-violation: #d2453c; --st-violation-ink: #a52c24; --st-violation-bg: rgba(210,69,60,.12);
  --st-closed: #3f8f4f;    --st-closed-ink: #2b6a38;    --st-closed-bg: rgba(63,143,79,.12);
  --st-neutral: #7a7f8c;   --st-neutral-ink: #4f5461;   --st-neutral-bg: rgba(122,127,140,.12);
  /* A property alert's Critical level (#145): plum, not the status red the Watch and denied pills use, so it never
     reads as the same signal. Its ink is 7.1:1 or better on every palette's surface (measured). */
  --st-critical: #8e2fb8;  --st-critical-ink: #6a1b8f;  --st-critical-bg: rgba(142,47,184,.12);
  /* Chart series — validated for color-vision deficiency on both surfaces.
     Violations are raspberry, not status red, so a bar never reads as a pill. */
  --s-calls: #2f6df0; --s-complaints: #d98a1f; --s-violations: #c2366b;

  --radius-card: 16px; --radius-pop: 18px; --radius-ctl: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bar-h: 64px;

  /* v1 names, aliased so explorer's style.css and band_editor.css keep working. */
  --paper: var(--ground); --card: var(--surface); --ink-soft: var(--muted);
  --tint: var(--hover); --accent-ink: var(--accent-strong);
  --open: var(--st-open); --invest: var(--st-invest);
  --violation: var(--st-violation); --closed: var(--st-closed);
  --radius: var(--radius-ctl);
}
:root[data-theme="night"] {
  --st-open-ink: #9dbcff;      --st-open-bg: rgba(47,109,240,.2);
  --st-invest-ink: #f3bf73;    --st-invest-bg: rgba(217,138,31,.2);
  --st-violation-ink: #ff9c94; --st-violation-bg: rgba(210,69,60,.2);
  --st-closed-ink: #8fd49e;    --st-closed-bg: rgba(63,143,79,.2);
  --st-neutral-ink: #bcc1cc;   --st-neutral-bg: rgba(122,127,140,.2);
  --st-critical-ink: #e3b0f5;  --st-critical-bg: rgba(142,47,184,.2);
  --s-calls: #5b8ff5; --s-complaints: #b5822a; --s-violations: #e0567f;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  background: var(--ground); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
/* Profile → Accessibility → Larger text. Everything is px, so scale the root. */
html.pref-larger-text { zoom: 1.125; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -.01em; }
/* One focus ring for everything. `outline: none` appears nowhere in this repo,
   deliberately — see CLAUDE.md. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Links inside running text keep an underline: a link within a sentence is not
   identifiable by position, so color alone would be its only marker (SC 1.4.1). */
.prose a, .set-note a, .field .help a, .form-errors a, .empty a, .flash a, .auth a,
.band-intro a, .subtitle a, .dim a.u {
  text-decoration: underline; text-underline-offset: 2px;
}

/* One visibility utility for the whole shell. `!important` also defeats author
   `display` rules scoped tighter than the UA's own [hidden]. */
.hidden, [hidden] { display: none !important; }

/* Visually hidden but still in the accessibility tree. NOT interchangeable
   with .hidden, which removes content from assistive tech too. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  width: auto; height: auto; margin: 0; padding: 10px 16px;
  clip: auto; clip-path: none; overflow: visible;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--accent); border-radius: 8px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
}

.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }
.gap { flex-grow: 1; }
.plain { list-style: none; margin: 0; padding: 0; }
.dim { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h); padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand-name .accent { color: var(--accent); }
/* Which kind of server this is (accounts/_env_chip.html); absent in production. Words carry the meaning, the tint only helps. */
.env-chip {
  flex: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--soft); color: var(--soft-ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

.icon-btn {
  width: 44px; height: 44px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover, details[open] > .icon-btn { background: var(--hover); }
.icon-btn.bare { border-color: transparent; background: transparent; }
.icon-btn.bare:hover { background: var(--hover); }
.btn-new {
  height: 44px; padding: 0 14px 0 12px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: var(--radius-ctl);
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-new:hover { background: var(--accent-strong); }
.avatar-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--soft-ink); font-size: 14px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }

/* Menus are native <details>/<summary> (keyboard-operable with no script; see
   CLAUDE.md). app.js adds Escape, outside-click and one-open-at-a-time. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px;
}
.pop-new { width: 340px; }
.pop-account { width: 300px; }
.pop-areas { width: 604px; padding: 12px; border-radius: var(--radius-pop); }
.menu-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-item {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 6px 10px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item .well { width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--soft-ink); }
.menu-item .label { display: block; font-size: 15px; font-weight: 600; }
.menu-item .desc { display: block; font-size: 13px; color: var(--muted); }
.menu-line { height: 1px; margin: 4px; background: var(--line); }
.menu-row {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-row:hover { background: var(--hover); }
.tag-admin { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }

.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.areas a { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 14px; }
.areas a:hover { background: var(--hover); }
.areas a[aria-current="page"] { background: var(--hover); box-shadow: inset 0 0 0 1.5px var(--line); }
.areas .tile { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--soft-ink); }
.areas .tile .ico { width: 26px; height: 26px; }
.areas a[aria-current="page"] .tile { background: var(--accent); color: var(--on-accent); }
.areas .name { font-size: 14px; font-weight: 600; text-align: center; }

.theme-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 10px; margin: 0; }
.swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch.parchment { background: #4f5bd5; } .swatch.slate { background: #0e6a87; }
.swatch.fieldstone { background: #2e6a3e; } .swatch.brick { background: #a13f29; }
.swatch.night { background: #10141b; box-shadow: inset 0 0 0 10px #8e97ff; }
.swatch.night[aria-pressed="true"] { box-shadow: inset 0 0 0 10px #8e97ff, 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* ---------- Content area & the two-pane rule ---------- */
.content { padding: 18px 24px 24px; min-height: calc(100vh - var(--bar-h)); }
.content.narrow > * { max-width: 1040px; }
.panes { display: flex; gap: 16px; align-items: flex-start; }
.list-pane { width: 100%; flex: none; transition: width .2s ease; }
.panes.split .list-pane { width: 66%; }       /* list + form (add / edit) */
.panes.split-half .list-pane { width: 50%; }  /* list + record workspace (Cases) */
.side-pane {
  flex: 1 1 0; min-width: 0;
  position: sticky; top: calc(var(--bar-h) + 18px);
  max-height: calc(100vh - var(--bar-h) - 42px);
}

.card {
  display: flex; flex-direction: column; min-width: 0;
  border-radius: var(--radius-card); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--card-shadow); overflow: hidden;
}
.card-pad { padding: 18px 20px; }
.card > h2, .card-title { margin: 0; font-size: 18px; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; }

.head { padding: 16px 18px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.head h1, .head h2 { margin: 0 6px 0 0; font-size: 22px; font-weight: 700; }
.head h2.sm { font-size: 18px; }
.count { font-size: 13px; color: var(--muted); }
.filter {
  height: 44px; min-width: 200px; flex-grow: 1; max-width: 340px;
  padding: 0 12px; display: flex; align-items: center; gap: 8px;
  border-radius: var(--radius-ctl); border: 1px solid var(--field-line);
  background: var(--ground); color: var(--muted);
}
/* The wrapper draws the focus ring; the input inside has no border of its own. */
.filter:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter input { flex-grow: 1; min-width: 0; height: 40px; border: 0; background: transparent; font-size: 14px; color: var(--ink); }
.filter input:focus-visible { outline-color: transparent; }
.chip-rows { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.chips { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip {
  min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; border: 1px solid var(--field-line); background: transparent;
  color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { background: var(--hover); }
.chip[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .n { font-weight: 500; opacity: .8; }
.chip-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ---------- Tables (lists) ----------
   Real tables, not a grid of links: column headers and the row-header cell keep
   what a screen reader says for each cell. app.js makes the whole row clickable
   by forwarding to the row's identifying link. */
/* Positioned, so a visually hidden label inside a table scrolls with the table rather than widen the page. */
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 18px; background: var(--hover);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody th, .table td {
  padding: 8px 18px; height: 52px; vertical-align: middle;
  border-bottom: 1px solid var(--line); text-align: left;
}
.table tbody th { font: inherit; text-transform: none; letter-spacing: normal; color: inherit; background: transparent; white-space: normal; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover > * { background: var(--hover); }
.table tr[aria-current="true"] > * { background: var(--soft); }
.table tr[aria-current="true"] > :first-child { box-shadow: inset 4px 0 0 var(--accent); }
.table .rowmain { color: inherit; }
.table .addr { font-weight: 600; }
.table .sub { display: block; color: var(--muted); font-size: 13px; }
.table .clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.total-row td { border-top: 2px solid var(--line); font-weight: 700; }
.rowact { white-space: nowrap; text-align: right; }
.rowact a { font-size: 13px; font-weight: 600; color: var(--accent); padding: 0 6px; }
.rowact a.del { color: var(--st-violation-ink); }
.rowact a:hover { text-decoration: underline; }

/* ---------- Stamp, pill, priority ---------- */
/* The signature: a case reference as a file stamp — monospace, tracked, with a
   colored status tab. The office's real artifact. */
.stamp { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--surface); vertical-align: middle; }
.stamp .tab { width: 7px; background: var(--st-neutral); }
.stamp .ref { padding: 3px 8px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .05em; color: var(--ink); white-space: nowrap; }
.stamp.t-open .tab { background: var(--st-open); }
.stamp.t-invest .tab { background: var(--st-invest); }
.stamp.t-violation .tab { background: var(--st-violation); }
.stamp.t-closed .tab { background: var(--st-closed); }

/* nowrap stays: a table cell grows to fit, and wrapping "In progress" across
   two lines was a real regression in the language that ships. */
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--st-neutral-bg); color: var(--st-neutral-ink); }
.pill.t-open { background: var(--st-open-bg); color: var(--st-open-ink); }
.pill.t-invest { background: var(--st-invest-bg); color: var(--st-invest-ink); }
.pill.t-violation { background: var(--st-violation-bg); color: var(--st-violation-ink); }
.pill.t-closed { background: var(--st-closed-bg); color: var(--st-closed-ink); }
.pill.t-neutral { background: var(--st-neutral-bg); color: var(--st-neutral-ink); }
.pill.t-critical { background: var(--st-critical-bg); color: var(--st-critical-ink); box-shadow: inset 0 0 0 1px var(--st-critical); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--st-neutral); }
.dot.t-open { background: var(--st-open); } .dot.t-invest { background: var(--st-invest); }
.dot.t-violation { background: var(--st-violation); } .dot.t-closed { background: var(--st-closed); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.prio .dot { background: var(--st-neutral); }
.prio.high .dot { background: var(--st-violation); }
.prio.medium .dot { background: var(--st-invest); }
.prio.low .dot { background: var(--st-closed); }

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-ctl); border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-strong); }
.btn.ghost, .btn.alt { background: transparent; color: var(--ink); border-color: var(--field-line); }
.btn.ghost:hover, .btn.alt:hover { background: var(--hover); }
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--line); font-size: 14px; padding: 0 14px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--st-violation-ink); border-color: var(--st-violation); }
.btn.danger:hover { background: var(--st-violation-bg); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Forms ---------- */
.input, .select, .textarea {
  min-height: 44px; padding: 0 12px; border-radius: var(--radius-ctl);
  border: 1px solid var(--field-line); background: var(--ground); color: var(--ink); font-size: 15px;
}
.textarea { padding: 10px 12px; min-height: 92px; line-height: 1.5; resize: vertical; }
.input[type="file"] { padding: 8px 12px; }
.zform { padding: 18px; }
.form-body { flex-grow: 1; overflow: auto; padding: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.field .input, .field .select, .field .textarea { width: 100%; }
.field .req { color: var(--st-violation-ink); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--st-violation); }
.field .help { font-size: 13px; color: var(--muted); }
/* A list of checkboxes (Django's CheckboxSelectMultiple): each option reads as a sentence, not as a field label. */
.field label:has(> input[type="checkbox"]) {
  display: flex; align-items: center; gap: 8px; min-height: 32px;
  text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 500; color: var(--ink);
}
.field .err { font-size: 13px; color: var(--st-violation-ink); }
.field .err p, .form-errors p { margin: 0; }
.field .err p + p, .form-errors p + p { margin-top: 3px; }
.form-errors { background: var(--st-violation-bg); color: var(--st-violation-ink); border: 1px solid var(--st-violation); padding: 10px 12px; border-radius: var(--radius-ctl); margin-bottom: 14px; font-size: 14px; }
.req-legend { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.req-legend .req { color: var(--st-violation-ink); font-weight: 600; }
.form-actions, .form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions { margin-top: 20px; }
.form-foot { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--hover); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

/* ---------- Flash messages ---------- */
/* Levelled by message.level_tag, and each carries its words, so color is never
   the only thing distinguishing them (SC 1.4.1). */
.flash { padding: 10px 14px; border-radius: var(--radius-ctl); margin-bottom: 14px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.flash.f-success { background: var(--st-closed-bg); color: var(--st-closed-ink); border-color: var(--st-closed); }
.flash.f-info { background: var(--st-open-bg); color: var(--st-open-ink); border-color: var(--st-open); }
.flash.f-warning { background: var(--st-invest-bg); color: var(--st-invest-ink); border-color: var(--st-invest); }
.flash.f-error { background: var(--st-violation-bg); color: var(--st-violation-ink); border-color: var(--st-violation); }

/* ---------- Panels (v1 detail/settings sections) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--card-shadow); overflow: hidden; }
.panel-h { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.panel-b { padding: 6px 0; }
.panel > .kv { padding: 16px 18px; }
.panel > .table th:first-child, .panel > .table td:first-child { padding-left: 18px; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.section { margin-bottom: 24px; }

/* Key/value facts. Two columns of label-over-value in popovers and workspaces. */
.kv { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.kv > div { min-width: 0; }
.kv dt { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; }
.fact-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.prose { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-line; }

.linked { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-ctl); overflow: hidden; }
.linked > a, .linked > .item { min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.linked > :last-child { border-bottom: 0; }
.linked > a:hover { background: var(--hover); }
.linked .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The case's History tab: a list of changes, each line wrapping, since a value can be long (trail/display.py). */
.linked.history { list-style: none; margin: 0; padding: 0; }
.linked.history .t { white-space: normal; overflow-wrap: anywhere; }
.empty { padding: 28px 20px; text-align: center; font-size: 14px; color: var(--muted); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* ---------- Record workspace (Cases, 50/50) ---------- */
.workspace-head { position: relative; padding: 18px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.workspace-head .meta { padding-right: 52px; }
.workspace-head .close { position: absolute; top: 10px; right: 10px; }
.workspace-head .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workspace-head h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; }
.workspace-head .where { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.workspace-head .where a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.workspace-head .where a:hover { color: var(--ink); text-decoration: underline; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; margin: 0 -20px; overflow-x: auto; }
.tabs [role="tab"] {
  height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-bottom: 3px solid transparent; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.tabs .n { opacity: .75; }
.tabpanel { padding: 20px; display: flex; flex-direction: column; gap: 20px; overflow: auto; }
.side-pane > .card { max-height: inherit; }
.side-pane .tabpanel, .side-pane .form-body { flex: 1 1 auto; min-height: 0; }

/* ---------- Popover over the content ---------- */
.scrim { position: fixed; inset: var(--bar-h) 0 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--scrim); }
.scrim.top { align-items: flex-start; padding-top: 20px; }
.scrim > .close-hit { position: absolute; inset: 0; cursor: default; }
.dialog {
  position: relative; width: 620px; max-width: 100%; max-height: min(660px, calc(100vh - var(--bar-h) - 48px));
  display: flex; flex-direction: column; border-radius: var(--radius-pop); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--pop-shadow); overflow: hidden;
}
.dialog.wide { width: 880px; max-height: calc(100vh - var(--bar-h) - 44px); }
.dialog-head { padding: 18px 20px 14px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.well { width: 42px; height: 42px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--soft-ink); }
.well.sm { width: 34px; height: 34px; border-radius: 9px; }
.dialog-title { margin: 0; font-size: 20px; font-weight: 700; }
.dialog-sub { display: block; font-size: 14px; color: var(--muted); }
.dialog-body { flex-grow: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.dialog-foot { padding: 14px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--hover); }

/* Global search panel */
.search-field { height: 68px; flex: none; padding: 0 12px 0 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.search-field input { flex-grow: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 20px; color: var(--ink); }
.search-field:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.search-field input:focus-visible { outline-color: transparent; }
.search-results { padding: 8px; }
.search-results .menu-item { align-items: center; }
.search-results .menu-item .label, .search-results .menu-item .desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: var(--soft); color: var(--soft-ink); border-radius: 3px; padding: 0 2px; }

/* ---------- Home tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-content: start; list-style: none; margin: 0; padding: 0; }
.tile-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--card-shadow); min-width: 0; }
.tile-card.wide { grid-column: span 2; }
.tile-card.tall { grid-row: span 2; }
.tile-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tile-value { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.tile-value.t-open { color: var(--st-open-ink); } .tile-value.t-violation { color: var(--st-violation-ink); }
.tile-value.t-closed { color: var(--st-closed-ink); } .tile-value.t-invest { color: var(--st-invest-ink); }
.tile-unit { font-size: 13px; color: var(--muted); }
.tile-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; padding: 0; list-style: none; }
.tile-list a { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; padding: 6px 8px; border-radius: var(--radius-ctl); }
.tile-list a:hover { background: var(--hover); }
.tile-list .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-list .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tile-edit { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.tiles.editing .tile-card { border-style: dashed; }
.work-row { display: grid; grid-template-columns: 140px 1fr 34px; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
.work-bar { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.work-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.work-row .ct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Reports ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: var(--radius-ctl); overflow: hidden; }
.seg a, .seg-btn { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; border-right: 1px solid var(--line); color: var(--ink); }
.seg > :last-child { border-right: 0; }
.seg a:hover, .seg-btn:hover { background: var(--hover); }
.seg a[aria-current="true"], .seg-btn.on { background: var(--accent); color: var(--on-accent); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 13px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.s-calls { background: var(--s-calls); fill: var(--s-calls); }
.s-complaints { background: var(--s-complaints); fill: var(--s-complaints); }
.s-violations { background: var(--s-violations); fill: var(--s-violations); }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 30px; border-radius: var(--radius-card); background: var(--deep); color: var(--on-deep); }
.hero .num { font-size: 56px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero .lbl { font-size: 16px; font-weight: 600; }
.hero .lbl span { display: block; font-size: 13px; font-weight: 400; color: var(--on-deep-muted); }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.set-note { padding: 12px 18px 0; margin: 0; color: var(--muted); font-size: 13px; }
.envkey { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }  /* a key has no break of its own, and the console's card is a third of the page */
.logo-box { width: 96px; height: 96px; flex: none; border-radius: 12px; border: 1px dashed var(--field-line); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; }

/* ---------- Map key ----------
   The vertical swatch-and-label key built by explorer's sidebar.js and
   band_editor.js. Deliberately unscoped: embedded pages reach for it. */
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.legend-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.35; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.legend-swatch { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; margin-top: 2px; }
/* A band that draws no fill keys as an empty box (ColorBand.no_fill). */
.legend-swatch--none { background: transparent; box-shadow: inset 0 0 0 1px var(--field-line); }

/* ---------- Full-bleed content (Map Explorer) ---------- */
.content.content--flush { padding: 18px 24px 24px; height: calc(100vh - var(--bar-h)); min-height: 0; display: flex; flex-direction: column; }

/* ---------- Sign in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 64px; gap: 24px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 26px; }
.auth-card .brand { margin-bottom: 8px; }
.auth-art { background: var(--deep); color: var(--on-deep); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; gap: 24px; }
.auth-art .big { font-size: 34px; font-weight: 700; line-height: 1.15; max-width: 14em; }
.auth-art .dim { color: var(--on-deep-muted); }
.alert { padding: 12px 14px; border-radius: var(--radius-ctl); border: 1px solid var(--st-violation); background: var(--st-violation-bg); color: var(--st-violation-ink); font-size: 14px; }

/* What's New */
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.news li { display: flex; align-items: center; gap: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tiles, .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panes.split .list-pane, .panes.split-half .list-pane { width: 50%; }
  .pop-areas { width: min(604px, calc(100vw - 32px)); }
  .set-grid, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .bar { padding: 0 12px; gap: 8px; }
  .brand-name, .btn-new .lbl { display: none; }
  .btn-new { padding: 0 12px; }
  .content, .content.content--flush { padding: 12px; }
  .panes { flex-direction: column; }
  .panes .list-pane, .panes.split .list-pane, .panes.split-half .list-pane { width: 100%; }
  /* Record and form stack above the list on a phone: it is what was just opened. */
  .panes .side-pane { order: -1; position: static; max-height: none; width: 100%; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 32px 16px; }
  .tiles, .stat-row, .kv, .fact-grid, .grid-fields { grid-template-columns: 1fr; }
  .tile-card.wide { grid-column: auto; }
  .areas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .areas a { height: 96px; }
  .pop { position: fixed; top: calc(var(--bar-h) + 6px); left: 8px; right: 8px; width: auto; max-height: calc(100vh - var(--bar-h) - 16px); overflow: auto; }
  .filter { max-width: none; }
  /* Wide tables scroll inside their card rather than the page. */
  .table-wrap .table { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
html.pref-reduce-motion * { transition: none !important; animation: none !important; }

/* ---------- Print ---------- */
/* The shell is screen chrome; printing a record should put the record on the
   paper. print_map.css is separate — a standalone document built for paper. */
@media print {
  .bar, .skip-link, #cp-live, #overlay:empty, .chips, .filter, .form-foot { display: none !important; }
  .content { padding: 0; min-height: 0; }
  body { background: #fff; }
  .card, .panel, .tile-card { box-shadow: none; break-inside: avoid; }
  .panes { display: block; }
  .side-pane { position: static; max-height: none; }
  .table tr.row-link { cursor: auto; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}

/* ---------- Management (People and access; docs/accounts-access-ux.md) ----------
   Drawn in the "CornerPost Accounts & Access UX" canvas: a title with the jurisdiction beside it, underlined tabs (links, not
   buttons: each tab is a URL), a tools row, then a list with its pane. */
.mgmt-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.mgmt-head h1 { margin: 0; font-size: 22px; font-weight: 700; }
.jur-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 99px; background: var(--surface); font-size: 13px; font-weight: 600;
}
.utabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.utabs a {
  height: 44px; padding: 0 14px; margin-bottom: -1px; display: inline-flex; align-items: center;
  border-bottom: 3px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.utabs a:hover { color: var(--ink); }
.utabs a[aria-current="page"], .utabs a[aria-current="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.tools-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.tools-row .input { width: 260px; max-width: 100%; }
.tools-row .select.chip-select { width: auto; min-height: 36px; padding: 0 30px 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.p-role { background: var(--soft); color: var(--soft-ink); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.mgmt-note { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.table.people td, .table.people th { height: 60px; }

/* A choice drawn as a card: a roles picker, a permission. The real checkbox is the first child, hidden, and the box beside it
   draws its state, so the keyboard and screen readers get a checkbox and the eye gets the design. */
.pick {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; min-height: 56px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
}
.pick input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.pick .box {
  width: 22px; height: 22px; flex: none; margin-top: 1px; display: grid; place-items: center;
  border: 2px solid var(--field-line); border-radius: 6px; background: var(--surface); color: var(--muted);
}
.pick .box svg { width: 14px; height: 14px; }
.pick .box .on, .pick .box .lock { display: none; }
.pick input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pick input:checked + .box .on { display: block; } .pick input:checked + .box .off { display: none; }
.pick input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick .strong { font-weight: 600; }
.pick.changed { border-color: var(--accent); background: var(--soft); }
.pick.locked { background: var(--hover); border-style: dashed; color: var(--muted); cursor: default; }
.pick.locked .box { border-color: var(--line); } .pick.locked .box .off, .pick.locked .box .on { display: none; }
.pick.locked .box .lock { display: block; }
.pick .why { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--st-invest-ink); }
.pick-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.pick-list legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 20px 20px; }
.perm-grid .gh {
  grid-column: 1 / -1; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.perm-grid .gh:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.role-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.role-list li { border-bottom: 1px solid var(--line); }
.role-list li:last-child { border-bottom: 0; }
.role-list a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; }
.role-list a:hover { background: var(--hover); }
.role-list li[aria-current="true"] a { background: var(--soft); }
.role-list .grow { flex: 1; min-width: 0; }
.role-list .grow strong { display: block; font-weight: 600; }
.roles-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.save-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px;
  border-top: 1px solid var(--line); background: var(--hover);
}
.save-bar .grow { flex: 1; min-width: 240px; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; padding: 16px 20px 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-tile { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--card-shadow); }
.stat-tile .k { font-size: 14px; color: var(--muted); } .stat-tile .v { font-size: 28px; font-weight: 700; line-height: 1.2; }
.holds { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.holds .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.holds .bar > span { display: block; height: 100%; background: var(--accent); }
.row-gap { display: flex; flex-direction: column; gap: 16px; }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.bullets li { display: flex; gap: 12px; align-items: flex-start; }
.bullets .ico { margin-top: 2px; color: var(--st-violation-ink); }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-ctl); background: var(--st-invest-bg); color: var(--st-invest-ink); font-weight: 600; }
.callout.info { background: var(--st-open-bg); color: var(--st-open-ink); }
.floor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.floor:last-child { border-bottom: 0; }
.floor .sub { margin-top: 2px; }
.dialog-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.dialog-tabs a {
  height: 44px; padding: 0 12px; margin-bottom: -1px; display: inline-flex; align-items: center;
  border-bottom: 3px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted);
}
.dialog-tabs a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.signed-in-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.signed-in-row:last-child { border-bottom: 0; }
.signed-in-row .grow { flex: 1; min-width: 0; }
.signed-in-row .grow strong { display: block; font-weight: 600; }
.sec-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.danger-text { color: var(--st-violation-ink); }
.invite-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.invite-steps span { display: block; height: 5px; border-radius: 99px; background: var(--line); }
.invite-steps .on { background: var(--accent); }
.invite-steps small { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.invite-steps .cur small { color: var(--ink); }
@media (max-width: 900px) {
  .perm-grid { grid-template-columns: 1fr; }
  .roles-layout, .sec-layout { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-pair { grid-template-columns: 1fr; }
}
/* Management's filter chips mark the chosen one softly (the design: "All 7" on a pale accent), not in ink. */
.tools-row .chip[aria-current="true"] { background: var(--soft); color: var(--soft-ink); border-color: transparent; }
.tools-row .input { background: var(--surface); }
/* A person's popover reads as label | value rows, as drawn. */
.kv.rows { grid-template-columns: 1fr; gap: 14px; }
.kv.rows > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.kv.rows dt { text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 500; }
.kv.rows dd { font-weight: 500; }

/* ---------- The platform console (docs/user-admin-plan.md; the "Platform" boards) ---------- */
.bar.platform { background: var(--deep); border-bottom-color: transparent; color: var(--on-deep); }
.bar.platform .brand-name, .bar.platform a { color: var(--on-deep); }
.bar.platform .brand-name .accent { color: var(--on-deep); }
.bar.platform .brand-mark { color: var(--on-deep); }
.plat-chip { padding: 3px 12px; border-radius: 99px; background: rgba(255,255,255,.16); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.plat-host { font-family: var(--mono); font-size: 13px; opacity: .85; }
/* Short of room, the areas scroll inside the bar rather than push it past the window; the padding keeps the focus ring in view,
   and app.js brings the current area, and each as it takes focus, whole into view.
   At 570 pixels and below no whole area fits, so they hide rather than take focus out of view, and the host with them, so the bar fits a phone. */
.plat-nav { display: flex; gap: 4px; padding: 4px; min-width: 0; overflow-x: auto; scrollbar-width: thin; scroll-padding-inline: 4px; }
@media (max-width: 570px) { .plat-nav, .plat-host { display: none; } }
.plat-nav a { min-height: 44px; line-height: 1.15; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: .85; }
.plat-nav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.plat-nav a[aria-current="page"] { background: rgba(255,255,255,.18); opacity: 1; }
.bar.platform .avatar { background: rgba(255,255,255,.2); color: var(--on-deep); box-shadow: none; }
/* Where the areas take its room, the note's four lines still fit the 64-pixel bar. */
.bar.platform .plat-note { font-size: 13px; line-height: 1.2; opacity: .85; }
.bar.platform .env-chip { background: rgba(255,255,255,.12); color: var(--on-deep); border-color: transparent; }
/* A menu opened from the bar sits on the page's own surface, so it takes the page's text color, not the bar's (#308). */
.bar.platform .pop { color: var(--ink); }
.bar.platform .pop a { color: inherit; }
.support-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: var(--st-invest-bg); color: var(--st-invest-ink);
  border-bottom: 1px solid var(--st-invest); font-size: 14px; position: sticky; top: var(--bar-h); z-index: 39;
}
.plat-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.plat-head h1 { margin: 0; font-size: 22px; font-weight: 700; }
.plat-head .dim { font-size: 14px; }
.attn { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.attn:last-child { border-bottom: 0; }
.attn .grow { flex: 1; min-width: 0; } .attn .grow strong { display: block; font-weight: 600; }
.attn .ico { color: var(--st-invest-ink); flex: none; }
.wizard-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 18px 0; }
.wizard-steps span { display: block; height: 5px; border-radius: 99px; background: var(--line); }
.wizard-steps .on { background: var(--accent); }
.wizard-steps small { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.wizard-steps .cur small { color: var(--ink); }
.match { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.match.chosen { border-color: var(--accent); background: var(--soft); }
.acct-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.acct-row:last-child { border-bottom: 0; }
.acct-row[aria-current="true"] { background: var(--soft); }
.acct-row .grow { flex: 1; min-width: 0; } .acct-row .grow strong { display: block; font-weight: 600; }
.sec-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .acct-layout, .sec-two { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 901px) { .stat-tiles.six { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Inspection checklists (checklists/templates/checklists/; docs/inspection-checklists-plan.md) */
.checklist-heading { margin: 18px 0; }
.checklist-heading .head form, .checklist-controls form, .page-head form { display: inline-flex; gap: 6px; }
.checklist-lines { margin: 8px 0 0; padding-left: 22px; }
.checklist-line { padding: 12px 0; border-top: 1px solid var(--line); }
.checklist-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.compare-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.compare-versions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.compare-list { list-style: none; padding: 0; margin: 0; }
.compare-list > li { padding: 10px 0; border-top: 1px solid var(--line); }

/* ---------- Property alerts (#145) ---------- */
.alert-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-level { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-level .pill { display: inline-flex; align-items: center; gap: 5px; }
.alert-text { margin: 6px 0 4px; overflow-wrap: anywhere; white-space: pre-line; }
.alert-meta { margin: 0; overflow-wrap: anywhere; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.alert-actions form { display: inline-flex; margin: 0; }
.alert-ended { border-top: 1px solid var(--line); }
.alert-ended > summary { cursor: pointer; padding: 12px 18px; font-weight: 600; }
.alert-ended .alert-item { opacity: .92; }
.alert-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-ctl); background: var(--hover); }
.alert-line.has-critical { box-shadow: inset 3px 0 0 var(--st-critical); }
.alert-line .alert-text { margin: 0; flex-basis: 100%; }
.field label:has(> input[type="checkbox"]) input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
fieldset.level-field { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
fieldset.level-field legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.level-options { display: flex; flex-wrap: wrap; gap: 8px; }
.level-options label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: var(--radius-ctl); cursor: pointer; font-weight: 600; font-size: 15px; }
.level-options input { width: 18px; height: 18px; accent-color: var(--accent); }
.level-options label:has(input:checked) { background: var(--hover); border-color: var(--ink); }
.level-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.field .check.is-disabled { color: var(--muted); }
@media (max-width: 640px) {
  .alert-item { grid-template-columns: minmax(0, 1fr); }
  .alert-actions .btn { flex: 1 1 auto; }
}
.field input.tick { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); align-self: flex-start; }
[data-focus-hash] { scroll-margin-top: calc(var(--bar-h) + 16px); }
