/* BC2026 — Command
   Operational ops-tool theme for incident-command-w3w.
   Graphite dark-first surfaces · single blue accent · Inter only · denser type · tighter radii.

   Authoring rules (ADR-0011):
   - No raw hex outside this file. Components reference tokens only.
   - Dark is the default; light is an explicit opt-in via [data-theme="light"].
   - Component heights flow from --component-base / --component-sm / --component-lg.
*/

:root {
  color-scheme: dark;

  /* Surfaces — dark, default */
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-soft: #1f242c;
  --bg-quiet: #11161d;
  --bg-overlay: rgba(2, 6, 13, 0.62);

  /* Text */
  --text: #e6edf3;
  --text-2: #9aa4b2;
  --text-3: #8b949e;
  --text-inv: #0d1117;

  /* Lines */
  --border: #2a313c;
  --border-strong: #3d4654;
  --divider: #1f242c;

  /* Accent — operational blue (not Basecamp orange) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #142546;
  --accent-fg: #ffffff;
  --link: #58a6ff;

  /* Utility rail — bound to incident priority semantics
     pink=critical · orange=high · yellow=medium · teal=low · purple=investigation · green=resolved
  */
  --utility-orange: #f97316;
  --utility-orange-soft: #3a1f0e;
  --utility-yellow: #eab308;
  --utility-yellow-soft: #332813;
  --utility-pink: #ec4899;
  --utility-pink-soft: #3b1730;
  --utility-purple: #8b5cf6;
  --utility-purple-soft: #261a44;
  --utility-teal: #14b8a6;
  --utility-teal-soft: #0e2e2c;
  --utility-green: #22c55e;
  --utility-green-soft: #112d1d;

  /* Status (semantic) */
  --success: #22c55e;
  --success-soft: #112d1d;
  --warn: #eab308;
  --warn-soft: #332813;
  --danger: #ef4444;
  --danger-soft: #391616;
  --info: #38bdf8;
  --info-soft: #0f2839;

  /* Radii — tighter, more enterprise */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-xl: 8px;
  --r-pill: 999px;

  /* Spacing — denser workhorse than crisp */
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 8px;
  --s-4: 12px;
  --s-5: 16px;
  --s-6: 20px;
  --s-7: 28px;
  --s-8: 40px;

  /* Shadows — dark-first relies on borders + bg-elev lift rather than glow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px -8px rgba(0, 0, 0, 0.7);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.35);

  /* Type — Inter only */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Type scale — tightened one step vs crisp */
  --t-11: 11px;
  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-15: 15px;
  --t-16: 16px;
  --t-18: 18px;
  --t-20: 20px;
  --t-22: 22px;
  --t-24: 24px;
  --t-30: 30px;
  --t-40: 40px;

  /* Component height ladder — single ladder for Capture + Console */
  --component-base: 36px;
  --component-sm: 28px;
  --component-lg: 44px;

  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-13);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

*, *::before, *::after { box-sizing: border-box; }

/* OS dark preference re-affirms dark tokens when no explicit [data-theme] is set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
  }
}

/* Explicit dark override — equivalent to the dark-first :root, kept verbose for clarity. */
:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-soft: #1f242c;
  --bg-quiet: #11161d;
  --text: #e6edf3;
  --text-2: #9aa4b2;
  --text-3: #8b949e;
  --text-inv: #0d1117;
  --border: #2a313c;
  --border-strong: #3d4654;
  --divider: #1f242c;
  --link: #58a6ff;
  color-scheme: dark;
}

/* Explicit light opt-in. The single Basecamp echo in command. */
:root[data-theme="light"] {
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --bg-soft: #f3f4f6;
  --bg-quiet: #ececea;
  --bg-overlay: rgba(10, 10, 10, 0.45);
  --text: #0d1117;
  --text-2: #475569;
  --text-3: #6b7280;
  --text-inv: #ffffff;
  --border: #e2e4e8;
  --border-strong: #cbd0d8;
  --divider: #ececea;
  --accent-soft: #dbe6ff;
  --link: #2563eb;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 32px -10px rgba(0, 0, 0, 0.18);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.22);
  color-scheme: light;
}

/* ===================== Typography ===================== */
h1, h2, h3, h4 { margin: 0; }
.h-display { font-size: var(--t-40); line-height: 1.05; letter-spacing: -0.03em; font-weight: var(--weight-bold); }
.h-1 { font-size: var(--t-30); line-height: 1.1; letter-spacing: -0.025em; font-weight: var(--weight-semibold); }
.h-2 { font-size: var(--t-22); line-height: 1.2; letter-spacing: -0.02em; font-weight: var(--weight-semibold); }
.h-3 { font-size: var(--t-18); line-height: 1.25; letter-spacing: -0.015em; font-weight: var(--weight-medium); }
.h-4 { font-size: var(--t-15); line-height: 1.3; font-weight: var(--weight-medium); letter-spacing: -0.005em; }
.h-5 { font-size: var(--t-13); line-height: 1.4; font-weight: var(--weight-medium); }
.text-lg { font-size: var(--t-15); line-height: 1.5; }
.text-md { font-size: var(--t-13); line-height: 1.5; }
.text-sm { font-size: var(--t-12); line-height: 1.45; }
.text-xs { font-size: var(--t-11); line-height: 1.4; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.eyebrow {
  font-size: var(--t-11);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: var(--weight-semibold);
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--component-base);
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: var(--t-13);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .05s;
  white-space: nowrap;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn--primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-soft); border-color: var(--text-3); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn--ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn--danger:hover { background: var(--danger); color: var(--accent-fg); border-color: var(--danger); }
.btn--sm { height: var(--component-sm); padding: 0 var(--s-3); font-size: var(--t-12); }
.btn--lg { height: var(--component-lg); padding: 0 var(--s-5); font-size: var(--t-14); }
.btn--icon { width: var(--component-base); padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Subtle command-bar key hint */
.kbd {
  display: inline-grid; place-items: center;
  height: 18px; min-width: 18px; padding: 0 var(--s-2);
  border-radius: var(--r-xs);
  background: var(--bg-soft); border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--t-11);
}

/* ===================== Inputs ===================== */
.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.field label { font-size: var(--t-12); font-weight: var(--weight-medium); color: var(--text); }
.field .hint { font-size: var(--t-11); color: var(--text-3); }
.grid-span-2 { grid-column: span 2 / span 2; }

.input, .select, .textarea {
  width: 100%;
  height: var(--component-base);
  padding: 0 var(--s-3);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: var(--t-13);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 80px; padding: var(--s-3); resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.input--invalid, .select--invalid, .textarea--invalid { border-color: var(--danger); }
.file-input { padding-top: 8px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'><path d='M3 4.5 6 8l3-3.5' stroke='%239aa4b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--s-3) center;
  background-size: 12px;
  padding-right: 28px;
}

.checkbox, .radio { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--t-13); }
.checkbox input, .radio input {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elev);
  border-radius: var(--r-xs);
  display: grid; place-items: center; cursor: pointer;
  transition: background .12s, border-color .12s; margin: 0;
}
.radio input { border-radius: 50%; }
.checkbox input:checked, .radio input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after { content: ""; width: 9px; height: 9px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'><path d='M2 5.5 4 7.5 8 3' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-size: contain; }
.radio input:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fg); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--t-13); }
.toggle input { appearance: none; width: 30px; height: 18px; background: var(--border-strong); border-radius: var(--r-pill); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--bg-elev); border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(12px); }

/* Checkbox/radio labels + grouped fields (BC2026::FormCheckbox) */
.checkbox-label, .radio-label { color: var(--text); font-weight: var(--weight-regular); }
.checkbox.is-disabled, .radio.is-disabled { opacity: 0.5; cursor: not-allowed; }
.field--group { border: 0; padding: 0; margin: 0; min-width: 0; }
.field--group > legend { font-size: var(--t-12); font-weight: var(--weight-medium); color: var(--text); padding: 0; margin-bottom: var(--s-2); }
.field-group-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 560px) { .field-group-items { grid-template-columns: 1fr; } }
.field .hint--error { color: var(--danger); }
.field--invalid .checkbox input, .field--invalid .radio input { border-color: var(--danger); }

.stack-xs { display: flex; flex-direction: column; gap: var(--s-1); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-md { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s-5); }

.form { max-width: 920px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.console-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.console-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.console-rich-text-input trix-toolbar {
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--bg-soft);
}
.console-rich-text-input trix-editor {
  min-height: 180px;
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--bg-elev);
  color: var(--text);
}
.console-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
  max-width: 920px;
}
.console-choice-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-height: 180px;
  color: inherit;
  text-decoration: none;
}
.console-choice-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
@media (max-width: 760px) {
  .form-grid,
  .console-form-grid,
  .console-choice-grid { grid-template-columns: 1fr; }
}

