html,
body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  font-family: Verdana, Arial, sans-serif;
  color: #373f35;
  background: #f5f6f2;
}

.container-fluid {
  padding: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.affm-topbar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 1100;
  min-height: 68px;
  background: #9d2235;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.forecaster-logo {
  height: 56px;
  max-width: min(560px, 60vw);
  width: auto;
  display: block;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  padding: 3px 8px;
}

.forecaster-header-tagline {
  flex: 0 1 auto;
  color: #f5f6f2;
  font-family: Verdana, Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.affm-topbar-spacer {
  flex: 1 1 auto;
  min-width: 12px;
}

.affm-logo-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.affm-logo {
  height: 56px;
  max-width: min(260px, 26vw);
  width: auto;
  display: block;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  padding: 3px 8px;
}

.main-nav-tabs {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-nav-tabs > .tabbable {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-nav-tabs > .tabbable > .nav-tabs {
  flex: 0 0 auto;
  min-height: 65px;
  margin: 0;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: #ffffff;
  border-bottom: 1px solid #dde0d6;
}

.main-nav-tabs > .tabbable > .nav-tabs > li {
  float: none;
  display: flex;
  margin: 0;
}

.main-nav-tabs > .tabbable > .nav-tabs > li > a {
  height: 65px;
  margin: 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #484848;
  font-family: Verdana, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav-tabs > .tabbable > .nav-tabs > li > a:hover,
.main-nav-tabs > .tabbable > .nav-tabs > li > a:focus,
.main-nav-tabs > .tabbable > .nav-tabs > li.active > a,
.main-nav-tabs > .tabbable > .nav-tabs > li.active > a:hover,
.main-nav-tabs > .tabbable > .nav-tabs > li.active > a:focus {
  border: 0;
  background: #ffffff;
  color: #808080;
  box-shadow: inset 0 -3px 0 #c7192f;
}

.main-nav-tabs > .tabbable > .tab-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-nav-tabs > .tabbable > .tab-content > .tab-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.main-nav-tabs > .tabbable > .tab-content > .tab-pane.active {
  display: flex !important;
  flex-direction: column;
}

.forecast-map-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-page-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: #f5f6f2;
}

.nav-page-card {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 30px 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dde0d6;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.nav-page-card h1 {
  margin: 0 0 14px;
  color: #2f3a2d;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.nav-page-card h2 {
  margin: 20px 0 8px;
  color: #34422f;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.nav-page-card p,
.nav-page-card li {
  color: #3f4b37;
  font-size: 14px;
  line-height: 1.55;
}

.nav-status-panel {
  margin: 18px 0;
}

.nav-status-panel .summary-strip {
  position: static;
  top: auto;
  border: 1px solid #dde0d6;
}

.nav-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.nav-action-button {
  color: #34422f;
  background: #ffffff;
  border: 1px solid #a8b09f;
  border-radius: 0;
  font-weight: 700;
}

.nav-action-button.primary {
  color: #ffffff;
  background: #6a785f;
  border-color: #56634d;
}

.nav-caution-note,
.nav-placeholder-note {
  padding: 10px 12px;
  border-left: 4px solid #e68619;
  background: #fff8e8;
}

.risk-definition-list {
  margin: 10px 0 14px;
}

.risk-definition-list p {
  margin: 4px 0;
}

.alert-table-placeholder {
  margin: 18px 0;
  overflow-x: auto;
}

.placeholder-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
}

.placeholder-table th,
.placeholder-table td {
  padding: 8px 9px;
  border: 1px solid #dde0d6;
  color: #3f4b37;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
}

.placeholder-table th {
  background: #f3f6ee;
  font-weight: 700;
}

.summary-strip {
  flex: 0 0 auto;
  position: sticky;
  top: 68px;
  z-index: 1090;
  display: grid;
  grid-template-columns: minmax(172px, 230px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  background: white;
  border-bottom: 1px solid #dde0d6;
}

.forecast-summary-count-card {
  white-space: nowrap;
  border-left: 5px solid #6a785f;
  background: #fafbf8;
  padding: 7px 11px;
  font-size: 13px;
  color: #373f35;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.forecast-summary-count-line {
  line-height: 1.45;
}

.forecast-summary-count-line strong {
  font-size: 15px;
}

.risk-alert-word {
  font-weight: 700;
}

.forecast-summary-copy {
  min-width: 0;
}

.forecast-summary-copy h3 {
  margin: 0 0 3px;
  font-size: 15px;
  line-height: 1.25;
  color: #2f3a2d;
}

.forecast-summary-copy p {
  margin: 2px 0;
  font-size: 12px;
  line-height: 1.35;
  color: #4d5548;
}

.summary-card {
  border-left: 5px solid #6a785f;
  background: #fafbf8;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.summary-card span {
  display: block;
  font-size: 21px;
  font-weight: 700;
}

.summary-card small {
  color: #5d6658;
}

.summary-card.red { border-color: #c7192f; }
.summary-card.amber { border-color: #e68619; }
.summary-card.orange { border-color: #e68619; }
.summary-card.neutral { border-color: #8b9185; }
.summary-card.source { border-color: #536b85; }

.test-mode-banner {
  flex: 0 0 auto;
  background: #7f1d1d;
  color: #fff;
  font-weight: 700;
  padding: 8px 20px;
}

.scenario-safety-banner {
  flex: 0 0 auto;
  background: #fff4d6;
  color: #604307;
  border-bottom: 1px solid #e4bd67;
  font-weight: 700;
  padding: 7px 18px;
}

.app-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.control-panel,
.diagnostic-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dde0d6;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  padding: 16px;
}

.control-panel {
  display: flex;
  flex-direction: column;
  flex: 0 0 320px;
  width: 320px;
  max-width: 36vw;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.map-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.control-panel h3 {
  margin-top: 0;
  color: #3f4b37;
}

.control-panel h4 {
  margin: 14px 0 8px;
  color: #3f4b37;
  font-size: 14px;
  font-weight: 700;
}

.btn-affm {
  color: white;
  background: #6a785f;
  border-color: #56634d;
  font-weight: 700;
}

.btn-affm-secondary {
  color: #3f4b37;
  background: white;
  border-color: #a8b09f;
}

.forecast-day-list {
  margin: 10px 0 12px;
  border: 1px solid #d8ddd0;
  background: #fafbf8;
}

.forecast-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-bottom: 1px solid #e2e5dc;
  font-size: 13px;
}

.forecast-section {
  margin-bottom: 10px;
}

.static-triage-controls {
  margin: 2px 0 5px;
}

.triage-checkbox-control {
  margin: 0;
  padding: 0;
}

.triage-checkbox-control .form-group,
.triage-checkbox-control .checkbox {
  margin: 0;
  padding: 0;
}

.triage-checkbox-control label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  column-gap: 7px;
  min-height: 20px;
  margin: 0;
  padding: 1px 0;
  color: #34422f;
  font-size: 12.25px;
  font-weight: 500;
  line-height: 1.22;
  white-space: normal;
}

.triage-checkbox-control input[type="checkbox"] {
  position: static;
  grid-column: 1;
  align-self: start;
  margin: 2px 0 0;
  accent-color: #6a785f;
}

.triage-checkbox-control.active label {
  font-weight: 600;
}

.triage-checkbox-control.disabled {
  opacity: 0.62;
}

.triage-unavailable-note {
  margin: -1px 0 4px 23px;
  font-size: 10px;
}

.triage-layer-readout {
  margin: 6px 0 2px;
  padding: 5px 7px;
  background: #f3f6ee;
  color: #4f584c;
  border-left: 3px solid #8b9582;
  font-size: 11px;
  line-height: 1.25;
}

.forecast-section h3,
.forecast-section-heading {
  margin: 0 0 7px;
  color: #3f4b37;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.forecast-range-heading {
  margin: 0 0 4px;
  color: #2f3a2d;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
}

.forecast-range-label {
  margin-bottom: 8px;
  color: #5d6658;
  font-size: 13px;
  font-weight: 700;
}

.forecast-primary-heading {
  margin: 0 0 5px;
  color: #2f3a2d;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
}

.forecast-secondary-heading {
  margin: 0 0 8px;
  color: #3f4b37;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.forecast-section-separator {
  border-top: 1px solid #dde0d6;
  height: 0;
  margin: 8px 0 8px;
}

.forecast-mode-button-row,
.forecast-day-buttons,
.playback-button-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.weekly-forecast-section .time-controls {
  margin-top: 10px;
}

.weekly-forecast-toggle,
.daily-forecast-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none !important;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

.weekly-forecast-toggle:hover,
.weekly-forecast-toggle:focus,
.daily-forecast-toggle:hover,
.daily-forecast-toggle:focus {
  color: #2f3a2d;
  text-decoration: none !important;
}

.weekly-forecast-chevron,
.daily-forecast-chevron {
  display: inline-block;
  flex: 0 0 1em;
  width: 1em;
  color: #5f6a58;
  font-size: 1em;
  line-height: 1;
  text-align: center;
}

/* Shiny wraps action-link text in .action-label: keep the title and triangle
   together inside that wrapper, including on tablet-width control panels. */
.weekly-forecast-toggle .action-label,
.daily-forecast-toggle .action-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  white-space: nowrap;
}

.weekly-forecast-collapsible.collapsed,
.daily-forecast-collapsible.collapsed {
  display: none;
}

.forecast-mode-button {
  padding: 3px 9px;
  border: 1px solid #a8b09f;
  background: #ffffff;
  color: #34422f;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
}

.forecast-mode-button.active {
  background: #6a785f;
  border-color: #56634d;
  color: #ffffff;
}

.forecast-day-label {
  font-weight: 700;
  color: #34422f;
}

.forecast-day-row:last-child {
  border-bottom: 0;
}

.forecast-day-row.active {
  background: #eef2e8;
  box-shadow: inset 4px 0 0 #6a785f;
  font-weight: 700;
}

.playback-symbol-button {
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid #a8b09f;
  background: #ffffff;
  color: #34422f;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
}

.playback-symbol-button.primary {
  color: #ffffff;
  background: #6a785f;
  border-color: #56634d;
}

.time-controls {
  margin: 8px 0 12px;
}

.forecast-slider-block {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: 18px 36px 18px;
  column-gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.native-forecast-slider-block {
  display: block;
  margin-top: 6px;
}

.selected-frame-readout {
  margin: 0 0 6px;
  /* Reserve the normal two-line local-time label before Shiny fills it. */
  min-height: 2.5em;
  color: #4f584c;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

/* Keep the map and playback targets stationary as hourly summaries change
   between compact playback and detailed paused text. Let longer text grow. */
@media (min-width: 1025px) {
  .sites11a-forecast-page #alert_summary .forecast-summary-strip {
    min-height: 112px;
  }
}

.forecast-slider-block .native-slider-wrap .control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.forecast-slider-block .irs-min,
.forecast-slider-block .irs-max,
.forecast-slider-block .irs-from,
.forecast-slider-block .irs-to,
.forecast-slider-block .irs-single,
.forecast-slider-block .irs-grid-text {
  display: none !important;
}

.native-slider-wrap .form-group,
.opacity-slider-wrap .form-group {
  margin-bottom: 0;
}

.native-slider-wrap .irs,
.opacity-slider-wrap .irs {
  margin-top: -6px;
}

.forecast-slider-axis-label {
  color: #67705f;
  font-size: 10px;
  line-height: 1;
  text-transform: lowercase;
}

.forecast-slider-axis-time {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.forecast-slider-axis-date {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

.forecast-slider-stage {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 3;
  height: 72px;
}

.forecast-range-input {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  width: 100%;
  margin: 0;
  accent-color: #6a785f;
}

.forecast-slider-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 35px;
  height: 15px;
  pointer-events: none;
}

.forecast-slider-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 7px;
  background: #a8b09f;
  transform: translateX(-50%);
}

.forecast-slider-tick.midnight {
  height: 13px;
  width: 2px;
  background: #6a785f;
}

.forecast-slider-tick.midday {
  height: 8px;
  background: #9aa38f;
}

.forecast-slider-tick.daily {
  height: 10px;
  width: 2px;
  background: #8b9582;
}

.forecast-slider-handle-label {
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
  white-space: nowrap;
  pointer-events: none;
  color: #34422f;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
}

.forecast-slider-handle-top {
  top: 4px;
  background: #eef2e8;
  border: 1px solid #cbd2c3;
  padding: 2px 5px;
}

.forecast-slider-handle-bottom {
  bottom: 1px;
}

.playback-button-row {
  justify-content: center;
  margin: 0;
}

.playback-button-only-row {
  display: flex;
  justify-content: center;
  margin: 3px 0 6px;
}

.playback-button-row.disabled {
  opacity: 0.55;
}

.playback-opacity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  margin: 3px 0 6px;
}

.static-opacity-row {
  justify-content: flex-end;
  margin-top: 6px;
}

.overlay-opacity-control {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.global-forecast-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
}

.global-forecast-controls .standalone-overlay-opacity-control {
  justify-content: flex-start;
  max-width: 210px;
  gap: 8px;
}

.global-forecast-controls .opacity-slider-wrap {
  flex-basis: 104px;
  width: 104px;
  max-width: 104px;
}

.reset-starting-view-control {
  border-top: 1px solid #dde0d6;
  margin-top: 3px;
  padding-top: 18px;
}

.reset-starting-view-button {
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  padding: 4px 8px;
  border: 1px solid #a8b09f;
  color: #3f4b37;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.simulation-toggle-control {
  margin: 3px 0 0;
  padding: 1px 0 0;
}

.simulation-toggle-control .form-group,
.simulation-toggle-control .checkbox {
  margin: 0;
  padding: 0;
}

.simulation-toggle-control label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  column-gap: 7px;
  margin: 0;
  padding: 1px 0;
  color: #34422f;
  font-size: 12.25px;
  font-weight: 500;
  line-height: 1.22;
}

.simulation-toggle-control input[type="checkbox"] {
  position: static;
  grid-column: 1;
  align-self: start;
  margin: 2px 0 0;
  accent-color: #6a785f;
}

.simulation-toggle-control.active label,
.simulation-toggle-control:has(input[type="checkbox"]:checked) label {
  font-weight: 600;
}

.simulation-toggle-control.disabled {
  opacity: 0.62;
}

.overlay-opacity-label {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #3f4b37;
  white-space: nowrap;
}

.inline-overlay-opacity-control .overlay-opacity-label {
  font-size: 10px;
  font-weight: 700;
}

.opacity-slider-wrap {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  max-width: 64px;
  min-width: 58px;
}

.opacity-slider-wrap .control-label {
  display: none;
}

.opacity-slider-wrap .irs {
  margin-top: -16px;
}

.opacity-slider-wrap .irs-min,
.opacity-slider-wrap .irs-max,
.opacity-slider-wrap .irs-single,
.opacity-slider-wrap .irs-from,
.opacity-slider-wrap .irs-to,
.opacity-slider-wrap .irs-grid-text {
  display: none !important;
}

.inline-overlay-opacity-control .irs {
  height: 34px;
}

.inline-overlay-opacity-control .irs-line,
.inline-overlay-opacity-control .irs-bar {
  height: 3px !important;
}

.inline-overlay-opacity-control .irs-handle {
  width: 10px !important;
  height: 10px !important;
}

.opacity-range-input {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  width: 100%;
  margin: 0;
  accent-color: #6a785f;
}

.opacity-value-bubble {
  position: absolute;
  left: var(--opacity-pos);
  top: 0;
  transform: translateX(-50%);
  background: #eef2e8;
  border: 1px solid #cbd2c3;
  color: #34422f;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  pointer-events: none;
}

.tmax-period-note {
  margin: 10px 0 12px;
  padding: 9px 10px;
  border-left: 4px solid #e68619;
  background: #fff7eb;
  color: #4f3b14;
  font-size: 12px;
}

.hourly-notice {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 5px solid #e68619;
  background: #fff7eb;
  color: #5c3b0c;
  font-size: 12px;
}

.map-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.headline-video-layer {
  position: absolute;
  inset: 0;
  z-index: 850;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #eef1eb;
}

.headline-video-layer.hidden {
  display: none;
}

.headline-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #eef1eb;
}

.map-camp-layer-panel {
  position: absolute;
  z-index: 820;
  top: 12px;
  right: 12px;
  width: 238px;
  max-width: calc(100% - 84px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #bfc8b8;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
  color: #34422f;
}

.leaflet-control-affm-camps {
  position: static;
  margin: 12px 12px 0 0;
  width: 238px;
  max-width: min(238px, calc(100vw - 96px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(1px);
}

.heat-risk-legend-control {
  margin: 0 12px 18px 0 !important;
}

.temperature-legend-control {
  margin: 0 0 18px 12px !important;
}

.temperature-legend {
  width: 185px;
  max-width: calc(100vw - 40px);
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(106, 120, 95, 0.38);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  padding: 7px 9px;
  color: #33402e;
  font: 11px/1.25 Verdana, Arial, sans-serif;
}

.temperature-legend-title {
  margin-bottom: 5px;
  color: #34422f;
  font-weight: 700;
}

.temperature-legend-ramp {
  height: 10px;
  border: 1px solid rgba(45, 52, 42, 0.28);
  opacity: var(--temperature-legend-ramp-opacity, 0.55);
  background: linear-gradient(
    90deg,
    #335bb6 0%,
    #2d9dd3 18%,
    #40c2a4 35%,
    #9bd66f 50%,
    #f5e55b 65%,
    #f39a34 80%,
    #c7192f 100%
  );
}

.temperature-legend-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 3px;
  color: #4f584c;
  font-size: 10px;
}

.heat-risk-legend {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(106, 120, 95, 0.38);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  padding: 8px 10px;
  color: #33402e;
  font: 12px/1.25 Verdana, Arial, sans-serif;
  width: min(370px, calc(100vw - 40px));
  max-width: 370px;
}

.heat-risk-legend-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #34422f;
}

.heat-risk-legend-row {
  display: grid;
  grid-template-columns: 56px 13px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin: 4px 0;
}

.heat-risk-word {
  font-weight: 700;
  letter-spacing: 0;
}

.heat-risk-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(45, 52, 42, 0.35);
}

.heat-risk-description {
  min-width: 0;
  white-space: nowrap;
}

.map-camp-layer-panel .form-group {
  margin-bottom: 0;
}

.map-camp-layer-panel .control-label {
  font-weight: 700;
  color: #3f4b37;
  margin-bottom: 5px;
}

.map-camp-layer-panel .checkbox {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}

.map-camp-layer-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.map-camp-layer-panel input[type="checkbox"] {
  margin-top: 0;
}

.map-navigation-controls {
  position: absolute;
  z-index: 830;
  top: 12px;
  left: 54px;
  width: 254px;
  max-width: min(254px, calc(100% - 360px));
  pointer-events: auto;
}

.map-search-control,
.map-basemap-control {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #bfc8b8;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.18);
  color: #34422f;
}

.map-search-control {
  padding: 5px;
}

.map-basemap-control {
  margin-top: 5px;
  padding: 4px 5px;
  width: 150px;
}

.map-search-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.map-navigation-controls .form-group {
  margin-bottom: 0;
}

.map-navigation-controls .control-label {
  display: none;
}

.map-search-control input.form-control,
.map-basemap-control select.form-control {
  height: 27px;
  min-height: 27px;
  padding: 3px 7px;
  border-color: #cbd2c3;
  color: #34422f;
  font-size: 12px;
  line-height: 1.2;
}

.map-basemap-control select.form-control {
  padding-right: 20px;
}

.map-search-button {
  flex: 0 0 auto;
  height: 27px;
  min-height: 27px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.2;
  color: #34422f;
  border-color: #aeb9a7;
  background: #eef2e8;
}

.species-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.species-swatch {
  flex: 0 0 auto;
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.species-swatch.ghff { background: #f2b43c; }
.species-swatch.bff { background: #1f1f1f; }
.species-swatch.lrff { background: #ce2b2b; }
.species-swatch.sff { background: #7b5a62; }

.forecast-fixed-label {
  position: absolute;
  z-index: 800;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(440px, calc(100% - 570px));
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #bfc8b8;
  color: #34422f;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.forecast-fixed-label.hidden {
  display: none;
}

.forecast-overlay-debug-panel {
  position: absolute;
  left: 12px;
  bottom: 18px;
  z-index: 760;
  max-width: min(560px, calc(100% - 24px));
  max-height: 42vh;
  overflow: auto;
  padding: 10px 12px;
  background: rgba(255, 255, 248, 0.96);
  border: 1px solid #c7cdbd;
  box-shadow: 0 2px 10px rgba(33, 39, 32, 0.15);
  color: #24302d;
  font-size: 12px;
  line-height: 1.25;
}

.forecast-overlay-debug-panel h4 {
  margin: 0 0 6px;
  font-size: 13px;
}

.forecast-overlay-debug-panel dl {
  margin: 0;
}

.forecast-overlay-debug-panel dt {
  float: left;
  clear: left;
  width: 145px;
  font-weight: 700;
}

.forecast-overlay-debug-panel dd {
  margin: 0 0 4px 150px;
  overflow-wrap: anywhere;
}

.transparent-video-timecode-label {
  z-index: 805;
}

.leaflet-container {
  height: 100% !important;
  min-height: 0;
  background: #eef1eb;
  border: 1px solid #d8ddd0;
}

#heat_map,
#heat_map .html-widget,
#heat_map .leaflet,
.map-wrap > .leaflet,
.map-wrap > .html-widget {
  height: 100% !important;
}

.forecast-image-overlay {
  mix-blend-mode: normal;
}

.small-note,
.popup-note {
  color: #67705f;
  font-size: 12px;
  margin-top: 8px;
}

.diagnostic-footer {
  font-size: 12px;
  color: #4f584c;
  overflow-wrap: anywhere;
}

.public-source-note {
  margin-top: 0;
  padding: 5px 0 0;
  background: #fafbf8;
  border-left: 0;
  border-top: 1px solid #dde0d6;
  font-size: 11px;
  line-height: 1.3;
  color: #4f584c;
}

.control-panel-footer {
  margin-top: auto;
  padding-top: 0;
  flex: 0 0 auto;
}

.control-panel-footer .simulation-toggle-control {
  margin: 0 0 7px;
  padding: 0 0 11px;
  border-bottom: 1px solid #dde0d6;
}

.forecast-disclaimer-note {
  margin-top: 6px;
  color: #687163;
  font-size: 9.5px;
  line-height: 1.28;
}

.forecast-disclaimer-note a {
  color: #3f4b37;
  text-decoration: underline;
}

.diagnostics-panel {
  font-size: 12px;
  color: #4f584c;
}

.diagnostics-panel summary {
  cursor: pointer;
  color: #3f4b37;
  font-weight: 700;
}

#heat_map:has(.leaflet-popup) .heat-risk-legend-control {
  visibility: hidden;
  pointer-events: none;
}

.leaflet-popup-content {
  width: min(440px, calc(100vw - 72px)) !important;
  max-width: calc(100vw - 72px);
  margin: 12px 14px;
  overflow-wrap: anywhere;
}

.camp-popup dl {
  display: grid;
  grid-template-columns: minmax(105px, 132px) minmax(0, 1fr);
  gap: 4px 10px;
  margin: 10px 0;
}

.camp-popup dt {
  font-weight: 700;
  color: #4c5747;
}

.camp-popup dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.camp-popup {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.camp-popup h4 {
  margin: 0 0 8px;
  color: #34422f;
}

.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.camp-popup .popup-title {
  flex: 1 1 230px;
  min-width: 0;
  margin: 0;
}

.popup-risk-badge {
  flex: 0 0 auto;
  margin-top: 1px;
  white-space: nowrap;
}

.popup-mini-plot {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  border: 1px solid #dde0d6;
  overflow: hidden;
}

.popup-downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.popup-downloads a {
  display: inline-block;
  color: white;
  background: #6a785f;
  padding: 5px 9px;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  white-space: normal;
}

.risk-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-size: 12px;
}

.risk-red { background: #c7192f; }
.risk-amber { background: #e68619; }
.risk-neutral { background: #8b9185; }
.risk-missing { background: #787878; }

@media (max-width: 1120px) {
  .main-nav-tabs > .tabbable > .nav-tabs {
    justify-content: flex-start;
    padding: 0 10px;
  }
  .main-nav-tabs > .tabbable > .nav-tabs > li > a {
    padding: 0 14px;
    font-size: 14px;
  }
  .app-shell {
    gap: 10px;
    padding: 10px;
  }
  .control-panel {
    flex-basis: 292px;
    width: 292px;
    max-width: 38vw;
  }
  .summary-strip {
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
  }
  .forecast-fixed-label {
    top: 52px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: min(360px, calc(100% - 140px));
  }
  .map-navigation-controls {
    width: 236px;
    max-width: min(236px, calc(100% - 328px));
  }
  .map-basemap-control {
    width: 142px;
  }
  .map-camp-layer-panel {
    top: 54px;
    right: 12px;
    width: 220px;
  }
  .leaflet-control-affm-camps {
    width: 220px;
    margin-top: 54px;
  }
  .camp-popup {
    max-width: calc(100vw - 72px);
  }
}

@media (max-width: 560px) {
  .affm-topbar {
    min-height: 60px;
    gap: 10px;
    padding: 5px 10px;
  }
  .forecaster-logo {
    height: 46px;
    max-width: 62vw;
    padding: 2px 5px;
  }
  .forecaster-header-tagline {
    font-size: 18px;
  }
  .affm-logo {
    height: 46px;
    max-width: 28vw;
    padding: 2px 5px;
  }
  .main-nav-tabs > .tabbable > .nav-tabs {
    min-height: 52px;
    padding: 0 6px;
  }
  .main-nav-tabs > .tabbable > .nav-tabs > li > a {
    height: 52px;
    padding: 0 10px;
    font-size: 12px;
  }
  .nav-page-shell {
    padding: 14px;
  }
  .nav-page-card {
    padding: 18px;
  }
  .nav-page-card h1 {
    font-size: 22px;
  }
  .summary-strip {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }
  .forecast-summary-copy p {
    display: none;
  }
  .summary-card {
    padding: 7px 9px;
  }
  .summary-card span {
    font-size: 17px;
  }
  .app-shell {
    padding: 8px;
    gap: 8px;
  }
  .control-panel {
    flex-basis: 220px;
    width: 220px;
    max-width: 42vw;
    padding: 10px;
  }
  .leaflet-popup-content {
    width: calc(100vw - 64px) !important;
    max-width: calc(100vw - 64px);
    margin: 10px 12px;
  }
  .camp-popup dl {
    grid-template-columns: 1fr;
  }
  .camp-popup dt {
    margin-top: 5px;
  }
  .map-camp-layer-panel,
  .leaflet-control-affm-camps {
    width: 208px;
    max-width: calc(100vw - 88px);
  }
  .map-navigation-controls {
    top: 10px;
    left: 48px;
    width: 196px;
    max-width: calc(100% - 60px);
  }
  .map-basemap-control {
    width: 132px;
  }
  .map-search-button {
    padding: 3px 6px;
  }
  .forecast-fixed-label {
    top: 84px;
    max-width: calc(100% - 36px);
    font-size: 12px;
    padding: 6px 9px;
  }
  .heat-risk-legend {
    width: min(340px, calc(100vw - 40px));
    max-width: 340px;
  }
  .heat-risk-description {
    white-space: normal;
  }
}
