/*
 * PWS Watch
 * Shared context icon, compact disclosure and responsive content families.
 * Author: Carlos Enrique Ortiz (CEO)
 * HyperKode (c) 2026 · www.HyperKode.com
 * License: Project license designation pending confirmation.
 */
.pws-context-icon {width:1.25em;height:1.25em;flex:none;color:var(--pws-color-text);}
.pws-context-icon--tide {color:var(--pws-color-weather-rain);}
.pws-context-phrase {display:flex;align-items:baseline;gap:var(--pws-space-2);margin:var(--pws-space-2) 0;}
.pws-context-phrase .pws-context-icon {align-self:center;}
.pws-context-settings {display:flex;flex-wrap:wrap;align-items:center;gap:var(--pws-space-4);margin:var(--pws-space-4) 0;}
.pws-context-settings form {display:flex;flex-wrap:wrap;align-items:end;gap:var(--pws-space-2);min-width:0;}
.pws-context-settings label {display:flex;flex-wrap:wrap;align-items:center;gap:var(--pws-space-2);}
.pws-context-settings input:not([type=checkbox]) {width:11rem;max-width:100%;min-height:var(--pws-control-height);box-sizing:border-box;border:1px solid var(--pws-color-control-border);border-radius:var(--pws-radius-control);padding:var(--pws-space-2);background:var(--pws-color-panel);color:var(--pws-color-text);font:inherit;}
.pws-context-toggle {min-height:var(--pws-control-height);cursor:pointer;}
.pws-context-toggle input {accent-color:var(--pws-color-accent);}
.pws-context-body a {color:var(--pws-color-accent);overflow-wrap:anywhere;}
.pws-context-curve {width:100%;max-width:32rem;height:100px;color:var(--pws-color-weather-rain);display:block;}
.pws-context-extremes {display:flex;flex-wrap:wrap;gap:var(--pws-space-2) var(--pws-space-4);list-style:none;padding:0;font-size:var(--pws-text-meta);}
.pws-context-events {list-style:none;padding:0;margin:var(--pws-space-3) 0;}
.pws-context-events li {display:grid;gap:var(--pws-space-1);margin:var(--pws-space-3) 0;}
.pws-context-reference {display:flex;flex-wrap:wrap;gap:var(--pws-space-5);}
.pws-context-reference .pws-context-icon {width:24px;height:24px;}
.pws-context-reference small .pws-context-icon {width:16px;height:16px;}

/* Reset legacy dashboard label/input rules; retain the shared control family. */
.pws-context-settings label,.pws-context-toggle {flex-direction:row;text-transform:none;letter-spacing:normal;font-size:var(--pws-text-control);font-weight:var(--pws-weight-control);}
.pws-context-settings input[type=checkbox] {width:18px;height:18px;min-height:0;margin:0;flex:none;}
.pws-context-body {padding:0 var(--dashboard-space-inset) var(--dashboard-space-section);}
.pws-context-settings a {color:var(--pws-color-accent);}

body.review-dashboard .pws-seismic-notice {border-color:var(--pws-color-control-border);}
body.review-dashboard .pws-seismic-notice summary strong {display:flex;align-items:center;gap:var(--pws-space-2);}
body.review-dashboard .pws-seismic-notice a {color:var(--pws-color-accent);}

/* Optional source controls must honor native hidden state despite the form layout rule. */
.pws-context-settings form[hidden] {display:none;}

