
/* 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(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.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(images/marker-icon.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;
		}
	}

:root {
  color-scheme: light dark;
  background-color: var(
    --background,
    var(--color-background-primary, light-dark(rgb(255 255 255), rgb(24 24 24)))
  ) !important;

  /* Agent-facing contract; keep in sync with SKILL.md. */
  --background: var(
    --color-background-primary,
    light-dark(rgb(255 255 255), rgb(24 24 24))
  );
  --foreground: var(
    --color-text-primary,
    light-dark(rgb(26 28 31), rgb(255 255 255))
  );
  --card: color-mix(in oklab, var(--foreground) 5%, var(--background));
  --card-foreground: var(
    --color-text-primary,
    light-dark(rgb(26 28 31), rgb(255 255 255))
  );
  --popover: var(
    --color-background-secondary,
    light-dark(rgb(255 255 255), rgb(45 45 45))
  );
  --popover-foreground: var(
    --color-text-primary,
    light-dark(rgb(26 28 31), rgb(255 255 255))
  );
  --primary: var(
    --color-text-info,
    light-dark(rgb(51 156 255), rgb(131 195 255))
  );
  --primary-foreground: var(
    --color-text-inverse,
    light-dark(rgb(255 255 255), rgb(13 13 13))
  );
  --secondary: var(
    --color-background-secondary,
    light-dark(rgb(255 255 255 / 96%), rgb(54 54 54 / 96%))
  );
  --secondary-foreground: var(
    --color-text-primary,
    light-dark(rgb(26 28 31), rgb(255 255 255))
  );
  --muted: color-mix(in srgb, var(--foreground) 10%, transparent);
  --muted-foreground: var(
    --color-text-secondary,
    light-dark(rgb(26 28 31 / 49.4%), rgb(255 255 255 / 49.8%))
  );
  --accent: var(
    --color-background-info,
    light-dark(rgb(229 242 255), rgb(13 39 63))
  );
  --accent-foreground: var(
    --color-text-info,
    light-dark(rgb(51 156 255), rgb(131 195 255))
  );
  --destructive: var(
    --color-text-warning,
    light-dark(rgb(226 85 7), rgb(255 133 73))
  );
  --border: var(
    --color-border-secondary,
    light-dark(rgb(26 28 31 / 8%), rgb(255 255 255 / 8.2%))
  );
  --input: var(
    --color-border-primary,
    light-dark(
      rgb(26 28 31 / 11.8%),
      color-mix(in oklab, rgb(0 0 0) 10%, transparent)
    )
  );
  --ring: var(
    --color-ring-primary,
    light-dark(rgb(51 156 255), rgb(131 195 255 / 76%))
  );
  --font-size-base: var(--font-text-md-size, 14px);
  --blue: light-dark(rgb(51 156 255), rgb(51 156 255));
  --orange: light-dark(rgb(226 85 7), rgb(251 106 34));
  --green: light-dark(rgb(0 162 64), rgb(64 201 119));
  --red: light-dark(rgb(224 46 42), rgb(255 103 100));
  --purple: light-dark(rgb(146 79 247), rgb(173 123 249));
  --yellow: light-dark(rgb(255 195 0), rgb(255 210 64));
  --viz-series-1: var(--primary);
  --viz-series-2: light-dark(rgb(243 136 59), rgb(245 154 86));
  --viz-series-3: light-dark(rgb(93 201 119), rgb(116 213 139));
  --viz-series-4: light-dark(rgb(235 119 177), rgb(240 143 192));
  --viz-series-5: light-dark(rgb(155 121 236), rgb(170 145 239));
  --viz-series-6: light-dark(rgb(58 185 177), rgb(90 203 194));

  /* Internal implementation variables; not part of the agent contract. */
  --font-sans: -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
  --font-size-normal: max(11px, var(--font-size-base));
  --font-size-tooltip: calc(var(--font-size-base) - 1px);
  --font-size-small: max(11px, calc(var(--font-size-base) - 2px));
  --font-size-h1: calc(var(--font-size-normal) * 1.7142857143);
  --font-size-h2: calc(var(--font-size-normal) * 1.4285714286);
  --font-size-h3: calc(var(--font-size-normal) * 1.2857142857);
  --font-weight-normal: 430;
  --font-weight-medium: 500;
  --icon-size: 16px;
  --line-height-normal: calc(var(--font-size-normal) * 1.5);
  --line-height-tooltip: calc(var(--font-size-tooltip) * 1.4285714286);
  --line-height-small: calc(var(--font-size-small) + 4px);
  --corner-shape: round;
  --radius: var(--border-radius-lg, 10px);
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-2xl: calc(var(--radius) * 1.6);
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px -1px rgb(0 0 0 / 8%);
  --checkmark-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3E%3Cpath d='M12.8961 3.64101C13.1297 3.41418 13.4984 3.37523 13.7779 3.56581C14.0571 3.75635 14.1554 4.11331 14.0299 4.41347L13.9615 4.53847L7.71151 13.7045C7.59411 13.8767 7.4063 13.9877 7.19881 14.0072C6.99136 14.0267 6.78564 13.9533 6.63826 13.806L2.88826 10.056L2.79842 9.9457C2.6192 9.67407 2.64927 9.30496 2.88826 9.06581C3.12738 8.82669 3.49647 8.79676 3.76815 8.97597L3.8785 9.06581L7.03084 12.2182L12.8053 3.74941L12.8961 3.64101Z'/%3E%3C/svg%3E");

  /* Legacy aliases; not part of the current agent contract. */
  --viz-bg: transparent;
  --viz-panel: var(--card);
  --viz-border: var(--border);
  --viz-text: var(--foreground);
  --viz-muted: var(--muted-foreground);
  --viz-accent: var(--primary);
  --viz-accent-text: var(--primary-foreground);
  --viz-accent-bg: var(--accent);
  --viz-font-size: var(--font-size-base);
  --viz-warning: var(--destructive);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html > body {
  /* Preserve MCP aliases for older inline renderers without creating :root cycles. */
  --color-background-primary: var(
    --background,
    light-dark(rgb(255 255 255), rgb(24 24 24))
  );
  --color-text-primary: var(
    --foreground,
    light-dark(rgb(26 28 31), rgb(255 255 255))
  );
  --color-border-secondary: var(
    --border,
    light-dark(rgb(26 28 31 / 8%), rgb(255 255 255 / 8.2%))
  );

  margin: 0;
  padding: var(--visualize-paint-gutter, 0px);
  color: var(--foreground);
  background: transparent !important;
  font-family: var(--font-sans) !important;
  font-size: var(--font-size-normal);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
}

