/* Cascade layer order (#223).
 *
 * Declared once and required before any other styles so the rebuild has a
 * defined precedence to migrate component rules into. Listing the order with no
 * rules assigned to the layers is inert — it changes nothing visually until
 * rules are moved inside `@layer components { ... }` (and friends). Establishing
 * the order first means that migration can happen incrementally without
 * reshuffling precedence each time.
 */
@layer reset, base, components, modules, utilities, native, platform;
/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(/assets/images/layers-0e356f4d554162eb71f127f50460dbc55d405027189ebe90b20729ef18d13d36.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(/assets/images/layers-2x-ba8fa601e413b14db27db07285ade3951721e02244c31523284ab2d1ed53c3dc.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(/assets/images/marker-icon-3d253116ec4ba0e1f22a01cdf1ff7f120fa4d89a6cd0933d68f12951d19809b4.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
	-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
	-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
	-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
	transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

.leaflet-cluster-spider-leg {
	/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
	-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
	-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
	-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
	transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}
.marker-cluster-small {
	background-color: rgba(181, 226, 140, 0.6);
	}
.marker-cluster-small div {
	background-color: rgba(110, 204, 57, 0.6);
	}

.marker-cluster-medium {
	background-color: rgba(241, 211, 87, 0.6);
	}
.marker-cluster-medium div {
	background-color: rgba(240, 194, 12, 0.6);
	}

.marker-cluster-large {
	background-color: rgba(253, 156, 115, 0.6);
	}
.marker-cluster-large div {
	background-color: rgba(241, 128, 23, 0.6);
	}

	/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
	background-color: rgb(181, 226, 140);
	}
.leaflet-oldie .marker-cluster-small div {
	background-color: rgb(110, 204, 57);
	}

.leaflet-oldie .marker-cluster-medium {
	background-color: rgb(241, 211, 87);
	}
.leaflet-oldie .marker-cluster-medium div {
	background-color: rgb(240, 194, 12);
	}

.leaflet-oldie .marker-cluster-large {
	background-color: rgb(253, 156, 115);
	}
.leaflet-oldie .marker-cluster-large div {
	background-color: rgb(241, 128, 23);
}

.marker-cluster {
	background-clip: padding-box;
	border-radius: 20px;
	}
.marker-cluster div {
	width: 30px;
	height: 30px;
	margin-left: 5px;
	margin-top: 5px;

	text-align: center;
	border-radius: 15px;
	font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
	}
.marker-cluster span {
	line-height: 30px;
	}
/* 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;
  --accent-text: #58a6ff;
  --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: #f472b6;
  --utility-pink-soft: #3b1730;
  --utility-purple: #a78bfa;
  --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: #f87171;
  --danger-soft: #391616;
  --info: #38bdf8;
  --info-soft: #0f2839;

  /* Text tones — tuned independently from fills to preserve WCAG AA contrast. */
  --critical-text: #f472b6;
  --warning-text: #eab308;
  --success-text: #22c55e;
  --danger-text: #f87171;

  /* 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;

  /* Safe-area indirection (#223). A host shell may inject these to override;
     otherwise they resolve to the platform inset, and finally to 0px. Component
     CSS must route through these rather than referencing env() directly so the
     inset source is swappable in one place. */
  --custom-safe-inset-top: env(safe-area-inset-top, 0px);
  --custom-safe-inset-right: env(safe-area-inset-right, 0px);
  --custom-safe-inset-bottom: env(safe-area-inset-bottom, 0px);
  --custom-safe-inset-left: env(safe-area-inset-left, 0px);

  /* Motion tokens (#223) — named durations + easings so micro-interactions share
     one vocabulary instead of inlining magic numbers. */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 280ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1.2);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);

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

/* ===================== Reports surface (#273) ===================== */
.reports-surface {
  display: grid;
  gap: var(--s-6);
}

.report-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4);
}

.report-filter-summary,
.report-filter-controls,
.report-range-form,
.report-back-link,
.report-link-card {
  display: flex;
  align-items: center;
}

.report-filter-summary { gap: var(--s-3); }
.report-filter-controls { flex-wrap: wrap; gap: var(--s-3); justify-content: flex-end; }
.report-range-form { flex-wrap: wrap; gap: var(--s-2); }
.report-filter-label {
  margin: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--t-11);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-filter-value { margin: var(--s-1) 0 0; color: var(--text); font-weight: var(--weight-semibold); }
.report-date-input { width: 9.25rem; min-height: 2.25rem; }

.report-back-link {
  width: max-content;
  gap: var(--s-1);
  margin-bottom: var(--s-2);
  color: var(--text-2);
  font-size: var(--t-13);
  text-decoration: none;
}
.report-back-link:hover,
.report-back-link:focus-visible { color: var(--link); }

.reports-chart-grid,
.reports-detail-grid,
.reports-table-grid,
.report-link-grid {
  display: grid;
  gap: var(--s-4);
}
.reports-chart-grid,
.reports-detail-grid,
.reports-table-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.report-link-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }

.report-link-card {
  gap: var(--s-3);
  padding: var(--s-4);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.report-link-card:hover,
.report-link-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-soft));
  transform: translateY(-1px);
}
.report-link-body { min-width: 0; flex: 1; display: grid; gap: var(--s-1); }
.report-link-title { color: var(--text); font-size: var(--t-14); }
.report-link-sub { color: var(--text-2); font-size: var(--t-12); line-height: 1.45; }
.report-link-arrow { color: var(--text-3); flex: 0 0 auto; }

.report-metric-list {
  display: grid;
  gap: var(--s-3);
  margin: 0;
}
.report-metric-list--columns { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.report-metric-list div {
  display: flex;
  align-items: baseline;
  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);
}
.report-metric-list dt {
  color: var(--text-2);
  font-size: var(--t-12);
}
.report-metric-list dd {
  margin: 0;
  color: var(--text);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.report-alert {
  padding: var(--s-4);
  border-color: color-mix(in srgb, var(--warn) 42%, var(--border));
  background: color-mix(in srgb, var(--warn) 8%, var(--bg));
}
.report-alert p { margin: var(--s-2) 0 0; color: var(--text-2); }
.report-alert strong { color: var(--text); }

@media (max-width: 760px) {
  .report-filter { align-items: stretch; flex-direction: column; }
  .report-filter-controls { justify-content: flex-start; }
  .report-date-input { flex: 1 1 8rem; }
}

*, *::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: #4b5563;
  --text-inv: #ffffff;
  --border: #e2e4e8;
  --border-strong: #cbd0d8;
  --divider: #ececea;
  --accent-soft: #dbe6ff;
  --accent-text: #1d4ed8;
  --link: #2563eb;
  --critical-text: #be185d;
  --warning-text: #854d0e;
  --success-text: #15803d;
  --danger-text: #b91c1c;
  --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;
}

/* ===================== Base ===================== */
/* The hidden attribute must always hide. Component rules that set `display`
   (flex, grid) would otherwise override the browser default and show elements
   that scripts have hidden. Important declarations in a layer beat normal
   declarations everywhere, so this one rule covers every component. */
@layer base {
  [hidden] { display: none !important; }
}

/* ===================== 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-text); 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-text); 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(--link); 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; }

/* ============ Incidents table — shared _report row (#232) ============ */
/* Priority left-rail. Colour comes ONLY from the utility-rail tokens bound to
   priority in docs/references/priority-tokens.md (pink=critical, orange=high,
   yellow=medium, teal=low) — never a raw hex. */
.report-th-rail { width: 4px; padding-left: 0; padding-right: 0; }
.report-cell-rail { width: 4px; padding-left: 0; padding-right: 0; }
.priority-rail-cell {
  display: block;
  width: 4px;
  align-self: stretch;
  min-height: 28px;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--border);
}
.priority-rail-cell--critical { background: var(--utility-pink); }
.priority-rail-cell--high     { background: var(--utility-orange); }
.priority-rail-cell--medium   { background: var(--utility-yellow); }
.priority-rail-cell--low      { background: var(--utility-teal); }

/* Machine-meta cell — what3words / id / guard. */
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.report-meta-item { font-size: var(--t-11); color: var(--text-2); white-space: nowrap; }

/* Activity cell — trigger + evidence counts (tooltips reuse the #223 primitive). */
.report-activity { display: flex; align-items: center; gap: var(--s-3); }
.report-activity-count { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--text-2); font-variant-numeric: tabular-nums; }
.report-activity-num { font-size: var(--t-12); font-family: var(--font-mono); }

.report-cell-time { white-space: nowrap; color: var(--text-2); }

/* Inline row quick-actions — revealed on row hover/focus-within. Kept visible
   for keyboard users via :focus-within so they never become unreachable. */
.report-cell-actions { text-align: right; }
.report-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--s-1); opacity: 0; transition: opacity var(--motion-fast) var(--ease-standard); }
.report-actions form { margin: 0; }
.report-row:hover .report-actions,
.report-row:focus-within .report-actions { opacity: 1; }
@media (hover: none) { .report-actions { opacity: 1; } }

/* Density toggle in the card header. */
.card-head-trailing { display: inline-flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.density-toggle { display: inline-flex; gap: var(--s-1); }
.density-toggle-btn[aria-pressed="true"] { background: var(--bg-soft); color: var(--text); }

/* Compact density — tightens row padding. */
.table--compact td, .table--compact th { padding-top: var(--s-1); padding-bottom: var(--s-1); }
.table--compact .report-meta-item, .table--compact .text-muted { font-size: var(--t-10); }
.table--compact .priority-rail-cell { min-height: 20px; }

/* ============ Bulk-action bar + row selection (#233) ============ */
/* Row-select checkbox column — narrow, left of the priority rail. */
.report-th-select, .report-cell-select { width: 28px; padding-right: 0; }

/* The off-screen form the row checkboxes post into (no visual footprint). */
.visually-hidden-form { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Row + select-all checkbox — accent-tinted to match the command theme. */
.row-select-box { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* Bulk bar — appears above the table when rows are selected. Command-theme
   surface (soft bg + border), denser spacing, accent count. */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar-summary { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--text-2); }
.bulk-bar-count { color: var(--link); font-variant-numeric: tabular-nums; }
.bulk-bar-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.bulk-bar-field { display: inline-flex; align-items: center; gap: var(--s-1); }
.select--sm { padding-top: var(--s-1); padding-bottom: var(--s-1); font-size: var(--t-12); }

.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); }

