:root {
  --bg: #07131d;
  --panel: rgba(15, 24, 29, 0.93);
  --panel-strong: rgba(22, 34, 40, 0.97);
  --line: rgba(211, 228, 220, 0.17);
  --text: #f2f7f4;
  --muted: #a9b8b1;
  --accent: #63d6b6;
  --amber: #f2c86f;
  --blue: #7ab8f2;
  --coral: #ef7f70;
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.3);
  --gutter: 1rem;
  --max-width: 1800px;
  --map-detail-height: 840px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  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%);
  font-family: "Noto Sans SC", "Space Grotesk", sans-serif;
}

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%);
}

button,
select {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 1050px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.04rem;
}

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

.benchmark-hero {
  padding-bottom: 18px;
}

.topbar,
.nav-links,
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid rgba(99, 214, 182, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(16, 55, 48, 0.78), rgba(8, 14, 15, 0.9)),
    rgba(8, 14, 15, 0.82);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.main-link,
.status-pill,
.control-card,
.panel,
.stat {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.main-link,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.main-link:hover {
  border-color: rgba(99, 214, 182, 0.55);
}

.main-link.is-active {
  border-color: rgba(99, 214, 182, 0.7);
  background: rgba(99, 214, 182, 0.14);
}

.status-pill {
  color: var(--muted);
  box-shadow: none;
}

.bucket-variant-control {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-size: 0.82rem;
}

.bucket-variant-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 16, 0.72);
}

.bucket-variant-toggle button {
  min-width: 68px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.bucket-variant-toggle button:hover,
.bucket-variant-toggle button:focus-visible {
  color: var(--text);
  outline: 0;
}

.bucket-variant-toggle button.is-active {
  color: var(--text);
  background: rgba(99, 214, 182, 0.18);
  box-shadow: inset 0 0 0 1px rgba(99, 214, 182, 0.34);
}

.bucket-height-control {
  display: inline-grid;
  grid-template-columns: auto minmax(120px, 176px);
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.bucket-height-control[hidden] {
  display: none;
}

.bucket-height-control select {
  min-height: 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 560px);
  gap: 18px;
  align-items: stretch;
}

.benchmark-page .hero-grid {
  grid-template-columns: minmax(0, 1fr);
}

.benchmark-page .hero-grid .control-card:not(.is-sidebar-control) {
  display: none;
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 18px;
  align-items: end;
}

.title-row h1 {
  max-width: none;
}

.title-month-control {
  position: relative;
  align-self: end;
  min-width: 0;
}

.title-month-control > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.month-select-native {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.month-button-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.month-button {
  min-height: 46px;
  border: 1px solid rgba(211, 228, 220, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(7, 12, 14, 0.58);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.month-button:hover {
  border-color: rgba(99, 214, 182, 0.52);
  color: var(--text);
}

.month-button.is-active {
  border-color: rgba(99, 214, 182, 0.82);
  color: #f7fffb;
  background:
    linear-gradient(135deg, rgba(99, 214, 182, 0.28), rgba(122, 184, 242, 0.16)),
    rgba(12, 25, 29, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-copy,
.status-line,
.panel-head p,
.stat small,
.site-detail-grid span {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy {
  max-width: 940px;
  margin-top: 12px;
}

.control-card,
.panel,
.stat {
  border-radius: 8px;
}

.control-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--panel-strong);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.inline-control {
  display: inline-grid;
  grid-template-columns: auto minmax(120px, 170px);
  align-items: center;
  gap: 8px;
}

.inline-control select {
  min-height: 40px;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(9, 14, 16, 0.84);
  outline: 0;
}

select option {
  color: #101719;
  background: #f4f7f2;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  min-height: 116px;
  padding: 14px;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat strong {
  display: block;
  margin: 8px 0 4px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
}

.main-grid,
.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(360px, 0.66fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timeseries-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.timeseries-grid .chart {
  min-height: 460px;
}

.benchmark-page .main-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(340px, 0.58fr);
}

.online-hero-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 380px);
}

.online-hero-grid h1 {
  max-width: 1180px;
  font-size: clamp(2rem, 3.15vw, 3.25rem);
  line-height: 1.05;
  text-wrap: balance;
  white-space: pre-line;
}

.online-control-card {
  align-content: start;
}

.online-note-card {
  align-content: center;
}

.online-note-card .status-line {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.single-row-controls {
  grid-template-columns: 1fr;
}

.online-summary-grid {
  margin-top: 0;
}

.online-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.online-chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 570px;
}

.online-chart-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  align-items: start;
}

.online-chart-panel .panel-head > div {
  min-width: 0;
}

.online-chart-panel .panel-head p {
  max-width: 760px;
}

.online-chart-panel .panel-control {
  justify-self: end;
  grid-template-columns: auto minmax(190px, 230px);
  max-width: 100%;
}

.online-chart-panel .chart {
  flex: 1 1 auto;
  height: 480px;
  min-height: 480px;
}

.online-map-panel {
  margin-bottom: 18px;
}

.online-map-panel .map-panel-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 760px) minmax(240px, 1fr);
  align-items: start;
  gap: 10px 16px;
}

.online-map-panel .map-panel-head > div {
  grid-column: 1;
}

.online-map-panel .timeline-control {
  grid-column: 2;
}

.timeline-control {
  flex: 0 1 auto;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  gap: 4px 12px;
  padding: 0;
}

.timeline-control > span {
  font-size: 0.9rem;
}

.timeline-control input {
  grid-column: 1 / -1;
  width: 100%;
  height: 26px;
  accent-color: var(--accent);
  cursor: pointer;
}

.timeline-control input[type="range"] {
  appearance: none;
  background: transparent;
}

.timeline-control strong {
  justify-self: end;
  color: var(--text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.9rem;
}

.timeline-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(242, 247, 244, 0.28);
  background: linear-gradient(90deg, rgba(99, 214, 182, 0.9), rgba(242, 247, 244, 0.58));
}

.timeline-control input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 214, 182, 0.14);
  -webkit-appearance: none;
}