:root:not([data-app-block-surface], [data-visualize-standalone]) > body {
  padding: 12px;
}

a {
  color: color-mix(in srgb, var(--viz-accent) 80%, var(--viz-text) 20%);
  cursor: pointer;
  font-weight: var(--font-weight-medium, 500);
  text-decoration: none;
  text-underline-offset: 2px;
}

a:is(:hover, :focus-visible) {
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 0.5px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin-block: 0;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

h3,
h4,
h5,
h6 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

b,
strong,
th {
  font-weight: var(--font-weight-medium);
}

code:not(pre code) {
  display: inline;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  corner-shape: var(--corner-shape);
  background: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  word-break: break-word;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--foreground);
  font: inherit;
  text-align: start;
}

.table :is(th, td) {
  padding-block: 10px;
  padding-inline: 0 24px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.table-responsive > .table :is(th, td) {
  overflow-wrap: break-word;
}

.table :is(th, td):last-child {
  padding-inline-end: 0;
}

.table :is(caption, thead th) {
  font-weight: 600;
}

.table thead th {
  padding-block: 8px;
  border-bottom-color: color-mix(in srgb, var(--foreground) 16%, transparent);
}

.table tbody tr:last-child :is(th, td) {
  border-bottom: 0;
}

.table.table-sm :is(th, td) {
  padding-block: 6px;
}

.table.table-sm :is(th, td):not(:last-child) {
  padding-inline-end: 16px;
}

.table :is(.text-end, [align="right"]) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.table :is(.text-center, [align="center"]) {
  text-align: center;
}

.table .text-nowrap {
  white-space: nowrap;
}

#widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: transparent !important;
}

.card {
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  overflow-wrap: break-word;
  border-radius: var(--radius-2xl);
  corner-shape: var(--corner-shape);
  color: var(--card-foreground);
  background: var(--card);
}

#widget > :not(.card, .progress) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.tooltip {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(
    20rem,
    var(--tooltip-available-width, calc(100vw - 10px)),
    calc(100vw - 10px)
  );
  max-height: min(
    var(--tooltip-available-height, calc(100vh - 10px)),
    calc(100vh - 10px)
  );
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  corner-shape: var(--corner-shape);
  color: var(--popover-foreground);
  background: var(--popover);
  box-shadow: none;
  font-size: var(--font-size-tooltip);
  line-height: var(--line-height-tooltip);
  overflow-wrap: break-word;
  white-space: normal;
  pointer-events: none;
  user-select: none;
}

/* The shared runtime owns data-tooltip; suppress AppBlock's pseudo-tooltip. */
main [data-tooltip]::after {
  content: none;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(max(180px, 24%), 1fr));
  gap: 10px;
}

.viz-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viz-stat-value {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

.viz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

hr {
  width: 100%;
  height: 1px;
  margin-block: 6px;
  border: 0;
  background: var(--border);
}

.nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.progress {
  display: flex;
  height: 8px;
  margin-block: calc((var(--line-height-normal, 1.5em) - 8px) / 2);
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--muted);
}

.progress-bar:only-child {
  border-radius: var(--radius-full);
}

.progress-bar {
  height: 100%;
  flex-shrink: 0;
  border: 0;
  background: var(--viz-series-1);
}

.viz-badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: var(--accent-foreground);
  background: var(--accent);
  font-weight: var(--font-weight-medium);
}

small,
.text-small,
.viz-badge {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
}

.text-muted {
  color: var(--muted-foreground);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

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

.viz-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.viz-controls > .form-label {
  display: grid;
  min-width: min(100%, 260px);
  flex: 1 1 280px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 12px;
  margin-bottom: 0;
}

.viz-controls > .form-label > :is(.form-control, .form-range, .form-select) {
  grid-column: 1 / -1;
}

.btn,
.nav-link,
.form-check-input,
.form-control,
.form-range,
.form-select {
  font: inherit;
}

.btn,
.nav-link {
  appearance: button;
  display: inline-flex;
  inline-size: fit-content;
  max-inline-size: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0 8px;
  -webkit-app-region: no-drag;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  corner-shape: var(--corner-shape);
  color: var(--secondary-foreground);
  background: var(--secondary);
  cursor: var(--cursor-interaction, pointer);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.btn:is(.btn-block, .viz-tile) {
  inline-size: 100%;
}

.btn.viz-tile {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

a.btn {
  cursor: pointer;
  text-decoration: none;
}

.btn:not(:disabled):hover,
.nav-link:not(:disabled):not([aria-disabled="true"]):hover {
  background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
}

.btn-primary {
  border-color: transparent;
  color: var(--primary-foreground);
  background: var(--foreground);
  background-clip: padding-box;
}

.btn-primary .text-muted {
  color: color-mix(in srgb, var(--primary-foreground) 50%, transparent);
}

.btn-primary:not(:disabled):hover {
  background: color-mix(in srgb, var(--foreground) 80%, transparent);
  background-clip: padding-box;
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted-foreground);
  background: transparent;
}

.btn-ghost:not(:disabled):hover {
  color: var(--foreground);
  background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
}

.nav-pills .nav-link {
  min-width: 0;
  border-color: transparent;
  color: var(--muted-foreground);
  background: transparent;
}

.nav-justified .nav-link {
  flex: 1 1 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.nav-pills .nav-link.active {
  color: var(--foreground);
  background: var(--muted);
}

.btn:disabled,
.nav-link:disabled,
.nav-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.4;
}

[data-lucide] {
  stroke-width: 1.6;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--foreground);
}

.form-control {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  outline: none;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  corner-shape: var(--corner-shape);
  color: var(--foreground);
  background: var(--secondary);
}

.form-control::placeholder {
  color: var(--muted-foreground);
}

.form-control[type="file"] {
  padding: 0;
  overflow: hidden;
  cursor: var(--cursor-interaction, pointer);
}

.form-control[type="file"]::file-selector-button {
  min-height: 26px;
  margin-right: 8px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--input);
  color: var(--secondary-foreground);
  background: var(--secondary);
  cursor: inherit;
  font: inherit;
}

