/* V2 overrides for the shared toolkit and legacy map styles.
 * Rule order is intentional: responsive and print styles override base rules.
 * This file is maintained directly, not generated by scripts/build.mjs. */
/* Design tokens and shared element defaults. */
:root {
  --ink: #0b0c0c;
  --muted: #6f777b;
  /* Council link blue and action green; layer symbols retain data colours. */
  --teal: #00728f;
  --primary: #00663d;
  --primary-hover: #004d2e;
  --deep: #0b0c0c;
  --line: #bfc1c3;
  --paper: #f8f8f8;
  --panel-width: 370px;
  --footer: 30px;
  --category-surface: #f8f8f8;
  --subcategory-surface: #f8f8f8;
  --category-active: #eaf3f6;
  --focus-ring: #ffdd00;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0px;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}
body {
  overflow: hidden;
}
button,
input,
select,
textarea,
.govuk-body,
.govuk-label,
.govuk-hint,
.govuk-heading-m,
.govuk-details,
.govuk-button {
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
:focus-visible {
  outline: var(--focus-ring) solid 3px !important;
  outline-offset: 3px !important;
}
[hidden] {
  display: none !important;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0px;
  border-radius: 7px;
  padding: 11px 15px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  background: var(--teal);
  color: white;
}
.button-light {
  background: var(--category-active);
  color: var(--deep);
}
.button-white {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: rgba(25, 51, 55, 0.03) 0px 2px 7px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}
/* Workspace and layer catalogue. */
main {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.map-full-wrapper#map-full-container {
  position: absolute;
  inset: 0 0 var(--footer);
  display: flex;
  width: 100%;
  overflow: hidden;
  height: auto !important;
  min-height: 0px !important;
  margin: 0px !important;
  padding: 0px !important;
}
#map-full {
  position: absolute;
  inset: 0 0 0 var(--panel-width);
  background: #dee0e2;
  z-index: auto;
  width: auto !important;
  height: 100% !important;
  margin: 0px !important;
  padding: 0px !important;
}
.panel-heading {
  position: absolute;
  left: 0px;
  top: 0px;
  width: var(--panel-width);
  background: white;
  border-right: 1px solid var(--line);
  z-index: 5;
}
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.panel-tabs button {
  background: none;
  border-width: 0px 0px 2px;
  border-style: none none solid;
  border-color: currentcolor currentcolor transparent;
  border-image: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0%;
  white-space: nowrap;
}
.panel-tabs button.active {
  border-bottom-color: var(--teal);
}
.map-legend-container {
  background: rgb(255, 255, 255);
  border-right: 1px solid var(--line);
  z-index: 4;
  flex-direction: column;
  overflow: hidden;
  position: absolute !important;
  left: 0px !important;
  bottom: 0px !important;
  width: var(--panel-width) !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0px !important;
  padding: 0px !important;
}
#map-legend-top {
  flex-shrink: 0;
  position: relative !important;
}
.search-label {
  font-size: 11px;
  font-weight: 700;
  display: block;
  color: var(--ink);
}
#map-legend-top > .govuk-form-group {
  margin-bottom: 4px !important;
  display: block !important;
}
#map-legend-top fieldset {
  width: 100% !important;
  max-width: none !important;
}
#map-legend-top > .govuk-form-group > .checkbox-info {
  display: none;
}
.SelectizeWrapperClass {
  width: 100%;
}
.sel-input.govuk-input {
  box-shadow: rgba(25, 51, 55, 0.01) 0px 2px 3px;
  line-height: 19px;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  min-height: 43px !important;
  background: rgb(251, 252, 252) !important;
  padding: 11px 12px !important;
  font-size: 12px !important;
}
.sel-input input {
  min-width: 140px;
  font-size: 12px !important;
  color: var(--ink) !important;
}
.sel-dropdown {
  box-shadow: rgba(25, 51, 55, 0.125) 0px 7px 24px;
  background: white;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  z-index: 1500 !important;
  height: auto !important;
  font-size: 12px !important;
}
.sel-dropdown .option {
  line-height: 1.5;
  padding: 11px !important;
}
.sel-dropdown .active {
  background: var(--category-active);
  color: var(--deep);
}
.DropdownContentClass {
  max-height: 220px;
  overflow: auto;
}
.selection-summary {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
#selected-count {
  display: inline-block;
  background: var(--category-active);
  color: var(--teal);
  border-radius: 4px;
  padding: 3px 7px;
  margin-right: 5px;
  font-size: 11px;
}
.selection-summary button {
  background: none;
  border: 0px;
  color: var(--teal);
  font-size: 11px;
  padding: 4px;
}
.catalogue-label {
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}
#catalogue-count {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0px;
}
#map-legend-layers {
  flex: 1 1 0%;
  min-height: 0px;
  overflow: auto;
  position: relative !important;
  margin: 0px !important;
  padding: 0px 18px 24px !important;
  width: 100% !important;
  height: auto !important;
}
.map-legend-overflow {
  overflow: auto;
  height: auto !important;
  max-height: none !important;
}
#map-legend-layers > div > details {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin: 0px 0px 9px !important;
}
#map-legend-layers > div > details[open] {
  border-color: var(--line);
}
#map-legend-layers .govuk-details__summary {
  display: flex;
  align-items: center;
  padding: 14px 30px 14px 16px;
  color: var(--ink);
  width: 100%;
  text-decoration: none;
  box-sizing: border-box;
}
#map-legend-layers .govuk-details__summary::before {
  left: auto;
  right: 16px;
  border-width: 4px 0px 4px 5px;
  color: var(--muted);
}
#map-legend-layers details[open] > .govuk-details__summary::before {
  border-width: 5px 4px 0px;
  transform: none;
}
#map-legend-layers .govuk-details__summary-text {
  line-height: 1.35;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px !important;
  padding: 0px !important;
}
#map-legend-layers .govuk-details__text {
  padding: 0px 12px 8px;
  margin: 0px;
  border: 0px;
  font-size: 12px;
}
#map-legend-layers .govuk-details__text .govuk-details__summary {
  padding: 12px 22px 12px 4px;
}
#map-legend-layers .govuk-details__text .govuk-details__summary-text {
  font-weight: 500;
  font-size: 12px !important;
}
#map-legend-layers .govuk-checkboxes__label {
  line-height: 1.5;
  font-size: 12px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
