/* Match the header's content width and side spacing. */
.main-wrap.map-main { max-width: 1600px; padding-inline: 4.5%; }
@media (max-width: 760px) {
  .main-wrap.map-main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}
.map-shell { position: relative; grid-template-columns: 260px minmax(0, 1fr); height: 640px; min-height: 0; }
.map-sidebar { min-height: 0; overflow-y: auto; }
.map-legend-marker { width: 24px; height: 30px; flex: none; object-fit: contain; }
.map-region-control { border-bottom: 1px solid var(--line); padding: 2px 0 14px; margin-bottom: 14px; }
.map-region-control > .checkbox { min-height: 44px; font-size: 13px; }
.map-region-control .field-help { margin: 4px 0 10px; }
.map-region-legend { list-style: none; margin: 10px 0; padding: 0; font-size: 12px; }
.map-region-legend li { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.map-region-swatch { width: 15px; height: 15px; flex: 0 0 15px; border: 2px solid; border-radius: 3px; }
.map-region-swatch.baixo-corgo { border-color: #b56a28; background: #b56a2830; }
.map-region-swatch.cima-corgo { border-color: #657b46; background: #657b4630; }
.map-region-swatch.douro-superior { border-color: #65568f; background: #65568f30; }
.map-region-control .button, .map-region-control .text-button { min-height: 44px; }
.map-geography-filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.map-geography-filters .field { min-width: 0; }
.map-geography-filters select { width: 100%; margin-top: auto; }
.map-more-filters { border-top: 1px solid var(--line); margin: 8px 0 12px; }
.map-more-filters summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-size: 13px; font-weight: 600; }
.map-more-filters .checkbox { font-size: 13px; min-height: 44px; }
.map-active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.map-filter-chip { border: 1px solid var(--line); border-radius: 8px; color: var(--wine); background: var(--paper); padding: 8px; min-height: 44px; font-size: 12px; text-align: left; overflow-wrap: anywhere; max-width: 100%; }
.map-reset { margin-top: 10px; width: 100%; }
.map-reset:disabled { opacity: .5; cursor: default; }
.map-list-empty { color: var(--muted); font-size: 13px; }
.map-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
.map-result-status { position: absolute; z-index: 1; top: 10px; left: 45px; max-width: min(300px, calc(100% - 65px)); margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--wine); font-size: 12px; pointer-events: none; }
.map-stage.map-detail-open { grid-template-columns: minmax(0, 1fr) minmax(300px, 350px); }
#port-map { min-width: 0; min-height: 0; height: 100%; }
#port-map .ol-control button { color: var(--wine); }
#port-map .ol-attribution { max-width: 100%; font-size: 10px; }
.map-marker-tooltip { position: absolute; z-index: 4; box-sizing: border-box; width: max-content; max-width: min(280px, calc(100% - 16px)); padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--wine); box-shadow: 0 2px 8px #292c2630; font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; pointer-events: none; }
.map-marker-tooltip[hidden] { display: none; }
[data-map-error] { font-size: 12px; color: #932e32; }
.map-tools-toggle, .map-tools-close { display: none; }
.map-list button[aria-pressed="true"] { color: var(--wine); background: var(--paper); font-weight: 600; }
.map-detail-panel { display: none; position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: var(--white); border-left: 1px solid var(--line); }
.map-detail-panel.show { display: block; }
.map-detail-panel[hidden] { display: none; }
.map-place-content { padding: 20px; overflow-wrap: anywhere; }
.map-vineyard-controls {padding:10px;border-left:3px solid #537b28;background:var(--paper);margin:10px 0}
.map-vineyard-controls[hidden] {display:none}
.map-vineyard-body {font-size:14px;line-height:1.5}
.map-vineyard-body p {margin:0 0 12px}
.map-vineyard-catalogue-entry {border-top:1px solid var(--line);padding:8px 0}
.map-vineyard-catalogue-entry p {margin:4px 0}
@media(max-width:991.98px) {
  .map-detail-panel.map-vineyard-detail {max-height:48dvh}
}
.map-place-heading { padding-right: 40px; margin-bottom: 20px; }
.map-place-type { display: inline-flex; background: var(--wine); color: var(--white); border-radius: 20px; padding: 3px 9px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.map-place-heading h2 { font-size: 27px; margin: 12px 0 0; letter-spacing: -.5px; }
.map-detail-close, .map-tools-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--wine); font-size: 29px; line-height: 1; border-radius: 4px; }
.map-detail-close:hover, .map-tools-close:hover { background: var(--paper); }
.map-place-description { font-size: 14px; line-height: 1.65; margin: 18px 0; }
.map-place-admin {display:flex;flex-direction:column;gap:10px}
.map-place-location-controls {padding:12px;background:var(--paper);border:1px solid var(--line);border-radius:6px}
.map-place-location-controls[hidden] {display:none}
.map-place-location-controls p,[data-place-location-status] {margin:0 0 10px;font-size:12px;line-height:1.5}
[data-place-location-status]:empty {display:none}
[data-place-location-coordinates] {font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#port-map.map-editing-location,#port-map.map-editing-location .ol-viewport {cursor:crosshair}
.map-place-resume { margin: 12px 0 18px; border-top: 1px solid var(--line); }
.map-place-resume > summary { min-height: 44px; padding: 12px 0; font-size: 13px; font-weight: 600; color: var(--wine); cursor: pointer; }
.map-place-resume > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
.map-place-facts { margin: 0 0 18px; font-size: 12px; }
.map-place-facts > div { display: grid; grid-template-columns: minmax(80px, .42fr) minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding: 10px 0; }
.map-place-facts dt { color: var(--muted); font-weight: 600; }
.map-place-facts dd { margin: 0; }
.map-place-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.map-place-actions .button { min-height: 44px; padding: 10px 6px; gap: 6px; font-size: 12px; text-align: center; }
.map-place-primary { position: sticky; top: 0; z-index: 1; background: var(--white); padding: 10px 0; border-bottom: 1px solid var(--line); }
.map-place-actions .map-place-read { grid-column: 1 / -1; font-size: 14px; font-weight: 600; padding: 13px 10px; }
.map-place-primary > .button:last-child:nth-child(2) { grid-column: 1 / -1; }
.map-place-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.map-place-more summary { font-size: 13px; font-weight: 600; color: var(--wine); cursor: pointer; padding: 12px 0; min-height: 44px; }
.map-place-admin { margin-top: 16px; font-size: 12px; }
@media (min-width: 992px) {
  .map-place-more { border: 0; margin: 8px 0 0; padding: 0; }
  .map-place-more > summary { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .map-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .map-sidebar { padding: 18px; }
  .map-stage.map-detail-open { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 991.98px) {
  .map-page-heading { padding-top: 28px; margin-bottom: 20px; }
  .map-page-heading h1 { font-size: 36px; margin-bottom: 12px; }
  .map-page-heading .eyebrow { margin-bottom: 8px; }
  .map-page-heading p:last-child { margin-bottom: 0; font-size: 13px; }
  .map-shell { display: block; height: max(430px, 68dvh); }
  .map-stage, .map-stage.map-detail-open { display: block; height: 100%; }
  #port-map { min-height: 0; height: 100%; }
  .map-tools-toggle { display: inline-flex; position: absolute; z-index: 2; top: 12px; right: 12px; }
  .map-tools-close { display: block; }
  .map-result-status { top: 62px; max-width: calc(100% - 65px); }
  .map-sidebar { display: none; position: absolute; z-index: 3; top: 10px; right: 10px; width: min(340px, calc(100% - 20px)); max-height: calc(100% - 20px); padding: 45px 20px 20px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 22px #292c2640; }
  .map-shell.tools-open .map-sidebar { display: block; }
  .map-detail-panel { position: fixed; z-index: 1190; top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: min(70dvh, 680px); border: 1px solid var(--line); border-width: 1px 0 0; border-radius: 18px 18px 0 0; box-shadow: 0 -14px 38px #292c2660; }
  .map-detail-panel.show { display: flex; flex-direction: column; }
  .map-place-content { padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .map-place-heading::before { position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; border-radius: 99px; background: #50243460; content: ''; transform: translateX(-50%); }
}
@media (max-width: 575.98px) {
  .map-place-facts > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Map workspace: a fixed search header, independently scrolling places, and separate tools. */
.map-shell [hidden] {display:none!important}
.map-location-control {position:absolute;z-index:2;top:112px;left:8px;max-width:min(300px,calc(100% - 16px));pointer-events:none}
.map-location-control .button {pointer-events:auto;min-height:44px;padding:8px 12px;gap:8px;font-size:12px;background:var(--white);box-shadow:0 2px 8px #292c2615}
.map-location-control .button:disabled {opacity:.7;cursor:wait}
.map-location-control svg {flex:none}
.map-location-message {display:flex;align-items:start;margin-top:6px;background:var(--white);border:1px solid var(--line);border-radius:5px;pointer-events:auto}
.map-location-control p {margin:0;padding:8px 10px;color:var(--wine);font-size:12px;line-height:1.4}
.map-location-message button {flex:none;width:44px;min-height:44px;border:0;background:transparent;color:var(--wine);font-size:24px}
.map-coverage {flex:none;margin:0;padding:8px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
@media (max-width:991.98px) {.map-location-control {top:140px}}
.map-page-heading {padding:20px 0 16px;gap:12px}
.map-page-heading .eyebrow {margin-bottom:6px;font-size:10px}
.map-page-heading h1 {font-size:32px;margin:0 0 6px;letter-spacing:-.7px}
.map-page-heading p:last-child {font-size:13px;max-width:none;margin:0}
.map-shell {grid-template-columns:300px minmax(0,1fr);height:max(440px,calc(100dvh - var(--map-top,220px) - 24px));min-height:0}
.map-shell.sidebar-collapsed {grid-template-columns:minmax(0,1fr)}
.map-sidebar {display:flex;flex-direction:column;overflow:hidden;padding:0;min-height:0;border-right:1px solid var(--line)}
.sidebar-collapsed .map-sidebar {display:none}
.map-sidebar-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px 0 16px;flex:none;font-size:14px}
.map-sidebar .map-tools-close {display:block;position:static;flex:none;width:44px;height:44px;font-size:25px}
.map-search-controls {padding:0 16px 10px;flex:none}
.map-search-controls .field {margin:0 0 8px;gap:4px}
.map-search-controls .field>span {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}
.map-search-controls input[type=search] {min-height:44px;padding:10px;font-size:14px}
.map-search-controls .map-filters {display:flex;gap:6px 14px;flex-wrap:wrap;margin:0 0 8px;min-width:0}
.map-search-controls .map-filters legend {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}
.map-search-controls .map-filters .checkbox {font-size:12px;min-height:36px;align-items:center;margin:0;gap:7px}
.map-filter-toggle {width:100%;min-height:44px;justify-content:center;font-size:13px;padding:9px 12px}
.map-search-controls .map-active-filters {flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:6px;scrollbar-width:thin}
.map-search-controls .map-active-filters:not(:empty) {margin-top:8px}
.map-filter-chip {min-height:36px;border-radius:18px;font-size:11px;padding:7px 10px;flex-shrink:0}
.map-search-controls .map-filter-chip {max-width:240px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-list-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 16px;border-top:1px solid var(--line);flex:none;font-size:12px;min-height:44px}
.map-list-heading .text-button {font-size:11px;min-height:44px}
.map-sidebar [data-map-retry] {flex:none;min-height:44px}
.map-sidebar .map-list {flex:1;min-height:0;max-height:none;margin:0;padding:0 16px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.map-list button {min-height:52px;padding:12px 6px;font-size:13px}
.map-list button small {font-size:11px;margin-top:4px}
.map-list button:hover {background:var(--paper)}
.map-list:focus-visible {outline:2px solid var(--wine);outline-offset:-3px}
.map-list-footer {flex:none;border-top:1px solid var(--line);padding:8px 16px;font-size:11px}
.map-list-footer p {font-size:10px;color:var(--muted);margin:0 0 4px}
.map-list-footer a {display:inline-flex;align-items:center;min-height:30px}
.map-toolbar {position:absolute;z-index:2;top:10px;right:10px;display:flex;gap:6px}
.map-toolbar .button {min-height:44px;padding:9px 12px;font-size:12px;background:var(--white);box-shadow:0 2px 8px #292c2615;white-space:nowrap}
.map-toolbar .map-tools-toggle {position:static;display:none}
.sidebar-collapsed .map-toolbar .map-tools-toggle {display:inline-flex}
.map-mobile-label,.map-toolbar .map-mobile-control {display:none}
.map-stage .map-result-status {top:64px;left:12px;max-width:calc(100% - 24px);font-size:11px}
.map-stage.map-detail-open .map-toolbar {right:calc(350px + 10px)}
.map-stage.map-detail-open .map-result-status {max-width:calc(100% - 374px)}
.map-dialog {width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--line);border-radius:14px;background:var(--white);color:var(--ink);box-shadow:0 15px 60px #292c2640;overflow:hidden}
.map-dialog[open] {display:flex;flex-direction:column}
.map-dialog::backdrop {background:#292c264f}
.map-dialog-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid var(--line);flex:none}
.map-dialog-heading h2 {font-size:25px;margin:0}
.map-dialog-heading button {width:44px;height:44px;flex:none;background:transparent;border:0;color:var(--wine);font-size:28px;border-radius:5px}
.map-dialog-body {padding:16px 20px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.map-dialog-body>.field-help:first-child {margin-top:0}
.map-dialog-body .field {gap:6px;margin-bottom:14px}
.map-dialog-body .map-geography-filters {grid-template-columns:1fr 1fr}
.map-dialog-body .map-geography-filters .field>span {min-height:36px}
.map-dialog-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-top:1px solid var(--line);flex:none}
.map-dialog-footer .button {min-height:44px;padding:10px 16px;font-size:13px}
.map-dialog-footer .text-button {min-height:44px;font-size:12px}
.map-dialog-footer:has(>button:only-child) {justify-content:flex-end}
.map-layer-dialog {width:min(440px,calc(100vw - 32px))}
.map-layer-dialog .map-dialog-body {padding:12px 18px}
.map-layer-dialog .map-dialog-body>.field-help:first-child {font-size:12px;margin-bottom:12px}
.map-layer-dialog .map-douro-button {min-height:44px;margin:0 0 12px;font-size:12px}
.map-layer-group {border:1px solid var(--line);border-radius:8px;margin:0 0 8px;background:var(--white)}
.map-layer-group>summary {display:flex;align-items:center;gap:8px;min-height:52px;padding:10px 12px;cursor:pointer;font-size:14px;font-weight:600;list-style:none}
.map-layer-group>summary::-webkit-details-marker {display:none}
.map-layer-group>summary::before {content:'›';font-size:22px;line-height:1;transition:transform .15s}
.map-layer-group[open]>summary::before {transform:rotate(90deg)}
.map-layer-group>summary>span:first-of-type {flex:1;min-width:0}
.map-layer-group [data-layer-count] {flex:none;font-size:11px;font-weight:400;color:var(--muted);white-space:nowrap}
.map-layer-group.has-active-layers [data-layer-count] {color:var(--wine);background:var(--paper);padding:3px 7px;border-radius:12px}
.map-layer-group-body {padding:0 12px 12px;border-top:1px solid var(--line)}
.map-layer-group-body .checkbox {min-height:44px;margin:0;gap:9px;font-size:14px;align-items:center}
.map-layer-group-body .checkbox input {flex:none}
.map-layer-group-body .field-help {font-size:12px;line-height:1.5;margin:0 0 10px}
.map-layer-group-body>.field {margin-top:10px}
.map-layer-help>summary {cursor:pointer;min-height:44px;padding:12px 0;font-size:12px;color:var(--wine)}
.map-layer-help .field-help {font-size:12px;line-height:1.5}
.map-layer-dialog [role=status]:empty {display:none}
.map-layer-dialog .map-landscape-opacity {margin:16px 0 0}
.map-layer-dialog .map-landscape-opacity>span {display:flex;justify-content:space-between;gap:10px;font-size:13px}
.map-layer-dialog .map-dialog-footer {gap:12px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px))}
.map-layer-dialog .map-dialog-footer .text-button {font-size:12px;text-align:left;line-height:1.4}
.map-layer-dialog .map-dialog-footer .button {flex:none}
.map-layer-dialog .map-dialog-footer .text-button:disabled {opacity:.5;cursor:default}
.map-layer-dialog .map-region-control {border:0;margin:0;padding:0}
.map-landscape-controls {border:0;border-top:1px solid var(--line);padding:14px 0 4px;margin:18px 0 0;min-width:0}
.map-landscape-controls legend {font-weight:600;font-size:15px;padding-right:8px}
.map-landscape-controls .checkbox {min-height:44px;font-size:14px}
.map-landscape-controls .field-help {margin:8px 0;font-size:12px}
.map-landscape-opacity {margin-top:16px}
.map-landscape-opacity output {float:right;font-variant-numeric:tabular-nums}
.map-landscape-opacity input {width:100%;min-height:44px;accent-color:var(--wine)}
.map-landscape-legend {position:absolute;z-index:2;bottom:54px;left:10px;width:min(270px,calc(100% - 20px));max-height:50%;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--white);box-shadow:0 2px 8px #292c2620;font-size:12px}
.map-landscape-legend[hidden],.map-detail-open .map-landscape-legend {display:none}
.map-landscape-legend summary {min-height:44px;padding:12px;cursor:pointer;font-weight:600}
.map-landscape-legend-body {padding:0 12px 10px}
.map-landscape-legend-body:empty,.map-landscape-legend>p:empty {display:none}
.map-landscape-legend-body>div+div {margin-top:12px}
.map-landscape-legend-body p {margin:0 0 8px}
.map-landscape-legend ul {list-style:none;margin:6px 0;padding:0}
.map-landscape-legend li {display:flex;align-items:center;gap:8px;margin:5px 0}
.map-landscape-swatch {width:15px;height:15px;flex:none;border:1px solid #0003;border-radius:3px}
[data-landscape-map-status] {margin:0;padding:0 12px 10px;color:var(--wine)}
[data-landscape-map-status]:empty {display:none}
[data-trip-map-status] {margin:0;padding:0 12px 10px;color:var(--wine)}
[data-trip-map-status]:empty,[data-trip-legend-body]:empty {display:none}
.map-trip-river-key {width:24px;height:3px;background:#147cb3;flex:none}
.map-trip-detail {overflow-wrap:anywhere}
.map-trip-detail .button {display:flex;margin:8px 0;min-height:44px}
.map-trip-list {display:flex;flex-direction:column;gap:4px}
.map-trip-list .text-button {text-align:left;min-height:44px;overflow-wrap:anywhere}
@media(min-width:992px) and (max-width:1199.98px) {
  .map-shell {grid-template-columns:270px minmax(0,1fr)}
  .map-shell.sidebar-collapsed {grid-template-columns:minmax(0,1fr)}
  .map-stage.map-detail-open .map-toolbar {right:310px}
  .map-stage.map-detail-open .map-result-status {max-width:calc(100% - 324px)}
}
@media(max-width:991.98px) {
  .map-page-heading {padding:16px 0 12px;margin:0}
  .map-page-heading .eyebrow {display:none}
  .map-page-heading h1 {font-size:28px;margin:0 0 6px}
  .map-page-heading p:last-child {font-size:12px}
  .map-shell {height:max(360px,calc(100dvh - var(--map-top,200px) - 20px - var(--mobile-nav-space,0px)))}
  .map-shell .map-sidebar {display:none;position:fixed;z-index:1190;inset:auto 0 var(--mobile-nav-space,0px);width:100%;height:min(78dvh,720px);max-height:calc(100dvh - var(--mobile-nav-space,0px) - 12px);padding:0;border:1px solid var(--line);border-radius:18px 18px 0 0;box-shadow:0 -14px 38px #292c2640}
  .map-shell.tools-open .map-sidebar {display:flex}
  .map-sidebar-heading {padding-top:10px}
  .tools-list-mode .map-search-controls {display:none}
  .map-toolbar,.map-stage.map-detail-open .map-toolbar {left:8px;right:8px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 44px;gap:4px}
  .map-toolbar .map-tools-toggle,.map-toolbar .map-mobile-control {display:inline-flex}
  .map-toolbar .button {padding:8px 4px;gap:3px;font-size:12px;justify-content:center}
  .map-desktop-label {display:none}
  .map-mobile-label {display:inline}
  .map-stage .map-result-status,.map-stage.map-detail-open .map-result-status {top:64px;left:48px;max-width:calc(100% - 58px)}
  #port-map .ol-zoom {top:64px}
  .map-dialog,.map-layer-dialog {width:100%;max-width:none;max-height:calc(88dvh - env(safe-area-inset-bottom,0px));margin:0;inset:auto 0 0;border-radius:18px 18px 0 0}
  .map-dialog-footer {padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .map-search-controls input[type=search],.map-dialog input,.map-dialog select {font-size:16px}
}
@media(max-width:359px) {
  .map-dialog-body .map-geography-filters {grid-template-columns:1fr}
  .map-dialog-body .map-geography-filters .field>span {min-height:0}
  .map-toolbar .button {font-size:11px}
}

.map-toolbar .map-fullscreen-button {gap:6px}
.map-fullscreen-button svg {flex:none}
.map-fullscreen-exit-icon,.map-fullscreen-test {display:none}
.map-fullscreen .map-fullscreen-enter-icon {display:none}
.map-fullscreen .map-fullscreen-exit-icon {display:initial}
html.map-fullscreen-open,html.map-fullscreen-open body {overflow:hidden;overscroll-behavior:none}
.map-shell.map-fullscreen {position:fixed;inset:0;z-index:2000;display:grid;grid-template-rows:minmax(0,1fr);width:100%;max-width:none;height:100dvh;min-height:0;margin:0;border:0;border-radius:0;background:var(--paper);padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);--mobile-nav-space:0px}
.map-shell.map-fullscreen:has(.map-fullscreen-test) {grid-template-rows:auto minmax(0,1fr)}
.map-fullscreen .map-fullscreen-test {display:block;grid-column:1/-1;grid-row:1;padding:3px 8px;background:#ffdc65;color:#332600;text-align:center;font-size:11px;overflow-wrap:anywhere}
.map-fullscreen:has(.map-fullscreen-test)>.map-sidebar,.map-fullscreen:has(.map-fullscreen-test)>.map-stage {grid-row:2}
@media(max-width:991.98px) {
  .map-fullscreen-button [data-map-fullscreen-label] {display:none}
  .map-shell.map-fullscreen {grid-template-columns:minmax(0,1fr)}
  .map-fullscreen .map-sidebar {bottom:env(safe-area-inset-bottom,0px)}
}

/* Desktop: two aligned tool groups, with result details in the sidebar. */
@media(min-width:992px) {
  .map-stage .map-result-status[data-state=ready] {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}
  .map-stage .map-result-status:not([data-state=ready]) {top:12px;left:70px;max-width:calc(100% - 400px)}
  .map-toolbar {top:12px;right:12px;gap:0;padding:3px;background:var(--white);border:1px solid var(--line);border-radius:8px;box-shadow:0 2px 10px #292c2620}
  .map-toolbar .button {border:0;border-radius:5px;box-shadow:none;background:transparent;padding:8px 12px}
  .map-toolbar .button:hover {background:var(--paper)}
  .map-toolbar .button:focus-visible {outline:2px solid var(--wine);outline-offset:-2px}
  .map-toolbar [data-map-open-layers] {border-right:1px solid var(--line);border-radius:5px 0 0 5px}
  #port-map .ol-zoom {top:12px;left:12px;padding:0;background:var(--white);border:1px solid var(--line);border-bottom:0;border-radius:7px 7px 0 0;overflow:hidden}
  #port-map .ol-zoom button {width:44px;height:44px;margin:0;font-size:20px;border-radius:0;background:transparent}
  #port-map .ol-zoom button+button {border-top:1px solid var(--line)}
  #port-map .ol-zoom button:hover {background:var(--paper)}
  .map-location-control {top:101px;left:12px;width:46px;max-width:none}
  .map-location-control>.button {width:46px;height:45px;min-height:44px;padding:0;justify-content:center;box-shadow:none;border-radius:0 0 7px 7px}
  .map-location-control>.button span {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}
  .map-location-message {position:absolute;top:0;left:56px;width:280px;margin:0;box-shadow:0 2px 8px #292c2620}
  .map-stage.map-detail-open .map-location-message {width:210px}
  .map-landscape-legend {left:12px;width:auto;max-width:calc(100% - 24px);box-shadow:0 2px 10px #292c2620}
  .map-landscape-legend[open] {width:280px}
  .map-landscape-legend summary {font-weight:500}
  .map-landscape-legend:not([open]) [data-landscape-notice],.map-landscape-legend:not([open]) [data-trip-notice] {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .map-landscape-legend:not([open]) summary:has([data-landscape-notice]:not(:empty),[data-trip-notice]:not(:empty))::after {content:'';display:inline-block;width:7px;height:7px;margin-left:8px;border-radius:50%;background:var(--wine)}
}

.map-sector-range {font-size:1.25rem;font-weight:700;color:var(--wine)}
[data-sector-detail-body] a {display:inline-block;margin:4px 12px 4px 0}
[data-sectors-select] {max-width:100%}
@media(max-width:991.98px) {
  .map-landscape-legend:not([open]) [data-sectors-notice] {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .map-landscape-legend:not([open]) summary:has([data-sectors-notice]:not(:empty))::after {content:'';display:inline-block;width:7px;height:7px;margin-left:7px;border-radius:50%;background:var(--wine)}
}

/* Keep the mobile map clear; detailed counts remain available in the list. */
@media(max-width:991.98px) {
  body.map-page .site-header {min-height:60px;padding:6px 12px;gap:8px}
  body.map-page .site-header .brand img.brand-logo {width:160px;height:auto}
  body.map-page .test-database-banner {padding:4px 8px;gap:0 10px;font-size:11px}
  body.map-page .main-wrap {padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
  body.map-page .map-page-heading {padding:10px 4px;margin:0}
  body.map-page .map-page-heading h1 {font-size:23px;line-height:1.2;margin:0}
  body.map-page .map-page-heading p {display:none}
  .map-stage .map-result-status[data-state=ready] {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);border:0}
  .map-stage .map-result-status:not([data-state=ready]) {left:60px;max-width:calc(100% - 120px)}
  .map-location-control {top:64px;right:8px;left:auto;width:44px;max-width:none}
  .map-location-control .button {width:44px;height:44px;padding:0;justify-content:center}
  .map-location-control .button span {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%)}
  .map-location-message {position:absolute;top:52px;right:0;width:min(280px,calc(100vw - 86px));margin:0;box-shadow:0 2px 8px #292c2620}
  .map-location-control p {font-size:11px}
  #port-map .ol-zoom {left:8px;padding:0;background:var(--white);border:1px solid var(--line);border-radius:5px;overflow:hidden}
  .map-stage #port-map .ol-zoom button {width:44px;height:44px;margin:0;font-size:20px;border-radius:0}
  #port-map .ol-zoom button+button {border-top:1px solid var(--line)}
  .map-landscape-legend {left:8px;bottom:54px;width:auto;max-width:calc(100% - 16px)}
  .map-landscape-legend[open] {width:min(300px,calc(100% - 16px))}
  .map-landscape-legend summary {padding:12px;font-size:12px}
  .map-landscape-legend:not([open]) [data-landscape-notice],.map-landscape-legend:not([open]) [data-trip-notice] {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .map-landscape-legend:not([open]) summary:has([data-landscape-notice]:not(:empty),[data-trip-notice]:not(:empty))::after {content:'';display:inline-block;width:7px;height:7px;margin-left:7px;border-radius:50%;background:var(--wine)}
}