/* Undo toast (#223) — a toast with a trailing affordance to revert the last
   action. Inherits the toast surface; adds an inline action button. */
.toast--undo { display: flex; align-items: center; gap: var(--s-4); }
.toast--undo .toast-undo-action {
  margin-left: auto;
  font-weight: var(--weight-semibold);
  font-size: var(--t-12);
  color: var(--link);
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
}
.toast--undo .toast-undo-action:hover { background: var(--bg-soft); }

/* Hover tooltip (#223) — a reusable micro-interaction primitive. Wrap a trigger
   in [data-tooltip]; the label is exposed via the attribute and revealed on
   hover/focus. Suppressed on touch where there is no hover. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--s-2));
  left: 50%;
  transform: translateX(-50%) translateY(var(--s-1));
  white-space: nowrap;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--t-11);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (any-hover: none) {
  [data-tooltip]::after { display: none; }
}

/* ===================== 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); }

/* ===================== Dashboard ChartKit widgets (#227) ===================== */
/* KPI sparkline cards */
.kpi-spark-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
@media (max-width: 900px) { .kpi-spark-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-spark-grid { grid-template-columns: 1fr; } }
.kpi-spark-card { padding: var(--s-4); }
.kpi-spark-label { font-size: var(--t-12); color: var(--text-2); margin: 0; }
.kpi-spark-figure { display: flex; align-items: baseline; gap: var(--s-2); margin: var(--s-1) 0 var(--s-2); }
.kpi-spark-value { font-size: var(--t-20); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-spark-delta { font-size: var(--t-11); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kpi-spark-delta--up   { color: var(--critical-text); }
.kpi-spark-delta--down { color: var(--success-text); }
.kpi-spark-delta--flat { color: var(--text-2); }

/* Widget grid */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}
@media (max-width: 900px) { .dashboard-widgets { grid-template-columns: 1fr; } }
.widget { min-width: 0; }
.widget--wide { grid-column: 1 / -1; }

/* ChartKit frames + SVG primitives */
.chartkit-frame { display: block; margin: 0; min-width: 0; }
.chartkit-frame .chartkit { display: block; width: 100%; height: auto; }
.chartkit-frame--spark { height: 32px; }
.chartkit-frame--spark .chartkit { height: 32px; }
.chartkit-frame--donut, .chartkit-frame--radial { max-width: 200px; margin: var(--s-2) auto; }
.chartkit-frame--area { height: 110px; }
.chartkit-frame--area .chartkit { height: 110px; }

.chartkit-empty-label { fill: var(--text-2); font-size: 11px; font-family: var(--font-mono); }

.chartkit-spark-line { stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.chartkit-donut-arc { stroke: var(--border); }
.chartkit-tone--pink   { stroke: var(--utility-pink); }
.chartkit-tone--orange { stroke: var(--utility-orange); }
.chartkit-tone--yellow { stroke: var(--utility-yellow); }
.chartkit-tone--teal   { stroke: var(--utility-teal); }
.chartkit-tone--green  { stroke: var(--utility-green); }
.chartkit-tone--purple { stroke: var(--utility-purple); }
.chartkit-donut-total { fill: var(--text); font-size: 22px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }

.chartkit-heat-cell {
  fill: var(--accent);
  fill-opacity: calc(0.08 + var(--intensity, 0) * 0.92);
  outline: none;
  transition: fill-opacity var(--motion-fast) var(--ease-standard);
}
.chartkit-heat-cell:hover, .chartkit-heat-cell:focus-visible { stroke: var(--accent); stroke-width: 1.5; }

.chartkit-radial-hub { stroke: var(--border); }
.chartkit-radial-spoke { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }

.chartkit-league-track { fill: var(--bg-soft); }
.chartkit-league-bar { fill: var(--accent); }
.widget-league-labels { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.widget-league-labels-item { display: flex; justify-content: space-between; font-size: var(--t-12); color: var(--text-2); }
.widget-league-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-league-count { font-family: var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }

.chartkit-area-fill { fill: var(--accent); fill-opacity: 0.14; }
.chartkit-area-line { stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }

/* Status funnel */
.status-funnel { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.status-funnel-stage { display: flex; flex-direction: column; gap: var(--s-1); }
.status-funnel-meta { display: flex; justify-content: space-between; font-size: var(--t-12); color: var(--text-2); }
.status-funnel-count { font-family: var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.status-funnel-track { display: block; height: 8px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.status-funnel-bar { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); min-width: 2px; transition: width var(--motion-base) var(--ease-standard); }
.status-funnel-bar--draft       { background: var(--text-2); }
.status-funnel-bar--submitted   { background: var(--accent); }
.status-funnel-bar--under_review { background: var(--utility-yellow); }
.status-funnel-bar--resolved    { background: var(--utility-green); }
.status-funnel-bar--closed      { background: var(--utility-teal); }

/* ============ Dashboard time-scope + cross-filter chips (#230) ============ */
/* Segmented time-scope control sits in the surface head, right-aligned. */
.dashboard-surface .surface-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

.time-scope {
  display: inline-flex;
  padding: var(--s-1);
  gap: var(--s-1);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.time-scope-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: var(--t-12);
  font-weight: var(--weight-medium);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
.time-scope-tab:hover { color: var(--text); }
.time-scope-tab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.time-scope-tab.is-active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

.filter-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-4); }
.filter-chips[hidden] { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-1) var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--t-11); font-weight: var(--weight-medium);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--accent) 32%, transparent);
}
.filter-chip-label { font-variant-numeric: tabular-nums; }
.filter-chip-remove {
  appearance: none; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; line-height: 1;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-14);
  transition: color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
.filter-chip-remove:hover { color: var(--text); background: color-mix(in oklab, var(--accent) 22%, transparent); }
.filter-chip-remove:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Brushable widgets advertise interactivity on their clickable segments. */
.chartkit-frame[data-chart-brushable] .chartkit-donut-arc,
.chartkit-frame[data-chart-brushable] .chartkit-league-row { cursor: pointer; }
.chartkit-frame[data-chart-brushable] .chartkit-donut-arc:hover { stroke-opacity: 0.82; }
.chartkit-frame[data-chart-brushable] .chartkit-league-row:hover .chartkit-league-bar { fill-opacity: 0.82; }

/* ===================== Dashboard live ticker (#228) ===================== */
/* Newsroom-style top strip of incoming incidents. Seamless auto-scroll is the
   run rendered twice + translateX(-50%); the `ticker` Stimulus controller
   binds the duration and pause state. Animation is gated on .ticker--animated
   (set by the controller when motion is allowed AND items exist) and on the
   reduced-motion media query below. */
.ticker {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.ticker-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  flex: none;
  font-size: var(--t-11);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  padding-right: var(--s-3);
  border-right: 1px solid var(--border);
}
.ticker-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticker-run {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticker--animated .ticker-track {
  animation: ticker-scroll var(--ticker-duration, 30s) linear infinite;
}
.ticker-item {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 var(--s-3);
  border-right: 1px solid var(--border);
}
.ticker-item--critical { background: color-mix(in oklab, var(--utility-pink) 14%, transparent); }
.ticker-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-12);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.ticker-link:hover .ticker-title { color: var(--accent); }
.ticker-flag {
  font-size: var(--t-10);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--critical-text);
}
.ticker-title { font-weight: var(--weight-medium); }
.ticker-type { color: var(--text-2); }
.ticker-time {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-11);
}
.ticker-empty-text { margin: 0; font-size: var(--t-12); color: var(--text-2); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker--animated .ticker-track { animation: none; }
}

/* ===================== Capture surface ===================== */
.capture-home {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding: var(--s-5) var(--s-5) var(--s-7);
  width: 100%;
  max-width: min(640px, 100%);
  min-width: 0;
  margin: 0 auto;
  min-height: 100vh;
}
.safe-area-top { padding-top: max(var(--s-5), var(--custom-safe-inset-top)); }
.safe-area-bottom { padding-bottom: max(var(--s-7), var(--custom-safe-inset-bottom)); }
body.capture-surface {
  /* Kill the UA default 8px body margin — with width:100% it pushes the whole
     surface past the viewport (the root cause of the #241 mobile overflow). */
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: calc(56px + var(--custom-safe-inset-bottom));
}
body.capture-surface #capture-skip-target {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.capture-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-bottom: var(--custom-safe-inset-bottom);
}

/* Floating create action (#244) — sits above the bottom nav, anchored to the
   trailing edge with safe-area-aware offset. */
.capture-fab {
  position: fixed;
  right: var(--s-5);
  bottom: calc(64px + var(--custom-safe-inset-bottom));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: var(--component-lg);
  padding: 0 var(--s-5);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: var(--weight-semibold);
  font-size: var(--t-14);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: background var(--motion-fast) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}
.capture-fab:hover { background: var(--accent-hover); }
.capture-fab:active { transform: translateY(1px); }
.capture-fab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.capture-fab-label { line-height: 1; }
.capture-bottom-nav-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.capture-bottom-nav-li { display: flex; min-width: 0; }
.capture-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  width: 100%;
  min-width: 0;
  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-text); 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(--warning-text);
  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 */
/* isolation keeps Leaflet's panes (z-index 400+) below the bottom nav bar. */
.capture-mini-map { height: 300px; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg-soft); isolation: isolate; }
.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; } }

/* Evidence pack thumbnails (#219) — image evidence shows a preview alongside its label. */
.capture-evidence-item { display: flex; align-items: center; gap: var(--s-3); }
.capture-evidence-thumb { flex: 0 0 auto; }
.capture-evidence-thumb-img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; }

