:root {
  --bg: #07131d;
  --surface: rgba(9, 25, 38, 0.82);
  --surface-strong: rgba(13, 37, 55, 0.95);
  --surface-soft: rgba(129, 183, 214, 0.08);
  --border: rgba(148, 205, 227, 0.18);
  --text: #ebf7ff;
  --muted: #9db8c8;
  --accent: #71e2c2;
  --accent-2: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --page-gutter: 1rem;
  --page-max-width: 1800px;
  --dashboard-left-column: 2fr;
  --dashboard-right-column: 1fr;
  --dashboard-right-min: 300px;
  --dashboard-resizer-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(75, 169, 214, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(113, 226, 194, 0.18), transparent 24%),
    linear-gradient(160deg, #030c14 0%, #07131d 36%, #0c1f2f 100%);
  visibility: hidden;
}

body.i18n-ready {
  visibility: visible;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 80%);
}

.app-shell {
  width: min(var(--page-max-width), calc(100vw - (var(--page-gutter) * 2)));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.hero-main {
  display: grid;
  gap: 14px;
  max-width: 1180px;
}

.site-nav {
  position: sticky;
  top: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(113, 226, 194, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(16, 55, 48, 0.78), rgba(5, 15, 24, 0.9)),
    rgba(5, 15, 24, 0.82);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.site-nav-links,
.control-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav-link,
.analysis-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(5, 15, 24, 0.7);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.site-nav-link.is-active {
  border-color: rgba(113, 226, 194, 0.76);
  background: rgba(113, 226, 194, 0.18);
  box-shadow: inset 0 0 0 1px rgba(113, 226, 194, 0.16);
}

.site-nav-link:hover,
.analysis-link:hover {
  border-color: rgba(113, 226, 194, 0.46);
}

.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(5, 15, 24, 0.7);
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-control select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.inline-control input[type="number"] {
  width: 72px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  text-align: right;
}

.inline-control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.inline-control select option,
.select-wrap select option {
  color: #0b1722;
  background: #f3f8fc;
}

.compact-inline-control {
  padding-inline: 10px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  margin-bottom: 16px;
}

h1 sub {
  font-size: 0.55em;
  line-height: 0;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.hero-copy,
.panel-head p,
.notes-card p,
.interaction-tips,
.status-line {
  color: var(--muted);
  line-height: 1.6;
}

.upload-card,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.upload-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 24px;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(113, 226, 194, 0.18), rgba(6, 17, 26, 0.65)),
    var(--surface-strong);
}

.info-card {
  cursor: default;
  min-height: 0;
  padding: 20px 22px;
  justify-content: flex-start;
}

.source-summary-card {
  width: min(560px, 100%);
  align-items: stretch;
  overflow: visible;
}

.source-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.source-summary-title {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.source-summary-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-info-button,
.source-info-close {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(113, 226, 194, 0.42);
  color: var(--text);
  background: rgba(5, 15, 24, 0.72);
  cursor: pointer;
}

.source-info-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 700;
}

.source-info-button:hover,
.source-info-close:hover {
  border-color: rgba(113, 226, 194, 0.82);
  background: rgba(113, 226, 194, 0.16);
}

.source-month-select {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.source-info-popover {
  position: fixed;
  z-index: 10000;
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(113, 226, 194, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(15, 55, 49, 0.98), rgba(5, 15, 24, 0.98)),
    var(--surface-strong);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.46);
}

.source-info-popover[hidden] {
  display: none;
}

.source-info-popover h3 {
  margin: 0 34px 8px 0;
  color: var(--text);
  font-size: 1rem;
}

.source-info-popover p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.source-info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 1rem;
}

.map-title-source {
  display: grid;
  gap: 10px;
}

.map-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-source-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.source-inline-label {
  align-self: center;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  align-items: start;
}

.info-grid > div:first-child {
  grid-column: 1 / -1;
}

.info-grid > div:nth-child(2),
.info-grid > div:nth-child(6) {
  grid-column: 1 / -1;
}

