/* In-flow research controls: no new floating cards or modal stacking. */
.research-captured-chart-controls { min-width:0; margin:0 0 12px; }
.research-captured-chart-controls .control, .research-captured-chart-controls select { width:100%; min-width:0; max-width:100%; }
.research-captured-chart-controls p { line-height:1.6; overflow-wrap:anywhere; }
#research-captured-chart-plot { min-width:0; width:100%; }
#research-captures[hidden] { display:none !important; }
#research-captures .control, #research-captures-search { min-width:0; width:100%; max-width:100%; }
.research-captures-list { display:grid; gap:8px; margin:12px 0; }
.research-captures-choice { display:flex; gap:10px; padding:12px; border:1px solid var(--line,#29434b); border-radius:8px; line-height:1.55; min-width:0; cursor:pointer; }
.research-captures-choice > input { flex:none; width:18px; height:18px; margin-top:4px; }
.research-captures-choice > span { display:grid; gap:3px; min-width:0; overflow-wrap:anywhere; }
.research-captures-choice > span > span { color:var(--text-muted,#a8baca); font-size:.85rem; }
.research-study-bar { display:grid; grid-template-columns:minmax(220px,1.5fr) minmax(220px,1fr); gap:14px; padding:16px; margin-bottom:18px; border:1px solid var(--line, #29434b); border-radius:12px; background:var(--panel, #102930); }
.research-study-bar .control, .research-import-grid .control { min-width:0; }
.research-study-bar input, .research-study-bar select, .research-import input, .research-import select { width:100%; max-width:100%; min-width:0; }
.research-study-bar > p { grid-column:1 / -1; margin:0; line-height:1.6; }
.research-result-actions { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0; }
.research-result-actions > p { flex-basis:100%; margin:0; }
#research-evidence-body { line-height:1.65; overflow-wrap:anywhere; }
#research-evidence-body ul { padding-left:20px; }
#research-evidence-body li { margin-bottom:8px; }
.research-import { margin:16px 0; padding:18px; max-width:100%; }
.research-import-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin:16px 0; }
#research-import-review { margin-top:12px; overflow-wrap:anywhere; }
.analysis-setup details input[type=datetime-local] { width:100%; min-width:0; }
.research-display-note { line-height:1.5; }
.research-public-data { border:1px solid var(--line,#29434b); border-radius:12px; padding:16px; margin:0 0 18px; min-width:0; }
.research-source-heading h3 { margin:0 0 6px; }
.research-source-choices { margin:12px 0; }
.research-public-query > summary { cursor:pointer; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.research-public-query[open] > summary { margin-bottom:12px; }
#research-public-reopen { margin-top:12px; }
.research-station-finder { padding:12px; margin:12px 0; border:1px solid var(--line,#29434b); border-radius:8px; min-width:0; }
.research-station-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:8px; margin:10px 0; }
.research-station-choice { display:flex; flex-direction:column; align-items:flex-start; gap:5px; width:100%; min-width:0; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.research-station-choice span { font-size:12px; line-height:1.45; font-weight:400; }
.research-variable-definition,.research-loaded-context { padding-left:10px; border-left:2px solid var(--line,#29434b); }
.research-query-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(185px,1fr)); gap:12px; margin:12px 0; }
.research-public-data .control { min-width:0; }
.research-public-data input,.research-public-data select { width:100%; max-width:100%; min-width:0; }
.research-public-data p { line-height:1.55; overflow-wrap:anywhere; }
.research-public-data [hidden] { display:none !important; }
#research-public-status[data-tone="error"] { color:var(--danger,#ffb4b4); }
@media(max-width:560px) { .research-query-grid { grid-template-columns:minmax(0,1fr); } .research-source-choices .button { flex:1 1 160px; } .research-public-data { padding:12px; } }
#graphs-page .analysis-result .visualization-canvas .comparison-key { width:30px; height:12px; flex:0 0 30px; align-self:center; }
@media(max-width:760px) { .research-study-bar { grid-template-columns:minmax(0,1fr); padding:12px; } .research-result-actions .button { flex:1 1 180px; } .research-import-grid { grid-template-columns:minmax(0,1fr); } }

.research-summary-controls { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:12px 0; }
.research-summary-table { max-width:100%; overflow-x:auto; border:1px solid var(--border-color,rgba(140,180,210,.22)); border-radius:8px; }
.research-summary-table table { width:100%; border-collapse:collapse; font-size:.85rem; }
.research-summary-table th,.research-summary-table td { padding:10px; text-align:left; vertical-align:top; border-bottom:1px solid rgba(140,180,210,.15); }
.research-summary-table th span { display:block; margin-top:4px; font-weight:400; color:var(--text-muted,#a8baca); overflow-wrap:anywhere; }
.research-summary-table th:first-child { min-width:170px; }
.research-summary-table td { font-variant-numeric:tabular-nums; }
.research-summary-table details { min-width:120px; max-width:280px; overflow-wrap:anywhere; }
.research-summary-table caption { padding:10px; text-align:left; }
#research-temporal-summary[hidden] { display:none !important; }
#research-seasonal-comparison[hidden] { display:none !important; }
.research-seasonal-controls { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin:12px 0; }
.research-seasonal-controls .control { min-width:0; flex:1 1 220px; }
.research-seasonal-controls select { width:100%; min-width:0; max-width:100%; }
.research-seasonal-years { display:flex; flex-wrap:wrap; gap:8px 14px; max-height:180px; overflow:auto; padding:10px 2px; }
.research-seasonal-years label { display:inline-flex; align-items:center; gap:5px; min-height:32px; }
#research-seasonal-chart { width:100%; min-width:0; min-height:360px; overflow:hidden; }
#research-seasonal-chart svg { max-width:100%; }
#research-seasonal-status { overflow-wrap:anywhere; line-height:1.6; }
#research-calculations[hidden], #research-calculations [hidden] { display:none !important; }
.research-calculation-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0; }
.research-calculation-controls > :nth-child(1),.research-calculation-controls > :nth-child(2) { grid-column:1 / -1; }
.research-calculation-controls .control { min-width:0; }
.research-calculation-controls select,.research-calculation-controls input { min-width:0; max-width:100%; width:100%; }
.research-calculation-check { display:flex; gap:8px; align-items:center; line-height:1.5; }
.research-calculation-check input { width:auto; flex:none; }
.research-calculation-chart { min-width:0; width:100%; overflow:hidden; margin:12px 0; }
.research-calculation-chart svg { max-width:100%; }
.research-calculation-answer { min-width:0; margin:10px 0; padding:0 0 0 12px; border-left:3px solid var(--accent,#42d3e8); overflow-wrap:anywhere; }
.research-calculation-answer p { margin:6px 0; line-height:1.55; }
.research-calculation-answer .research-calculation-answer-lead { margin:2px 0; font-size:1rem; font-weight:650; line-height:1.4; }
.research-calculation-answer details > summary { width:fit-content; min-height:30px; padding:4px 0; font-size:.85rem; line-height:1.4; cursor:pointer; }
.research-calculation-answer dl { display:flex; flex-wrap:wrap; gap:8px 28px; margin:10px 0; }
.research-calculation-answer dl > div { flex:1 1 210px; min-width:0; }
.research-calculation-answer dt { font-size:.8rem; opacity:.8; }
.research-calculation-answer dd { margin:3px 0 0; line-height:1.5; }
#research-calculation-status,#research-calculation-method-note { line-height:1.6; overflow-wrap:anywhere; }
#research-calculation-table { margin-top:12px; }
#research-calculation-table table { min-width:680px; }
#research-calculation-table th,#research-calculation-table td { min-width:110px; overflow-wrap:normal; word-break:normal; }
#research-calculation-table td { white-space:nowrap; }
#research-calculation-table td details,#research-calculation-table th { white-space:normal; }
#research-calculation-table td details { min-width:180px; }
#research-calculation-table td details dt { font-weight:600; }
#research-calculation-table td details dd { margin:0 0 8px; }
#research-calculations .research-summary-controls .button { white-space:normal; }
@media(max-width:640px) { .research-calculation-controls { grid-template-columns:minmax(0,1fr); } }

/* Calculations lead with the answer; detailed methods remain one disclosure away. */
#research-calculation-status[data-state="complete"] { display:none; }
.research-calculation-answer .research-calculation-notice { font-size:.92rem; line-height:1.5; color:var(--warning,#ffcf87); margin:8px 0; }
.research-calculation-answer #research-calculation-answer-details { max-width:76ch; margin-top:8px; }
.research-calculation-answer #research-calculation-answer-details > summary { font-size:.92rem; min-height:38px; padding:8px 0; }
.research-calculation-answer #research-calculation-answer-details :is(p,li,dd) { font-size:.94rem; line-height:1.55; }
.research-calculation-limitations { margin:14px 0 8px; }
.research-calculation-limitations ul { padding-left:22px; margin:8px 0; }
.research-calculation-limitations li + li { margin-top:8px; }
#research-calculation-chart { overflow-x:auto; overflow-y:hidden; }
#research-calculation-chart > svg { display:block; flex:none; }
#research-calculation-caption { max-width:80ch; font-size:.92rem; line-height:1.5; font-weight:400; }
.research-depth-figure { background:#fff; color:#243943; padding:12px; border-radius:6px; }
.research-depth-figure svg { display:block; width:100%; height:auto; max-height:620px; font:14px system-ui,sans-serif; fill:#243943; }
.research-depth-figure .legend { display:flex; flex-wrap:wrap; gap:8px; font-size:14px; }
.research-depth-figure .legend-item { display:inline-flex; align-items:center; gap:8px; }
.research-depth-figure .legend-item i { display:inline-block; width:16px; height:3px; }
.research-depth-figure .chart-note { font-size:13px; color:#52646d; }
#research-captured-depth-controls .control { flex:1 1 260px; min-width:0; }
#research-captured-depth-controls select { width:100%; max-width:100%; }
