:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --panel: rgba(248, 248, 247, 0.94);
  --panel-light: rgba(255, 255, 255, 0.9);
  --line: rgba(35, 35, 37, 0.12);
  --muted: #6f7074;
  --text: #242426;
  --accent: #ff8a1f;
  --accent-strong: #ff7018;
  --accent-soft: rgba(255, 138, 31, 0.12);
  --focus: #a94700;
  --cyan: var(--accent);
  --blue: var(--accent-strong);
  --map-background: #5b5b5e;
  --map-label-country: rgba(31, 31, 32, 0.92);
  --map-label-state: rgba(48, 48, 50, 0.86);
  --map-label-city: rgba(27, 27, 28, 0.94);
  --map-label-city-dot: rgba(31, 31, 32, 0.92);
  --range-start: #ff9a22;
  --range-end: #ff7018;
  --range-track: rgba(35, 35, 37, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #4d4d50;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 620px;
  isolation: isolate;
  color: var(--text);
}

.map-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #5b5b5e;
}

#mapDiv {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #5b5b5e;
}

#mapDiv.weather-point-query-enabled,
#mapDiv.weather-point-query-enabled .tdt-map-pane {
  cursor: crosshair !important;
}

#mapDiv .tdt-image-layer {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

#mapDiv .map-boundary-layer {
  filter: sepia(1) saturate(1.65) hue-rotate(348deg) brightness(1.08);
}

#mapDiv .cesium-viewer,
#mapDiv .cesium-viewer-cesiumWidgetContainer,
#mapDiv .cesium-widget,
#mapDiv .cesium-widget canvas {
  width: 100%;
  height: 100%;
}

#mapDiv .cesium-viewer-bottom,
#mapDiv .cesium-viewer-toolbar,
#mapDiv .cesium-viewer-animationContainer,
#mapDiv .cesium-viewer-timelineContainer,
#mapDiv .cesium-viewer-fullscreenContainer {
  display: none !important;
}

.map-shade {
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 74%, rgba(24, 24, 26, 0.1) 100%),
    radial-gradient(circle at 50% 48%, transparent 42%, rgba(25, 25, 27, 0.06) 100%);
  pointer-events: none;
}

#windCanvas {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.96;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 220ms ease;
  will-change: opacity;
  contain: paint;
}

#windCanvas.hidden {
  opacity: 0;
}

/* 海岸线由天地图的原生动画同步变换；仅暂停其他非关键装饰层。 */
.app-shell.map-interacting #mapDiv .map-boundary-layer {
  filter: none;
}

.app-shell.map-interacting #mapDiv .map-decoration-overlay {
  visibility: hidden;
}

.app-shell.map-zooming.coastline-render-after-zoom #mapDiv .map-coastline-overlay {
  visibility: hidden;
}

.app-shell.map-interacting #windCanvas {
  opacity: 0;
  mix-blend-mode: normal;
  transition: none;
}

.map-source {
  position: absolute;
  z-index: 5;
  left: 24px;
  bottom: 103px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 7px;
  color: #68686b;
  background: rgba(248, 248, 247, 0.86);
  box-shadow: 0 8px 22px rgba(25, 25, 27, 0.12);
  font-size: 8px;
  letter-spacing: 0.05em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.data-notice {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--text);
  text-align: center;
  background: rgba(246, 246, 244, 0.97);
  pointer-events: none;
}

.data-notice[hidden] {
  display: none;
}

.data-notice strong,
.data-notice span {
  width: max-content;
  max-width: calc(100vw - 48px);
  margin: 0 auto;
  padding: 0 14px;
}

.data-notice strong {
  font-size: 15px;
}

.data-notice span {
  color: var(--muted);
  font-size: 10px;
}

.weather-query-marker {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: var(--weather-query-marker-size, 9px);
  height: var(--weather-query-marker-size, 9px);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 138, 31, 0.22), 0 3px 10px rgba(53, 31, 12, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 140ms ease, height 140ms ease, opacity 140ms ease;
}

.weather-query-marker[hidden] {
  display: none;
}