.info-grid strong {
  display: block;
  margin-top: 4px;
  line-height: 1.3;
  word-break: break-word;
  font-size: 0.82rem;
  font-weight: 500;
}

.select-wrap {
  display: block;
  margin-top: 0;
}

.select-wrap select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(5, 15, 24, 0.8);
  font: inherit;
}

code {
  font-family: "Space Grotesk", monospace;
  font-size: 0.95em;
  color: #d5f8ff;
}

.info-label {
  display: inline-block;
  color: var(--muted);
  font-size: 0.72rem;
}

.upload-card::after,
.card::after {
  content: "";
  position: absolute;
  inset: auto -18% -42% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.18), transparent 70%);
}

.upload-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.upload-subtitle {
  color: var(--muted);
}

#file-input {
  margin-top: 6px;
  color: var(--text);
}

.dashboard {
  display: grid;
  grid-template-columns:
    minmax(0, var(--dashboard-left-column))
    var(--dashboard-resizer-size)
    minmax(var(--dashboard-right-min), var(--dashboard-right-column));
  gap: 12px;
  align-items: stretch;
}

.map-panel,
.stats-card,
.detail-card,
.notes-card {
  padding: 18px;
}

.map-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 840px;
  min-width: 0;
}

.dashboard-resizer {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: var(--dashboard-resizer-size);
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}

.dashboard-resizer::before {
  content: "";
  width: 2px;
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(148, 205, 227, 0.22);
  box-shadow: 0 0 0 1px rgba(5, 15, 24, 0.42);
  transition:
    width 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.dashboard-resizer span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 46px;
  border: 1px solid rgba(148, 205, 227, 0.3);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(113, 226, 194, 0.72), rgba(75, 169, 214, 0.5)),
    rgba(5, 15, 24, 0.9);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  opacity: 0.68;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.dashboard-resizer:hover::before,
.dashboard-resizer:focus-visible::before,
.dashboard-resizer.is-dragging::before {
  width: 4px;
  background: rgba(113, 226, 194, 0.72);
  box-shadow:
    0 0 0 1px rgba(113, 226, 194, 0.28),
    0 0 22px rgba(113, 226, 194, 0.28);
}

.dashboard-resizer:hover span,
.dashboard-resizer:focus-visible span,
.dashboard-resizer.is-dragging span {
  opacity: 1;
  transform: translate(-50%, -50%) scaleX(1.12);
}

body.dashboard-resizing,
body.dashboard-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

@media (min-width: 1500px) {
  :root {
    --page-gutter: 1rem;
    --page-max-width: calc(100vw - 2rem);
  }

  .hero,
  .dashboard,
  .sidebar {
    gap: 16px;
  }

  .dashboard {
    --dashboard-right-min: 320px;
  }

  .map-panel,
  .stats-card,
  .detail-card,
  .notes-card {
    padding: 16px;
  }
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.panel-head h2,
.panel-head p {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel-head h2 {
  margin: 0;
  line-height: 1.2;
}

.panel-head p {
  margin: 6px 0 0;
}

.legend,
.interaction-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.88rem;
}

.sampling-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: -4px 0 12px;
}

.site-color-toolbar {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 205, 227, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.16), rgba(255, 107, 107, 0.08)),
    rgba(5, 15, 24, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.site-color-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-color-copy {
  display: grid;
  gap: 4px;
}

.site-color-copy h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.site-color-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-color-mode-button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 205, 227, 0.28);
  border-radius: 8px;
  background: rgba(5, 15, 24, 0.76);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.site-color-mode-button:hover:not(:disabled) {
  border-color: rgba(113, 226, 194, 0.58);
  color: var(--text);
  background: rgba(113, 226, 194, 0.14);
}

.site-color-mode-button.is-active {
  border-color: rgba(113, 226, 194, 0.76);
  color: var(--text);
  background: rgba(113, 226, 194, 0.2);
  box-shadow: inset 0 0 0 1px rgba(113, 226, 194, 0.16);
}

.site-color-mode-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.site-color-copy p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.site-color-current {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  min-width: 210px;
  border-radius: 14px;
  border: 1px solid rgba(148, 205, 227, 0.18);
  background: rgba(3, 12, 20, 0.72);
  text-align: right;
}

