:root {
  color-scheme: light;
  --header-height: 84px;
  --bg: #eef1ee;
  --bg-2: #e5ebe7;
  --panel: rgba(252, 253, 249, 0.96);
  --panel-strong: #fffefa;
  --line: #d1d9d4;
  --line-strong: #a9b6b0;
  --text: #17272d;
  --muted: #53666d;
  --subtle: #78878c;
  --accent: #155f78;
  --accent-2: #268b88;
  --warning: #d89b2b;
  --flood: #c54b3c;
  --extreme: #7a1f2b;
  --normal: #2f7f8f;
  --nodata: #97a3a8;
  --ok: #2f7f8f;
  --shadow: 0 14px 34px rgba(27, 45, 50, 0.1);
  --shadow-soft: 0 4px 14px rgba(27, 45, 50, 0.07);
  --radius: 12px;
  --motion-fast: 140ms;
  --motion-standard: 220ms;
  --motion-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-exit: cubic-bezier(0.4, 0, 1, 1);
  --skeleton-base: rgba(31, 94, 122, 0.08);
  --skeleton-highlight: rgba(255, 255, 255, 0.72);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  max-width: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(38, 139, 136, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(21, 95, 120, 0.06), transparent 30%),
    repeating-linear-gradient(
      165deg,
      rgba(21, 95, 120, 0.025) 0,
      rgba(21, 95, 120, 0.025) 1px,
      transparent 2px,
      transparent 18px
    ),
    linear-gradient(180deg, #f5f6f2, var(--bg));
  font-family: "Source Sans 3", sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1200;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 249, 245, 0.94);
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 2px;
}

.brand-mark img,
.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-copy strong {
  font-family: "Fraunces", serif;
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.93rem;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.date-navigator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 252, 0.9);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.date-control {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(154px, 1fr);
  align-items: center;
  gap: 2px 10px;
  min-width: 260px;
}

.date-control-heading {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.date-picker-row {
  display: block;
  min-width: 0;
}

.date-control input[type="date"],
.search-input,
select,
.toolbar-button,
.download-button,
.date-step-button,
.lang-button,
.range-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 252, 0.98);
  color: var(--text);
}

.date-control input[type="date"],
.search-input,
select {
  padding: 0 12px;
}

select {
  width: 100%;
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 6.75 9 11.25l4.5-4.5' fill='none' stroke='%235b6a71' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.toolbar-button,
.download-button,
.date-step-button,
.lang-button,
.range-button {
  padding: 0 14px;
  font-weight: 700;
  transition:
    transform var(--motion-fast) var(--motion-enter),
    border-color var(--motion-fast) var(--motion-enter),
    box-shadow var(--motion-fast) var(--motion-enter),
    background-color var(--motion-fast) var(--motion-enter),
    color var(--motion-fast) var(--motion-enter);
}

.toolbar-button:active,
.download-button:active,
.date-step-button:active,
.lang-button:active,
.range-button:active {
  transform: scale(0.98);
}

.lang-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-code {
  letter-spacing: 0.04em;
}

.date-control input[type="date"] {
  width: 100%;
  min-width: 154px;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 700;
}

.date-step-button {
  width: 36px;
  min-width: 36px;
  min-height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-size: 1.7rem;
  font-weight: 400;
  background: transparent;
}

.date-timeline {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
  padding-top: 2px;
}

.date-scrubber {
  --timeline-progress: 0%;
  appearance: none;
  width: 100%;
  height: 12px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) 0 var(--timeline-progress), rgba(21, 95, 120, 0.14) var(--timeline-progress) 100%) center / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 21px, rgba(21, 95, 120, 0.18) 21px 22px) center / 100% 10px no-repeat;
  cursor: ew-resize;
}

.date-scrubber::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 3px 8px rgba(21, 95, 120, 0.28);
}

.date-scrubber::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 3px 8px rgba(21, 95, 120, 0.28);
}

.date-timeline-limits {
  display: flex;
  justify-content: space-between;
  color: var(--subtle);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1;
}