/* ===================== Cards ===================== */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); gap: var(--s-4); }
.card-title { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0; letter-spacing: -0.005em; }
.card-sub { font-size: var(--t-12); color: var(--text-2); margin-top: var(--s-1); }
.card-body { min-width: 0; }
.card-body > *:first-child { margin-top: 0; }
.card-body > *:last-child { margin-bottom: 0; }

/* ===================== Badges ===================== */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  font-size: var(--t-11);
  font-weight: var(--weight-medium);
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--border);
  line-height: 1.5;
}
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge--orange { background: var(--utility-orange-soft); color: var(--utility-orange); border-color: transparent; }
.badge--yellow { background: var(--utility-yellow-soft); color: var(--utility-yellow); border-color: transparent; }
.badge--pink { background: var(--utility-pink-soft); color: var(--utility-pink); border-color: transparent; }
.badge--purple { background: var(--utility-purple-soft); color: var(--utility-purple); border-color: transparent; }
.badge--teal { background: var(--utility-teal-soft); color: var(--utility-teal); border-color: transparent; }
.badge--green { background: var(--utility-green-soft); color: var(--utility-green); border-color: transparent; }
/* Semantic priority tones — bound to the utility rail per
   docs/references/priority-tokens.md (pink=critical, orange=high,
   yellow=medium, teal=low, purple=investigation, green=resolved). */
.badge--critical      { background: var(--utility-pink-soft);   color: var(--utility-pink);   border-color: transparent; }
.badge--high          { background: var(--utility-orange-soft); color: var(--utility-orange); border-color: transparent; }
.badge--medium        { background: var(--utility-yellow-soft); color: var(--utility-yellow); border-color: transparent; }
.badge--low           { background: var(--utility-teal-soft);   color: var(--utility-teal);   border-color: transparent; }
.badge--investigation { background: var(--utility-purple-soft); color: var(--utility-purple); border-color: transparent; }
.badge--resolved      { background: var(--utility-green-soft);  color: var(--utility-green);  border-color: transparent; }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ===================== Avatars ===================== */
.avatar {
  width: var(--component-sm); height: var(--component-sm);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: var(--t-11);
  font-weight: var(--weight-semibold);
  display: inline-grid; place-items: center;
  border: 2px solid var(--bg-elev);
  flex-shrink: 0;
}
.avatar--sm { width: 22px; height: 22px; font-size: var(--t-11); }
.avatar--lg { width: var(--component-lg); height: var(--component-lg); font-size: var(--t-13); }
.avatar--tone-1 { background: var(--utility-yellow-soft); color: var(--utility-yellow); }
.avatar--tone-2 { background: var(--utility-purple-soft); color: var(--utility-purple); }
.avatar--tone-3 { background: var(--utility-pink-soft); color: var(--utility-pink); }
.avatar--tone-4 { background: var(--utility-teal-soft); color: var(--utility-teal); }
.avatar--tone-5 { background: var(--utility-green-soft); color: var(--utility-green); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack .avatar--more { background: var(--bg-elev); color: var(--text-2); border-color: var(--bg-elev); }
.avatar-line { display: inline-flex; align-items: center; gap: var(--s-3); min-width: 0; }
.avatar-line > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.avatar-line strong,
.avatar-line h1,
.avatar-line p { margin: 0; }
.avatar-line .text-muted { font-size: var(--t-12); }

/* ===================== Top tabs ===================== */
.nav-tabs { display: flex; align-items: center; gap: var(--s-1); }
.nav-tab {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-13);
  font-weight: var(--weight-medium);
  color: var(--text-2);
  border-radius: var(--r-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-tab:hover { color: var(--text); background: var(--bg-soft); }
.nav-tab.is-active { background: var(--text); color: var(--text-inv); }
.nav-tab .icon { width: 14px; height: 14px; opacity: 0.7; }

/* ===================== Tables (dense) ===================== */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-12); }
.table th {
  text-align: left;
  font-weight: var(--weight-medium);
  color: var(--text-3);
  font-size: var(--t-11);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg-soft); }
.table-wrap { width: 100%; overflow-x: auto; }
.table-link { color: var(--text); font-weight: var(--weight-medium); text-decoration: none; }
.table-link:hover { color: var(--accent); text-decoration: underline; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; }
.row-actions form { margin: 0; }

.stores-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  gap: var(--s-3);
  align-items: end;
}
.stores-filter-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 160px;
  text-align: center;
  color: var(--text-2);
}

.detail-list { display: flex; flex-direction: column; margin: 0; }
.detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: var(--s-4);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--divider);
}
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--text-3); font-size: var(--t-12); font-weight: var(--weight-medium); }
.detail-row dd { margin: 0; min-width: 0; color: var(--text); }

.user-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--s-5);
  align-items: start;
}
.user-side { min-width: 0; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }

@media (max-width: 860px) {
  .stores-filter-form,
  .user-layout { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 1fr; gap: var(--s-1); }
}

/* ===================== Lists ===================== */
.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--divider); }
.list-item:last-child { border-bottom: 0; }

/* ===================== Toasts ===================== */
.toast { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-md); max-width: 400px; }
.toast .toast-title { font-weight: var(--weight-semibold); font-size: var(--t-13); }
.toast .toast-body { font-size: var(--t-12); color: var(--text-2); margin-top: var(--s-1); }
.toast--success { border-left: 3px solid var(--success); }
.toast--warn { border-left: 3px solid var(--warn); }
.toast--danger { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--info); }

/* ===================== Modal ===================== */
.modal-shell { background: var(--bg-overlay); padding: var(--s-7); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg-elev); border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; padding: var(--s-6); }
.modal h3 { font-size: var(--t-16); font-weight: var(--weight-semibold); margin: 0 0 var(--s-2); }
.modal p { color: var(--text-2); margin: 0 0 var(--s-6); font-size: var(--t-13); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); }

/* ===================== Empty ===================== */
.empty { text-align: center; padding: var(--s-8) var(--s-6); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-soft); }
.empty .empty-mark { width: var(--component-lg); height: var(--component-lg); border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--border); display: inline-grid; place-items: center; margin-bottom: var(--s-4); color: var(--text-3); }
.empty h4 { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0 0 var(--s-2); }
.empty p { color: var(--text-2); font-size: var(--t-13); margin: 0 0 var(--s-4); max-width: 36ch; margin-inline: auto; }

/* ===================== App shell ===================== */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}
.app-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-3);
  display: flex;
  flex-direction: column;
}
.app-side .brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-5); font-weight: var(--weight-semibold); font-size: var(--t-13); }
.app-side .brand-mark { width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: var(--t-11); font-weight: var(--weight-bold); }
.app-side h5 { font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin: var(--s-4) var(--s-3) var(--s-2); font-weight: var(--weight-semibold); }
.app-side a { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--t-13); }
.app-side a:hover { background: var(--bg-soft); color: var(--text); }
.app-side a.is-active { background: var(--bg-quiet); color: var(--text); font-weight: var(--weight-medium); }
.app-side a svg { width: 14px; height: 14px; opacity: 0.7; }
.app-side a .count { margin-left: auto; font-size: var(--t-11); color: var(--text-3); font-family: var(--font-mono); }

