:root {
  --ink: #10202c;
  --muted: #667480;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(16, 32, 44, 0.14);
  --live: #12a66a;
  --nofix: #d24f45;
  --offline: #7b8792;
}

* {
  box-sizing: border-box;
}

html,
body,
#windy {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
a,
input {
  font: inherit;
}

.windy-header,
.track-panel,
.vessel-panel,
.loading,
.meteo-legend {
  position: absolute;
  z-index: 800;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(8, 26, 35, 0.16);
  backdrop-filter: blur(14px);
}

.windy-header {
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
}

.windy-header p,
.windy-header h1 {
  margin: 0;
}

.windy-header p {
  color: #315064;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.windy-header h1 {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1;
}

.windy-header nav,
.track-presets,
.track-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.windy-header button,
.windy-header a,
.track-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: #eef4f4;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.windy-header button.active,
.windy-header button:hover,
.windy-header a:hover,
.track-btn.active,
.track-btn:hover {
  color: #fff;
  background: #17394c;
}

.track-panel {
  top: 88px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: calc(100vw - 380px);
  padding: 8px;
}

.track-custom input {
  width: 120px;
  height: 30px;
  border: 1px solid rgba(16, 32, 44, 0.16);
  border-radius: 6px;
  padding: 0 7px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

#trackStatus {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.vessel-panel {
  top: 88px;
  right: 16px;
  width: 320px;
  max-height: calc(100vh - 110px);
  padding: 13px;
  overflow-y: auto;
}

.vessel-panel h2 {
  margin: 0;
  font-size: 21px;
}

.vessel-panel > p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

#vesselList {
  display: grid;
  gap: 9px;
}

.hazard-side-panel {
  padding: 0;
  overflow: hidden;
}

.hazard-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(16, 32, 44, 0.12);
  padding: 13px 13px 10px;
  background: linear-gradient(135deg, #f8fbfc, #eaf4f6);
}

.hazard-side-head p,
.hazard-side-head h2 {
  margin: 0;
}

.hazard-side-head p {
  color: #4b7184;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hazard-side-head h2 {
  margin-top: 3px;
  font-size: 20px;
}

#hazardSideCount {
  display: grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #17394c;
  font-size: 15px;
  font-weight: 900;
}

.hazard-side-panel > #serverClock {
  margin: 0;
  border-bottom: 1px solid rgba(16, 32, 44, 0.1);
  padding: 8px 13px;
  background: #fff;
}

.side-hazard-list {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 7px;
}

.side-hazard-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid rgba(16, 32, 44, 0.13);
  border-left: 4px solid var(--event-color);
  border-radius: 6px;
  background: #fff;
}

.side-hazard-card > button {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 0;
  padding: 9px 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.side-hazard-card > button:hover {
  background: #eef7f8;
}

.side-hazard-code {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--event-color) 58%, white);
  border-radius: 50%;
  color: #fff;
  background: var(--event-color);
  font-size: 8px;
  font-weight: 900;
}

.side-hazard-copy,
.side-hazard-copy b,
.side-hazard-copy small {
  display: block;
  min-width: 0;
}

.side-hazard-copy b {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-hazard-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: #6c7e89;
  font-size: 8.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-hazard-card > a {
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(16, 32, 44, 0.1);
  color: #087ca2;
  background: #f4fafb;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.side-hazard-card > a:hover {
  color: #fff;
  background: #087ca2;
}

.hazard-side-empty {
  margin: 12px;
  color: var(--muted);
  font-size: 12px;
}

.vessel-card {
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ship-color);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.vessel-card.selected,
.vessel-card:hover {
  border-color: rgba(23, 57, 76, 0.4);
  border-left-color: var(--ship-color);
  box-shadow: 0 12px 24px rgba(8, 26, 35, 0.12);
}

.vessel-card strong {
  display: block;
  color: var(--ship-color);
  font-size: 14px;
}

.vessel-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ship-arrow-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 9px 16px rgba(8, 26, 35, 0.34));
}