.timeline-control input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(242, 247, 244, 0.28);
  background: linear-gradient(90deg, rgba(99, 214, 182, 0.9), rgba(242, 247, 244, 0.58));
}

.timeline-control input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 214, 182, 0.14);
}

.timeline-ticks {
  position: relative;
  display: block;
  grid-column: 1 / -1;
  height: 27px;
  margin-top: -3px;
}

.timeline-ticks[hidden] {
  display: none;
}

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

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

.timeline-tick b {
  min-height: 0.8rem;
  font: inherit;
  font-weight: 700;
}

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

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

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

.map-status {
  margin-bottom: 12px;
}

.dual-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.map-pane {
  min-width: 0;
}

.map-pane h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.spatial-map {
  min-height: 460px;
}

.cesm2-shell .benchmark-hero {
  padding-bottom: 34px;
}

.cesm2-global-panel {
  margin-top: 24px;
}

.cesm2-panel-head {
  align-items: flex-start;
  gap: 18px;
}

.cesm2-control-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(28, 43, 39, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.segmented-control button {
  min-width: 48px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #52615d;
  font: 700 0.78rem/1 "Space Grotesk", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
  cursor: pointer;
}

.segmented-control button:hover,
.segmented-control button:focus-visible {
  background: rgba(29, 43, 39, 0.08);
  outline: none;
}

.segmented-control button.is-active {
  background: #20352f;
  color: #ffffff;
}

.cesm2-time-control {
  margin: 4px 0 18px;
}

.cesm2-region-map {
  width: 100%;
  min-height: 620px;
}

.cesm2-global-panel .inline-control select,
.online-chart-panel .inline-control select {
  min-width: 130px;
}

.panel-control {
  flex: 0 1 300px;
}

.panel-control select {
  min-width: 190px;
}

.online-table-panel {
  margin-bottom: 18px;
}

.map-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.benchmark-page .map-column {
  display: block;
}

.side-column {
  display: grid;
  gap: 18px;
  align-self: start;
  min-width: 0;
}

.side-column .control-card {
  align-content: start;
}

.side-column .control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-panel {
  grid-column: 1 / -1;
}

.detail-panel {
  align-self: start;
  height: var(--map-detail-height);
  overflow-y: auto;
}

.benchmark-page .detail-panel {
  height: auto;
  overflow-y: visible;
}

.map-panel {
  display: flex;
  flex-direction: column;
  height: var(--map-detail-height);
}

.panel {
  padding: 16px;
  min-width: 0;
}

.hero-grid > *,
.summary-grid > *,
.timeseries-grid > *,
.main-grid > *,
.chart-grid > *,
.map-column > * {
  min-width: 0;
}

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

.chart-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(211, 228, 220, 0.16);
  border-radius: 8px;
  background: rgba(7, 12, 14, 0.42);
}