.pws-context-seismic-map {width:100%;border-radius:var(--pws-radius-control);isolation:isolate;}
.pws-context-body [hidden] {display:none;}
.pws-context-status:empty {display:none;}
.pws-context-earthquake-head {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--pws-space-2);margin-bottom:var(--pws-space-2);}
.pws-context-earthquake-summary {margin:0;font-size:var(--pws-text-body);}
.pws-context-earthquake-head .pws-context-settings {margin:0;}
.pws-context-earthquake-layout {display:grid;grid-template-columns:minmax(0,1fr);gap:var(--pws-space-3);align-items:start;}
.pws-context-earthquake-layout > div {min-width:0;}
.pws-context-location {margin:var(--pws-space-2) 0;}
.pws-context-events {margin:0;}
.pws-context-events li {margin:0 0 var(--pws-space-2);}
body.review-dashboard button.pws-context-event-select {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;width:100%;height:auto;min-height:var(--pws-control-height);padding:var(--pws-space-3);gap:var(--pws-space-1);white-space:normal;}
.pws-context-event-select strong {font-weight:var(--pws-weight-control);font-size:var(--pws-text-body);}
.pws-context-event-select .pws-meta {font-weight:var(--pws-weight-normal);}
.pws-context-events > li > a {margin-inline:var(--pws-space-3);justify-self:start;}
.pws-context-seismic-source {margin:var(--pws-space-3) 0 0;}
@media(max-width:760px) {
  .pws-context-earthquake-layout {grid-template-columns:minmax(0,1fr);gap:var(--pws-space-3);}
}

/* Earthquake exploration uses shared controls, event symbols and selection colors. */
.pws-context-map-actions {display:flex;flex-wrap:wrap;gap:var(--pws-space-2);margin-bottom:var(--pws-space-2);}
body.review-dashboard .pws-context-seismic-map {height:360px;background:var(--atlas-map-bg);}
.pws-context-map-dialog {width:min(1100px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto;border:1px solid var(--pws-color-control-border);border-radius:var(--pws-radius-panel);padding:var(--pws-space-4);background:var(--pws-color-panel);color:var(--pws-color-text);}
.pws-context-map-dialog::backdrop {background:color-mix(in srgb,var(--pws-color-page) 70%,transparent);}
.pws-context-map-dialog > button {margin-bottom:var(--pws-space-3);}
body.review-dashboard .pws-context-map-dialog .pws-context-seismic-map {height:min(65dvh,640px);min-height:240px;}
.pws-seismic-marker-host {background:none;border:0;}
.pws-seismic-marker {display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:44px;color:var(--pws-color-map-ink);filter:drop-shadow(0 1px 1px var(--pws-color-map-halo));}
.pws-seismic-marker .pws-context-icon {color:var(--pws-color-map-ink);width:24px;height:24px;}
.pws-seismic-marker-label {font:var(--pws-weight-control) var(--pws-text-caption)/1.4 var(--pws-font-ui);white-space:nowrap;padding:0 var(--pws-space-1);border-radius:var(--pws-radius-control);background:var(--pws-color-panel);color:var(--pws-color-text);border:1px solid var(--pws-color-map-ink);}
.pws-seismic-marker.is-selected .pws-seismic-marker-label {background:var(--pws-color-accent);color:var(--pws-color-on-accent);}
.pws-context-seismic-map .leaflet-popup-content {max-height:240px;overflow:auto;}
.pws-context-seismic-map .leaflet-popup-content .pws-control {display:flex;width:100%;margin-top:var(--pws-space-2);white-space:normal;height:auto;min-height:44px;text-align:left;}
.pws-context-seismic-map .leaflet-popup-content-wrapper,
.pws-context-seismic-map .leaflet-popup-tip {background:var(--pws-color-panel);color:var(--pws-color-text);}
.pws-context-seismic-map .leaflet-popup-close-button {color:var(--pws-color-text);}
.pws-context-seismic-map .pws-seismic-station-label {font:var(--pws-text-caption)/1.3 var(--pws-font-ui);padding:var(--pws-space-1);}
body.review-dashboard button.pws-context-event-select {justify-self:start;}
.pws-context-event-select[aria-pressed=true] {outline:2px solid var(--pws-color-accent);outline-offset:2px;}
.pws-context-seismic-map .leaflet-marker-icon:focus-visible {outline:2px solid var(--pws-color-accent);outline-offset:3px;}

.pws-context-earthquake-layout:has(> [data-context-events][hidden]) {grid-template-columns:minmax(0,1fr);}

/* One compact control row above a full-width map and its linked reports. */
.pws-context-toolbar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--pws-space-2);margin-block:var(--pws-space-3);}
.pws-context-toolbar .pws-tabs,.pws-context-toolbar .pws-context-map-actions {margin:0;}
.pws-context-earthquake-summary {margin-bottom:var(--pws-space-2);}
.pws-context-events {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:var(--pws-space-2) var(--pws-space-4);}
.pws-context-preference {min-height:var(--pws-control-height);font-size:var(--pws-text-control);font-weight:var(--pws-weight-control);text-transform:none;letter-spacing:normal;}
.pws-context-preference input[type=checkbox] {width:18px;height:18px;min-height:0;flex:none;accent-color:var(--pws-color-accent);}