.ship-arrow-wrap::before,
.ship-arrow {
  position: absolute;
  clip-path: polygon(50% 0, 86% 100%, 50% 82%, 14% 100%);
  transform: rotate(var(--course));
  transform-origin: 50% 58%;
  content: "";
}

.ship-arrow-wrap::before {
  left: 5px;
  top: 0;
  width: 38px;
  height: 46px;
  background: #fff;
}

.ship-arrow {
  left: 10px;
  top: 5px;
  width: 28px;
  height: 38px;
  background: var(--ship-color);
}

.ship-arrow::after {
  position: absolute;
  left: 10px;
  top: 9px;
  width: 8px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  content: "";
}

.ship-arrow-wrap span {
  position: absolute;
  left: 50%;
  bottom: -7px;
  min-width: 28px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--ship-color);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.ship-info-box {
  width: 176px;
  padding: 9px 10px;
  border: 1px solid rgba(16, 32, 44, 0.16);
  border-left: 4px solid var(--ship-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(8, 26, 35, 0.18);
}

.ship-info-box strong {
  display: block;
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--ship-color);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-info-box dl {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 3px 7px;
  margin: 0;
  font-size: 11px;
}

.ship-info-box dt {
  color: var(--muted);
  font-weight: 850;
  text-transform: uppercase;
}

.ship-info-box dd {
  margin: 0;
  overflow: hidden;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading {
  left: 50%;
  top: 50%;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  transform: translate(-50%, -50%);
}

.loading.hidden {
  display: none;
}

.meteo-canvas {
  pointer-events: none;
  mix-blend-mode: multiply;
}

.meteo-legend {
  left: 16px;
  bottom: 16px;
  width: 260px;
  padding: 10px 12px;
}

.meteo-legend.hidden {
  display: none;
}

.meteo-legend strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  text-transform: uppercase;
}

.meteo-legend span {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #36c779, #f2d14c, #e26d4f, #9643ab);
}

.meteo-legend small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.meteo-legend a {
  color: #17394c;
  font-weight: 900;
}

.snapshot-dock {
  display: none;
}

.hazard-summary {
  position: absolute;
  z-index: 900;
  left: 16px;
  bottom: 18px;
  width: min(760px, calc(100vw - 370px));
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 8px;
  padding: 10px;
  color: #eefaff;
  background: rgba(7, 21, 37, 0.92);
  box-shadow: 0 12px 30px rgba(3, 16, 24, 0.3);
  backdrop-filter: blur(14px);
}

.hazard-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hazard-summary-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.hazard-summary strong {
  flex: 0 0 auto;
  color: #fbbf24;
  font-size: 12px;
}

.hazard-summary span {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazard-summary-head > button,
.hazard-filters button {
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 5px;
  padding: 0 10px;
  color: #dbeafe;
  background: rgba(15, 37, 51, 0.94);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.hazard-filters {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.hazard-filters button {
  flex: 1 1 0;
}

.hazard-filters button.active,
.hazard-filters button:hover,
.hazard-summary-head > button:hover {
  border-color: #22d3ee;
  color: #fff;
  background: #0e7490;
}

.hazard-list {
  max-height: min(290px, 42vh);
  margin-top: 8px;
  overflow-y: auto;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 7px;
}

.hazard-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  border-left: 4px solid var(--event-color);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 37, 51, 0.74);
}

.hazard-card > button {
  min-width: 0;
  border: 0;
  padding: 8px 10px;
  color: #eefaff;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.hazard-card b,
.hazard-card small {
  display: block;
}

.hazard-card b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hazard-card b span {
  display: inline-block;
  min-width: 34px;
  margin-right: 7px;
  color: var(--event-color);
}

.hazard-card small {
  margin-top: 3px;
  color: #9fb4c2;
  font-size: 9px;
}

.hazard-card > a {
  color: #7dd3fc;
  font-size: 18px;
  text-align: center;
  text-decoration: none;
}

.hazard-empty {
  margin: 8px;
  color: #9fb4c2;
  font-size: 11px;
}

.hazard-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--hazard-color, #f59e0b);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hazard-color, #f59e0b) 25%, transparent), 0 7px 18px rgba(2, 12, 20, 0.28);
  font-size: 10px;
  font-weight: 900;
}

.hazard-marker.tsunami::after {
  position: absolute;
  top: 30px;
  border-radius: 4px;
  padding: 2px 4px;
  content: "TSU";
  color: #fff;
  background: #b91c1c;
  font-size: 8px;
}

body.snapshot-mode {
  background: #0b1b25;
}

body.snapshot-mode #windy {
  height: calc(100% - 168px);
}

body.snapshot-mode .windy-header,
body.snapshot-mode .vessel-panel {
  display: none;
}

body.snapshot-mode .hazard-filters,
body.snapshot-mode #hazardDetailsBtn,
body.snapshot-mode .hazard-list {
  display: none;
}

body.snapshot-mode .track-panel {
  top: 14px;
  left: 14px;
  display: block;
  max-width: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.snapshot-mode .track-presets {
  display: none;
}

body.snapshot-mode #trackStatus {
  display: inline-flex;
  align-items: center;
  min-width: 188px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(7, 24, 36, 0.88);
  color: #f3fbff;
  font-size: 12px;
  box-shadow: 0 8px 22px rgba(4, 18, 28, 0.22);
}

body.snapshot-mode .meteo-legend {
  left: 18px;
  bottom: 184px;
}

body.snapshot-mode .hazard-summary {
  top: 14px;
  right: 14px;
  bottom: auto;
  left: auto;
  max-width: 720px;
  min-height: 34px;
  border-color: rgba(245, 158, 11, 0.74);
  background: rgba(7, 21, 37, 0.95);
}

body.snapshot-mode .ship-info-box {
  display: none;
}

body.snapshot-mode .ship-arrow-wrap {
  transform: scale(1.08);
}

body.snapshot-mode .snapshot-dock {
  position: absolute;
  z-index: 1100;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  height: 168px;
  flex-direction: column;
  border-top: 1px solid #244150;
  padding: 11px 18px 13px;
  color: #f4fbff;
  background: #081a25;
  box-shadow: 0 -12px 30px rgba(3, 16, 24, 0.22);
}

body.snapshot-mode .snapshot-dock-head {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 7px;
}

body.snapshot-mode .snapshot-dock-head strong {
  font-size: 14px;
  font-weight: 850;
}

body.snapshot-mode .snapshot-dock-head span {
  color: #8fb0bf;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

body.snapshot-mode .snapshot-dock-list {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.snapshot-mode .snapshot-vessel {
  min-width: 0;
  border: 1px solid #284552;
  border-left: 4px solid var(--ship-color);
  border-radius: 6px;
  padding: 8px 12px 9px;
  background: #0d2432;
}

body.snapshot-mode .snapshot-vessel-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.snapshot-mode .snapshot-vessel-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ship-color);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.snapshot-mode .snapshot-source {
  flex: 0 0 auto;
  border: 1px solid rgba(72, 214, 154, 0.42);
  border-radius: 999px;
  padding: 3px 7px;
  color: #70e4b4;
  background: rgba(20, 128, 88, 0.16);
  font-size: 9px;
  font-weight: 850;
}

body.snapshot-mode .snapshot-source.waiting {
  border-color: rgba(245, 181, 65, 0.45);
  color: #f6ca73;
  background: rgba(148, 91, 12, 0.2);
}

body.snapshot-mode .snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 7px 0 0;
}

body.snapshot-mode .snapshot-metric {
  min-width: 0;
}

body.snapshot-mode .snapshot-metric dt {
  margin: 0 0 1px;
  color: #7fa2b2;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

body.snapshot-mode .snapshot-metric dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #f6fbfd;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .windy-header {
    flex-direction: column;
  }

  .track-panel {
    top: 146px;
    right: 16px;
    max-width: none;
  }

  .vessel-panel {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    width: auto;
    max-height: 260px;
  }

  .hazard-summary {
    left: 16px;
    right: 16px;
    bottom: 292px;
    width: auto;
  }

  .hazard-summary-head > div {
    display: block;
  }

  .hazard-summary span {
    display: block;
    margin-top: 3px;
    max-width: calc(100vw - 120px);
  }

  .hazard-filters {
    overflow-x: auto;
  }

  .hazard-filters button {
    flex: 0 0 74px;
  }
}