.form-control[type="file"]:not(:disabled):hover::file-selector-button {
  background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
}

.form-control-color[type="color"] {
  width: 40px;
  height: 28px;
  padding: 3px;
  cursor: var(--cursor-interaction, pointer);
}

.form-control-color[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.form-control-color[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: calc(var(--radius-lg) - 4px);
  corner-shape: var(--corner-shape);
}

textarea.form-control {
  height: auto;
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}

.form-control:focus-visible {
  border-color: var(--ring);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.form-control:disabled,
.form-select:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.form-select {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 28px;
  margin: 0;
  padding: 0 32px 0 8px;
  outline: none;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  corner-shape: var(--corner-shape);
  color: var(--foreground);
  background-color: var(--secondary);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 4px 4px;
  cursor: var(--cursor-interaction, default);
}

.form-select:not(:disabled):hover {
  background-color: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
}

.form-select:focus-visible {
  border-color: var(--ring);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.form-check {
  display: flex;
  min-height: 20px;
  align-items: center;
  gap: 6px;
}

.form-check-input {
  appearance: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--input);
  color: var(--primary-foreground);
  background-color: transparent;
  cursor: var(--cursor-interaction, default);
  transition:
    background-color 150ms,
    border-color 150ms,
    box-shadow 150ms;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"] {
  border-color: var(--input);
  border-radius: var(--radius-sm);
  corner-shape: var(--corner-shape);
  background-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.form-check:not(.form-switch)
  .form-check-input:not(:disabled):not(:checked):hover {
  background-color: var(--card);
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked {
  border-color: var(--primary);
  background-color: var(--primary);
}

.form-check:not(.form-switch)
  .form-check-input[type="checkbox"]:checked::before {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--primary-foreground);
  content: "";
  mask: var(--checkmark-image) center / 12px 12px no-repeat;
}

.form-check-input[type="radio"] {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
}

.form-check-input[type="radio"]:checked {
  border: 2px solid var(--primary);
  background:
    radial-gradient(circle, var(--primary-foreground) 0 2.5px, transparent 3px),
    var(--primary);
}

.form-check:not(.form-switch) .form-check-input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.form-check:not(.form-switch) .form-check-input:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.form-check:not(.form-switch) .form-check-input:disabled + .form-check-label {
  cursor: not-allowed;
}

.form-switch .form-check-input:disabled,
.form-switch .form-check-input:disabled + .form-check-label {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-check-label {
  color: var(--foreground);
  cursor: var(--cursor-interaction, default);
}

.form-switch .form-check-input {
  position: relative;
  width: 32px;
  height: 20px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--muted);
  box-shadow: none;
  transition: background-color 200ms cubic-bezier(0, 0, 0.2, 1);
}

.form-switch .form-check-input::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1px solid light-dark(var(--primary-foreground), var(--foreground));
  border-radius: var(--radius-full);
  background: light-dark(var(--primary-foreground), var(--foreground));
  box-shadow: var(--shadow-sm);
  content: "";
  transform: translate(2px, -50%);
  transition: transform 200ms cubic-bezier(0, 0, 0.2, 1);
}

.form-switch .form-check-input:checked {
  background: var(--primary);
}

.form-switch .form-check-input:checked::before {
  transform: translate(14px, -50%);
}

.form-switch .form-check-input:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

.form-range {
  appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  flex: 1;
  margin: 0;
  padding: 0;
  outline: none;
  border: 0;
  accent-color: var(--primary);
  background: linear-gradient(
      color-mix(in srgb, var(--foreground) 7%, transparent),
      color-mix(in srgb, var(--foreground) 7%, transparent)
    )
    center / 100% 2px no-repeat;
}

.form-range::-webkit-slider-runnable-track {
  height: 28px;
  background: transparent;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: light-dark(var(--primary-foreground), var(--foreground));
}

.form-range:focus-visible::-webkit-slider-thumb {
  border-color: var(--ring);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.form-range::-moz-range-track {
  height: 28px;
  background: transparent;
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: light-dark(var(--primary-foreground), var(--foreground));
}

.form-range:focus-visible::-moz-range-thumb {
  border-color: var(--ring);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.form-range:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.btn:not(.btn-primary, .viz-tile):is(
  [aria-pressed="true"],
  [aria-selected="true"],
  .is-selected
) {
  border-color: var(--primary);
  color: var(--primary-foreground);
  background: var(--primary);
}

.btn.viz-tile:is([aria-pressed="true"], [aria-selected="true"], .is-selected) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .btn,
  .nav-link,
  .form-control,
  .form-select {
    min-width: 44px;
    min-height: 44px;
  }

  /* Keep small-screen WebKit from zooming when a text field receives focus. */
  .form-control,
  .form-select {
    font-size: max(16px, var(--font-size-normal));
  }

  .form-control[type="file"]::file-selector-button {
    min-width: 44px;
    min-height: 44px;
  }

  .form-control-color[type="color"] {
    width: 44px;
    height: 44px;
  }

  .form-control:is(
    [type="date"],
    [type="datetime-local"],
    [type="month"],
    [type="time"],
    [type="week"]
  ) {
    min-width: 0;
    max-width: 100%;
    padding-block: 8px;
  }

  .form-check {
    min-height: 44px;
    padding-inline: 15px;
  }

  .form-check-input {
    position: relative;
  }

  .form-check-input::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    content: "";
    transform: translate(-50%, -50%);
  }

  .form-check-label {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
  }

  .form-range {
    height: 44px;
    touch-action: pan-y;
  }

  .form-range::-webkit-slider-runnable-track {
    height: 44px;
  }

  .form-range::-moz-range-track {
    height: 44px;
  }

  .form-range::-webkit-slider-thumb {
    margin-top: 12px;
  }
}

/* Leaflet's renderer SVGs are sized by width/height attributes inside 0x0
   panes; a stylesheet max-width or height on them collapses the map layers
   to nothing, so the design rule stops at the map container. */
svg:not(.leaflet-container svg) {
  display: block;
  max-width: 100%;
  height: auto;
}

#widget > svg {
  width: 100%;
}

/* Model-authored chart rules can otherwise stretch icons after these styles load. */
svg.lucide {
  display: block;
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
  flex: none;
  margin: 0 !important;
  stroke-width: 1.6;
}

.text-warning,
.text-destructive {
  color: var(--destructive);
}

html>body{padding:0}
/* --- Atlas-specific styling, on top of the shared design tokens ----------- */
/* The design system sets display on .progress, .nav and friends, which outranks
   the user-agent [hidden] rule. Restore it so hiding an element actually does. */
#atlas [hidden] { display: none !important; }
#atlas { --va-weight: 1.75; max-width: 1180px; margin: 0 auto; padding: 1rem; }
#atlas h1 { font-size: var(--font-size-h1); margin: 0 0 .25rem; }
#atlas h2 { font-size: var(--font-size-h2); margin: 0 0 .5rem; }
#atlas h3 { font-size: var(--font-size-h3); margin: 1.1rem 0 .35rem; }
#atlas p { margin: .4rem 0; }
.atlas-header { margin-bottom: .9rem; }
/* The city picker sits beside the title and drops under it on a phone. */
.atlas-title-row { display: flex; align-items: flex-end; justify-content: space-between;
  gap: .5rem 1rem; flex-wrap: wrap; }
.atlas-title-row h1 { margin: 0; }
#atlas .city-pick { display: flex; align-items: center; gap: .4rem; margin: 0; }
#atlas .city-pick select { width: auto; }
#atlas .nav { margin-bottom: 1rem; }
#atlas section { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
#atlas .card { padding: 1rem; margin-bottom: 1rem; }
#atlas .viz-controls { align-items: flex-end; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
#atlas .form-label.grow { flex: 1 1 190px; min-width: 0; }
#atlas .form-label.grow select { width: 100%; }
#atlas code { font-family: var(--font-mono); font-size: .92em;
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
  padding: .05em .35em; border-radius: var(--radius-sm); }

