#discover {
  max-width: 1170px;
  margin: 0 auto 3rem;
}
#discover {
  padding-top: clamp(12px, 2vw, 30px);
}
.dis-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.dis-tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  padding: 0.75rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  line-height: 1.15;
  background: #fcfbf6;
  font-size: 0.94rem;
}
.dis-tab svg {
  flex: none;
}
.dis-tab[aria-pressed="true"],
.dis-button {
  background: var(--green);
  color: #fffbee;
  border-color: var(--green);
}
.dis-tab:hover {
  box-shadow: inset 0 0 0 1px var(--green);
}
.dis-panel {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf6;
}
.dis-panel h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
}
.dis-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dis-field {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  min-width: min(165px, 100%);
  max-width: 100%;
}
.dis-field select {
  margin: 0;
  width: 100%;
  color: var(--ink);
  font-size: 1rem;
}
.dis-button {
  align-self: end;
  padding: 0.62rem 0.95rem;
  border-radius: 5px;
  font-weight: 600;
}
.dis-button:hover,
.dis-button:focus-visible {
  background: #27554c;
}
.dis-sources {
  position: relative;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.dis-source-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding: 0 0.2rem;
  color: inherit;
  font: inherit;
}
.dis-source-trigger::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 600 0.75rem/1 Georgia, serif;
}
.dis-source-trigger[aria-expanded="true"] { color: var(--green); }
.dis-source-panel {
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: 30px;
  width: min(28rem, 100%);
  max-height: min(55dvh, var(--source-room));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 1rem;
  background: #fffdf6;
  border: 1px solid #a6b8a9;
  border-radius: 9px;
  box-shadow: 0 4px 18px #173c3026;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.dis-source-panel.opens-below { top: 100%; bottom: auto; }
.dis-source-panel p { margin: 0 0 0.5rem; }
.dis-source-panel a { display: block; padding-block: 0.15rem; text-underline-offset: 2px; }
.night-scene {
  background: #08121f;
  position: relative;
  height: clamp(225px, 50vh, 490px);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.night-scene svg {
  position: absolute;
  inset: 0;
  background: #08121f;
}
.night-divider {
  position: absolute;
  inset-block: 0;
  width: 44px;
  transform: translateX(-50%);
  cursor: ew-resize;
  background: linear-gradient(to right, transparent calc(50% - 1px), #fff0c2 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}
.night-divider .atlas-arrow {
  box-sizing: border-box;
  inset: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #e4d5ad;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 9px;
  color: #fff0c2;
  background: #17222e;
}
.night-divider:focus-visible { outline: none; }
.night-divider:focus-visible .atlas-arrow { outline: 3px solid #fff0c2; outline-offset: 3px; }
.night-scene.dragging { cursor: grabbing; }
.night-map-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  overflow: hidden;
  border: 1px solid #a6afa6;
  border-radius: 5px;
  background: #faf8ed;
}
.night-map-controls button {
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}
.night-map-controls button + button { border-left: 1px solid var(--line); }
.night-map-controls button:disabled { opacity: .4; cursor: default; }
.night-map-controls button:focus-visible { outline-offset: -3px; }
.night-scene:focus-visible {
  outline: 3px solid #b77b34;
  outline-offset: 2px;
}
.night-tag {
  position: absolute;
  top: 8px;
  padding: 0.15rem 0.5rem;
  color: #fff3cf;
  background: #17222eee;
  border-radius: 4px;
  font-weight: 650;
  pointer-events: none;
}
.night-tag.first {
  left: 8px;
}
.night-tag.last {
  right: 8px;
}
.night-scene svg {
  display: block;
  width: 100%;
  height: 100%;
}
.night-scale {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.night-scale i {
  width: 100px;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, #08121f, #826955, #e2a258, #fff9df);
  border: 1px solid #c6beb1;
}
.dis-toggle button {
  background: #fcfaf2;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0.42rem 0.65rem;
  text-align: left;
  font-size: 0.93rem;
}
.dis-toggle button[aria-pressed="true"] {
  border-color: var(--green);
  background: #e3eddf;
  color: #143d35;
}
.dis-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
@media (max-width: 530px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    padding-top: 8px;
  }
  .header-inner .brand {
    font-size: 1.22rem;
  }
  .header-inner nav {
    width: 100%;
    justify-content: space-around;
    height: 39px;
  }
  .header-inner nav :is(button, a) {
    padding: 0 5px;
  }
  .header-inner nav :is(button, a)[aria-current="page"]:after {
    bottom: 2px;
  }
}
.discovery-link {
  margin-top: 0.65rem;
}
.dis-panel.dis-gol { padding: 0; overflow: hidden; }
.dis-gol .lake-name { width: fit-content; max-width: calc(100% - 68px); margin: 10px 14px 7px; }
#discover .lake-name select {
  width: auto; min-height: 44px; padding: 0 25px 0 0; border: 0; color: var(--ink);
  background-color: transparent; font-size: clamp(1.45rem, 3vw, 1.8rem) !important;
  font-weight: 670 !important; letter-spacing: -.045em;
}
.dis-panel.dis-gol .card-share { inset-block-start: 10px; inset-inline-end: 12px; }
.lake-years {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  padding: 0 14px 12px;
}
.lake-years .dis-field { min-width: 0; }
.lake-years select {
  appearance: none; min-height: 44px; padding: 0 25px 0 10px;
  background: #f8f8ee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23345445' stroke-width='1.5'/%3E%3C/svg%3E") right 8px center / 11px 8px no-repeat;
}
.lake-map {
  display: block; width: 100%; height: clamp(245px, 42vw, 390px);
  border-block: 1px solid #cdd1be; background: #e6e2ce;
}
.lake-key { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 12px 14px; font-size: .9rem; }
.lake-key span { display: inline-flex; align-items: center; gap: 6px; }
.lake-key span::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: #146582; }
.lake-key .loss::before { background: repeating-linear-gradient(126deg, #e9be91 0 3px, #aa6a32 3px 4px); }
.lake-key .gain::before { background: #3ba8a4; }
@media (max-width: 480px) {
  .lake-key { font-size: .82rem; gap: 5px 10px; }
  .lake-years { gap: 8px; }
  .lake-years select { padding-inline: 5px 16px; background-position: right 4px center; }
}
@media (max-width: 360px) {
  #discover .lake-years select { font-size: .875rem !important; }
}
.flow-figure {
  margin: 0;
  padding: clamp(0.7rem, 2.2vw, 1.5rem);
  background: #f4f4e9;
  border: 1px solid #cbd1c0;
  border-radius: 10px;
}
.flow-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.flow-value {
  display: grid;
  line-height: 1.2;
  color: #175e57;
}
.flow-value.out {
  text-align: right;
  color: #934629;
}
.flow-value strong {
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  font-variant-numeric: tabular-nums;
}
.flow-net span {
  color: var(--muted);
  font-size: 0.86rem;
}
.flow-drawing {
  position: relative;
  height: clamp(84px, 13vw, 125px);
  margin: 0.15rem 0;
}
.flow-stream {
  width: 100%;
  height: 100%;
  display: block;
}
.flow-in {
  fill: #348778;
}
.flow-out {
  fill: #bc704a;
}
.flow-town {
  position: absolute;
  inset: 18% 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #21493f;
  font-size: clamp(0.85rem, 2vw, 1.35rem);
  line-height: 1.05;
  text-align: center;
}
.flow-town svg {
  display: block;
  width: 100%;
  height: 100%;
}
.flow-net {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  text-align: center;
}
.flow-net strong {
  font-size: 1.35rem;
}
.flow-net .positive { color: #176741; }
.flow-net .negative { color: #aa302e; }
.dis-goc .dis-controls {
  display: grid; grid-template-columns: minmax(0, 190px) minmax(76px, 118px);
}
.dis-goc .dis-field { min-width: 0; }
.flow-summary-heading, .flow-heading, .flow-directions, .flow-clear {
  display: flex; align-items: center; gap: .6rem;
}
.flow-summary-heading, .flow-heading { justify-content: space-between; }
.flow-summary-heading { margin-bottom: .6rem; min-height: 36px; }
.flow-summary-heading > strong, .flow-heading h3 { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.flow-summary-heading small, .flow-rank { color: var(--muted); }
.flow-clear { background: #e7ede0; border: 1px solid #aac0ad; border-radius: 18px; padding: .32rem .6rem; font-size: .9rem; text-align: left; line-height: 1.2; }
.flow-heading { margin: 1.1rem 0 .3rem; flex-wrap: wrap; }
.flow-directions { gap: 0; border: 1px solid #bac6b6; padding: 3px; border-radius: 7px; }
.flow-directions button { min-height: 34px; border-radius: 4px; padding: .2rem .65rem; }
.flow-directions button[aria-pressed="true"] { background: #215247; color: white; }
.flow-list { list-style: none; padding: 0; margin: 0; }
.flow-row {
  display: grid; grid-template-columns: 1.5em 1fr auto 15px; align-items: center;
  text-align: left; width: 100%; min-height: 44px; gap: .5rem; padding: .45rem .5rem;
  border-bottom: 1px solid var(--line);
}
.flow-row:hover { background: #f1f3e9; }
.flow-row[aria-pressed="true"] { background: #e6ede1; box-shadow: inset 3px 0 #306652; }
.flow-row strong { font-weight: 620; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flow-row svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.flow-more { min-height: 44px; padding: .4rem .5rem; color: var(--green); font-weight: 600; }
.flow-more::after { content: ""; display: inline-block; width: .45em; height: .45em; vertical-align: .16em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-inline-start: .65em; }
.flow-more[aria-expanded="true"]::after { transform: rotate(225deg); vertical-align: -.02em; }
@media (max-width: 600px) {
  .dis-panel {
    padding: 0.8rem;
  }
  .dis-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .dis-tab {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.25rem;
    padding: 0.5rem 0.15rem;
    font-size: 0.86rem;
  }
  .dis-field {
    min-width: 115px;
    flex: 1;
  }
  .dis-goc .dis-controls { gap: 8px; grid-template-columns: minmax(88px, 1.55fr) minmax(72px, 1fr); }
  .flow-row { grid-template-columns: 1em 1fr auto 13px; gap: .35rem; padding-inline: .3rem; font-size: .94rem; }
  .flow-directions button { font-size: .92rem; }

}