#map-legend-layers .govuk-checkboxes__item {
  min-height: 32px;
}
#map-legend-layers .govuk-checkboxes__label::before,
#map-legend-layers .govuk-checkboxes__label::after {
  display: none;
}
#map-legend-layers .map-info {
  position: static;
  display: block;
  margin-left: 15px;
  margin-bottom: 5px;
  color: var(--teal);
}
.locateIcon,
.checkbox-info {
  color: var(--teal);
  font-size: 14px;
}
.svg-checkbox:has(input:focus-visible) {
  outline: var(--focus-ring) solid 3px;
  outline-offset: 3px;
}
#map-legend-bottom {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  position: relative !important;
  margin: 0px !important;
  width: 100% !important;
  bottom: auto !important;
}
#map-legend-bottom .govuk-back-link {
  font-size: 12px;
  color: var(--teal);
  margin: 0px;
}
#map-legend-bottom .govuk-inset-text {
  font-size: 12px;
  padding-left: 0px;
  border: 0px;
}
#map-legend-bottom .govuk-form-group {
  margin-bottom: 0px !important;
}
#map-legend-bottom-addressNotOnMap .govuk-back-link::before {
  display: none;
}
#map-legend-bottom-addressNotOnMap .govuk-back-link {
  padding: 0px;
}
#map-legend-addressLookup > .map-legend-overflow,
#map-legend-addressSelectize {
  padding: 20px 24px !important;
}
#map-legend-addressLookup .govuk-label,
#map-legend-addressSelectize .govuk-label {
  font-size: 15px;
  font-weight: 600;
}
#map-legend-addressLookup .govuk-hint,
#map-legend-addressSelectize .govuk-hint {
  font-size: 12px;
  line-height: 1.65;
  margin: 8px 0px 15px;
}
.govuk-button {
  background: var(--teal);
  border-radius: 5px;
  box-shadow: none;
  font-size: 13px;
  padding: 11px 15px;
}
.govuk-back-link {
  font-size: 12px;
  margin: 0px 0px 20px;
}
#PCInput {
  height: 42px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#PCLocationButton {
  display: block;
}
.govuk-select {
  border-radius: 5px;
  font-size: 13px;
}
.govuk-error-message {
  font-size: 13px;
}
.map-topbar {
  position: absolute;
  left: calc(var(--panel-width) + 20px);
  top: 18px;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 450;
}
.map-topbar > * {
  pointer-events: auto;
}
/* Floating map controls. */
.map-actions {
  position: absolute;
  right: 20px;
  top: 84px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: rgba(25, 51, 55, 0.07) 0px 3px 12px;
}
.map-actions button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: white;
  color: var(--ink);
  border-top: 0px;
  border-right: 0px;
  border-left: 0px;
  border-image: none;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.map-actions button:last-child {
  border-bottom: 0px;
}
.map-actions button:hover {
  background: var(--category-active);
}
.leaflet-top.leaflet-left {
  top: 80px !important;
  left: 10px !important;
}
.leaflet-top.leaflet-right {
  top: 8px !important;
  right: 10px !important;
}
.leaflet-control {
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}
.leaflet-bar {
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: rgba(25, 51, 55, 0.07) 0px 3px 12px !important;
}
.leaflet-bar a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--ink) !important;
}
.leaflet-control-layers {
  padding: 4px;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: rgba(25, 51, 55, 0.07) 0px 3px 12px !important;
}
.leaflet-control-layers-expanded {
  padding: 12px;
  font-size: 12px;
  line-height: 1.8;
}
.leaflet-control-layers-toggle {
  width: 32px !important;
  height: 32px !important;
}
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 5px;
  box-shadow: rgba(18, 60, 66, 0.19) 0px 7px 30px;
}
.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.65;
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}
.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(255, 255, 255, 0.867) !important;
}
.leaflet-control-scale-line {
  font-size: 10px !important;
}
.leaflet-container {
  font-family:
    Arial,
    Helvetica,
    sans-serif;
  background: #dee0e2;
}
/* Keep the divider above map panes and controls, below popups. */
#dragbar {
  z-index: 1200;
  cursor: col-resize;
  touch-action: none;
  position: absolute !important;
  bottom: 0px !important;
  height: auto !important;
}
#dragbar:hover,
#dragbar:focus-visible {
  background: rgba(0, 114, 143, 0.25);
}
#shield {
  display: none !important;
}
.map-statusbar {
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  height: var(--footer);
  background: white;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 22px;
  font-size: 9px;
  color: var(--muted);
  z-index: 500;
}
.map-statusbar > span:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
}
.map-statusbar a {
  color: var(--muted);
  text-decoration: none;
}
.service-status {
  position: absolute;
  left: calc(var(--panel-width) + 20px);
  right: 80px;
  top: 76px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgb(255, 249, 232);
  border: 1px solid rgb(231, 207, 138);
  border-radius: 8px;
  padding: 13px 15px;
  color: rgb(96, 73, 26);
  font-size: 12px;
  line-height: 1.6;
  box-shadow: rgba(25, 51, 55, 0.063) 0px 3px 12px;
}
.service-status button {
  white-space: nowrap;
  border: 0px;
  background: none;
  text-decoration: underline;
  color: rgb(96, 73, 26);
  font-size: 12px;
}
.service-status #dismiss-status {
  font-size: 20px;
  text-decoration: none;
  padding: 0px 3px;
}
.panel-collapsed .panel-heading,
.panel-collapsed .map-legend-container,
.panel-collapsed #dragbar {
  display: none !important;
}
.panel-collapsed #map-full {
  left: 0px;
}
.panel-collapsed .map-topbar {
  left: 20px;
}
.panel-collapsed .service-status {
  left: 20px;
}
#toast {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 8px;
  background: var(--deep);
  color: white;
  box-shadow: rgba(18, 60, 66, 0.145) 0px 5px 20px;
  font-size: 13px;
  z-index: 3000;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  max-width: min(500px, 90vw);
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(18, 60, 66, 0.44);
}
dialog h2 {
  font-size: 22px;
  margin: 0px 0px 18px;
}
#share-dialog label {
  display: block;
  font-size: 13px;
}
#share-dialog input {
  width: 100%;
  margin: 10px 0px 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.imgModal {
  z-index: 2500;
}
.ui.modal {
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
  border-radius: 12px !important;
}
.ui.popup {
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}
/* Embedded map layout. */
.embedded .panel-heading,
.embedded .map-topbar,
.embedded .map-actions,
.embedded .map-statusbar,
.embedded .map-legend-container,
.embedded #dragbar {
  display: none !important;
}
.embedded main {
  height: 100dvh;
}
.embedded #map-full-container {
  bottom: 0px;
}
.embedded #map-full {
  left: 0px;
}
.embedded .service-status {
  left: 15px;
  right: 15px;
  top: 15px;
}
.embedded .leaflet-top.leaflet-left {
  top: 0px !important;
}
/* Responsive catalogue and map controls. */
@media (max-width: 1000px) {
  :root {
    --panel-width: 330px;
  }
  .panel-heading {
    padding-left: 20px;
    padding-right: 20px;
  }
  .service-status {
    right: 75px;
  }
}
@media (max-width: 760px) {
  :root {
    --panel-width: 100%;
    --footer: 27px;
  }
  .button-light {
    padding: 8px 10px;
    font-size: 11px;
  }
  .panel-heading {
    border-top: 1px solid var(--line);
    border-right: 0px;
  }
  .panel-tabs button {
    padding-bottom: 10px;
  }
  .map-full-wrapper#map-full-container {
    overflow: visible;
  }
  .map-legend-container {
    border: 0px;
    bottom: 0px !important;
  }
  .map-legend-overflow {
    overscroll-behavior: contain;
  }
  #map-full {
    left: 0px;
    bottom: auto;
    width: 100% !important;
  }
  .map-topbar {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .map-topbar .button {
    padding: 7px 10px;
    font-size: 10px;
  }
  .map-actions {
    right: 12px;
    top: 65px;
  }
  .map-actions button {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .leaflet-top.leaflet-left {
    top: 60px !important;
    left: 2px !important;
  }
  .leaflet-top.leaflet-right {
    top: 2px !important;
    right: 2px !important;
  }
  .leaflet-bar a {
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
  }
  .leaflet-control-layers-toggle {
    height: 26px !important;
    width: 26px !important;
  }
  .search-label {
    display: none;
  }
  .catalogue-label {
    font-size: 8px;
  }
  #map-legend-layers {
    padding: 0px 14px 15px !important;
  }
  .service-status {
    left: 12px;
    right: 55px;
    top: 61px;
    padding: 9px;
    font-size: 11px;
    gap: 7px;
    flex-wrap: wrap;
  }
  .panel-collapsed .map-topbar {
    left: 12px;
  }
  .map-statusbar {
    padding: 0px 12px;
    font-size: 8px;
  }
  #map-coordinates {
    display: none;
  }
  #dragbar {
    display: none !important;
  }
  #map-legend-bottom {
    padding: 9px 20px !important;
  }
  #map-legend-addressLookup > .map-legend-overflow,
  #map-legend-addressSelectize {
    padding: 12px 20px !important;
  }
  .embedded #map-full {
    height: 100% !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation: auto ease 0s 1 normal none running none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Print page. */