/* ─────────────────────────────────────────────────────────────────────────
   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-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 32%, var(--bg-elev));
}
.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; }
.capture-checklist-item.is-answered {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: color-mix(in srgb, var(--success-soft) 32%, var(--bg-elev));
}

/* Per-item answer controls (#219). Every interactive control meets the 44pt
   gloved-hand tap target (#39 / #77) on the mobile capture surface. */
.capture-checklist-answer { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.capture-checklist-answer .btn,
.capture-checklist-answer .input,
.capture-checklist-answer .select { min-height: var(--component-lg); }
.capture-checklist-yesno { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.capture-checklist-radio {
  display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-14);
  min-height: var(--component-lg); padding: 0 var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elev);
}
.capture-checklist-radio input { width: 20px; height: 20px; accent-color: var(--accent); }
.capture-checklist-radio:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--bg-elev));
}
.capture-checklist-radio:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.capture-checklist-item-answer { font-size: var(--t-13); color: var(--text-2); margin: var(--s-1) 0 0; }

/* Answered state carries a non-colour signal (icon + label) alongside the
   green tint so state reads without colour vision (#77). */
.capture-checklist-answered-flag {
  display: inline-flex; align-items: center; gap: var(--s-1);
  margin-left: var(--s-2); font-size: var(--t-12); font-weight: var(--weight-medium);
  color: var(--success);
}

/* Checklist completion progress bar (#77) */
.capture-checklist-progress { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.capture-checklist-progress-bar {
  flex: 1; height: 6px; border-radius: var(--r-pill);
  background: var(--bg-soft); overflow: hidden;
}
.capture-checklist-progress-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.capture-checklist-progress-label { font-size: var(--t-12); color: var(--text-2); }

/* Passkey management on the capture surface also honours the 44pt rule (#79). */
.passkeys-page .passkey-item .btn { min-height: var(--component-lg); }

/* 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-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 18%, var(--bg-elev));
}
.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-text);
}

/* ─────────────────────────────────────────────────────────────────────────
   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 work queues (#245) — compact segmented control + rich list rows.
   Built from shared capture shell/card/chip tokens; no one-off brand colours. */
.capture-segmented {
  display: flex; gap: var(--s-1);
  padding: var(--s-1);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.capture-segmented-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none;
  font-size: var(--t-13); font-weight: var(--weight-semibold);
  transition: background .12s, color .12s;
}
.capture-segmented-tab:hover { color: var(--text); }
.capture-segmented-tab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.capture-segmented-tab.is-active {
  background: var(--bg-elev); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.capture-segmented-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 var(--s-2); border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--text-2);
  font-size: var(--t-11); font-weight: var(--weight-semibold);
}
.capture-segmented-tab.is-active .capture-segmented-count {
  background: var(--accent-soft); color: var(--accent);
}

.capture-queue-search {
  position: relative;
  display: flex; align-items: center;
}
.capture-queue-search-icon {
  position: absolute; left: var(--s-3); display: inline-flex;
  color: var(--text-3); pointer-events: none;
}
.capture-queue-search-input {
  width: 100%; min-height: 44px;
  padding: var(--s-2) var(--s-3) var(--s-2) calc(var(--s-3) * 2 + 16px);
  background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: var(--t-14);
}
.capture-queue-search-input::placeholder { color: var(--text-3); }
.capture-queue-search-input:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-color: var(--accent); }

.capture-queue-list { display: flex; flex-direction: column; gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
.capture-queue-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.capture-queue-link {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%; min-height: var(--component-lg);
  padding: var(--s-3) var(--s-4);
  text-decoration: none; color: inherit;
}
.capture-queue-link:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-lg); }
.capture-queue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.capture-queue-title {
  font-size: var(--t-15); font-weight: var(--weight-semibold); margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.capture-queue-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1) var(--s-3);
  font-size: var(--t-12); color: var(--text-2); margin: 0;
}
.capture-queue-type { font-weight: var(--weight-medium); }
.capture-queue-loc { display: inline-flex; align-items: center; gap: var(--s-1); min-width: 0; }
.capture-queue-loc .icon { color: var(--text-3); flex: none; }
.capture-queue-sub { font-size: var(--t-12); color: var(--text-3); margin: 0; }
.capture-queue-aside { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); flex: none; }
.capture-queue-action {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--t-12); font-weight: var(--weight-semibold); color: var(--accent);
}
.capture-queue-action .icon { flex: none; }
.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), var(--custom-safe-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-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 18%, var(--bg-elev));
}
.capture-sec--required.is-complete {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: color-mix(in srgb, var(--success-soft) 18%, var(--bg-elev));
}
.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-coordinates {
  margin: 0; color: var(--text-2); font-size: var(--t-12);
  font-family: var(--font-mono);
}

/* ----- Full-screen location picker (#248) -----
 * The inline location step is now a single trigger row (the summary) plus the
 * area/store fields. The map + GPS/what3words controls + confirmation sheet move
 * into an immersive full-screen overlay opened from the trigger. Command-theme
 * tokens only — no one-off map chrome colours. */
@layer components {
  /* Trigger row shown inline on the capture step. */
  .capture-location-open {
    display: flex; align-items: center; gap: var(--s-3); width: 100%;
    padding: var(--s-3) var(--s-4); min-height: 56px;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--bg); color: var(--text); text-align: left; cursor: pointer;
    transition: border-color .12s, background .12s;
  }
  .capture-location-open:hover { border-color: var(--text-3); background: var(--bg-soft); }
  .capture-location-open:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
  .capture-location-open-icon { flex: 0 0 auto; color: var(--accent); display: inline-flex; }
  .capture-location-open-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
  .capture-location-open-title { font-size: var(--t-14); font-weight: var(--weight-semibold); }
  .capture-location-open-sum {
    font-size: var(--t-12); color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .capture-location-open-chevron { flex: 0 0 auto; color: var(--text-3); display: inline-flex; }

  /* Immersive overlay — full viewport, map fills the remaining space. */
  .capture-location-overlay {
    position: fixed; inset: 0; z-index: 70;
    display: flex; flex-direction: column;
    background: var(--bg); color: var(--text);
  }

  .capture-location-bar {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
  }
  .capture-location-bar-title {
    flex: 1 1 auto; margin: 0; font-size: var(--t-14); font-weight: var(--weight-semibold);
  }
  .capture-location-gps { flex: 0 0 auto; }

  /* isolation keeps Leaflet's z-indexed panes inside the map, so they can
     never paint over the confirmation sheet or other controls. */
  .capture-location-map {
    flex: 1 1 auto; min-height: 0; width: 100%;
    background: var(--bg-soft);
    isolation: isolate;
  }
  /* Inline (non-overlay) fallback sizing — used if a map target ever renders
     outside the overlay. */
  .capture-sec-body .capture-location-map {
    flex: none; min-height: 220px;
    border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  }

  .capture-location-overlay .capture-location-status {
    margin: 0; padding: var(--s-2) var(--s-4); text-align: center;
    background: var(--bg-elev); border-top: 1px solid var(--border);
  }

  /* Selected what3words square drawn on the map (token-driven, no raw hex). */
  .capture-location-square {
    stroke: var(--accent); stroke-width: 2;
    fill: var(--accent); fill-opacity: 0.18;
  }

  /* Bottom confirmation sheet pinned inside the overlay (reuses .sheet chrome). */
  .capture-location-sheet {
    position: static; z-index: auto;
    border: 0; border-top: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--shadow-lg);
    animation: none;
  }
  .capture-location-sheet-body { display: flex; flex-direction: column; gap: var(--s-3); }
  .capture-location-detail {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  }
  .capture-location-detail-label {
    flex: 0 0 auto; font-size: var(--t-11); text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-3);
  }
  .capture-location-detail-value {
    min-width: 0; text-align: right; font-size: var(--t-13); color: var(--text);
  }
  .capture-location-detail-value[data-empty="true"] { color: var(--text-3); }
  .capture-location-detail-place { margin: 0; font-size: var(--t-12); color: var(--text-2); }
  .capture-location-sheet-notice {
    margin: 0; padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    background: var(--warn-soft);
    color: var(--warn); font-size: var(--t-12);
  }
  .capture-location-words-row {
    display: flex; align-items: flex-end; gap: var(--s-2);
  }
  .capture-location-words-row .field { flex: 1 1 auto; margin: 0; }
  .capture-location-map-words { flex: 0 0 auto; min-height: 44px; }
  .capture-location-sheet-foot { border-top: 1px solid var(--border); }

  /* Lock background scroll while the overlay is open. */
  body.capture-location-locked { overflow: hidden; }
}

/* 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); }

/* Guided question completion (#246) — required count, prominent next question,
   compact remaining queue, covered facts. Tokens only, no one-off colours. */
.capture-guided.is-complete .capture-sec-tick { border: 0; background: var(--success-soft); color: var(--success); }
.capture-guided-count { font-weight: 600; color: var(--accent); }
.capture-guided.is-complete .capture-guided-count { color: var(--success); }
.capture-guided-next {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}
.capture-guided-priority {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  font-size: var(--t-12);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
}
.capture-guided-helper { margin: 0; }
.capture-guided-queue-head, .capture-guided-covered-head { margin: var(--s-2) 0 0; }
.capture-guided-tick { display: inline-flex; vertical-align: middle; color: var(--success); margin-right: var(--s-1); }
.capture-guided-covered .list-item-title { color: var(--text-2); }

/* Per-question note / media / action controls (#247). Reuses tokens + the
   shared sheet surface; the panel groups one control card per guided question. */
.capture-q-controls-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.capture-q-controls-heading {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
  font-size: var(--t-15);
  font-weight: 600;
  color: var(--text-1);
}
.capture-q-controls {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}
.capture-q-controls-prompt { margin: 0; font-size: var(--t-13); color: var(--text-2); }
.capture-q-notes { gap: var(--s-1); }
.capture-q-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  font-size: var(--t-13);
  color: var(--text-1);
}
.capture-q-control-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.capture-q-control-btn { min-height: 44px; }
.capture-sheet-form { display: contents; }

