:root,
      html[data-theme='light'] {
        --paper: #f6f1e4;
        --base: #f6f1e4;
        --panel: rgba(250, 246, 236, 0.94);
        --panel-solid: #faf6ec;
        --panel2: #efe8d8;
        --line: #d5cbb6;
        --line-strong: #c4b89f;
        --muted: #7a7366;
        --text: #2a2620;
        --text-soft: #5a5348;
        --green: #1f8a62;
        --green-soft: #2d9a70;
        --green-bg: #e4f3eb;
        --green-border: #8fc9ad;
        --green-active-bg: #d7eee3;
        --green-active-text: #176b4c;
        --purple: #7a5cc8;
        --soft: #8a8478;
        --input-bg: #fffdf7;
        --input-border: #d0c6b0;
        --input-text: #2a2620;
        --mode-bg: rgba(255, 253, 247, 0.88);
        --mode-text: #6a6358;
        --mode-hover-bg: #f3ecdc;
        --mode-hover-text: #2a2620;
        --stat-bg: #fffdf8;
        --stat-grid: #d5cbb6;
        --track: #e2d9c6;
        --rank-name: #3a342c;
        --rank-votes: #6e675c;
        --shadow: 0 18px 60px rgba(70, 50, 20, 0.14);
        --shadow-sm: 0 8px 24px rgba(70, 50, 20, 0.1);
        --map-bg: #e4ddd0;
        --grain: radial-gradient(
          ellipse at 58% 49%,
          transparent 28%,
          rgba(120, 95, 50, 0.06) 100%
        );
        --top-fade: linear-gradient(
          to bottom,
          rgba(246, 241, 228, 0.55),
          transparent
        );
        --attrib-bg: rgba(246, 241, 228, 0.82);
        --attrib-text: #6a6358;
        --attrib-link: #1f6b4d;
        --icon-muted: #8a8376;
        --icon-hover-bg: #ebe3d2;
        --pill-bg: rgba(250, 246, 236, 0.9);
        --pill-border: #cfc4ad;
        --pill-text: #4a443a;
        --pill-hover: #efe6d4;
        --legend-bg: rgba(250, 246, 236, 0.92);
        --control-bg: rgba(250, 246, 236, 0.92);
        --control-border: #cfc4ad;
        --tip-bg: #faf6ec;
        --tip-border: #9bb8a8;
        --tip-value: #1f5f45;
        --detail-bg: rgba(250, 246, 236, 0.96);
        --empty-bg: rgba(250, 246, 236, 0.92);
        --toast-bg: #e4f3eb;
        --toast-border: #8fc9ad;
        --toast-text: #176b4c;
        --help-overlay: rgba(42, 38, 32, 0.45);
        --help-card: #faf6ec;
        --help-border: #c4b89f;
        --help-p: #6a6358;
        --help-item: #2a2620;
        --help-num-bg: #e4f3eb;
        --help-num-text: #176b4c;
        --help-btn: #1f8a62;
        --help-btn-text: #f6f1e4;
        --loading-bg: rgba(250, 246, 236, 0.95);
        --loading-border: #c4b89f;
        --loading-text: #5a5348;
        --spinner-track: #d5cbb6;
        --spinner-head: #1f8a62;
        --scrollbar: #c4b89f;
        --map-title-shadow: 0 1px 10px rgba(246, 241, 228, 0.85);
        --border-line: #d5cbb6;
        --focus-btn-bg: #e4f3eb;
        --focus-btn-border: #8fc9ad;
        --focus-btn-text: #176b4c;
        --focus-btn-hover: #d0e9dc;
        --neutral-btn-bg: #efe8d8;
        --neutral-btn-border: #d0c6b0;
        --side-foot-text: #7a7366;
        --link-btn: #4a443a;
        --link-btn-hover: #1f8a62;
        --suggestion-bg: #fffdf7;
        --suggestion-border: #d0c6b0;
        --suggestion-hover: #efe8d8;
        --brand-winnipeg: #00669b;
        --brand-atlas: #3d8fb8;
        --field-label: #7a7366;
        --field-hint: #9a9284;
        --line-title: #5a5348;
        --hover-minor: #7a7366;
        --dline-name: #3a342c;
        --dline-num: #6e675c;
        --legend-key: #3a342c;
        --legend-label: #7a7366;
        --select-chevron: #8a8376;
        --map-line: #6a8f7e;
        --map-ward-line: #4d7464;
        --map-hover-line: #1f5f45;
        --map-selected-line: #2a2620;
        --map-label: #2a2620;
        --map-label-halo: #f6f1e4;
        --fallback-bg: #e4ddd0;
        --fallback-grid: #b8ae98;
        --fallback-stroke: #6a8f7e;
        --status-dot: #1f8a62;
      }
      html[data-theme='dark'] {
        --paper: #070b0f;
        --base: #0b0f13;
        --panel: rgba(13, 18, 23, 0.96);
        --panel-solid: #12171c;
        --panel2: #161e23;
        --line: #29333a;
        --line-strong: #344149;
        --muted: #7d8c96;
        --text: #e9f3f3;
        --text-soft: #a2b1b9;
        --green: #61e4ae;
        --green-soft: #61e4ae;
        --green-bg: rgba(97, 228, 174, 0.09);
        --green-border: rgba(97, 228, 174, 0.28);
        --green-active-bg: #133a30;
        --green-active-text: #90ffce;
        --purple: #b298ff;
        --soft: #a2b1b9;
        --input-bg: #1b242b;
        --input-border: #303c43;
        --input-text: #e6eff2;
        --mode-bg: rgba(30, 40, 48, 0.74);
        --mode-text: #9cafb7;
        --mode-hover-bg: #28343b;
        --mode-hover-text: #e8f5f5;
        --stat-bg: #182128;
        --stat-grid: #2d3b42;
        --track: #303c43;
        --rank-name: #d3e1e5;
        --rank-votes: #a9bac3;
        --shadow: 0 18px 80px rgba(0, 0, 0, 0.52);
        --shadow-sm: 0 8px 23px #0005;
        --map-bg: #171e26;
        --grain: radial-gradient(
          ellipse at 58% 49%,
          transparent 28%,
          rgba(5, 10, 15, 0.12) 100%
        );
        --top-fade: linear-gradient(
          to bottom,
          rgba(6, 10, 15, 0.48),
          transparent
        );
        --attrib-bg: rgba(9, 14, 18, 0.67);
        --attrib-text: #aab7bd;
        --attrib-link: #c5d5d9;
        --icon-muted: #9badb6;
        --icon-hover-bg: #222e34;
        --pill-bg: rgba(12, 18, 23, 0.86);
        --pill-border: #35434b;
        --pill-text: #c0d0d5;
        --pill-hover: #202b32;
        --legend-bg: rgba(13, 20, 25, 0.89);
        --control-bg: #141d23df;
        --control-border: #44525a;
        --tip-bg: #10181e;
        --tip-border: #627d77;
        --tip-value: #e7fff1;
        --detail-bg: #111920ed;
        --empty-bg: #101820d9;
        --toast-bg: #1b352d;
        --toast-border: #548d72;
        --toast-text: #d1ffe9;
        --help-overlay: rgba(0, 0, 0, 0.65);
        --help-card: #121b21;
        --help-border: #3b514c;
        --help-p: #a9bbc2;
        --help-item: #dbe9e8;
        --help-num-bg: #174333;
        --help-num-text: #90f2c2;
        --help-btn: #57dca7;
        --help-btn-text: #10201c;
        --loading-bg: #101a20e8;
        --loading-border: #385047;
        --loading-text: #bfd2d7;
        --spinner-track: #3a594f;
        --spinner-head: #76edb8;
        --scrollbar: #3e4d51;
        --map-title-shadow: 0 2px 14px #000a;
        --border-line: #263139;
        --focus-btn-bg: #184536;
        --focus-btn-border: #36765b;
        --focus-btn-text: #a5f8d0;
        --focus-btn-hover: #25644c;
        --neutral-btn-bg: #29343c;
        --neutral-btn-border: #3a4b54;
        --side-foot-text: #86979d;
        --link-btn: #c5d7dc;
        --link-btn-hover: #7de8b6;
        --suggestion-bg: #1b252c;
        --suggestion-border: #33454e;
        --suggestion-hover: #293941;
        --brand-winnipeg: #00669b;
        --brand-atlas: #3d8fb8;
        --field-label: #91a1a9;
        --field-hint: #647982;
        --line-title: #bbcbd0;
        --hover-minor: #9aadba;
        --dline-name: #d7e4e8;
        --dline-num: #bdd1d6;
        --legend-key: #d4e0e3;
        --legend-label: #9bafb7;
        --select-chevron: #9cabb3;
        --map-line: #bacfca;
        --map-ward-line: #bfd5d0;
        --map-hover-line: #edfff8;
        --map-selected-line: #ffffff;
        --map-label: #ebf8f3;
        --map-label-halo: #0c131b;
        --fallback-bg: #1a242d;
        --fallback-grid: #435460;
        --fallback-stroke: #7b979e;
        --status-dot: #66dfac;
      }
      * {
        box-sizing: border-box;
      }
      html,
      body {
        margin: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: var(--paper);
        color: var(--text);
        font-family: 'Outfit', sans-serif;
        font-optical-sizing: auto;
        font-size: 13px;
      }
      button,
      input,
      select {
        font: inherit;
      }
      button {
        cursor: pointer;
        border: 0;
        background: transparent;
        color: inherit;
      }
      button:focus-visible,
      select:focus-visible,
      input:focus-visible {
        outline: 2px solid var(--green);
        outline-offset: 2px;
      }
      #map {
        position: absolute;
        inset: 0;
        background: var(--map-bg);
      }
      .maplibregl-canvas {
        outline: 0;
      }
      .maplibregl-control-container .maplibregl-ctrl-bottom-right {
        bottom: max(4px, env(safe-area-inset-bottom, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        max-width: min(280px, calc(100vw - 90px));
      }
      .maplibregl-ctrl-attrib {
        background: var(--attrib-bg) !important;
        color: var(--attrib-text) !important;
        font-size: 10px !important;
      }
      .maplibregl-ctrl-attrib a {
        color: var(--attrib-link) !important;
      }
      .map-grain {
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: var(--grain);
        z-index: 2;
      }
      .map-top-gradient {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 135px;
        pointer-events: none;
        background: var(--top-fade);
        z-index: 2;
      }
      .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
      }
      #sidebar {
        position: absolute;
        top: 18px;
        left: 18px;
        bottom: 18px;
        width: 350px;
        z-index: 20;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 13px;
        box-shadow: var(--shadow);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        backdrop-filter: blur(24px);
        transition:
          transform 0.35s,
          opacity 0.35s;
      }
      #sidebar.hidden {
        transform: translateX(-110%);
        opacity: 0;
        pointer-events: none;
      }
      .side-head {
        padding: 22px 23px 20px;
        border-bottom: 1px solid var(--border-line);
      }
      .brand {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .brand-logo {
        width: 50px;
        height: 50px;
        object-fit: contain;
        flex-shrink: 0;
        display: block;
      }
      .brand-title {
        font-family: 'Outfit', sans-serif;
        font-weight: 700;
        font-size: 18px;
        letter-spacing: -0.8px;
        line-height: 1.02;
      }
      .brand-winnipeg {
        color: var(--brand-winnipeg);
        font-weight: 700;
      }
      .brand-atlas {
        color: var(--brand-atlas);
        font-weight: 700;
      }
      .logo-credit {
        padding: 8px 22px 10px;
        border-top: 1px solid var(--border-line);
        font-family: 'Outfit', sans-serif;
        font-size: 8px;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: var(--muted);
        font-weight: 500;
      }
      .logo-credit a {
        color: var(--brand-atlas);
        text-decoration: none;
      }
      .logo-credit a:hover {
        text-decoration: underline;
      }
      .eyebrow {
        font-family: 'Outfit', sans-serif;
        font-size: 9px;
        letter-spacing: 1.6px;
        color: var(--muted);
        text-transform: uppercase;
        font-weight: 500;
      }
      .eyebrow-accent {
        color: var(--green);
      }
      .brand-sub {
        margin-top: 5px;
      }
      .head-actions {
        margin-left: auto;
        display: flex;
        gap: 5px;
      }
      .iconbtn {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border: 1px solid transparent;
        border-radius: 7px;
        color: var(--icon-muted);
      }
      .iconbtn:hover {
        background: var(--icon-hover-bg);
        color: var(--text);
        border-color: var(--line-strong);
      }
      .icon {
        width: 17px;
        height: 17px;
        display: block;
        stroke: currentColor;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.7;
      }
      .sidebar-body {
        overflow-y: auto;
        scrollbar-color: var(--scrollbar) transparent;
        scrollbar-width: thin;
        min-height: 0;
        padding: 21px 22px 12px;
        flex: 1;
      }
      .side-section {
        margin-bottom: 25px;
      }
      .field-label {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: 'Outfit', sans-serif;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1.1px;
        color: var(--field-label);
        margin-bottom: 10px;
        font-weight: 600;
      }
      .field-hint {
        font-family: 'Outfit', sans-serif;
        font-size: 9px;
        color: var(--field-hint);
        font-weight: 500;
        letter-spacing: 0.8px;
      }
      .select-wrap {
        position: relative;
      }
      .select-wrap:after {
        content: '⌄';
        position: absolute;
        right: 13px;
        top: 50%;
        transform: translateY(-58%);
        color: var(--select-chevron);
        font-size: 21px;
        pointer-events: none;
      }
      .field-select {
        width: 100%;
        height: 43px;
        border: 1px solid var(--input-border);
        color: var(--input-text);
        background: var(--input-bg);
        padding: 0 32px 0 12px;
        border-radius: 6px;
        appearance: none;
        font-size: 12px;
        font-weight: 600;
      }
      .field-select:hover {
        border-color: var(--line-strong);
      }
      .field-select option {
        background: var(--panel-solid);
        color: var(--text);
      }
      .field-select option:disabled {
        color: var(--muted);
      }
      .two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }
      .mode-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }
      .mode {
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
        padding: 10px 10px;
        min-height: 44px;
        height: auto;
        border: 1px solid var(--input-border);
        border-radius: 6px;
        background: var(--mode-bg);
        color: var(--mode-text);
        font-size: 11px;
        font-weight: 600;
        transition: 0.18s;
      }
      .mode:hover {
        background: var(--mode-hover-bg);
        color: var(--mode-hover-text);
      }
      .mode.active {
        color: var(--green-active-text);
        background: var(--green-active-bg);
        border-color: var(--green-border);
      }
      .mode-icon {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
      }
      .candidate-controls {
        display: none;
        gap: 10px;
        margin-top: 13px;
      }
      .candidate-controls.visible {
        display: grid;
      }
      .candidate-controls.compare {
        grid-template-columns: 1fr 1fr;
      }
      .candidate-controls.compare .field-select {
        font-size: 11px;
        padding-left: 8px;
      }
      .candidate-controls .field-label {
        margin-bottom: 7px;
      }
      .intro-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        border: 1px solid var(--line);
        border-radius: 7px;
        overflow: hidden;
        background: var(--stat-grid);
        margin: 18px 0 20px;
      }
      .stat {
        background: var(--stat-bg);
        padding: 12px 11px 12px;
      }
      .stat-val {
        font-family: 'Outfit', sans-serif;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: -1px;
        line-height: 1.15;
        font-variant-numeric: tabular-nums;
      }
      .stat-label {
        font-size: 9px;
        font-family: 'Outfit', sans-serif;
        text-transform: uppercase;
        color: var(--muted);
        letter-spacing: 0.35px;
        margin-top: 6px;
        font-weight: 500;
      }
      .line-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 13px;
      }
      .line-title h3 {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1.4px;
        font-weight: 700;
        margin: 0;
        color: var(--line-title);
      }
      .tiny-btn {
        font-family: 'Outfit', sans-serif;
        color: var(--green);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.4px;
      }
      .tiny-btn:hover {
        text-decoration: underline;
      }
      .leaderboard {
        display: flex;
        flex-direction: column;
        gap: 13px;
      }
      .rank-entry {
        display: flex;
        flex-direction: column;
        gap: 7px;
        cursor: pointer;
      }
      .rank-top {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 6px;
      }
      .rank-person {
        display: flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
      }
      .rank-dot {
        width: 8px;
        height: 8px;
        border-radius: 3px;
        flex-shrink: 0;
      }
      .rank-name {
        font-size: 12px;
        color: var(--rank-name);
        font-weight: 600;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
      .rank-votes {
        font-family: 'Outfit', sans-serif;
        color: var(--rank-votes);
        font-size: 11px;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
      }
      .rank-pct {
        color: var(--text);
        font-weight: 600;
      }
      .rank-track {
        height: 4px;
        background: var(--track);
        border-radius: 20px;
        overflow: hidden;
      }
      .rank-progress {
        height: 100%;
        border-radius: 20px;
        transition: width 0.4s ease;
      }
      .rank-entry:hover .rank-name {
        color: var(--text);
      }
      #search-wrap {
        margin-bottom: 21px;
        position: relative;
      }
      .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        width: 16px;
        height: 16px;
      }
      .searchbox {
        width: 100%;
        height: 41px;
        border-radius: 6px;
        border: 1px solid var(--input-border);
        padding: 0 12px 0 37px;
        background: var(--input-bg);
        color: var(--input-text);
        outline: none;
        font-size: 12px;
      }
      .searchbox:focus {
        border-color: var(--green-border);
      }
      .searchbox::placeholder {
        color: var(--muted);
      }
      .suggestions {
        position: absolute;
        top: 47px;
        left: 0;
        right: 0;
        background: var(--suggestion-bg);
        border: 1px solid var(--suggestion-border);
        border-radius: 7px;
        z-index: 50;
        max-height: 230px;
        overflow: auto;
        box-shadow: var(--shadow-sm);
        display: none;
      }
      .suggestion {
        padding: 11px 12px;
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        gap: 10px;
        border-bottom: 1px solid var(--line);
      }
      .suggestion:hover {
        background: var(--suggestion-hover);
      }
      .suggestion small {
        color: var(--muted);
      }
      .empty-search {
        padding: 12px;
        color: var(--muted);
      }
      .side-foot {
        padding: 14px 22px;
        border-top: 1px solid var(--border-line);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 7px;
        font-family: 'Outfit', sans-serif;
        color: var(--side-foot-text);
        font-size: 9px;
        letter-spacing: 0.25px;
        font-weight: 500;
        text-transform: uppercase;
      }
      .side-foot a {
        color: var(--green);
        text-decoration: none;
      }
      .link-btn {
        font-family: 'Outfit', sans-serif;
        font-size: 10px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: var(--link-btn);
        font-weight: 600;
        letter-spacing: 0.4px;
      }
      .link-btn:hover {
        color: var(--link-btn-hover);
      }
      #floating-header {
        position: absolute;
        top: 26px;
        left: calc(50% + 167px);
        transform: translateX(-50%);
        z-index: 10;
        min-width: 290px;
        text-align: center;
        pointer-events: none;
      }
      .map-eyebrow {
        font-family: 'Outfit', sans-serif;
        color: var(--muted);
        font-size: 10px;
        letter-spacing: 2.4px;
        text-shadow: var(--map-title-shadow);
        font-weight: 500;
      }
      .map-title {
        font-family: 'Outfit', sans-serif;
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.85px;
        margin: 7px 0 2px;
        text-shadow: var(--map-title-shadow);
        color: var(--text);
      }
      .map-subtitle {
        font-family: 'Outfit', sans-serif;
        font-size: 10px;
        color: var(--text-soft);
        text-shadow: var(--map-title-shadow);
        font-weight: 500;
        letter-spacing: 0.3px;
      }
      #top-right {
        position: absolute;
        top: max(16px, env(safe-area-inset-top, 0px));
        right: max(16px, env(safe-area-inset-right, 0px));
        display: flex;
        align-items: center;
        gap: 9px;
        z-index: 17;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: calc(100vw - 24px);
      }
      .top-pill {
        height: 36px;
        min-height: 36px;
        padding: 0 13px;
        display: flex;
        align-items: center;
        gap: 9px;
        border: 1px solid var(--pill-border);
        background: var(--pill-bg);
        backdrop-filter: blur(14px);
        border-radius: 6px;
        font-family: 'Outfit', sans-serif;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.5px;
        color: var(--pill-text);
        box-shadow: var(--shadow-sm);
      }
      .top-pill:hover {
        background: var(--pill-hover);
      }
      .status-dot {
        width: 6px;
        height: 6px;
        background: var(--status-dot);
        border-radius: 100%;
        display: inline-block;
      }
      .side-foot-dot {
        margin-right: 7px;
        vertical-align: middle;
      }
      #toggle-panel {
        display: none;
      }
      #legend-chrome {
        position: absolute;
        bottom: max(28px, env(safe-area-inset-bottom, 0px));
        left: 392px;
        z-index: 11;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        max-width: min(600px, calc(100vw - 480px));
      }
      #bottom-legend {
        background: var(--legend-bg);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 14px 17px;
        min-width: 250px;
        max-width: 100%;
        box-shadow: var(--shadow-sm);
        backdrop-filter: blur(16px);
      }
      .legend-label {
        font-family: 'Outfit', sans-serif;
        letter-spacing: 1.2px;
        font-size: 9px;
        text-transform: uppercase;
        color: var(--legend-label);
        margin-bottom: 11px;
        font-weight: 600;
      }
      .legend-row {
        display: flex;
        flex-wrap: wrap;
        column-gap: 17px;
        row-gap: 10px;
      }
      .legend-key {
        display: flex;
        align-items: center;
        gap: 7px;
        color: var(--legend-key);
        font-size: 11px;
        white-space: nowrap;
      }
      .legend-more {
        color: var(--muted);
      }
      .legend-swatch {
        width: 11px;
        height: 11px;
        border-radius: 2px;
        border: 1px solid rgba(42, 38, 32, 0.12);
      }
      html[data-theme='dark'] .legend-swatch {
        border-color: rgba(255, 255, 255, 0.15);
      }
      .legend-gradient {
        height: 10px;
        border-radius: 3px;
        background: linear-gradient(
          90deg,
          var(--track),
          #316656,
          var(--green-soft)
        );
      }
      .legend-scale {
        display: flex;
        justify-content: space-between;
        margin-top: 7px;
        font-family: 'Outfit', sans-serif;
        color: var(--muted);
        font-size: 10px;
      }
      #map-controls {
        position: absolute;
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: max(44px, calc(28px + env(safe-area-inset-bottom, 0px)));
        z-index: 12;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .map-control {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border: 1px solid var(--control-border);
        background: var(--control-bg);
        color: var(--pill-text);
        border-radius: 6px;
        box-shadow: var(--shadow-sm);
        backdrop-filter: blur(10px);
      }
      .map-control:hover {
        background: var(--green-bg);
        color: var(--green);
      }
      .data-disclaimer-pill {
        height: 36px;
        min-height: 36px;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        border: 1px solid var(--pill-border);
        background: var(--pill-bg);
        backdrop-filter: blur(14px);
        border-radius: 6px;
        font-family: 'Outfit', sans-serif;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.4px;
        color: var(--pill-text);
        box-shadow: var(--shadow-sm);
        white-space: nowrap;
      }
      .data-disclaimer-pill:hover {
        background: var(--pill-hover);
      }
      .data-disclaimer-pill .info-mark {
        font-size: 12px;
        line-height: 1;
        color: var(--brand-atlas);
      }
      .data-disclaimer-short {
        display: none;
      }
      #hover-tip {
        position: absolute;
        z-index: 35;
        pointer-events: none;
        display: none;
        min-width: 174px;
        max-width: 255px;
        background: var(--tip-bg);
        border: 1px solid var(--tip-border);
        border-radius: 7px;
        padding: 11px 13px;
        box-shadow: var(--shadow-sm);
      }
      .hover-head {
        font-size: 14px;
        font-weight: 700;
        font-family: 'Outfit', sans-serif;
      }
      .hover-minor {
        color: var(--hover-minor);
        font-size: 11px;
        margin: 4px 0;
      }
      .hover-value {
        font-size: 12px;
        margin-top: 8px;
        color: var(--tip-value);
      }
      .hover-value b {
        color: var(--green);
      }
      #detail {
        position: absolute;
        right: 22px;
        top: 105px;
        z-index: 24;
        width: 344px;
        background: var(--detail-bg);
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: var(--shadow);
        backdrop-filter: blur(24px);
        max-height: calc(100vh - 165px);
        overflow: auto;
        transform: translateX(calc(100% + 34px));
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      }
      #detail.open {
        transform: translateX(0);
      }
      .detail-head {
        padding: 21px 21px 18px;
        border-bottom: 1px solid var(--border-line);
      }
      .detail-topline {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      .detail-code {
        font-family: 'Outfit', sans-serif;
        font-size: 30px;
        line-height: 1.2;
        font-weight: 700;
        letter-spacing: -1.1px;
        margin-top: 8px;
      }
      .detail-ward {
        font-size: 12px;
        color: var(--text-soft);
        margin: 3px 0;
      }
      .detail-metrics {
        display: grid;
        grid-template-columns: 1fr 1fr;
        border-bottom: 1px solid var(--border-line);
      }
      .detail-metric {
        padding: 13px 21px;
      }
      .detail-metric + .detail-metric {
        border-left: 1px solid var(--border-line);
      }
      .detail-metric strong {
        font-family: 'Outfit', sans-serif;
        font-size: 20px;
        letter-spacing: -0.5px;
      }
      .detail-metric span {
        display: block;
        font-family: 'Outfit', sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--muted);
        font-size: 9px;
        margin-top: 4px;
        font-weight: 500;
      }
      .detail-body {
        padding: 17px 21px 21px;
      }
      .drow {
        margin-bottom: 15px;
      }
      .dline {
        display: flex;
        justify-content: space-between;
        gap: 5px;
        font-size: 11px;
        margin-bottom: 6px;
      }
      .dline-name {
        color: var(--dline-name);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .dline-num {
        color: var(--dline-num);
        font-family: 'Outfit', sans-serif;
        font-variant-numeric: tabular-nums;
      }
      .dtrack {
        height: 5px;
        background: var(--track);
        border-radius: 5px;
        overflow: hidden;
      }
      .dfill {
        height: 100%;
        border-radius: 5px;
      }
      .detail-actions {
        margin-top: 19px;
        display: flex;
        gap: 8px;
      }
      .focus-btn {
        flex: 1;
        background: var(--focus-btn-bg);
        border: 1px solid var(--focus-btn-border);
        color: var(--focus-btn-text);
        font-size: 11px;
        font-weight: 700;
        border-radius: 5px;
        padding: 12px 10px;
        min-height: 44px;
      }
      .focus-btn:hover {
        background: var(--focus-btn-hover);
      }
      .neutral-btn {
        background: var(--neutral-btn-bg);
        border: 1px solid var(--neutral-btn-border);
        border-radius: 5px;
        padding: 12px 10px;
        font-size: 11px;
        min-height: 44px;
        color: var(--text);
      }
      #empty-message {
        position: absolute;
        z-index: 11;
        right: 25px;
        bottom: 190px;
        background: var(--empty-bg);
        border: 1px solid var(--line);
        border-radius: 7px;
        padding: 12px 14px;
        color: var(--text-soft);
        font-size: 11px;
        display: flex;
        align-items: center;
        gap: 10px;
        max-width: 246px;
        backdrop-filter: blur(10px);
      }
      .hint-icon {
        width: 17px;
        height: 17px;
        flex-shrink: 0;
        color: var(--green);
        stroke: currentColor;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.7;
      }
      #toast {
        position: absolute;
        bottom: max(28px, env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translate(-50%, 25px);
        opacity: 0;
        transition: 0.2s;
        background: var(--toast-bg);
        border: 1px solid var(--toast-border);
        padding: 12px 18px;
        border-radius: 7px;
        color: var(--toast-text);
        z-index: 60;
        font-size: 12px;
        pointer-events: none;
      }
      #toast.on {
        opacity: 1;
        transform: translate(-50%, 0);
      }
      #help-modal {
        position: absolute;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 90;
        background: var(--help-overlay);
        backdrop-filter: blur(6px);
        padding: 18px;
      }
      #help-modal.open {
        display: flex;
      }
      .help-card {
        max-width: 510px;
        width: 100%;
        border: 1px solid var(--help-border);
        border-radius: 12px;
        background: var(--help-card);
        padding: 30px;
        box-shadow: var(--shadow);
      }
      .help-card h2 {
        margin: 9px 0;
        font-family: 'Outfit', sans-serif;
        font-size: 27px;
        color: var(--text);
      }
      .help-card p {
        line-height: 1.65;
        color: var(--help-p);
      }
      .help-item {
        display: flex;
        gap: 11px;
        margin: 16px 0;
        color: var(--help-item);
        align-items: flex-start;
      }
      .help-num {
        font-family: 'Outfit', sans-serif;
        background: var(--help-num-bg);
        color: var(--help-num-text);
        padding: 4px 7px;
        border-radius: 4px;
        flex-shrink: 0;
        font-weight: 600;
        letter-spacing: 0.4px;
      }
      .help-end {
        width: 100%;
        padding: 12px;
        margin-top: 12px;
        background: var(--help-btn);
        color: var(--help-btn-text);
        border-radius: 6px;
        font-weight: 800;
        min-height: 44px;
      }
      .help-legal-pointer {
        font-size: 11px;
        margin: 18px 0 0;
        line-height: 1.55;
        color: var(--help-p);
      }
      #legal-modal {
        position: absolute;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 92;
        background: var(--help-overlay);
        backdrop-filter: blur(6px);
        padding: 18px;
      }
      #legal-modal.open {
        display: flex;
      }
      .legal-card {
        max-width: 560px;
        width: 100%;
        max-height: min(90dvh, 720px);
        overflow-y: auto;
        border: 1px solid var(--help-border);
        border-radius: 12px;
        background: var(--help-card);
        padding: 28px 30px 26px;
        box-shadow: var(--shadow);
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar) transparent;
      }
      .legal-card h2 {
        margin: 8px 0 16px;
        font-family: 'Outfit', sans-serif;
        font-size: 20px;
        letter-spacing: -0.4px;
        color: var(--text);
        line-height: 1.25;
      }
      .legal-card p {
        margin: 0 0 14px;
        font-size: 11.5px;
        line-height: 1.6;
        color: var(--help-p);
      }
      .legal-card p strong {
        color: var(--text);
        font-weight: 700;
      }
      .legal-card a {
        color: var(--brand-atlas);
        text-decoration: underline;
        text-underline-offset: 2px;
      }
      .legal-card a:hover {
        color: var(--brand-winnipeg);
      }
      .legal-card em {
        font-style: italic;
      }
      .legal-updated {
        margin-bottom: 18px !important;
        color: var(--muted) !important;
      }
      .legal-close {
        width: 100%;
        padding: 12px;
        margin-top: 4px;
        background: var(--help-btn);
        color: var(--help-btn-text);
        border-radius: 6px;
        font-weight: 800;
        min-height: 44px;
      }
      #loading {
        position: absolute;
        left: calc(50% + 180px);
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 9;
        background: var(--loading-bg);
        border: 1px solid var(--loading-border);
        padding: 17px 24px;
        border-radius: 9px;
        text-align: center;
        color: var(--loading-text);
      }
      .spinner {
        width: 22px;
        height: 22px;
        border: 2px solid var(--spinner-track);
        border-top-color: var(--spinner-head);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
        margin: 0 auto 9px;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }
      .disclaimer {
        margin: 26px 0 0;
        font-size: 10px;
        color: var(--muted);
        line-height: 1.7;
      }
      @media (max-width: 1150px) {
        #floating-header {
          left: calc(50% + 160px);
        }
        #top-right .map-eyebrow {
          display: none;
        }
        #detail {
          width: 315px;
        }
      }
      @media (max-width: 870px) {
        #floating-header {
          display: none;
        }
        #top-right {
          right: max(12px, env(safe-area-inset-right, 0px));
          top: max(12px, env(safe-area-inset-top, 0px));
        }
        .top-pill {
          height: 36px;
          min-height: 36px;
          padding: 0 10px;
        }
        #sidebar {
          width: 330px;
          top: 12px;
          left: 12px;
          bottom: 12px;
        }
        #legend-chrome {
          left: 360px;
        }
      }
      @media (max-width: 700px) {
        #sidebar {
          width: min(350px, calc(100vw - 24px));
          height: auto;
          bottom: unset;
          top: max(10px, env(safe-area-inset-top, 0px));
          left: max(10px, env(safe-area-inset-left, 0px));
          max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px));
        }
        .sidebar-body {
          max-height: calc(100dvh - 150px);
        }
        #sidebar.mobile-hidden {
          transform: translateX(-110%);
          opacity: 0;
          pointer-events: none;
        }
        #toggle-panel {
          display: flex;
        }
        #top-right {
          right: max(10px, env(safe-area-inset-right, 0px));
          top: max(10px, env(safe-area-inset-top, 0px));
          gap: 6px;
        }
        .top-pill {
          font-size: 9px;
          height: 40px;
          min-height: 40px;
        }
        .top-pill span.hide-mobile {
          display: none;
        }
        #legend-chrome {
          bottom: max(18px, env(safe-area-inset-bottom, 0px));
          left: max(10px, env(safe-area-inset-left, 0px));
          right: 72px;
          max-width: none;
        }
        #bottom-legend {
          padding: 11px 13px;
          min-width: 0;
          width: 100%;
        }
        #map-controls {
          right: max(10px, env(safe-area-inset-right, 0px));
          bottom: max(36px, calc(18px + env(safe-area-inset-bottom, 0px)));
        }
        .data-disclaimer-pill {
          height: 34px;
          min-height: 34px;
          font-size: 9px;
          padding: 0 10px;
        }
        #detail {
          right: 10px;
          left: 10px;
          width: auto;
          top: auto;
          bottom: calc(110px + env(safe-area-inset-bottom, 0px));
          max-height: 48dvh;
          z-index: 26;
          transform: translateY(calc(100% + 140px));
        }
        #detail.open {
          transform: translateY(0);
        }
        #empty-message {
          display: none;
        }
        #loading {
          left: 50%;
        }
        #sidebar .stat-val {
          font-size: 21px;
        }
        .field-select,
        .searchbox {
          font-size: 16px;
          height: 44px;
        }
        .mode {
          min-height: 48px;
        }
      }
      @media (max-width: 400px) {
        .mode-grid {
          grid-template-columns: 1fr;
        }
        .data-disclaimer-full {
          display: none;
        }
        .data-disclaimer-short {
          display: inline;
        }
      }

