:root {
  color-scheme: dark;
  --bg: rgba(8, 14, 24, 0.88);
  --border: rgba(120, 170, 255, 0.25);
  --text: #e8eef8;
  --muted: #9db0cc;
  --accent: #5eb3ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #02060f;
  color: var(--text);
}

#globe {
  position: fixed;
  inset: 0;
}

#update-countdown {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.countdown-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown-value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.1;
}

#update-countdown.is-refreshing .countdown-value {
  font-size: 0.92rem;
  color: #ffe066;
}

#panel-toggle,
#panel-backdrop,
#legend-toggle,
#legend-backdrop {
  display: none;
}

#panel-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 12;
  width: auto;
  margin: 0;
  padding: 10px 14px;
  font-weight: 600;
}

#panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.45);
}

#legend-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  width: auto;
  margin: 0;
  padding: 10px 14px;
  font-weight: 600;
}

#legend-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.45);
}

#panel {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  z-index: 10;
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 179, 255, 0.45) rgba(255, 255, 255, 0.06);
}

#panel::-webkit-scrollbar {
  width: 8px;
}

#panel::-webkit-scrollbar-track {
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

#panel::-webkit-scrollbar-thumb {
  background: rgba(94, 179, 255, 0.35);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

#panel::-webkit-scrollbar-thumb:hover {
  background: rgba(94, 179, 255, 0.55);
  border: 2px solid transparent;
  background-clip: padding-box;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden])) #panel {
  max-height: calc(100vh - 58px);
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #panel {
  max-height: calc(100vh - 100px);
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #panel {
  max-height: calc(100vh - 142px);
}

header h1 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

#panel header {
  position: relative;
  padding-right: 36px;
}

#panel-close,
#legend-close {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
}

#legend-close {
  top: 8px;
  right: 8px;
}

.subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

section {
  margin-bottom: 16px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

section:first-of-type {
  border-top: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 0.92rem;
  cursor: pointer;
}

button {
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(94, 179, 255, 0.12);
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

button:hover {
  background: rgba(94, 179, 255, 0.22);
}

.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--text);
}

.field-hint {
  margin: 6px 0 10px;
  font-size: 0.72rem;
  color: var(--muted);
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
}

.search-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-row button {
  width: auto;
  min-width: 64px;
  margin: 0;
  flex: 0 0 auto;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.location-actions button {
  width: auto;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.saved-locations {
  margin: 10px 0 12px;
}

.saved-locations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saved-location-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.saved-location-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  color: var(--text);
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-location-name:hover {
  color: var(--accent);
}

.saved-location-badge {
  flex: 0 0 auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.saved-location-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
}

.saved-location-remove:hover {
  color: #ff8a8a;
  background: rgba(255, 138, 138, 0.12);
}

#alert-notification-status.is-warning {
  color: #ffcc66;
}

#alert-notification-status.is-ready {
  color: #8fd18f;
}

.alert-notification-help {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.alert-notification-help summary {
  cursor: pointer;
  color: var(--accent);
}

.alert-notification-help p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.location-alert-notices {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  width: min(460px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.location-alert-notice {
  position: relative;
  padding: 12px 36px 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 90, 0.55);
  background: rgba(24, 10, 10, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.location-alert-event {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffb4a8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.location-alert-location {
  margin-top: 2px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.location-alert-headline {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #d8dde6;
}

.location-alert-dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.location-alert-dismiss:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.search-error {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #ff8a8a;
}

#btn-home,
#btn-refresh,
#btn-fullscreen {
  margin-top: 6px;
}

#btn-fullscreen[aria-pressed="true"] {
  background: rgba(94, 179, 255, 0.22);
}

.radio-now-playing {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--text);
}

#btn-radio-mute {
  width: auto;
  min-width: 0;
  padding: 4px 10px;
  margin: 4px 0 6px;
  font-size: 0.75rem;
  border-radius: 6px;
}

#btn-radio-mute[aria-pressed="false"] {
  background: rgba(94, 179, 255, 0.22);
  border-color: var(--accent);
}

#status-lines {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

#details-body {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.panel-footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.panel-footer-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(94, 179, 255, 0.1);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.panel-footer-link:hover {
  background: rgba(94, 179, 255, 0.2);
  color: #fff;
}

