/* Typhoon chart layer. Data states stay distinct from the static geography. */
.typhoon-weather-panel {
  padding: 20px;
}

.typhoon-map {
  gap: 0;
  min-width: 0;
}

.typhoon-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 2px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.typhoon-map-head-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.typhoon-map-kicker {
  color: var(--st-action);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}

.typhoon-map-head-main strong {
  color: var(--st-ink);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.3;
}

.typhoon-map-head-main > span:last-child {
  color: var(--st-muted);
  font-size: 13px;
  line-height: 1.55;
}

.typhoon-map-source {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.typhoon-map-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid var(--st-line);
  border-radius: 4px;
  color: var(--st-primary);
  background: var(--st-soft);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.typhoon-map-state i {
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.typhoon-map-state.is-live i {
  background: currentColor;
}

.typhoon-map-state.is-offline {
  color: var(--st-muted);
  background: var(--st-canvas);
}

.typhoon-map-source small {
  color: var(--st-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.typhoon-track-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.typhoon-track-picker button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--st-line);
  border-radius: 4px;
  background: white;
  color: var(--st-primary);
  cursor: pointer;
}

.typhoon-track-picker button.is-active {
  border-color: var(--st-action);
  background: var(--st-soft);
  font-weight: 650;
}

.typhoon-map-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  color: var(--st-muted);
  font-size: 12px;
  line-height: 1.55;
}

.typhoon-map-subbar strong { color: var(--st-primary); }
.typhoon-map-subbar a { color: var(--st-action); text-decoration: underline; text-underline-offset: 2px; }
.typhoon-map-subbar button { flex: 0 0 auto; min-height: 44px; }

.typhoon-map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--st-line);
  border-radius: 6px;
  background: #d9e6f2;
  cursor: default;
}

.typhoon-map-shell:focus-visible,
.typhoon-map-tools button:focus-visible,
.typhoon-track-picker button:focus-visible {
  outline: 3px solid var(--st-action);
  outline-offset: 2px;
}

.typhoon-map .typhoon-map-shell svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 880 / 500;
  border: 0;
  border-radius: 0;
  background: #d9e6f2;
  fill: none;
}

.typhoon-map .map-grid line {
  stroke: #8ba9c2;
  stroke-width: .8;
  stroke-dasharray: 3 5;
  opacity: .42;
}

.typhoon-map .map-label,
.typhoon-map .sea-label {
  fill: #4d5d65;
  stroke: #f6e8cd;
  stroke-width: 2.5px;
  paint-order: stroke;
  font-size: 9px;
  font-weight: 650;
}

.typhoon-map .sea-label {
  fill: #68839a;
  stroke: #d9e6f2;
  font-size: 11px;
  letter-spacing: .08em;
}

.typhoon-map .zoom-city text {
  fill: #596970;
  stroke: #f6e8cd;
  stroke-width: 2px;
}

.typhoon-map .zoom-city circle {
  fill: #7b817a;
  stroke: #f6e8cd;
}

.typhoon-map .track-history,
.typhoon-map .track-forecast {
  stroke: #374c5c;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.typhoon-map .track-forecast {
  stroke: #b25068;
  stroke-width: 2.3;
  stroke-dasharray: 7 5;
}

.typhoon-map-reference-note {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 3px;
  max-width: min(250px, calc(100% - 150px));
  padding: 9px 12px;
  border: 1px solid rgba(92, 111, 117, .28);
  border-radius: 4px;
  background: rgba(255, 251, 242, .91);
  box-shadow: 0 2px 9px rgba(47, 74, 90, .1);
  pointer-events: none;
}

.typhoon-map-reference-note strong {
  color: #354753;
  font-size: 12px;
  line-height: 1.3;
}

.typhoon-map-reference-note span {
  color: #5f6870;
  font-size: 11px;
  line-height: 1.35;
}

