/* **************************************** */
/* * Boundary Map Controls */
/* **************************************** */
.boundary-comparison-page [hidden], .boundary-directory-page [hidden], #boundaryCheckoutModal [hidden] { display: none !important; }
.comparison-map-card { position: relative; z-index: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.comparison-map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px; }
.comparison-map-toolbar h2 { flex-basis: 100%; margin: 0; font-size: 1.35rem; }
.comparison-mode-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.comparison-mode-controls button { padding: 8px 12px; border: 1px solid #cfdbe4; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.comparison-mode-controls button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.comparison-reset, .comparison-focus { border: 0; background: transparent; color: #315e83; font: inherit; font-size: .85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.comparison-reset { margin-left: auto; padding: 8px 0; }
.comparison-map-card button:disabled { opacity: .55; cursor: wait; }
.comparison-map-container { position: relative; }
.comparison-map { height: 490px; background: #eef3f5; isolation: isolate; }
.comparison-map-legend { position: absolute; bottom: 56px; left: 14px; z-index: 600; display: flex; flex-wrap: wrap; gap: 9px 16px; max-width: calc(100% - 28px); padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fffffff0; color: var(--ink); font-size: .8rem; font-weight: 700; pointer-events: none; }
.comparison-map-legend span { display: flex; align-items: center; gap: 7px; }
.comparison-swatch { width: 11px; height: 11px; border-radius: 2px; }
.comparison-swatch.retained { background: #477daa; }
.comparison-swatch.removed { background: #d99028; }
.comparison-swatch.added { background: #078d79; }
.comparison-map-status { position: absolute; bottom: 0; left: 0; z-index: 600; width: 100%; margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); background: #fffffff0; color: var(--muted); font-size: .72rem; line-height: 1.4; pointer-events: none; }
.comparison-map .leaflet-control-attribution { margin-bottom: 37px; font-size: 9px; }
.comparison-map-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 14px 18px 0; }
.comparison-focus { padding: 0; text-align: left; }
.comparison-map-caption { margin: 0; padding: 12px 18px 16px; color: var(--muted); font-size: .82rem; line-height: 1.55; }

/* **************************************** */
/* * Linked Boundary Change Images */
/* **************************************** */
.ward-page .facts-box img.boundary-change-image { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; margin: 0 0 16px; border: 0; border-radius: 0; background: #fff; }
.ward-page .boundary-image-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.boundary-image-links .boundary-image-featured { grid-column: 1 / -1; }
.boundary-image-summary { margin: 0 0 28px; }
.boundary-image-summary > a { display: block; }

/* **************************************** */
/* * Ward Style Comparison Data */
/* **************************************** */
.boundary-table-wrap { overflow-x: auto; }
.boundary-comparison-page .stripe-tbl td { vertical-align: top; }
.boundary-comparison-page .stripe-tbl td:nth-child(2) { white-space: normal; }
.boundary-related-wards { margin-top: 26px; }
.boundary-comparison-page .boundary-related-wards .related-wards { margin: 20px 0; padding: 0; }
.boundary-historical-ward { padding: 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #f7fafc; }
.boundary-historical-ward h3 { margin: 0 0 12px; font-size: 1.12rem; }
.boundary-historical-ward p { margin: 0; font-size: .9rem; }
.comparison-sources { margin-top: 26px; }
.comparison-sources summary { cursor: pointer; color: var(--ink); font-weight: 800; }
.comparison-sources[open] summary { margin-bottom: 16px; }
.boundary-page-links { margin-top: 26px; }
.boundary-unchanged-note { margin: 0 0 20px; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); }

/* **************************************** */
/* * Darlington 2027 Ward Review */
/* **************************************** */
.ward-page .darlington-review-notice { margin: 24px 0; border: 2px solid #a95a09; border-left-width: 7px; background: #fff8ea; }
.darlington-review-notice h2 { margin-top: 0; }
.darlington-review-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.darlington-review-links .regular-btn { white-space: normal; }
.darlington-ward-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 18px 18px; }
.darlington-ward-filter label { font-weight: 700; }
.darlington-ward-filter select { max-width: 100%; padding: 10px; border: 1px solid #cfdbe4; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.darlington-map-key { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 16px 18px 0; font-size: .85rem; font-weight: 700; }
.darlington-current-key { border-bottom: 3px dashed #a95408; }
.darlington-new-key { border-bottom: 3px solid #007e68; }
.darlington-ward-lists { margin-top: 26px; }
.darlington-ward-lists li { margin-bottom: 7px; }

/* **************************************** */
/* * Boundary Directory */
/* **************************************** */
.boundary-directory-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 30px 0; }
.boundary-directory-totals h2 { font-size: 2rem; }
.boundary-directory-totals .section-copy { margin-bottom: 0; }
.boundary-search { max-width: 750px; margin: 20px 0; }
.boundary-search label { display: block; margin-bottom: 8px; font-weight: 700; }
.boundary-search > div { display: flex; gap: 10px; }
.boundary-search input { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #cfdbe4; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.boundary-search button { white-space: nowrap; }
.boundary-directory-list, .boundary-review-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.boundary-directory-list .facts-box, .boundary-review-list .facts-box { min-width: 0; }
.boundary-directory-list h3, .boundary-review-list h3 { margin: 0 0 12px; font-size: 1.35rem; }
.boundary-directory-list .section-copy, .boundary-review-list .section-copy { margin-bottom: 12px; }
.boundary-directory-list article > span { color: var(--muted); font-size: .82rem; }
.boundary-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 25px 0 40px; }
.boundary-pagination a { min-width: 42px; padding: 9px 14px; border: 1px solid #cfdbe4; border-radius: 6px; text-align: center; font-weight: 700; }
.boundary-pagination a[aria-current="page"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.boundary-review-section { padding-top: 28px; border-top: 1px solid var(--line); }
.boundary-review-list article { scroll-margin-top: 190px; }
.boundary-review-list a { display: inline-block; margin-top: 8px; font-size: .9rem; }
.boundary-review-status { font-weight: 700; color: var(--brand); }
.boundary-directory-page section[id], .boundary-comparison-page section[id], .boundary-comparison-page details[id] { scroll-margin-top: 190px; }

/* **************************************** */
/* * Boundary Checkout */
/* **************************************** */
#boundaryCheckoutBack { margin-top: 14px; padding: 0; border: 0; background: transparent; color: #315e83; font: inherit; text-decoration: underline; cursor: pointer; }
#boundaryCheckoutModal .ward-print-field { margin-bottom: 14px; }
#boundaryCheckoutModal .ward-print-checkbox { margin: 16px 0; }
#boundaryCheckoutModal .ward-download-payment-subtitle { line-height: 1.5; }

/* **************************************** */
/* * Smaller Screens */
/* **************************************** */
@media (max-width: 1050px) {
    .boundary-directory-list, .boundary-review-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .ward-page .boundary-image-links { grid-template-columns: 1fr; }
    .comparison-map { height: 390px; }
    .comparison-map-toolbar { padding: 14px; gap: 10px; }
    .comparison-mode-controls { gap: 4px; }
    .comparison-mode-controls button { padding: 8px 9px; font-size: .78rem; }
    .comparison-reset { font-size: .78rem; }
    .comparison-map-status { font-size: .68rem; }
    .comparison-map-legend { bottom: 65px; font-size: .73rem; }
    .comparison-map .leaflet-control-attribution { margin-bottom: 46px; }
    .boundary-directory-totals, .boundary-directory-list, .boundary-review-list { grid-template-columns: 1fr; gap: 14px; }
    .boundary-search > div { flex-direction: column; }
    .boundary-table-wrap .stripe-tbl th, .boundary-table-wrap .stripe-tbl td { padding: 11px 9px; font-size: .82rem; }
}