.toolbar-button:hover,
.download-button:hover,
.date-step-button:hover,
.lang-button:hover,
.range-button:hover,
.toolbar-button:focus-visible,
.download-button:focus-visible,
.date-step-button:focus-visible,
.lang-button:focus-visible,
.range-button:focus-visible,
.search-input:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 94, 122, 0.12);
}

.date-step-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.lang-button.active,
.range-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.language-switch,
.range-buttons {
  display: inline-flex;
  gap: 6px;
}

.actions-menu {
  position: relative;
}

.actions-menu summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.96);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition:
    border-color var(--motion-fast) var(--motion-enter),
    box-shadow var(--motion-fast) var(--motion-enter),
    background-color var(--motion-fast) var(--motion-enter);
}

.actions-menu summary::-webkit-details-marker {
  display: none;
}

.actions-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.actions-menu-icon {
  display: none;
  letter-spacing: 0.08em;
}

.actions-menu[open] summary,
.actions-menu summary:hover,
.actions-menu summary:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 95, 120, 0.1);
  outline: none;
}

.actions-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1400;
  display: grid;
  width: 210px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(252, 253, 249, 0.98);
  box-shadow: 0 18px 44px rgba(23, 39, 45, 0.18);
  transform-origin: top right;
  animation: menu-enter var(--motion-fast) var(--motion-enter) both;
}

.actions-menu-panel .toolbar-button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  text-align: left;
  box-shadow: none;
}

.actions-menu-panel .toolbar-button:hover,
.actions-menu-panel .toolbar-button:focus-visible {
  background: rgba(21, 95, 120, 0.08);
  box-shadow: none;
}

@keyframes menu-enter {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-shell {
  height: 100vh;
  padding-top: var(--header-height);
  display: grid;
  grid-template-columns: clamp(340px, 25vw, 420px) minmax(360px, 1fr) clamp(460px, 31vw, 580px);
}

.app-progress {
  position: fixed;
  top: var(--header-height);
  right: 0;
  left: 0;
  z-index: 1250;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 5px 14px;
  background: rgba(247, 242, 231, 0.96);
  box-shadow: 0 8px 18px rgba(29, 43, 49, 0.08);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity var(--motion-fast) var(--motion-enter),
    transform var(--motion-fast) var(--motion-enter);
}

.app-progress.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-progress-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 94, 122, 0.12);
}

.app-progress-track > span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  transition: transform var(--motion-standard) var(--motion-enter);
}

.app-progress.indeterminate .app-progress-track > span {
  transform-origin: center;
  animation: progress-indeterminate 1.1s linear infinite;
}

.app-progress strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes progress-indeterminate {
  0% { transform: translateX(-70%) scaleX(0.24); }
  50% { transform: translateX(0) scaleX(0.58); }
  100% { transform: translateX(70%) scaleX(0.24); }
}

.async-region {
  position: relative;
}

.async-region.is-loading {
  overflow: hidden;
}

.async-region.is-loading:not(.station-list-card)::after,
.chart-card.chart-pending .chart-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 950;
  border-radius: inherit;
  background:
    linear-gradient(100deg, transparent 20%, var(--skeleton-highlight) 42%, transparent 64%) -120% 0 / 65% 100% no-repeat,
    repeating-linear-gradient(180deg, var(--skeleton-base) 0 16px, transparent 16px 30px),
    rgba(255, 252, 245, 0.9);
  animation: skeleton-shimmer 1.25s linear infinite;
}

.chart-card.chart-ready .chart-wrap {
  animation: chart-enter var(--motion-standard) var(--motion-enter) both;
}

@keyframes chart-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-stage.is-loading::after {
  background:
    linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.52) 42%, transparent 64%) -120% 0 / 65% 100% no-repeat,
    radial-gradient(circle at 30% 36%, rgba(46, 139, 139, 0.16), transparent 24%),
    repeating-linear-gradient(155deg, rgba(31, 94, 122, 0.08) 0 2px, transparent 2px 28px),
    #e8eee9;
}