@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: white !important;
  }
  main,
  #toast,
  dialog {
    display: none !important;
  }
  .print-wrapper {
    display: block !important;
  }
  .print-wrapper img {
    max-width: 100%;
  }
  .noprint {
    display: none !important;
  }
}
.link-options-button {
  border: 0px;
  background: none;
  color: rgb(226, 239, 236);
  font-size: 12px;
  padding: 10px 0px;
  text-decoration: underline;
  white-space: nowrap;
}
.modal-close-button {
  position: absolute;
  right: 14px;
  top: 12px;
  background: none;
  border: 0px;
  font-size: 26px;
  color: var(--ink);
}
.leaflet-control-fullscreen a {
  position: relative;
  background-image: none !important;
}
.leaflet-control-fullscreen a::before {
  content: "\f065";
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 16px;
}
.leaflet-fullscreen-on .leaflet-control-fullscreen a::before {
  content: "\f066";
}
@media (max-width: 760px) {
  .link-options-button {
    font-size: 9px;
    max-width: 40px;
    white-space: normal;
  }
  .legend {
    display: block !important;
    visibility: visible !important;
  }
}
#map-full:fullscreen,
#map-full.leaflet-pseudo-fullscreen {
  inset: 0px !important;
  width: 100vw !important;
  height: 100dvh !important;
}
/* Council masthead and compact panel sizing. */
.council-header {
  flex: 0 0 auto;
  z-index: 1100;
  font-size: 16px;
}
.council-header .navigation-primary {
  font-family: Arial, sans-serif;
}
main {
  flex: 1 1 0px;
  min-height: 0px;
  height: auto;
}
.panel-heading {
  height: 50px;
  padding: 0px 20px;
}
.panel-tabs {
  align-items: stretch;
}
.panel-tabs button {
  font-size: 13px;
}
.map-legend-container {
  top: 50px !important;
}
.selection-summary {
  margin: 0px 20px 10px;
  padding: 6px 0px 10px;
}
.catalogue-label {
  padding: 0px 20px 10px;
}
.embedded .council-header {
  display: none !important;
}
@media (max-width: 768px) {
  .council-header .navigation-primary--active {
    overflow-y: auto;
    max-height: min(65dvh, 600px) !important;
  }
}
@media (max-width: 760px) {
  .panel-heading {
    height: 50px;
    padding: 0px 16px;
  }
  .panel-tabs {
    margin-top: 0px;
  }
  #map-legend-top {
    padding: 8px 16px 4px;
  }
  .selection-summary {
    margin: 0px 16px 8px;
    padding: 5px 0px 8px;
  }
  .catalogue-label {
    padding: 0px 16px 8px;
  }
  .panel-collapsed #map-full {
    height: 100% !important;
  }
}
html.map-full-html {
  height: 100%;
}
body.map-full-body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
#map-legend-bottom:has(#map-legend-bottom-addressOnMap[style*="display: none"]) {
  display: none !important;
}
/* Flat council buttons share the segmented navigation palette. */
body .govuk-button {
  background:var(--primary); color:white; border:1px solid var(--primary);
  border-radius:6px; box-shadow:none; font:400 14px/1.3 Arial, sans-serif;
  padding:8px 12px; text-decoration:none; top:0;
}
body .govuk-button:hover { background:var(--primary-hover); border-color:var(--primary-hover); }
body .govuk-button:active:not(:disabled) { top:0; box-shadow:none; }
body .govuk-button--secondary { background:var(--paper); color:var(--teal); border-color:#bfc1c3; box-shadow:none; }
body .govuk-button--secondary:hover { background:var(--category-active); border-color:var(--teal); }
body .govuk-button:focus:not(:active) { outline:3px solid var(--focus-ring) !important; outline-offset:2px; box-shadow:none; }
body .govuk-button:disabled, body .govuk-button--disabled { opacity:.5; cursor:default; }
body .map-topbar .govuk-button,
body .selection-summary .govuk-button,
body .service-status .govuk-button {
  width: auto;
  margin: 0px;
  font-size: 13px;
  padding: 6px 10px;
}
body .map-actions .govuk-button {
  margin: 0px 0px 3px;
  border-radius: 0px;
}
#PCDontKnow {
  text-align: center;
  margin-bottom: 0px;
}
#PCFindButton {
  margin: 8px 0px 12px !important;
}
#PCLocationButton {
  margin: 0px 0px 16px !important;
}
#PCInput {
  display: block;
}
#dragbar {
  background: transparent;
  user-select: none;
  display: block !important;
  top: 0px !important;
  left: calc(var(--panel-width) - 6px) !important;
  width: 12px !important;
  margin: 0px !important;
  padding: 0px !important;
}
/* Visible resize grip; pointer and keyboard behaviour lives in js/dragbar.js. */
#dragbar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 6px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #dee0e2;
  box-shadow: rgba(255, 255, 255, 0.85) 0px 0px 0px 3px;
}
#dragbar:hover::after,
#dragbar:focus-visible::after,
#dragbar.dragging::after {
  background: var(--teal);
  border-color: var(--teal);
}
@media (max-width: 760px) {
  #dragbar {
    background: var(--paper);
    border-block: 1px solid var(--line);
    cursor: row-resize;
    top: var(--mobile-map-height, 32%) !important;
    left: 0px !important;
    bottom: auto !important;
    width: 100% !important;
    height: 24px !important;
  }
  #dragbar::after {
    top: 8px;
    left: 50%;
    width: 48px;
    height: 6px;
    transform: translateX(-50%);
    box-shadow: none;
  }
  .panel-heading {
    top: calc(var(--mobile-map-height, 32%) + 24px);
  }
  .map-legend-container {
    top: calc(var(--mobile-map-height, 32%) + 74px) !important;
  }
  #map-full {
    height: var(--mobile-map-height, 32%) !important;
  }
  .panel-collapsed #map-full,
  .embedded #map-full {
    height: 100% !important;
  }
}
.panel-collapsed #dragbar,
.embedded #dragbar {
  display: none !important;
}
main:has(.leaflet-control-layers-expanded) .map-actions {
  visibility: hidden;
}
/* Printed legend symbols: suppress the duplicate GOV.UK checkbox. */
.print-wrapper .govuk-checkboxes__label::before,
.print-wrapper .govuk-checkboxes__label::after {
  display: none !important;
}
.print-wrapper .svg-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  max-width: none;
  margin: 0px;
  line-height: 1.4;
  padding: 0px !important;
}
.print-wrapper .svg-checkbox > input {
  display: none;
}
.print-wrapper .svg-checkbox > .overlay {
  position: relative;
  top: auto;
  left: auto;
  order: -1;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
}
.print-wrapper .svg-checkbox > span:not(.overlay) {
  padding-left: 0px !important;
}
.print-wrapper .govuk-checkboxes__item {
  min-height: 28px;
  margin-bottom: 6px;
}
.print-wrapper fieldset {
  break-inside: avoid;
}
/* Non-blocking WFS refresh status. */
.wfs-status {
  position: absolute;
  bottom: 65px;
  left: calc(var(--panel-width) + 20px);
  z-index: 450;
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  pointer-events: none;
}
.panel-collapsed .wfs-status,
.embedded .wfs-status {
  left: 20px;
}
@media (max-width: 760px) {
  .wfs-status {
    left: 60px;
    top: 14px;
    bottom: auto;
  }
}
/* Collapsible sharing controls. */
.panel-share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 5px 20px;
  border-top: 1px solid var(--line);
  background: white;
}
body .panel-share-actions .govuk-button {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
  max-width: none;
  white-space: nowrap;
}
.panel-sharing {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: white;
}
#sharing-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  color: var(--teal);
}
#sharing-toggle:hover {
  background: var(--category-active);
}
#sharing-toggle[aria-expanded=true] i {
  transform: rotate(180deg);
}
.panel-sharing .panel-share-actions {
  border-top: 0px;
  padding-bottom: 10px;
}
/* Keep workspace controls accessible when the council masthead is collapsed. */
.map-topbar { justify-content: flex-start; gap: 8px; right: 70px; }
#header-toggle[aria-expanded="false"] i { transform: rotate(180deg); }
@media (max-width:760px) { .map-topbar { right: 60px; gap: 6px; } }