.panel-footer-note {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.disclaimer-modal[hidden] {
  display: none;
}

.disclaimer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 15, 0.82);
  backdrop-filter: blur(6px);
}

.disclaimer-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: 22px 24px 20px;
  background: rgba(8, 14, 24, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.disclaimer-modal__panel h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: var(--text);
}

.disclaimer-modal__lead {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.disclaimer-modal__list {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.disclaimer-modal__list li {
  margin-bottom: 10px;
}

.disclaimer-modal__list li:last-child {
  margin-bottom: 0;
}

.disclaimer-modal__list strong {
  color: var(--text);
}

.disclaimer-modal__list a {
  color: var(--accent);
}

.disclaimer-modal__fine {
  margin: 0 0 16px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.disclaimer-modal__fine a {
  color: var(--accent);
}

.disclaimer-modal__accept {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

body.disclaimer-open {
  overflow: hidden;
}

.info-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(94, 179, 255, 0.12), transparent 55%),
    #02060f;
}

.info-shell {
  width: min(720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.info-header {
  margin-bottom: 28px;
}

.info-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.info-back:hover {
  color: #fff;
}

.info-header h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

.info-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.info-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-section:last-of-type {
  border-bottom: 0;
}

.info-section h2 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.info-section p,
.info-section li {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.info-section p {
  margin: 0 0 12px;
}

.info-section ul {
  margin: 0 0 12px;
  padding-left: 1.2rem;
}

.info-section li {
  margin-bottom: 8px;
}

.info-section a {
  color: var(--accent);
}

.info-section code {
  font-size: 0.85em;
  color: var(--text);
}

.info-footer {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.info-footer p {
  margin: 0 0 8px;
}

.info-footer a {
  color: var(--accent);
}

.cesium-viewer-bottom,
.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer {
  display: none !important;
}

#precip-legend {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: auto;
  z-index: 10;
  width: min(240px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}

#precip-legend h3 {
  margin: 0 0 2px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.legend-subtitle {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--muted);
}

.legend-scale {
  height: 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.radar-scale {
  background: linear-gradient(
    to right,
    #88ddee 0%,
    #00c800 25%,
    #ffff00 50%,
    #ff9500 68%,
    #ff0000 82%,
    #ff00ff 100%
  );
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 10px;
  font-size: 0.65rem;
  color: var(--muted);
}

.legend-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legend-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 0.75rem;
  color: var(--text);
}

.legend-items .swatch {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#legend-precip-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#precip-legend > div:not([hidden]) + div:not([hidden]) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-fire-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend-fire-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

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

body:has(#alert-tickers .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#alert-tickers .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 52px;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 94px;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 136px;
}

body:has(#location-forecast:not([hidden])) #precip-legend,
body:has(#location-forecast:not([hidden])) #legend-toggle {
  bottom: 168px;
}

body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 210px;
}

body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 252px;
}

body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #precip-legend,
body:has(#location-forecast:not([hidden])):has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #legend-toggle {
  bottom: 294px;
}

#location-forecast {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(920px, calc(100vw - 32px));
  padding: 10px 14px 12px;
  background: rgba(8, 14, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden])) #location-forecast {
  bottom: 54px;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #location-forecast {
  bottom: 96px;
}

body:has(#alert-tickers .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden]) + .alert-ticker-bar:not([hidden])) #location-forecast {
  bottom: 138px;
}

.forecast-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
  text-align: center;
}

.forecast-title {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.forecast-location {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-days {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.forecast-day {
  flex: 1 1 0;
  min-width: 0;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.forecast-day-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.forecast-day-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.forecast-icon {
  width: 34px;
  height: 34px;
  display: block;
  overflow: visible;
}

@keyframes forecast-sun-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.06);
  }
}

@keyframes forecast-sun-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes forecast-cloud-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px);
  }
}