.callout { border-left: 3px solid var(--viz-series-2); }

/* --- Map ------------------------------------------------------------------ */
.map-wrap { position: relative; }
.atlas-map { display: block; width: 100%; height: clamp(380px, 72vw, 700px);
  overflow: hidden; background: color-mix(in srgb, var(--foreground) 3%, transparent);
  border-radius: var(--radius); }
/* Leaflet resets max-width only for its own overlay pane; our federal and
   provincial panes are custom, so repeat the reset for every pane's renderer. */
.leaflet-container .leaflet-pane > svg { max-width: none !important; max-height: none !important; }
/* Leaflet's stylesheet paints its own ground and fonts; bring both into the theme. */
.leaflet-container { background: color-mix(in srgb, var(--foreground) 3%, var(--background)); font: inherit; }
.leaflet-container .leaflet-bar a { background: var(--card); color: var(--foreground); border-bottom-color: var(--border); }
.leaflet-container .leaflet-bar a:hover { background: var(--accent); }
.leaflet-container .leaflet-bar { border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.leaflet-container .leaflet-control-attribution {
  background: color-mix(in oklab, var(--background) 82%, transparent); color: var(--muted-foreground);
  font-size: 11px; }
.leaflet-container .leaflet-control-attribution a { color: var(--accent-foreground); }
.leaflet-container .leaflet-interactive.poll { cursor: pointer; }
.poll { fill: var(--muted); stroke: var(--foreground); stroke-opacity: .34;
  stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; }
.poll.outside-cov { stroke-dasharray: 3 2; }
.poll.point-like { stroke-opacity: .8; stroke-width: 1; }
.poll:hover { stroke-opacity: .9; stroke-width: 1.4; }
.poll.selected { stroke: var(--viz-series-1); stroke-opacity: 1; stroke-width: 2.6; }
.va { fill: none; stroke: var(--viz-series-2); stroke-opacity: .95;
  stroke-width: var(--va-weight); vector-effect: non-scaling-stroke;
  pointer-events: stroke; cursor: pointer; }
.layer-prov.filled .va { fill: var(--viz-series-2); fill-opacity: .08; pointer-events: all; }
.va:hover { stroke-width: calc(var(--va-weight) + 1.4); }
.va.selected { stroke: var(--orange); stroke-width: calc(var(--va-weight) + 2);
  stroke-opacity: 1; filter: drop-shadow(0 0 2px var(--orange)); }
.da { fill: none; stroke: var(--viz-series-3); stroke-opacity: .9; stroke-width: 1.3;
  stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: pointer; }
.layer-da.filled .da { fill: var(--viz-series-3); fill-opacity: .08; pointer-events: all; }
.da:hover { stroke-width: 2.6; }
.da.selected { stroke: var(--orange); stroke-width: 3; stroke-opacity: 1; stroke-dasharray: none;
  filter: drop-shadow(0 0 2px var(--orange)); }
.swatch-da { background: none; border: 2px dashed var(--viz-series-3); }

/* Voting places: the points the 2024 provincial count was actually reported
   at. A final-day place earns a catchment; the others are spread across their
   whole district, and are drawn hollow and dashed to say so. */
.place { stroke: var(--viz-series-4); fill: var(--viz-series-4); cursor: pointer; }
.place-other { fill-opacity: .12; stroke-dasharray: 3 2; }
.place:hover { stroke-width: 3; }
.swatch-place { background: var(--viz-series-4); border-radius: 50%; }

/* Bar lists: one row per party or per voting channel, the bar carrying the
   comparison and the number carrying the value. */
#atlas .bar-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
#atlas .party-row { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr auto;
  gap: .6rem; align-items: center; }
