/* Phase13D: presentation only. Preserve existing map/data/editor behaviour. */
:root {--ui-panel-top:calc(var(--header-height) + 16px);}
#layer-menu {top:var(--ui-panel-top);width:300px;}
#object-details {top:var(--ui-panel-top);}
.maplibregl-ctrl-top-right {top:var(--ui-panel-top);}
.menu-heading {padding:12px 16px;min-height:64px;}
.menu-scroll {padding:0 16px 16px;}
.region-card {padding:12px;margin-top:16px;gap:6px;}
.eyebrow {font-size:11px;letter-spacing:1px;}
.section-tag {font-size:10px;letter-spacing:.2px;}
.menu-section {margin-top:16px;padding-top:16px;border-top:1px solid var(--border);}
.menu-scroll h3 {display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;margin:0 0 8px;line-height:1.4;}
.menu-scroll h3 .section-tag {float:none;flex-shrink:0;}
.layer-row {gap:10px;min-height:56px;padding:6px 0;font-size:14px;line-height:1.4;}
.layer-row > span:not(.switch):not(.layer-symbol) {min-width:0;overflow-wrap:anywhere;}
.layer-row small {font-size:12px;line-height:1.5;margin-top:4px;}
.menu-note,.legend p {font-size:12px;line-height:1.6;color:#bacbd5;margin:10px 0;}
.menu-source-notes {margin-top:20px;padding:12px;border:1px solid var(--border);border-radius:8px;background:#ffffff03;}
.menu-source-notes h4 {font-size:13px;line-height:1.4;margin:0 0 8px;color:#edf4f7;}
.menu-source-notes p+p {border-top:1px solid var(--border);padding-top:10px;}
#rfg-rule-list h4 {font-size:13px;line-height:1.5;margin:20px 0 8px;}
.rfg-rule-button {padding:12px;font-size:13px;line-height:1.5;border-radius:8px;}
.rfg-rule-button small {font-size:12px;line-height:1.5;margin-top:5px;}
.rfg-key {display:flex;align-items:center;justify-content:center;gap:3px;color:#dce6ed;}
.rfg-key i {width:4px;height:17px;background:#E00000;border-radius:2px;}
.rfg-key i+i {background:repeating-linear-gradient(45deg,#E00000 0 4px,#fff 4px 8px);}
.legend-entry {display:flex;align-items:center;gap:8px;margin-bottom:6px;color:#edf4f7;}
.legend-chip {display:inline-block;width:18px;height:6px;border-radius:2px;flex-shrink:0;}
.legend-chip.annual {background:#E00000;}
.legend-chip.seasonal {background:repeating-linear-gradient(45deg,#E00000 0 4px,#fff 4px 8px);}
.legend-note strong {display:inline-block;margin-top:8px;color:#edf4f7;}
#detail-content {padding:16px;font-size:13px;line-height:1.6;}
#detail-content h2 {margin-bottom:16px;}
#detail-content h3 {font-size:14px;line-height:1.4;color:#edf4f7;margin:22px 0 12px;padding-top:16px;}
#detail-content .detail-row {gap:5px;margin-bottom:14px;}
#detail-content .detail-label {font-size:12px;line-height:1.5;color:#bacbd5;letter-spacing:0;}
#detail-content .detail-value {font-size:13px;line-height:1.6;}
#detail-content > .detail-row[data-field="river"],#detail-content > .detail-row[data-field="bank"],#detail-content > .detail-row[data-field="river_km_reference"],#detail-content > .detail-row[data-field="visibility_status"] {grid-template-columns:120px minmax(0,1fr);column-gap:10px;align-items:start;padding-bottom:8px;margin-bottom:10px;border-bottom:1px solid #ffffff0d;}
#detail-content .status,#detail-content .detail-row[data-field="access_status"] {padding:12px;border-radius:8px;}
#detail-content .status .detail-label {font-weight:600;color:#d5e1e8;}
#detail-content .detail-note,#detail-content .source-check {font-size:12px;line-height:1.6;}
.groyne-technical {margin-top:20px;padding-top:6px;}
.groyne-technical > summary {font-size:13px;min-height:44px;}
#wesel-gauge-details {top:var(--ui-panel-top);height:calc(100dvh - var(--ui-panel-top) - var(--footer-clearance,72px));max-height:calc(100dvh - var(--ui-panel-top) - var(--footer-clearance,72px));padding-left:16px;padding-right:16px;}
#wesel-gauge-details .gauge-detail-toolbar {margin:0 -16px;padding:7px 12px;}
#wesel-gauge-details dt {font-size:12px;margin-top:16px;line-height:1.5;}
#wesel-gauge-details dd {margin-top:5px;line-height:1.6;padding-bottom:12px;border-bottom:1px solid #ffffff10;}
#gauge-menu {margin:16px 0;padding:0 12px;border-radius:8px;}
#gauge-menu summary {font-size:14px;min-height:48px;}
.gauge-menu-station {margin:8px 0;padding:12px;border-radius:8px;}
.gauge-menu-station span,.gauge-menu-station small {font-size:12px;line-height:1.5;}
@media(max-width:1023px) {#layer-menu {width:280px;}}
@media(max-width:600px) {
  #layer-menu {width:min(290px,calc(100% - 70px));}
  #object-details {top:auto;}
  #wesel-gauge-details {top:auto;height:auto;max-height:min(42dvh,calc(100dvh - var(--header-height) - var(--footer-clearance,72px) - 16px));}
  .menu-scroll {padding-left:12px;padding-right:12px;}
  .menu-scroll h3 {font-size:13px;}
  .layer-row {font-size:13px;}
  .section-tag {font-size:10px;}
}
@media(max-height:500px) {
  #object-details,#wesel-gauge-details {height:auto;max-height:calc(100dvh - var(--ui-panel-top) - var(--footer-clearance,72px));}
}

/* Phase13E: existing values remain uncollapsed; supplementary nodes are disclosed. */
.detail-more {margin-top:16px;border-top:1px solid var(--border);padding-top:4px;}
.detail-more > summary {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 0;cursor:pointer;font-size:13px;color:#d5e1e8;}
.detail-more > summary .more-label,.detail-more > summary .less-label {color:var(--cyan);white-space:nowrap;}
.detail-more:not([open]) > summary .less-label,.detail-more[open] > summary .more-label {display:none;}
.detail-more > summary:focus-visible {outline:2px solid var(--cyan);outline-offset:2px;}
#detail-content > .detail-row {margin-bottom:10px;}
#detail-content > .detail-row[data-field="bank"],#detail-content > .detail-row[data-field="river_km"],#detail-content > .detail-row[data-field="river_km_reference"] {grid-template-columns:110px minmax(0,1fr);padding-bottom:6px;}
#detail-content > .status {padding:10px;}
#detail-content > .detail-row[data-field="period"] {padding:10px;border:1px solid var(--border);border-radius:8px;}

/* Phase13F: footer information lives in the menu, not over the map. */
:root {--footer-clearance:12px;--source-clearance:12px;}
#shore-notice,.maplibregl-ctrl-attrib {display:none !important;}
#map-source-list {line-height:1.7;overflow-wrap:anywhere;}
#map-source-list a {color:var(--cyan);text-decoration:underline;text-underline-offset:2px;}
#object-details {bottom:auto;height:auto;max-height:calc(100dvh - var(--ui-panel-top) - 12px);}
.detail-more {margin-top:10px;}
@media(max-width:600px) {
 #object-details {top:auto;bottom:12px;height:auto;max-height:min(42dvh,calc(100dvh - var(--header-height) - 28px));}
}

/* Phase13G: same categories and controls, explanatory text behind native disclosure. */
.menu-section {margin-top:12px;padding-top:12px;}
.layer-row {min-height:50px;padding-top:4px;padding-bottom:4px;}
.menu-more {margin:6px 0 10px;}
.menu-more > summary {display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:8px 0;cursor:pointer;font-size:12px;line-height:1.5;color:#bacbd5;}
.menu-more > summary > span:first-child {min-width:0;}
.menu-more > summary .more-label,.menu-more > summary .less-label {color:var(--cyan);white-space:nowrap;flex-shrink:0;}
.menu-more:not([open]) > summary .less-label,.menu-more[open] > summary .more-label {display:none;}
.menu-more > summary:focus-visible {outline:2px solid var(--cyan);outline-offset:2px;}
.menu-source-notes.menu-more {padding:4px 12px;margin-top:12px;}
.menu-source-notes.menu-more > summary {font-size:13px;color:#edf4f7;}

/* Phase13H: list replaces object content in the same dock/bottom sheet. */
.rfg-menu-row #open-rfg-list {flex:1;min-width:0;min-height:44px;padding:5px 0;background:transparent;border:0;color:#edf4f7;text-align:left;font:inherit;}
.rfg-menu-row #open-rfg-list small {color:#bacbd5;}
.rfg-menu-row input {flex-shrink:0;}
.rfg-navigation-list .rfg-rule-button {width:100%;}
.rfg-navigation-list h4 {font-size:14px;margin:16px 0 8px;color:#edf4f7;}
.detail-toolbar {gap:8px;}
.detail-toolbar > .eyebrow {flex:1;min-width:0;}

/* Phase13I: one explicitly marked photo preview, intrinsic ratio without crop. */
.groyne-test-photo {margin:0 0 14px;}
.groyne-test-photo img {display:block;width:100%;height:auto;border-radius:6px;}
.groyne-test-photo figcaption {margin-top:6px;color:#bacbd5;font-size:12px;line-height:1.5;}

/* Online test: phone-only taller details; desktop rules remain unchanged. */
@media (max-width:600px) {
 #object-details {top:calc(var(--header-height) + 2px);bottom:12px;height:auto;max-height:none;display:flex;flex-direction:column;overflow:hidden;}
 #object-details[hidden] {display:none;}
 #object-details > .detail-toolbar {flex:0 0 auto;}
 #object-details > #detail-content {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
 .maplibregl-ctrl-top-right .maplibregl-ctrl-group {background:transparent;border:0;box-shadow:none;overflow:visible;}
 .maplibregl-ctrl-top-right .maplibregl-ctrl-group button {position:relative;width:44px;height:44px;border:0;background:transparent;}
 .maplibregl-ctrl-top-right .maplibregl-ctrl-group button::before {content:"";position:absolute;inset:6.5px;border:1px solid var(--border);border-radius:7px;background:#0a202bee;box-shadow:0 2px 8px #0004;pointer-events:none;}
 .maplibregl-ctrl-top-right .maplibregl-ctrl-group button .maplibregl-ctrl-icon {position:relative;transform:scale(.7);}
}
