


#map-pane {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--sea);
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}







#boat-box {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 26;
  display: flex;
  flex-direction: column;
  width: 412px;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--data-boat);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 8px 12px 10px;
  font-size: 13px;
  line-height: 1.25;
}
#boat-box[hidden] { display: none; }

@media (max-width: 600px) { #boat-box { width: 264px; } }
@media (pointer: coarse) and (max-height: 500px) { #boat-box { width: 600px; } }



#boat-box { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#boat-box-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(44px / var(--bb-s, 1));
  height: calc(44px / var(--bb-s, 1));
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  cursor: nwse-resize;
  touch-action: none;
}
#boat-box-grip svg {
  width: calc(12px / var(--bb-s, 1));
  height: calc(12px / var(--bb-s, 1));
  margin: calc(5px / var(--bb-s, 1));
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
}

#boat-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

#boat-box-time {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

#boat-box-model { color: var(--muted); font-size: 12px; }

.bb-model-mark { display: inline-block; vertical-align: 0; margin-right: 5px; overflow: visible; }

#boat-box-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

#boat-box-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 12px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  #boat-box { font-size: 12px; padding: 6px 10px 8px; }
  #boat-box-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
}

@media (pointer: coarse) and (max-height: 500px) {
  #boat-box { font-size: 12px; padding: 6px 10px 8px; }
  #boat-box-lines { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px 10px; }
}

.bb-cell { display: flex; flex-direction: column; min-width: 0; }
.bb-label { color: var(--muted); font-size: 11px; }
.bb-value { overflow-wrap: anywhere; }
.bb-label + .bb-value { font-weight: 600; }
.bb-value + .bb-value { font-size: 12px; }


.bb-tack {
  display: inline-block;
  min-width: 15px;
  padding: 0 3px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  color: #ffffff;
  text-shadow: none;
}
.bb-tack-s { background: var(--data-starboard); }
.bb-tack-p { background: var(--data-port); }

#boat-box-close {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -6px -10px 0 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

#boat-box-close:hover { color: var(--ink); }

@media (pointer: coarse) {
  #boat-box-close { width: 44px; height: 44px; margin: -12px -14px -10px 0; font-size: 24px; }
}

#map-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#map-controls button {
  width: 36px;
  height: 36px;
  font-size: 19px;
  line-height: 1;
  padding: 0;
  letter-spacing: 0;
}

#wx-bar {
  position: absolute;
  left: 14px;
  right: 60px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 7px 12px;
}

#wx-bar select { width: auto; flex: 0 0 auto; }






#wx-source {
  flex: 0 0 auto;
  width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#wx-back, #wx-fwd {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
}
#wx-time { flex: 1 1 auto; min-width: 0; accent-color: var(--accent); }
#wx-back, #wx-fwd { flex: 0 0 auto; }
#wx-time-label {
  flex: 0 0 auto;
  width: 178px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

#wx-legend {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 160px;
  position: relative;
  font-size: 10px;
  color: var(--muted);
}

#wx-legend .legend-bar {
  height: 9px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

#wx-legend .legend-ticks {
  position: relative;
  height: 12px;
}

#wx-legend .legend-ticks span {
  position: absolute;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}

#wx-legend .legend-unit {
  position: absolute;
  right: 0;
  top: -13px;
  font-weight: 600;
}

#wx-source { white-space: nowrap; }



#route-key {
  position: absolute;
  right: 14px;
  top: 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 7px 10px;
  font-size: 11px;
  color: var(--body-text);
  line-height: 1.7;
  white-space: nowrap;
}

#route-key div {
  display: flex;
  align-items: center;
  gap: 7px;
}

#route-key .key-line {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
}
#route-key .key-models {
  display: block;
  border-top: 1px solid var(--border);
  margin-top: 3px;
  padding-top: 3px;
}



#route-key .key-depth[hidden] { display: none; }
#route-key .key-depth-mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 5px;
  box-sizing: border-box;
  background: var(--fail);
  border: 1.5px solid var(--bg);
  border-radius: 50%;
}


#route-key {
  --data-thunder-possible: #FBC02D;
  --data-thunder-likely: #E53935;
}
#route-key .key-thunder[hidden] { display: none; }
#route-key .key-thunder-mark {
  display: inline-block;
  width: 18px;
  height: 8px;
  box-sizing: border-box;
  border: 1.5px solid var(--bg);
  border-radius: 4px;
}
#route-key .key-thunder-possible .key-thunder-mark { background: var(--data-thunder-possible); }
#route-key .key-thunder-likely .key-thunder-mark { background: var(--data-thunder-likely); }

#route-key .key-thunder-mark[hidden],
#route-key .key-thunder-bolt[hidden] { display: none; }
#route-key .key-thunder-bolt { margin: 0 2px 0 4px; vertical-align: -1px; }
#route-key .key-thunder-bolt svg { stroke: var(--bg); stroke-width: 2px; paint-order: stroke; }


#route-key .key-climate[hidden] { display: none; }
#route-key .key-climate-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 5px;
  box-sizing: border-box;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
}


.depth-box {
  position: absolute;
  right: 60px;
  top: 14px;
  z-index: 26;
  max-width: 260px;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--fail);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 8px 12px 10px;
  font-size: 13px;
  color: var(--body-text);
}
.depth-box[hidden] { display: none; }
.depth-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.depth-title { color: var(--ink); }
.depth-text { margin: 4px 0 0; line-height: 1.45; }
.depth-close {
  width: 28px;
  height: 28px;
  margin: -6px -8px -4px 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.depth-close:hover { color: var(--ink); }
@media (pointer: coarse) {
  .depth-close { width: 44px; height: 44px; margin: -12px -12px -10px 0; font-size: 24px; }
}