#atlas .party-name { font-size: .92rem; }
#atlas .party-track { background: var(--surface-2, rgba(127,127,127,.14)); border-radius: 999px;
  height: .85rem; overflow: hidden; }
#atlas .party-fill { display: block; height: 100%; border-radius: 999px; }
#atlas .party-value { font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }

#atlas .ranked-list { margin: .4rem 0 0; padding-left: 1.4rem; }
#atlas .ranked-list li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem;
  align-items: baseline; padding: .18rem 0; }
#atlas .ranked-name { font-size: .95rem; }
#atlas .ranked-value { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 560px) {
  #atlas .party-row { grid-template-columns: 1fr auto; }
  #atlas .party-track { grid-column: 1 / -1; }
  #atlas .ranked-list li { grid-template-columns: 1fr auto; }
}

.map-legend { position: absolute; left: .6rem; bottom: 1.6rem; z-index: 1001; display: flex;
  flex-direction: column; gap: .25rem; padding: .5rem .6rem; border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  border: 1px solid var(--border); font-size: var(--font-size-small); max-width: 60%; }
.legend-item { display: flex; align-items: center; gap: .4rem; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none;
  border: 1px solid color-mix(in srgb, var(--foreground) 25%, transparent); }
.swatch-outline { background: none; border: 2px solid var(--viz-series-2); }

/* --- Readout -------------------------------------------------------------- */
.readout { margin: .8rem 0; min-height: 4.5rem; }
.readout-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.readout-card { border: 1px solid var(--border); border-radius: var(--radius);
  padding: .7rem .85rem; background: var(--card); }
.readout-card h3 { margin: 0 0 .3rem; font-size: var(--font-size-small);
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.readout-name { font-weight: var(--font-weight-medium); margin: 0 0 .2rem; }
.result-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex;
  flex-direction: column; gap: .2rem; font-size: var(--font-size-small); }
.result-list li { display: flex; align-items: center; gap: .45rem; }
.result-list .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.result-list .party { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.result-list .votes { color: var(--muted-foreground); white-space: nowrap; }

/* --- Status and mapping --------------------------------------------------- */
.status:empty { display: none; }
.status { margin-top: .6rem; font-size: var(--font-size-small); }
.status-error { color: var(--destructive); }
.status-busy { color: var(--muted-foreground); }
.status details { margin-top: .5rem; }
.status summary { cursor: pointer; color: var(--muted-foreground); }
.status ul { margin: .4rem 0 0 1rem; padding: 0; }
#atlas .viz-grid { display: grid; gap: .6rem; margin: .6rem 0;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
#atlas .viz-stat { border: 1px solid var(--border); border-radius: var(--radius);
  padding: .55rem .7rem; background: var(--card); }
#atlas .viz-stat-value { font-size: var(--font-size-h2); font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums; }
.viz-stat.good .viz-stat-value { color: var(--green); }
.viz-stat.warn .viz-stat-value { color: var(--orange); }
.viz-stat.bad .viz-stat-value { color: var(--destructive); }
.mapping { margin-top: .8rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.wide-parties { margin: .5rem 0; }
.preview { margin-top: .6rem; font-size: var(--font-size-small); }
.preview summary { cursor: pointer; color: var(--muted-foreground); }
.preview td, .preview th { white-space: nowrap; max-width: 18ch;
  overflow: hidden; text-overflow: ellipsis; }
#atlas .progress { margin: .5rem 0; }
#atlas input[type="file"].form-control { flex: 1 1 260px; padding: .4rem; }

/* --- Scatter -------------------------------------------------------------- */
.scatter { display: block; width: 100%; margin-top: .4rem; }
.scatter .axis text { fill: var(--muted-foreground); font-size: var(--font-size-small); }
.scatter .axis path, .scatter .axis line { stroke: var(--border); }
.scatter .axis-label { fill: var(--muted-foreground); font-size: var(--font-size-small); }
.scatter .dot { fill-opacity: .55; stroke: var(--background); stroke-width: .5; }
.scatter .fit-line { fill: none; stroke: var(--foreground); stroke-opacity: .65;
  stroke-width: 1.5; stroke-dasharray: 5 3; }

#atlas ul { margin: .4rem 0 .4rem 1.1rem; padding: 0; }
#atlas li { margin: .2rem 0; }

@media (max-width: 640px) {
  #atlas { padding: .75rem; }
  .map-legend { position: static; max-width: none; margin-top: .5rem; }
}

/* --- Turnout tab ----------------------------------------------------------- */
.turnout-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.turnout-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-small);
  font-variant-numeric: tabular-nums; }
.turnout-table th { position: sticky; top: 0; background: var(--card); text-align: right;
  cursor: pointer; user-select: none; white-space: nowrap; padding: .4rem .5rem;
  border-bottom: 1px solid var(--border); font-weight: var(--font-weight-medium); }