.chart-tab {
  min-height: 32px;
  min-width: 124px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.chart-tab:hover,
.chart-tab:focus-visible {
  color: var(--text);
  background: rgba(211, 228, 220, 0.1);
  outline: none;
}

.chart-tab.is-active {
  color: #061014;
  background: var(--accent);
}

.legend-row {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend-dot,
.legend-line {
  display: inline-block;
  vertical-align: middle;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.legend-line {
  width: 24px;
  height: 3px;
  border-radius: 999px;
}

.legend-line.main {
  background: var(--blue);
}

.legend-line.sensitivity {
  background: var(--amber);
}

.sample-note,
.track-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sample-note {
  padding: 9px 10px;
  border: 1px solid rgba(99, 214, 182, 0.2);
  border-radius: 8px;
  background: rgba(7, 12, 14, 0.48);
}

.info-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #071117;
  background: var(--accent);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
}

.track-scale {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.track-scale[hidden] {
  display: none;
}

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

.track-scale-head span:last-child {
  white-space: nowrap;
}

.track-scale-bar {
  height: 9px;
  border: 1px solid rgba(211, 228, 220, 0.16);
  border-radius: 999px;
  background: linear-gradient(90deg, #440154 0%, #31688e 36%, #35b779 70%, #fde725 100%);
}

.map-stage {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081117;
}

#benchmark-map {
  position: absolute;
  inset: 0;
}

#benchmark-map .maplibregl-ctrl-attrib,
#benchmark-map .maplibregl-ctrl-scale {
  color: #132023;
}

.map-tooltip {
  position: absolute;
  z-index: 2;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 15, 0.92);
  color: var(--text);
  font-size: 0.78rem;
  pointer-events: none;
}

.site-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.site-detail-grid div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 12, 14, 0.45);
}

.site-detail-grid strong {
  display: block;
  margin-top: 6px;
  word-break: break-word;
}

.chart {
  width: 100%;
  min-height: 390px;
  min-width: 0;
}

.js-plotly-plot,
.plot-container,
.svg-container {
  max-width: 100% !important;
}