.chart-card.chart-pending .chart-wrap::after {
  inset: 0;
  border: 1px solid rgba(188, 174, 151, 0.45);
  background:
    linear-gradient(100deg, transparent 20%, var(--skeleton-highlight) 42%, transparent 64%) -120% 0 / 65% 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 42px, rgba(31, 94, 122, 0.08) 42px 43px),
    rgba(255, 252, 245, 0.92);
}

@keyframes skeleton-shimmer {
  to { background-position: 220% 0, 0 0, 0 0; }
}

.station-skeleton {
  height: 118px;
  border-radius: 14px;
  background:
    linear-gradient(100deg, transparent 20%, var(--skeleton-highlight) 42%, transparent 64%) -120% 0 / 65% 100% no-repeat,
    linear-gradient(var(--skeleton-base), var(--skeleton-base)) 12px 14px / 54% 14px no-repeat,
    linear-gradient(var(--skeleton-base), var(--skeleton-base)) 12px 42px / 74% 11px no-repeat,
    linear-gradient(var(--skeleton-base), var(--skeleton-base)) 12px 68px / 62% 10px no-repeat,
    rgba(31, 94, 122, 0.04);
  animation: skeleton-shimmer 1.25s linear infinite;
}

.load-more-button {
  width: 100%;
  margin-top: 12px;
}

body.app-ready .sidebar,
body.app-ready .map-stage,
body.app-ready .detail-panel {
  animation: region-enter var(--motion-standard) var(--motion-enter) both;
}

body.app-ready .map-stage { animation-delay: 35ms; }
body.app-ready .detail-panel { animation-delay: 70ms; }

@keyframes region-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.sidebar,
.detail-panel {
  min-width: 0;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 14px;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(246, 248, 244, 0.76);
}

.detail-panel {
  border-left: 1px solid var(--line);
}

.map-stage {
  position: relative;
  min-width: 0;
}

#map {
  width: 100%;
  height: calc(100vh - var(--header-height));
}

.hero-card,
.fatal-card,
.control-card,
.station-list-card,
.floating-card,
.status-card,
.metadata-card,
.chart-card,
.event-card,
.qa-card,
.dataset-card,
.stats-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

.hero-card,
.fatal-card,
.control-card,
.station-list-card,
.status-card,
.metadata-card,
.chart-card,
.event-card,
.qa-card,
.dataset-card {
  padding: 15px;
}

.hero-card {
  background:
    linear-gradient(135deg, rgba(21, 95, 120, 0.09), rgba(38, 139, 136, 0.03)),
    var(--panel-strong);
  border-top: 3px solid var(--accent);
}

.fatal-card {
  margin-top: 12px;
  border-color: rgba(197, 75, 60, 0.32);
  background: rgba(255, 248, 244, 0.98);
}

.fatal-card h2 {
  margin-bottom: 8px;
}

.fatal-card p {
  color: var(--muted);
  line-height: 1.45;
}

.fatal-card pre {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(188, 174, 151, 0.82);
  background: rgba(255, 252, 245, 0.98);
  color: var(--text);
  overflow-x: auto;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
}

h1 {
  margin-top: 10px;
  font-size: 1.86rem;
  line-height: 1.08;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 1rem;
}

.hero-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr) minmax(0, 1.05fr);
  gap: 8px;
  margin: 12px 0;
}

.stats-grid article {
  padding: 12px;
  min-width: 0;
}

.stats-grid span,
.selected-metrics span,
.status-grid span,
.dataset-metrics span,
.metadata-grid dt {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stats-grid strong,
.selected-metrics strong,
.status-grid strong,
.dataset-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 1.03rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.stat-range strong {
  font-size: 0.97rem;
  line-height: 1.3;
}

.control-head,
.section-head,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-button {
  white-space: nowrap;
}

.control-head {
  margin-bottom: 12px;
}

.control-card label,
.date-control,
.filter-grid label {
  display: grid;
  gap: 5px;
}

.control-card label span,
.filter-grid label span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-span-2 {
  grid-column: 1 / -1;
}

.station-list {
  display: grid;
  gap: 6px;
}

.station-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 252, 0.72);
  padding: 11px 12px;
  text-align: left;
  transition:
    transform var(--motion-fast) var(--motion-enter),
    border-color var(--motion-fast) var(--motion-enter),
    box-shadow var(--motion-fast) var(--motion-enter);
}