.site-color-current span {
  color: var(--muted);
  font-size: 0.74rem;
}

.site-color-current strong {
  font-size: 0.98rem;
  color: var(--text);
}

.site-color-slider-shell {
  display: grid;
  gap: 10px;
}

.site-color-slider-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.site-color-slider-row span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

#site-color-slider {
  width: 100%;
  height: 24px;
  accent-color: var(--accent);
  cursor: pointer;
  --site-color-slider-progress: 0%;
  --site-slider-left: #4e86ff;
  --site-slider-left-hi: #83c5ff;
  --site-slider-right: rgba(185, 193, 202, 0.55);
  --site-slider-right-deep: rgba(86, 96, 108, 0.72);
}

.site-color-range-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#site-color-slider[type="range"] {
  appearance: none;
  background: transparent;
}

#site-color-slider[type="range"]::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(242, 247, 244, 0.34);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0.02) 42%, rgba(0,0,0,0.24)),
    linear-gradient(90deg,
      var(--site-slider-left-hi) 0%,
      var(--site-slider-left) var(--site-color-slider-progress),
      var(--site-slider-right) var(--site-color-slider-progress),
      var(--site-slider-right-deep) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.28),
    inset 0 -2px 4px rgba(0,0,0,0.34),
    0 8px 22px rgba(21, 64, 150, 0.24);
}

#site-color-slider[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7.5px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 24%, transparent 36%),
    linear-gradient(145deg, #9df6ff, #4b90ff 48%, #2151c8);
  box-shadow:
    0 0 0 5px rgba(78, 134, 255, 0.16),
    0 8px 18px rgba(0,0,0,0.34),
    inset 0 1px 2px rgba(255,255,255,0.72),
    inset 0 -2px 5px rgba(0,0,0,0.25);
  -webkit-appearance: none;
}

#site-color-slider[type="range"]::-moz-range-track {
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(242, 247, 244, 0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0.02) 42%, rgba(0,0,0,0.24)),
    linear-gradient(90deg, var(--site-slider-right), var(--site-slider-right-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.28), inset 0 -2px 4px rgba(0,0,0,0.34);
}

#site-color-slider[type="range"]::-moz-range-progress {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.36), rgba(255,255,255,0.03)), linear-gradient(90deg, var(--site-slider-left-hi), var(--site-slider-left));
}

#site-color-slider[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 24%, transparent 36%),
    linear-gradient(145deg, #9df6ff, #4b90ff 48%, #2151c8);
  box-shadow:
    0 0 0 5px rgba(78, 134, 255, 0.16),
    0 8px 18px rgba(0,0,0,0.34),
    inset 0 1px 2px rgba(255,255,255,0.72),
    inset 0 -2px 5px rgba(0,0,0,0.25);
}

.site-color-time-ticks {
  position: relative;
  display: block;
  height: 27px;
  margin-top: -3px;
}

.site-color-time-ticks[hidden] {
  display: none;
}

.site-color-time-tick {
  display: grid;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  justify-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
}

.site-color-time-tick i {
  width: 1px;
  height: 8px;
  border-radius: 999px;
  background: rgba(242, 247, 244, 0.44);
}

.site-color-time-tick b {
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.site-color-time-tick.is-current {
  color: var(--text);
}

.site-color-time-tick:first-child {
  transform: translateX(0);
  justify-items: start;
}

.site-color-time-tick:last-child {
  transform: translateX(-100%);
  justify-items: end;
}

.site-color-scale {
  display: grid;
  gap: 6px;
}

.site-color-scale-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, #440154 0%, #3b528b 25%, #21918c 50%, #5ec962 75%, #fde725 100%);
}

.site-color-scale-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

.control-note {
  color: var(--accent-2);
  font-size: 0.8rem;
  line-height: 1.35;
  align-self: center;
}

.trajectory-toolbar-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  align-items: stretch;
}

.bucket-equilibrium-control {
  position: relative;
  display: block;
  min-width: 0;
}