/* 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 + var(--custom-safe-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; }

/* ─────────────────────────────────────────────────────────────────────
   Completion review + completed state (#250).
   The review state lists declaration blockers (from the same completeness
   model) with direct links back to each step/question. The completed state
   confirms the seal and offers post-completion actions. Both use command-theme
   tokens and reflow safely at narrow (iPhone) widths.
   ───────────────────────────────────────────────────────────────────── */
.capture-completion-review {
  display: flex; flex-direction: column; gap: var(--s-3);
  margin: 0 0 var(--s-4);
  padding: var(--s-4);
  background: var(--utility-amber-soft, var(--bg-elev));
  border: 1px solid var(--utility-amber, var(--border));
  border-radius: var(--r-lg);
}
.capture-completion-review-title {
  display: flex; align-items: center; gap: var(--s-2);
  margin: 0; font-size: var(--t-15); font-weight: var(--weight-semibold); color: var(--text);
}
.capture-completion-review-title .icon { color: var(--utility-amber, var(--text-2)); }
.capture-completion-review-lead { margin: 0; font-size: var(--t-13); color: var(--text-2); }
.capture-completion-blockers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.capture-completion-blocker-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); text-decoration: none; font-size: var(--t-13); line-height: 1.4;
}
.capture-completion-blocker-link:hover { border-color: var(--accent); }
.capture-completion-blocker-link .icon { color: var(--text-3); flex: none; }
.capture-completion-blocker-summary { min-width: 0; }

.capture-completion-done {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3);
  margin: 0 0 var(--s-4);
  padding: var(--s-6) var(--s-4);
  background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
}
.capture-completion-done-icon {
  display: inline-grid; place-items: center;
  width: var(--component-md, 44px); height: var(--component-md, 44px); border-radius: 50%;
  background: var(--utility-green-soft, var(--bg-soft)); color: var(--utility-green, var(--accent));
}
.capture-completion-done-title { margin: 0; font-size: var(--t-18); font-weight: var(--weight-semibold); color: var(--text); }
.capture-completion-done-lead { margin: 0; max-width: 36ch; font-size: var(--t-13); color: var(--text-2); line-height: 1.5; }
.capture-completion-done-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2);
  width: 100%; margin-top: var(--s-2);
}
.capture-completion-done-actions .btn { flex: 1 1 auto; min-width: 140px; }

@media (max-width: 420px) {
  .capture-priority-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture-completion-done-actions .btn { flex: 1 1 100%; }
}

/* ─────────────────────────────────────────────────────────────────────
   Capture Spotlight stepper (#224, Direction 1 wizard).
   A contained, fixed-height one-screen shell with three vertical zones —
   done (top) · active hero (centre) · upcoming (bottom) — and a sticky
   "Step N · <label>" progress meter. The capture-spotlight controller moves
   the form's section cards between zones; without JS the shell collapses to a
   normal scroll and the full checklist renders inline.
   ───────────────────────────────────────────────────────────────────── */
.capture-report-form--spotlight { padding: 0; max-width: 100%; }
.capture-spotlight {
  display: flex; flex-direction: column;
  width: 100%; max-width: 640px; margin: 0 auto;
}
/* Contained fixed-height shell — only enforced once the controller connects so
   no-JS keeps the document flow and full scroll. */
.capture-spotlight-ready { height: 100dvh; max-height: 100dvh; overflow: hidden; }

.capture-spotlight-head {
  position: sticky; top: 0; z-index: 20; flex: none;
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: max(var(--s-3), var(--custom-safe-inset-top)) var(--s-5) var(--s-3);
  background: var(--bg); border-bottom: 1px solid var(--divider);
}
.capture-spotlight-meter {
  height: 5px; border-radius: var(--r-pill);
  background: var(--bg-soft); overflow: hidden;
}
.capture-spotlight-meter i {
  display: block; height: 100%;
  width: calc(100% / 6); /* step 1 of 6 before JS advances it */
  background: var(--accent); border-radius: var(--r-pill);
  transition: width .25s ease;
}
.capture-spotlight-progress {
  margin: 0; font-size: var(--t-12);
  color: var(--text-2); font-weight: var(--weight-semibold);
}

.capture-spotlight-zones {
  display: flex; flex-direction: column;
  padding: var(--s-4) var(--s-5) var(--s-5);
}
.capture-spotlight-ready .capture-spotlight-zones { flex: 1; min-height: 0; }
.capture-spotlight-stage { min-width: 0; }
.capture-spotlight-ready .capture-spotlight-stage {
  flex: 1; min-height: 0; overflow-y: auto;
}

/* Once the controller connects, the in-form section cards are flowed into the
   three zones by their data-capture-spotlight-state using flex order: done
   collapses to the top, the active step is the centred hero, upcoming steps
   preview muted at the bottom. The cards stay inside the <form>, so the create
   action and the offline submit path are untouched. */
.capture-spotlight-ready .capture-checklist-form {
  display: flex; flex-direction: column; min-height: 100%;
}
.capture-spotlight-ready .capture-sec[data-capture-spotlight-state] { transition: opacity .2s ease; }

.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="done"] {
  order: 1; opacity: 0.78; background: var(--bg-quiet);
}
.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="done"] .capture-sec-body { display: none; }

.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="active"] {
  order: 2; margin: var(--s-3) 0;
}
.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="active"] .capture-sec-body { display: flex; }

.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="upcoming"] {
  order: 3; opacity: 1; pointer-events: none; background: var(--bg-quiet);
}
.capture-spotlight-ready .capture-sec[data-capture-spotlight-state="upcoming"] .capture-sec-body { display: none; }

/* Pin the declaration + footer after the last step. The declaration's flex
   item is its capture-object wrapper, so order must be set on the wrapper. */
.capture-spotlight-ready .capture-object--declaration,
.capture-spotlight-ready .capture-draft-summary { order: 4; }
.capture-spotlight-ready .capture-check-foot { order: 5; }

.capture-spotlight-nav {
  position: sticky; bottom: calc(56px + var(--custom-safe-inset-bottom)); z-index: 20;
  flex: none; display: flex; gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  background: var(--bg); border-top: 1px solid var(--divider);
}
.capture-spotlight-nav .btn { flex: 1; min-height: 48px; }
.capture-spotlight-back { flex: 0 0 30% !important; }

/* "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.
   The main track is minmax(0, 1fr), not 1fr: a bare 1fr cannot shrink below
   its content's min-content width, so the live ticker's single long row
   stretched the whole page past the screen edge.
   ───────────────────────────────────────────────────────────────────── */
.app-shell--with-side {
  grid-template-columns: 220px minmax(0, 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-text);
  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);
}

/* Saved-view tabs for the incidents index (#231). */
.console-view-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.console-view-tab {
  display: inline-flex;
  align-items: center;
  height: var(--component-sm);
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: var(--t-12);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.console-view-tab:hover { color: var(--text); border-color: var(--border-strong); }
.console-view-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.console-view-tab-group { display: inline-flex; align-items: center; gap: var(--s-1); }
.console-view-tab-remove {
  display: inline-grid;
  place-items: center;
  width: var(--component-sm);
  height: var(--component-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
}
.console-view-tab-remove:hover { color: var(--danger); border-color: var(--danger); }
.console-view-save { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; }
.console-view-save-input { width: 12rem; height: var(--component-sm); }
.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);
}

/* Subjects visual gallery (#236). */
.subject-facets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.subject-facet-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.subject-facet {
  display: inline-flex;
  align-items: center;
  height: var(--component-sm);
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: var(--t-12);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.subject-facet:hover { color: var(--text); border-color: var(--border-strong); }
.subject-facet.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.subject-view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.subject-view-btn {
  padding: var(--s-1) var(--s-3);
  font-size: var(--t-12);
  color: var(--text-2);
  background: var(--bg-elev);
  text-decoration: none;
}
.subject-view-btn + .subject-view-btn { border-left: 1px solid var(--border); }
.subject-view-btn.is-active { background: var(--accent-soft); color: var(--text); }

.subject-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-4);
  padding: var(--s-4);
}
.subject-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
}
/* Guard-created / unverified subjects read as visibly provisional. */
.subject-card--provisional {
  border-style: dashed;
  border-color: var(--border-strong);
  background: var(--bg-quiet);
}
.subject-card-head { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.subject-card-photo {
  flex: 0 0 auto;
  width: var(--s-8);
  height: var(--s-8);
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--border);
}
.subject-card-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--s-8);
  height: var(--s-8);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-weight: var(--weight-semibold);
}
.subject-card-id { display: grid; min-width: 0; }
.subject-card-name { font-weight: var(--weight-semibold); color: var(--text); text-decoration: none; }
.subject-card-name:hover { color: var(--link); }
.subject-card-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.subject-card-stats { display: flex; gap: var(--s-5); margin: 0; }
.subject-card-stats dt { font-size: var(--t-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.subject-card-stats dd { margin: 0; font-weight: var(--weight-semibold); font-size: var(--t-15); }

/* Bulletins BOLO board (#237). */
.bulletin-facets { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.bulletin-facet {
  display: inline-flex;
  align-items: center;
  height: var(--component-sm);
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: var(--t-12);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.bulletin-facet:hover { color: var(--text); border-color: var(--border-strong); }
.bulletin-facet.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.bulletin-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-4);
}
.bulletin-card {
  --rail: var(--utility-teal);
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  overflow: hidden;
}
.bulletin-card--pink { --rail: var(--utility-pink); }
.bulletin-card--orange { --rail: var(--utility-orange); }
.bulletin-card--teal { --rail: var(--utility-teal); }
.bulletin-card--purple { --rail: var(--utility-purple); }
.bulletin-card-rail { flex: 0 0 4px; background: var(--rail); }
.bulletin-card--unread {
  border-color: var(--rail);
  box-shadow: 0 0 0 1px var(--rail), var(--shadow-md);
}
.bulletin-card-body { display: grid; gap: var(--s-3); padding: var(--s-4); min-width: 0; flex: 1; }
.bulletin-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.bulletin-cat-badge { background: color-mix(in srgb, var(--rail) 18%, transparent); color: var(--rail); border-color: transparent; }
.bulletin-unread-dot { width: var(--s-3); height: var(--s-3); border-radius: var(--r-pill); background: var(--rail); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rail) 30%, transparent); }
.bulletin-card-title { font-weight: var(--weight-semibold); font-size: var(--t-15); color: var(--text); text-decoration: none; }
.bulletin-card-title:hover { color: var(--link); }
.bulletin-card-photo { width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); object-fit: cover; }
.bulletin-card-meta { font-size: var(--t-12); }
.bulletin-ack { display: grid; gap: var(--s-1); }
.bulletin-ack-bar { height: 6px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.bulletin-ack-bar span { display: block; height: 100%; width: var(--ack-pct, 0%); background: var(--rail); border-radius: var(--r-pill); }
.bulletin-ack-label { font-size: var(--t-11); color: var(--text-3); }

/* "Need your judgment" review band (#229). */
.review-band {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}
.review-band-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.review-band-kicker { margin: 0; font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); font-weight: var(--weight-semibold); }
.review-band-count { margin: 0; font-size: var(--t-18); font-weight: var(--weight-semibold); color: var(--text); }
.review-band-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.review-card {
  --rail: var(--utility-yellow);
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  overflow: hidden;
  text-decoration: none;
}
.review-card:hover { border-color: var(--border-strong); }
.review-card--critical { --rail: var(--utility-pink); }
.review-card--high { --rail: var(--utility-orange); }
.review-card--medium { --rail: var(--utility-yellow); }
.review-card--low { --rail: var(--utility-teal); }
.review-card-rail { flex: 0 0 3px; background: var(--rail); }
.review-card-body { display: grid; gap: var(--s-2); padding: var(--s-3); min-width: 0; }
.review-card-title { font-weight: var(--weight-medium); color: var(--text); font-size: var(--t-13); }
.review-card-meta { font-size: var(--t-11); }
.trigger-slips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
/* Trigger severity slips — deliberately distinct from priority badges: a
   notched, dashed ticket rather than a solid pill. */