.compact-chart {
  min-height: 330px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(211, 228, 220, 0.1);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

td {
  font-size: 0.88rem;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected-row {
  background: rgba(99, 214, 182, 0.1);
}

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

@media (max-width: 980px) {
  .hero-grid,
  .title-row,
  .main-grid,
  .timeseries-grid,
  .chart-grid,
  .summary-grid,
  .map-column {
    grid-template-columns: 1fr;
  }

  .control-grid,
  .site-detail-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }

  .topbar,
  .nav-links {
    align-items: stretch;
    flex-direction: column;
  }

  .main-link,
  .topbar .inline-control,
  .topbar .bucket-variant-control,
  .topbar .bucket-height-control {
    width: 100%;
    justify-content: space-between;
  }

  .dual-map-grid {
    grid-template-columns: 1fr;
  }

  .timeline-control {
    width: 100%;
  }

  .panel-control {
    width: 100%;
  }

  .online-chart-panel .panel-head {
    grid-template-columns: 1fr;
  }

  .online-chart-panel .panel-control {
    justify-self: stretch;
    grid-template-columns: 1fr;
  }

  .online-map-panel .map-panel-head {
    grid-template-columns: 1fr;
  }

  .online-map-panel .map-panel-head > div,
  .online-map-panel .timeline-control {
    grid-column: 1;
  }

  .cesm2-panel-head {
    align-items: stretch;
  }

  .cesm2-control-strip {
    justify-content: flex-start;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .segmented-control button {
    min-width: 0;
  }

  .cesm2-region-map {
    min-height: 460px;
  }

  .chart-tabs {
    width: 100%;
    justify-content: stretch;
  }

  .chart-tab {
    min-width: 0;
    flex: 1 1 0;
  }

  .map-panel,
  .detail-panel {
    height: auto;
    overflow-y: visible;
  }

  .map-stage {
    flex: none;
    min-height: 520px;
  }
}


/* 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;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(21, 47, 61, 0.16);
  --text: #122333;
  --muted: #596b78;
  --accent: #0f806d;
  --amber: #9a6a00;
  --blue: #1f6ea5;
  --coral: #b64d3f;
  --shadow: 0 10px 30px rgba(15, 45, 62, 0.08);
}

html[data-theme="light"] .topbar {
  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"] .main-link,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .control-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .stat,
html[data-theme="light"] .inline-control,
html[data-theme="light"] .bucket-height-control,
html[data-theme="light"] .bucket-variant-toggle,
html[data-theme="light"] .timeline-control,
html[data-theme="light"] .map-pane,
html[data-theme="light"] .online-note-card,
html[data-theme="light"] .metric-breakdown,
html[data-theme="light"] .cesm2-region-tooltip,
html[data-theme="light"] .cesm2-map-source-info-popover,
html[data-theme="light"] table,
html[data-theme="light"] .table-wrap {
  background: #ffffff !important;
  border-color: rgba(21, 47, 61, 0.14) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .main-link.is-active,
html[data-theme="light"] .bucket-variant-toggle button.is-active,
html[data-theme="light"] .global-map-mode-buttons button.is-active,
html[data-theme="light"] .month-button.is-active {
  background: rgba(15, 128, 109, 0.12) !important;
  border-color: rgba(15, 128, 109, 0.42) !important;
  color: var(--text) !important;
}

html[data-theme="light"] .chart,
html[data-theme="light"] .spatial-map,
html[data-theme="light"] .cesm2-shell .chart,
html[data-theme="light"] .cesm2-shell .spatial-map,
html[data-theme="light"] .cesm2-region-map,
html[data-theme="light"] .map-container,
html[data-theme="light"] .map-card {
  background: #ffffff !important;
}

html[data-theme="light"] .metric-breakdown-row span:first-child,
html[data-theme="light"] .status-line,
html[data-theme="light"] .panel-head p,
html[data-theme="light"] .stat small,
html[data-theme="light"] .stat span,
html[data-theme="light"] .map-status,
html[data-theme="light"] .online-note-card p {
  color: var(--muted) !important;
}

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

html[data-theme="light"] .cesm2-region-colorbar,
html[data-theme="light"] .cesm2-region-colorbar > span,
html[data-theme="light"] .cesm2-map-source-info-button {
  color: var(--text) !important;
}
/* End white background mode */

/* White mode visibility repair */
html[data-theme="light"] .inline-control select,
html[data-theme="light"] .bucket-height-control select,
html[data-theme="light"] .control-grid select,
html[data-theme="light"] .timeline-control select,
html[data-theme="light"] .panel-control select,
html[data-theme="light"] .select-field select,
html[data-theme="light"] .cesm2-global-panel .inline-control select,
html[data-theme="light"] .online-chart-panel .inline-control select,
html[data-theme="light"] .map-pane select {
  background: #ffffff !important;
  border: 1px solid rgba(18, 45, 62, 0.18) !important;
  color: #122333 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .inline-control,
html[data-theme="light"] .bucket-height-control,
html[data-theme="light"] .timeline-control,
html[data-theme="light"] .panel-control,
html[data-theme="light"] .select-field {
  color: #526979 !important;
}

html[data-theme="light"] .bucket-variant-toggle,
html[data-theme="light"] .month-button-group,
html[data-theme="light"] .global-map-mode-buttons,
html[data-theme="light"] #global-map-mode-buttons {
  background: #ffffff !important;
  border-color: rgba(18, 45, 62, 0.18) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .bucket-variant-toggle button,
html[data-theme="light"] .month-button,
html[data-theme="light"] .global-map-mode-buttons button,
html[data-theme="light"] #global-map-mode-buttons button,
html[data-theme="light"] .release-month-button,
html[data-theme="light"] .map-mode-button {
  background: #ffffff !important;
  border-color: rgba(18, 45, 62, 0.18) !important;
  color: #122333 !important;
  box-shadow: none !important;
}

html[data-theme="light"] .bucket-variant-toggle button.is-active,
html[data-theme="light"] .bucket-variant-toggle button[aria-pressed="true"],
html[data-theme="light"] .month-button.is-active,
html[data-theme="light"] .month-button[aria-pressed="true"],
html[data-theme="light"] .global-map-mode-buttons button.is-active,
html[data-theme="light"] .global-map-mode-buttons button[aria-pressed="true"],
html[data-theme="light"] #global-map-mode-buttons button.is-active,
html[data-theme="light"] #global-map-mode-buttons button[aria-pressed="true"],
html[data-theme="light"] .release-month-button.is-active,
html[data-theme="light"] .map-mode-button.is-active {
  background: rgba(15, 128, 109, 0.14) !important;
  border-color: rgba(15, 128, 109, 0.45) !important;
  color: #122333 !important;
  box-shadow: inset 0 0 0 1px rgba(15, 128, 109, 0.14) !important;
}

html[data-theme="light"] .status-pill,
html[data-theme="light"] .metric-breakdown,
html[data-theme="light"] .map-status,
html[data-theme="light"] .online-note-card,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] table {
  color: #122333 !important;
}

html[data-theme="light"] .spatial-map canvas,
html[data-theme="light"] .cesm2-shell .spatial-map canvas {
  background: #ffffff !important;
}

html[data-theme="light"] .cesm2-region-colorbar,
html[data-theme="light"] .cesm2-region-colorbar span,
html[data-theme="light"] .cesm2-region-tooltip,
html[data-theme="light"] .cesm2-map-source-info-popover {
  color: #122333 !important;
}

html[data-theme="light"] .cesm2-map-source-info-button,
html[data-theme="light"] .cesm2-map-source-info-close {
  background: #ffffff !important;
  border-color: rgba(18, 45, 62, 0.24) !important;
  color: #122333 !important;
}
/* End white mode visibility repair */

/* White mode visibility repair: targeted residual controls */
html[data-theme="light"] button[data-month],
html[data-theme="light"] button[data-month].is-active,
html[data-theme="light"] button[data-month][aria-pressed="true"] {
  background: #ffffff !important;
  border-color: rgba(18, 45, 62, 0.18) !important;
  color: #122333 !important;
  box-shadow: none !important;
}

html[data-theme="light"] button[data-month].is-active,
html[data-theme="light"] button[data-month][aria-pressed="true"] {
  background: rgba(15, 128, 109, 0.14) !important;
  border-color: rgba(15, 128, 109, 0.45) !important;
}
/* End targeted residual controls */

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