/* Final, scoped small-screen overrides for the existing portal layout.
   Tables keep their own horizontal scrolling; the page itself must fit. */
@media (max-width: 760px) {
    .portal-main > *,
    .risk-dashboard > *,
    .forecast-summary > div,
    .forecast-fit-summary > div { min-width: 0; }

    .portal-page-copy,
    .portal-page-meta,
    .risk-command-copy { min-width: 0; overflow-wrap: anywhere; }
    .portal-title-row h1,
    .risk-title-row h1 { line-height: 1.4; }
    .portal-page-meta strong { max-width: 100%; overflow-wrap: anywhere; }

    .forecast-summary strong { overflow-wrap: anywhere; }
    .forecast-panel-head > *,
    .forecast-panel-head label { min-width: 0; max-width: 100%; }
    .forecast-panel-head label { width: 100%; }
    .forecast-panel-head select { flex: 1; min-width: 0; max-width: 100%; }
    .forecast-controls select { max-width: 100%; }
    .forecast-fit-summary strong { overflow-wrap: anywhere; }
    .forecast-legend > span { min-width: 0; max-width: 100%; }

    .portal-page .dashboard-map-section .map-chart-container { height: 320px; }
    .dashboard-map-layout { min-height: 0; }
    .dashboard-map-brief h2 { flex-wrap: wrap; }
    .dashboard-map-brief h2 strong { font-size: clamp(25px, 8vw, 36px); }
    .portal-section-heading { gap: 8px; flex-wrap: wrap; }
    .portal-page .portal-filter-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .portal-page .portal-filter-strip .date-filter-label,
    .portal-page .portal-filter-strip .date-filter-info { grid-column: 1 / -1; }
    .portal-page .portal-filter-strip .date-input { width: 100%; min-width: 0; max-width: 100%; }
    .portal-page .portal-filter-strip .date-filter-sep { display: none; }
    .portal-page .portal-filter-strip .portal-host-select { grid-column: 1 / -1; }
    .portal-page .portal-filter-strip button { min-height: 40px; }

    .batch-file-input { min-width: 0; max-width: 100%; }
    .file-drop-copy { overflow-wrap: anywhere; }
    .form-row > *,
    .form-group,
    .submit-form fieldset { min-width: 0; }
}

@media (max-width: 680px) {
    .risk-command-main { min-width: 0; width: 100%; }
    .risk-map-title h2 { font-size: 17px; }
    .risk-map-view-switch { display: flex; width: 100%; height: auto; min-height: 40px; }
    .risk-map-view-switch button { flex: 1; min-width: 0; min-height: 40px; padding: 0 3px; font-size: 10px; }
    .risk-view-nav-shell { overflow: visible; }
    .risk-view-tabs { display: flex; width: 100%; min-width: 0; min-height: 44px; }
    .risk-view-tabs button { flex: 1; min-width: 0; padding: 0 5px; font-size: 11px; }
    .risk-view-actions { display: flex; justify-content: flex-end; width: 100%; gap: 8px; padding: 7px 9px; }
    .risk-view-actions .risk-view-action { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; }
    .risk-date-fields { min-width: 0; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .risk-date-input.date-input { width: 100%; min-width: 0; max-width: 100%; }
    .risk-map-display-tools .risk-map-level-control { min-width: 0; max-width: 100%; }
    .risk-map-level-buttons { min-width: 0; }
    .risk-map-level-buttons button { min-width: 0; }
    .risk-priority-below .risk-priority-title-row { flex-wrap: wrap; }
    .risk-holdout-header > *,
    .risk-holdout-split { min-width: 0; }
}

@media (max-width: 360px) {
    .forecast-summary { grid-template-columns: minmax(0, 1fr); }
    .forecast-fit-summary small { display: block; }
    .portal-title-row h1,
    .portal-dashboard-page .portal-title-row h1,
    .risk-title-row h1 { font-size: 17px; }
    .risk-map-level-heading { flex-wrap: wrap; }
}