.station-item:hover,
.station-item:focus-visible,
.station-item.active {
  border-color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 4px 14px rgba(21, 95, 120, 0.08);
  outline: none;
}

.station-item.active {
  background: rgba(21, 95, 120, 0.07);
  box-shadow: inset 3px 0 0 var(--accent);
}

.station-item strong {
  display: block;
  font-size: 0.98rem;
}

.station-item small,
.station-item .station-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.station-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.pill.subtle {
  background: rgba(31, 94, 122, 0.08);
  color: var(--accent);
}

.status-pill.normal {
  background: rgba(47, 127, 143, 0.12);
  color: var(--normal);
}

.status-pill.warning {
  background: rgba(216, 155, 43, 0.15);
  color: #8c6200;
}

.status-pill.flooded {
  background: rgba(197, 75, 60, 0.14);
  color: var(--flood);
}

.status-pill.extreme_flooding {
  background: rgba(122, 31, 43, 0.14);
  color: var(--extreme);
}

.status-pill.no_data {
  background: rgba(151, 163, 168, 0.18);
  color: #58656a;
}

.floating-card {
  position: absolute;
  z-index: 700;
  padding: 16px;
  border: 0;
  box-shadow: var(--shadow);
}

.selected-card {
  top: 18px;
  left: 18px;
  width: min(360px, calc(100% - 36px));
  border-top: 3px solid var(--accent);
}

.legend-card {
  right: 18px;
  bottom: 18px;
  width: min(300px, calc(100% - 36px));
}

.selected-card p {
  margin-top: 6px;
  color: var(--muted);
}

.selected-metrics,
.status-grid,
.dataset-metrics,
.event-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.legend-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.legend-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.detail-panel {
  background: rgba(246, 248, 244, 0.74);
}

.tabbar {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(229, 235, 231, 0.78);
}

.tabbar button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 700;
}

.tabbar button.active {
  background: var(--panel-strong);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.panel-view {
  display: none;
}

.panel-view.active {
  display: grid;
  gap: 14px;
  animation: panel-enter var(--motion-standard) var(--motion-enter) both;
}

.daily-analysis-panel {
  align-content: start;
}

.daily-analysis-header {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(47, 127, 143, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 18%, rgba(216, 155, 43, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(47, 127, 143, 0.13), rgba(255, 252, 245, 0.88) 58%);
  box-shadow: var(--shadow-soft);
}

.daily-analysis-header::after {
  position: absolute;
  right: -28px;
  bottom: -40px;
  width: 150px;
  height: 92px;
  border: 2px solid rgba(47, 127, 143, 0.14);
  border-radius: 50%;
  content: "";
  transform: rotate(-12deg);
}

.daily-analysis-header h2 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.daily-analysis-header p {
  max-width: 700px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.daily-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.daily-summary-grid article {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.daily-summary-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.daily-summary-grid strong {
  align-self: end;
  color: var(--text);
  font-family: "Fraunces", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.daily-summary-grid .daily-summary-alert {
  border-color: rgba(197, 75, 60, 0.28);
  background: linear-gradient(145deg, rgba(197, 75, 60, 0.1), rgba(255, 252, 245, 0.98) 72%);
}

.daily-summary-alert strong {
  color: var(--flood);
}

.daily-analysis-card {
  min-width: 0;
}

.daily-condition-wrap {
  height: 260px;
}

.daily-spatial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.daily-spatial-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(188, 174, 151, 0.62);
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.62);
}

.daily-spatial-grid h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.92rem;
}

.daily-spatial-wrap {
  height: 250px;
}

.daily-state-table th,
.daily-state-table td {
  padding: 11px 12px;
}

.daily-share-cell {
  display: grid;
  grid-template-columns: 52px minmax(74px, 1fr);
  gap: 10px;
  align-items: center;
}

.daily-share-cell > span {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(197, 75, 60, 0.12);
}

.daily-share-cell i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warning), var(--flood), var(--extreme));
}