.trigger-slip {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--s-2);
  height: 18px;
  font-size: var(--t-11);
  font-weight: var(--weight-medium);
  border-radius: var(--r-xs);
  border: 1px dashed var(--slip, var(--border-strong));
  color: var(--slip, var(--text-2));
  background: transparent;
}
.trigger-slip--essential { --slip: var(--danger-text); }
.trigger-slip--recommended { --slip: var(--warning-text); }
.trigger-slip--optional { --slip: var(--text-3); }

/* Mobile: rail collapses to drawer */
@media (max-width: 900px) {
  .app-shell--with-side {
    grid-template-columns: minmax(0, 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; }

/* Activities surface */
.activities-surface .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.activity-filter-card { margin-bottom: var(--s-5); }
.activity-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: var(--s-3);
  align-items: end;
}
.activity-filter-actions,
.activity-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.activity-list { display: flex; flex-direction: column; gap: var(--s-3); }
.activity-row {
  display: grid;
  grid-template-columns: var(--component-base) minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
}
.activity-row--complete { opacity: 0.76; }
.activity-row-action form { margin: 0; }
.activity-complete-button,
.activity-complete-mark {
  width: var(--component-base);
  height: var(--component-base);
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-sm);
}
.activity-complete-button {
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text-2);
  cursor: pointer;
}
.activity-complete-button:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.activity-complete-button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.activity-complete-mark { background: var(--success-soft); color: var(--success); border: 1px solid transparent; }
.activity-row-body { min-width: 0; }
.activity-row-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.activity-title { font-size: var(--t-14); font-weight: var(--weight-semibold); margin: 0; }
.activity-row--complete .activity-title { text-decoration: line-through; color: var(--text-2); }
.activity-description { margin: var(--s-2) 0 0; color: var(--text-2); font-size: var(--t-13); }
.activity-meta { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-2); color: var(--text-2); font-size: var(--t-12); }
.activity-meta span { display: inline-flex; align-items: center; gap: var(--s-1); }
.activity-meta-danger { color: var(--danger); font-weight: var(--weight-medium); }
.activity-form-surface,
.activity-detail-surface { max-width: 920px; }
.activity-form .card { margin-bottom: var(--s-5); }
.pagination-shell { margin-top: var(--s-5); }

@media (max-width: 900px) {
  .activities-surface .stat-grid,
  .activity-filter-form { grid-template-columns: 1fr; }
  .activity-filter-actions { justify-content: flex-start; }
}

/* Admin workflow rules surface */
.workflow-rules-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.workflow-rule-list { display: flex; flex-direction: column; gap: var(--s-3); }
.workflow-rule-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: var(--s-4);
  align-items: center;
}
.workflow-status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  box-shadow: 0 0 0 3px var(--bg-soft);
}
.workflow-status-dot--active { background: var(--success); }
.workflow-rule-main { min-width: 0; }
.workflow-rule-title { font-size: var(--t-15); font-weight: var(--weight-semibold); margin: 0; }
.workflow-rule-description { margin: var(--s-1) 0 0; color: var(--text-2); font-size: var(--t-12); }
.workflow-rule-badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.workflow-rule-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-1); }
.workflow-rule-actions form { margin: 0; }
.workflow-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  cursor: pointer;
  padding: 2px;
}
.workflow-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.workflow-toggle--active { background: var(--success-soft); border-color: var(--success); }
.workflow-toggle-knob {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--text-2);
  transition: transform var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
.workflow-toggle--active .workflow-toggle-knob { transform: translateX(18px); background: var(--success); }
.workflow-form-surface,
.workflow-detail-surface { max-width: 1040px; }
.workflow-builder-form { display: flex; flex-direction: column; gap: var(--s-5); }
.workflow-builder-section { display: flex; flex-direction: column; gap: var(--s-4); }
.workflow-builder-block,
.workflow-builder-stack { display: flex; flex-direction: column; gap: var(--s-3); }
.workflow-builder-copy { display: flex; flex-direction: column; gap: var(--s-1); }
.workflow-builder-copy .h-5,
.workflow-action-list .h-5 { margin: 0; }
.workflow-builder-item {
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.workflow-builder-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.workflow-builder-row--head { justify-content: space-between; }
.workflow-builder-field,
.workflow-builder-type { flex: 1 1 auto; min-width: 180px; }
.workflow-builder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}
.workflow-recipient-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); }
.workflow-match-type { margin-top: var(--s-2); }
.workflow-variable-card { background: var(--accent-soft); }
.workflow-variable-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.workflow-detail-surface .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workflow-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-5);
  margin-bottom: var(--s-5);
}
.workflow-condition-list,
.workflow-action-list {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.workflow-condition-list li,
.workflow-action-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.workflow-action-index {
  display: inline-grid;
  place-items: center;
  width: var(--component-sm);
  height: var(--component-sm);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--link);
  font-family: var(--font-mono);
  font-size: var(--t-11);
  flex-shrink: 0;
}
.workflow-action-copy { color: var(--text-2); font-size: var(--t-12); margin-top: var(--s-1); }
.workflow-action-copy p { margin: 0; }
.workflow-executions-card { margin-top: var(--s-5); }

@media (max-width: 900px) {
  .workflow-rule-row,
  .workflow-detail-grid,
  .workflow-detail-surface .stat-grid,
  .workflow-variable-grid,
  .workflow-builder-grid { grid-template-columns: 1fr; }
  .workflow-rule-meta { align-items: flex-start; }
  .workflow-builder-row { align-items: stretch; flex-direction: column; }
}

/* Notifications surface */
.notifications-surface { max-width: 920px; }
.notifications-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.notification-card { padding: 0; overflow: hidden; }
.notification-list { display: flex; flex-direction: column; }
.notification-item {
  display: grid;
  grid-template-columns: var(--component-lg) minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-4);
  border-bottom: 1px solid var(--divider);
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: var(--bg-soft); }
.notification-item--unread { background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-elev)); }
.notification-icon {
  width: var(--component-lg);
  height: var(--component-lg);
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--text-2);
}
.notification-icon--danger { background: var(--danger-soft); color: var(--danger); }
.notification-icon--warn { background: var(--warn-soft); color: var(--warn); }
.notification-icon--success { background: var(--success-soft); color: var(--success); }
.notification-icon--info { background: var(--info-soft); color: var(--info); }
.notification-body { min-width: 0; }
.notification-title { display: inline-block; margin: 0; font-size: var(--t-14); font-weight: var(--weight-semibold); }
.notification-copy { margin: var(--s-1) 0 0; color: var(--text-2); font-size: var(--t-13); }
.notification-time { margin: var(--s-2) 0 0; color: var(--text-3); font-size: var(--t-11); }
.notification-actions { display: inline-flex; align-items: center; gap: var(--s-2); }
.notification-actions form { margin: 0; }
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
}
.notification-dot--unread { background: var(--link); }
.notification-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--s-2);
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--text-inv);
  font-size: var(--t-11);
  font-weight: var(--weight-semibold);
}

@media (max-width: 640px) {
  .notification-item { grid-template-columns: var(--component-lg) minmax(0, 1fr); }
  .notification-actions { grid-column: 2; }
}