.weather-query-card {
  --weather-query-anchor-x: 50%;
  position: absolute;
  z-index: 12;
  width: min(200px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(240, 240, 238, 0.94));
  box-shadow: 0 20px 52px rgba(24, 24, 26, 0.22);
  backdrop-filter: blur(18px);
}

.weather-query-card::after {
  position: absolute;
  left: var(--weather-query-anchor-x);
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(35, 35, 37, 0.13);
  border-bottom: 1px solid rgba(35, 35, 37, 0.13);
  background: #f1f1ef;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.weather-query-card.below-marker::after {
  top: -7px;
  bottom: auto;
  border: 0;
  border-top: 1px solid rgba(35, 35, 37, 0.13);
  border-left: 1px solid rgba(35, 35, 37, 0.13);
}

.weather-query-card[hidden] {
  display: none;
}

.weather-query-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 1px 10px;
  border-bottom: 1px solid var(--line);
}

.weather-query-head h2,
.weather-query-head p {
  margin: 0;
}

.weather-query-head h2 {
  color: #242426;
  font-size: 15px;
  line-height: 1.35;
}

.weather-query-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

#weatherQueryClose {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #77777a;
  background: transparent;
  font-size: 22px;
  font-weight: 300;
  line-height: 24px;
  cursor: pointer;
}

#weatherQueryClose:hover {
  color: #242426;
  background: rgba(35, 35, 37, 0.07);
}

.weather-query-fields {
  display: grid;
  gap: 8px;
  padding-top: 11px;
}

.weather-query-field {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
}

.weather-query-field[hidden] {
  display: none;
}

.weather-query-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  font-size: 19px;
  font-style: normal;
  font-weight: 500;
}

.temperature-query-icon {
  color: #ff7218;
  background: rgba(255, 113, 24, 0.12);
  font-size: 21px;
}

.wind-query-icon {
  color: #ff8a1f;
  background: rgba(255, 138, 31, 0.11);
  font-size: 23px;
}

.precipitation-query-icon {
  color: #f0a13b;
  background: rgba(240, 161, 59, 0.13);
  font-size: 17px;
}

.weather-query-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.weather-query-copy > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.weather-query-copy strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #242426;
  font-size: 18px;
  line-height: 1.2;
}

.weather-query-copy small {
  color: #5d5d60;
  font-size: 0.72em;
}

.weather-query-copy em {
  margin-left: 3px;
  color: #77777a;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.weather-query-card.loading .weather-query-copy strong {
  color: #8a8a8d;
}

.topbar {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  border: 2px solid #ff9a22;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 138, 31, 0.24);
  transform: rotate(-18deg);
}

.brand-mark i {
  position: absolute;
  height: 2px;
  border-radius: 2px;
  background: #ff9a22;
}

.brand-mark i:first-child {
  width: 26px;
  top: 11px;
  left: 9px;
  box-shadow: -7px 7px 0 #ff9a22;
}

.brand-mark i:last-child {
  width: 18px;
  top: 25px;
  left: -2px;
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand strong {
  font-size: 21px;
  letter-spacing: 0.04em;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.main-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 40px;
  margin-right: 34px;
}

.main-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: translateX(-50%);
}

.top-actions {
  display: flex;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 173, 76, 0.62);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #ff9a22, #ff6f18);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.layer-panel {
  position: absolute;
  z-index: 7;
  top: 88px;
  right: 24px;
  width: 200px;
  padding: 18px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 17px;
  background: rgba(248, 248, 247, 0.94);
  box-shadow: 0 20px 50px rgba(24, 24, 26, 0.22);
  backdrop-filter: blur(18px);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-title div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-title small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.panel-title strong {
  font-size: 15px;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #a94700;
  font-size: 10px;
}

.live-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff8a1f;
  box-shadow: 0 0 8px rgba(255, 138, 31, 0.72);
}

.model-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 5px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.model-select-wrap {
  position: relative;
  min-width: 0;
}