.daily-empty-note {
  margin: 14px 0 0;
  color: var(--muted);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head p,
.section-head span {
  color: var(--muted);
}

.download-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.metadata-grid {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metadata-grid div {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(188, 174, 151, 0.8);
}

.metadata-grid dd {
  margin: 4px 0 0;
  font-weight: 700;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.chart-wrap {
  position: relative;
  margin-top: 0;
  padding: 12px 10px 8px;
  min-height: 260px;
  background:
    linear-gradient(180deg, rgba(21, 95, 120, 0.025), transparent 36%),
    #fff;
}

.chart-card {
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.chart-card > .section-head {
  min-height: 58px;
  padding: 13px 15px 12px;
  border-bottom: 1px solid rgba(35, 56, 63, 0.09);
  background: rgba(248, 250, 247, 0.82);
}

.chart-card > .section-head h3 {
  color: var(--text);
  letter-spacing: -0.01em;
}

.chart-card > .section-head span {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.chart-card > .evidence-summary,
.chart-card > .seasonality-summary {
  margin: 0;
  padding: 11px 15px 0;
  font-size: 0.86rem;
}

.chart-wrap canvas {
  max-width: 100%;
}

.evidence-wrap {
  min-height: 280px;
}

.chart-empty {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(188, 174, 151, 0.9);
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.72);
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.chart-empty[hidden] {
  display: none !important;
}

.seasonality-wrap {
  min-height: 210px;
}

.seasonality-summary {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.evidence-summary {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.table-wrap {
  margin-top: 12px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.event-card table {
  min-width: 540px;
}

th,
td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(188, 174, 151, 0.62);
  text-align: left;
  font-size: 0.8rem;
  white-space: nowrap;
}

th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.event-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.event-metrics div,
.qa-overview div {
  padding: 12px 14px;
  border: 1px solid rgba(188, 174, 151, 0.78);
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.72);
}

.event-metrics span,
.qa-overview span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.event-metrics strong,
.qa-overview strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.qa-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.qa-overview .caution-low {
  background: rgba(47, 127, 143, 0.09);
  border-color: rgba(47, 127, 143, 0.3);
}

.qa-overview .caution-medium {
  background: rgba(216, 155, 43, 0.11);
  border-color: rgba(216, 155, 43, 0.28);
}

.qa-overview .caution-high {
  background: rgba(197, 75, 60, 0.11);
  border-color: rgba(197, 75, 60, 0.24);
}

.qa-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.qa-flags li {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 94, 122, 0.16);
  background: rgba(31, 94, 122, 0.08);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
}

.qa-flags li.flag-good {
  background: rgba(47, 127, 143, 0.12);
  border-color: rgba(47, 127, 143, 0.22);
  color: var(--normal);
}

.qa-flags li.flag-caution {
  background: rgba(216, 155, 43, 0.14);
  border-color: rgba(216, 155, 43, 0.28);
  color: #8c6200;
}

.qa-flags li.flag-high {
  background: rgba(197, 75, 60, 0.14);
  border-color: rgba(197, 75, 60, 0.24);
  color: var(--flood);
}

.qa-image-wrap {
  margin-top: 14px;
}

.qa-image-shell {
  padding: 12px;
  border: 1px solid rgba(188, 174, 151, 0.82);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(31, 94, 122, 0.05), rgba(216, 155, 43, 0.04)),
    rgba(255, 252, 245, 0.9);
}

.qa-image-wrap img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}

.qa-image-wrap p {
  margin-top: 10px;
}

.image-expand-button {
  margin-top: 10px;
}

#qaImageCaption {
  font-size: 0.9rem;
}

.qa-image-wrap p {
  color: var(--muted);
}

.qa-subpanels {
  margin-top: 18px;
}

.qa-subpanels h4 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 0.98rem;
}

.qa-subpanels .section-head span {
  display: block;
  margin-top: 4px;
  line-height: 1.42;
}

.qa-subpanel-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.qa-subpanel-card {
  padding: 14px;
  border: 1px solid rgba(188, 174, 151, 0.78);
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.76);
}