@media (max-width: 560px) {
  .hazard-summary {
    padding: 8px;
  }

  .hazard-list {
    max-height: 180px;
  }
}

/* 2026-08-20 map-first command layout */
:root {
  --navy-950: #04131d;
  --navy-900: #071d29;
  --navy-800: #0b2a39;
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --amber: #fbbf24;
  --glass: rgba(5, 24, 35, 0.91);
  --glass-line: rgba(103, 232, 249, 0.28);
}

.windy-header,
.track-panel,
.hazard-side-panel,
.hazard-summary,
.meteo-legend {
  color: #eefaff;
  border-color: var(--glass-line);
  background: linear-gradient(145deg, rgba(5, 24, 35, 0.95), rgba(8, 42, 55, 0.88));
  box-shadow: 0 16px 42px rgba(1, 10, 17, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(145%);
}

.windy-header {
  top: 12px;
  right: 12px;
  left: 12px;
  min-height: 64px;
  align-items: center;
  border-radius: 13px;
  padding: 9px 10px 9px 14px;
}

.windy-brand,
.header-actions,
.map-actions,
.live-status,
.hazard-side-actions {
  display: flex;
  align-items: center;
}

.windy-brand {
  min-width: 238px;
  gap: 14px;
}

.windy-header p {
  color: #68d9eb;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.windy-header h1 {
  margin-top: 3px;
  color: #fff;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.live-status {
  flex: 0 0 auto;
  gap: 6px;
  border: 1px solid rgba(52, 211, 153, 0.34);
  border-radius: 999px;
  padding: 5px 8px;
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.35);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12), 0 0 12px #34d399;
}