.trajectory-toolbar-row > .inline-control,
.bucket-equilibrium-control,
.bucket-equilibrium-shell {
  width: 100%;
}

.trajectory-toolbar-row > .inline-control {
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  box-sizing: border-box;
}

.trajectory-toolbar-row > .inline-control span {
  min-width: 0;
}

.trajectory-toolbar-row > .inline-control select {
  min-width: 0;
  max-width: 58%;
  text-overflow: ellipsis;
}

.bucket-equilibrium-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  max-width: none;
  min-width: 0;
  height: 100%;
  min-height: 56px;
  padding: 9px 10px 9px 12px;
  box-sizing: border-box;
}

.map-grid-shell {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  width: 100%;
  min-height: 56px;
  height: 100%;
}

.map-grid-shell .bucket-equilibrium-toggle {
  flex: 1 1 160px;
}

.bucket-equilibrium-toggle {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  cursor: pointer;
}

.bucket-equilibrium-toggle span {
  line-height: 1.35;
}

.bucket-equilibrium-toggle input[type="checkbox"] {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
}

.bucket-equilibrium-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(122, 142, 158, 0.35);
  border: 1px solid rgba(148, 205, 227, 0.26);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.24);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.bucket-equilibrium-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eaf6ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
  transition: transform 160ms ease;
}

.bucket-equilibrium-toggle input[type="checkbox"]:checked + .bucket-equilibrium-switch {
  border-color: rgba(113, 226, 194, 0.7);
  background: linear-gradient(135deg, rgba(113, 226, 194, 0.92), rgba(54, 144, 212, 0.86));
  box-shadow: 0 0 18px rgba(113, 226, 194, 0.18);
}

.bucket-equilibrium-toggle input[type="checkbox"]:checked + .bucket-equilibrium-switch::after {
  transform: translateX(18px);
}

.bucket-equilibrium-toggle input[type="checkbox"]:focus-visible + .bucket-equilibrium-switch {
  outline: 2px solid rgba(113, 226, 194, 0.72);
  outline-offset: 3px;
}

.bucket-equilibrium-settings-button {
  width: 30px;
  height: 30px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  justify-self: end;
  padding: 0;
  border-radius: 50%;
  flex: 0 0 auto;
  font-size: 0.9rem;
  line-height: 1;
}

.bucket-equilibrium-settings-button span {
  display: grid;
  place-items: center;
  line-height: 1;
}

.bucket-equilibrium-popover {
  width: min(560px, calc(100vw - 40px));
}

.bucket-equilibrium-popover p + .inline-control {
  margin-top: 14px;
}

.bucket-equilibrium-threshold-control {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.bucket-equilibrium-threshold-control span:first-child {
  line-height: 1.4;
}

.bucket-equilibrium-threshold-control input[type="number"] {
  width: 76px;
}

.bucket-equilibrium-threshold-hint {
  margin-top: 10px !important;
  color: var(--accent-2) !important;
  font-size: 0.84rem;
}

.trajectory-toolbar-note {
  display: none;
}

.trajectory-toolbar-warning-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 56px;
  padding: 0 2px;
  box-sizing: border-box;
}

.trajectory-color-help {
  display: none;
}

.legend span,
.interaction-tips span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot,
.legend-line,
.legend-depth,
.legend-bathy {
  display: inline-block;
  flex: 0 0 auto;
}

.start-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(113, 226, 194, 0.7);
}

.legend-line {
  width: 22px;
  height: 2px;
  background: var(--accent-2);
}

.legend-depth {
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d0887 0%, #7e03a8 25%, #cc4778 50%, #f89540 75%, #f0f921 100%);
}

.legend-bathy {
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #06264a 0%, #0f6daa 42%, #6bd5f0 100%);
}

.map-stage {
  position: relative;
  min-height: 0;
}

.map-loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 9;
}

.map-loading-overlay.is-visible {
  opacity: 1;
}

.map-loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(460px, calc(100% - 32px));
  max-width: min(560px, calc(100% - 32px));
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(151, 220, 236, 0.28);
  background: rgba(6, 18, 30, 0.72);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.map-loading-overlay[data-mode="site"] .map-loading-card {
  min-width: 0;
  max-width: min(340px, calc(100% - 48px));
  padding: 14px 16px;
  background: rgba(4, 15, 26, 0.6);
}