/* Checklist templates surface */
.checklist-template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.checklist-filter-card,
.checklist-description-card,
.checklist-items-card { margin-bottom: var(--s-5); }
.checklist-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(170px, 220px) auto;
  gap: var(--s-3);
  align-items: end;
}
.checklist-filter-actions,
.checklist-template-actions,
.checklist-item-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.checklist-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
.checklist-template-card { display: flex; flex-direction: column; gap: var(--s-4); }
.checklist-template-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: start;
}
.checklist-template-description { margin: 0; color: var(--text-2); font-size: var(--t-13); }
.checklist-template-meta,
.checklist-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  color: var(--text-2);
  font-size: var(--t-12);
}
.checklist-template-meta span { display: inline-flex; align-items: center; gap: var(--s-1); }
.checklist-template-form-surface,
.checklist-template-detail-surface { max-width: 1040px; }
.checklist-template-form { display: flex; flex-direction: column; gap: var(--s-5); }
.checklist-active-field { justify-content: end; }
.checklist-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checklist-item-form-panel {
  margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-5);
  padding: var(--s-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.checklist-item-form-panel .h-5 { margin: 0 0 var(--s-4); }
.checklist-item-list,
.checklist-preview-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist-preview-list li,
.checklist-item-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.checklist-preview-list li { grid-template-columns: auto minmax(0, 1fr); }
.checklist-drag-handle {
  display: inline-grid;
  place-items: center;
  width: var(--component-sm);
  height: var(--component-sm);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: grab;
}
.checklist-drag-handle:hover { background: var(--bg-elev); color: var(--text); }
.checklist-drag-handle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.checklist-item-index {
  display: inline-grid;
  place-items: center;
  width: var(--component-sm);
  height: var(--component-sm);
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: var(--t-11);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.checklist-item-body { min-width: 0; }
.checklist-item-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.checklist-item-head .h-5 { margin: 0; }
.checklist-item-copy { margin: var(--s-1) 0 0; color: var(--text-2); font-size: var(--t-13); }
.checklist-item-meta { margin-top: var(--s-2); }
.checklist-item-row-actions form { margin: 0; }

@media (max-width: 1000px) {
  .checklist-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist-filter-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .checklist-template-grid,
  .checklist-filter-form,
  .checklist-stat-grid,
  .checklist-preview-list li,
  .checklist-item-row { grid-template-columns: 1fr; }
  .checklist-template-card-head { grid-template-columns: auto minmax(0, 1fr); }
  .checklist-template-card-head .badge { grid-column: 1 / -1; justify-self: start; }
}

.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;
}
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden !important; }

/* Link modal/search surfaces */
.link-panel { margin-top: var(--s-5); }
.link-card-list,
.link-results-list { display: flex; flex-direction: column; gap: var(--s-3); }
.link-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
}
.link-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
}
.link-modal-positioner {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--s-5);
}
.link-modal {
  width: min(100%, 460px);
  padding: 0;
  overflow: hidden;
}
.link-modal-head,
.link-modal-search,
.link-role-section,
.link-modal-foot {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
}
.link-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.link-modal-foot { background: var(--bg-soft); border-bottom: 0; }
.link-role-section { display: flex; flex-direction: column; gap: var(--s-4); border-top: 1px solid var(--border); }
.link-results {
  max-height: 320px;
  overflow-y: auto;
  padding: var(--s-3);
}
.link-results-empty { margin: var(--s-5) 0; text-align: center; color: var(--text-2); font-size: var(--t-13); }
.link-result-row,
.link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}
.link-card { margin-bottom: var(--s-3); }
.link-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--component-lg);
  height: var(--component-lg);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.link-avatar--lg { width: 60px; height: 60px; }
.link-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-avatar-alert {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--danger);
  border: 2px solid var(--bg-elev);
}
.link-result-body,
.link-card-body { min-width: 0; }
.link-result-title,
.link-card-title {
  margin: 0;
  font-size: var(--t-14);
  font-weight: var(--weight-semibold);
}
.link-result-sub,
.link-card-sub,
.link-card-notes {
  margin: var(--s-1) 0 0;
  color: var(--text-2);
  font-size: var(--t-12);
}
.link-result-badges,
.link-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.link-card-actions form,
.link-result-action { margin: 0; }
.link-modal-inline { display: flex; flex-direction: column; gap: var(--s-4); }
.link-search-form { margin: 0; }
.link-errors { margin: var(--s-3); }

@media (max-width: 640px) {
  .link-result-row,
  .link-card { grid-template-columns: 1fr; }
  .link-modal-positioner { align-items: stretch; padding: var(--s-3); }
}

/* ─────────────────────────────────────────────────────────────────────────
   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; }

/* Cluster count bubbles (#234) — coloured by the dominant priority token.
   --cluster-color is set inline by the markers controller to var(--utility-*). */
.map-cluster-icon { background: transparent; border: 0; }
.map-cluster {
  display: grid; place-items: center; box-sizing: border-box;
  width: 100%; height: 100%; border-radius: 50%;
  background: color-mix(in srgb, var(--cluster-color, var(--accent)) 30%, var(--bg-elev));
  border: 2px solid var(--cluster-color, var(--accent));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), var(--shadow-sm);
  cursor: pointer;
}
.map-cluster--sm { font-size: var(--t-11); }
.map-cluster--md { font-size: var(--t-13); }
.map-cluster--lg { font-size: var(--t-15); }
.map-cluster-count {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold); color: var(--text); line-height: 1;
}
.map-cluster:hover { filter: brightness(1.08); }

/* Heatmap fallback discs (#234) — translucent priority-token density proxy when
   the leaflet.heat plugin is unavailable. */
.map-heat-disc { fill: var(--accent); }
.map-heat-disc--critical { fill: var(--utility-pink); }
.map-heat-disc--high { fill: var(--utility-orange); }
.map-heat-disc--medium { fill: var(--utility-yellow); }
.map-heat-disc--low { fill: var(--utility-teal); }

/* Priority legend (#234) — bottom-left floating key + live counts */
.map-legend {
  position: absolute; bottom: var(--s-5); left: var(--s-4); z-index: 3;
  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: 150px;
}
.map-legend-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.map-legend-title {
  font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: var(--weight-semibold);
}
.map-legend-total { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); font-size: var(--t-13); }
.map-legend-list { margin-top: var(--s-3); flex-direction: column; gap: var(--s-2); }
.map-legend .priority-legend-item { justify-content: flex-start; width: 100%; }
.map-legend-swatch {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto;
  background: color-mix(in srgb, var(--legend-color, var(--accent)) 22%, transparent);
  border: 2px solid var(--legend-color, var(--accent)); box-sizing: border-box;
}
.map-legend-label { flex: 1 1 auto; color: var(--text-2); }
.map-legend .priority-legend-count { margin-left: auto; }

/* Viewport controls (#234) — bottom-centre search-this-area + recenter */
.map-viewport-controls {
  position: absolute; bottom: var(--s-5); left: 50%; transform: translateX(-50%);
  z-index: 3; display: inline-flex; gap: var(--s-2);
}
.map-viewport-controls .btn {
  background: var(--bg-elev); box-shadow: var(--shadow-md);
}
.map-search-area { gap: var(--s-2); }

/* 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; }
}

/* ----- Live Map hover popover (#235) -----
   The Leaflet tooltip wrapper is restyled into a dark command-theme card; the
   inner markup is the shared `_report` partial rendered in :popover context. */
.leaflet-tooltip.map-popover-tooltip {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  padding: 0;
  white-space: normal;
}
.leaflet-tooltip.map-popover-tooltip::before { display: none; }

.report-popover {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: min(240px, 60vw);
  padding: var(--s-3);
}
.report-popover-head { display: flex; align-items: center; gap: var(--s-2); }
.report-popover-title {
  font-size: var(--t-13);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.report-popover-w3w {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s-1) var(--s-2);
}
.report-popover-w3w-value {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  color: var(--accent); font-size: var(--t-12);
}
.report-popover-meta {
  display: flex; justify-content: space-between; gap: var(--s-2);
  font-size: var(--t-12); color: var(--text-2);
}
.report-popover-guard { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- Live Map select dossier (#235) -----
   The dossier markup is the shared `_report` partial in :dossier context,
   injected into the BC2026::Sheet (#249) body. */
.map-dossier-body { display: block; }
.report-dossier { display: flex; flex-direction: column; gap: var(--s-4); }
.report-dossier-headline { display: flex; align-items: center; gap: var(--s-2); }
.report-dossier-title {
  margin: 0;
  font-size: var(--t-15);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.report-dossier-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.report-dossier-section { display: flex; flex-direction: column; gap: var(--s-2); }
.report-dossier-label {
  margin: 0;
  font-size: var(--t-11);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3, var(--text-2));
}
.report-dossier-w3w {
  display: flex; align-items: center; gap: var(--s-2);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s-2) var(--s-3);
}
.report-dossier-w3w-value {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  color: var(--accent); font-size: var(--t-13);
}
.report-dossier-coords { margin: 0; font-size: var(--t-12); }
.report-dossier-empty { margin: 0; font-size: var(--t-12); }
.report-dossier-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); margin: 0;
}
.report-dossier-cell {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: var(--s-2) var(--s-3);
}
.report-dossier-cell dt {
  font-size: var(--t-11); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em;
}
.report-dossier-cell dd { margin: var(--s-1) 0 0; font-size: var(--t-13); color: var(--text); }
.report-dossier-chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.report-dossier-chain-item {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-12);
}
.report-dossier-chain-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-dossier-chain-type { flex: 0 0 auto; font-size: var(--t-11); }
.report-dossier-actions { display: flex; gap: var(--s-2); }
.report-dossier-actions .report-action { flex: 1 1 auto; justify-content: center; }

/* Mobile: the dossier side sheet drops to a focus-trapped bottom sheet. We
   re-anchor `.map-dossier .sheet--side` here rather than editing the shared
   #249 sheet component, so its slide-in chrome/focus handling is preserved. */
@media (max-width: 767px) {
  .map-dossier .sheet--side {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-top: 0;
    animation: sheet-rise var(--motion-base) var(--ease-emphasized);
  }
}
@media (prefers-reduced-motion: reduce) {
  .map-dossier .sheet--side { animation: 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; }
}