.qa-subpanel-card h5 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
  font-size: 0.96rem;
}

.qa-subpanel-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  aspect-ratio: 2148 / 1419;
}

.qa-subpanel-frame img {
  position: absolute;
  inset: 0 auto auto 0;
  width: 200%;
  height: 200%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #fff;
  cursor: default;
}

.qa-subpanel-top-left img {
  transform: translate(0, 0);
}

.qa-subpanel-top-right img {
  transform: translate(-50%, 0);
}

.qa-subpanel-bottom-left img {
  transform: translate(0, -50%);
}

.qa-subpanel-bottom-right img {
  transform: translate(-50%, -50%);
}

.dataset-metrics {
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dataset-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.dataset-breakdown article {
  padding: 14px 16px;
  border: 1px solid rgba(188, 174, 151, 0.78);
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.76);
}

.dataset-breakdown h4 {
  margin: 0 0 6px;
  font-family: "Fraunces", serif;
  font-size: 0.96rem;
}

.dataset-breakdown p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.prose-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.caution-card {
  background: linear-gradient(135deg, rgba(122, 31, 43, 0.05), rgba(216, 155, 43, 0.05)), var(--panel);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(14px);
  z-index: 1400;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(29, 43, 49, 0.94);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--motion-fast) var(--motion-enter),
    transform var(--motion-fast) var(--motion-enter);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.modal-open {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--motion-exit);
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transition-timing-function: var(--motion-enter);
}

.overlay[hidden] {
  display: none !important;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 43, 49, 0.54);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--motion-fast) var(--motion-enter);
}

.overlay.is-open .overlay-backdrop {
  opacity: 1;
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(188, 174, 151, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(31, 94, 122, 0.08), rgba(216, 155, 43, 0.04)),
    rgba(255, 252, 245, 0.98);
  box-shadow: 0 28px 70px rgba(22, 31, 34, 0.24);
  opacity: 0;
  transform: translateY(8px);
  filter: blur(3px);
  transition:
    opacity var(--motion-standard) var(--motion-enter),
    transform var(--motion-standard) var(--motion-enter),
    filter var(--motion-standard) var(--motion-enter);
}

.overlay.is-open .overlay-panel {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.98);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

.overlay-close:hover,
.overlay-close:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 94, 122, 0.12);
}

.theory-panel h2,
.layers-panel h2,
.image-panel h2 {
  margin-top: 8px;
  font-size: 1.7rem;
}

.theory-panel p,
.layers-panel p,
.image-panel p {
  color: var(--muted);
  line-height: 1.52;
}

.theory-lead {
  margin-top: 12px;
  font-size: 1rem;
}

.theory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.theory-step,
.theory-note,
.theory-status-card {
  border: 1px solid rgba(188, 174, 151, 0.82);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.78);
  padding: 16px;
}

.theory-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.theory-step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(31, 94, 122, 0.12);
  color: var(--accent);
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.theory-step h3,
.theory-status-card h3,
.theory-note h3 {
  margin: 0;
  font-size: 1rem;
}

.theory-step p,
.theory-note p,
.theory-status-card p {
  margin-top: 8px;
}

.theory-status-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.theory-status-list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.theory-status-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
}

.theory-status-list strong {
  display: block;
  font-size: 0.94rem;
}

.theory-status-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.42;
}

.theory-note {
  margin-top: 14px;
}

.guide-panel {
  width: min(1120px, calc(100vw - 40px));
  padding: 28px 28px 24px;
}

.guide-shell {
  display: grid;
  gap: 24px;
}

.guide-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 48px;
}

