/* 3D model page (index.html): scenario console, flux equaliser and layout.
   Loaded after styles.css; new layout classes are prefixed m-, pc- (console), eq-, eqn-. */

.m-body {
  --panel: #ffffff;
  --panel-2: #f3f6f9;
  --ink: #0f1c2e;
  --ink-2: #44505e;
  --muted: #6b7684;
  --line: rgba(11, 37, 69, 0.12);
  --grid: #e3e8ee;
  --eq-gain: #e34948;
  --eq-loss: #2a78d6;
  --gain-text: #b3261e;
  --loss-text: #1c5cab;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --eq-h: 232px;
  font-family: var(--ui);
  font-size: 14px;
  background: #eef2f6;
  height: auto;
}
.m-body #ln-app {
  display: block;
  min-height: 100vh;
}
.m-body button {
  font-family: inherit;
}
.m-body :focus-visible {
  outline: 2px solid #0aa6c2;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Top bar                                                             */
/* ------------------------------------------------------------------ */
.m-top {
  box-sizing: border-box;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: #0b2545;
  color: #fff;
}
.m-brand h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.2;
}
.m-brand p {
  margin: 2px 0 0;
  color: #c5d3e2;
  font-size: 13px;
}
.m-links {
  margin-left: auto;
}
.m-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.m-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ------------------------------------------------------------------ */
/* Main: stage + panel                                                 */
/* ------------------------------------------------------------------ */
/* One fixed-height row: the stage and panel must never grow past it, or they
   spill over the sections below (the row would otherwise size to content). */
.m-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 72px);
  min-height: 700px;
  border-bottom: 1px solid var(--line);
}
.m-stage-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.m-body .m-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.m-places {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
}
.pc-place {
  flex: 1 1 0;
  min-width: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.pc-place strong {
  font-size: 14px;
}
.pc-place small {
  font-size: 11.5px;
  color: var(--muted);
}
.pc-place:hover {
  border-color: #0e7c86;
}
.pc-place:active {
  transform: translateY(1px);
}
.pc-place[aria-checked="true"] {
  background: #0b2545;
  border-color: #0b2545;
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.25);
}
.pc-place[aria-checked="true"] small {
  color: #c5d3e2;
}

.m-stage-hint {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 11.5px;
  pointer-events: none;
}

/* View popover */
.m-view {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}
.m-view-btn {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.08);
}
.m-view-btn::after {
  content: " ▾";
  color: var(--muted);
}
.m-view-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(380px, calc(100vw - 40px));
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(11, 37, 69, 0.18);
}
.m-view-pop .ln-seg {
  flex-wrap: wrap;
}
.m-view-pop[hidden] {
  display: none;
}
.m-view-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Live equation strip */
.m-eqn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-variant-numeric: tabular-nums;
}
.eqn-term {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 5px;
}
.eqn-term i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  align-self: center;
}
.eqn-term b {
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
}
.eqn-term small {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--muted);
}
.eqn-net b {
  font-size: 19px;
}
.eqn-net.gain b {
  color: var(--gain-text);
}
.eqn-net.loss b {
  color: var(--loss-text);
}
.eqn-op {
  font-size: 18px;
  color: var(--muted);
  padding-bottom: 12px;
}
.eqn-unit {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Right panel                                                         */
/* ------------------------------------------------------------------ */
.m-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
}