.app-main { padding: var(--s-6) var(--s-7); }
.app-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); }
.app-h h1 { font-size: var(--t-22); font-weight: var(--weight-semibold); letter-spacing: -0.015em; margin: 0; }
.app-h p { color: var(--text-2); margin: var(--s-1) 0 0; font-size: var(--t-13); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
.stat { padding: var(--s-4); }
/* Legacy child-class form (raw .stat markup) */
.stat .label { font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: var(--weight-medium); }
.stat .value { font-size: var(--t-22); font-weight: var(--weight-semibold); letter-spacing: -0.02em; margin-top: var(--s-1); font-variant-numeric: tabular-nums; }
.stat .delta { font-size: var(--t-11); color: var(--success); margin-top: var(--s-1); font-family: var(--font-mono); }
.stat .delta.neg { color: var(--danger); }
/* BEM form emitted by BC2026::Stat (and used by raw stat markup, e.g. geo/index) */
.stat-head { display: flex; align-items: center; gap: var(--s-3); }
.stat-label { font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: var(--weight-medium); margin: 0; }
.stat-value { font-size: var(--t-30); font-weight: var(--weight-semibold); letter-spacing: -0.02em; margin: var(--s-2) 0 0; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat--with-icon .stat-value { margin-top: var(--s-3); }
.stat-sub { font-size: var(--t-12); color: var(--text-2); margin: var(--s-1) 0 0; }
.stat-delta { font-size: var(--t-11); margin: var(--s-1) 0 0; font-family: var(--font-mono); color: var(--text-2); }
.stat-delta--pos { color: var(--success); }
.stat-delta--neg { color: var(--danger); }
.stat-delta--neutral { color: var(--text-2); }
.stat-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--component-sm); height: var(--component-sm);
  border-radius: var(--r-md);
  background: var(--bg-soft); color: var(--text-2);
}
.stat-icon .icon { width: 18px; height: 18px; }
.stat-icon--accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon--pink   { background: var(--utility-pink-soft);   color: var(--utility-pink); }
.stat-icon--orange { background: var(--utility-orange-soft); color: var(--utility-orange); }
.stat-icon--yellow { background: var(--utility-yellow-soft); color: var(--utility-yellow); }
.stat-icon--teal   { background: var(--utility-teal-soft);   color: var(--utility-teal); }
.stat-icon--purple { background: var(--utility-purple-soft); color: var(--utility-purple); }
.stat-icon--green  { background: var(--utility-green-soft);  color: var(--utility-green); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-4); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Priority distribution rail (dashboard) — utility-rail severity binding */
.priority-rail { display: flex; gap: 2px; height: 10px; margin-top: var(--s-4); border-radius: var(--r-pill); overflow: hidden; }
.priority-rail-seg { display: block; min-width: 4px; border-radius: var(--r-xs); }
.priority-rail-seg--pink   { background: var(--utility-pink); }
.priority-rail-seg--orange { background: var(--utility-orange); }
.priority-rail-seg--yellow { background: var(--utility-yellow); }
.priority-rail-seg--teal   { background: var(--utility-teal); }
.priority-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); list-style: none; padding: 0; margin: var(--s-4) 0 0; }
.priority-legend-item { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-12); color: var(--text-2); }
.priority-legend-count { font-family: var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; }
.priority-dot--pink   { background: var(--utility-pink); }
.priority-dot--orange { background: var(--utility-orange); }
.priority-dot--yellow { background: var(--utility-yellow); }
.priority-dot--teal   { background: var(--utility-teal); }

/* ===================== Capture surface ===================== */
.capture-home {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding: var(--s-5) var(--s-5) var(--s-7);
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
}
.safe-area-top { padding-top: max(var(--s-5), env(safe-area-inset-top)); }
.safe-area-bottom { padding-bottom: max(var(--s-7), env(safe-area-inset-bottom)); }
body.capture-surface { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

.capture-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.capture-bottom-nav-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}
.capture-bottom-nav-li { display: flex; }
.capture-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  width: 100%;
  min-height: 56px;
  padding: var(--s-3) var(--s-2);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--t-11);
  font-weight: var(--weight-medium);
  border-top: 2px solid transparent;
}
.capture-bottom-nav-item:hover { color: var(--text); }
.capture-bottom-nav-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.capture-bottom-nav-item--active { color: var(--accent); border-top-color: var(--accent); }
.capture-bottom-nav-icon { display: block; }
.capture-bottom-nav-label { line-height: 1; }

.capture-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.capture-topbar-meta { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.capture-topbar-org { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0; letter-spacing: -0.005em; }
.capture-topbar-shift { font-size: var(--t-12); color: var(--text-2); margin: 0; }

.capture-sos {
  min-height: var(--component-lg);
  min-width: var(--component-lg);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
}

.capture-greeting { display: flex; flex-direction: column; gap: var(--s-2); }
.capture-greeting-title { font-size: var(--t-22); font-weight: var(--weight-semibold); margin: 0; letter-spacing: -0.015em; }
.capture-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--t-12);
  color: var(--text-2);
}
.capture-status-item { display: inline-flex; align-items: center; gap: var(--s-2); }
.capture-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
.capture-status-offline.is-offline .capture-status-dot { background: var(--text-3); }
.capture-status-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--border-strong); }

.bulletin-card { display: block; text-decoration: none; color: inherit; }
.card--warning {
  background: var(--utility-yellow-soft);
  border-color: var(--utility-yellow);
}
.bulletin-card-eyebrow {
  font-size: var(--t-11);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--utility-yellow);
  margin: 0 0 var(--s-1);
  font-weight: var(--weight-semibold);
}
.bulletin-card-title { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0; }
.bulletin-card-meta { font-size: var(--t-12); color: var(--text-2); margin: var(--s-1) 0 0; }

.capture-record { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); }
.capture-record-cta {
  width: 100%;
  min-height: 56px;
  height: auto;
  font-size: var(--t-16);
  font-weight: var(--weight-semibold);
}
.capture-record-alt { align-self: center; }

.capture-section { display: flex; flex-direction: column; gap: var(--s-3); }
.capture-chat-error { margin-bottom: var(--s-3); max-width: none; }
.capture-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4);
}
.capture-section-title {
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: var(--weight-semibold); margin: 0;
}
.capture-section-link { font-size: var(--t-12); color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

.capture-drafts-list, .capture-recent-list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 var(--s-4); }
.capture-empty { color: var(--text-3); font-size: var(--t-13); margin: 0; }
.capture-touch-target { min-height: var(--component-lg); }

/* Capture home — list item links */
.list-item-link { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-decoration: none; color: inherit; }
.list-item-link:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: var(--t-14); font-weight: var(--weight-medium); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: var(--t-12); color: var(--text-2); margin: var(--s-1) 0 0; }

/* Capture home — offline-sync chip placeholder (#137) */
.capture-sync-chip { align-self: flex-start; }
.capture-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.capture-sync-chip.is-pending .capture-sync-dot { background: var(--warn); }
.capture-sync-chip.is-offline .capture-sync-dot { background: var(--text-3); }

/* Capture home — primary CTA card stack (#126) */
.capture-cta-stack { display: flex; flex-direction: column; gap: var(--s-3); }
.capture-cta-card {
  display: flex; align-items: center; gap: var(--s-4);
  min-height: var(--component-lg); padding: var(--s-4);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text);
  transition: border-color .12s, background .12s;
}
.capture-cta-card:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.capture-cta-card:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.capture-cta-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--component-lg); height: var(--component-lg);
  border-radius: var(--r-md); background: var(--bg-soft); color: var(--text-2);
}
.capture-cta-icon--accent { background: var(--accent-soft); color: var(--accent); }
.capture-cta-icon--purple { background: var(--utility-purple-soft); color: var(--utility-purple); }
.capture-cta-icon--teal { background: var(--utility-teal-soft); color: var(--utility-teal); }
.capture-cta-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.capture-cta-title { font-size: var(--t-15); font-weight: var(--weight-semibold); }
.capture-cta-sub { font-size: var(--t-12); color: var(--text-2); }
.capture-cta-chevron { color: var(--text-3); flex-shrink: 0; display: inline-grid; place-items: center; }

/* Capture home — bulletins card */
.capture-bulletins-card {
  display: flex; align-items: center; gap: var(--s-4); min-height: var(--component-lg);
  text-decoration: none; color: var(--text);
}
.capture-bulletins-card:hover { background: var(--bg-soft); }
.capture-bulletins-card:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.capture-bulletins-icon {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--component-lg); height: var(--component-lg);
  border-radius: var(--r-md); background: var(--utility-yellow-soft); color: var(--utility-yellow);
}
.capture-bulletins-count { flex-shrink: 0; }

/* Capture incident-show (#127) */
.capture-report-show { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-5) var(--s-5) var(--s-7); max-width: 640px; margin: 0 auto; }
.capture-report-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.capture-report-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin: 0; }
.capture-report-meta dt { font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: var(--weight-medium); }
.capture-report-meta dd { font-size: var(--t-14); margin: var(--s-1) 0 0; }
.capture-report-w3w { font-family: var(--font-mono); color: var(--accent); }
.capture-report-section { display: flex; flex-direction: column; gap: var(--s-3); }
.capture-report-heading {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: var(--weight-semibold); margin: 0;
}
.capture-report-heading .icon { color: var(--text-3); }
.capture-report-description { font-size: var(--t-14); color: var(--text); margin: 0; line-height: 1.55; }

/* Mini-map (#127) — fixed 300px, no chrome */
.capture-mini-map { height: 300px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg-soft); }
.capture-mini-map-canvas { width: 100%; height: 100%; }

/* Persons of interest */
.capture-subjects-list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 var(--s-4); }
.capture-subject-item { gap: var(--s-3); }
.capture-subject-avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: var(--component-sm); height: var(--component-sm); border-radius: 50%;
  background: var(--utility-purple-soft); color: var(--utility-purple);
}