/* --- SEO / share / docs additions --- */
.page-h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  letter-spacing: -0.7px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.25;
  color: var(--text);
}
.seo-intro {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
}
.seo-analysis {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-soft);
}
.seo-analysis h2 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--field-label);
  font-family: 'Outfit', sans-serif;
}
.seo-analysis ul {
  margin: 0;
  padding-left: 16px;
}
.seo-analysis li {
  margin-bottom: 6px;
}
.acclaimed-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-soft);
  margin-bottom: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
}
.side-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.3px;
}
.side-nav a {
  color: var(--link-btn);
  text-decoration: none;
}
.side-nav a:hover {
  color: var(--link-btn-hover);
}
.share-wrap {
  position: relative;
}
.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--panel-solid);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 6px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-menu[hidden] {
  display: none !important;
}
.share-menu button {
  text-align: left;
  padding: 9px 11px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
}
.share-menu button:hover {
  background: var(--mode-hover-bg);
}
.docs-page {
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}
.docs-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 22px 80px;
}
.docs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
  color: inherit;
}
.docs-brand img {
  width: 36px;
  height: 36px;
}
.docs-brand .brand-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.6px;
}
.docs-wrap h1 {
  font-size: 30px;
  letter-spacing: -0.9px;
  margin: 0 0 12px;
}
.docs-wrap h2 {
  font-size: 18px;
  margin: 28px 0 10px;
}
.docs-wrap p,
.docs-wrap li {
  line-height: 1.65;
  color: var(--text-soft);
  font-size: 15px;
}
.docs-wrap a {
  color: var(--green);
}
.docs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 18px 0 28px;
  font-size: 13px;
}
.docs-grid {
  display: grid;
  gap: 10px;
}
.docs-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  text-decoration: none;
  color: inherit;
}
.docs-card:hover {
  border-color: var(--green-border);
}
.docs-card strong {
  display: block;
  margin-bottom: 4px;
}
.docs-card span {
  font-size: 13px;
  color: var(--muted);
}