.turnout-table th.text-start, .turnout-table td.text-start { text-align: left; }
.turnout-table th.sorted::after { content: ' \25BE'; color: var(--muted-foreground); }
.turnout-table th.sorted.asc::after { content: ' \25B4'; }
.turnout-table td { text-align: right; padding: .3rem .5rem; border-bottom: 1px solid var(--border);
  white-space: nowrap; }
.turnout-table td.text-start { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; }
.turnout-table tr.in-basket td { background: color-mix(in srgb, var(--viz-series-1) 12%, transparent); }
.turnout-table tr.partial td { color: var(--muted-foreground); font-style: italic; }
/* A non-voter column header names the subtraction under its own name, so a
   screenshot of the table alone still says what was taken from what. */
.turnout-table th .th-sub { display: block; font-weight: var(--font-weight-normal, 400);
  font-size: var(--font-size-small, .8rem); color: var(--muted-foreground);
  white-space: normal; max-width: 16ch; margin-left: auto; }
.turnout-table th.text-start .th-sub { margin-left: 0; }
/* More ballots than roll electors. Not an error and never clamped: it says the
   roll does not describe the people who voted there. */
.turnout-table tr.over td { color: var(--destructive); }
.turnout-table input[type="checkbox"] { margin: 0; }
.poll.basket { stroke: var(--viz-series-1); stroke-width: 2.2; stroke-opacity: 1; stroke-dasharray: 4 2; }
.va.basket { stroke: var(--viz-series-1); stroke-dasharray: 4 2; }
.curve { display: block; width: 100%; margin: .4rem 0; }
.curve .axis text { fill: var(--muted-foreground); font-size: var(--font-size-small); }
.curve .axis path, .curve .axis line { stroke: var(--border); }
.curve .axis-label { fill: var(--muted-foreground); font-size: var(--font-size-small); }
.curve .line { fill: none; stroke: var(--viz-series-1); stroke-width: 2; }
.curve .line-expected { fill: none; stroke: var(--viz-series-2); stroke-width: 1.5; stroke-dasharray: 5 3; }
.curve .diag { fill: none; stroke: var(--border); stroke-dasharray: 3 3; }
.btn-small { padding: .2rem .6rem; font-size: var(--font-size-small); margin-top: .5rem; }

/* --- Socioeconomic tab ----------------------------------------------------- */
.socio-picker { display: flex; flex-wrap: wrap; gap: .3rem .9rem; max-height: 170px; overflow: auto;
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); margin: .4rem 0;
  font-size: var(--font-size-small); }
.socio-picker label { display: flex; align-items: center; gap: .35rem; white-space: nowrap; cursor: pointer; }
.socio-picker input[type="checkbox"] { margin: 0; }
.socio-search-results { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 .6rem; }
.socio-search-results .btn { font-size: var(--font-size-small); padding: .15rem .5rem; max-width: 100%;
  white-space: normal; text-align: left; }
.socio-table tr { cursor: pointer; }
.socio-table tr.picked td { background: color-mix(in srgb, var(--viz-series-3) 14%, transparent); }
.socio-table td.text-start { max-width: 44ch; }

/* A switch that cannot do anything should not look as though it can. The label
   carries the reason it is off, so it has to dim along with the control. */
.form-check-input:disabled,
.form-check-input:disabled + .form-check-label {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Progressive disclosure. A settings drawer that reads as one control when it
   is shut, used for the map's options and for the Data tab's replace-data
   section: the same affordance in both places, so it is learned once. */
.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg, .5rem);
  background: var(--card);
  margin-bottom: 1rem;
}
.disclosure > summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .85rem;
  cursor: pointer;
  font-weight: var(--font-weight-medium, 500);
  color: var(--foreground);
  list-style: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: "";
  flex: none;
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:focus-visible {
  outline: 2px solid var(--color-ring-primary, currentColor);
  outline-offset: -2px;
}
/* The browser hides a shut details' content with a UA display:none, and an
   author rule beats a UA one -- .viz-controls sets display:flex, so the drawer
   laid its contents out in full while reporting itself shut. Say it here, at
   author level, where it wins. */
.disclosure:not([open]) > :not(summary) { display: none; }
.disclosure > :not(summary) { padding: 0 .85rem; }
.disclosure > :last-child:not(summary) { padding-bottom: .5rem; }
@media (prefers-reduced-motion: reduce) {
  .disclosure > summary::before { transition: none; }
}

/* The tab row. The names are words rather than abbreviations, so on a phone the
   row is wider than the screen: it scrolls sideways rather than wrapping into a
   second row that shoves the map down, and the buttons refuse to shrink, since
   a squeezed "Neighbourhood profile" is unreadable rather than merely narrow.
   The edge it can still scroll towards fades, so there is a visible sign that
   more tabs are there instead of a row that simply looks finished. */
#atlas .nav[role="tablist"] {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#atlas .nav[role="tablist"]::-webkit-scrollbar { display: none; }
#atlas .nav[role="tablist"] > [role="tab"] { flex: 0 0 auto; white-space: nowrap; }
#atlas .nav[role="tablist"].can-scroll-end {
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
#atlas .nav[role="tablist"].can-scroll-start {
  mask-image: linear-gradient(to right, transparent, #000 2.5rem);
}
#atlas .nav[role="tablist"].can-scroll-start.can-scroll-end {
  mask-image: linear-gradient(to right, transparent, #000 2.5rem,
                              #000 calc(100% - 2.5rem), transparent);
}

/* The readiness checklist. Three columns so the eye can run down the marks
   without reading: state, what it is, what it amounts to. The detail column is
   tabular so the counts line up. */