/* Photos grid (also resolves #105's missing .capture-photo-grid) */
.capture-photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.capture-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
@media (max-width: 380px) { .capture-photo-grid { grid-template-columns: repeat(2, 1fr); } .capture-report-meta { grid-template-columns: 1fr; } }

/* ─────────────────────────────────────────────────────────────────────────
   Capture shared page shell — bulletins / checklists / notifications
   (UX audit #76 #77 #78: surfaces shipped unstyled; wire the tokens)
   ───────────────────────────────────────────────────────────────────── */
.capture-page { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-5) var(--s-5) var(--s-7); max-width: 640px; margin: 0 auto; }
.capture-page-header { display: flex; flex-direction: column; gap: var(--s-2); }
.capture-page-title { font-size: var(--t-22); font-weight: var(--weight-semibold); letter-spacing: -0.01em; margin: 0; }
.capture-page-subtitle { font-size: var(--t-13); color: var(--text-2); margin: 0; }
.capture-back-link {
  align-self: flex-start; display: inline-flex; align-items: center; gap: var(--s-1);
  min-height: 44px; font-size: var(--t-13); color: var(--accent); text-decoration: none;
}
.capture-back-link:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }
.capture-list { display: flex; flex-direction: column; gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
.capture-list-item { margin: 0; }

/* Bulletins — detail (#76) */
.capture-bulletin-detail .bulletin-card-eyebrow { margin-bottom: var(--s-1); }
.capture-bulletin-body { font-size: var(--t-15); line-height: 1.6; color: var(--text); }
.capture-bulletin-body > * { margin: 0 0 var(--s-4); }
.capture-bulletin-body > *:last-child { margin-bottom: 0; }
.capture-bulletin-ack {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-pill);
  font-size: var(--t-13); font-weight: var(--weight-medium);
  background: var(--success-soft); color: var(--success);
}

/* Checklists — index card + detail items (#77) */
.capture-checklist-card { display: block; text-decoration: none; color: inherit; }
.capture-checklist-title { font-size: var(--t-15); font-weight: var(--weight-semibold); margin: 0; }
.capture-checklist-meta { font-size: var(--t-12); color: var(--text-2); margin: var(--s-1) 0 0; }
.capture-checklist-items { display: flex; flex-direction: column; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.capture-checklist-item {
  display: flex; flex-direction: column; justify-content: center; gap: var(--s-1);
  padding: var(--s-3) var(--s-4); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.capture-checklist-item[data-required="true"] { border-left: 3px solid var(--accent); }
.capture-checklist-item-title { font-size: var(--t-14); font-weight: var(--weight-medium); margin: 0; }
.capture-checklist-item-type { font-size: var(--t-12); color: var(--text-2); margin: 0; }

/* Notifications — list (#78). Unread emphasis is reinforced by a text badge in
   the markup so the state is never conveyed by colour alone. */
.capture-notification-title { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0; }
.capture-notification-body { font-size: var(--t-13); color: var(--text-2); margin: var(--s-2) 0 0; line-height: 1.5; }
.capture-notification-meta { font-size: var(--t-12); color: var(--text-3); margin: var(--s-2) 0 0; }
.capture-notification .card-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }
.capture-notification--unread .card { border-left: 3px solid var(--accent); }
.capture-notification--read .capture-notification-title { font-weight: var(--weight-medium); color: var(--text-2); }
.capture-notification-flag {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 1px var(--s-2); border-radius: var(--r-pill);
  font-size: var(--t-11); font-weight: var(--weight-semibold);
  background: var(--accent-soft); color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Capture incident report form — progressive checklist (Direction 3).
   Collapsible section cards; required sections gate Declare via the
   capture-checklist Stimulus controller. Without JS everything renders
   expanded and Declare stays enabled (server validates).
   ───────────────────────────────────────────────────────────────────── */
.capture-report-form { display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-5) var(--s-5) var(--s-7); max-width: 640px; margin: 0 auto; }
.capture-reports { display: flex; flex-direction: column; gap: var(--s-4); padding-bottom: var(--s-6); }
.capture-reports-list { width: 100%; }
.capture-form { display: flex; flex-direction: column; gap: var(--s-4); }
.capture-checklist-form { gap: var(--s-3); }
.capture-checklist-form .form-input,
.capture-checklist-form .form-select,
.capture-checklist-form .form-textarea,
.capture-checklist-form input[type="text"],
.capture-checklist-form input[type="number"],
.capture-checklist-form select,
.capture-checklist-form textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
}
.capture-checklist-form textarea { resize: vertical; }
.capture-form-actions { display: flex; gap: var(--s-3); }
.capture-form-actions .btn { flex: 1; min-height: 44px; }

/* Sticky progress header */
.capture-check-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; gap: var(--s-2);
  margin: calc(var(--s-5) * -1) calc(var(--s-2) * -1) var(--s-2);
  padding: max(var(--s-4), env(safe-area-inset-top)) var(--s-2) var(--s-3);
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}
.capture-check-head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.capture-check-exit {
  display: inline-flex; align-items: center; gap: var(--s-1);
  min-height: 44px; color: var(--text-2); text-decoration: none;
  font-size: var(--t-13); font-weight: var(--weight-medium);
}
.capture-check-exit:hover { color: var(--text); }
.capture-check-exit:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }
.capture-check-w3w {
  padding: var(--s-1) var(--s-3); border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: var(--t-12); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}
.capture-meter { height: 5px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.capture-meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-pill); transition: width .25s ease; }
.capture-meter-label { font-size: var(--t-11); color: var(--text-3); font-weight: var(--weight-semibold); }

/* Section cards */
.capture-sec {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.capture-sec--required { border-left: 3px solid var(--accent); }
.capture-sec--required.is-complete { border-left-color: var(--success); }
.capture-sec-head {
  display: flex; align-items: center; gap: var(--s-4);
  width: 100%; min-height: 60px; padding: var(--s-4);
  background: none; border: 0; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.capture-sec-head:focus-visible { outline: none; box-shadow: inset var(--shadow-focus); }
.capture-sec-tick {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px dashed var(--border-strong); color: transparent;
}
.capture-sec.is-complete .capture-sec-tick { border: 0; background: var(--success-soft); color: var(--success); }
.capture-sec-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.capture-sec-name {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-15); font-weight: var(--weight-semibold);
}
.capture-sec-opt {
  font-size: var(--t-11); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3);
}
.capture-sec-sum {
  font-size: var(--t-12); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.capture-sec-chevron { flex: none; color: var(--text-3); transition: transform .18s ease; }
.capture-sec.is-open .capture-sec-chevron { transform: rotate(180deg); }
.capture-sec-body { display: flex; flex-direction: column; gap: var(--s-4); padding: 0 var(--s-4) var(--s-5); }
/* Collapse only once the controller connects — no-JS keeps everything open */
.capture-checklist-ready .capture-sec:not(.is-open) .capture-sec-body { display: none; }

/* Type tiles + priority segments (radio-backed, big touch targets) */
.capture-hidden-input,
.capture-tile-input {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.capture-type-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3);
  border: 0; padding: 0; margin: 0; min-width: 0;
}
.capture-type-grid > legend { margin-bottom: var(--s-2); }
.capture-type-tile {
  position: relative; display: flex; align-items: center; gap: var(--s-3);
  min-height: 52px; padding: var(--s-3) var(--s-4);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: var(--t-13); font-weight: var(--weight-semibold);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.capture-type-tile .icon { color: var(--text-2); flex: none; }
.capture-type-tile:hover { border-color: var(--border-strong); }
.capture-type-tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.capture-type-tile:has(input:checked) .icon { color: var(--accent); }
.capture-type-tile:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.capture-priority-seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.capture-priority-seg > legend { margin-bottom: var(--s-2); }
.capture-priority-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.capture-priority-option {
  position: relative; display: grid; place-items: center;
  min-height: 44px; padding: var(--s-2);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text-2); font-size: var(--t-12); font-weight: var(--weight-semibold);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.capture-priority-option:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.capture-priority-option[data-priority="low"]:has(input:checked)      { background: var(--utility-teal-soft);   color: var(--utility-teal);   border-color: var(--utility-teal); }
.capture-priority-option[data-priority="medium"]:has(input:checked)   { background: var(--utility-yellow-soft); color: var(--utility-yellow); border-color: var(--utility-yellow); }
.capture-priority-option[data-priority="high"]:has(input:checked)     { background: var(--utility-orange-soft); color: var(--utility-orange); border-color: var(--utility-orange); }
.capture-priority-option[data-priority="critical"]:has(input:checked) { background: var(--utility-pink-soft);   color: var(--utility-pink);   border-color: var(--utility-pink); }

/* Voice row */
.capture-mic-button {
  width: 36px; height: 36px; min-height: 36px; padding: 0;
  display: inline-grid; place-items: center; flex: none;
}
.capture-mic-button--lg { width: 56px; height: 56px; min-height: 56px; border-radius: 50%; }
.capture-mic-button.is-recording {
  color: var(--danger); border-color: var(--danger);
  background: var(--danger-soft);
}
.capture-voice-row { display: flex; align-items: center; gap: var(--s-4); }
.capture-voice-meta { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.capture-voice-timer {
  min-width: 3ch; color: var(--text-3);
  font-family: var(--font-mono); font-size: var(--t-12);
}
.capture-voice-status { margin: 0; }
.capture-voice-status[data-state="success"] { color: var(--success); }
.capture-voice-status[data-state="error"] { color: var(--danger); }
.capture-voice-status[data-state="busy"] { color: var(--accent); }

/* Location section internals */
.capture-location-status {
  margin: 0; color: var(--text-2); font-size: var(--t-12); line-height: 1.4;
}
.capture-location-status[data-state="success"] { color: var(--success); }
.capture-location-status[data-state="error"] { color: var(--danger); }
.capture-location-status[data-state="busy"] { color: var(--accent); }
.capture-location-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.capture-location-actions .btn { min-height: 44px; }
.capture-location-map {
  width: 100%; min-height: 220px; border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden; background: var(--bg-soft);
}
.capture-location-coordinates {
  margin: 0; color: var(--text-2); font-size: var(--t-12);
  font-family: var(--font-mono);
}

/* Camera-first evidence */
.capture-cam-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--s-3);
  min-height: 56px; width: 100%;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  background: var(--bg); color: var(--text);
  font-size: var(--t-14); font-weight: var(--weight-semibold); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.capture-cam-btn:hover { border-color: var(--text-3); background: var(--bg-soft); }
.capture-cam-btn:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.capture-thumbs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2);
  list-style: none; margin: 0; padding: 0;
}
.capture-thumb {
  aspect-ratio: 1; border-radius: var(--r-sm); border: 1px solid var(--border);
  overflow: hidden; background: var(--bg-soft);
}
.capture-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.capture-thumb--file {
  display: grid; place-items: center; padding: var(--s-2);
  font-size: var(--t-11); color: var(--text-2); word-break: break-all; text-align: center;
}

