.webgis { --left-width: 275px; --right-width: 335px; position: relative; display: grid; grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width); height: calc(100dvh - var(--site-header-height, 62px)); gap: 8px; min-height: 590px; }
.webgis.left-panel-hidden { --left-width: 0px; }
.webgis.right-panel-hidden { --right-width: 0px; }
.webgis > .side { grid-column: 1; grid-row: 1; }
.webgis > .map-section { grid-column: 2; grid-row: 1; }
.webgis > .detail { grid-column: 3; grid-row: 1; }
.side[hidden], .detail[hidden], .sample-banner[hidden], #search-empty[hidden], .map-notice[hidden], .map-tool-panel[hidden], .map-tool-rail button[hidden] { display: none !important; }
.side-title { display: flex; align-items: center; justify-content: space-between; color: #143e69; letter-spacing: .03em; padding: 10px 12px; min-height: 48px; }
.side-content { padding: 7px 10px 12px; }
.panel-close { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: #6d8297; padding: 5px; cursor: pointer; }
.panel-close:hover { background: #edf3f9; color: #173d66; }
.panel-close .ui-icon { width: 17px; height: 17px; }
.sample-banner { display: inline-block; padding: 3px 8px; margin: 2px 0 7px; border-radius: 12px; background: #f1f5f9; color: #65758a; font-size: 11px; }
.filter-group { margin: 4px 0 11px; border-bottom: 1px solid #e8eef5; padding-bottom: 9px; }
.filter-group > summary { display: flex; align-items: center; gap: 7px; padding: 9px 4px; color: #24446c; list-style: none; cursor: pointer; font-size: 12px; }
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid #7890a6; border-bottom: 1.5px solid #7890a6; transform: rotate(-45deg); margin-left: auto; margin-right: 3px; }
.filter-group[open] > summary::after { transform: rotate(45deg); }
.filter-group > summary .ui-icon { width: 16px; height: 16px; color: #305c8d; }
.layer-item { padding: 5px 3px; font-size: 12px; gap: 7px; min-height: 29px; }
.layer-item input { width: 13px; height: 13px; margin: 0; flex: 0 0 auto; accent-color: #2b558d; }
.layer-item .type-icon { width: 21px; height: 21px; }
.layer-item .count { min-width: 24px; padding: 1px 5px; border-radius: 10px; text-align: center; background: #edf3fa; color: #3e648d; font-size: 10px; line-height: 16px; }
.root-switch { background: #f0f5fc; border-radius: 6px; padding: 7px 8px; margin-bottom: 4px; }
.root-switch .ui-icon { width: 17px; height: 17px; }
.tree-children { position: relative; margin-left: 10px; padding-left: 10px; border-left: 1px solid #dae5ee; }
.tree-children .layer-item { position: relative; }
.tree-children .layer-item::before { content: ''; position: absolute; left: -11px; top: 14px; width: 7px; border-top: 1px solid #dae5ee; }
.filter-items { padding-left: 10px; }
.period-icon { display: inline-flex; color: #7993b0; }
.period-icon .ui-icon { width: 14px; height: 14px; }
.condition-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px #f1f5f9; flex: 0 0 auto; margin: 0 3px; }
.text-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 1px solid #dce6ef; border-radius: 6px; padding: 6px 10px; color: #466a90; background: #f8fbfe; font-size: 11px; margin-bottom: 10px; }
.text-button .ui-icon { width: 14px; height: 14px; }
.side-footer { padding: 10px; gap: 8px; color: #365574; font-size: 11px; }
.map-tool-buttons { display: flex; gap: 7px; }
.map-tool-buttons button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; font-size: 10px; }
.map-tool-buttons .ui-icon { width: 22px; height: 22px; }
.map-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 8px; pointer-events: none; z-index: 4; }
.map-toolbar > * { pointer-events: auto; }
.map-toolbar .map-search { position: static; width: 100%; display: flex; align-items: center; background: #fff; border: 1px solid #e0e8f0; box-shadow: 0 3px 15px #0d2c4b20; min-height: 39px; }
.map-search > [data-ui-icon] { color: #728ba3; display: flex; padding-left: 10px; }
.map-search input { padding: 9px 7px; font-size: 12px; }
.map-search button { display: flex; padding: 7px; color: #728ba3; }
.map-search button .ui-icon { width: 17px; height: 17px; }
.map-actions { display: flex; gap: 5px; }
.map-actions .icon-button { padding: 8px; min-height: 39px; box-shadow: 0 3px 15px #0d2c4b18; }
.map-options { position: absolute; top: 70px; left: 12px; bottom: calc(var(--map-stats-height, 58px) + 62px); width: 56px; z-index: 4; pointer-events: none; }
.map-options > * { pointer-events: auto; }
.map-tool-rail { display: flex; flex-direction: column; gap: 3px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: #fff; border-radius: 7px; padding: 4px; box-shadow: 0 2px 12px #0a1e3520; }
.map-tool-rail > button, .map-utility-group button, .map-utility-group > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 44px; min-height: 40px; flex-shrink: 0; border: 0; background: transparent; color: #426282; padding: 5px 2px; border-radius: 5px; font-weight: 600; font-size: 10px; }
.map-utility-group { border-top: 1px solid #e2eaf2; padding-top: 3px; }
.map-utility-group > summary { list-style: none; cursor: pointer; }
.map-utility-group > summary::-webkit-details-marker { display: none; }
.map-utility-group[open] > summary { background: #edf3fa; }
.map-sdk-navigation { display: grid; justify-items: center; gap: 3px; padding: 3px 0; border-block: 1px solid #e2eaf2; }
.map-sdk-navigation:empty { display: none; }
.map-sdk-navigation > div { width: 44px; }
.map-sdk-navigation .esri-widget, .map-sdk-navigation .esri-widget--button { width: 44px; box-shadow: none; }
.map-sdk-navigation .esri-widget--button { height: 32px; }
.map-tool-rail .ui-icon { width: 17px; height: 17px; }
.map-tool-rail button.selected, .map-tool-rail button[aria-pressed="true"] { background: #244c80; color: #fff; }
.map-tool-rail button:disabled { opacity: .55; cursor: wait; }
.map-tool-panel { position: absolute; top: 128px; right: 12px; bottom: calc(var(--map-stats-height, 58px) + 62px); width: min(340px, calc(100% - 82px)); z-index: 5; background: #fff; border: 1px solid #dce6ef; border-radius: 8px; display: flex; flex-direction: column; box-shadow: 0 4px 22px #0a1e3533; overflow: hidden; }
.map-tool-heading { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #e4ebf3; color: #24466f; font-size: 12px; flex-shrink: 0; }
.tool-heading-actions { display: flex; gap: 2px; }
.map-tool-panel[data-tool="measure"] { bottom: auto; max-height: calc(100% - var(--map-stats-height, 58px) - 190px); }
.map-tool-panel.is-minimized { bottom: auto; }
.map-tool-panel.is-minimized #map-tool-content { display: none; }
#map-tool-content { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; }
#map-tool-content > .esri-widget { width: 100%; max-width: none; box-shadow: none; }
.map-zone-form { padding: 10px; display: grid; gap: 10px; font-size: 12px; }
.map-zone-fields { display: grid; gap: 9px; }
.map-zone-form label { display: grid; gap: 3px; }
.map-zone-form input:not([type="checkbox"]), .map-zone-form select { min-width: 0; width: 100%; border: 1px solid #cfdce9; padding: 6px; border-radius: 5px; background: white; color: #23425e; }
.map-zone-form input[type="color"] { height: 30px; }
.map-zone-form label:has(input[type="checkbox"]) { display: flex; gap: 6px; align-items: center; }
.map-zone-sketch { border: 1px solid #e3eaf2; border-radius: 5px; overflow: hidden; }
.map-zone-sketch > .esri-widget { width: 100%; }
.map-zone-actions { display: flex; gap: 8px; }
.map-zone-actions button { padding: 7px 12px; border: 1px solid #cedbea; border-radius: 5px; color: #23425e; background: white; }
.map-zone-actions button[data-zone-action="save"] { background: #244c80; color: #fff; }
.map-zone-actions button:disabled { opacity: .5; cursor: not-allowed; }
.map-zone-status { margin: 0; color: #617a92; font-size: 11px; }
.zone-edit-button { display: flex; align-items: center; gap: 4px; background: none; border: 0; color: #446f98; font-size: 10px; padding: 2px 0 6px 25px; }
.zone-edit-button .ui-icon { width: 13px; height: 13px; }
.basemap-control { display: flex; flex-direction: column; gap: 2px; background: white; border-radius: 7px; padding: 6px 9px; box-shadow: 0 2px 12px #0a1e3520; }
.basemap-control > span { font-size: 10px; font-weight: 600; color: #69819b; }
.basemap-control .ui-icon { width: 13px; height: 13px; }
.basemap-control select { max-width: 190px; min-height: 24px; border: 0; color: #24466b; background: white; font-size: 12px; }
.map-status { position: absolute; bottom: calc(var(--map-stats-height, 58px) + 32px); left: 14px; max-width: calc(100% - 28px); background: #ffffffed; border: 1px solid #e1e9ef; padding: 5px 9px; border-radius: 5px; color: #466581; font-size: 10px; pointer-events: none; z-index: 2; }
.map-notice { top: auto; bottom: calc(var(--map-stats-height, 58px) + 62px); left: 76px; right: 12px; max-width: none; max-height: 120px; overflow: auto; font-size: 12px; box-shadow: 0 2px 14px #0a1e3526; }
.tool-panel-open .map-notice { display: none; }
.is-error { color: #9d3030; }
.layer-error { display: block; color: #a83636; padding-left: 25px; overflow-wrap: anywhere; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 3px; font-size: 11px; }
.legend-row > span:nth-child(2) { flex: 1; }
.legend-row .type-icon { width: 22px; height: 22px; }
.legend-row small { margin-left: auto; color: #71879a; }
.swatch.polygon, .swatch.tile { border-radius: 2px; opacity: .7; }
.swatch.line { height: 3px; border: none; box-shadow: none; border-radius: 0; }
.result-summary { padding: 2px 4px 6px; color: #71859a; font-size: 11px; }
.monument-result { width: 100%; border: 0; border-bottom: 1px solid #edf1f5; background: white; text-align: left; display: flex; align-items: center; gap: 8px; padding: 9px 2px; color: #23425e; }
.monument-result:hover, .monument-result:focus-visible { background: #edf6fc; }
.monument-result b { display: block; font-size: 11px; font-weight: 600; }
.monument-result small { display: block; font-size: 10px; color: #6d8394; margin-top: 2px; }
.detail #detail-content { margin: 0; text-align: left; }
.detail-heading { min-height: 48px; color: #24466f; font-size: 12px; }
.detail .empty-icon .ui-icon { width: 64px; height: 64px; stroke-width: 1; color: #adc1d4; }
.detail dl { grid-template-columns: 115px minmax(0, 1fr); }
.detail dt .ui-icon { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.detail dd { overflow-wrap: anywhere; }
.detail .cover.placeholder .type-icon { width: 76px; height: 76px; }
.detail h2 .ui-icon { margin-right: 6px; }
.attachment-links { display: grid; gap: 8px; overflow-wrap: anywhere; }
#map-stats { gap: 7px; bottom: 25px; max-width: calc(100% - 88px); flex-wrap: wrap; }
#map-stats > div { padding: 7px 9px; gap: 7px; border: 1px solid #e2eaf2; }
#map-stats > div > div { display: flex; flex-direction: column; }
#map-stats b { font-size: 19px; line-height: 1.1; }
#map-stats span { font-size: 10px; }
#map-stats .stat-icon { display: flex; padding: 6px; background: #edf4fc; border-radius: 7px; color: #4878aa; }
#map-stats .stat-icon.protect { color: #c88332; background: #fff4df; }
#map-stats .ui-icon { width: 21px; height: 21px; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #1987c9; outline-offset: 2px; }
@media (max-width: 1250px) {
  .webgis { --left-width: 245px; --right-width: 290px; }
  .webgis.left-panel-hidden { --left-width: 0px; } .webgis.right-panel-hidden { --right-width: 0px; }
  #map-stats { gap: 4px; } #map-stats > div { padding: 6px; gap: 5px; } #map-stats .stat-icon { padding: 4px; } #map-stats .ui-icon { width: 17px; height: 17px; }
}
@media (max-width: 900px) {
  .webgis { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .map-section { order: 0; height: 70vh; min-height: 470px; }
  .side { order: 1; height: 450px; } .detail { order: 2; height: 450px; }
}
@media (max-width: 560px) {
  .map-toolbar { top: 8px; left: 8px; right: 8px; grid-template-columns: minmax(70px,1fr) auto; gap: 6px; }
  .map-options { left: 8px; top: 64px; }
  .map-actions .icon-button { padding: 6px; min-width: 31px; }
  .basemap-control select { max-width: 150px; }
  .map-tool-panel { right: 8px; top: 126px; width: calc(100% - 76px); }
  #map-stats { left: 8px; right: 72px; bottom: 26px; max-width: none; gap: 4px; }
  #map-stats > div { flex: 1; padding: 5px; min-width: 0; }
  #map-stats .stat-icon { padding: 3px; } #map-stats .ui-icon { width: 15px; height: 15px; }
  #map-stats b { font-size: 15px; } #map-stats span { font-size: 9px; }
  .map-status { left: 8px; }
}
body.map-fullscreen { overflow: hidden; }
.webgis:fullscreen, .webgis.is-expanded { display: grid; width: 100vw; height: 100dvh; min-height: 0; margin: 0; padding: 8px; background: #eef3f8; }
.webgis.is-expanded { position: fixed; inset: 0; z-index: 10000; }
.webgis.is-fullscreen .map-section, .webgis.is-fullscreen .side, .webgis.is-fullscreen .detail { min-height: 0; height: auto; }
@media (max-width: 900px) {
  .webgis.is-fullscreen { grid-template-columns: minmax(0, 1fr); }
  .webgis.is-fullscreen > .map-section { grid-column: 1; grid-row: 1; }
  .webgis.is-fullscreen > .side, .webgis.is-fullscreen > .detail { position: absolute; top: 8px; bottom: 8px; width: min(300px, calc(100% - 64px)); z-index: 10; box-shadow: 0 5px 28px #15385640; }
  .webgis.is-fullscreen > .side { left: 8px; } .webgis.is-fullscreen > .detail { right: 8px; }
}

/* Saved zone manager owns only its root inside the shared map tool dock. */
.map-zone-manager { display: grid; gap: 9px; min-width: 0; padding: 10px; color: #23425e; font-size: 12px; }
.map-zone-manager, .map-zone-manager * { box-sizing: border-box; }
.map-zone-manager [hidden] { display: none !important; }
.map-zone-manager-filters { display: grid; gap: 7px; min-width: 0; }
.map-zone-manager-filters label { display: grid; gap: 3px; min-width: 0; color: #506d86; font-size: 11px; }
.map-zone-manager-filters input, .map-zone-manager-filters select { width: 100%; min-width: 0; min-height: 33px; padding: 6px 8px; border: 1px solid #cfdce9; border-radius: 5px; color: #23425e; background: #fff; font: inherit; font-size: 12px; }
.map-zone-manager-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #617a92; font-size: 11px; }
.map-zone-manager button { flex-shrink: 0; min-height: 30px; padding: 5px 8px; border: 1px solid #d3dfeb; border-radius: 5px; color: #244c80; background: #fff; font: inherit; font-size: 11px; cursor: pointer; }
.map-zone-manager button:hover { background: #edf5fc; border-color: #adc7df; }
.map-zone-manager button:disabled { opacity: .55; cursor: not-allowed; }
.map-zone-manager button[data-zone-manager-action="delete"] { color: #a23232; }
.map-zone-manager button[data-zone-manager-action="delete"]:hover { background: #fff2f2; border-color: #dfb9b9; }
.map-zone-manager-list { display: grid; gap: 8px; margin: 0; padding: 0; min-width: 0; list-style: none; }
.map-zone-manager-row { min-width: 0; border: 1px solid #e0e8f1; border-radius: 7px; padding: 8px; background: #fbfdff; }
.map-zone-manager-heading { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.map-zone-manager-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 600; line-height: 1.4; }
.map-zone-manager-color { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 2px; border: 1px solid #0002; border-radius: 3px; }
.map-zone-manager-meta, .map-zone-manager-monument { margin: 4px 0 0 20px; color: #617a92; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.map-zone-manager-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.map-zone-manager-visible { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; margin-right: auto; padding-right: 4px; cursor: pointer; color: #466581; font-size: 11px; }
.map-zone-manager-visible input { width: 14px; height: 14px; margin: 0; accent-color: #244c80; }
.map-zone-manager-empty, .map-zone-manager-readonly { margin: 0; padding: 10px; border-radius: 5px; color: #617a92; background: #f0f5fa; font-size: 11px; line-height: 1.5; }
.map-zone-manager-status { margin: 0; color: #617a92; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.map-zone-manager-status:empty { display: none; }
.map-zone-manager-status.is-error { color: #9d3030; }
.map-zone-manager-pagination { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #617a92; font-size: 10px; }
@media (max-width: 560px) {
  .map-zone-manager { padding: 8px; }
  .map-zone-manager-row { padding: 7px; }
  .map-zone-manager button { min-height: 34px; }
}