.typhoon-map .platform-warning-ring circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .platform-warning-ring.outer { color: #478169; }
.typhoon-map .platform-warning-ring.middle { color: #bf9a31; }
.typhoon-map .platform-warning-ring.inner { color: #bc5057; }

.typhoon-map .platform-reference-halo {
  fill: rgba(189, 80, 87, .14);
  stroke: #bc5057;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .platform-reference-center {
  fill: #a83249;
  stroke: #fff7e9;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .platform-reference-label {
  fill: #8f2f44;
  stroke: #fff8ec;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 9px;
  font-weight: 750;
}

.typhoon-map .track-point circle {
  fill: #3f6076;
  stroke: #fff7ec;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .track-point.is-forecast circle { fill: #b65c9b; }
.typhoon-map .track-point.is-current circle { fill: #d84952; }

.typhoon-map .track-label {
  fill: #263a4c;
  stroke: #fff8eb;
  stroke-width: 2.5px;
  paint-order: stroke;
  font-size: 9px;
  font-weight: 700;
}

.typhoon-map .wind-ring ellipse {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .wind-ring text {
  fill: currentColor;
  stroke: #fff8ec;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 10px;
  font-weight: 750;
}

.typhoon-map .wind-7 { color: #278363; }
.typhoon-map .wind-10 { color: #a37b06; }
.typhoon-map .wind-12 { color: #c54849; }

.typhoon-map .manual-site circle {
  fill: var(--st-primary);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.typhoon-map .manual-site text {
  fill: var(--st-primary);
  stroke: #fff;
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 10px;
  font-weight: 700;
}

.typhoon-map-tools {
  top: 14px;
  right: 14px;
  left: auto;
  gap: 6px;
}

.typhoon-map-tools span,
.typhoon-map-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid var(--st-line);
  border-radius: 4px;
  background: rgba(255,255,255,.96);
  color: var(--st-primary);
  box-shadow: 0 2px 8px rgba(7,29,44,.09);
  font-size: 13px;
  font-weight: 650;
}

.typhoon-map-tools button {
  cursor: pointer;
  pointer-events: auto;
}

.typhoon-map-tools button:hover:not(:disabled) {
  background: var(--st-soft);
  border-color: var(--st-action);
}

.typhoon-map-tools button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.typhoon-empty-card {
  position: absolute;
  top: auto;
  right: 16px;
  bottom: 22px;
  left: auto;
  display: grid;
  justify-items: start;
  gap: 6px;
  width: min(280px, calc(100% - 32px));
  padding: 17px 18px;
  border: 1px solid var(--st-line);
  border-radius: 5px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 7px 24px rgba(7,29,44,.09);
  text-align: left;
}

.typhoon-empty-rule {
  width: 28px;
  height: 2px;
  margin-bottom: 4px;
  background: var(--st-action);
}

.typhoon-empty-card strong {
  color: var(--st-ink);
  font-size: 16px;
}

.typhoon-empty-card span:not(.typhoon-empty-rule),
.typhoon-empty-card small {
  color: var(--st-muted);
  font-size: 12px;
  line-height: 1.55;
}

.typhoon-map-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px 0;
}

.typhoon-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.typhoon-map-meta .typhoon-map-legend span,
.typhoon-map-attribution {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--st-muted);
  font-size: 11px;
}

.legend-line {
  display: inline-block;
  width: 23px;
  height: 0;
  border-top: 3px solid var(--st-action);
}

.legend-line.forecast {
  border-top-style: dashed;
}

.typhoon-map .legend-ring {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.typhoon-map .legend-ring.platform-outer { color: #478169; }
.typhoon-map .legend-ring.platform-middle { color: #bf9a31; }
.typhoon-map .legend-ring.platform-inner { color: #bc5057; }

.typhoon-map .legend-site {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--st-primary);
  box-shadow: 0 0 0 1px var(--st-primary);
}

.typhoon-site-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid var(--st-line);
  border-radius: 5px;
  color: var(--st-primary);
  font-size: 12px;
}

.typhoon-site-list > div { display: flex; flex-wrap: wrap; gap: 8px; }

.typhoon-site-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--st-line);
  border-radius: 4px;
  background: var(--st-soft);
  font-variant-numeric: tabular-nums;
}

.typhoon-site-chip button {
  min-height: 30px;
  padding: 3px 9px;
  border: 0;
  border-radius: 3px;
  background: white;
  color: #a33b3d;
  cursor: pointer;
}

.typhoon-site-help { color: var(--st-muted); font-size: 13px; line-height: 1.55; }
.typhoon-site-error { color: #a33b3d; font-size: 13px; min-height: 1em; }

.typhoon-map-caution {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--st-action);
  background: var(--st-soft);
  color: var(--st-primary);
  font-size: 12px;
  line-height: 1.6;
}

.typhoon-offline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  color: var(--st-muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .typhoon-weather-panel { padding: 14px; }
  .typhoon-map-head { flex-direction: column; gap: 11px; }
  .typhoon-map-subbar { align-items: flex-start; flex-direction: column; }
  .typhoon-map-head-main strong { font-size: 18px; }
  .typhoon-map-head-main > span:last-child { font-size: 12px; }
  .typhoon-map-source { display: flex; flex-wrap: wrap; align-items: center; justify-items: start; }
  .typhoon-map .typhoon-map-shell svg { min-height: 230px; }
  .typhoon-map-reference-note { top: 8px; left: 8px; max-width: 145px; padding: 6px 8px; }
  .typhoon-map-reference-note strong { font-size: 10px; }
  .typhoon-map-reference-note span { font-size: 9px; }
  .typhoon-map-tools { top: 8px; right: 8px; gap: 4px; }
  .typhoon-map-tools span,
  .typhoon-map-tools button { height: 44px; min-width: 44px; padding: 0 8px; }
  .typhoon-empty-card {
    position: relative;
    inset: auto;
    width: auto;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--st-line);
    border-radius: 0;
    box-shadow: none;
  }
  .typhoon-map-meta { align-items: flex-start; flex-direction: column; }
  .typhoon-map-attribution { line-height: 1.5; }
  .typhoon-offline-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .typhoon-map svg animate { display: none; }
}