.readiness {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: grid;
  gap: .3rem;
}
.readiness li {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  gap: .6rem;
  align-items: baseline;
}
.readiness .mark { font-weight: 700; text-align: center; }
.readiness .is-ready, .readiness li.is-ready .mark { color: var(--green, #2f855a); }
.readiness li.is-missing .mark { color: var(--muted-foreground); }
.readiness li.is-missing .readiness-name { color: var(--muted-foreground); }
.readiness-detail { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 30rem) {
  .readiness li { grid-template-columns: 1.1rem minmax(0, 1fr); }
  .readiness-detail { grid-column: 2; text-align: left; }
}

/* The chosen measures a target list is ranked on, in the order they were added.

   Deliberately not .readiness, which this borrowed at first and should not
   have. That is a three-column checklist whose first column is 1.1rem wide
   because it holds a tick, and a grid container wraps a bare text node in an
   anonymous grid item -- so the measure's name landed in the tick column and
   rendered one character per line, a hundred lines tall. A list of labels and
   a button is a row, not a checklist. */
.target-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  display: grid;
  gap: .3rem;
}
.target-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
}
/* min-width lets a long measure name wrap instead of forcing the row wider
   than the panel: a flex item's floor is its content otherwise. */
.target-list .target-name { flex: 1 1 auto; min-width: 0; }
/* Sized to its own content rather than stretching with the row, so the
   direction reads as a property of the measure beside it. */
.target-list .target-direction { flex: 0 0 auto; width: auto; }
.target-list .target-weight { flex: 0 0 auto; width: auto; }
/* The share is the number being chosen; the weight select beside it is only how
   it is spelled. Tabular figures so a column of them lines up, and a fixed
   track so a 5% row and a 100% row put their select in the same place. */
.target-list .target-share {
  flex: 0 0 auto;
  min-width: 2.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .85em;
}

/* Headline findings. The figure leads, because that is what a reader is here
   for; the provenance badge sits under it rather than beside the heading, so
   "modelled" is read as part of the number and not as decoration. */
.findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: .75rem;
  margin-top: .5rem;
}
.finding {
  display: grid;
  gap: .2rem;
  align-content: start;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg, .5rem);
}
.finding-figure {
  font-size: 1.6rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.finding-headline { font-weight: var(--font-weight-medium, 500); }
.finding-detail { text-wrap: pretty; }
.badge {
  justify-self: start;
  margin-top: .35rem;
  padding: .1rem .45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--font-size-small, .8rem);
  color: var(--muted-foreground);
  white-space: nowrap;
  cursor: help;
}
.badge-counted { color: var(--green, #2f855a); border-color: currentColor; }

/* The caveats. Each is a claim followed by why, so the claim carries the
   weight and the reader can stop after it. */
.caveats { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .5rem; }
.caveats li { text-wrap: pretty; }

.stamp { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.badge-dirty { color: var(--color-text-warning, #b45309); border-color: currentColor; cursor: default; }
.sources { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.sources li { text-wrap: pretty; }

/* A named choice rather than a switch: two options, both labelled, so neither
   state has to be inferred from the other.

   It is a div with role="radiogroup", not a fieldset and not a .form-label.
   A fieldset carries an intrinsic min-width that browsers apply ahead of the
   author's, so as a flex item it collapsed to the width of its longest WORD.
   .form-label is worse here: design.css lays every .viz-controls > .form-label
   out as `grid-template-columns: minmax(0, 1fr) auto`, which is right for a
   caption over a select and wrong for three stacked children -- the nowrap
   radio labels claimed the auto column and squeezed the legend in the 1fr
   column down to one character per line. So it sits in the control row as a
   plain block that sizes itself. */
#atlas .viz-controls > .choice {
  display: block;
  flex: 1 1 16rem;
  min-width: 14rem;
  margin-bottom: 0;
}
.choice > .choice-legend {
  display: block;
  margin-bottom: .25rem;
  color: var(--muted-foreground);
  font-size: var(--font-size-small, .85rem);
}
.choice .form-check { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.choice .form-check + .form-check { margin-top: .15rem; }
.choice .form-check-label { line-height: 1.35; }

/* The plain-language summary. Set at reading width and a notch larger than the
   caption above it: it is the part somebody quotes, so it should not look like
   a footnote. */
.summary {
  margin-top: .75rem;
  padding: .75rem .9rem;
  border-left: 3px solid var(--border);
  display: grid;
  gap: .4rem;
  max-width: 62ch;
}
.summary p { margin: 0; text-wrap: pretty; }
.summary p:first-child { font-weight: var(--font-weight-medium, 500); }
.summary p:not(:first-child) { color: var(--muted-foreground); font-size: var(--font-size-small, .9rem); }

/* The census picker: six to start with, the rest one drawer down. */
.socio-picker-group { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.socio-more { margin-top: .6rem; }
.socio-more > summary { padding: .4rem .6rem; font-weight: var(--font-weight-normal, 400); }

/* --- Legibility ------------------------------------------------------------

   Nearly every explanatory line in this atlas is .text-small.text-muted, which
   stacks a size reduction on a contrast reduction. That pairing is right for a
   footnote and wrong for the sentence telling somebody what a number means --
   and most of the sentences here are the second kind. So inside the atlas the
   muted foreground is lifted towards the body colour, and the small size is
   raised a notch; the genuinely peripheral text keeps the old treatment by
   asking for it. */
#atlas {
  --muted-foreground: color-mix(in srgb, var(--foreground) 72%, var(--background));
}
#atlas .text-small,
#atlas small {
  font-size: calc(var(--font-size-small, .85rem) * 1.06);
  line-height: 1.5;
}
/* Attribution, licence lines and the source note under a chart: the places
   where faint really is the right answer. */
#atlas .footnote,
#atlas .atlas-header p,
#atlas .sources li,
#atlas .map-wrap + .text-small {
  color: color-mix(in srgb, var(--foreground) 55%, var(--background));
}
/* Chart furniture was a step below even the muted body text. An axis label
   nobody can read is a chart with no units. */
.scatter .axis text,
.curve .axis text { fill: color-mix(in srgb, var(--foreground) 70%, var(--background)); }
.scatter .axis-label,
.curve .axis-label {
  fill: var(--foreground);
  font-size: var(--font-size-base, 1rem);
}

/* Which variable the chart is showing, said above the chart. */
.plotted {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin: .75rem 0 .25rem;
}
.plotted-label {
  font-size: var(--font-size-small, .85rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.plotted-name { font-weight: var(--font-weight-medium, 500); }

/* A row you can click should look like one, and the row being plotted should
   be unmistakable -- it is the link between the table and the chart under it. */
.socio-table tbody tr { cursor: pointer; }
.socio-table tbody tr:hover td { background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.socio-table tr.picked td {
  background: color-mix(in srgb, var(--viz-series-3) 20%, transparent);
  font-weight: var(--font-weight-medium, 500);
}
.socio-table tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--viz-series-3); }

/* The model-status badge sits above the tiles, not among them: appended into
   the grid it took a cell of its own and was clipped by it. */
.model-badge { margin: .5rem 0 .25rem; }

/* The Balagan graphic dialog (gc-app-graphic.js). */
.graphic-bar { display: flex; justify-content: flex-end; margin: 6px 0 2px; }
.graphic-dialog { width: min(1180px, 96vw); max-height: 94vh; padding: 0; border: 1px solid var(--border, #ccc);
  border-radius: 8px; background: var(--bg, #fff); color: inherit; }
.graphic-dialog::backdrop { background: rgba(0,0,0,.45); }
.graphic-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border, #ddd); }
.graphic-head h2 { font-size: 1.1rem; margin: 0; }
.graphic-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; padding: 16px;
  max-height: calc(94vh - 60px); overflow: auto; }
.graphic-form { display: flex; flex-direction: column; gap: 10px; }
.graphic-form .form-label { display: flex; flex-direction: column; gap: 4px; }
.graphic-row { display: flex; gap: 10px; }
.graphic-row .form-label { flex: 1; }
.graphic-preview svg { width: 100%; height: auto; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
@media (max-width: 760px) { .graphic-body { grid-template-columns: 1fr; } }

/* --- First screen ------------------------------------------------------------

   Who won, before anything else. One tile per election, the winner's name in
   its party colour over a bar of its share. */
.glance-lede { font-size: calc(var(--font-size-normal) * 1.08); max-width: 62ch; }
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .75rem;
  margin: .8rem 0 1rem;
}
.glance-tile {
  border: 1px solid var(--border);
  border-top: 4px solid var(--party, var(--muted));
  border-radius: var(--radius-md);
  padding: .75rem .85rem .8rem;
  background: var(--background);
}
.glance-kicker {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted-foreground);
}
.glance-winner {
  font-size: var(--font-size-h3);
  font-weight: 600;
  line-height: 1.2;
  margin: .2rem 0 .45rem;
}
.glance-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--muted);
  overflow: hidden;
  margin-bottom: .45rem;
}
.glance-bar > span { display: block; height: 100%; background: var(--party, var(--primary)); }
.glance-line { font-size: var(--font-size-normal); font-variant-numeric: tabular-nums; }
.glance-line + .glance-line { color: var(--muted-foreground); font-size: var(--font-size-small); }
.glance-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* A whole card that folds: the heading is the summary. */
#atlas .disclosure-card { padding: 0; }
#atlas .disclosure-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
#atlas .disclosure-card > summary::-webkit-details-marker { display: none; }
#atlas .disclosure-card > summary::before {
  content: '';
  width: .5rem; height: .5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
}
#atlas .disclosure-card[open] > summary::before { transform: rotate(45deg); }
#atlas .disclosure-card > summary h2 { margin: 0; font-size: var(--font-size-h3); }
#atlas .disclosure-card > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
#atlas .disclosure-card > :last-child:not(summary) { margin-bottom: 1rem; }

/* The tab row in two groups: the reader's views, then the tools. */
#atlas .nav-sep {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  margin: .35rem .35rem;
  background: var(--border);
}
#atlas .nav-link.nav-tool { color: var(--muted-foreground); }
#atlas .nav-link.nav-tool.active { color: inherit; }

/* On a phone the header gets out of the way: a smaller title, the intro line
   dropped, and the tab row stuck to the top so the sections stay in reach. */
@media (max-width: 640px) {
  #atlas { padding: .75rem; }
  #atlas h1 { font-size: var(--font-size-h3); }
  #atlas .atlas-header { margin-bottom: .5rem; }
  #atlas .atlas-intro { display: none; }
  #atlas .nav[role="tablist"] {
    position: sticky; top: 0; z-index: 500;
    background: var(--background);
    padding: .35rem 0;
    margin-bottom: .6rem;
  }
  .glance-grid { grid-template-columns: 1fr; }
  .glance-actions .btn { flex: 1 1 100%; }
}

/* Outlines step back while the federal layer carries the colour. */
.map-quiet .va:not(.selected):not(.basket) {
  stroke: color-mix(in srgb, var(--foreground) 50%, transparent);
  stroke-opacity: .45; stroke-width: .8;
}
.map-quiet .da:not(.selected) { stroke-opacity: .2; stroke-width: .8; }
.map-quiet .swatch-outline { border-color: color-mix(in srgb, var(--foreground) 45%, transparent); border-width: 1px; }
.map-quiet .swatch-da { opacity: .4; }
.glance-party { font-size: var(--font-size-normal); font-weight: 500; color: var(--muted-foreground); margin-left: .5rem; }

/* Phone: the map's three questions in two rows, so the map is in view. */
@media (max-width: 640px) {
  #panel-map > .viz-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .35rem .5rem;
  }
  #panel-map > .viz-controls > label[for="area-filter"] { grid-column: 1 / -1; }
  #panel-map > .viz-controls > .form-label { font-size: var(--font-size-small); }
  #panel-map > .viz-controls > #zoom-reset { display: none; }
  .glance-tile { padding: .6rem .7rem; }
  .glance-winner { font-size: var(--font-size-normal); }
}

