.pogvm {
    --pogvm-navy: #10203c;
    --pogvm-blue: #185ca8;
    --pogvm-blue-dark: #0f3f73;
    --pogvm-border: #e6eaf0;
    --pogvm-surface: #ffffff;
    --pogvm-soft: #f5f7fa;
    --pogvm-text: #2b3b52;
    --pogvm-muted: #667085;
    --pogvm-map-fill: #dfe6ee;
    --pogvm-map-hover: #b7cde5;
    --pogvm-map-selected: #185ca8;
    --pogvm-map-height: 720px;
    color: var(--pogvm-text);
    font: inherit;
}

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

.pogvm__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.pogvm__eyebrow {
    margin: 0 0 4px;
    color: var(--pogvm-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pogvm__title {
    margin: 0;
    color: var(--pogvm-navy);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.2;
}

.pogvm__intro {
    max-width: 760px;
    margin: 8px 0 0;
}

.pogvm__controls {
    min-width: min(100%, 300px);
}

.pogvm__search-label {
    display: block;
    margin-bottom: 5px;
    color: var(--pogvm-navy);
    font-size: 0.82rem;
    font-weight: 700;
}

.pogvm__search {
    width: 100%;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid var(--pogvm-border);
    border-radius: 7px;
    background: var(--pogvm-surface);
    color: var(--pogvm-text);
    font: inherit;
}

.pogvm__zoom-controls {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.pogvm__button {
    min-width: 38px;
    min-height: 36px;
    padding: 5px 10px;
    border: 1px solid var(--pogvm-border);
    border-radius: 7px;
    background: var(--pogvm-surface);
    color: var(--pogvm-navy);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.pogvm__button:hover,
.pogvm__button:focus-visible {
    border-color: var(--pogvm-blue);
    outline: none;
}

.pogvm__button--text {
    min-width: 64px;
}

.pogvm__status {
    margin: 0 0 12px;
    padding: 9px 12px;
    border: 1px solid var(--pogvm-border);
    border-radius: 7px;
    background: var(--pogvm-soft);
    color: var(--pogvm-muted);
    font-size: 0.9rem;
}

.pogvm__status.is-error {
    border-color: #c7a7a7;
    color: #7b2525;
}

.pogvm__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

.pogvm__map-wrap {
    position: relative;
    min-height: var(--pogvm-map-height);
    overflow: hidden;
    border: 1px solid var(--pogvm-border);
    border-radius: 10px;
    background: var(--pogvm-soft);
    touch-action: none;
}

.pogvm__map {
    display: block;
    width: 100%;
    height: var(--pogvm-map-height);
    cursor: grab;
    user-select: none;
}

.pogvm__map.is-dragging {
    cursor: grabbing;
}

.pogvm__constituency {
    fill: var(--pogvm-map-fill);
    stroke: #ffffff;
    stroke-width: 1.1;
    vector-effect: non-scaling-stroke;
    transition: fill 120ms ease, opacity 120ms ease;
}

.pogvm__constituency:hover,
.pogvm__constituency.is-hovered {
    fill: var(--pogvm-map-hover);
}

.pogvm__constituency.is-selected {
    fill: var(--pogvm-map-selected);
    stroke: var(--pogvm-blue-dark);
    stroke-width: 1.8;
}

.pogvm__tooltip {
    position: absolute;
    z-index: 5;
    max-width: 250px;
    padding: 7px 9px;
    border: 1px solid var(--pogvm-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 18px rgba(16, 32, 60, 0.12);
    color: var(--pogvm-navy);
    font-size: 0.82rem;
    pointer-events: none;
}

.pogvm__details {
    padding: 16px;
    border: 1px solid var(--pogvm-border);
    border-radius: 10px;
    background: var(--pogvm-surface);
}

.pogvm__details-label {
    margin: 0 0 4px;
    color: var(--pogvm-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pogvm__details-name {
    margin: 0 0 14px;
    color: var(--pogvm-navy);
    font-size: 1.2rem;
    line-height: 1.25;
}

.pogvm__details-list {
    margin: 0;
}

.pogvm__details-list div {
    padding: 9px 0;
    border-top: 1px solid var(--pogvm-border);
}

.pogvm__details-list dt {
    margin-bottom: 2px;
    color: var(--pogvm-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.pogvm__details-list dd {
    margin: 0;
}

.pogvm__caveat {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--pogvm-border);
    color: var(--pogvm-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.pogvm__debug {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed var(--pogvm-border);
    border-radius: 8px;
    background: #fbfcfd;
}

.pogvm__debug summary {
    color: var(--pogvm-navy);
    cursor: pointer;
    font-weight: 700;
}

.pogvm__debug dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin: 12px 0 0;
}

.pogvm__debug dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--pogvm-border);
}

.pogvm__debug dt {
    font-weight: 700;
}

.pogvm__debug dd {
    margin: 0;
    text-align: right;
}

.pogvm__source {
    margin: 10px 0 0;
    color: var(--pogvm-muted);
    font-size: 0.78rem;
}


/* v0.3.3 embedded consumer mode: keep map-owned controls, legend, details and
   attribution while suppressing the standalone heading/intro shell. */
.pogvm--embedded .pogvm__header {
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pogvm--embedded .pogvm__controls {
    width: min(100%, 360px);
    min-width: min(100%, 300px);
}

.pogvm--embedded .pogvm__source {
    margin-top: 8px;
}

@media (max-width: 820px) {
    .pogvm__vote-summary {
        display: block;
    }

    .pogvm__vote-source-link {
        display: inline-flex;
        margin-top: 8px;
    }
    .pogvm__header {
        display: block;
    }

    .pogvm__controls {
        margin-top: 16px;
    }

    .pogvm--embedded .pogvm__controls {
        width: 100%;
        margin-top: 0;
    }

    .pogvm__layout {
        grid-template-columns: 1fr;
    }

    .pogvm__details {
        order: -1;
    }

    .pogvm__map-wrap,
    .pogvm__map {
        min-height: min(70vh, 650px);
        height: min(70vh, 650px);
    }

    .pogvm__debug dl {
        grid-template-columns: 1fr;
    }
}

/* v0.1.1 searchable constituency combobox */
.pogvm__search-wrap {
    position: relative;
}

.pogvm__search {
    appearance: none;
}

.pogvm__suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--pogvm-border);
    border-radius: 8px;
    background: var(--pogvm-surface);
    box-shadow: 0 8px 24px rgba(16, 32, 60, 0.13);
}

.pogvm__suggestion {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid var(--pogvm-border);
    background: transparent;
    color: var(--pogvm-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.pogvm__suggestion:last-child {
    border-bottom: 0;
}

.pogvm__suggestion:hover,
.pogvm__suggestion:focus-visible,
.pogvm__suggestion.is-active {
    background: var(--pogvm-soft);
    color: var(--pogvm-navy);
    outline: none;
}

.pogvm__suggestion-empty {
    padding: 9px 11px;
    color: var(--pogvm-muted);
    font-size: 0.9rem;
}

.pogvm__clear-selection {
    margin-top: 14px;
    padding: 7px 10px;
    border: 1px solid var(--pogvm-border);
    border-radius: 7px;
    background: var(--pogvm-surface);
    color: var(--pogvm-blue-dark);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
}

.pogvm__clear-selection:hover,
.pogvm__clear-selection:focus-visible {
    border-color: var(--pogvm-blue);
    outline: none;
}

.pogvm__source a,
.pogvm__debug a {
    color: var(--pogvm-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pogvm__source a:hover,
.pogvm__source a:focus-visible,
.pogvm__debug a:hover,
.pogvm__debug a:focus-visible {
    color: var(--pogvm-blue-dark);
}

@media (max-width: 820px) {
    .pogvm__suggestions {
        max-height: 240px;
    }
}

/* v0.2 MP join */
.pogvm__status.is-warning {
    border-color: #dec98d;
    background: #fffaf0;
    color: #66521c;
}

.pogvm__suggestion-main,
.pogvm__suggestion-meta {
    display: block;
}

.pogvm__suggestion-main {
    color: var(--pogvm-navy);
    font-weight: 600;
}

.pogvm__suggestion-meta {
    margin-top: 2px;
    color: var(--pogvm-muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.pogvm__party {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pogvm__party-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border: 1px solid rgba(16, 32, 60, 0.12);
    border-radius: 50%;
}

.pogvm__mp-profile {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    color: var(--pogvm-blue-dark);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.pogvm__mp-profile:hover,
.pogvm__mp-profile:focus-visible {
    color: var(--pogvm-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
}

.pogvm__mp-profile[hidden] {
    display: none !important;
}

/* v0.2.1 shared map modes */
.pogvm--party .pogvm__constituency.is-party-coloured {
    fill: var(--pogvm-party-fill);
}

.pogvm--party .pogvm__constituency.is-party-coloured:hover,
.pogvm--party .pogvm__constituency.is-party-coloured.is-hovered {
    filter: brightness(0.9);
}

/* In party mode, selection must never substitute a political-looking generic colour. */
.pogvm--party.has-selection .pogvm__constituency:not(.is-selected) {
    opacity: 0.28;
    filter: saturate(0.62) brightness(1.08);
}

.pogvm--party .pogvm__constituency.is-party-coloured.is-selected {
    fill: var(--pogvm-party-fill);
    opacity: 1;
    stroke: #10203c;
    stroke-width: 2.8;
    filter: drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 2.1px rgba(16, 32, 60, 0.92));
}

.pogvm--party .pogvm__constituency.is-selected:not(.is-party-coloured) {
    fill: #dfe6ee;
    opacity: 1;
    stroke: #10203c;
    stroke-width: 2.8;
    filter: drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 2.1px rgba(16, 32, 60, 0.92));
}

.pogvm--party .pogvm__constituency.is-selected:hover,
.pogvm--party .pogvm__constituency.is-selected.is-hovered {
    filter: drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 2.1px rgba(16, 32, 60, 0.92));
}


/* v0.3 Commons division distribution mode. Colours match the live Votes feature. */
.pogvm--vote .pogvm__constituency.is-vote-aye {
    fill: #2e8b57;
}

.pogvm--vote .pogvm__constituency.is-vote-no {
    fill: #d92d20;
}

.pogvm--vote .pogvm__constituency.is-vote-no-recorded {
    fill: #cbd5e1;
}

.pogvm--vote .pogvm__constituency.is-vote-unavailable {
    fill: #f3f4f6;
}

.pogvm--vote .pogvm__constituency.is-vote-aye:hover,
.pogvm--vote .pogvm__constituency.is-vote-no:hover,
.pogvm--vote .pogvm__constituency.is-vote-no-recorded:hover,
.pogvm--vote .pogvm__constituency.is-vote-unavailable:hover {
    filter: brightness(0.9);
}

/* Selection never changes the vote meaning: keep the result fill and use a neutral halo. */
.pogvm--vote.has-selection .pogvm__constituency:not(.is-selected) {
    opacity: 0.34;
}

.pogvm--vote .pogvm__constituency.is-selected {
    opacity: 1;
    stroke: #10203c;
    stroke-width: 2.8;
    filter: drop-shadow(0 0 1.4px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 2.1px rgba(16, 32, 60, 0.92));
}

.pogvm--vote .pogvm__constituency.is-vote-aye.is-selected {
    fill: #2e8b57;
}

.pogvm--vote .pogvm__constituency.is-vote-no.is-selected {
    fill: #d92d20;
}

.pogvm--vote .pogvm__constituency.is-vote-no-recorded.is-selected {
    fill: #cbd5e1;
}

.pogvm--vote .pogvm__constituency.is-vote-unavailable.is-selected {
    fill: #f3f4f6;
}

.pogvm__vote-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--pogvm-border);
    border-radius: 9px;
    background: var(--pogvm-surface);
}

.pogvm__vote-summary[hidden] {
    display: none;
}

.pogvm__vote-summary-eyebrow {
    margin: 0 0 3px;
    color: var(--pogvm-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pogvm__vote-summary-title {
    display: block;
    color: var(--pogvm-navy);
    font-size: 0.98rem;
    line-height: 1.35;
}

.pogvm__vote-summary-meta {
    margin: 4px 0 0;
    color: var(--pogvm-muted);
    font-size: 0.82rem;
}

.pogvm__vote-source-link {
    flex: 0 0 auto;
    color: var(--pogvm-blue-dark);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.pogvm__vote-source-link:hover,
.pogvm__vote-source-link:focus-visible {
    color: var(--pogvm-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
}

.pogvm__legend-swatch--aye { background: #2e8b57; }
.pogvm__legend-swatch--no { background: #d92d20; }
.pogvm__legend-swatch--no-recorded { background: #cbd5e1; }
.pogvm__legend-swatch--unavailable { background: #f3f4f6; }

.pogvm__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--pogvm-border);
    border-radius: 8px;
    background: var(--pogvm-surface);
    color: var(--pogvm-muted);
    font-size: 0.8rem;
}

.pogvm__legend[hidden] {
    display: none;
}

.pogvm__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pogvm__legend-swatch {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 1px solid rgba(16, 32, 60, 0.18);
    border-radius: 50%;
}

/* Lightweight single-constituency renderer. */
.pogmaps-outline {
    margin: 0;
    color: var(--pogvm-text, #2b3b52);
}

.pogmaps-outline__map {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--pogmaps-outline-height, 280px);
    overflow: hidden;
    border: 1px solid #e6eaf0;
    border-radius: 10px;
    background: #f5f7fa;
}

.pogmaps-outline__map svg {
    display: block;
    width: 100%;
    height: var(--pogmaps-outline-height, 280px);
}

.pogmaps-outline__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 12px;
    margin-top: 9px;
    color: #10203c;
}

.pogmaps-outline__caption span {
    color: #667085;
    font-size: 0.9rem;
}

.pogmaps-outline__caption a {
    margin-left: auto;
}

.pogmaps-outline__source,
.pogmaps-outline__debug {
    margin: 7px 0 0;
    color: #667085;
    font-size: 0.76rem;
}

.pogmaps-outline-error {
    padding: 10px 12px;
    border: 1px solid #e6eaf0;
    border-radius: 8px;
    background: #f5f7fa;
    color: #667085;
    font-size: 0.9rem;
}

@media (max-width: 520px) {
    .pogmaps-outline__caption a {
        width: 100%;
        margin-left: 0;
    }
}

/* v0.2.2 contextual compact constituency map */
.pogmaps-outline__map {
    position: relative;
}

.pogmaps-outline__neighbour {
    fill: #e9eef4;
    stroke: #ffffff;
    stroke-width: 1.1;
    vector-effect: non-scaling-stroke;
}

.pogmaps-outline__seat {
    stroke: #185ca8;
    stroke-width: 2.2;
    vector-effect: non-scaling-stroke;
}

.pogmaps-outline__label {
    fill: #596579;
    font-family: inherit;
    font-size: 8px;
    font-weight: 600;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, 0.94);
    stroke-width: 3px;
    stroke-linejoin: round;
}

.pogmaps-outline__label--selected {
    fill: #10203c;
    font-size: 9px;
    font-weight: 800;
    stroke-width: 3.5px;
}

.pogmaps-outline__context-key {
    position: absolute;
    right: 10px;
    bottom: 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border: 1px solid rgba(16, 32, 60, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #667085;
    font-size: 0.7rem;
    line-height: 1;
}

.pogmaps-outline__context-key span {
    width: 10px;
    height: 10px;
    border: 2px solid #185ca8;
    border-radius: 2px;
    background: #dfe6ee;
}

.pogmaps-outline--party .pogmaps-outline__seat {
    stroke: #10203c;
    filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, 0.98)) drop-shadow(0 0 1.8px rgba(16, 32, 60, 0.86));
}

.pogmaps-outline--party .pogmaps-outline__seat-halo {
    stroke: #ffffff;
}

.pogmaps-outline--party .pogmaps-outline__context-key span {
    background: #ffffff;
    border-color: #10203c;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.95);
}

.pogmaps-outline--party .pogmaps-outline__locator-selected {
    fill: #10203c;
    stroke: #ffffff;
    stroke-width: 1.4;
}

@media (max-width: 520px) {
    .pogmaps-outline__label {
        font-size: 7px;
    }

    .pogmaps-outline__label--selected {
        font-size: 8px;
    }

    .pogmaps-outline__context-key {
        right: 7px;
        bottom: 7px;
        font-size: 0.66rem;
    }
}

/* v0.2.3 compact-map context list: names remain readable without crowding SVG geography. */
.pogmaps-outline__nearby {
    margin: 7px 0 0;
    color: #667085;
    font-size: 0.78rem;
    line-height: 1.45;
}

.pogmaps-outline__nearby strong {
    color: #2b3b52;
    font-weight: 650;
}

/* v0.2.4: compact UK locator inset for immediate geographic orientation. */
.pogmaps-outline__locator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 96px;
    min-height: 142px;
    box-sizing: border-box;
    padding: 5px 5px 7px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #53657c;
    text-align: center;
    line-height: 1.15;
    pointer-events: none;
}

.pogmaps-outline__locator svg {
    display: block;
    width: 100%;
    height: 118px;
}

.pogmaps-outline__locator-title {
    fill: #53657c;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pogmaps-outline__locator-dots {
    fill: #c8d2de;
    stroke: none;
}

.pogmaps-outline__locator-selected {
    fill: #185ca8;
    stroke: #ffffff;
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
}

.pogmaps-outline__locator-nation {
    display: block;
    margin-top: -3px;
    font-size: 11px;
    font-weight: 700;
    color: #34465d;
}

@media (max-width: 600px) {
    .pogmaps-outline__locator {
        top: 8px;
        right: 8px;
        width: 82px;
        min-height: 124px;
        padding: 4px 4px 6px;
    }

    .pogmaps-outline__locator svg {
        height: 102px;
    }

    .pogmaps-outline__locator-nation {
        font-size: 10px;
    }
}