/* Follow-up prompt + subject fields */
.capture-prompt { display: flex; flex-direction: column; gap: var(--s-3); }
.capture-prompt-question { font-size: var(--t-14); }
.capture-prompt-actions { display: flex; gap: var(--s-3); align-items: stretch; }
.capture-prompt-actions .form-select { flex: 1; }
.capture-prompt-actions .btn { flex: none; min-height: 44px; }
.capture-subject-fields { display: flex; flex-direction: column; gap: var(--s-3); }

/* Declaration + sticky footer */
.capture-draft-summary { display: flex; flex-direction: column; gap: var(--s-2); }
.capture-draft-text { margin: 0; font-size: var(--t-13); color: var(--text-2); line-height: 1.55; }
.capture-declare-box {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-4); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  font-size: var(--t-13); line-height: 1.5; color: var(--text-2); cursor: pointer;
}
.capture-declare-box input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 1px; flex: none; }
.capture-check-foot {
  position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; flex-direction: column; gap: var(--s-2);
  margin: var(--s-2) calc(var(--s-2) * -1) 0;
  padding: var(--s-3) var(--s-2);
  background: var(--bg); border-top: 1px solid var(--divider);
}
.capture-check-reason {
  margin: 0; text-align: center;
  font-size: var(--t-11); color: var(--text-3); font-weight: var(--weight-medium);
}
.capture-answer-form { display: none; }

@media (max-width: 420px) {
  .capture-priority-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* "How to report" chooser (#74) — two equal-weight cards, no visual bias */
.capture-choose { display: flex; flex-direction: column; gap: var(--s-4); padding-bottom: var(--s-6); }
.capture-choose-actions { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-3); }

/* ─────────────────────────────────────────────────────────────────────────
   AI Reporter conversation (#75) — chat surface shipped unstyled.
   Message bubbles are role-distinct AND AA-contrast (white-on-accent ≈ 5.2:1,
   text-on-bg-soft well above 4.5:1); speaker is also labelled in the markup.
   ───────────────────────────────────────────────────────────────────── */
.capture-conversation { display: flex; flex-direction: column; gap: var(--s-4); padding-bottom: var(--s-6); }
.capture-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.capture-chat-messages { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4); max-height: 52vh; overflow-y: auto; }
.capture-chat-messages > div { display: flex; flex-direction: column; gap: var(--s-4); }
.capture-chat-message { display: flex; flex-direction: column; max-width: 82%; gap: var(--s-1); }
.capture-chat-message--user { align-self: flex-end; align-items: flex-end; }
.capture-chat-message--assistant { align-self: flex-start; align-items: flex-start; }
.capture-chat-bubble { padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); }
.capture-chat-message--assistant .capture-chat-bubble {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-bottom-left-radius: var(--r-xs);
}
.capture-chat-message--user .capture-chat-bubble {
  background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: var(--r-xs);
}
.capture-chat-text { margin: 0; font-size: var(--t-14); line-height: 1.5; white-space: pre-wrap; }
.capture-chat-meta { margin: var(--s-1) 0 0; font-size: var(--t-11); opacity: 0.85; }
.capture-chat-time { font-size: var(--t-11); color: var(--text-3); margin: 0; }
.capture-chat-composer { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); border-top: 1px solid var(--border); background: var(--bg-elev); }
.capture-chat-form { display: flex; flex-direction: column; gap: var(--s-3); }
.capture-chat-input { width: 100%; resize: vertical; }
.capture-chat-actions { display: flex; align-items: center; gap: var(--s-3); }
.capture-chat-actions .btn { min-height: 44px; }
.capture-chat-actions .btn[type="submit"] { margin-left: auto; }
.capture-chat-status { display: flex; align-items: center; gap: var(--s-2); flex: 1; min-width: 0; }
.capture-chat-status-text { font-size: var(--t-12); color: var(--text-2); }
.capture-chat-status-text.is-active { color: var(--accent); }
.capture-chat-status-text.is-done { color: var(--success); }
.capture-chat-status-text.is-error { color: var(--danger); }
.capture-chat-timer { font-size: var(--t-12); color: var(--danger); font-variant-numeric: tabular-nums; }
.capture-chat-timer.is-hidden { display: none; }
.capture-chat-actions .btn.is-recording { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.capture-chat-complete { padding: var(--s-4); border-top: 1px solid var(--border); }
.capture-chat-complete .btn { width: 100%; }

/* Conversation — extracted fields panel (#75) */
.capture-fields { display: flex; flex-direction: column; gap: var(--s-3); margin: 0; padding: var(--s-4); }
.capture-fields-row { display: grid; grid-template-columns: 104px 1fr; gap: var(--s-3); align-items: baseline; }
.capture-fields-label { font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: var(--weight-medium); margin: 0; }
.capture-fields-value { font-size: var(--t-14); color: var(--text); margin: 0; word-break: break-word; }
.capture-fields-flags { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0 var(--s-4) var(--s-4); padding: 0; }
.capture-fields-flag { display: inline-flex; align-items: center; padding: var(--s-1) var(--s-3); border-radius: var(--r-pill); font-size: var(--t-11); font-weight: var(--weight-medium); background: var(--warn-soft); color: var(--warn); }
.capture-fields-progress { padding: var(--s-4); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-2); }
.capture-fields-progress-meta { display: flex; justify-content: space-between; font-size: var(--t-12); color: var(--text-2); }
.capture-fields-progress-bar { height: 6px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.capture-fields-progress-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.2s ease; }
.capture-fields-progress-note { font-size: var(--t-12); color: var(--text-3); margin: 0; }

/* Conversation — review/preview (#75) */
.capture-preview-summary { font-size: var(--t-14); line-height: 1.6; color: var(--text); }
.capture-preview-summary > * { margin: 0 0 var(--s-3); }
.capture-preview-summary > *:last-child { margin-bottom: 0; }
.capture-preview-value { font-size: var(--t-14); color: var(--text); margin: var(--s-1) 0 0; word-break: break-word; }

/* ─────────────────────────────────────────────────────────────────────────
   Accessibility utilities
   ───────────────────────────────────────────────────────────────────── */
