/* The chart panel: extent switcher, layer toggles, map, fix scrubber. */
.chart {
  overflow: hidden;
}

.chart-bar {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s3);
}

@media (min-width: 1000px) {
  .chart-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2) var(--s4);
  }
}

/* ---------- legend: static keys plus layer toggles ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.key {
  --c: var(--track);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-2);
}

button.key {
  border-color: var(--rule);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button.key:hover {
  border-color: var(--ink-2);
}

button.key[aria-pressed="false"] {
  color: var(--ink-3);
  background: transparent;
  border-style: dashed;
}

button.key[aria-pressed="false"] .sw {
  opacity: 0.35;
}

button.key[aria-pressed="false"] .label {
  text-decoration: line-through;
}

@media (pointer: coarse) {
  button.key {
    padding: 8px 10px;
  }
}

.sw {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top: 3px solid var(--c);
}

.sw.dash {
  border-top-style: dashed;
}

.sw.dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--c);
}

.sw.box {
  height: 10px;
  border: 0;
  background: var(--calm-soft);
  outline: 1px solid var(--calm);
}

.c-track {
  --c: var(--track);
}

.c-ink {
  --c: var(--ink-3);
}

.c-fix {
  --c: var(--fix);
}

.c-storm {
  --c: var(--storm);
}

/* ---------- map (Leaflet) ---------- */
.canvas-box {
  position: relative;
  aspect-ratio: 1000 / 720;
  max-width: 100%;
  border-block: 1px solid var(--rule);
  background: var(--water);
}

@media (max-width: 600px) {
  .canvas-box {
    aspect-ratio: 1 / 1;
  }
}

.map {
  position: absolute;
  inset: 0;
  background: var(--water);
  font-family: var(--body);
  font-size: 12px;
  color: var(--ink);
}

.map:focus-visible {
  outline: 2px solid var(--fix);
  outline-offset: -2px;
}

.map .leaflet-control-layers,
.map .leaflet-bar,
.map .leaflet-control-scale-line {
  font-family: var(--mono);
}

/* Text labels on the map: small pills that stay readable over the ocean chart and the satellite imagery. */
.map .lbl {
  padding: 1px 5px;
  border: 0;
  border-radius: 4px;
  background: rgb(255 255 255 / 0.82);
  box-shadow: none;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  color: #1d2a36;
}

.map .lbl::before {
  display: none;
}

.map .lbl.lbl-hidden {
  visibility: hidden;
}

.map .lbl.boat {
  font-family: var(--body);
  font-size: 12px;
  color: #b23a12;
}

.map .lbl.storm {
  font-family: var(--body);
  font-weight: 600;
  color: #b3122a;
}

.map .lbl.calm {
  color: #7a5d12;
}

.map .lbl.dr {
  color: #4a5865;
}

.map .fixtip {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

.map .fixtip::before {
  border-top-color: var(--ink);
}

.map .wind-arrow svg {
  width: 60px;
  height: 60px;
  overflow: visible;
  stroke: #c2410c; /* fixed like the other map overlays, see C in js/chart/index.js */
  stroke-width: 2;
  fill: #c2410c;
}

/* ---------- fix scrubber ---------- */
.fixbar {
  display: grid;
  gap: var(--s2);
  padding: var(--s3);
}

.fix-scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s3);
}

.fix-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
}

.fixinfo {
  flex: 1 1 320px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
}

.fixinfo b {
  font-weight: 500;
  color: var(--fix);
}

.fix-actions {
  display: flex;
  gap: var(--s2);
}

@media (max-width: 600px) {
  .fix-actions {
    flex: 1 1 100%;
  }
  .fix-actions .btn {
    flex: 1;
  }
}

.scrub {
  --p: 100%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.scrub::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--track) var(--p), var(--rule) var(--p));
}

.scrub::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
}

.scrub::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--track);
}

.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--fix);
  box-shadow: 0 0 0 1px var(--fix);
}

.scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--fix);
  box-shadow: 0 0 0 1px var(--fix);
}

.scrub:focus-visible {
  outline-offset: 0;
  border-radius: 4px;
}

.chart-foot {
  margin: 0;
  padding: var(--s1) var(--s3) var(--s3);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.chart-foot a {
  color: inherit;
}
