:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eaf4f7;
  background: #071c2b;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #071c2b; }
button { font: inherit; }
.topbar {
  min-height: 82px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #0b293b;
  border-bottom: 1px solid #214456;
}
.topbar-brand h1 { margin: 2px 0 0; font-size: clamp(19px, 2.4vw, 25px); }
.topbar-brand p { margin: 1px 0 0; color: #a8c0cc; font-size: 12px; }
.back-link { color: #afcfdd; text-decoration: none; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.updated-at { color: #b4c7d0; font-size: 12px; }
.topbar-actions button, .select-actions button {
  border: 1px solid #426276; border-radius: 8px; padding: 8px 11px;
  color: #edf6f8; background: #15394d; cursor: pointer;
}
button:hover { filter: brightness(1.13); }
button:disabled { opacity: .55; cursor: wait; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 82px); min-height: 480px; }
.storm-panel { display: flex; flex-direction: column; min-height: 0; background: #0b2434; border-right: 1px solid #214456; }
.panel-heading { padding: 13px 13px 10px; border-bottom: 1px solid #203e4f; }
.panel-heading h2 { margin: 0 0 2px; font-size: 16px; }
.panel-heading p { margin: 0; color: #9db6c2; font-size: 12px; }
.select-actions { display: flex; gap: 6px; margin-top: 9px; }
.select-actions button { font-size: 12px; padding: 6px 9px; }
.storm-list { overflow-y: auto; padding: 7px; flex: 1; }
.storm-card {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: start; gap: 9px;
  margin-bottom: 7px; padding: 10px; border: 1px solid #254454; border-radius: 10px;
  background: #102e40; cursor: pointer;
}
.storm-card.is-selected { background: #17394c; border-color: #47778e; }
.storm-card input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: #54c7db; cursor: pointer; }
.storm-swatch { width: 12px; height: 12px; margin: 4px 0 0; border-radius: 50%; box-shadow: 0 0 0 3px #ffffff16; }
.storm-name { overflow-wrap: anywhere; font-size: 14px; font-weight: 750; line-height: 1.25; }
.storm-meta { margin-top: 5px; color: #adc2cc; font-size: 11px; line-height: 1.45; }
.storm-level { border: 1px solid #527080; border-radius: 999px; padding: 3px 6px; color: #d7e7ed; font-size: 10px; white-space: nowrap; }
.panel-message { padding: 8px 12px; color: #bdd0d8; font-size: 12px; }
.panel-message[hidden] { display: none; }
.data-note { display: grid; gap: 4px; padding: 11px 13px; border-top: 1px solid #203e4f; color: #a8bdc7; font-size: 11px; line-height: 1.4; }
.data-note strong { color: #e1edf1; }
.data-note a { color: #75cde0; text-decoration: none; }
.map-shell { position: relative; min-width: 0; min-height: 0; background: #162f3e; }
#map { width: 100%; height: 100%; background: #162f3e; }
.map-message {
  position: absolute; z-index: 700; left: 50%; top: 14px; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 8px;
  background: #092536ed; box-shadow: 0 2px 12px #0008; color: #f5fbfd; font-size: 13px;
}
.map-message[hidden] { display: none; }
.label-toggle {
  position: absolute; z-index: 710; top: 10px; right: 10px;
  padding: 7px 10px; border: 1px solid #b5cbd5; border-radius: 7px;
  color: #f5fbfd; background: #092536ed; box-shadow: 0 1px 5px #0006;
  font-size: 12px; font-weight: 650; cursor: pointer;
}
.label-toggle[aria-pressed="true"] { color: #082436; background: #e5f6fa; }
.label-toggle:focus-visible { outline: 2px solid #54c7db; outline-offset: 2px; }
.map-legend {
  position: absolute; z-index: 600; right: 10px; bottom: 16px; display: flex; align-items: center; gap: 7px;
  max-width: calc(100% - 20px); padding: 8px 10px; border-radius: 8px; background: #092536e8;
  color: #e0edf2; font-size: 11px; box-shadow: 0 2px 8px #0005;
}
.legend-line { display: inline-block; width: 23px; height: 0; border-top: 3px solid #54c7db; }
.legend-line.forecast { border-top-style: dashed; }
.legend-line.observed { border-top-style: solid; }
.legend-dot { display: inline-block; width: 10px; height: 10px; margin-left: 5px; border: 2px solid white; border-radius: 50%; background: #ed5b5b; }
.legend-forecast-point { display: inline-block; width: 10px; height: 10px; margin-left: 4px; border: 2px solid white; border-radius: 50%; background: transparent; }
.cyclone-marker { background: transparent; border: 0; width: max-content !important; height: 38px !important; }
.cyclone-tag { display: flex; align-items: center; gap: 6px; width: max-content; white-space: nowrap; }
.cyclone-marker .cyclone-tag > span {
  display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid white; border-radius: 50%;
  color: white; font-size: 23px; line-height: 1; text-shadow: 0 1px 3px #000; box-shadow: 0 1px 8px #0009;
}
.cyclone-marker .cyclone-tag > b {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: white; font-size: 13px; font-weight: 750;
  text-shadow: -1px -1px 2px #142631, 1px -1px 2px #142631, -1px 1px 2px #142631, 1px 1px 2px #142631, 0 1px 5px #000;
}
.track-arrow-wrap { background: transparent; border: 0; }
.track-arrow { display: block; width: 18px; height: 18px; font-size: 18px; line-height: 18px; font-weight: 900; text-shadow: 0 0 3px #071c2b, 0 1px 2px white; }
.leaflet-tooltip.track-point-tooltip {
  padding: 3px 5px; border: 1px solid #d6e5ed; border-radius: 5px;
  color: #f7fbfd; background: #082436ed; box-shadow: 0 1px 5px #0008;
  white-space: nowrap; font-size: 10px; line-height: 1.2;
}
.leaflet-tooltip.track-point-tooltip::before { display: none; }
.track-point-label { display: block; text-align: center; }
.track-point-label b, .track-point-label small { display: block; font-weight: 650; }
.track-point-label small { margin-top: 1px; color: #c4edf4; font-size: 9px; }
.leaflet-tooltip.forecast-point-tooltip { border-style: dashed; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { color: #15232b; }
.storm-popup { min-width: 190px; }
.storm-popup strong { display: block; margin-bottom: 5px; font-size: 15px; }
.storm-popup div { margin: 3px 0; }
.storm-popup a { display: inline-block; margin-top: 7px; color: #176b86; }

@media (max-width: 760px) {
  .topbar { min-height: auto; padding: 9px 11px; align-items: flex-start; }
  .topbar-brand p { max-width: 250px; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; gap: 4px; }
  .topbar-actions button { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  .updated-at { text-align: right; font-size: 10px; }
  .workspace { display: flex; flex-direction: column; height: calc(100dvh - 76px); min-height: 0; }
  .map-shell { order: 1; flex: 1 1 55%; min-height: 280px; }
  .storm-panel { order: 2; flex: 1 1 45%; min-height: 210px; max-height: 42dvh; border-right: 0; border-top: 1px solid #214456; }
  .panel-heading { padding: 8px 10px; }
  .panel-heading h2 { display: inline; font-size: 14px; }
  .panel-heading p { display: inline; margin-left: 5px; }
  .select-actions { margin-top: 6px; }
  .storm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
  .storm-card { margin: 0; padding: 8px; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 6px; }
  .storm-name { font-size: 12px; }
  .storm-meta { font-size: 10px; }
  .storm-level { padding: 2px 5px; font-size: 9px; }
  .data-note { padding: 7px 10px; }
  .map-legend { left: 7px; right: 7px; bottom: 8px; width: fit-content; font-size: 10px; }
  .label-toggle { top: 8px; right: 8px; padding: 6px 8px; font-size: 11px; }
}