/* Console */
.pc {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f6f9fb, #fff);
}
.pc-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.pc-dial-wrap {
  width: 150px;
}
.pc-dial {
  display: block;
  width: 150px;
  height: 150px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  border-radius: 50%;
  transition: opacity 0.2s;
}
.pc-dial.off {
  opacity: 0.35;
}
.pc-dial:focus-visible {
  outline: 2px solid #0aa6c2;
  outline-offset: 2px;
}
.pc-arc-bg {
  stroke: #fff;
  stroke-width: 2;
  transition: fill 0.2s;
}
.pc-arc-winter .pc-arc-bg { fill: #d6e6f5; }
.pc-arc-spring .pc-arc-bg { fill: #d9eed4; }
.pc-arc-summer .pc-arc-bg { fill: #fae3b4; }
.pc-arc-autumn .pc-arc-bg { fill: #f3d2bd; }
.pc-arc:hover .pc-arc-bg {
  filter: brightness(0.95);
}
.pc-arc.on .pc-arc-bg {
  fill: #0b2545;
}
.pc-arc-label {
  font-size: 10.5px;
  letter-spacing: 0.02em;
  font-weight: 650;
  fill: #0f1c2e;
  pointer-events: none;
}
.pc-arc.on .pc-arc-label {
  fill: #fff;
}
.pc-hub-bg {
  fill: #fff;
  stroke: var(--grid);
  stroke-width: 1.5;
  transition: fill 0.2s;
}
.pc-hub:hover .pc-hub-bg {
  fill: #f3f6f9;
}
.pc-hub.on .pc-hub-bg {
  fill: #0b2545;
  stroke: #0b2545;
}
.pc-hub-label {
  font-size: 14px;
  font-weight: 700;
  fill: #0f1c2e;
  pointer-events: none;
}
.pc-hub-sub {
  font-size: 10px;
  fill: #6b7684;
  pointer-events: none;
}
.pc-hub.on .pc-hub-label,
.pc-hub.on .pc-hub-sub {
  fill: #fff;
}
.pc-knob {
  transform-box: view-box;
  transform-origin: 75px 75px;
  transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.2s;
  pointer-events: none;
}
.pc-knob-dot {
  fill: #e34948;
  stroke: #fff;
  stroke-width: 2.5;
}

.pc-side {
  display: grid;
  gap: 10px;
}
.pc-field {
  display: grid;
  gap: 4px;
}
.pc-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pc-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(11, 37, 69, 0.12);
}
.pc-switch.off {
  opacity: 0.4;
}
.pc-switch-opt {
  position: relative;
  z-index: 1;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  transition: color 0.25s;
}
.pc-switch-knob {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: #0b2545;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.3);
  transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.pc-switch[aria-checked="true"] .pc-switch-knob {
  transform: translateX(100%);
}
.pc-switch[aria-checked="false"] .pc-switch-opt.a,
.pc-switch[aria-checked="true"] .pc-switch-opt.b {
  color: #fff;
}

.pc-seg {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.pc-seg button {
  padding: 6px 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.pc-seg button[aria-checked="true"] {
  background: #0b2545;
  color: #fff;
  font-weight: 600;
}
.pc-seg button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pc-actions {
  display: flex;
  gap: 6px;
}
.pc-btn {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pc-btn:hover {
  background: var(--panel-2);
}
.pc-btn[aria-pressed="true"] {
  background: #fff3e0;
  border-color: #eda100;
}
.pc-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #8a4b0b;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */
/* Equaliser                                                           */
/* ------------------------------------------------------------------ */
.eq {
  padding: 14px 16px 16px;
}
.eq-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
}
.eq-readout {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.eq-net {
  grid-row: span 2;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.eq-net.gain {
  color: var(--gain-text);
}
.eq-net.loss {
  color: var(--loss-text);
}
.eq-net.even {
  color: var(--ink);
}
.eq-verdict {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.eq-temp {
  font-size: 12.5px;
  color: var(--muted);
}

.eq-board {
  display: grid;
  grid-template-columns: 34px repeat(5, minmax(0, 1fr)) 12px minmax(0, 1.1fr) 30px;
  column-gap: 3px;
  padding: 6px 0 0;
}
.eq-axis {
  position: relative;
  height: var(--eq-h);
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.eq-axis span {
  position: absolute;
  right: 3px;
  transform: translateY(-50%);
}
.eq-axis span.zero {
  color: var(--ink-2);
  font-weight: 700;
}
.eq-axis-net span {
  right: auto;
  left: 3px;
}
.eq-divider {
  height: var(--eq-h);
  border-left: 1px dashed transparent;
  background: linear-gradient(90deg, transparent 5px, var(--grid) 5px, var(--grid) 7px, transparent 7px);
}
.eq-ch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}
.eq-track {
  position: relative;
  height: var(--eq-h);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(var(--ink-2), var(--ink-2)) center / 100% 1.5px no-repeat,
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px calc(var(--eq-h) / 4)),
    var(--panel-2);
  cursor: pointer;
  overflow: hidden;
}
.eq-track:hover {
  box-shadow: inset 0 0 0 1.5px #0e7c86;
}
.eq-ghost,
.eq-bar {
  position: absolute;
  top: 50%;
  height: 50%;
  transform-origin: top center;
  transform: scaleY(0);
}
.eq-ghost {
  left: 10%;
  right: 10%;
  opacity: 0.22;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s;
}
.eq-bar {
  left: 22%;
  right: 22%;
  transition: transform 0.7s cubic-bezier(0.25, 1.25, 0.4, 1), background-color 0.3s;
}
/* LED segments over the bars: the gaps are the panel colour. */
.eq-leds {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 6px, var(--panel-2) 6px 8px);
  mask: linear-gradient(to bottom, #000 calc(50% - 1px), transparent calc(50% - 1px), transparent calc(50% + 1px), #000 calc(50% + 1px));
  -webkit-mask: linear-gradient(to bottom, #000 calc(50% - 1px), transparent calc(50% - 1px), transparent calc(50% + 1px), #000 calc(50% + 1px));
}
/* Peak-hold mark: the ghost scenario's value. */
.eq-peak {
  position: absolute;
  z-index: 2;
  left: 6%;
  right: 6%;
  height: 2px;
  margin-top: -1px;
  background: var(--ink);
  border-radius: 1px;
  transition: top 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.eq-val {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  padding-bottom: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 3px var(--panel-2), 0 0 3px var(--panel-2);
  transition: top 0.7s cubic-bezier(0.25, 1.25, 0.4, 1);
}
.eq-val.below {
  transform: none;
  padding: 3px 0 0;
}
.eq-val.inside {
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}
.eq-delta {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.eq-delta b {
  font-size: 9px;
  margin-right: 1px;
}
.eq-delta.up b {
  color: var(--eq-gain);
}
.eq-delta.down b {
  color: var(--eq-loss);
}
.eq-delta.flat {
  color: var(--muted);
}
.eq-name {
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.eq-name i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.eq-ch-net .eq-name {
  color: var(--ink);
}
.eq-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.eq-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eq-key-now,
.eq-key-ghost {
  display: inline-block;
  width: 14px;
  height: 12px;
  border-radius: 2px;
  background: #4a3aa7;
}
.eq-key-ghost {
  opacity: 0.25;
  border-top: 2px solid var(--ink);
}
.eq-ghost-label {
  display: inline;
}
.eq-story {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.eq-story:empty {
  display: none;
}

/* Season strip: the year at a glance, doubles as a picker */
.eq-strip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.eq-strip-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
}
.eq-strip-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.1fr;
  gap: 6px;
}
.eq-sb {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 2px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}
.eq-sb:hover {
  border-color: #0e7c86;
}
.eq-sb.on {
  background: #fff;
  border-color: #0b2545;
  box-shadow: 0 1px 4px rgba(11, 37, 69, 0.15);
}
.eq-sb.yr {
  margin-left: 4px;
}
.eq-sb-plot {
  position: relative;
  width: 14px;
  height: 44px;
  background: linear-gradient(var(--axis, #b9c3ce), var(--axis, #b9c3ce)) center / 100% 1px no-repeat;
}
.eq-sb-bar {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 2px;
}
.eq-sb-bar.gain {
  background: var(--eq-gain);
}
.eq-sb-bar.loss {
  background: var(--eq-loss);
}
.eq-sb-v {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.eq-sb-l {
  font-size: 11px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Context and deeper sections                                         */
/* ------------------------------------------------------------------ */
.m-context,
.m-deeper {
  padding: 24px 20px;
}
.m-deeper {
  padding-top: 0;
}
.m-section-title {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: var(--ink);
}
.m-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  /* The last 1fr row soaks up the tall values card so the cards on the right stay packed. */
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "values budget mixed"
    "values lateral bed"
    "values . .";
  gap: 14px;
  align-items: start;
}
.m-context .ln-bathy-card,
.m-context .ln-eq-card {
  width: auto;
  max-width: none;
  margin: 0;
}
.m-context .ln-bathy-svg {
  width: 100%;
  height: auto;
}

/* Insets in the 3D window: map bottom-left (15% larger than the old card),
   bathymetry cross-section bottom-right. */
.m-inset {
  position: absolute;
  bottom: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-inset-left {
  left: 12px;
  width: min(414px, 40%);
  align-items: flex-start;
}
.m-inset-right {
  right: 12px;
  width: min(400px, 40%);
  align-items: flex-end;
}
.m-inset .ln-bathy-card {
  width: 100%;
  max-width: none;
  margin: 0;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.22);
}
.m-inset .ln-bathy-card[hidden] {
  display: none;
}
.m-inset .ln-bathy-svg {
  width: 100%;
  height: auto;
}
.m-inset-left .ln-map-preview-wrap {
  height: 190px; /* 165px x 1.15 */
}
.m-inset-toggle {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.1);
}

/* Values table: each label on a box of its flow's colour. */
.m-lbl {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
  line-height: 1.5;
}
.m-lbl-soft {
  padding-left: 6px;
  border-left: 4px solid transparent;
  border-radius: 0;
  font-weight: 500;
}
.m-eq-stack {
  display: grid;
  gap: 14px;
}
.m-card,
.m-context .ln-eq-card,
.m-context .ln-bathy-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.m-context .ln-flux-key {
  width: auto;
  height: auto;
  border-left: 1px solid var(--line);
  overflow: visible;
}
.m-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.m-context .ln-flux-table td {
  color: var(--ink);
}
.m-context .ln-flux-table tr.m-net-row th,
.m-context .ln-flux-table tr.m-net-row td {
  border-top: 2px solid var(--ink-2);
  font-weight: 700;
}
.m-context .ln-legend {
  width: auto;
  max-width: none;
}
.m-context .ln-legend-swatch {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.m-deeper .ln-collapsible-tier {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.m-deeper .ln-collapsible-tier > .ln-tier {
  position: static;
  max-height: none;
  padding: 14px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1250px) {
  .m-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "values budget"
      "values mixed"
      "values lateral"
      "values bed"
      "values .";
  }
}
@media (max-width: 1100px) {
  .m-main {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .m-body .m-stage {
    flex: none;
    height: 56vh;
    min-height: 380px;
  }
  .m-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .pc,
  .eq {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .m-top {
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
  .m-brand p {
    display: none;
  }
  .m-links {
    margin-left: 0;
  }
  .m-places {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px;
  }
  .pc-place {
    min-width: 0;
    padding: 6px 9px;
  }
  .m-body .m-stage {
    height: 380px;
    min-height: 340px;
  }
  .m-stage-hint {
    display: none;
  }
  .pc-row {
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
  }
  .pc-dial-wrap,
  .pc-dial {
    width: 130px;
    height: 130px;
  }
  .eq-board {
    grid-template-columns: 28px repeat(5, minmax(0, 1fr)) 8px minmax(0, 1.1fr) 26px;
    column-gap: 2px;
  }
  .eq-name {
    font-size: 11px;
  }
  .eq-name i {
    display: none;
  }
  .eq-delta {
    font-size: 10.5px;
  }
  .m-context-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "values" "budget" "mixed" "lateral" "bed";
  }
  .m-inset {
    bottom: 8px;
  }
  .m-inset-left {
    left: 8px;
    width: min(300px, 47%);
  }
  .m-inset-right {
    right: 8px;
    width: min(300px, 47%);
  }
  .m-eqn {
    gap: 4px 6px;
    padding: 8px 10px;
  }
  .eqn-term b {
    font-size: 14px;
  }
  .eqn-unit {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .eq-bar,
  .eq-ghost,
  .eq-peak,
  .eq-val,
  .pc-knob,
  .pc-switch-knob {
    transition: none;
  }
}

/* Month-by-month chart */
.eq-month {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.eq-month[hidden] {
  display: none;
}
.eq-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.eq-month-head .eq-strip-title {
  margin: 0;
}
.eq-month-seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.eq-month-seg button {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.eq-month-seg button[aria-checked="true"] {
  background: #0b2545;
  color: #fff;
  font-weight: 600;
}
.eq-month-plot {
  position: relative;
}
.eq-month-svg {
  display: block;
  width: 100%;
  height: auto;
}
.mth-band {
  fill: #0b2545;
  opacity: 0.06;
}
.mth-grid {
  stroke: var(--grid);
  stroke-width: 1;
}
.mth-zero {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.mth-tick {
  font-size: 10px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mth-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.mth-cur {
  stroke: var(--ink);
}
.mth-ghost {
  stroke: #9aa3ad;
  stroke-width: 1.5;
}
.mth-area.gain {
  fill: var(--eq-gain);
  opacity: 0.16;
}
.mth-area.loss {
  fill: var(--eq-loss);
  opacity: 0.16;
}
.mth-dot {
  stroke: #fff;
  stroke-width: 2;
}
.mth-dot.gain {
  fill: var(--eq-gain);
}
.mth-dot.loss {
  fill: var(--eq-loss);
}
.mth-dot.temp {
  fill: var(--ink);
}
.mth-hair {
  stroke: var(--ink-2);
  stroke-width: 1;
  pointer-events: none;
}
.eq-month-tip {
  position: absolute;
  top: 6px;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.eq-month-tip .muted {
  color: #b8c2cd;
}
.mth-key {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.mth-key.faint {
  opacity: 0.9;
}
.eq-month-legend {
  margin-top: 4px;
}
.eq-month-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.m-profile-chart { margin-top: 1rem; color: var(--ink); }
.m-profile-chart > p { font-size: .82rem; color: var(--ink-2); }
.m-profile-chart svg { display: block; width: 100%; height: auto; max-width: 460px; }
.m-profile-stats { display: grid; gap: .2rem; margin: .5rem 0; }
.m-profile-stats p { margin: .15rem 0; font-size: .84rem; }

/* The two stage views keep heat-flow arrows and temperature structure separate. */
.m-mode-switch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 16px rgba(11, 37, 69, .12);
  white-space: nowrap;
}
.m-mode-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 7px 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.m-mode-tab[aria-pressed="true"] { background: #0b2545; color: #fff; }
.m-mode-tab:focus-visible, .m-temp-panel button:focus-visible { outline: 3px solid #0e7c86; outline-offset: 2px; }
.m-temp-legend {
  position: absolute;
  top: 55px;
  left: 12px;
  z-index: 5;
  width: min(290px, calc(100% - 24px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(11, 37, 69, .1);
  pointer-events: none;
}
.m-temp-legend[hidden], .m-temp-panel[hidden] { display: none; }
.m-temp-legend strong, .m-temp-legend span { display: block; }
.m-temp-legend strong { font-size: 13px; }
.m-temp-legend > span { margin-top: 3px; font-size: 11px; color: var(--ink-2); }
.m-temp-ramp {
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #256681 0%, #55acb8 17%, #f3dd91 42%, #ee9857 67%, #c7504e 100%);
}
.m-temp-ramp-labels { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }
.m-temp-ramp-labels span { font-size: 10px; color: var(--ink-2); }
.m-temp-legend .m-temp-stage-stats { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 650; line-height: 1.35; }
.m-temperature-view .eq, .m-temperature-view .m-eqn { display: none; }
.m-temperature-view .m-view-pop .m-flux-only { display: none; }
.m-temperature-view .m-stage-hint { top: 12px; }
@media (max-width: 640px) {
  .m-mode-switch { top: 8px; left: 8px; transform: none; }
  .m-mode-tab { padding: 6px 10px; font-size: 11px; }
  .m-temp-legend { top: 50px; left: 8px; width: min(225px, calc(100% - 16px)); padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ln-detail { transition: none; }
}

/* Contrast scale reveals sub-degree bay leads without changing the temperatures. */
.m-temp-ramp.contrast { background: linear-gradient(90deg, #123e83 0%, #3b99bd 33.333%, #d9e7eb 50%, #f4b261 58.333%, #db5938 75%, #8d1735 100%); }
@media (max-width: 640px) {
  .m-temp-legend { width: calc(100% - 16px); padding: 7px 10px; }
  .m-temp-legend strong { font-size: 11px; }
  .m-temp-legend > span { font-size: 9px; }
  .m-temp-legend .m-temp-stage-stats { display: none; }
  .m-temp-ramp { margin-top: 4px; height: 6px; }
  .m-temp-ramp-labels span { font-size: 9px; }
}

/* Temperature panel: controls, site rows, findings and folded detail. */
.m-temp-panel { padding: 16px 16px 20px; color: var(--ink); }
.m-temp-panel h2 { margin: 0 0 6px; font-size: 18px; }
.m-temp-panel p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.m-temp-panel .m-temp-lede { font-size: 13.5px; color: var(--ink); }
.m-temp-composites { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 10px; padding: 3px; border-radius: 9px; background: var(--panel-2); width: fit-content; }
.m-temp-composites button {
  border: 0; border-radius: 7px; background: transparent; color: var(--ink);
  padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.m-temp-composites button[aria-pressed="true"] { background: #0b2545; color: #fff; }
.m-temp-composites button:disabled { opacity: .45; cursor: not-allowed; }
.m-temp-selects { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.m-temp-scale, .m-temp-month { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.m-temp-selects select { min-width: 0; max-width: 100%; padding: 6px 7px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12px; }
.m-temp-panel .m-temp-explainer { min-height: 3em; }
.m-temp-stats { display: grid; gap: 4px; margin: 0 0 10px; }
.m-temp-stats > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 7px; background: var(--panel-2); font-size: 12px; }
.m-temp-stats > div.selected { box-shadow: inset 3px 0 #0b2545; background: #eaf2f6; }
.m-temp-stats strong small { display: block; font-weight: 400; color: var(--muted); }
.m-temp-stats span { color: var(--ink-2); text-align: right; line-height: 1.5; }
.m-temp-stats b { color: var(--ink); }
.m-temp-detail {
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
  padding: 7px 11px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.m-temp-findings { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.m-temp-findings h3 { margin: 0 0 8px; font-size: 15px; }
.m-temp-findings ol { margin: 0; padding: 0; list-style: none; counter-reset: finding; display: grid; gap: 10px; }
.m-temp-findings li { position: relative; padding-left: 26px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); counter-increment: finding; }
.m-temp-findings li::before {
  content: counter(finding); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%;
  background: #0b2545; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.m-temp-findings li strong { color: var(--ink); }
.m-sat { margin: 8px 0 0; }
.m-sat figcaption { font-size: 11.5px; font-weight: 650; color: var(--ink); }
.m-sat-chart { display: block; width: 100%; height: auto; color: var(--ink-2); }
.m-sat-chart text { fill: currentColor; font: 10px system-ui, sans-serif; }
.m-sat-chart .m-sat-val { fill: var(--ink); font-weight: 650; }
.m-sat-grid { stroke: var(--grid); }
.m-sat-zero { stroke: var(--ink-2); stroke-opacity: .6; }
.m-sat-obs { fill: #0b2545; background: #0b2545; }
.m-sat-mod { fill: #a9bccf; background: #a9bccf; }
.m-temp-chart-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; margin: 4px 0 8px; color: var(--ink-2); }
.m-temp-chart-key span { display: inline-flex; align-items: center; gap: 5px; }
.m-temp-chart-key svg { width: 24px; height: 8px; }
.m-temp-chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.m-temp-more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.m-temp-more summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink); }
.m-temp-more[open] summary { margin-bottom: 8px; }
.m-temp-year > svg { width: 100%; height: auto; color: var(--ink); }
.m-temp-year svg text { fill: currentColor; font: 10px system-ui, sans-serif; }
.m-temp-year p { font-size: 11.5px; }
.m-temp-year table { width: 100%; font-size: 12px; text-align: right; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.m-temp-year th, .m-temp-year td { padding: 3px 4px; border-bottom: 1px solid var(--line); }
.m-temp-method ul { margin: 0; padding-left: 16px; display: grid; gap: 6px; }
.m-temp-method li { font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.m-temp-method li strong { color: var(--ink); }
.m-temp-method code { font-size: 11px; }
.m-profile-key { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.m-profile-key span { display: inline-flex; align-items: center; gap: 5px; }
.m-profile-key i { display: inline-block; width: 22px; height: 0; border-top: 2px solid #7a1466; }
.m-profile-key i.solid { border-top-width: 3px; }
.m-profile-key i.dash { border-top: 2px dashed #44505e; }
.m-profile-key i.dot { border-top: 2px dotted #2a78d6; }
.m-profile-chart svg { max-width: 520px; }
.m-temp-stats > div > strong { margin-right: auto; }
.m-temp-spark { flex: 0 0 auto; width: 56px; height: 40px; }
.m-temp-spark .axis { stroke: var(--ink-2); stroke-opacity: .5; }
.m-temp-spark .fill { fill: #7a1466; fill-opacity: .16; }
.m-temp-spark .line { fill: none; stroke: #7a1466; stroke-width: 2; stroke-linejoin: round; }

/* Rivers view: catchment bar graph. Lake-only controls step aside. */
.m-rivers-view .eq, .m-rivers-view .m-eqn, .m-rivers-view .m-places, .m-rivers-view .m-inset:not(.m-riv-inset), .m-riv-inset,
.m-rivers-view .pc-side .pc-field, .m-rivers-view .pc-hold, .m-rivers-view .pc-note { display: none; }
.m-rivers-view .m-view-pop .m-flux-only, .m-rivers-view .m-view-pop .m-lake-only { display: none; }
.m-view-pop .m-rivers-only { display: none; }
.m-rivers-view .m-riv-inset { display: flex; }
.m-rivers-view .m-view-pop .m-rivers-only { display: block; }
.m-rivers-view .m-stage-hint { top: 12px; }
.m-view-reset {
  margin: 4px 0 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.m-riv-legend {
  position: absolute; top: 55px; left: 12px; z-index: 5;
  width: min(300px, calc(100% - 24px)); padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .95); color: var(--ink);
  box-shadow: 0 4px 18px rgba(11, 37, 69, .1); pointer-events: none;
}
.m-riv-legend[hidden], .m-riv-panel[hidden] { display: none; }
.m-riv-legend strong { display: block; font-size: 13px; }
.m-riv-legend > span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
.m-riv-legend p { margin: 8px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
.m-riv-legend-beads { display: flex; gap: 8px; align-items: flex-start; }
.m-riv-legend-beads i {
  flex: none; width: 34px; height: 12px; margin-top: 2px; border-radius: 6px;
  background: radial-gradient(circle at 6px 6px, #f4faff 0 4px, transparent 4.5px), radial-gradient(circle at 20px 6px, #f4faff 0 5px, transparent 5.5px), #1d5d9b;
}
.m-riv-legend .m-riv-legend-stat { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 650; color: var(--ink); }

.m-riv-panel { padding: 16px 16px 20px; color: var(--ink); }
.m-riv-panel h2 { margin: 0 0 6px; font-size: 18px; }
.m-riv-panel p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.m-riv-panel .m-riv-lede { font-size: 13.5px; color: var(--ink); }
.m-riv-measure { display: flex; gap: 4px; margin: 12px 0 10px; padding: 3px; border-radius: 9px; background: var(--panel-2); width: fit-content; }
.m-riv-measure button {
  border: 0; border-radius: 7px; background: transparent; color: var(--ink);
  padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
}
.m-riv-measure button[aria-pressed="true"] { background: #0b2545; color: #fff; }
.m-riv-panel button:focus-visible, .m-riv-table > div:focus-visible { outline: 3px solid #0e7c86; outline-offset: 2px; }
.m-riv-panel .m-riv-explainer { min-height: 4.5em; }
.m-riv-table { display: grid; gap: 4px; margin: 0 0 8px; }
.m-riv-table > div {
  display: grid; grid-template-columns: 12px 1fr auto; grid-template-areas: "sw name val" "sw bar bar" "sw extra extra";
  column-gap: 8px; row-gap: 3px; padding: 7px 10px 7px 8px; border-radius: 7px; background: var(--panel-2);
  font-size: 12px; cursor: pointer;
}
.m-riv-table > div:hover { background: #eaf0f5; }
.m-riv-table > div.selected { box-shadow: inset 3px 0 #0b2545; background: #eaf2f6; }
.m-riv-sw { grid-area: sw; width: 12px; height: 12px; margin-top: 2px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .25); }
.m-riv-table strong { grid-area: name; font-size: 12.5px; }
.m-riv-table strong small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.m-riv-val { grid-area: val; text-align: right; color: var(--ink-2); white-space: nowrap; }
.m-riv-val b { font-size: 15px; color: var(--ink); }
.m-riv-bar { grid-area: bar; height: 7px; border-radius: 4px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.m-riv-bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .2); }
.m-riv-extra { grid-area: extra; color: var(--ink-2); font-size: 11.5px; }
.m-riv-extra b { color: var(--ink); }
.m-riv-panel .m-riv-total { padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.m-riv-h3 { margin: 18px 0 4px; font-size: 14px; }
.m-riv-panel .m-riv-sub { font-size: 12px; margin-bottom: 8px; }
.m-riv-q95 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.m-riv-q95 figure { margin: 0; padding: 6px 6px 2px; border-radius: 7px; background: var(--panel-2); }
.m-riv-q95 figure.selected { box-shadow: inset 0 0 0 2px #0b2545; }
.m-riv-q95 figcaption { font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.m-riv-q95 figcaption small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
.m-riv-q95 svg { display: block; width: 100%; height: auto; }
.m-riv-q95 .axis { stroke: #9aa5b1; stroke-width: 1; }
.m-riv-q95 rect { stroke: rgba(11, 37, 69, .35); stroke-width: .6; transition: opacity .3s; }
.m-riv-q95 rect.off { opacity: .38; }
.m-riv-q95 rect.on { stroke: #0b2545; stroke-width: 1.4; }
.m-riv-q95 text { fill: var(--ink-2); font-size: 7.5px; }
.m-riv-q95 text.v { fill: var(--ink); font-weight: 650; }
.m-riv-find { margin: 0; padding: 0; list-style: none; counter-reset: f; display: grid; gap: 8px; }
.m-riv-find li { counter-increment: f; display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.m-riv-find li::before {
  content: counter(f); grid-row: span 2; width: 20px; height: 20px; border-radius: 50%;
  background: #0b2545; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.m-riv-find strong { color: var(--ink); font-size: 13px; }
.m-riv-method { margin-top: 14px; }
.m-riv-method ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.m-riv-method li { margin-bottom: 6px; }
/* Rivers insets: radar map bottom-left, climatology bottom-right. */
.m-riv-inset.m-inset-left { width: min(250px, 27%); }
.m-riv-inset.m-inset-right { width: min(320px, 33%); }
.m-riv-card {
  width: 100%; margin: 0; padding: 9px 10px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .96); color: var(--ink); box-shadow: 0 8px 24px rgba(11, 37, 69, .18);
}
.m-riv-card[hidden] { display: none; }
.m-riv-card figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 6px; }
.m-riv-card figcaption strong { font-size: 12.5px; }
.m-riv-card figcaption small { flex-basis: 100%; font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.m-riv-radar-wrap { position: relative; }
.m-riv-radar canvas { display: block; width: 100%; height: auto; aspect-ratio: 145 / 150; border-radius: 6px; cursor: crosshair; }
.m-riv-radar-read {
  position: absolute; transform: translate(10px, -130%); padding: 2px 6px; border-radius: 4px;
  background: rgba(11, 37, 69, .9); color: #fff; font-size: 11px; font-weight: 650; pointer-events: none; opacity: 0; white-space: nowrap;
}
.m-riv-radar-read.show { opacity: 1; }
.m-riv-radar-key { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 10.5px; color: var(--ink-2); }
.m-riv-radar-key i { flex: 1; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(11, 37, 69, .2); }
.m-riv-card p { margin: 5px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink-2); }
.m-riv-card p b { color: var(--ink); }
.m-riv-radar-stat span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.m-riv-clim-tog { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border-radius: 7px; background: var(--panel-2); }
.m-riv-clim-tog button { border: 0; border-radius: 5px; background: transparent; color: var(--ink); padding: 3px 8px; font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
.m-riv-clim-tog button[aria-pressed="true"] { background: #0b2545; color: #fff; }
.m-riv-clim-tog button:focus-visible { outline: 2px solid #0e7c86; outline-offset: 1px; }
.m-riv-clim .m-riv-clim-sub { order: 3; }
.m-riv-clim svg { display: block; width: 100%; height: auto; }
.m-riv-clim svg text, .m-riv-long svg text { fill: var(--ink-2); font-size: 9px; }
.m-riv-clim svg text.unit, .m-riv-long svg text.unit { fill: var(--ink); font-weight: 650; }
.m-riv-clim .grid, .m-riv-long .grid { stroke: #9aa5b1; stroke-opacity: .3; stroke-width: 1; }
.m-riv-clim .band { fill: #1d5d9b; fill-opacity: .18; }
.m-riv-clim .mean { fill: none; stroke: #0b2545; stroke-width: 1.8; stroke-linejoin: round; }
.m-riv-clim .recent { fill: none; stroke: #d62828; stroke-width: 1.3; stroke-dasharray: 4 2; stroke-linejoin: round; }
.m-riv-clim-stat { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.m-riv-clim-stat span { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; }
.m-riv-clim-stat b { flex-basis: 100%; }
.m-riv-clim-stat i { display: inline-block; width: 16px; height: 0; }
.m-riv-clim-stat i.k-mean { border-top: 2px solid #0b2545; }
.m-riv-clim-stat i.k-band { height: 8px; background: rgba(29, 93, 155, .2); }
.m-riv-clim-stat i.k-recent { border-top: 2px dashed #d62828; }
.m-riv-long svg { display: block; width: 100%; height: auto; }
.m-riv-long .trend { fill: none; stroke: #0b2545; stroke-width: 1.4; stroke-dasharray: 5 3; }
.m-riv-long .rain { fill: none; stroke: #1d5d9b; stroke-width: 1.3; stroke-linejoin: round; }
.m-riv-long svg text.lab { fill: var(--ink); font-size: 10px; font-weight: 650; }
.m-riv-long svg text.yr { font-size: 7.5px; }
.m-riv-h4 { margin: 14px 0 6px; font-size: 12.5px; }
.m-riv-panel .m-riv-lttrend, .m-riv-panel .m-riv-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; }
.m-riv-ext { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-riv-ext > div { padding: 8px 10px; border-radius: 7px; background: var(--panel-2); font-size: 11.5px; }
.m-riv-ext strong { display: block; margin-bottom: 4px; font-size: 12px; }
.m-riv-ext ol { margin: 0; padding-left: 16px; }
.m-riv-ext li { display: list-item; }
.m-riv-ext li span { color: var(--ink-2); }
.m-riv-ext li b { float: right; font-weight: 650; }
.m-riv-qt, .m-riv-vt { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.m-riv-qt th, .m-riv-qt td, .m-riv-vt th, .m-riv-vt td { padding: 4px 5px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.m-riv-qt thead th, .m-riv-vt thead th { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.m-riv-qt tbody th { font-weight: 650; white-space: nowrap; }
.m-riv-qt tbody th i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; }
.m-riv-qt td small { color: var(--muted); }
.m-riv-qt td.down { color: #b42318; font-weight: 650; }
.m-riv-qt td.up { color: #1d5d9b; font-weight: 650; }
.m-riv-qt tr.selected { background: #eaf2f6; }
.m-riv-vt { margin: 6px 0; }
.m-riv-vt td { text-align: right; }
@media (max-width: 640px) {
  .m-riv-inset.m-inset-left, .m-riv-inset.m-inset-right { width: min(300px, 47%); }
  .m-riv-ext { grid-template-columns: 1fr; }
  .m-riv-legend { top: 50px; left: 8px; width: calc(100% - 16px); padding: 7px 10px; }
  .m-riv-legend strong { font-size: 11px; }
  .m-riv-legend > span, .m-riv-legend .m-riv-legend-stat { display: none; }
  .m-riv-legend p { margin-top: 4px; font-size: 10px; }
  .m-riv-q95 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