.site-color-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  display: grid;
  gap: 4px;
  min-width: min(420px, calc(100% - 36px));
  max-width: min(520px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(151, 220, 236, 0.28);
  background: rgba(5, 16, 27, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  z-index: 8;
}

.site-color-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-color-hint strong {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
}

.site-color-hint span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.map-loading-spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #71e2c2;
  border-right-color: #ffd166;
  animation: map-loading-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.map-loading-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-loading-copy strong {
  color: var(--text);
  font-size: 1rem;
}

.map-loading-copy span {
  color: rgba(222, 239, 246, 0.82);
  font-size: 0.82rem;
  line-height: 1.4;
}

.panel-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 9, 15, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.panel-loading-overlay[hidden] {
  display: none;
}

.panel-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.panel-loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(440px, calc(100% - 24px));
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(151, 220, 236, 0.28);
  background: rgba(5, 16, 27, 0.84);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
}

.panel-loading-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.panel-loading-copy strong {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
}

.panel-loading-copy span {
  color: rgba(222, 239, 246, 0.82);
  font-size: 0.8rem;
  line-height: 1.4;
}

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

#map {
  width: 100%;
  height: 100%;
  min-height: 680px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.minimal-basemap #map,
body.minimal-basemap #map .maplibregl-canvas-container,
body.minimal-basemap #map .maplibregl-canvas {
  background: #f7f8f4;
}

body[data-map-projection="globe"] #map {
  background:
    radial-gradient(circle at 50% 42%, rgba(70, 150, 188, 0.2), transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(3, 9, 18, 0.1), rgba(2, 7, 13, 0.88) 68%),
    #020812;
}

body.minimal-basemap[data-map-projection="globe"] #map {
  background: #02050a;
}

body.minimal-basemap[data-map-projection="globe"] #map .maplibregl-canvas-container,
body.minimal-basemap[data-map-projection="globe"] #map .maplibregl-canvas {
  background: #02050a;
}

.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right {
  top: 14px;
}

.maplibregl-ctrl-top-left {
  left: 14px;
}

.maplibregl-ctrl-top-right {
  right: auto;
  left: 14px;
}

.maplibregl-ctrl-top-left .maplibregl-ctrl,
.maplibregl-ctrl-top-right .maplibregl-ctrl {
  margin: 0;
}

.maplibregl-ctrl-compass {
  display: none !important;
}

.map-side-legends {
  position: absolute;
  top: 16px;
  bottom: 16px;
  right: 16px;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  justify-items: end;
  gap: 12px;
  width: auto;
  pointer-events: none;
}

.side-legend {
  padding: 12px;
  border: 1px solid rgba(148, 205, 227, 0.18);
  border-radius: 16px;
  background: rgba(5, 15, 24, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: fit-content;
  max-width: 15ch;
  justify-self: end;
}

.side-legend-head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  justify-items: center;
}

.side-legend-head h3 {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text);
  max-inline-size: 15ch;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.25;
  text-align: center;
}

.side-legend-head span {
  color: var(--muted);
  font-size: 0.75rem;
  max-inline-size: 15ch;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.3;
  text-align: center;
}

.side-legend-head span:empty {
  display: none;
}

.colorbar-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.bathy-scale-shell {
  display: grid;
  grid-template-columns: 18px minmax(58px, 1fr);
  gap: 10px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.bathy-scale-bar {
  min-height: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.22);
  background: linear-gradient(
    180deg,
    #000a3b 0%,
    #012a62 13%,
    #104587 28%,
    #3570a8 43%,
    #368fbb 58%,
    #2ca2be 72%,
    #4db6c9 84%,
    #72d6e5 92%,
    #b3e1d6 100%
  );
}

.bathy-scale-ticks {
  position: relative;
  min-height: 0;
}