@keyframes forecast-rain-fall {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes forecast-lightning-flash {
  0%,
  78%,
  100% {
    opacity: 0.35;
  }
  80%,
  84% {
    opacity: 1;
  }
  82% {
    opacity: 0.5;
  }
}

@keyframes forecast-snow-fall {
  0% {
    opacity: 0;
    transform: translateY(-2px);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes forecast-fog-drift {
  0%,
  100% {
    opacity: 0.45;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(2px);
  }
}

@keyframes forecast-wind-blow {
  0% {
    opacity: 0.35;
    transform: translateX(-3px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
    transform: translateX(3px);
  }
}

.forecast-icon--sunny .fi-sun-core,
.forecast-icon--partly-cloudy .fi-sun-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: forecast-sun-pulse 3.2s ease-in-out infinite;
}

.forecast-icon--sunny .fi-sun-rays {
  transform-box: fill-box;
  transform-origin: center;
  animation: forecast-sun-spin 18s linear infinite;
}

.forecast-icon--partly-cloudy .fi-sun-rays {
  transform-box: fill-box;
  transform-origin: center;
  animation: forecast-sun-spin 24s linear infinite;
}

.forecast-icon--cloudy .fi-cloud,
.forecast-icon--rain .fi-cloud,
.forecast-icon--thunderstorm .fi-cloud,
.forecast-icon--snow .fi-cloud,
.forecast-icon--partly-cloudy .fi-cloud {
  transform-box: fill-box;
  transform-origin: center;
  animation: forecast-cloud-float 4s ease-in-out infinite;
}

.forecast-icon--rain .fi-rain-drop,
.forecast-icon--thunderstorm .fi-rain-drop {
  transform-box: fill-box;
  transform-origin: center;
}

.forecast-icon--rain .fi-rain-drop:nth-child(1),
.forecast-icon--thunderstorm .fi-rain-drop:nth-child(1) {
  animation: forecast-rain-fall 1.1s ease-in infinite;
}

.forecast-icon--rain .fi-rain-drop:nth-child(2),
.forecast-icon--thunderstorm .fi-rain-drop:nth-child(2) {
  animation: forecast-rain-fall 1.1s ease-in 0.35s infinite;
}

.forecast-icon--rain .fi-rain-drop:nth-child(3) {
  animation: forecast-rain-fall 1.1s ease-in 0.7s infinite;
}

.forecast-icon--thunderstorm .fi-lightning {
  transform-box: fill-box;
  transform-origin: center;
  animation: forecast-lightning-flash 2.8s ease-in-out infinite;
}

.forecast-icon--snow .fi-snow-flake {
  transform-box: fill-box;
  transform-origin: center;
}

.forecast-icon--snow .fi-snow-flake:nth-child(1) {
  animation: forecast-snow-fall 1.8s ease-in infinite;
}

.forecast-icon--snow .fi-snow-flake:nth-child(2) {
  animation: forecast-snow-fall 1.8s ease-in 0.45s infinite;
}

.forecast-icon--snow .fi-snow-flake:nth-child(3) {
  animation: forecast-snow-fall 1.8s ease-in 0.9s infinite;
}

.forecast-icon--fog .fi-fog-line {
  transform-box: fill-box;
  transform-origin: center;
}

.forecast-icon--fog .fi-fog-line:nth-child(1) {
  animation: forecast-fog-drift 3.2s ease-in-out infinite;
}

.forecast-icon--fog .fi-fog-line:nth-child(2) {
  animation: forecast-fog-drift 3.2s ease-in-out 0.5s infinite;
}

.forecast-icon--fog .fi-fog-line:nth-child(3) {
  animation: forecast-fog-drift 3.2s ease-in-out 1s infinite;
}

.forecast-icon--wind .fi-wind-line {
  transform-box: fill-box;
  transform-origin: center;
}

.forecast-icon--wind .fi-wind-line:nth-child(1) {
  animation: forecast-wind-blow 2.2s ease-in-out infinite;
}

.forecast-icon--wind .fi-wind-line:nth-child(2) {
  animation: forecast-wind-blow 2.2s ease-in-out 0.35s infinite;
}

.forecast-icon--wind .fi-wind-line:nth-child(3) {
  animation: forecast-wind-blow 2.2s ease-in-out 0.7s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .forecast-icon *,
  .forecast-icon *::before,
  .forecast-icon *::after {
    animation: none !important;
  }
}

.forecast-day-temp {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.forecast-day-desc {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.forecast-message {
  flex: 1 1 100%;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 769px) {
  #panel-close,
  #legend-close {
    display: block;
  }

  #precip-legend:not([hidden]) {
    padding-top: 36px;
  }

  body.panel-collapsed #panel {
    transform: translateX(calc(-100% - 24px));
    pointer-events: none;
  }

  body.panel-collapsed #panel-toggle {
    display: block;
  }

  body.legend-collapsed #precip-legend:not([hidden]) {
    transform: translateX(calc(100% + 24px));
    pointer-events: none;
  }

  body.legend-collapsed #legend-toggle:not([hidden]) {
    display: block;
  }
}