/* Give layer tools a usable hit area without changing map controls. */
#map-legend-layers .locateIcon,
#map-legend-layers .checkbox-info {
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#map-legend-layers .govuk-fieldset > .govuk-checkboxes {
  flex: 1;
  min-width: 0;
}
@media (max-width: 760px) {
  #sharing-toggle { width: 44px; height: 44px; }
  #map-legend-layers .locateIcon,
  #map-legend-layers .checkbox-info { min-width: 40px; min-height: 40px; }
}
.layer-load-error {
  display: block;
  color: #af122a;
  font-size: 12px;
  line-height: 1.4;
  margin: 4px 0 8px;
}
/* Keep the address icon in the same layout row as its text. */
#map-legend-bottom-addressOnMap-home,
#map-legend-bottom-addressOnMap-location {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 25px;
  margin-bottom: 8px;
}
#map-legend-bottom .map-legend-bottom-addressOnMap-icon-container {
  position: static;
  flex: 0 0 25px;
}
#map-legend-bottom-addressOnMap-home-address,
#map-legend-bottom-addressOnMap-location-address { padding-left: 0; }
#map-legend-bottom-addressOnMap-home:not([style*="display: none"]),
#map-legend-bottom-addressOnMap-location:not([style*="display: none"]) { display: flex !important; }
#os-terms-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  font: 16px/1.5 Arial, sans-serif;
}
#os-terms-dialog::backdrop { background: rgb(0 0 0 / 45%); }
#os-terms-dialog h2 { font-size: 22px; }
#os-terms-dialog li { margin-bottom: 12px; }
/* Align the OS terms link with the right edge of the map attribution. */
.leaflet-control-attribution a[data-map-command="open-os-terms"] {
  display: block;
  text-align: right;
}
#generateLinkModal {
  width: min(850px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 28px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-family: Arial, sans-serif;
}
#generateLinkModal::backdrop { background: rgb(0 0 0 / 45%); }

#generateLinkModal { max-width: calc(100vw - 32px); }
#layer-info-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
#layer-info-content { overflow-wrap: anywhere; margin-bottom: 20px; }
#layer-info-content img { max-width: 100%; height: auto; }

/* Stack the map tools after zoom/fullscreen using Leaflet control layout. */
.map-actions.leaflet-control { position: relative; inset: auto; }
@media (max-width: 760px) {
  .map-actions.leaflet-control { flex-direction: row; }
  .map-actions.leaflet-control button { border-bottom: 0; border-right: 1px solid var(--line); }
  .map-actions.leaflet-control button:last-child { border-right: 0; }
}
/* Keep the tools hidden until Leaflet attaches them to the left control stack. */
.map-actions:not(.leaflet-control) { display: none; }

#map-legend-layers button.map-info {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 15px 5px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
#map-legend-layers button.map-info span { text-decoration: underline; text-underline-offset: 3px; }
#map-legend-layers button.map-info:hover { color: var(--deep); }
/* Browsing can reclaim the space used by search and navigation tabs. */
#browse-tools-toggle {
  border: 0; background: none; color: var(--teal); padding: 5px;
  font-size: 11px; text-decoration: underline; cursor: pointer;
}
.catalogue-label { flex-wrap: wrap; }
.browse-tools-collapsed #map-legend-top { display: none; }

#mobile-map-tools-toggle { display: none; }
.leaflet-popup-content .popup-layerName { font-size: 18px !important; line-height: 1.3 !important; margin-bottom: 8px; }
.leaflet-popup-content .popup-category { font-size: 15px !important; line-height: 1.3 !important; margin-bottom: 6px; }
.leaflet-popup-content .popup-caption { font-size: 13px !important; line-height: 1.3 !important; }
@media (max-width: 760px) {

  .map-actions.leaflet-control { flex-direction: column; }
  #mobile-map-tools-toggle { display: block; }
  .map-actions:not(.tools-expanded) button:not(#mobile-map-tools-toggle) { display: none; }
  .map-actions.leaflet-control button { border-right: 0; border-bottom: 1px solid var(--line); }
  .map-actions.leaflet-control button:last-child { border-bottom: 0; }
  .leaflet-popup-content .popup-layerName { font-size: 15px !important; }
  .leaflet-popup-content .popup-category { font-size: 14px !important; }
}
@media (max-width: 760px) {
  .map-actions.leaflet-control {
    position: absolute;
    left: 44px;
    top: 0;
    max-height: max(38px, calc(var(--mobile-map-height, 220px) - 80px));
    overflow-y: auto;
  }
}
.map-actions.leaflet-control button { flex-shrink: 0; }
/* Compact catalogue rows: one flexible label and two stable action columns. */

#map-legend-layers .layer-row-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 30px 30px;
  align-items: center; column-gap: 3px;
}
#map-legend-layers .layer-row .govuk-checkboxes { grid-column: 1; width: auto; min-width: 0; }
#map-legend-layers .layer-row .govuk-checkboxes__item { min-height: 34px; padding: 0; margin: 0; }
#map-legend-layers .layer-row .svg-checkbox {
  display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 9px;
  align-items: center; min-height: 34px; width: 100%; max-width: none;
  padding: 4px 0 !important; margin: 0; line-height: 1.3; position: relative;
}
#map-legend-layers .layer-row .svg-checkbox > span:not(.overlay) {
  grid-column: 2; grid-row: 1; padding: 0; min-width: 0; overflow-wrap: anywhere;
}
#map-legend-layers .layer-row .svg-checkbox > .overlay {
  position: relative; top: auto; left: auto; grid-column: 1; grid-row: 1;
  width: 25px; height: 25px; pointer-events: none;
}
#map-legend-layers .layer-row .svg-checkbox > input { width: 25px; height: 25px; left: 0; top: 50%; margin: 0; transform: translateY(-50%); }
#map-legend-layers .layer-row .locateIcon,
#map-legend-layers .layer-row .checkbox-info {
  grid-row: 1; position: static; width: 30px;
  min-width: 0; min-height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
#map-legend-layers .layer-row .locateIcon { grid-column: 2; }
#map-legend-layers .layer-row .checkbox-info { grid-column: 3; }
#map-legend-layers .layer-row .svg-checkbox input:checked ~ .overlay .point-Checkbox {
  display: flex; align-items: center; justify-content: center;
}
#map-legend-layers .layer-row .point-Checkbox-icon {
  padding: 0; margin: 0; font-size: 14px; line-height: 1; vertical-align: baseline;
}
@media (max-width: 760px) {
  #map-legend-layers .layer-row-layout { grid-template-columns: minmax(0, 1fr) 36px 36px; }
  #map-legend-layers .layer-row .locateIcon,
  #map-legend-layers .layer-row .checkbox-info { width: 36px; height: 36px; }
  #map-legend-layers .layer-row .svg-checkbox { min-height: 36px; }
}

/* A compact disclosure keeps sharing discoverable without a full-height toolbar. */
.panel-sharing { position: relative; text-align: center; padding: 0; min-height: 12px; }
#sharing-toggle { position: absolute; z-index: 1; top: -10px; left: 50%; transform: translateX(-50%); height: 20px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 11px; }
.panel-sharing .panel-share-actions { justify-content: center; flex-wrap: wrap; padding-top: 16px; }
#share-dialog { width: 620px; max-width: calc(100vw - 32px); }
/* Indent the names, keeping every depth's action columns on the same right edge. */
#map-legend-layers .govuk-details__text .govuk-details__text { padding-right: 0; }

.selection-summary { flex-wrap: wrap; }
.selection-actions { display: flex; gap: 6px; margin-left: auto; }