.model-select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 10px;
  color: #e97312;
  font-size: 13px;
  pointer-events: none;
  transform: translateY(-58%);
}

#modelSelect {
  width: 100%;
  height: 32px;
  padding: 0 30px 0 11px;
  border: 1px solid rgba(255, 138, 31, 0.34);
  border-radius: 9px;
  appearance: none;
  color: #2a2a2c;
  background: linear-gradient(135deg, rgba(255, 113, 24, 0.12), rgba(255, 154, 34, 0.07));
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

#modelSelect option {
  color: #2a2a2c;
  background: #f7f7f5;
}

#modelSelect:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.layer-options {
  display: grid;
  gap: 5px;
  padding: 10px 0;
}

.layer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #4c4c4f;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.layer-option[hidden] {
  display: none;
}

.layer-option:hover:not(:disabled) {
  background: rgba(35, 35, 37, 0.05);
}

.layer-option:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.layer-option.active {
  border-color: rgba(255, 138, 31, 0.42);
  color: #242426;
  background: linear-gradient(90deg, rgba(255, 113, 24, 0.15), rgba(255, 154, 34, 0.07));
}

.layer-option > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-option b {
  font-size: 12px;
}

.layer-option small {
  color: var(--muted);
  font-size: 9px;
}

.layer-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #ed7714;
  background: rgba(255, 138, 31, 0.11);
  font-size: 21px;
  font-weight: 500;
}

.temperature-icon {
  font-size: 23px;
}

.map-controls {
  position: absolute;
  z-index: 7;
  right: 24px;
  bottom: 172px;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 13px;
  background: rgba(248, 248, 247, 0.94);
  box-shadow: 0 10px 30px rgba(24, 24, 26, 0.18);
  backdrop-filter: blur(14px);
}

.map-controls button {
  width: 40px;
  height: 38px;
  border: 0;
  color: #343436;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.map-controls button:not(:disabled):hover {
  background: rgba(35, 35, 37, 0.07);
}

.map-controls button.active {
  color: #242426;
  background: var(--cyan);
}

.map-controls button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.42;
}

.map-controls .typhoon-toggle {
  font-family: "Segoe UI Symbol", "Arial Unicode MS", sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.map-controls .typhoon-toggle.active {
  color: #242426;
  background: var(--blue);
}

.map-controls span {
  height: 1px;
  margin: 2px 8px;
  background: var(--line);
}

.legend {
  position: absolute;
  z-index: 7;
  right: 82px;
  bottom: 104px;
  width: min(410px, calc(100vw - 48px));
  padding: 8px 12px 7px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background: rgba(248, 248, 247, 0.92);
  box-shadow: 0 10px 35px rgba(24, 24, 26, 0.18);
  backdrop-filter: blur(15px);
}

.legend-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #535356;
  font-size: 9px;
}

.legend-head strong {
  color: #242426;
  font-size: 9px;
}

.legend-bar {
  height: 5px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(35, 35, 37, 0.14), 0 0 12px rgba(255, 138, 31, 0.12);
}