.guide-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(31, 94, 122, 0.2);
  border-radius: 999px;
  background: rgba(31, 94, 122, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-progress {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-dot {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(91, 106, 113, 0.32);
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.96);
  transition:
    transform var(--motion-fast) var(--motion-enter),
    background-color var(--motion-fast) var(--motion-enter),
    border-color var(--motion-fast) var(--motion-enter);
}

.guide-dot.active {
  width: 34px;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(31, 94, 122, 0.2);
}

.guide-dot:hover,
.guide-dot:focus-visible {
  outline: none;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.guide-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.94fr);
  gap: 24px;
  align-items: start;
}

.guide-copy {
  min-width: 0;
}

.guide-eyebrow {
  margin-top: 2px;
}

.guide-panel h2 {
  margin: 12px 0 0;
  font-size: clamp(2.05rem, 3vw, 2.95rem);
  line-height: 1.04;
}

.guide-panel h2:focus {
  outline: none;
}

.guide-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.62;
}

.guide-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.guide-highlight-card,
.guide-class-card {
  border: 1px solid rgba(188, 174, 151, 0.82);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.78);
  padding: 16px;
}

.guide-highlight-card h3,
.guide-class-card strong {
  margin: 0;
  font-size: 1rem;
}

.guide-highlight-card p,
.guide-class-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.guide-class-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.guide-class-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-class-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
}

.guide-step-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 94, 122, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: rgba(31, 94, 122, 0.07);
  color: var(--muted);
  line-height: 1.52;
}

.guide-visual-card {
  margin: 0;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(188, 174, 151, 0.82);
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(46, 139, 139, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(31, 94, 122, 0.06), rgba(216, 155, 43, 0.04)),
    rgba(255, 252, 245, 0.98);
  box-shadow: var(--shadow);
}

.guide-visual-card[data-mode="lockup"] {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px;
}

.guide-lockup {
  display: block;
  width: min(100%, 720px);
  height: auto;
}

.guide-visual-image {
  width: 100%;
  min-height: 300px;
  max-height: 455px;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.guide-visual-card figcaption {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.guide-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.guide-footer .toolbar-button {
  min-height: 46px;
  padding-inline: 18px;
}

.guide-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.guide-primary:hover,
.guide-primary:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 94, 122, 0.14);
}

.guide-prev-button:disabled,
.guide-tertiary:disabled,
.guide-footer .toolbar-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.layers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.layers-group {
  border: 1px solid rgba(188, 174, 151, 0.82);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.78);
  padding: 16px;
}

.layers-group h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.layer-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
}

.layer-option + .layer-option {
  border-top: 1px dashed rgba(188, 174, 151, 0.8);
}

.layer-option input {
  margin-top: 2px;
}

.layer-option strong,
.layer-option span {
  display: block;
}

.layer-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.42;
}

.image-panel {
  width: min(1080px, calc(100vw - 40px));
}

.image-panel img {
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 252, 245, 0.98);
  color: var(--text);
}

.leaflet-container {
  font-family: "Source Sans 3", sans-serif;
}

.marker-popup strong {
  display: block;
  margin-bottom: 4px;
}

.marker-popup small {
  color: var(--muted);
}

@media (max-width: 1220px) {
  .brand-copy small {
    display: none;
  }

  .app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: calc(100vh - var(--header-height)) calc(100vh - var(--header-height));
  }

  .detail-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid rgba(188, 174, 151, 0.7);
  }
}