@media (max-width: 768px) {
  #panel-toggle {
    display: block;
  }

  #panel {
    transform: translateX(calc(-100% - 24px));
    width: min(340px, calc(100vw - 32px));
  }

  #panel-close,
  #legend-close {
    display: block;
  }

  body.panel-open #panel {
    transform: translateX(0);
    z-index: 11;
  }

  body.panel-open #panel-toggle {
    display: none;
  }

  body.panel-open #panel-backdrop {
    display: block;
  }

  #legend-toggle:not([hidden]) {
    display: block;
  }

  #precip-legend:not([hidden]) {
    transform: translateX(calc(100% + 24px));
    transition: transform 0.25s ease;
    width: min(280px, calc(100vw - 32px));
    max-height: min(50vh, calc(100vh - 120px));
    padding-top: 36px;
    pointer-events: none;
  }

  body.legend-open #precip-legend:not([hidden]) {
    transform: translateX(0);
    z-index: 11;
    pointer-events: auto;
  }

  body.legend-open #legend-toggle {
    display: none;
  }

  body.legend-open #legend-backdrop {
    display: block;
  }
}

@media (max-width: 900px) {
  #location-forecast {
    width: calc(100vw - 24px);
  }

  .forecast-days {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .forecast-day {
    flex: 0 0 132px;
    max-width: none;
  }
}

#alert-tickers {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
}

.alert-ticker-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 42px;
  background: rgba(8, 10, 18, 0.92);
  border-top: 1px solid rgba(255, 90, 90, 0.45);
  backdrop-filter: blur(8px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

#hurricane-ticker.alert-ticker-bar {
  border-top-color: rgba(0, 163, 204, 0.5);
}

#tornado-ticker.alert-ticker-bar {
  border-top-color: rgba(180, 70, 255, 0.5);
}

.ticker-badge {
  flex: 0 0 148px;
  width: 148px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #b00020, #ff4d4d);
  white-space: nowrap;
}

.ticker-badge.tornado-badge {
  background: linear-gradient(90deg, #5a0090, #a855f7);
}

.ticker-badge.hurricane-badge {
  background: linear-gradient(90deg, #004080, #00a3cc);
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-viewport::before,
.ticker-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  z-index: 1;
  pointer-events: none;
}

.ticker-viewport::before {
  left: 0;
  background: linear-gradient(90deg, rgba(8, 10, 18, 0.95), transparent);
}

.ticker-viewport::after {
  right: 0;
  background: linear-gradient(270deg, rgba(8, 10, 18, 0.95), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
}

.ticker-copy {
  display: inline-flex;
  align-items: center;
  height: 100%;
  flex: 0 0 auto;
}

.ticker-gap {
  display: inline-block;
  flex: 0 0 auto;
  height: 1px;
}

.ticker-viewport:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px 0 0;
  margin-right: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: var(--text);
}

.ticker-item:last-child {
  border-right: 0;
}

.ticker-event {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ticker-event.severity-extreme {
  color: #ff5c8a;
}

.ticker-event.severity-severe {
  color: #ffb020;
}

.ticker-event.severity-moderate {
  color: #ffe066;
}

.ticker-event.severity-minor {
  color: #9db0cc;
}

.ticker-area {
  color: var(--muted);
}

.ticker-locations {
  color: #f3e8ff;
  font-weight: 500;
}

.ticker-headline {
  color: #d6e4ff;
  font-size: 0.78rem;
}

.ticker-expires {
  color: #8ec5ff;
  font-size: 0.75rem;
}

.ticker-issued {
  color: #d8b4fe;
  font-size: 0.75rem;
}

.ticker-empty {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes ticker-scroll-distance {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--ticker-scroll-end, -50%));
  }
}