.temperature-bar {
  background: linear-gradient(90deg, #350444 0%, #532363 8.696%, #7b3294 17.391%, #a65aa5 26.087%, #8aaed2 34.783%, #67c7ca 43.478%, #5e8fbd 52.174%, #57966d 56.522%, #7f9918 60.870%, #b9aa16 65.217%, #f1c40f 69.565%, #f39a18 73.913%, #ed5b1a 78.261%, #b93416 82.609%, #831907 86.957%, #461108 100%);
}

.wind-bar {
  background: linear-gradient(90deg, #4169b1 0%, #4194b2 7.5%, #38aa70 12.5%, #79b548 25%, #d39a50 37.5%, #b64f83 50%, #913f7b 62.5%, #68436f 75%, #402844 100%);
}

.precipitation-bar {
  background: linear-gradient(90deg, #fff 0%, #d6f5ff 12.5%, #73dfff 25%, #3399ff 37.5%, #0066cc 50%, #00aa55 62.5%, #ffcc00 75%, #e60000 87.5%, #580800 100%);
}

.pressure-bar {
  background: linear-gradient(90deg, #37348e 0%, #3a6fb0 20%, #3a8bc2 40%, #51c0b2 50%, #9dd56b 60%, #ead74e 80%, #e98c38 100%);
}

.legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: #737376;
  font-size: 7px;
}

.timeline-card {
  position: absolute;
  z-index: 8;
  left: 24px;
  right: 24px;
  bottom: 20px;
  display: grid;
  grid-template-columns: 46px 220px minmax(300px, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 14px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.97), rgba(240, 240, 238, 0.94));
  box-shadow: 0 18px 50px rgba(24, 24, 26, 0.22);
  backdrop-filter: blur(20px);
}

/* 地图移动时暂停实时背景模糊，避免每帧重新采样地图画面。 */
.app-shell.map-interacting .map-source,
.app-shell.map-interacting .layer-panel,
.app-shell.map-interacting .map-controls,
.app-shell.map-interacting .legend,
.app-shell.map-interacting .weather-query-card,
.app-shell.map-interacting .timeline-card {
  backdrop-filter: none;
}

.play-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffa42e, #ff6f18);
  box-shadow: 0 0 0 4px rgba(255, 138, 31, 0.1), 0 6px 17px rgba(224, 91, 4, 0.3);
  cursor: pointer;
}

.play-button span {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid white;
}

.play-button.playing span {
  width: 11px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-left: 3px solid white;
  border-right: 3px solid white;
}

.time-summary {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.time-summary small {
  color: #66666a;
  font-size: 9px;
}

.time-summary strong {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.time-summary-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.time-summary-footer > span {
  flex: 0 0 auto;
  color: #bd5808;
  font-size: 9px;
}

.forecast-run-button {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 150px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(255, 138, 31, 0.36);
  border-radius: 6px;
  color: #4a2a12;
  background: rgba(255, 138, 31, 0.09);
  font-size: 9px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.forecast-run-button[hidden] {
  display: none;
}

.forecast-run-button:hover:not(:disabled),
.forecast-run-button[aria-expanded="true"] {
  border-color: rgba(255, 138, 31, 0.68);
  background: rgba(255, 138, 31, 0.16);
}

.forecast-run-button:disabled {
  color: #929295;
  border-color: rgba(35, 35, 37, 0.1);
  background: rgba(35, 35, 37, 0.04);
  cursor: default;
}

.forecast-run-button > span:first-child {
  flex: 0 0 auto;
  color: #bd5808;
}

.forecast-run-button:disabled > span:first-child {
  color: inherit;
}

#forecastRunLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-run-button i {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin: -2px 1px 0 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.forecast-run-button[aria-expanded="true"] i {
  margin-top: 2px;
  transform: rotate(225deg);
}

.forecast-calendar {
  position: absolute;
  z-index: 30;
  left: 96px;
  bottom: 104px;
  width: min(304px, calc(100vw - 48px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 15px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.99), rgba(240, 240, 238, 0.98));
  box-shadow: 0 20px 52px rgba(24, 24, 26, 0.24);
  backdrop-filter: blur(22px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.forecast-calendar[hidden] {
  display: none;
}

.forecast-calendar::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 136px;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(35, 35, 37, 0.12);
  border-bottom: 1px solid rgba(35, 35, 37, 0.12);
  background: #f1f1ef;
  transform: rotate(45deg);
}

.forecast-calendar-head {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.forecast-calendar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.forecast-calendar-title span {
  color: #66666a;
  font-size: 9px;
}

.forecast-calendar-title strong {
  font-size: 13px;
  text-align: center;
}

.forecast-calendar-head button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0 0 2px;
  border: 1px solid rgba(35, 35, 37, 0.11);
  border-radius: 8px;
  color: #4a4a4d;
  background: rgba(35, 35, 37, 0.04);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.play-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.42;
}

.forecast-calendar-head button:hover:not(:disabled) {
  border-color: rgba(255, 138, 31, 0.44);
  background: rgba(255, 138, 31, 0.11);
}

.forecast-calendar-head button:disabled {
  color: #b0b0b2;
  cursor: default;
}

.forecast-calendar-weekdays,
.forecast-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.forecast-calendar-weekdays {
  margin-bottom: 4px;
  color: #66666a;
  font-size: 10px;
  text-align: center;
}

.forecast-calendar-weekdays span {
  padding: 3px 0;
}

.forecast-calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
  padding: 0 0 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #9a9a9d;
  background: transparent;
  font-size: 11px;
  cursor: default;
}

.forecast-calendar-day.outside-month {
  color: #c0c0c2;
}

.forecast-calendar-day.available {
  color: #3a3a3c;
  border-color: rgba(255, 138, 31, 0.34);
  background: rgba(255, 138, 31, 0.09);
  cursor: pointer;
}

.forecast-calendar-day.available::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ff8a1f;
  box-shadow: 0 0 6px rgba(255, 138, 31, 0.68);
  transform: translateX(-50%);
}

.forecast-calendar-day.available:hover {
  border-color: rgba(255, 138, 31, 0.68);
  background: rgba(255, 138, 31, 0.17);
}

.forecast-calendar-day.selected {
  border-color: rgba(75, 75, 78, 0.46);
}

.forecast-calendar-day.active {
  color: #242426;
  border-color: #ff8a1f;
  background: linear-gradient(145deg, rgba(255, 154, 34, 0.78), rgba(255, 113, 24, 0.64));
  box-shadow: 0 5px 14px rgba(204, 82, 5, 0.2);
}

.forecast-calendar-day:disabled {
  opacity: 1;
}

.timeline-main {
  min-width: 0;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #66666a;
  font-size: 9px;
}

.timeline-meta span:first-child {
  color: #3f3f42;
}

#timeRange {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  accent-color: var(--cyan);
  cursor: pointer;
}

#timeRange:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.day-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: #6f7074;
  font-size: 8px;
}