/* Selected layers share the existing catalogue actions and selection state. */
/* Segmented layer-view control. */
.layer-view-switch { display:flex; gap:0; margin:8px 18px 10px; padding:0; border:1px solid #bfc1c3; border-radius:7px; background:var(--paper); flex-shrink:0; }
.layer-view-switch button { flex:1; min-width:0; display:flex; align-items:center; justify-content:center; border:0; border-right:1px solid #bfc1c3; padding:8px 4px; background:transparent; color:var(--deep); font-size:12px; line-height:1.25; cursor:pointer; }
.layer-view-switch button:first-child { border-radius:6px 0 0 6px; }
.layer-view-switch button:last-child { border-right:0; border-radius:0 6px 6px 0; }
.layer-view-switch button:hover { background:var(--category-active); }
.layer-view-switch button[aria-pressed="true"] { background:var(--teal); color:white; font-weight:bold; }
.layer-view-switch button:focus-visible { position:relative; z-index:1; }
.layer-view-switch button[aria-pressed="true"] #selected-view-count { background:white; color:var(--teal); }
#selected-view-count { color:var(--muted); background:var(--paper); border-radius:8px; padding:2px 5px; }
#selected-layers-view { flex:1 1 0%; min-height:0; overflow:auto; padding:0 18px 24px; }
.selected-layer-row { display:grid; grid-template-columns:minmax(0,1fr) repeat(3,32px); gap:3px; align-items:center; border-bottom:1px solid var(--line); padding:10px 0; }
.selected-layer-description { min-width:0; overflow-wrap:anywhere; font-size:13px; }
.selected-layer-description span { display:block; color:var(--muted); font-size:11px; }
.selected-layer-row button { width:32px; height:36px; border:0; border-radius:4px; color:var(--teal); background:transparent; }
.selected-layer-row button:hover { background:var(--paper); }
.selected-layers-empty { font-size:14px; line-height:1.5; color:var(--muted); }
.selected-layer-error { grid-column:1 / -1; font-size:12px; color:#af122a; margin:0; }
@media(max-width:760px) { .selected-layer-row { grid-template-columns:minmax(0,1fr) repeat(3,36px); } .selected-layer-row button { width:36px; height:40px; } }

.layer-loading-status { display:block; padding:3px 0 3px 34px; color:var(--muted); font-size:12px; line-height:1.4; }
.layer-loading-status::before { content:''; display:inline-block; width:11px; height:11px; margin-right:6px; border:2px solid var(--line); border-top-color:var(--teal); border-radius:50%; vertical-align:-1px; animation:layer-status-spin .8s linear infinite; }
.selected-layer-loading { grid-column:1 / -1; padding-left:0; }
@keyframes layer-status-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .layer-loading-status::before { animation:none; } }

.layer-zoom-status { display:block; padding:3px 0 3px 34px; color:var(--muted); font-size:12px; line-height:1.4; }
.selected-layer-zoom { grid-column:1 / -1; padding-left:0; }
/* The view tabs supply the heading; keep room for browsing on laptop screens. */
#layer-view-heading { display: none; }
.layer-view-switch { padding-top: 0; }

.embed-search-button { max-width:min(260px,calc(100vw - 40px)); padding:8px 12px; border:1px solid var(--line); border-radius:5px; background:white; color:var(--deep); font-size:14px; overflow-wrap:anywhere; box-shadow:0 1px 4px #0002; }
.embed-search-panel { position:absolute; z-index:1100; top:10px; left:10px; bottom:24px; width:330px; max-width:calc(100% - 20px); display:flex; flex-direction:column; background:white; border:1px solid var(--line); border-radius:8px; padding:14px; box-shadow:0 3px 16px #0003; }
.embed-search-header { display:flex; gap:10px; align-items:center; justify-content:space-between; }
.embed-search-header h2 { font-size:18px; margin:0; overflow-wrap:anywhere; }
.embed-search-header button { border:0; background:white; color:var(--deep); font-size:26px; min-width:40px; height:40px; }
.embed-search-panel input { width:100%; min-height:42px; margin-top:10px; padding:8px; border:1px solid var(--muted); border-radius:4px; }
.embed-search-status { font-size:13px; color:var(--muted); margin:10px 0; }
.embed-search-results { overflow:auto; min-height:0; }
.embed-search-results button { display:block; width:100%; text-align:left; padding:10px 4px; border:0; border-bottom:1px solid var(--line); background:white; color:var(--deep); font-size:14px; overflow-wrap:anywhere; }
.embed-search-results button:hover { background:var(--paper); }

.embed-search-layer h3 { margin:12px 0 0; padding:8px 4px; border-bottom:2px solid var(--line); color:var(--deep); font-size:15px; line-height:1.3; font-weight:700; }
.embed-search-layer:first-child h3 { margin-top:0; }

#linkPopup-embedSearch-options { margin:8px 0 16px 20px; padding-left:16px; border-left:3px solid var(--line); }
#linkPopup-searchLabel-options { margin-top:12px; }

#feature-search-view { flex:1 1 0%; min-height:0; overflow:hidden; padding:0 18px 24px; }
#feature-search-view:not([hidden]) { display:flex; flex-direction:column; }
#feature-search-view > :not(.embed-search-results) { flex-shrink:0; }
#feature-search-view > .embed-search-results { flex:1 1 0%; min-height:0; overflow:auto; overscroll-behavior:contain; }
.feature-search-scope { font-size:14px; line-height:1.4; color:var(--muted); }

.embed-search-icon { display:none; }
@media (max-width: 767px) {
  .embed-search-button { width:44px; height:44px; padding:0; display:grid; place-items:center; }
  .embed-search-button .embed-search-icon { display:inline-block; font-size:18px; }
  .embed-search-caption { display:none; }
}
#map-full > .leaflet-popup-pane { z-index:1400; pointer-events:none; }
#map-full > .leaflet-popup-pane .leaflet-popup { pointer-events:auto; }

.feature-result-title { font-weight:600; }
.feature-result-detail { color:var(--muted); }
.feature-search-error { font-size:14px; color:#af122a; margin:12px 4px 4px; }
@media(max-width:767px) {
 .embed-search-results button:has(.feature-result-title) { font-size:0; }
 .feature-result-title { display:block; font-size:14px; }
 .feature-result-detail { display:block; font-size:13px; margin-top:3px; line-height:1.4; }
}
@media (min-width: 768px) and (max-height: 800px) {
  .layer-view-switch button { padding-top:2px; padding-bottom:2px; }
}
/* The shared toolkit references unavailable legacy NTA files. Map text uses
   the existing Arial stack; keep icon font classes untouched for print capture. */
#map-full [class*="govuk-heading"],
#map-full [class*="govuk-caption"],
#map-full .govuk-body,
#map-full .govuk-body-s,
#map-full .govuk-link,
#map-full .govuk-label {
  font-family: Arial, Helvetica, sans-serif !important;
}

#printLegend { font: 10pt/1.35 Arial, Helvetica, sans-serif; color:#222; }
#printLegend .print-key-title { font: bold 14pt/1.3 Arial, sans-serif; margin:12px 0 8px; border-bottom:1px solid #888; padding-bottom:5px; }
#printLegend .print-key-group { margin:0 0 10px; }
#printLegend .print-key-group h3 { font:bold 10pt/1.35 Arial,sans-serif; margin:0 0 5px; break-after:avoid; color:#444; }
#printLegend .print-key-row { display:flex !important; align-items:center; gap:10px; position:relative; padding:3px 0 !important; margin:0 !important; min-height:28px; break-inside:avoid; }
#printLegend .print-key-row::before, #printLegend .print-key-row::after { display:none !important; }
#printLegend .print-key-row > .overlay { position:relative !important; top:auto !important; left:auto !important; width:24px !important; height:24px !important; flex:0 0 24px; transform:none !important; display:flex !important; align-items:center; justify-content:center; }
#printLegend .print-key-name { font:10pt/1.35 Arial,sans-serif; margin:0 !important; padding:0 !important; }
#printLegend .icon { display:block !important; }
#printLegend { print-color-adjust:exact; -webkit-print-color-adjust:exact; }

#printLegend .print-key-cluster .overlay { border:0 !important; background:transparent !important; }
#printLegend .print-key-cluster .marker-cluster { width:24px; height:24px; margin:0; }
#printLegend .print-key-cluster .marker-cluster > div { width:18px; height:18px; margin:3px; }
#printLegend .print-key-cluster .marker-cluster span { line-height:18px; font:11px/18px Arial,sans-serif; }
/* Full-map feature search shares the Selected layers text hierarchy. */
#feature-search-view { font-family:Arial, Helvetica, sans-serif; }
#feature-search-view .feature-search-scope,
:is(#feature-search-view, .embed-search-panel) .embed-search-status { font-size:12px; line-height:1.4; }
#feature-search-view > label { display:block; font-size:13px; font-weight:700; line-height:1.4; margin:0 0 6px; color:var(--ink); }
:is(#feature-search-input, .embed-search-panel input) { box-sizing:border-box; width:100%; height:40px; min-height:40px; padding:8px 10px; border:1px solid #bfc1c3; border-radius:5px; background:white; color:var(--ink); font:13px/1.4 Arial, Helvetica, sans-serif; box-shadow:none; }
:is(#feature-search-input, .embed-search-panel input)::placeholder { color:var(--muted); opacity:1; }
:is(#feature-search-input, .embed-search-panel input):focus { outline:3px solid var(--focus-ring); outline-offset:0; border-color:var(--deep); }
#feature-search-input:disabled { background:var(--paper); color:var(--muted); }
#feature-search-view .embed-search-layer h3 { font:700 13px/1.4 Arial, Helvetica, sans-serif; padding:8px 0; }
:is(#feature-search-view, .embed-search-panel) .embed-search-results button:has(.feature-result-title) { padding:10px 0; font-size:0; line-height:1.4; color:var(--ink); }
:is(#feature-search-view, .embed-search-panel) .feature-result-title { display:block; font:700 13px/1.4 Arial, Helvetica, sans-serif; }
:is(#feature-search-view, .embed-search-panel) .feature-result-detail { display:block; font:11px/1.4 Arial, Helvetica, sans-serif; color:var(--muted); }

/* On small screens only the input stays in view; results share the panel scroll. */
@media (max-width:767px) {
  #feature-search-view:not([hidden]) { display:block; overflow-y:auto; overscroll-behavior:contain; padding-bottom:12px; }
  #feature-search-view .feature-search-scope { margin:0 0 6px; }
  #feature-search-view .feature-search-scope-detail { display:none; }
  #feature-search-view > .embed-search-results { overflow:visible; }
  #feature-search-input { position:sticky; top:3px; z-index:2; margin-bottom:0; box-shadow:0 -3px 0 3px white, 0 3px 0 3px white; }
}

/* Denser layer navigation, retaining readable text and separate action targets. */
#map-legend-top { padding-top:6px; padding-bottom:2px; }
.search-label { margin-bottom:4px; }
.selection-summary { gap:4px; margin-top:0; margin-bottom:2px; padding-top:3px; padding-bottom:3px; }
.layer-view-switch { margin-top:4px; margin-bottom:8px; }
.catalogue-label { padding-bottom:3px; }
#map-legend-layers { padding-bottom:12px !important; }
#map-legend-layers > div > details { margin-bottom:2px !important; }
#map-legend-layers .govuk-details__summary { min-height:24px; padding-top:1px; padding-bottom:1px; }
#map-legend-layers .govuk-details__text .govuk-details__summary { min-height:24px; padding-top:1px; padding-bottom:1px; }
#map-legend-layers .govuk-details__text { padding-top:0; padding-bottom:0; }
#map-legend-layers .govuk-form-group { margin-bottom:2px !important; }
#map-legend-layers .layer-row { margin-bottom:0 !important; }
#map-legend-layers .layer-row .govuk-checkboxes__item,
#map-legend-layers .layer-row .svg-checkbox { min-height:27px; }
#map-legend-layers .layer-row .svg-checkbox { box-sizing:border-box; padding-top:1px !important; padding-bottom:1px !important; }
#map-legend-layers .layer-row .locateIcon,
#map-legend-layers .layer-row .checkbox-info { height:27px; }
#map-legend-layers button.map-info { min-height:30px; margin-bottom:2px; padding-top:2px; padding-bottom:2px; }
#selected-layers-view { padding-bottom:12px; }
.selected-layer-row { padding-top:1px; padding-bottom:1px; row-gap:0; }
.layer-load-error { margin-top:2px; margin-bottom:4px; }
.layer-loading-status, .layer-zoom-status { padding-top:2px; padding-bottom:2px; }
#feature-search-view .feature-search-scope { margin-top:0; margin-bottom:6px; }
.embed-search-status { margin-top:6px; margin-bottom:6px; }
.embed-search-layer h3 { margin-top:8px; padding-top:3px; padding-bottom:3px; }
#feature-search-view .embed-search-layer h3 { padding-top:3px; padding-bottom:3px; }
.embed-search-results button { min-height:30px; padding-top:1px; padding-bottom:1px; }
:is(#feature-search-view, .embed-search-panel) .embed-search-results button:has(.feature-result-title) { padding-top:1px; padding-bottom:1px; }
@media (max-width:767px) {
  #map-legend-layers .govuk-details__summary { min-height:26px; }
  #map-legend-layers .govuk-details__text .govuk-details__summary { min-height:30px; }
  #map-legend-layers .layer-row .svg-checkbox { min-height:30px; }
  #map-legend-layers .layer-row .locateIcon,
  #map-legend-layers .layer-row .checkbox-info { height:30px; }
  .embed-search-results button { min-height:28px; }
}

#map-legend-layers .layer-row-layout,
#map-legend-layers .layer-row .govuk-checkboxes { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; }

#map-legend-layers .govuk-details__text .govuk-details { margin-top:0 !important; margin-bottom:0 !important; }
#map-legend-layers .govuk-details__summary { margin-bottom:0; }
#selected-layers-view .selected-layer-row button { height:28px; }
.selected-layer-description { line-height:1.25; }
.selected-layer-description span { line-height:1.25; margin-top:0; }
:is(#feature-search-view, .embed-search-panel) .feature-result-title,
:is(#feature-search-view, .embed-search-panel) .feature-result-detail { line-height:1.25; }
:is(#feature-search-view, .embed-search-panel) .feature-result-detail { margin-top:0; }

/* Keep category focus visible without the heavy GOV.UK underline. */
#map-legend-layers .govuk-details__summary:focus {
  box-shadow:0 -2px var(--govuk-focus-colour, #fd0), 0 1px var(--govuk-focus-text-colour, #0b0c0c);
}

/* Desktop has room for a more relaxed hierarchy; mobile keeps the dense layout. */
@media (min-width:768px) {
  #map-legend-top { padding-top:9px; padding-bottom:4px; }
  .selection-summary { margin-bottom:4px; padding-top:5px; padding-bottom:5px; }
  .layer-view-switch { margin-top:6px; margin-bottom:10px; }
  .catalogue-label { padding-bottom:6px; }
  #map-legend-layers > div > details { margin-bottom:6px !important; }
  #map-legend-layers .govuk-details__summary { min-height:36px; padding-top:7px; padding-bottom:7px; }
  #map-legend-layers .govuk-details__text .govuk-details__summary { min-height:32px; padding-top:5px; padding-bottom:5px; }
  #map-legend-layers .govuk-details__text { padding-bottom:5px; }
  #map-legend-layers .govuk-details__text .govuk-details { margin-bottom:2px !important; }
  #map-legend-layers .govuk-form-group { margin-bottom:6px !important; }
  #map-legend-layers .layer-row { margin-bottom:1px !important; }
  #map-legend-layers .layer-row .govuk-checkboxes__item,
  #map-legend-layers .layer-row .svg-checkbox { min-height:32px; }
  #map-legend-layers .layer-row .svg-checkbox { padding-top:3px !important; padding-bottom:3px !important; }
  #map-legend-layers .layer-row .locateIcon,
  #map-legend-layers .layer-row .checkbox-info { height:32px; }
  #map-legend-layers button.map-info { min-height:32px; margin-bottom:3px; padding-top:3px; padding-bottom:3px; }
  .selected-layer-row { padding-top:7px; padding-bottom:7px; row-gap:3px; }
  #selected-layers-view .selected-layer-row button { height:34px; }
  .selected-layer-description { line-height:1.4; }
  .selected-layer-description span { line-height:1.4; margin-top:2px; }
  .embed-search-status { margin-top:8px; margin-bottom:8px; }
  .embed-search-layer h3 { margin-top:10px; padding-top:6px; padding-bottom:6px; }
  #feature-search-view .embed-search-layer h3 { padding-top:6px; padding-bottom:6px; }
  .embed-search-results button { min-height:38px; padding-top:7px; padding-bottom:7px; }
  :is(#feature-search-view, .embed-search-panel) .embed-search-results button:has(.feature-result-title) { padding-top:7px; padding-bottom:7px; }
  :is(#feature-search-view, .embed-search-panel) .feature-result-title,
  :is(#feature-search-view, .embed-search-panel) .feature-result-detail { line-height:1.4; }
  :is(#feature-search-view, .embed-search-panel) .feature-result-detail { margin-top:2px; }
}

/* Layer-name search belongs to Browse collections, below the view switch. */
#map-legend:has(#browse-collections-view[aria-pressed="false"]) #map-legend-top { display:none; }
#map-legend-top { padding:0 18px 4px; }
#map-legend-top .search-label { font:700 13px/1.4 Arial, Helvetica, sans-serif; margin:0 0 6px; }
#map-legend-top .SelectizeWrapperClass { margin-bottom:0; }
#map-legend-top .sel-input {
  box-sizing:border-box; width:100%; min-height:40px !important; padding:8px 10px !important;
  border:1px solid #bfc1c3 !important; border-radius:5px !important; background:white !important;
  color:var(--ink); font:13px/1.4 Arial, Helvetica, sans-serif !important; box-shadow:none;
}
#map-legend-top .sel-input input { font:13px/1.4 Arial, Helvetica, sans-serif !important; color:var(--ink); }
#map-legend-top .sel-input input::placeholder { color:var(--muted); opacity:1; }
#map-legend-top .sel-input.focus { outline:3px solid var(--focus-ring); outline-offset:0; border-color:var(--deep) !important; box-shadow:none; }

/* Consistent navigation segments and labelled map options. */
.panel-tabs { height:38px; gap:0; margin-top:6px; border:1px solid #bfc1c3; border-radius:7px; background:var(--paper); overflow:hidden; }
.panel-tabs button { justify-content:center; border:0; border-right:1px solid #bfc1c3; margin:0; padding:5px; font:13px/1.25 Arial,sans-serif; color:var(--deep); }
.panel-tabs button:last-child { border-right:0; }
.panel-tabs button.active { background:var(--teal); color:white; font-weight:700; }
#sharing-toggle { width:auto; min-width:110px; padding:0 10px; gap:6px; }
.mobile-sheet-heading { display:none; }
#feature-search-view > label.govuk-visually-hidden { margin:0; }
#map-legend:has(#browse-collections-view[aria-pressed="false"]) #browse-tools-toggle { display:none; }
@media (max-width:760px) {
  .mobile-sheet-heading { display:flex; align-items:center; justify-content:space-between; height:36px; font-size:13px; }
  .mobile-sheet-heading button { padding:5px 8px; margin-left:4px; border:1px solid var(--line); border-radius:5px; color:var(--deep); background:var(--paper); font-size:12px; }
  .panel-heading { height:86px; border-radius:12px 12px 0 0; }
  .map-legend-container { top:calc(var(--mobile-map-height, 50%) + 110px) !important; }
  body[data-sheet-state="collapsed"] .panel-heading { height:40px; }
  body[data-sheet-state="collapsed"] #panel-tabs,
  body[data-sheet-state="collapsed"] .map-legend-container { display:none !important; }
  .panel-tabs button { padding:5px; }
}

/* Readable phone inputs avoid focus zoom without disabling user zoom. */
@media (max-width:767px), (hover:none) and (pointer:coarse) {
  #map-legend-top .sel-input,
  #map-legend-top .sel-input input { font-size:16px !important; }
}

/* Subtle shaded collection headers distinguish navigation from layer rows. */
#map-legend-layers > div > details { background:white; }
#map-legend-layers > div > details[open] { background:white; }
#map-legend-layers .govuk-details__summary { background:var(--category-surface); }
#map-legend-layers .govuk-details__text .govuk-details__summary { background:var(--subcategory-surface); }
#map-legend-layers .govuk-details__summary:hover { background:var(--category-active); }
#map-legend-layers details[open] > .govuk-details__summary { background:var(--category-active); }
#map-legend-layers .govuk-details__summary:focus:not(:focus-visible) { outline:none; box-shadow:none; }

.panel-share-actions .selection-actions { margin:0; display:contents; }
body .panel-share-actions .govuk-button { margin:0; border-radius:6px; box-shadow:none; }
.panel-sharing .panel-share-actions { gap:8px; padding:16px 12px 10px; }

/* Counts flank the centred search disclosure below the layer search. */
.catalogue-label { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:4px; }
.catalogue-label .selection-summary { grid-column:1; grid-row:1; border:0; margin:0; padding:0; font-weight:400; letter-spacing:0; }
.catalogue-label #browse-tools-toggle { grid-column:2; grid-row:1; justify-self:center; }
.catalogue-label #catalogue-count { grid-column:3; grid-row:1; text-align:right; }

#map-full-container:fullscreen { width:100vw !important; height:100dvh !important; background:white; }
.embed-fullscreen-control { overflow:visible; }
.embed-fullscreen-control a { display:flex; align-items:center; justify-content:center; background:white; border-radius:7px; text-decoration:none; }
.embed-fullscreen-notice { position:absolute; left:44px; top:0; width:210px; margin:0; padding:10px; background:white; color:var(--ink); border:1px solid var(--line); border-radius:6px; font:13px/1.4 Arial,sans-serif; }

/* Include the input overlay and custom SVG symbol in the clickable cursor area. */
#map-legend-layers input:is([type="checkbox"], [type="radio"]):not(:disabled),
#map-legend-layers label,
#map-legend-layers .svg-checkbox,
#map-legend-layers .svg-checkbox * { cursor:pointer; }
#map-legend-layers input:disabled { cursor:not-allowed; }

/* Let subcategory bands reach the collection edges without moving their text. */
#map-legend-layers .govuk-details__text .govuk-details__summary {
  margin-left:-12px;
  width:calc(100% + 24px);
  padding-left:16px;
  padding-right:34px;
}
#map-legend-layers .govuk-details__text .govuk-details__summary::before { right:28px; }
#map-legend-layers .govuk-details__text .govuk-details__text .govuk-details__summary {
  width:calc(100% + 12px);
  padding-right:22px;
}
#map-legend-layers .govuk-details__text .govuk-details__text .govuk-details__summary::before { right:16px; }

/* Slightly slimmer panel/header controls. */
.map-topbar .button { padding-top:8px; padding-bottom:8px; }
@media (max-width:760px) { .map-topbar .button { padding-top:5px; padding-bottom:5px; } }

/* Compact current-location cards stay above Map options while layers scroll. */
#map-legend-bottom { padding:8px 12px 14px !important; background:white; box-sizing:border-box; }
#map-legend-bottom .current-location-card { align-items:center; gap:9px; margin:0; padding:9px; border:1px solid var(--line); border-radius:6px; background:white; box-shadow:0 1px 4px #0b0c0c12; }
#map-legend-bottom .current-location-card + .current-location-card { margin-top:5px; }
.current-location-card > i { color:var(--teal); font-size:18px; flex:0 0 20px; }
.current-location-copy { flex:1; min-width:0; overflow-wrap:anywhere; font:12px/1.35 Arial,sans-serif; }
.current-location-copy > * { display:block; }
.current-location-label, .current-location-copy small { font-size:11px; color:var(--muted); }
.current-location-actions { display:flex; align-items:center; gap:2px; flex-shrink:0; }
.current-location-actions button { margin:0 !important; display:inline-flex; align-items:center; justify-content:center; border:0; background:transparent; color:var(--teal); text-decoration:underline; padding:8px 5px; font:12px Arial,sans-serif; cursor:pointer; }
#return-to-top { display:none !important; }
@media (max-width:760px) {
  #map-legend-bottom { max-height:96px; overflow-y:auto; }
}

#feature-search-count { display:inline-block; background:var(--paper); color:var(--muted); border-radius:8px; padding:2px 5px; }
#feature-search-count[data-available="true"] { background:var(--teal); color:white; }
.layer-view-switch button[aria-pressed="true"] #feature-search-count { background:white; color:var(--teal); }

.layer-view-switch button:not([aria-pressed="true"]) #selected-view-count[data-available="true"] { background:var(--teal); color:white; }

/* Keep focus outlines without replacing button surfaces with a yellow fill. */
body button:focus, body .govuk-button:focus:not(:active) { box-shadow:none; }
body .govuk-button:focus:not(:active) { background:var(--primary); color:white; }
body .govuk-button--secondary:focus:not(:active) { background:var(--paper); color:var(--teal); }
body button:focus:not(:focus-visible), body .govuk-button:focus:not(:active):not(:focus-visible) { outline:none !important; }
#browse-tools-toggle:focus, .current-location-actions button:focus { background:transparent; color:var(--teal); }
#sharing-toggle:focus { background:var(--paper); color:var(--deep); }
#map-legend-addressSelectize .sel-dropdown, #map-legend-addressSelectize .sel-input,
#PCAddressConfDiv-legend, #PCAddressConfDiv-legend * { font-family:Arial,sans-serif; font-size:13px; line-height:1.4; }
.address-result-summary { margin:12px 0; padding:0; border:0; }
@media(max-width:760px) { #map-legend-addressSelectize .sel-input input { font-size:16px; } }
#map-legend-layers .govuk-details__summary:focus-visible { background:var(--category-surface); }
#map-legend-layers .govuk-details__text .govuk-details__summary:focus-visible { background:var(--subcategory-surface); }
#map-legend-layers details[open] > .govuk-details__summary:focus-visible { background:var(--category-active); }
.map-topbar .button:focus { background:white; color:var(--ink); }

.leaflet-popup-content .popup-bullets { margin:4px 0; padding-left:20px; list-style:disc; font:inherit; }
.leaflet-popup-content .popup-bullets li { margin-bottom:4px; }

/* Keep touch navigation within the application; Leaflet manages map gestures. */
@media (hover:none) and (pointer:coarse) {
  body { touch-action:pan-x pan-y; }
  input, select, textarea { font-size:16px; }
}
.leaflet-popup-content { overflow-wrap:anywhere; }

/* Discrete display transitions preserve the existing hidden-state semantics.
   Browsers without support continue to show/hide immediately. */
@media (prefers-reduced-motion:no-preference) {
  #sharing-actions, #panel-tabs, #feature-search-view, #selected-layers-view,
  #map-legend-layers, #map-legend-top {
    transition:opacity 150ms ease, display 150ms allow-discrete;
  }
  :is(#sharing-actions, #panel-tabs, #feature-search-view, #selected-layers-view,
      #map-legend-layers, #map-legend-top)[hidden] { opacity:0; }
  @starting-style {
    #sharing-actions, #panel-tabs, #feature-search-view, #selected-layers-view,
    #map-legend-layers, #map-legend-top { opacity:0; }
  }
}

/* Configured UTFGrid layers: do not override the dragging cursor. */
.leaflet-container.wms-feature-hover:not(.leaflet-drag-target) { cursor:pointer; }
/* WMS images sit above the map and must inherit its hover/drag cursor. */
.leaflet-container .leaflet-image-layer { cursor:inherit !important; }

/* Selection and map appearance are separate, persistent columns. */
#map-legend-layers .layer-row .layer-choice {
  grid-template-columns:20px 19px minmax(0,1fr); column-gap:8px;
}
#map-legend-layers .layer-row .layer-choice > span:not(.overlay) { grid-column:3; }
#map-legend-layers .layer-row .layer-choice > span.layer-selection {
  grid-column:1; grid-row:1; width:19px; height:19px; border:1.5px solid #6f777b;
  border-radius:3px; background:#fff; display:grid; place-items:center; box-sizing:border-box;
}
#map-legend-layers .layer-choice > input:checked ~ .layer-selection { background:var(--teal); border-color:var(--teal); }
#map-legend-layers .layer-choice > input:checked ~ .layer-selection::after {
  content:''; width:5px; height:9px; border:solid white; border-width:0 2px 2px 0; transform:translateY(-1px) rotate(45deg);
}
#map-legend-layers .layer-row .layer-choice > span.layer-selection-radio { border-radius:50%; }
#map-legend-layers .layer-choice > input:checked ~ .layer-selection-radio::after { width:7px; height:7px; background:white; border:0; border-radius:50%; transform:none; }
#map-legend-layers .layer-row .layer-choice > input { width:20px; height:24px; }
#map-legend-layers .layer-row .layer-choice > .layer-symbol {
  grid-column:2; grid-row:1; width:19px; height:19px; border:0; background:transparent;
  display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:3px;
}
#map-legend-layers .layer-choice .layer-symbol .icon { display:block; }
#map-legend-layers .layer-choice .layer-symbol .point-Checkbox,
#printLegend .layer-symbol .point-Checkbox { display:flex; align-items:center; justify-content:center; border-radius:4px; color:white; }
#map-legend-layers .layer-choice .layer-symbol .point-Checkbox-icon { font-size:11px; }
#printLegend .layer-symbol { border:0 !important; }

/* Keep unselected symbols visible without competing with active layers. */
#map-legend-layers .layer-row .layer-choice > input:not(:checked) ~ .layer-symbol { opacity:0.6; }
#map-legend-layers .layer-row .layer-choice > input:checked ~ .layer-symbol { opacity:1; }

/* Match category/subcategory All controls to individual layer selection. */
#map-legend-layers .svg-checkbox:has(> .legendSelectAll) > .overlay {
  width:19px; height:19px; box-sizing:border-box; border:1.5px solid #6f777b; border-radius:3px; background:white;
}
#map-legend-layers .legendSelectAll:checked ~ .overlay { background:var(--teal); border-color:var(--teal); }
#map-legend-layers .legendSelectAll:checked ~ .overlay::after {
  content:''; position:absolute; left:5px; top:2px; width:5px; height:9px;
  border:solid white; border-width:0 2px 2px 0; transform:rotate(45deg);
}

/* Reuse catalogue symbols in the selected list without another control column. */
.feature-search-layer-heading,
.selected-layer-summary { display:flex; align-items:center; gap:8px; min-width:0; }
.feature-search-layer-heading > .layer-symbol,
.selected-layer-summary > .layer-symbol { position:static; flex:0 0 19px; width:19px; height:19px; border:0; border-radius:3px; overflow:hidden; }
.feature-search-layer-heading .layer-symbol .icon,
.selected-layer-summary .layer-symbol .icon { display:block; }
.feature-search-layer-heading .layer-symbol .point-Checkbox,
.selected-layer-summary .layer-symbol .point-Checkbox { display:flex; align-items:center; justify-content:center; color:white; border-radius:4px; }
.feature-search-layer-heading .point-Checkbox-icon,
.selected-layer-summary .point-Checkbox-icon { padding:0; margin:0; font-size:11px; line-height:1; }

/* Native disclosure keeps layer groups keyboard accessible. */
.embed-search-layer > summary.feature-search-layer-heading {
  list-style:none; cursor:pointer; margin:8px 0 0; padding:6px 0;
  border-bottom:2px solid var(--line); color:var(--deep); font:700 13px/1.4 Arial,sans-serif;
}
.embed-search-layer > summary::-webkit-details-marker { display:none; }
.embed-search-layer > summary::after {
  content:''; width:6px; height:6px; border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:rotate(-45deg); margin:0 5px 0 auto; flex-shrink:0;
}
.embed-search-layer[open] > summary::after { transform:rotate(45deg); }
.embed-search-layer > summary:focus-visible { outline:2px solid var(--focus-ring); outline-offset:2px; }
.embed-search-layer:first-child > summary { margin-top:0; }

/* Include interactive map features and controls during popup lookup. */
html.popup-loading, html.popup-loading * { cursor:progress !important; }

@media(max-width:760px) { .embed-search-panel input { font-size:16px; } }