.bathy-tick {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bathy-tick::before {
  content: "";
  width: 10px;
  height: 1px;
  background: rgba(235, 247, 255, 0.38);
  flex: 0 0 auto;
}

.bathy-tick span {
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.colorbar {
  width: 18px;
  min-height: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.08);
}

.bathy-colorbar {
  background: linear-gradient(180deg, #06264a 0%, #0f6daa 48%, #6bd5f0 100%);
}

body.minimal-basemap .bathy-side-legend {
  display: none;
}

.trajectory-colorbar {
  background: linear-gradient(180deg, #f0f921 0%, #f89540 25%, #cc4778 50%, #7e03a8 75%, #0d0887 100%);
}

.colorbar-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  color: var(--muted);
  font-size: 0.76rem;
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.chart {
  width: 100%;
  height: 320px;
  min-width: 0;
  overflow: visible;
}

.small-chart {
  height: 300px;
}

.detail-card {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) minmax(300px, 1fr);
  gap: 14px;
}

.detail-card .chart {
  height: 100%;
  min-height: 300px;
  box-sizing: border-box;
  padding-top: 18px;
}

.notes-card {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.invalid-site-card {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.invalid-site-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.invalid-site-info-button {
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
}

.invalid-site-info-popover {
  width: min(520px, calc(100vw - 40px));
}

.invalid-site-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(280px, auto);
  gap: 14px;
  align-items: stretch;
}

.invalid-site-stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(6, 18, 29, 0.52);
}

.invalid-site-stat strong {
  font-size: 1.4rem;
  line-height: 1;
}

.invalid-threshold-control {
  justify-content: space-between;
  align-self: stretch;
  width: 100%;
}

.invalid-threshold-control span {
  max-width: 24ch;
  line-height: 1.4;
}

.status-line {
  color: var(--accent-2);
}

.selection-box {
  position: absolute;
  border: 1px dashed rgba(113, 226, 194, 0.9);
  background: rgba(113, 226, 194, 0.12);
  pointer-events: none;
  border-radius: 4px;
}

.maplibregl-popup-content {
  background: rgba(5, 15, 24, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.maplibregl-popup-close-button {
  color: var(--text);
}

@media (max-width: 1080px) {
  .hero,
  .dashboard {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dashboard-resizer {
    display: none;
  }

  .invalid-site-grid {
    grid-template-columns: 1fr;
  }

  .map-side-legends {
    width: auto;
  }

  #map {
    min-height: 58vh;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(calc(100vw - 2rem), 1500px);
    padding-top: 14px;
  }

  .upload-card,
  .map-panel,
  .stats-card,
  .detail-card,
  .invalid-site-card,
  .notes-card {
    padding: 14px;
    border-radius: 18px;
  }

  .panel-head {
    flex-direction: column;
  }

  .site-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav-links {
    align-items: stretch;
  }

  .site-nav-link,
  .site-nav .inline-control {
    width: 100%;
    justify-content: space-between;
  }

  .sampling-toolbar {
    grid-template-columns: 1fr;
  }

  .trajectory-toolbar-row,
  .trajectory-toolbar-note {
    grid-template-columns: 1fr;
  }

  .site-color-head {
    flex-direction: column;
  }

  .site-color-current {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .site-color-slider-row {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-grid > div:nth-child(2),
  .info-grid > div:nth-child(6) {
    grid-column: auto;
  }

  .hero-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-control {
    width: 100%;
    justify-content: space-between;
  }

  .map-side-legends {
    position: static;
    width: 100%;
    margin-top: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    grid-template-rows: none;
    pointer-events: auto;
  }
}


/* White background mode */
:root[data-theme="light"] {
  color-scheme: light;
}

.theme-mode-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border, var(--line, rgba(22, 52, 68, 0.16)));
  border-radius: 8px;
  background: rgba(5, 15, 24, 0.7);
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.theme-mode-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-mode-switch {
  position: relative;
  inline-size: 42px;
  block-size: 23px;
  border-radius: 999px;
  border: 1px solid rgba(235, 247, 255, 0.24);
  background: rgba(235, 247, 255, 0.16);
  transition: background 160ms ease, border-color 160ms ease;
}

.theme-mode-switch::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 15px;
  block-size: 15px;
  border-radius: 50%;
  background: #eef8ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-mode-control input:checked + .theme-mode-switch {
  border-color: rgba(15, 128, 109, 0.52);
  background: rgba(15, 128, 109, 0.26);
}

.theme-mode-control input:checked + .theme-mode-switch::after {
  transform: translateX(19px);
  background: #ffffff;
}

html[data-theme="light"] body {
  background: #ffffff !important;
  color: var(--text) !important;
}

html[data-theme="light"] body::before {
  display: none !important;
}

html[data-theme="light"] .theme-mode-control {
  background: #ffffff !important;
  border-color: rgba(21, 47, 61, 0.16) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .theme-mode-switch {
  border-color: rgba(15, 128, 109, 0.35);
  background: rgba(15, 128, 109, 0.15);
}

html[data-theme="light"] .theme-mode-switch::after {
  background: #ffffff;
}

html[data-theme="light"] .js-plotly-plot,
html[data-theme="light"] .js-plotly-plot .main-svg,
html[data-theme="light"] .js-plotly-plot .bg {
  background: #ffffff !important;
  fill: #ffffff !important;
}

html[data-theme="light"] .js-plotly-plot text,
html[data-theme="light"] .js-plotly-plot .gtitle,
html[data-theme="light"] .js-plotly-plot .xtitle,
html[data-theme="light"] .js-plotly-plot .ytitle,
html[data-theme="light"] .js-plotly-plot .legendtext {
  fill: #122333 !important;
  color: #122333 !important;
}

html[data-theme="light"] .js-plotly-plot .gridlayer path {
  stroke: rgba(18, 45, 62, 0.14) !important;
}

html[data-theme="light"] .js-plotly-plot .zerolinelayer path,
html[data-theme="light"] .js-plotly-plot .xlines-above path,
html[data-theme="light"] .js-plotly-plot .ylines-above path {
  stroke: rgba(18, 45, 62, 0.24) !important;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f5f8fb;
  --border: rgba(21, 47, 61, 0.16);
  --text: #122333;
  --muted: #596b78;
  --accent: #0f806d;
  --accent-2: #9a6a00;
  --danger: #b83b3b;
  --shadow: 0 10px 30px rgba(15, 45, 62, 0.08);
}

html[data-theme="light"] .site-nav {
  background: #ffffff !important;
  border-color: rgba(21, 47, 61, 0.14) !important;
  box-shadow: 0 10px 30px rgba(15, 45, 62, 0.08) !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] .site-nav-link,
html[data-theme="light"] .analysis-link,
html[data-theme="light"] .inline-control,
html[data-theme="light"] .select-wrap,
html[data-theme="light"] .compact-map-control,
html[data-theme="light"] .layer-toggle,
html[data-theme="light"] .site-color-mode-button,
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .control-card,
html[data-theme="light"] .source-info-popover,
html[data-theme="light"] .detail-loading-toast,
html[data-theme="light"] .detail-loading-popover,
html[data-theme="light"] .invalid-site-stat,
html[data-theme="light"] .trajectory-detail-card,
html[data-theme="light"] .summary-card,
html[data-theme="light"] .map-style-control {
  background: #ffffff !important;
  border-color: rgba(21, 47, 61, 0.14) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .site-nav-link.is-active,
html[data-theme="light"] .layer-toggle.is-active,
html[data-theme="light"] .site-color-mode-button.is-active,
html[data-theme="light"] .site-color-mode-button[aria-pressed="true"] {
  background: rgba(15, 128, 109, 0.12) !important;
  border-color: rgba(15, 128, 109, 0.42) !important;
}

html[data-theme="light"] .inline-control select,
html[data-theme="light"] .inline-control input,
html[data-theme="light"] .select-wrap select,
html[data-theme="light"] button,
html[data-theme="light"] select,
html[data-theme="light"] input {
  color: var(--text) !important;
}

html[data-theme="light"] .map-stage,
html[data-theme="light"] .map-shell,
html[data-theme="light"] #map,
html[data-theme="light"] .chart,
html[data-theme="light"] .trajectory-chart,
html[data-theme="light"] .site-detail-chart,
html[data-theme="light"] .map-panel {
  background: #ffffff !important;
}

html[data-theme="light"] .hero,
html[data-theme="light"] .dashboard,
html[data-theme="light"] .app-shell {
  background-image: none !important;
}

html[data-theme="light"] .status-line,
html[data-theme="light"] .muted,
html[data-theme="light"] .info-label,
html[data-theme="light"] .legend,
html[data-theme="light"] .panel-head p {
  color: var(--muted) !important;
}
/* End white background mode */

/* White mode visibility repair */
html[data-theme="light"] .source-info-button,
html[data-theme="light"] .source-info-close,
html[data-theme="light"] .map-loading-card,
html[data-theme="light"] .site-color-hint,
html[data-theme="light"] .site-color-current {
  background: #ffffff !important;
  border-color: rgba(18, 45, 62, 0.24) !important;
  color: #122333 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .source-info-button:hover,
html[data-theme="light"] .source-info-close:hover {
  background: rgba(15, 128, 109, 0.12) !important;
  border-color: rgba(15, 128, 109, 0.45) !important;
}

html[data-theme="light"] .site-color-toolbar {
  background: #f7fafb !important;
  border-color: rgba(18, 45, 62, 0.18) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .site-color-copy h3,
html[data-theme="light"] .site-color-current strong,
html[data-theme="light"] .site-color-hint strong,
html[data-theme="light"] .site-color-time-tick.is-current {
  color: #122333 !important;
}

html[data-theme="light"] .site-color-copy p,
html[data-theme="light"] .site-color-current span,
html[data-theme="light"] .site-color-slider-row span,
html[data-theme="light"] .site-color-hint span,
html[data-theme="light"] .site-color-time-tick,
html[data-theme="light"] .site-color-scale-ticks {
  color: #526979 !important;
}

html[data-theme="light"] .site-color-time-tick i {
  background: rgba(18, 45, 62, 0.38) !important;
}

html[data-theme="light"] #site-color-slider {
  --site-slider-left: #1167b1;
  --site-slider-left-hi: #4f98d7;
  --site-slider-right: rgba(18, 45, 62, 0.22);
  --site-slider-right-deep: rgba(18, 45, 62, 0.36);
}

html[data-theme="light"] #site-color-slider[type="range"]::-webkit-slider-runnable-track {
  border-color: rgba(18, 45, 62, 0.28) !important;
  background: linear-gradient(90deg, var(--site-slider-left-hi) 0%, var(--site-slider-left) var(--site-color-slider-progress), var(--site-slider-right) var(--site-color-slider-progress), var(--site-slider-right-deep) 100%) !important;
  box-shadow: none !important;
}

html[data-theme="light"] #site-color-slider[type="range"]::-moz-range-track {
  border-color: rgba(18, 45, 62, 0.28) !important;
  background: linear-gradient(90deg, var(--site-slider-right), var(--site-slider-right-deep)) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .legend-line,
html[data-theme="light"] .legend-bathy {
  border-color: #334b5c !important;
  background: #334b5c !important;
}

html[data-theme="light"] .maplibregl-ctrl button,
html[data-theme="light"] .maplibregl-ctrl-group button,
html[data-theme="light"] .maplibregl-ctrl-attrib-button {
  background-color: #ffffff !important;
  color: #122333 !important;
}

html[data-theme="light"] .maplibregl-ctrl button span,
html[data-theme="light"] .maplibregl-ctrl button::before,
html[data-theme="light"] .maplibregl-ctrl button::after {
  filter: invert(1) grayscale(1) contrast(1.8) !important;
}
/* End white mode visibility repair */

/* White mode visibility repair: targeted residual controls */
html[data-theme="light"] #month-select,
html[data-theme="light"] .source-month-select select,
html[data-theme="light"] .select-wrap select {
  background: #ffffff !important;
  border: 1px solid rgba(18, 45, 62, 0.18) !important;
  color: #122333 !important;
  box-shadow: none !important;
}
/* End targeted residual controls */