.loading-toast {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 118px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 9px;
  color: #343436;
  background: rgba(248, 248, 247, 0.94);
  box-shadow: 0 10px 28px rgba(24, 24, 26, 0.18);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.loading-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.loading-toast.error {
  border-color: rgba(255, 139, 139, 0.42);
  color: #ffe2e2;
  background: rgba(41, 13, 18, 0.9);
}

@media (max-width: 900px) {
  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .brand small,
  .main-nav {
    display: none;
  }

  .layer-panel {
    top: 70px;
    right: 14px;
    width: 190px;
  }

  .layer-option {
    padding: 6px;
  }

  .map-controls {
    right: 14px;
    bottom: 180px;
  }

  .legend {
    right: 65px;
    bottom: 116px;
    width: min(320px, calc(100vw - 86px));
  }

  .map-source {
    left: 14px;
    bottom: 151px;
  }

  .timeline-card {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 48px 1fr;
    gap: 11px;
    padding: 10px 12px;
  }

  .timeline-main {
    grid-column: 1 / -1;
  }

  .forecast-calendar {
    left: 12px;
    bottom: 148px;
  }

  .forecast-calendar::after {
    left: 174px;
  }
}

@media (max-width: 540px) {
  .app-shell {
    min-height: 560px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .layer-panel {
    width: 166px;
    padding: 12px 9px;
  }

  .layer-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .layer-option {
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 5px 2px;
    text-align: center;
  }

  .layer-option b {
    font-size: 10px;
  }

  .layer-option small {
    display: none;
  }

  .panel-title {
    padding-bottom: 10px;
  }

  .model-control {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 9px 4px;
  }

  .map-controls {
    right: auto;
    left: 14px;
  }

  .legend {
    bottom: 154px;
  }

  .time-summary-footer {
    gap: 5px;
  }

  .forecast-run-button {
    max-width: 138px;
  }
}

@media (max-height: 760px) {
  .map-controls {
    right: auto;
    left: clamp(14px, 2vw, 24px);
  }
}

@media (max-height: 620px) {
  .app-shell {
    min-height: 0;
  }

  .layer-panel {
    top: 70px;
    right: 14px;
    display: grid;
    grid-template-columns: auto minmax(68px, 88px) minmax(112px, 1fr);
    align-items: center;
    gap: 8px;
    width: min(460px, calc(50vw - 20px));
    padding: 6px 8px;
  }

  .panel-title {
    padding: 4px 9px 4px 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .panel-title small,
  .panel-title .live-dot,
  .model-control > span:first-child {
    display: none;
  }

  .panel-title strong {
    font-size: 11px;
    white-space: nowrap;
  }

  .model-control {
    display: block;
    padding: 3px 8px 3px 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  #modelSelect {
    height: 29px;
    padding-left: 8px;
    font-size: 10px;
  }

  .layer-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 0;
  }

  .layer-option {
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding: 2px 1px;
    text-align: center;
  }

  .layer-option small {
    display: none;
  }

  .layer-icon {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    font-size: 17px;
  }

  .layer-option b {
    font-size: 9px;
  }

  .legend {
    display: none;
  }

  .map-controls {
    bottom: 148px;
  }

  .map-source {
    left: 72px;
    bottom: 145px;
  }

  .forecast-calendar {
    position: fixed;
    top: 50%;
    bottom: auto;
    left: 50%;
    width: min(276px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 10px;
    transform: translate(-50%, -50%);
  }

  .forecast-calendar::after {
    display: none;
  }

  .forecast-calendar-head {
    margin-bottom: 5px;
  }

  .forecast-calendar-weekdays,
  .forecast-calendar-grid {
    gap: 2px;
  }

  .forecast-calendar-day {
    height: 30px;
  }

}

@media (max-width: 520px) and (max-height: 620px) {
  .layer-panel {
    left: 14px;
    right: 14px;
    grid-template-columns: minmax(82px, 104px) 1fr;
    width: auto;
  }

  .panel-title {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Set window.ENABLE_NEW_COLOR_THEME to false in index.html to restore this theme. */
html.legacy-color-theme {
  color-scheme: dark;
  --panel: rgba(9, 18, 28, 0.88);
  --panel-light: rgba(20, 31, 43, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --muted: #99a8b5;
  --text: #f6f9fb;
  --accent: #5de5de;
  --accent-strong: #2c8fff;
  --accent-soft: rgba(93, 229, 222, 0.12);
  --focus: #5de5de;
  --cyan: #5de5de;
  --blue: #2c8fff;
  --map-background: #294a53;
  --map-label-country: rgba(18, 27, 31, 0.92);
  --map-label-state: rgba(30, 39, 43, 0.86);
  --map-label-city: rgba(15, 23, 27, 0.94);
  --map-label-city-dot: rgba(16, 27, 34, 0.92);
  --range-start: #5de5de;
  --range-end: #2c8fff;
  --range-track: rgba(255, 255, 255, 0.16);
}

html.legacy-color-theme,
html.legacy-color-theme body {
  background: #15232c;
}

.legacy-color-theme .map-stage,
.legacy-color-theme #mapDiv {
  background: #294a53;
}

.legacy-color-theme .map-shade {
  background:
    linear-gradient(180deg, rgba(3, 11, 18, 0.28) 0%, transparent 20%, transparent 72%, rgba(2, 8, 15, 0.34) 100%),
    radial-gradient(circle at 50% 48%, transparent 40%, rgba(4, 12, 18, 0.15) 100%);
}

.legacy-color-theme .map-source {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(5, 14, 22, 0.55);
  box-shadow: none;
}

.legacy-color-theme .data-notice {
  color: #f5fbfc;
  background: rgba(4, 13, 20, 0.97);
}

.legacy-color-theme .data-notice span {
  color: #b7c5cd;
}

.legacy-color-theme .weather-query-marker {
  background: #2c8fff;
  box-shadow: 0 0 0 3px rgba(44, 143, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.38);
}

.legacy-color-theme .weather-query-card {
  border-color: rgba(255, 255, 255, 0.14);
  color: #f6f9fb;
  background: linear-gradient(145deg, rgba(7, 16, 24, 0.94), rgba(16, 29, 39, 0.91));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.legacy-color-theme .weather-query-card::after {
  border-right-color: rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background: #10202b;
}

.legacy-color-theme .weather-query-card.below-marker::after {
  border-top-color: rgba(255, 255, 255, 0.14);
  border-left-color: rgba(255, 255, 255, 0.14);
}

.legacy-color-theme .weather-query-head h2 {
  color: #f7fbfc;
}

.legacy-color-theme #weatherQueryClose {
  color: #b9c5cd;
}

.legacy-color-theme #weatherQueryClose:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.legacy-color-theme .temperature-query-icon {
  color: #ff9b52;
  background: rgba(255, 139, 65, 0.12);
}

.legacy-color-theme .wind-query-icon {
  color: #5de5de;
  background: rgba(75, 210, 202, 0.1);
}

.legacy-color-theme .precipitation-query-icon {
  color: #5aa8ff;
  background: rgba(44, 143, 255, 0.13);
}

.legacy-color-theme .weather-query-copy strong {
  color: #f6f9fb;
}

.legacy-color-theme .weather-query-copy small {
  color: #d7e0e5;
}

.legacy-color-theme .weather-query-copy em,
.legacy-color-theme .weather-query-card.loading .weather-query-copy strong {
  color: #9eacb6;
}

.legacy-color-theme .brand-mark {
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.legacy-color-theme .brand-mark i {
  background: #fff;
}

.legacy-color-theme .brand-mark i:first-child {
  box-shadow: -7px 7px 0 #fff;
}

.legacy-color-theme .avatar {
  border-color: rgba(93, 229, 222, 0.5);
  background: linear-gradient(135deg, #287fd8, #34c8c0);
}

.legacy-color-theme .layer-panel {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(7, 16, 24, 0.86);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.legacy-color-theme .live-dot {
  color: #7ee7df;
}

.legacy-color-theme .live-dot::before {
  background: #59e5dc;
  box-shadow: 0 0 8px #59e5dc;
}

.legacy-color-theme .model-select-wrap::after {
  color: #8cebe5;
}

.legacy-color-theme #modelSelect {
  border-color: rgba(93, 229, 222, 0.28);
  color: #f6fbfc;
  background: linear-gradient(135deg, rgba(44, 143, 255, 0.2), rgba(93, 229, 222, 0.1));
}

.legacy-color-theme #modelSelect option {
  color: #edf7f8;
  background: #10202b;
}

.legacy-color-theme .layer-option {
  color: #c5d0d8;
}

.legacy-color-theme .layer-option:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.legacy-color-theme .layer-option.active {
  border-color: rgba(93, 229, 222, 0.32);
  color: #fff;
  background: linear-gradient(90deg, rgba(43, 143, 255, 0.2), rgba(93, 229, 222, 0.08));
}

.legacy-color-theme .layer-icon {
  color: #79e1dc;
  background: rgba(75, 210, 202, 0.1);
}

.legacy-color-theme .map-controls {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(7, 16, 24, 0.84);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.legacy-color-theme .map-controls button {
  color: #fff;
}

.legacy-color-theme .map-controls button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
}

.legacy-color-theme .map-controls button.active {
  color: #07161c;
  background: #5de5de;
}

.legacy-color-theme .map-controls .typhoon-toggle.active {
  color: #fff;
  background: #2c8fff;
}

.legacy-color-theme .legend {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(8, 17, 25, 0.79);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.24);
}

.legacy-color-theme .legend-head {
  color: #d7e0e5;
}

.legacy-color-theme .legend-head strong {
  color: #fff;
}

.legacy-color-theme .legend-bar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 14px rgba(65, 218, 191, 0.18);
}

.legacy-color-theme .legend-ticks {
  color: #9eacb6;
}

.legacy-color-theme .timeline-card {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(100deg, rgba(7, 16, 24, 0.94), rgba(16, 29, 39, 0.9));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.legacy-color-theme .play-button {
  background: linear-gradient(145deg, #55e2d8, #278fff);
  box-shadow: 0 0 0 4px rgba(71, 202, 220, 0.1), 0 6px 17px rgba(34, 147, 230, 0.34);
}

.legacy-color-theme .time-summary small {
  color: #8fa0ad;
}

.legacy-color-theme .time-summary-footer > span {
  color: #65ddd6;
}

.legacy-color-theme .forecast-run-button {
  border-color: rgba(93, 229, 222, 0.3);
  color: #eafcfc;
  background: rgba(93, 229, 222, 0.08);
}

.legacy-color-theme .forecast-run-button:hover:not(:disabled),
.legacy-color-theme .forecast-run-button[aria-expanded="true"] {
  border-color: rgba(93, 229, 222, 0.62);
  background: rgba(93, 229, 222, 0.15);
}

.legacy-color-theme .forecast-run-button:disabled {
  color: #778791;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.legacy-color-theme .forecast-run-button > span:first-child {
  color: #76dcd7;
}

.legacy-color-theme .forecast-run-button:disabled > span:first-child {
  color: inherit;
}

.legacy-color-theme .forecast-calendar {
  border-color: rgba(125, 232, 226, 0.3);
  background: linear-gradient(150deg, rgba(8, 20, 29, 0.98), rgba(14, 30, 41, 0.98));
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.46);
}

.legacy-color-theme .forecast-calendar::after {
  border-right-color: rgba(125, 232, 226, 0.24);
  border-bottom-color: rgba(125, 232, 226, 0.24);
  background: #0d1d27;
}

.legacy-color-theme .forecast-calendar-title span {
  color: #81929d;
}

.legacy-color-theme .forecast-calendar-head button {
  border-color: rgba(255, 255, 255, 0.1);
  color: #c8f6f3;
  background: rgba(255, 255, 255, 0.04);
}

.legacy-color-theme .forecast-calendar-head button:hover:not(:disabled) {
  border-color: rgba(93, 229, 222, 0.4);
  background: rgba(93, 229, 222, 0.1);
}

.legacy-color-theme .forecast-calendar-head button:disabled {
  color: #51616c;
}

.legacy-color-theme .forecast-calendar-weekdays {
  color: #82929e;
}

.legacy-color-theme .forecast-calendar-day {
  color: #61717c;
}

.legacy-color-theme .forecast-calendar-day.outside-month {
  color: #394954;
}

.legacy-color-theme .forecast-calendar-day.available {
  color: #eafffd;
  border-color: rgba(93, 229, 222, 0.3);
  background: rgba(93, 229, 222, 0.09);
}

.legacy-color-theme .forecast-calendar-day.available::after {
  background: #5de5de;
  box-shadow: 0 0 6px rgba(93, 229, 222, 0.75);
}

.legacy-color-theme .forecast-calendar-day.available:hover {
  border-color: rgba(93, 229, 222, 0.65);
  background: rgba(93, 229, 222, 0.16);
}

.legacy-color-theme .forecast-calendar-day.selected {
  border-color: rgba(255, 255, 255, 0.78);
}

.legacy-color-theme .forecast-calendar-day.active {
  color: #fff;
  border-color: #5de5de;
  background: linear-gradient(145deg, rgba(44, 143, 255, 0.58), rgba(41, 197, 190, 0.42));
  box-shadow: 0 5px 14px rgba(20, 150, 190, 0.2);
}

.legacy-color-theme .timeline-meta {
  color: #9dabb5;
}

.legacy-color-theme .timeline-meta span:first-child {
  color: #e3edf1;
}

.legacy-color-theme .day-labels {
  color: #758693;
}

.legacy-color-theme .loading-toast {
  border-color: rgba(255, 255, 255, 0.14);
  color: #dbe7eb;
  background: rgba(3, 12, 19, 0.83);
  box-shadow: none;
}

.legacy-color-theme .loading-toast.error {
  border-color: rgba(255, 139, 139, 0.42);
  color: #ffe2e2;
  background: rgba(41, 13, 18, 0.9);
}