/* ===================== Sheets, slide-ins & action menus (#249) =====================
 *
 * Reusable modal task surfaces for capture views. Rendered by BC2026::Sheet and
 * BC2026::ActionMenu, driven by the shared `capture-sheet` Stimulus controller.
 * Authored inside @layer components so component rules sit at the established
 * precedence (#223) and can be overridden by utilities/native/platform layers.
 *
 * Surfaces are hidden by default (the [hidden] attribute) and revealed when the
 * controller toggles `.is-open` on the wrapper — so without JS no surface
 * obscures primary content. Backdrop, Escape, focus-trap and aria wiring live in
 * the controller; this stylesheet only describes the dark command-theme chrome.
 */
@layer components {
  .sheet-wrap { position: relative; }

  /* Dimmed backdrop shared by sheets and menus. */
  .sheet-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    border: 0;
    z-index: 60;
    animation: sheet-fade var(--motion-fast) var(--ease-standard);
  }
  .sheet-backdrop[hidden] { display: none; }

  /* ----- Bottom sheet / slide-in panel ----- */
  .sheet {
    position: fixed;
    z-index: 61;
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    color: var(--text);
  }
  .sheet[hidden] { display: none; }

  /* Bottom sheet — anchored to the bottom edge, safe-area aware (mobile-first). */
  .sheet--bottom {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: max(var(--s-5), var(--custom-safe-inset-bottom));
    animation: sheet-rise var(--motion-base) var(--ease-emphasized);
  }

  /* Slide-in panel — anchored to the trailing edge, full height. */
  .sheet--side {
    inset: 0 0 0 auto;
    width: min(420px, 92vw);
    max-height: 100dvh;
    border-radius: var(--r-lg) 0 0 var(--r-lg);
    padding-top: max(var(--s-5), var(--custom-safe-inset-top));
    padding-bottom: max(var(--s-5), var(--custom-safe-inset-bottom));
    animation: sheet-slide var(--motion-base) var(--ease-emphasized);
  }

  /* Desktop: centre the bottom sheet into a contained dialog so it doesn't span
     the full width and obscure content. */
  @media (min-width: 768px) {
    .sheet--bottom {
      inset: auto 0 var(--s-7) 0;
      width: min(480px, 92vw);
      margin: 0 auto;
      border-radius: var(--r-lg);
    }
  }

  .sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border);
  }
  .sheet-title { margin: 0; font-size: var(--t-16); font-weight: var(--weight-semibold); }
  .sheet-close { flex: 0 0 auto; }

  .sheet-body {
    padding: var(--s-5);
    overflow-y: auto;
    color: var(--text-2);
    font-size: var(--t-13);
  }

  .sheet-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--s-2);
    padding: var(--s-4) var(--s-5);
    border-top: 1px solid var(--border);
  }
  .sheet-foot-form { display: contents; }

  /* ----- Overflow action menu ----- */
  .menu {
    position: absolute;
    top: calc(100% + var(--s-2));
    min-width: 200px;
    padding: var(--s-1);
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 61;
    animation: sheet-fade var(--motion-fast) var(--ease-standard);
  }
  .menu[hidden] { display: none; }
  .menu--end { right: 0; }
  .menu--start { left: 0; }

  .menu-item-form { display: block; }

  .menu-item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    padding: var(--s-2) var(--s-3);
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--t-13);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .menu-item:hover,
  .menu-item:focus-visible {
    background: var(--bg-soft);
    outline: none;
  }
  .menu-item:focus-visible { box-shadow: var(--shadow-focus); }

  /* Destructive actions read clearly against the default items. */
  .menu-item--destructive { color: var(--danger); }
  .menu-item--destructive:hover,
  .menu-item--destructive:focus-visible {
    background: color-mix(in srgb, var(--danger) 14%, transparent);
  }

  .menu-item-label { flex: 1 1 auto; }

  /* Mobile: promote the overflow menu to a bottom sheet so touch targets are
     comfortable and the menu never clips off-screen. */
  @media (max-width: 640px) {
    .menu {
      position: fixed;
      inset: auto 0 0 0;
      top: auto;
      min-width: 0;
      width: 100%;
      padding: var(--s-2) var(--s-2) max(var(--s-3), var(--custom-safe-inset-bottom));
      border-radius: var(--r-lg) var(--r-lg) 0 0;
      animation: sheet-rise var(--motion-base) var(--ease-emphasized);
    }
    .menu-item { padding: var(--s-3); }
  }

  @keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes sheet-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
  @keyframes sheet-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }

  @media (prefers-reduced-motion: reduce) {
    .sheet--bottom, .sheet--side, .menu, .sheet-backdrop { animation: none; }
  }
}

/* The location confirmation is part of the full-screen picker's flex layout,
 * not a shared modal sheet. Keep this override after the shared sheet rules so
 * their fixed positioning cannot pull it out of flow. Isolating the map in a
 * lower stacking context also contains Leaflet's z-indexed panes; otherwise
 * they paint over the enabled Confirm button while its DOM box remains visible. */
@layer components {
  .capture-location-overlay > .capture-location-map {
    position: relative;
    z-index: 0;
  }

  .capture-location-overlay > .capture-location-sheet {
    position: relative;
    inset: auto;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--shadow-lg);
    animation: none;
    transform: none;
  }
}

/* ===================== Command palette (#238) =====================
 *
 * Native <dialog> command palette opened by ⌘K / Ctrl+K / "/". Authored inside
 * @layer components so it sits at the established component precedence (#223).
 * Tokens only — no raw brand colours. The keycap hints reuse the .kbd keycap
 * from #223 and are hidden on touch devices via @media (any-hover: none) below.
 */
@layer components {
  .cmdk {
    width: min(560px, calc(100vw - var(--s-7)));
    max-width: 560px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-elev);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    /* Native <dialog> centres horizontally; nudge it to the upper third. */
    margin: 12vh auto auto;
  }
  .cmdk::backdrop { background: var(--bg-overlay); }
  .cmdk:not([open]) { display: none; }

  .cmdk-panel { display: flex; flex-direction: column; max-height: 70vh; }

  .cmdk-search {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--divider);
  }
  .cmdk-search-icon { display: inline-grid; place-items: center; color: var(--text-3); }
  .cmdk-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--t-15);
  }
  .cmdk-input::placeholder { color: var(--text-3); }
  .cmdk-input:focus { outline: none; }

  .cmdk-results { overflow-y: auto; padding: var(--s-2); }
  .cmdk-list[hidden] { display: none; }
  .cmdk-empty { margin: 0; padding: var(--s-5) var(--s-4); font-size: var(--t-13); color: var(--text-3); text-align: center; }

  .cmdk-group { margin-bottom: var(--s-2); }
  .cmdk-group-heading {
    padding: var(--s-2) var(--s-3) var(--s-1);
    font-size: var(--t-11);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    font-weight: var(--weight-semibold);
  }

  .cmdk-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    color: var(--text);
    text-decoration: none;
    font-size: var(--t-13);
    cursor: pointer;
  }
  .cmdk-row:hover,
  .cmdk-row.is-active {
    background: var(--accent-soft);
  }
  .cmdk-row.is-active { outline: 1px solid var(--accent); outline-offset: -1px; }

  .cmdk-row-type {
    flex: none;
    display: inline-grid;
    place-items: center;
    min-width: 56px;
    padding: 1px var(--s-2);
    border-radius: var(--r-xs);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-3);
    font-size: var(--t-11);
    text-transform: capitalize;
  }
  .cmdk-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmdk-row-meta { flex: none; color: var(--text-3); font-size: var(--t-11); }

  .cmdk-foot {
    display: flex;
    gap: var(--s-4);
    padding: var(--s-2) var(--s-4);
    border-top: 1px solid var(--divider);
    font-size: var(--t-11);
    color: var(--text-3);
  }
  .cmdk-foot-hint { display: inline-flex; align-items: center; gap: var(--s-1); }
  .cmdk-hint { margin-left: auto; }
}

/* Hide keycap hints on touch devices: a `kbd` hotkey hint is meaningless where
 * there's no physical keyboard (#238). Covers the shared #223 .kbd keycap and
 * the legacy .topbar-kbd, so every keyboard hint disappears under any-hover. */
@media (any-hover: none) {
  .kbd,
  .topbar-kbd,
  .cmdk-foot { display: none; }
}

/* ============================================================================
   Capture object components (#225)
   One structural shell (.capture-object), restyled by variant. Shared by the
   location proof, report registers, evidence chain, subject brief, and the
   declaration seal so each capture "object" reads as a distinct component while
   reusing one partial.
   ========================================================================= */