.live-status.is-error {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
  background: rgba(127, 29, 29, 0.34);
}

.live-status.is-error i {
  background: #fb7185;
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
}

.header-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
}

.map-actions {
  min-width: 0;
  gap: 5px;
}

.map-actions > * {
  flex: 0 0 auto;
}

.windy-header button,
.windy-header a,
.track-btn,
.hazard-toggle {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(148, 215, 229, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  color: #c9e4ed;
  background: rgba(17, 54, 68, 0.72);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.windy-header button.active,
.windy-header button:hover,
.windy-header a:hover,
.track-btn.active,
.track-btn:hover,
.hazard-toggle:hover {
  border-color: rgba(103, 232, 249, 0.64);
  color: #03131c;
  background: linear-gradient(135deg, #67e8f9, #22d3ee);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
}

.windy-header .nav-link {
  border-color: rgba(103, 232, 249, 0.24);
  color: #9ce9f4;
  background: rgba(8, 72, 91, 0.48);
}

.control-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: rgba(148, 215, 229, 0.18);
}

.hazard-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.hazard-toggle span,
.hazard-fab b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #071d29;
  background: var(--amber);
  font-size: 10px;
}

.track-panel {
  top: 88px;
  left: 12px;
  max-width: calc(100vw - 428px);
  gap: 7px;
  border-radius: 11px;
  padding: 7px;
}

.track-label {
  padding: 0 5px;
  color: #6cdce9;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.track-btn {
  width: 46px;
  height: 30px;
  flex: 0 0 46px;
  padding: 0 7px;
  border-radius: 7px;
  cursor: pointer;
}

#trackStatus {
  padding: 0 5px;
  color: #a8c8d3;
  font-size: 10px;
}

.hazard-side-panel {
  top: 88px;
  right: 12px;
  bottom: 54px;
  width: 390px;
  max-height: none;
  border-radius: 13px;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(.22,.7,.24,1);
}