.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-to-content {
  position: absolute; top: 0; left: 0; padding: var(--s-3) var(--s-4);
  background: var(--accent); color: var(--accent-fg);
  font-size: var(--t-13); font-weight: var(--weight-semibold); text-decoration: none;
  border-radius: 0 0 var(--r-sm) 0; transform: translateY(-110%);
  transition: transform 0.15s ease; z-index: 100;
}
.skip-to-content:focus { transform: translateY(0); outline: none; box-shadow: var(--shadow-focus); }

/* ─────────────────────────────────────────────────────────────────────────
   Navbar (BC2026::Navbar)
   ───────────────────────────────────────────────────────────────────── */
.app-h-brand { display: flex; flex-direction: column; gap: var(--s-1); }
.app-h-brand-link { color: inherit; text-decoration: none; }
.app-h-brand-title { font-size: var(--t-14); font-weight: var(--weight-semibold); color: var(--text); }
.app-h-brand-sub { font-size: var(--t-12); color: var(--text-2); }
.app-h-nav { display: flex; gap: var(--s-2); flex: 1; justify-content: center; }
.app-h-nav-link {
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-size: var(--t-13);
  color: var(--text-2); text-decoration: none;
}
.app-h-nav-link:hover { background: var(--bg-soft); color: var(--text); }
.app-h-nav-link.is-active { background: var(--bg-quiet); color: var(--text); font-weight: var(--weight-medium); }
.app-h-trailing { display: flex; align-items: center; gap: var(--s-3); }

/* ─────────────────────────────────────────────────────────────────────────
   Sidebar (BC2026::Sidebar)
   ───────────────────────────────────────────────────────────────────── */
.app-side-section { display: flex; flex-direction: column; gap: 1px; margin-bottom: var(--s-3); }
.app-side-heading {
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-3); margin: var(--s-4) var(--s-3) var(--s-1); font-weight: var(--weight-semibold);
}
.app-side-link { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: var(--t-13); }
.app-side-link:hover { background: var(--bg-soft); color: var(--text); }
.app-side-link.is-active { background: var(--bg-quiet); color: var(--text); font-weight: var(--weight-medium); }
.app-side-link-label { flex: 1; }
.app-side-actions {
  margin-top: auto;
  padding: var(--s-4) 0 0;
  border-top: 1px solid var(--border);
}
.app-side .app-side-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-fg);
  font-weight: var(--weight-semibold);
}
.app-side .app-side-cta:hover,
.app-side .app-side-cta.is-active {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}
.app-side .app-side-cta:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ─────────────────────────────────────────────────────────────────────────
   Breadcrumb (BC2026::Breadcrumb)
   ───────────────────────────────────────────────────────────────────── */
.crumbs { font-size: var(--t-12); color: var(--text-2); }
.crumbs-list { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.crumbs-item { display: inline-flex; align-items: center; gap: var(--s-1); }
.crumbs-link { color: var(--text-2); text-decoration: none; }
.crumbs-link:hover { color: var(--text); text-decoration: underline; }
.crumbs-current { color: var(--text); font-weight: var(--weight-medium); }
.crumbs-sep { color: var(--text-3); padding: 0 var(--s-1); }

/* ─────────────────────────────────────────────────────────────────────────
   LoadingState (BC2026::LoadingState)
   ───────────────────────────────────────────────────────────────────── */
.loading { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text-2); font-size: var(--t-13); }
.loading-label { font-weight: var(--weight-medium); }
.loading-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: bc2026-spin 0.75s linear infinite;
}
@keyframes bc2026-spin { to { transform: rotate(360deg); } }
.loading--skeleton { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; }
.loading-skeleton { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; }
.loading-skeleton-line {
  display: block; height: 10px; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--bg-quiet) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%; animation: bc2026-shimmer 1.4s ease-in-out infinite;
}
.loading-skeleton-line:nth-child(odd) { width: 92%; }
.loading-skeleton-line:nth-child(even) { width: 78%; }
@keyframes bc2026-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─────────────────────────────────────────────────────────────────────────
   Pagination (BC2026::Pagination)
   ───────────────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-13); }
.pagination-list { display: flex; gap: var(--s-1); list-style: none; padding: 0; margin: 0; }
.pagination-item { display: inline-flex; }
.pagination-page, .pagination-step {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--component-sm); height: var(--component-sm); padding: 0 var(--s-3); border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-weight: var(--weight-medium);
  border: 1px solid transparent;
}
.pagination-page:hover, .pagination-step:hover { background: var(--bg-soft); color: var(--text); }
.pagination-page.is-current { background: var(--text); color: var(--text-inv); }
.pagination-step.is-disabled { color: var(--text-3); cursor: not-allowed; pointer-events: none; }
.pagination-gap { color: var(--text-3); padding: 0 var(--s-2); }

/* ─────────────────────────────────────────────────────────────────────────
   Alerts (used by capture/auth layouts)
   ───────────────────────────────────────────────────────────────────── */
.alert {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}
.alert--success {
  border-color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}
.alert--danger {
  border-color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}
.alert--warn {
  border-color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, var(--border));
}

/* ─────────────────────────────────────────────────────────────────────────
   Console AppShell (issue #125)
   Migrated from the retired bc2026.css: the #161 swap to bc2026-command.css
   left these shell/topbar/surface classes in the no-longer-required sheet,
   so the console shell rendered unstyled. They reference command tokens.
   Layout: 220px sidebar + topbar above main content; mobile collapses to a
   drawer with a dimmed backdrop.
   ───────────────────────────────────────────────────────────────────── */
.app-shell--with-side {
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "side topbar"
    "side main";
  min-height: 100vh;
  min-height: 100dvh;
}
.app-shell--with-side > .app-side          { grid-area: side; align-self: stretch; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.app-shell--with-side > .app-h--console    { grid-area: topbar; margin-bottom: 0; padding: var(--s-3) var(--s-7); border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.app-shell--with-side > .app-main          { grid-area: main; }
.app-shell--with-side > .app-shell-backdrop {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
  z-index: 25;
}

/* Active nav item uses --accent per command theme (issue #125 AC). */
.app-side-link.is-active,
.app-side a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

/* Topbar */
.app-h--console {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-5);
}
.app-h-menu {
  display: none;
  align-items: center; justify-content: center;
  width: var(--component-base); height: var(--component-base);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--text); cursor: pointer;
}
.app-h-menu:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.app-h-topbar-leading { display: flex; align-items: center; gap: var(--s-4); }
.app-h-topbar-actions { display: flex; align-items: center; gap: var(--s-3); justify-self: end; }

.topbar-button {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 30px; padding: 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--text-2);
  font: inherit; font-size: var(--t-13); font-weight: var(--weight-medium);
  cursor: pointer;
}
.topbar-button:hover { background: var(--bg-soft); color: var(--text); }
.topbar-button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.topbar-org-mark, .topbar-user-mark {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-fg);
  font-size: var(--t-11); font-weight: var(--weight-bold);
}
.topbar-caret { color: var(--text-3); font-size: var(--t-11); }
.topbar-search {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 30px; padding: 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg);
  min-width: 220px;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.topbar-search-input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font: inherit; font-size: var(--t-13); color: var(--text);
}
.topbar-search-input::placeholder { color: var(--text-3); }
.topbar-search-input:focus { outline: none; }
.topbar-kbd {
  font-family: var(--font-mono); font-size: var(--t-11);
  padding: 1px 5px; border: 1px solid var(--border); border-radius: var(--r-xs);
  color: var(--text-3); background: var(--bg-elev);
}
.topbar-icon-button { padding: 0; width: 30px; justify-content: center; position: relative; }

/* Topbar interactions (#134) */
.topbar-org-static { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-13); font-weight: var(--weight-medium); color: var(--text); }
.topbar-search { cursor: pointer; font: inherit; }
.topbar-search-placeholder { color: var(--text-3); }
.topbar-bell-dot {
  position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); border: 1px solid var(--bg-elev);
}
.topbar-dropdown { position: relative; }
.topbar-panel {
  position: absolute; top: calc(100% + var(--s-2)); right: 0; z-index: 40;
  min-width: 260px; padding: var(--s-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev); box-shadow: var(--shadow-lg);
}
.topbar-panel--user { min-width: 180px; }
.topbar-panel-head {
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: var(--weight-semibold);
  padding: var(--s-2) var(--s-3) var(--s-2);
}
.topbar-panel-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.topbar-panel-empty { padding: var(--s-4) var(--s-3); font-size: var(--t-12); color: var(--text-3); text-align: center; }
.topbar-panel-foot {
  display: block; text-align: center; padding: var(--s-2);
  font-size: var(--t-12); color: var(--accent); text-decoration: none;
  border-top: 1px solid var(--divider); margin-top: var(--s-1);
}
.topbar-panel-foot:hover { background: var(--bg-soft); }
.topbar-panel-form { margin: 0; }
.topbar-panel-item {
  display: block; width: 100%; text-align: left;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: var(--t-13); color: var(--text); text-decoration: none;
}
.topbar-panel-item:hover { background: var(--bg-soft); }
.topbar-panel-item--button { border: 0; background: transparent; font: inherit; cursor: pointer; }
.topbar-notification { border-bottom: 1px solid var(--divider); }
.topbar-notification:last-child { border-bottom: 0; }
.topbar-notification-link { display: flex; flex-direction: column; gap: 1px; padding: var(--s-2) var(--s-3); text-decoration: none; color: var(--text); }
.topbar-notification-link:hover { background: var(--bg-soft); }
.topbar-notification.is-unread .topbar-notification-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: var(--s-2);
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}
.topbar-notification-title { font-size: var(--t-13); font-weight: var(--weight-medium); }
.topbar-notification-meta { font-size: var(--t-11); color: var(--text-3); }