/* Match the stable tab workspace: hidden actions keep the toolbar footprint on tab switches. */
body.review-dashboard .pws-context-toolbar > [data-context-map-controls][hidden] {display:block !important;visibility:hidden;pointer-events:none;}

/* Compact context cards: one takeaway first, source detail on demand. */
.pws-regional-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--pws-space-3);align-items:start;}
.pws-regional-card {min-width:0;margin:0;}
.pws-regional-glance {display:flex;flex-direction:column;gap:var(--pws-space-2);min-height:118px;list-style:none;cursor:pointer;}
.pws-regional-glance::-webkit-details-marker {display:none;}
.pws-regional-glance:focus-visible {outline:2px solid var(--pws-color-accent);outline-offset:4px;border-radius:var(--pws-radius-control);}
.pws-regional-glance-heading {display:flex;align-items:center;justify-content:space-between;gap:var(--pws-space-2);}
.pws-regional-glance-heading > span {min-width:0;}
.pws-regional-glance-heading .pws-weather-phrase {margin:0;}
.pws-regional-glance-value {font-size:var(--pws-text-section);font-weight:var(--pws-weight-control);line-height:1.3;overflow-wrap:anywhere;}
.pws-regional-glance-context {line-height:1.45;margin-top:auto;}
.pws-regional-card[open] > summary .atlas-provider-indicator {transform:rotate(180deg);}
.pws-regional-detail-body {border-top:1px solid var(--pws-color-divider);padding-top:var(--pws-space-3);margin-top:var(--pws-space-3);overflow-wrap:anywhere;}
.pws-regional-detail-body p {margin-block:var(--pws-space-2);}
.pws-regional-detail-body a {display:inline-block;margin:var(--pws-space-1) var(--pws-space-3) var(--pws-space-1) 0;min-height:24px;}
.pws-regional-gauge {padding-block:var(--pws-space-3);border-top:1px solid var(--pws-color-divider);}
.pws-regional-gauge p {margin:var(--pws-space-1) 0;}
.pws-regional-card .review-weather-alert > summary {white-space:normal;}
.pws-regional-card .review-weather-alert > summary .pws-meta {display:block;}
@media(max-width:1099px) {.pws-regional-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:760px) {.pws-regional-card[open] {grid-column:1/-1;}}
@media(max-width:359px) {.pws-regional-grid {grid-template-columns:minmax(0,1fr);}}

/* One restrained status cue inside the sentence; labels retain the full meaning. */
.pws-regional-emphasis {font-weight:var(--pws-weight-control);}
.pws-regional-emphasis--attention {color:var(--pws-color-warning);}
.pws-regional-inline-cue {display:inline-block;width:.9em;height:.9em;vertical-align:-.1em;margin-right:var(--pws-space-1);}

/* Open cards retain the same meaning-first hierarchy without a stretched metric header. */
.pws-regional-card[open] .pws-regional-glance {min-height:0;}
.pws-regional-focus-name {font-size:var(--pws-text-body);line-height:1.4;margin:0 0 var(--pws-space-2);}

/* Topic icons identify the subject; headline cues communicate the reported condition. */
.pws-regional-value--good {color:var(--pws-color-success);}
.pws-regional-value--attention,.pws-regional-value--warning {color:var(--pws-color-warning);}
.pws-regional-value--unknown,.pws-regional-value--pending {color:var(--pws-color-muted);}