.hazard-side-head {
  min-height: 65px;
  border-bottom-color: rgba(103, 232, 249, 0.18);
  padding: 12px 12px 10px 14px;
  background: linear-gradient(135deg, rgba(9, 51, 66, 0.94), rgba(5, 27, 39, 0.96));
}

.hazard-side-head p {
  color: #67d8e8;
  font-size: 8px;
  letter-spacing: 0.15em;
}

.hazard-side-head h2 {
  color: #fff;
  font-size: 19px;
}

.hazard-side-actions {
  gap: 7px;
}

#hazardSideCount {
  min-width: 34px;
  height: 34px;
  color: #05202d;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.28);
}

#hazardPanelClose {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(148, 215, 229, 0.2);
  border-radius: 9px;
  padding: 0 0 3px;
  color: #b9d9e4;
  background: rgba(10, 40, 52, 0.78);
  font-size: 22px;
  cursor: pointer;
}

#hazardPanelClose:hover {
  color: #03131c;
  background: var(--cyan-bright);
}

.hazard-side-panel > #serverClock {
  border-bottom-color: rgba(103, 232, 249, 0.12);
  color: #86acb9;
  background: rgba(4, 22, 32, 0.86);
}

.side-hazard-list {
  max-height: none;
  height: calc(100% - 100px);
  padding: 8px;
  scrollbar-color: rgba(103, 232, 249, 0.42) transparent;
}

.side-hazard-card {
  border-color: rgba(148, 215, 229, 0.16);
  border-left-color: var(--event-color);
  border-radius: 8px;
  background: rgba(9, 42, 55, 0.76);
}

.side-hazard-card > button {
  color: #f0fbff;
}

.side-hazard-card > button:hover {
  background: rgba(17, 78, 96, 0.74);
}

.side-hazard-copy small {
  color: #91b3be;
}

.side-hazard-card > a {
  border-left-color: rgba(148, 215, 229, 0.14);
  color: #67e8f9;
  background: rgba(5, 31, 43, 0.8);
}

.hazard-summary {
  bottom: 50px;
  left: 12px;
  width: min(780px, calc(100vw - 428px));
  border-radius: 11px;
  padding: 9px 10px;
}

.hazard-summary strong {
  color: #ffd34d;
}

.hazard-filters button {
  border-radius: 7px;
  color: #c4e2ea;
  background: rgba(10, 48, 62, 0.82);
}

.hazard-filters button.active,
.hazard-filters button:hover {
  border-color: #22d3ee;
  color: #03131c;
  background: #22d3ee;
}

.hazard-fab {
  position: absolute;
  z-index: 980;
  right: 14px;
  bottom: 56px;
  display: none;
  height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(103, 232, 249, 0.48);
  border-radius: 999px;
  padding: 0 8px 0 14px;
  color: #eafdff;
  background: rgba(5, 27, 39, 0.94);
  box-shadow: 0 14px 34px rgba(1, 10, 17, 0.38);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

body.hazards-collapsed .hazard-side-panel {
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(100% + 24px));
}

body.hazards-collapsed .hazard-fab {
  display: inline-flex;
}

body.hazards-collapsed .track-panel,
body.hazards-collapsed .hazard-summary {
  max-width: calc(100vw - 24px);
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 11px 14px;
  color: #dffaff;
  background: rgba(4, 24, 35, 0.94);
}

.loading i {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(103, 232, 249, 0.22);
  border-top-color: #67e8f9;
  border-radius: 50%;
  animation: windy-spin 800ms linear infinite;
}

@keyframes windy-spin { to { transform: rotate(360deg); } }

.ship-arrow-wrap {
  transition: transform 180ms ease, filter 180ms ease;
}