/* Global search palette (#134) */
.topbar-search-palette { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding-top: 12vh; }
.topbar-search-palette[hidden] { display: none; }
.topbar-search-backdrop { position: absolute; inset: 0; background: var(--bg-overlay); }
.topbar-search-dialog {
  position: relative; width: min(560px, calc(100% - var(--s-7)));
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: var(--s-4);
}
.topbar-search-field {
  width: 100%; height: var(--component-lg); padding: 0 var(--s-4);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: var(--t-15);
}
.topbar-search-field:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.topbar-search-hint { margin: var(--s-3) 0 0; font-size: var(--t-12); color: var(--text-3); }

/* Console detail/content helpers */
.console-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}
.console-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: var(--s-5);
  align-items: start;
}
.console-definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: 0;
}
.console-definition-list div {
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.console-definition-list dt {
  margin: 0 0 var(--s-1);
  font-size: var(--t-11);
  font-weight: var(--weight-semibold);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.console-definition-list dd { margin: 0; color: var(--text); }
.console-media-grid, .console-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.console-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3);
}
.console-media-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.console-media-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.console-list { display: grid; gap: var(--s-2); }
.console-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.console-rich-text { color: var(--text); }
.console-rich-text :is(p, ul, ol) { margin-top: 0; }
.console-rich-text :is(img, video) {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}
.subject-cell {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.subject-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--component-lg);
  height: var(--component-lg);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: var(--weight-semibold);
}

/* Mobile: rail collapses to drawer */
@media (max-width: 900px) {
  .app-shell--with-side {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .app-shell--with-side > .app-side {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    background: var(--bg-elev);
    box-shadow: var(--shadow-lg);
    z-index: 30;
  }
  .app-shell--with-side.is-open > .app-side { transform: translateX(0); }
  .app-shell--with-side.is-open > .app-shell-backdrop { opacity: 1; pointer-events: auto; }
  .app-h-menu { display: inline-flex; }
  .topbar-search { display: none; }
  .console-filter-grid,
  .console-detail-grid,
  .console-definition-list {
    grid-template-columns: 1fr;
  }
  .console-list-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Surface wrapper + heading utility used by placeholders + dashboard */
.surface { display: block; }
.surface-head { margin-bottom: var(--s-5); }
.surface-title { font-size: var(--t-20); font-weight: var(--weight-semibold); letter-spacing: -0.015em; margin: 0; }
.surface-sub   { color: var(--text-2); font-size: var(--t-13); margin: var(--s-1) 0 0; }

.empty-mark-dot {
  display: inline-block; width: var(--component-sm); height: var(--component-sm);
  border-radius: 50%; background: var(--bg-quiet); border: 1px solid var(--border);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Live Operations Map (ADR-0012, issues #135 + C-series)
   The map breaks out of the padded .app-main to render full-bleed below the
   topbar. Floating chrome is positioned within the .map-surface.
   ───────────────────────────────────────────────────────────────────── */
.app-main:has(.map-surface) { padding: 0; position: relative; overflow: hidden; }
.map-surface { position: absolute; inset: 0; background: var(--bg); }
.map-canvas { position: absolute; inset: 0; z-index: 0; }
.map-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.map-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  color: var(--text-2); font-size: var(--t-13); z-index: 1;
}
.map-loading[hidden] { display: none; }
/* Markers (rendered as Leaflet divIcon content by map-markers controller) */
.map-marker-icon, .map-marker-search-icon { background: transparent; border: 0; }
.map-marker-ring {
  width: 16px; height: 16px; border-radius: 50%;
  background: color-mix(in srgb, var(--marker-color, var(--accent)) 22%, transparent);
  border: 2px solid var(--marker-color, var(--accent));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  cursor: pointer; box-sizing: border-box;
  transition: transform .1s ease;
}
.map-marker-ring:hover { transform: scale(1.25); }
.map-marker-ring--dashed { border-style: dashed; }
.map-marker-ring.is-selected {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.map-marker-search {
  width: 18px; height: 18px; border-radius: 50% 50% 50% 0;
  background: var(--accent); border: 2px solid var(--accent-fg);
  transform: rotate(-45deg); box-shadow: var(--shadow-md);
}

/* what3words grid overlay (#140) — 1px lines at --text-3, ~30% opacity */
.w3w-grid { overflow: visible; }
.w3w-grid-line { stroke: var(--text-3); stroke-opacity: 0.3; stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
/* Selected-incident square highlight (#146) */
.w3w-grid-square { fill: var(--accent-soft); fill-opacity: 0.45; stroke: var(--accent); stroke-width: 1.5; }
.w3w-grid-label { fill: var(--text); font-family: var(--font-mono); font-size: 10px; font-weight: var(--weight-medium); text-anchor: middle; }
.w3w-grid-label--leaflet {
  color: var(--text); line-height: 16px; text-align: center;
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.w3w-create-popup .leaflet-popup-content-wrapper {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.w3w-create-popup .leaflet-popup-content { margin: var(--s-4); min-width: 220px; }
.w3w-create-popup .leaflet-popup-tip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.w3w-create-popup-body { display: flex; flex-direction: column; gap: var(--s-2); }
.w3w-create-popup-eyebrow {
  margin: 0; color: var(--text-3); font-size: var(--t-11);
  font-weight: var(--weight-medium); text-transform: uppercase; letter-spacing: 0.06em;
}
.w3w-create-popup-title { margin: 0; color: var(--accent); font-family: var(--font-mono); font-size: var(--t-15); font-weight: var(--weight-semibold); }
.w3w-create-popup-meta { margin: 0; color: var(--text-2); font-family: var(--font-mono); font-size: var(--t-12); }
.w3w-create-popup-action { margin-top: var(--s-2); justify-content: center; }

/* Filter chip rail (#142) — top-left */
.map-chip-rail {
  position: absolute; top: var(--s-4); left: var(--s-4); z-index: 3;
  display: flex; flex-wrap: wrap; gap: var(--s-2); max-width: calc(100% - var(--s-8));
}
.map-chip { position: relative; }
.map-chip-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 30px; padding: 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: var(--t-12); font-weight: var(--weight-medium);
  cursor: pointer; box-shadow: var(--shadow-sm); white-space: nowrap;
}
.map-chip-btn:hover { background: var(--bg-soft); }
.map-chip-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.map-chip-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.map-chip-count {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-fg);
  font-size: 10px; font-family: var(--font-mono); line-height: 1;
}
.map-chip-menu {
  position: absolute; top: calc(100% + var(--s-2)); left: 0; z-index: 4;
  min-width: 180px; max-height: 280px; overflow-y: auto;
  padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 1px;
}
.map-chip-menu[hidden] { display: none; }
.map-chip-option {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm);
  font-size: var(--t-13); color: var(--text); cursor: pointer;
}
.map-chip-option:hover { background: var(--bg-soft); }
.map-chip-option input { accent-color: var(--accent); margin: 0; }
.map-chip-empty { padding: var(--s-3); font-size: var(--t-12); color: var(--text-3); margin: 0; }

/* what3words search + Find me (#139) — top-right */
.map-search { position: absolute; top: var(--s-4); right: var(--s-4); z-index: 4; width: 280px; max-width: calc(100% - var(--s-8)); }
.map-search-box {
  display: flex; align-items: center; gap: var(--s-2);
  height: 36px; padding: 0 var(--s-2) 0 var(--s-3);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev); box-shadow: var(--shadow-md);
}
.map-search-box:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.map-search-input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: var(--t-13); font-family: var(--font-mono); color: var(--text);
}
.map-search-input::placeholder { color: var(--text-3); }
.map-search-input:focus { outline: none; }
.map-search-find {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer;
}
.map-search-find:hover { background: var(--bg-soft); color: var(--accent); }
.map-search-find:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.map-search-find.is-error { color: var(--danger); }
.map-search-results {
  list-style: none; margin: var(--s-2) 0 0; padding: var(--s-1);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev); box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto;
}
.map-search-results[hidden] { display: none; }
.map-search-result {
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); cursor: pointer;
}
.map-search-result:hover, .map-search-result.is-active { background: var(--bg-soft); }
.map-search-words { font-family: var(--font-mono); font-size: var(--t-13); color: var(--accent); }
.map-search-place { font-size: var(--t-11); color: var(--text-3); }
.map-search-empty { padding: var(--s-3); font-size: var(--t-12); color: var(--text-3); }