@layer components {
  .capture-object {
    margin-top: var(--s-4);
    padding: var(--s-4);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
  }
  .capture-object-eyebrow { margin: 0 0 var(--s-3); }
  .capture-object-body { display: block; }

  /* AC1 — Location proof: mono w3w + GPS/site, precision states. */
  .capture-object--location-proof { border-left: 3px solid var(--border-strong); }
  .capture-proof-grid { display: grid; gap: var(--s-2); }
  .capture-proof-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  }
  .capture-proof-label { color: var(--text-3); font-size: var(--t-12); }
  .capture-proof-w3w,
  .capture-proof-coords {
    font-family: var(--font-mono); font-size: var(--t-12); color: var(--text); text-align: right;
  }
  .capture-proof-site { color: var(--text-2); font-size: var(--t-12); text-align: right; }
  .capture-proof-w3w[data-empty="true"],
  .capture-proof-coords[data-empty="true"],
  .capture-proof-site[data-empty="true"] { color: var(--text-3); font-style: italic; }
  .capture-proof-state {
    display: flex; align-items: center; gap: var(--s-2); margin: var(--s-2) 0 0; font-size: var(--t-12);
  }
  .capture-proof-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
  .capture-object--location-proof[data-precision="verified"] { border-left-color: var(--success); }
  .capture-object--location-proof[data-precision="verified"] .capture-proof-state-dot { background: var(--success); }
  .capture-object--location-proof[data-precision="verified"] .capture-proof-state-text { color: var(--success-text); }
  .capture-object--location-proof[data-precision="human"] { border-left-color: var(--warn); }
  .capture-object--location-proof[data-precision="human"] .capture-proof-state-dot { background: var(--warn); }
  .capture-object--location-proof[data-precision="human"] .capture-proof-state-text { color: var(--warning-text); }
  .capture-object--location-proof[data-precision="missing"] { border-left-color: var(--danger); }
  .capture-object--location-proof[data-precision="missing"] .capture-proof-state-dot { background: var(--danger); }
  .capture-object--location-proof[data-precision="missing"] .capture-proof-state-text { color: var(--danger-text); }

  /* AC2 — Source vs record registers, visually distinct. */
  .capture-registers { display: grid; gap: var(--s-3); }
  @media (min-width: 480px) { .capture-registers { grid-template-columns: 1fr 1fr; } }
  .capture-register { padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); }
  .capture-register--source {
    background: color-mix(in srgb, var(--info) 8%, var(--bg-soft));
    border-color: color-mix(in srgb, var(--info) 30%, var(--border));
  }
  .capture-register--source .capture-register-text { font-style: italic; }
  .capture-register--record {
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-soft));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  }
  .capture-register-head {
    margin: 0 0 var(--s-2); font-size: var(--t-11); text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-3);
  }
  .capture-register--source .capture-register-head { color: var(--info); }
  .capture-register--record .capture-register-head { color: var(--accent); }
  .capture-register-text { margin: 0; color: var(--text); font-size: var(--t-13); }
  .capture-register-text--muted { color: var(--text-3); }
  .capture-register-sub { margin: var(--s-2) 0 0; color: var(--text-3); font-size: var(--t-11); }
  .capture-register-facts { margin: 0; display: grid; gap: var(--s-2); }
  .capture-register-fact dt { color: var(--text-3); font-size: var(--t-11); }
  .capture-register-fact dd { margin: 0; color: var(--text); font-size: var(--t-13); }

  /* AC3 — Evidence chain: horizontal scroll-snap, colour derived per kind. */
  .capture-evidence-chain {
    display: flex; gap: var(--s-3); margin: 0; padding: 0 var(--s-1) var(--s-2);
    list-style: none; overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .capture-evidence-link {
    --kind: var(--text-3);
    flex: 0 0 auto; width: 9.5rem; scroll-snap-align: start;
    display: flex; flex-direction: column; gap: var(--s-1);
    padding: var(--s-3); border-radius: var(--r-md);
    background: color-mix(in oklab, var(--kind) 14%, transparent);
    border: 1px solid color-mix(in oklab, var(--kind) 38%, transparent);
  }
  .capture-evidence-kind {
    font-size: var(--t-11); text-transform: uppercase; letter-spacing: 0.04em; color: var(--kind);
  }
  .capture-evidence-title { font-size: var(--t-13); color: var(--text); }
  .capture-evidence-ref { font-family: var(--font-mono); font-size: var(--t-11); color: var(--text-2); }
  .capture-evidence-link[data-evidence-kind="photo"] { --kind: var(--accent); }
  .capture-evidence-link[data-evidence-kind="original_audio"] { --kind: var(--info); }
  .capture-evidence-link[data-evidence-kind="source_transcript"] { --kind: var(--success); }
  .capture-evidence-link[data-evidence-kind="translated_transcript"] { --kind: var(--success); }
  .capture-evidence-link[data-evidence-kind="location_proof"] { --kind: var(--warn); }
  .capture-evidence-link[data-evidence-kind="witness_detail"] { --kind: var(--info); }
  .capture-evidence-link[data-evidence-kind="cctv_reference"] { --kind: var(--danger); }
  .capture-evidence-link[data-evidence-kind="bodycam_reference"] { --kind: var(--danger); }
  .capture-evidence-link[data-evidence-kind="other_reference"] { --kind: var(--text-3); }

  /* Live photo previews share the same horizontal scroll-snap chain. */
  .capture-thumbs {
    display: flex; gap: var(--s-2); overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .capture-thumbs > * { flex: 0 0 auto; scroll-snap-align: start; }

  /* AC4 — Subject brief: provisional / guard-created shown as dashed. */
  .capture-subject-briefs { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
  .capture-subject-brief {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2);
    padding: var(--s-3); border-radius: var(--r-md);
    background: var(--bg-soft); border: 1px solid var(--border);
  }
  .capture-subject-brief-name { color: var(--text); font-weight: 600; }
  .capture-subject-brief-role { color: var(--text-2); font-size: var(--t-12); }
  .capture-subject-brief[data-provisional="true"] {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--warn) 45%, var(--border));
    background: color-mix(in srgb, var(--warn) 6%, var(--bg-soft));
  }
  .capture-subject-brief-flag { margin-left: auto; color: var(--warn); font-size: var(--t-11); }

  /* AC5 — Declaration seal: stamp, sealed (immutable) once declared. */
  .capture-declaration-stamp {
    margin-top: var(--s-3); padding: var(--s-4);
    border: 2px solid var(--border-strong); border-radius: var(--r-lg);
    background: var(--bg-soft);
  }
  .capture-declaration-stamp--sealed {
    border-style: double; border-width: 3px;
    border-color: color-mix(in srgb, var(--success) 55%, var(--border-strong));
    background: color-mix(in srgb, var(--success) 8%, var(--bg-soft));
    text-align: center;
  }
  .capture-declaration-seal-mark {
    display: inline-block; transform: rotate(-6deg);
    margin-bottom: var(--s-2); padding: var(--s-1) var(--s-3);
    border: 2px solid var(--success); border-radius: var(--r-sm);
    color: var(--success); font-family: var(--font-mono);
    font-weight: 700; letter-spacing: 0.14em; font-size: var(--t-14);
  }
  .capture-declaration-seal-text { margin: 0; color: var(--text-2); font-size: var(--t-12); }
}
/* Application stylesheet — manifest (#223).
 *
 * Required sheets first (order is load-bearing: `layers` declares the cascade
 * layer order and MUST come before any layered rules; `tokens/bc2026-command`
 * holds the design-system tokens + component rules):
 *





 *
 * Below: page/component rules that live in this sheet. Rules whose selectors do
 * NOT overlap anything in the token sheet are wrapped in `@layer components` so
 * they sit at the established component precedence. `.capture-home` /
 * `.passkeys-page` and `.alert` / `.alert--success` have a BARE same-selector
 * rule UNLAYERED in `tokens/bc2026-command.css`; since unlayered rules always
 * outrank layered ones, wrapping those here would flip which declaration wins,
 * so they stay UNLAYERED. `.icon` has no bare conflict and is kept unlayered
 * only as a conservative simplicity choice. See the unlayered block below (and
 * PR #262 / issue #223) for the full overlap audit.
 *
 * Visual-regression safety net: the Playwright gate (spec/visual) that would
 * confirm "renders unchanged" is temporarily disabled — its baselines fail on a
 * ~4px CI-environment rendering delta, tracked in #263. Until that's fixed, the
 * unlayered audit above is the guard against a precedence regression here.
 */

/* ─────────────────────────────────────────────────────────────────────────
   Migrated component rules — non-overlapping selectors, safe to layer.
   ───────────────────────────────────────────────────────────────────── */
@layer components {
  .auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    /* Honour device safe-area insets so the panel never sits under the
       notch / home indicator on mobile, matching the capture shell (#251). */
    padding:
      calc(var(--s-8) + var(--custom-safe-inset-top, 0px))
      calc(var(--s-5) + var(--custom-safe-inset-right, 0px))
      calc(var(--s-8) + var(--custom-safe-inset-bottom, 0px))
      calc(var(--s-5) + var(--custom-safe-inset-left, 0px));
    background: var(--bg);
    color: var(--text);
  }

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

  .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 {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
  }

  .auth-alert-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    margin-top: 1px;
  }

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

  /* Post-login signpost — quiet, supportive, never competes with the forms. */
  .auth-next {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    margin-top: var(--s-6);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--bg-elev);
  }

  .auth-next-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    margin-top: 1px;
    color: var(--accent);
  }

  .auth-next-copy {
    margin: 0;
    font-size: var(--t-13);
    line-height: 1.45;
    color: var(--text-2);
  }

  .auth-next-copy strong {
    color: var(--text);
    font-weight: var(--weight-medium);
  }

  /* Footer support / privacy links — present but understated. */
  .auth-foot {
    margin-top: var(--s-6);
    text-align: center;
  }

  .auth-foot-links {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--t-13);
    color: var(--text-3);
  }

  .auth-foot-links a {
    color: var(--text-2);
    text-decoration: none;
  }

  .auth-foot-links a:hover {
    color: var(--text);
    text-decoration: underline;
  }

  .auth-foot-sep {
    color: var(--text-3);
  }

  .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);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Unlayered — kept out of @layer components on purpose (#223). See the overlap
   audit in PR #262 / issue #223 before moving any of these.

   Genuine precedence traps — a BARE same-selector rule also exists UNLAYERED in
   the token sheet, so layering here would let that unlayered rule win and flip
   the effective declaration:
     · .capture-home — token sheet has a conflicting unlayered `.capture-home`
       (flex-column vs this sheet's grid layout)
     · .alert / .alert--success — token sheet has conflicting unlayered `.alert*`
   .passkeys-page has NO bare token-sheet conflict of its own; it only shares a
   grouped selector block with .capture-home below, so it is kept unlayered with
   it for consistency (splitting the group to layer just .passkeys-page would be
   safe but needless).

   Not a real conflict, kept unlayered as a conservative simplicity choice:
     · .icon — the token sheet has NO bare `.icon`; only higher-specificity
       compound rules (`.nav-tab .icon`, `.stat-icon .icon`, …) that win via
       specificity regardless of layer order. Safe to layer later if desired.
   ───────────────────────────────────────────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}

.capture-home,
.passkeys-page {
  min-height: 100vh;
  width: 100%;
  min-width: 0;
  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;
}

.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));
}