.ship-arrow-wrap.selected {
  filter: drop-shadow(0 0 9px #fff) drop-shadow(0 0 18px var(--ship-color));
}

.ship-arrow-wrap.selected::after {
  position: absolute;
  inset: -5px;
  border: 2px solid #67e8f9;
  border-radius: 50%;
  content: "";
  animation: vessel-focus 1.8s ease-out infinite;
}

@keyframes vessel-focus {
  0% { opacity: 0.85; transform: scale(.78); }
  100% { opacity: 0; transform: scale(1.28); }
}

body.map-density-compact .ship-arrow-wrap {
  transform: scale(.72);
}

body.map-density-medium .ship-arrow-wrap {
  transform: scale(.86);
}

body.map-density-detail .ship-arrow-wrap {
  transform: scale(1);
}

.ship-info-box {
  border-color: rgba(103, 232, 249, 0.28);
  color: #eafdff;
  background: rgba(5, 27, 39, 0.93);
  box-shadow: 0 14px 34px rgba(1, 10, 17, 0.32);
}

.ship-info-box dt {
  color: #81a8b5;
}

.ship-info-box dd {
  color: #f3fcff;
}

.meteo-legend {
  bottom: 138px;
  border-radius: 11px;
}

.meteo-legend small {
  color: #a4c6d1;
}

.meteo-legend a {
  color: #67e8f9;
}

@media (max-width: 1100px) {
  .windy-brand {
    min-width: 204px;
  }

  .live-status {
    display: none;
  }

  .windy-header button,
  .windy-header a {
    padding-right: 9px;
    padding-left: 9px;
  }
}

@media (max-width: 900px) {
  .windy-header {
    top: 8px;
    right: 8px;
    left: 8px;
    display: block;
    min-height: 104px;
    padding: 9px;
  }

  .windy-brand {
    justify-content: space-between;
  }

  .windy-header h1 {
    font-size: 19px;
  }

  .header-actions {
    display: block;
    margin-top: 8px;
  }

  .map-actions {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .map-actions::-webkit-scrollbar {
    display: none;
  }

  .windy-header button,
  .windy-header a {
    flex: 0 0 auto;
    height: 32px;
  }

  .control-divider {
    flex: 0 0 1px;
  }

  .hazard-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 34px !important;
  }

  .track-panel {
    top: 120px;
    right: 8px;
    left: 8px;
    display: grid;
    max-width: none;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 7px;
  }

  .track-label {
    display: none;
  }

  .track-presets {
    flex-wrap: nowrap;
  }

  .track-btn {
    width: 44px;
    flex: 0 0 44px;
  }

  #trackStatus {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hazard-side-panel {
    z-index: 1400;
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: min(72vh, 620px);
    max-height: none;
    transform: translateY(0);
  }

  body.hazards-collapsed .hazard-side-panel {
    transform: translateY(calc(100% + 20px));
  }

  .hazard-summary,
  body.hazards-collapsed .hazard-summary {
    right: 8px;
    bottom: 44px;
    left: 8px;
    width: auto;
    max-width: none;
    padding: 8px;
  }

  .hazard-summary-head > div {
    display: flex;
  }

  .hazard-summary span {
    display: block;
    max-width: calc(100vw - 170px);
    margin-top: 0;
  }

  .hazard-filters {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hazard-filters::-webkit-scrollbar {
    display: none;
  }

  .hazard-filters button {
    flex: 0 0 68px;
  }

  .hazard-fab {
    right: 10px;
    bottom: 142px;
  }

  .meteo-legend {
    bottom: 138px;
    left: 8px;
    width: min(260px, calc(100vw - 16px));
  }
}

.side-hazard-copy b {
  font-size: 12px;
}

.side-hazard-copy small {
  font-size: 9px;
  line-height: 1.28;
}

.side-hazard-copy .hazard-card-kicker {
  margin-bottom: 5px;
}

.side-hazard-copy .hazard-card-kicker em,
.side-hazard-copy .hazard-card-kicker i {
  font-size: 8px;
}

@media (max-width: 560px) {
  .windy-header p {
    font-size: 8px;
  }

  .track-panel {
    grid-template-columns: 1fr;
  }

  .track-presets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .track-btn {
    width: auto;
    min-width: 0;
  }

  #trackStatus {
    text-align: left;
  }

  .hazard-summary span {
    max-width: calc(100vw - 152px);
  }

  .hazard-summary strong {
    font-size: 10px;
  }

  .hazard-summary span,
  .hazard-filters button {
    font-size: 9px;
  }

  .hazard-side-panel {
    height: min(76vh, 640px);
  }
}