@media (max-width: 920px) {
  .topbar {
    position: sticky;
    height: auto;
    padding: 10px 14px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    flex-wrap: wrap;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .date-navigator {
    grid-column: 1 / -1;
    width: 100%;
  }

  .date-control {
    min-width: 0;
    flex: 1 1 auto;
  }

  .language-switch {
    grid-column: 1;
  }

  #theoryButton {
    grid-column: 2;
    justify-self: start;
  }

  .actions-menu {
    grid-column: 3;
    justify-self: end;
  }

  .lang-button,
  #theoryButton,
  .actions-menu summary {
    min-height: 38px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .lang-button {
    gap: 5px;
  }

  .actions-menu-panel {
    position: fixed;
    top: 158px;
    right: 12px;
    left: 12px;
    width: auto;
    transform-origin: top center;
  }

  .date-control input {
    width: 100%;
    min-width: 0;
  }

  .date-control input[type="date"] {
    width: 100%;
    min-width: 0;
  }

  .app-shell {
    height: auto;
    padding-top: 0;
    display: block;
    max-width: 100%;
    overflow-x: clip;
  }

  .app-progress {
    top: 0;
  }

  .sidebar,
  .detail-panel,
  #map {
    height: auto;
    width: 100%;
    min-width: 0;
  }

  .panel-view,
  .panel-view > *,
  .panel-head,
  .section-head,
  .table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .panel-head,
  .section-head {
    flex-wrap: wrap;
  }

  .panel-actions,
  .section-actions {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .map-stage {
    height: 74vh;
  }

  #map {
    height: 74vh;
  }

  .floating-card {
    position: absolute;
    width: min(290px, calc(100% - 24px));
  }

  .selected-card {
    top: 12px;
    left: 12px;
  }

  .legend-card {
    right: 12px;
    bottom: 12px;
  }

  .metadata-grid,
  .filter-grid,
  .selected-metrics,
  .status-grid,
  .dataset-metrics,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .tabbar button {
    min-width: 0;
    padding-inline: 8px;
  }

  .daily-spatial-grid {
    grid-template-columns: 1fr;
  }

  .event-metrics,
  .qa-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 18px 16px 12px;
  }

  .guide-header-row {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 44px;
  }

  .guide-progress {
    justify-content: flex-start;
  }

  .guide-content {
    grid-template-columns: 1fr;
    padding-bottom: 84px;
  }

  .guide-highlight-grid {
    grid-template-columns: 1fr;
  }

  .guide-visual-card {
    min-height: 0;
  }

  .guide-visual-image {
    min-height: 220px;
    max-height: 300px;
  }

  .guide-footer {
    position: sticky;
    bottom: -12px;
    margin: 0 -16px -12px;
    padding: 12px 16px 0;
    flex-direction: column;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(247, 242, 231, 0), rgba(247, 242, 231, 0.96) 36%);
  }

  .guide-footer-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
  }

  .guide-footer .toolbar-button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .actions-menu-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .actions-menu-icon {
    display: inline;
  }

  .actions-menu summary::after {
    display: none;
  }

  .hero-card h1 {
    font-size: 1.7rem;
    overflow-wrap: anywhere;
  }

  .event-metrics,
  .qa-overview,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .daily-analysis-header {
    padding: 18px;
  }

  .daily-summary-grid {
    grid-template-columns: 1fr;
  }

  .daily-summary-grid article {
    min-height: 76px;
  }

  .daily-condition-wrap,
  .daily-spatial-wrap {
    height: 235px;
  }

  .daily-state-table-wrap {
    overflow: visible;
  }

  .daily-state-table {
    display: block;
    min-width: 0;
    font-size: 0.78rem;
  }

  .daily-state-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .daily-state-table tbody {
    display: grid;
    gap: 10px;
  }

  .daily-state-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 252, 245, 0.72);
  }

  .daily-state-table td {
    display: grid;
    gap: 3px;
    padding: 0;
    border: 0;
  }

  .daily-state-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .daily-share-cell {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .layers-grid,
  .theory-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .brand-copy strong {
    font-size: 1.14rem;
  }

  .brand-copy small {
    white-space: normal;
    line-height: 1.24;
    font-size: 0.84rem;
  }

  .guide-panel h2 {
    font-size: 1.72rem;
  }

  .guide-dot.active {
    width: 28px;
  }

  .guide-highlight-card,
  .guide-class-card {
    padding: 14px;
  }

  .guide-visual-image {
    max-height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .toolbar-button:active,
  .download-button:active,
  .date-step-button:active,
  .lang-button:active,
  .range-button:active {
    transform: none;
  }
}
