/* Research lab: map-first comparison workspace. */
#researchMap{height:clamp(350px,53vh,570px);width:100%;border:1px solid var(--az-edge);border-radius:12px;margin:16px 0;background:#dce8ee;z-index:0}
.research-legend{display:flex;gap:8px 16px;flex-wrap:wrap;font-size:12px;color:var(--az-muted);margin-bottom:16px}.research-legend span{display:inline-flex;align-items:center;gap:5px}.research-legend i{width:12px;height:12px;border-radius:50%;display:inline-block}
.research-selection-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.research-selection-head h3{margin:0}.research-selection-head h3 span{font-size:13px;color:var(--az-muted)}
.research-selected,.research-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,225px),1fr));gap:10px;margin:12px 0}
.research-station,.research-result{min-width:0;padding:13px;border:1px solid var(--az-edge);border-left:5px solid var(--station-color,var(--az-accent));border-radius:9px;background:var(--az-soft);overflow-wrap:anywhere}
.research-station strong,.research-result strong{display:block}.research-station p,.research-result p{font-size:13px;margin:5px 0}.research-station button{min-height:36px;padding:4px 10px;margin-top:6px}
.research-result button{margin-top:8px}.research-parameter label{flex:1}.research-parameter select{width:100%}.research-marker-label{font-weight:800;color:#fff;background:#10283c;border:0;border-radius:20px;box-shadow:none}
#resultStation{width:min(100%,440px);margin-bottom:12px}#progress{display:none}.research-selected:empty::after{content:"No stations selected. Click a map marker or add a station from the list.";color:var(--az-muted);font-size:14px}
@media(max-width:600px){#researchMap{height:340px}.research-selection-head button{min-height:44px}.research-results{grid-template-columns:1fr}}

.trend-graph{height:clamp(350px,55vh,600px)}#time-trends{scroll-margin-top:24px}#trendStatus{overflow-wrap:anywhere}#trendRows td{white-space:normal}@media(max-width:600px){.trend-graph{height:390px}}

.figure-caption{border-left:3px solid var(--az-accent);background:var(--az-soft);padding:14px 16px;border-radius:6px;margin:12px 0 20px;font-size:14px;line-height:1.65}.figure-caption p{margin:0 0 10px}.figure-caption span{margin-left:8px;color:var(--az-muted)}

/* Real-time parameter readiness, adjacent to the selector. */
.research-parameter-workspace{border:1px solid var(--az-edge);border-radius:12px;padding:14px;background:var(--az-card);margin-top:12px}
.research-parameter{align-items:flex-end}.research-parameter label{min-width:0}
.parameter-badge{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--az-edge);border-radius:8px;color:var(--az-muted);font-size:13px;font-weight:700;white-space:nowrap}
.parameter-state-icon{display:inline-block;width:13px;height:13px;flex:none;border:2px solid currentColor;border-radius:50%}
.parameter-badge[data-state=loading]{color:var(--az-accent);background:var(--az-soft)}.parameter-badge[data-state=loading] .parameter-state-icon{border-right-color:transparent;animation:parameter-spin .85s linear infinite}
.parameter-badge[data-state=ready]{color:#087f5b}.parameter-badge[data-state=ready] .parameter-state-icon{background:currentColor;box-shadow:inset 0 0 0 3px var(--az-card)}
html[data-az-theme=dark] .parameter-badge[data-state=ready]{color:#82e6b8}
.parameter-badge[data-state=error]{color:#b45309}html[data-az-theme=dark] .parameter-badge[data-state=error]{color:#ffc477}
.parameter-loading{margin-top:12px;padding:12px;border-radius:8px;background:var(--az-soft)}.parameter-loading[hidden]{display:none!important}
.parameter-loading-head{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:13px}.parameter-loading progress{margin:8px 0;height:8px}.parameter-station-progress{display:grid;gap:5px;font-size:12px}.parameter-station-progress>div{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}.parameter-station-progress>div span:last-child{color:var(--az-muted)}
#parameterStatus{margin:8px 0 0}#param:disabled{opacity:.7;cursor:wait}
@keyframes parameter-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.parameter-state-icon{animation:none!important}}html[data-az-motion-paused] .parameter-state-icon{animation:none!important}
@media(max-width:600px){.research-parameter-workspace{padding:10px}.parameter-badge{min-height:36px}.parameter-station-progress>div{display:block}.parameter-station-progress>div span{display:block}}

.research-outreach{margin-top:12px;border-top:1px solid var(--az-edge);padding-top:12px}.research-outreach strong{font-size:13px}.research-outreach-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}.research-outreach-actions a{font-size:13px;font-weight:650}.research-outreach-actions .research-mail{display:inline-flex;align-items:center;min-height:44px;padding:6px 10px;border:1px solid var(--az-edge);border-radius:7px;background:var(--az-card)}.research-outreach-actions button{margin:0;min-height:44px}.research-outreach p a{overflow-wrap:anywhere}

.station-history-loading{display:flex;align-items:center;gap:8px}.station-history-spinner{display:inline-block;flex:none;width:14px;height:14px;box-sizing:border-box;border:2px solid var(--az-accent);border-right-color:transparent;border-radius:50%;animation:parameter-spin .85s linear infinite}@media(prefers-reduced-motion:reduce){.station-history-spinner{animation:none!important}}html[data-az-motion-paused] .station-history-spinner{animation:none!important}

.spatial-grouping{padding:14px;margin:16px 0;border:1px solid var(--az-edge);background:var(--az-soft);border-radius:10px}.spatial-grouping h3{margin-top:0}.spatial-assignments{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:10px;margin:12px 0}.spatial-check{display:flex;flex-direction:row;align-items:center}.spatial-check input{min-height:0;width:20px;height:20px}.spatial-grouping [hidden]{display:none!important}

.repeat-map-controls{margin-top:14px;align-items:end}.repeat-map-controls label:first-child{flex:1;min-width:min(100%,260px)}.repeat-map-controls select{width:100%}.repeat-map-controls p{margin:0;flex-basis:100%}.research-legend .repeat-key i{background:#64748b;border:1px solid var(--az-edge)}.research-legend .repeat-small{width:7px;height:7px}.research-legend .repeat-large{width:13px;height:13px}.research-legend .repeat-big{width:18px;height:18px}