@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;
  }
}

/* 2026-08-20 vessel labels and alert hierarchy */
.ship-info-box {
  width: 168px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-top: 3px solid var(--ship-color);
  border-left: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 11px;
  padding: 8px 9px 9px;
  color: #eafdff;
  background: linear-gradient(145deg, rgba(4, 22, 32, 0.96), rgba(8, 45, 57, 0.92));
  box-shadow: 0 14px 32px rgba(1, 10, 17, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(145%);
}

.ship-info-head,
.ship-info-primary,
.ship-info-foot {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.ship-info-head strong {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #f3fcff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ship-info-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 5px;
  color: #061923;
  background: var(--ship-color);
  font-size: 8px;
  font-weight: 950;
}

.ship-info-primary {
  margin-top: 7px;
}

.ship-info-primary b {
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.03em;
}

.ship-info-primary span {
  color: #9bc0ca;
  font-size: 9px;
  font-weight: 850;
}

.ship-info-foot {
  margin-top: 6px;
  border-top: 1px solid rgba(148, 215, 229, 0.13);
  padding-top: 5px;
  color: #87aeba;
  font-size: 8px;
  font-weight: 780;
}

.ship-info-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-hazard-card {
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.side-hazard-card:hover {
  transform: translateX(-2px);
}

.side-hazard-card.severity-critical {
  border-color: rgba(251, 113, 133, 0.38);
  background: linear-gradient(100deg, rgba(127, 29, 29, 0.28), rgba(9, 42, 55, 0.82) 48%);
  box-shadow: inset 3px 0 0 rgba(251, 113, 133, 0.32);
}

.side-hazard-card.severity-high {
  background: linear-gradient(100deg, rgba(154, 52, 18, 0.22), rgba(9, 42, 55, 0.78) 48%);
}

.side-hazard-card > button {
  padding-top: 8px;
  padding-bottom: 8px;
}

.hazard-card-kicker {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.hazard-card-kicker em,
.hazard-card-kicker i {
  overflow: hidden;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hazard-card-kicker em {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 215, 229, 0.22);
  border-radius: 999px;
  padding: 2px 5px;
  color: #b9d7e0;
  background: rgba(15, 45, 58, 0.9);
}

.hazard-card-kicker i {
  min-width: 0;
  color: #6f9caa;
}

.severity-critical .hazard-card-kicker em {
  border-color: rgba(251, 113, 133, 0.48);
  color: #ffe4e6;
  background: rgba(190, 24, 93, 0.46);
}

.severity-high .hazard-card-kicker em {
  border-color: rgba(251, 146, 60, 0.5);
  color: #ffedd5;
  background: rgba(194, 65, 12, 0.44);
}

.severity-advisory .hazard-card-kicker em {
  border-color: rgba(250, 204, 21, 0.44);
  color: #fef9c3;
  background: rgba(133, 77, 14, 0.48);
}

.hazard-distance {
  color: #bdebf3 !important;
  font-weight: 850;
}

.hazard-marker.severity-critical {
  animation: critical-hazard-pulse 1.8s ease-out infinite;
}

.hazard-marker.severity-high {
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hazard-color) 30%, transparent), 0 8px 22px rgba(2, 12, 20, 0.42);
}

@keyframes critical-hazard-pulse {
  0%, 100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--hazard-color) 24%, transparent), 0 7px 18px rgba(2, 12, 20, 0.3); }
  50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--hazard-color) 8%, transparent), 0 10px 28px rgba(2, 12, 20, 0.48); }
}

@media (max-width: 900px) {
  .hazard-filters button {
    flex-basis: 92px;
  }
}