/* Layer toggles (#144) — bottom-right */
.map-layers {
  position: absolute; bottom: var(--s-5); right: var(--s-4); z-index: 3;
  display: flex; flex-direction: column; gap: 1px;
  padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-elev); box-shadow: var(--shadow-md); min-width: 0;
}
.map-layers-legend {
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: var(--weight-semibold);
  padding: 0; margin: 0 0 var(--s-2);
}
.map-layer-toggle {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-1) var(--s-2); border-radius: var(--r-sm);
  font-size: var(--t-13); color: var(--text); cursor: pointer;
}
.map-layer-toggle:hover { background: var(--bg-soft); }
.map-layer-toggle input { accent-color: var(--accent); margin: 0; }

/* Collapsible left rail (#143) */
.map-rail {
  position: absolute; top: 0; left: 0; bottom: 0; z-index: 4;
  width: 360px; display: flex; flex-direction: column;
  background: var(--bg-elev); border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: width 0.18s ease;
}
.map-rail.is-collapsed { width: 44px; }
.map-rail-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.map-rail-toggle {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 28px; height: 28px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg-elev); color: var(--text-2); cursor: pointer;
}
.map-rail-toggle:hover { background: var(--bg-soft); color: var(--text); }
.map-rail-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.map-rail-toggle-icon { width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.18s ease; }
.map-rail.is-collapsed .map-rail-toggle-icon { transform: rotate(-135deg); }
.map-rail-title { font-size: var(--t-13); font-weight: var(--weight-semibold); margin: 0; flex: 1; white-space: nowrap; }
.map-rail-count {
  font-family: var(--font-mono); font-size: var(--t-11);
  background: var(--bg-soft); color: var(--text-2);
  padding: 1px var(--s-2); border-radius: var(--r-pill);
}
.map-rail.is-collapsed .map-rail-title,
.map-rail.is-collapsed .map-rail-count { display: none; }
.map-rail-body { flex: 1; overflow-y: auto; min-height: 0; }
.map-rail.is-collapsed .map-rail-body { display: none; }
.map-rail-list { list-style: none; margin: 0; padding: 0; }
.map-rail-row {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
  padding: var(--s-3) var(--s-4); border: 0; border-bottom: 1px solid var(--divider);
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.map-rail-row:hover { background: var(--bg-soft); }
.map-rail-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.map-rail-row.is-active { background: var(--accent-soft); }
.map-rail-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--marker-color, var(--accent)); flex-shrink: 0; }
.map-rail-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.map-rail-row-title { font-size: var(--t-13); font-weight: var(--weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-rail-row-meta { font-size: var(--t-11); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-rail-status { flex-shrink: 0; }
.map-rail-empty { padding: var(--s-5); color: var(--text-3); font-size: var(--t-13); text-align: center; }

/* Shift the filter chips clear of the open rail */
.map-surface.is-rail-open .map-chip-rail { left: calc(360px + var(--s-4)); }

/* Selected incident callout (#141) */
.map-detail {
  position: absolute;
  top: var(--map-detail-top, var(--s-6));
  left: var(--map-detail-left, calc(100% - 184px));
  z-index: 30;
  width: 320px;
  max-width: calc(100% - var(--s-8));
  max-height: min(360px, calc(100% - var(--s-8)));
  transform: translate(-50%, calc(-100% - 12px)) scale(0.98);
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  cursor: default;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.map-detail.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 16px)) scale(1);
}
.map-detail.map-detail--below {
  transform: translate(-50%, 12px) scale(0.98);
  transform-origin: 50% 0;
}
.map-detail.map-detail--below.is-open { transform: translate(-50%, 16px) scale(1); }
.map-detail::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.map-detail.map-detail--below::after {
  top: -7px;
  bottom: auto;
  border: 0;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
@media (prefers-reduced-motion: reduce) { .map-detail { transition: none; } }
.map-detail-card {
  position: relative;
  z-index: 1;
  max-height: inherit;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  box-shadow: var(--shadow-lg);
}
.map-detail-card .card-head { align-items: flex-start; gap: var(--s-3); }
.map-detail-card .card-title {
  font-size: var(--t-14);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.map-detail-close {
  flex-shrink: 0;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: pointer;
}
.map-detail-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.map-detail-w3w {
  display: flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: var(--t-13);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s-2) var(--s-3);
}
.map-detail-w3w-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--accent); }
.map-detail-reporter { font-size: var(--t-12); color: var(--text-2); margin: 0; }
.map-detail-desc {
  font-size: var(--t-13);
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.map-detail-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.map-detail-thumb {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--r-sm);
  background-size: cover; background-position: center; cursor: pointer; padding: 0;
}
.map-detail-thumb:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.map-detail-open { margin-top: var(--s-1); cursor: pointer; }
.map-detail-lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: var(--bg-overlay); padding: var(--s-6); cursor: zoom-out;
}
.map-detail-lightbox[hidden] { display: none; }
.map-detail-lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
@media (max-width: 767px) {
  .map-detail { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; transform: translateY(100%); }
  .map-detail.is-open { transform: translateY(0); }
  .map-detail-card { max-height: 70vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .map-detail::after { display: none; }
}

/* Mobile: rail becomes a bottom sheet */
@media (max-width: 767px) {
  .map-rail {
    top: auto; right: 0; bottom: 0; left: 0; width: auto;
    max-height: 45%; border-right: 0; border-top: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .map-rail.is-collapsed { width: auto; height: 48px; max-height: 48px; }
  .map-rail.is-collapsed .map-rail-title,
  .map-rail.is-collapsed .map-rail-count { display: block; }
  .map-surface.is-rail-open .map-chip-rail { left: var(--s-4); }
}

/* Admin read-only chip (supervisor on /console/admin/*) */
.admin-readonly-chip { margin-bottom: var(--s-4); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--t-11); font-weight: var(--weight-medium);
  background: var(--bg-soft); color: var(--text-2);
  border: 1px solid var(--border);
}
.chip--muted { color: var(--text-3); }

/* Local visual fixtures */
.visual-fixture { max-width: 920px; margin: 0 auto; }
.visual-fixture--buttons { display: grid; gap: var(--s-6); }
.visual-fixture-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
.visual-fixture-button-cell {
  display: grid;
  align-content: start;
  gap: var(--s-3);
  min-height: 104px;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-quiet);
}
.visual-fixture-button-cell .btn { justify-self: start; }
@media (max-width: 640px) {
  .visual-fixture-button-grid { grid-template-columns: 1fr; }
}
/*

 */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--s-8) var(--s-5);
  background: var(--bg);
}

.auth-panel {
  width: min(100%, 30rem);
}

.auth-head {
  text-align: center;
  margin-bottom: var(--s-7);
}

.auth-mark {
  width: var(--s-8);
  height: var(--s-8);
  display: inline-grid;
  place-items: center;
  margin-bottom: var(--s-5);
  color: var(--accent-fg);
  background: var(--accent);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

.auth-copy {
  margin-top: var(--s-2);
  color: var(--text-2);
}

.auth-stack {
  display: grid;
  gap: var(--s-5);
}

.auth-card {
  display: grid;
  gap: var(--s-4);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  color: var(--text-3);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--divider);
}

.auth-alert {
  margin-bottom: var(--s-5);
}

.auth-code {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}

.capture-home,
.passkeys-page {
  min-height: 100vh;
  padding: var(--s-6) var(--s-4);
  background: var(--bg);
  color: var(--text);
}

.capture-home {
  display: grid;
  align-content: start;
  gap: var(--s-5);
}

.passkeys-page {
  display: grid;
  place-items: start center;
}

.passkeys-panel {
  width: min(100%, 42rem);
  display: grid;
  gap: var(--s-5);
}

.passkey-registration,
.passkeys-list {
  display: grid;
  gap: var(--s-4);
}

.passkey-items,
.evidence-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}

.passkey-item,
.evidence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}

.passkey-name {
  margin: 0;
  font-weight: var(--weight-medium);
}

.alert {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}

.alert--success {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}
