/*
 * Core interaction contract
 * -------------------------
 * The app writes the selected pressure to data-pressure-path and its current
 * stage to data-pressure-step. Each pathway has its own evidence-led length.
 * Causal nodes receive .is-pressure-affected and a numbered data-pressure-stage.
 * True graph edges in the highlighted route receive .is-pressure-active.
 * Completion adds .pressure-is-complete to .river-app. No graph edge is removed.
 * Interpretation limits are collected in the persistent web-reading guide
 * and the linked evidence page, rather than repeated inside every node.
 */

.river-app[data-movement="disturb"][data-pressure-path="fine-material"][data-pressure-step="0"] .sediment-cloud {
  opacity: 0;
}

.river-app[data-movement="disturb"][data-pressure-path="fine-material"][data-pressure-step="1"] .sediment-cloud {
  opacity: .28;
}

.river-app[data-movement="disturb"][data-pressure-path="fine-material"][data-pressure-step="2"] .sediment-cloud {
  opacity: .58;
}

.river-app[data-movement="disturb"][data-pressure-path="fine-material"][data-pressure-step="3"] .sediment-cloud,
.river-app[data-movement="disturb"][data-pressure-path="fine-material"][data-pressure-step="4"] .sediment-cloud {
  opacity: .82;
}

.scene-node.is-pressure-affected {
  opacity: 1;
  box-shadow: 0 0 0 7px rgba(248, 224, 80, .28), 0 0 30px rgba(248, 224, 80, .48);
}

.thread-line.is-pressure-active {
  opacity: 1;
  stroke: #F8E04E;
  stroke-width: 1.2;
  stroke-dasharray: 2.5 1.4;
  animation: pressure-flow 1.6s linear infinite;
}

@keyframes pressure-flow {
  to { stroke-dashoffset: -7.8; }
}

.pressure-progress {
  display: grid;
  gap: .75rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
}

.pressure-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}

#movement-action .pressure-paths button {
  min-height: 44px;
  padding: .45rem .35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font-size: .75rem;
  line-height: 1.2;
}

#movement-action .pressure-paths button[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--eco-yellow);
  box-shadow: inset 0 -3px 0 rgba(16, 44, 51, .18);
}

.pressure-counter {
  margin: 0;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  color: var(--green-deep);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pressure-step-copy,
.pressure-complete,
.downstream-note {
  margin: 0;
  font-size: .76rem;
  line-height: 1.55;
}

.downstream-note {
  padding: .65rem;
  border-left: 4px solid var(--eco-sky);
  background: var(--sky-pale);
}

.pressure-prediction {
  display: grid;
  gap: .45rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pressure-prediction legend {
  margin-bottom: .45rem;
  font-size: .72rem;
  font-weight: 800;
}

#movement-action .pressure-prediction button,
#movement-action .pressure-next,
#movement-action .pressure-reset {
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  white-space: normal;
  text-align: left;
  line-height: 1.5;
}

/* Panel controls and instructions read at body size on desktop. */
@media (min-width: 761px) {
  #movement-action .pressure-prediction button,
  #movement-action .pressure-next,
  #movement-action .pressure-reset,
  .pressure-prediction legend,
  .connect-guide p { font-size: var(--step-0, 1rem); line-height: 1.5; }
}

#movement-action .pressure-prediction button {
  position: relative;
  padding-right: 2.2rem;
  border: 2px solid var(--teal);
  color: var(--ink);
  background: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 44, 51, .08);
}

#movement-action .pressure-prediction button::after {
  content: "→";
  position: absolute;
  right: .8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
  font-size: 1.05rem;
}

#movement-action .pressure-prediction button:hover,
#movement-action .pressure-prediction button:focus-visible {
  border-color: var(--ink);
  background: var(--eco-yellow);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#movement-action .pressure-prediction button:hover::after,
#movement-action .pressure-prediction button:focus-visible::after { color: var(--ink); }

.pressure-step-prompt { color: var(--ink); font-size: .85rem; letter-spacing: .04em; }
.pressure-step-next { margin-top: .35rem; color: var(--muted); }
.pressure-paths-label { margin: .9rem 0 0; color: var(--muted); font-size: .72rem; font-weight: 700; }
.pressure-progress[data-step="0"] .pressure-paths button { font-size: .7rem; }
.pressure-progress[data-step="0"] .pressure-paths button span { font-weight: 700; }

/* Step 0 only: tells people the first action is in the panel. */
.scene-start-prompt {
  position: absolute;
  z-index: 5;
  left: 1rem;
  bottom: 2.4rem;
  max-width: min(22rem, calc(100% - 2rem));
  margin: 0;
  padding: .7rem .9rem;
  border-left: 5px solid var(--eco-yellow);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-size: .85rem;
  font-weight: 750;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.scene-start-prompt-below { display: none; }
.scene-start-prompt-arrow::before { content: "→"; }

.pressure-is-complete .pressure-progress {
  border-color: var(--eco-green);
  background: var(--green-pale);
}

.relationship-list {
  gap: .9rem;
}

.relationship-group {
  display: grid;
  gap: .45rem;
}

.relationship-group h5 {
  margin: .2rem 0 0;
  color: var(--green-deep);
  font-size: .75rem;
  letter-spacing: .04em;
}

.relationship-item {
  min-width: 0;
}

.relationship-list button span {
  display: block;
}

.waterway-empty {
  margin: .65rem 0;
  color: #45605d;
  font-size: .75rem;
}

@media (prefers-reduced-motion: reduce) {
  .thread-line.is-pressure-active {
    animation: none;
  }
}

@media (max-width: 760px) {
  /* Accessible names stay on each button; visual labels appear on focus/selection. */
  .scene-node .node-label {
    visibility: hidden;
    opacity: 0;
    transition: opacity .16s;
  }

  .scene-node:hover .node-label,
  .scene-node:focus-visible .node-label,
  .scene-node.is-active .node-label,
  .scene-node.is-pressure-affected .node-label {
    visibility: visible;
    opacity: 1;
  }

  .scene-node[data-node-id="varied-bed"] .node-label,
  .scene-node[data-node-id="waterbugs"] .node-label {
    top: auto;
    bottom: calc(100% + 5px);
  }

  .scene-node[data-node-id="varied-bed"] .node-label {
    left: 28%;
  }

  .scene-node[data-node-id="waterbugs"] .node-label {
    left: 64%;
  }
}

/* Focus-and-pivot Connect ---------------------------------------------- */

.creek-world {
  grid-template-rows: auto minmax(0, 1fr);
}

.creek-world > .ecosystem-breadcrumbs {
  grid-column: 1 / -1;
  grid-row: 1;
}

.creek-world > .creek-scene { grid-column: 1; grid-row: 2; }
.creek-world > .thread-panel { grid-column: 2; grid-row: 2; }

/* Both columns consume only the space left below the breadcrumb row. */
.creek-world > .creek-scene,
.creek-world > .thread-panel {
  min-height: 0;
  height: 100%;
}

.ecosystem-breadcrumbs {
  position: sticky;
  top: 0;
  z-index: 7;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  margin: 0;
  padding: .55rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
  color: white;
  background: #4A6E4A;
}

.ecosystem-breadcrumbs[hidden] { display: none; }
.ecosystem-breadcrumbs > strong { color: #d6e9e6; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.ecosystem-breadcrumbs ol { min-width: 0; display: flex; align-items: center; gap: .2rem; margin: 0; padding: 0; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.ecosystem-breadcrumbs li { display: flex; flex: 0 0 auto; align-items: center; }
.ecosystem-breadcrumbs li:not(:last-child)::after { content: "›"; margin: 0 .15rem; color: var(--eco-yellow); font-size: 1rem; }
.ecosystem-breadcrumbs button { min-height: 38px; border-color: rgba(255,255,255,.26); color: white; background: transparent; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.ecosystem-breadcrumbs button:hover,
.ecosystem-breadcrumbs button:focus-visible { border-color: var(--eco-yellow); outline: 2px solid var(--eco-yellow); outline-offset: 1px; }
.ecosystem-breadcrumbs button[aria-current="page"] { border-color: var(--eco-yellow); color: var(--ink); background: var(--eco-yellow); opacity: 1; }
.ecosystem-breadcrumbs button[aria-current="step"],
.ecosystem-breadcrumbs .pressure-stage-nodes span[aria-current="step"] { display: inline-flex; align-items: center; min-height: 38px; padding: 0 .55rem; border: 1px solid var(--eco-yellow); border-radius: 8px; color: var(--ink); background: var(--eco-yellow); opacity: 1; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.ecosystem-breadcrumbs button:disabled:not([aria-current="page"]) { opacity: .42; cursor: default; }
.ecosystem-breadcrumbs button::after { content: none !important; }
.ecosystem-breadcrumbs .breadcrumb-controls { display: flex; gap: .4rem; }
.ecosystem-breadcrumbs .breadcrumb-start { color: var(--ink); background: white; }

/* Keep the nested catalogue trail below the persistent site header. On wide
   screens the outer creek trail owns Back; the component keeps its own Back
   controls for narrow screens where the outer controls are hidden. */
.river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .ecosystem-breadcrumbs { top: 0; }

@media (min-width: 761px) {
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .waterbug-catalogue__exit,
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .waterbug-view__back,
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .waterbug-taxon__back { display: none; }
}

#movement-action { margin-top: 1.1rem; }

.connect-guide {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--eco-sky) 58%, var(--line));
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(154,204,214,.2), rgba(255,255,255,.96) 45%);
  box-shadow: 0 10px 30px rgba(16,44,51,.09);
}

.interaction-kicker,
.connect-guide h4,
.connect-guide h5,
.connect-guide p { margin: 0; }
.interaction-kicker { color: var(--green-deep); font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.connect-guide h4 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 520; line-height: 1.05; }
.connect-guide h5 { margin: 0 0 .5rem; color: var(--green-deep); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.connect-guide p { font-size: .75rem; line-height: 1.5; }

.connect-current {
  position: relative;
  display: grid;
  gap: .4rem;
  padding: 1rem 1rem 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--focus-color) 65%, var(--line));
  border-left: 8px solid var(--focus-color);
  border-radius: 11px;
  background: white;
  box-shadow: 0 8px 22px rgba(16,44,51,.08);
}
.connect-current::after { content: "In focus"; position: absolute; top: .65rem; right: .7rem; padding: .24rem .4rem; border-radius: 999px; color: var(--ink); background: var(--focus-color); font-size: .75rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.connect-current p { padding-right: 2rem; }
.connect-count { width: fit-content; color: var(--teal); font-size: .75rem; font-weight: 800; }

.connect-start-prompt { display: grid; gap: .3rem; padding: .8rem; border-radius: 10px; background: var(--sky-pale); }
.connect-starters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .35rem; }
#movement-action .connect-starters button { min-height: 44px; border-radius: 9px; text-align: center; font-weight: 800; }

.connect-overview { align-content: start; border-color: color-mix(in srgb, var(--eco-yellow) 72%, var(--line)); background: linear-gradient(145deg, rgba(248,224,78,.2), rgba(255,255,255,.98) 48%); }
.connect-overview h4 { max-width: 12ch; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.connect-preview { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .15rem 0 0; padding: 0; list-style: none; }
.connect-preview li { display: grid; gap: .12rem; padding: .65rem; border: 1px solid color-mix(in srgb, var(--eco-sky) 62%, var(--line)); border-radius: 9px; background: rgba(255,255,255,.84); }
.connect-preview span { color: var(--green-deep); font-size: .75rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.connect-preview strong { font-size: .7rem; }
#movement-action .connect-begin { width: 100%; min-height: 48px; border-color: var(--teal-deep); border-radius: 9px; color: white; background: var(--teal-deep); text-align: center; font-weight: 850; }
.connect-begin-breadcrumb { border-color: var(--eco-yellow) !important; color: var(--ink) !important; background: var(--eco-yellow) !important; }

.focus-relationship-list { display: grid; gap: 1rem; }
.focus-relationship-list[hidden] { display: none; }
.focus-relationship-list .relationship-group + .relationship-group { margin-top: 0; }
.focus-relationship-list .relationship-group h5 { margin: 0 0 .5rem; color: var(--green-deep); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.focus-relationship-list .relationship-group { display: grid; gap: .5rem; }
.focus-relationship-list .relationship-item { min-width: 0; }
#movement-action .focus-relationship-list button {
  position: relative;
  width: 100%;
  min-height: 126px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .16rem .65rem;
  padding: .78rem;
  border: 1px solid color-mix(in srgb, var(--connection-color) 68%, var(--ink));
  border-left: 7px solid var(--connection-color);
  border-radius: 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--connection-color) 15%, white);
  box-shadow: 0 5px 14px rgba(16,44,51,.07);
  text-align: left;
  white-space: normal;
}
#movement-action .focus-relationship-list button:hover,
#movement-action .focus-relationship-list button:focus-visible { outline: 3px solid var(--eco-sky); outline-offset: 2px; transform: translateY(-1px); }
.focus-relationship-list .connection-number { grid-column: 1; grid-row: 1 / 6; }
.focus-relationship-list .relationship-route,
.focus-relationship-list .relationship-copy,
.focus-relationship-list .relationship-follow { grid-column: 2 / 4; }
.focus-relationship-list .relationship-route { margin-top: .05rem; color: var(--teal-deep); font-size: .82rem; font-weight: 750; line-height: 1.35; }
.focus-relationship-list .relationship-copy { margin-top: .25rem; color: var(--ink); font-size: .75rem; line-height: 1.42; }
.focus-relationship-list .relationship-follow { margin-top: .28rem; color: var(--teal-deep); font-size: .75rem; font-weight: 850; }
.connect-path-note { padding: .7rem; border-left: 4px solid var(--eco-yellow); background: white; }
.connect-path-note strong { color: var(--green-deep); }
.connect-mobile-key { display: none; padding: .55rem .65rem; border-left: 4px solid var(--eco-yellow); background: white; color: var(--muted); }

.waterbug-catalogue-entry { display: grid; gap: .7rem; margin: .9rem 0; padding: .9rem; border: 1px solid color-mix(in srgb, var(--eco-sky) 72%, var(--line)); border-radius: 12px; background: linear-gradient(145deg, rgba(154,204,214,.24), white 54%); }
.waterbug-catalogue-entry h5 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; line-height: 1.08; letter-spacing: -.01em; text-transform: none; }
.waterbug-catalogue-entry > p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.waterbug-preview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.waterbug-preview figure { min-width: 0; display: grid; place-items: center; gap: .2rem; margin: 0; padding: .35rem .2rem; border: 1px solid color-mix(in srgb, var(--eco-sky) 62%, var(--line)); border-radius: 8px; color: var(--teal-deep); background: white; }
.waterbug-preview svg { width: 44px; height: 44px; overflow: visible; }
.waterbug-preview figcaption { color: var(--ink); font-size: .75rem; line-height: 1.15; text-align: center; }
.waterbug-catalogue-entry ul { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.waterbug-catalogue-entry li { padding: .48rem .55rem; border-left: 4px solid var(--eco-sky); border-radius: 6px; background: white; font-size: .75rem; line-height: 1.3; }
.waterbug-catalogue-entry li:nth-child(2) { border-left-color: var(--eco-yellow); }
.waterbug-catalogue-entry li:nth-child(3) { border-left-color: var(--eco-green); }
.waterbug-catalogue-entry li:nth-child(4) { border-left-color: #dd9476; }
.waterbug-catalogue-entry li:nth-child(5) { border-left-color: #9e94c5; grid-column: 1 / -1; }
.waterbug-catalogue-entry li strong { display: block; font-size: .76rem; }
#movement-action .waterbug-catalogue-entry__open { width: 100%; min-height: 48px; border-color: var(--teal-deep); border-radius: 9px; color: white; background: var(--teal-deep); text-align: center; font-weight: 850; }
.river-app[data-movement="connect"][data-connect-focus="waterbugs"] #selected-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.river-app[data-movement="connect"][data-connect-focus="waterbugs"] #selected-card > :not(#waterbug-catalogue-mount) { display: none; }

.node-detail-disclosure,
.node-evidence-disclosure { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.node-detail-disclosure summary,
.node-evidence-disclosure summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--green-deep); font-size: .72rem; font-weight: 800; }
.selected-card { margin-top: .75rem; }
.selected-card > div:first-child { margin-bottom: .1rem; }

.river-app[data-movement="connect"] .thread-line { opacity: 0; }
.river-app[data-movement="connect"] .thread-line.is-related { opacity: .28; stroke-width: 1.6; }
.river-app[data-movement="connect"] .thread-line.is-connect-active { opacity: 1; stroke-width: 3.8; filter: drop-shadow(0 0 1.5px rgba(255,255,255,.95)); }
.river-app[data-movement="connect"] .scene-node:not(.is-connect-visible) { opacity: 0; pointer-events: none; }
.river-app[data-movement="connect"] .scene-node.is-connect-visible { opacity: 1; pointer-events: auto; }
.river-app[data-movement="connect"] .scene-node.is-connect-option { box-shadow: 0 0 0 8px rgba(248,224,78,.32), 0 0 24px rgba(248,224,78,.7); }
.river-app[data-movement="connect"] .scene-node.is-connect-entry { z-index: 5; border-color: var(--eco-yellow); box-shadow: 0 0 0 10px rgba(248,224,78,.3), 0 0 34px rgba(248,224,78,.82); animation: connect-entry-pulse 1.8s ease-in-out infinite; }
.river-app[data-movement="connect"] .scene-node.is-connect-thread { border-width: 3px; border-color: white; }
.river-app[data-movement="connect"] .scene-node.is-active { z-index: 5; box-shadow: 0 0 0 10px rgba(255,255,255,.36), 0 0 34px var(--eco-yellow); }
.river-app[data-movement="connect"] .selected-card { border-left-color: var(--eco-sky); }
.river-app[data-movement="connect"] #close-selection { display: none; }

@keyframes connect-entry-pulse {
  50% { box-shadow: 0 0 0 16px rgba(248,224,78,.1), 0 0 42px rgba(248,224,78,.95); }
}

/* Branch-aware Disturb -------------------------------------------------- */

.pressure-breadcrumbs li:not(:last-child)::after { content: "·"; margin-inline: .25rem; }
.pressure-breadcrumbs .pressure-pathway-name span { display: inline-flex; min-height: 36px; align-items: center; padding: .4rem .55rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #d6e9e6; font-size: .75rem; font-weight: 800; }
.pressure-breadcrumbs .pressure-stage-nodes { display: inline-flex; align-items: center; gap: .25rem; }
.pressure-breadcrumbs .pressure-branch-stage { display: grid; grid-template-columns: auto 1fr; gap: .15rem .3rem; align-items: center; padding: .22rem .32rem; border: 1px solid rgba(248,224,78,.35); border-radius: 10px; }
.pressure-breadcrumbs .pressure-branch-label { grid-column: 1 / -1; color: var(--eco-yellow); font-size: .75rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.pressure-breadcrumbs .pressure-branch-stage::after { content: none !important; }

.pressure-focus-card {
  position: relative;
  display: grid;
  gap: .4rem;
  padding: 1rem 1rem 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--focus-color) 65%, var(--line));
  border-left: 8px solid var(--focus-color);
  border-radius: 11px;
  background: white;
  box-shadow: 0 8px 22px rgba(16,44,51,.08);
}
.pressure-focus-card::after { content: "In focus"; position: absolute; top: .65rem; right: .7rem; padding: .24rem .4rem; border-radius: 999px; color: var(--ink); background: var(--focus-color); font-size: .75rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.pressure-focus-card .interaction-kicker { padding-right: 5.5rem; line-height: 1.35; }
.pressure-focus-card h4 { margin: 0; padding-right: 0; font-family: var(--font-display); font-size: 1.65rem; font-weight: 520; line-height: 1.05; }
.pressure-focus-card p { margin: 0; padding-right: 2rem; font-size: .75rem; line-height: 1.5; }
.pressure-reviewing { width: fit-content; padding: .3rem .45rem; border-radius: 5px; color: var(--green-deep); background: var(--sky-pale); font-size: .75rem; font-weight: 800; }
.pressure-start-note { margin: 0; padding: .75rem; border-left: 4px solid var(--eco-yellow); background: white; font-size: .7rem; line-height: 1.5; }
.pressure-branch-note { display: grid; gap: .45rem; padding: .75rem; border: 1px solid color-mix(in srgb, var(--eco-yellow) 65%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--eco-yellow) 12%, white); }
.pressure-branch-note > strong { color: var(--green-deep); font-size: .72rem; }
.pressure-branch-note p { margin: 0; font-size: .75rem; line-height: 1.45; }
.pressure-branch-note > div { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
#movement-action .pressure-branch-note button { min-height: 42px; border-radius: 8px; text-align: center; }
#movement-action .pressure-branch-note button[aria-pressed="true"] { border-color: var(--teal); background: var(--eco-yellow); opacity: 1; }
.pressure-relationship-list { padding-top: .15rem; }

.pressure-paths button { display: grid; gap: .18rem; text-align: left; }
.pressure-paths button strong { font-size: .75rem; }
.pressure-paths button span { color: var(--muted); font-size: .75rem; font-weight: 800; }
.pressure-paths button[aria-pressed="true"] span { color: var(--ink); }
.prediction-feedback { margin: 0; padding: .65rem; border-left: 4px solid var(--eco-sky); background: var(--sky-pale); font-size: .72rem; line-height: 1.45; }
.prediction-reveal { border-color: var(--teal) !important; color: var(--teal-deep) !important; background: white !important; font-weight: 800; }
.prediction-why { padding: .65rem .75rem; border-radius: 8px; background: var(--sky-pale); font-size: .75rem; line-height: 1.45; }
.prediction-why summary { min-height: 38px; display: flex; align-items: center; color: var(--teal-deep); font-weight: 850; cursor: pointer; }
.prediction-why p { margin: .35rem 0 0; }
.prediction-return { padding: .65rem; border-radius: 8px; background: white; }
.prediction-return strong { color: var(--green-deep); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.prediction-return p { margin: .25rem 0 0; font-size: .72rem; }
#movement-action .connect-onward { width: 100%; min-height: 46px; margin-top: .6rem; border: 0; border-radius: 9px; color: var(--ink); background: var(--eco-yellow); text-align: center; font-weight: 850; cursor: pointer; }
#movement-action .help-return { width: 100%; min-height: 44px; margin: .5rem 0; border-color: var(--line); border-radius: 9px; background: white; text-align: center; font-weight: 750; }
#movement-action .help-skip { display: block; width: auto; margin: .9rem auto 0; border: 0; padding: .35rem .5rem; background: transparent; color: var(--teal-deep); font-size: .74rem; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }

/* Ways to help: the end of Changes, below the final-stage explanation. */
.ways-to-help { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.ways-to-help > h4 { margin: .2rem 0 .5rem; font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.01em; }
.ways-to-help > p { margin: 0 0 1rem; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.help-cards { display: grid; gap: .85rem; }
.help-cards article { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.help-cards img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.help-cards article > *:not(img) { margin-left: .9rem; margin-right: .9rem; }
.help-cards span { margin-top: .8rem; color: var(--green-deep); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.help-cards h5 { margin: .2rem 0 .3rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; line-height: 1.2; }
.help-cards p { margin: 0 0 .7rem; color: var(--muted); font-size: .74rem; line-height: 1.5; }
#movement-action .help-cards button, .help-cards a { display: inline-flex; width: auto; justify-self: start; margin-bottom: .55rem; border-radius: 999px; padding: .55rem .8rem; font-size: .74rem; font-weight: 750; text-decoration: none; }
#movement-action .help-cards button { border: 0; color: var(--ink); background: var(--eco-yellow); cursor: pointer; }
.help-cards a { border: 1px solid var(--line); color: var(--teal-deep); background: white; }
.help-cards article > a:last-child { margin-bottom: .9rem; }
#movement-action .pressure-reset { border: 2px solid var(--ink); color: var(--ink); background: white; text-align: center; font-weight: 800; }

.river-app[data-movement="disturb"] .thread-line { opacity: 0; }
.river-app[data-movement="disturb"] .thread-line.is-pressure-active { opacity: .34; stroke-width: 2.2; }
.river-app[data-movement="disturb"] .thread-line.is-pressure-focus-edge { opacity: 1; stroke-width: 4; filter: drop-shadow(0 0 1.5px rgba(255,255,255,.95)); }
.river-app[data-movement="disturb"] .scene-node.is-unavailable { opacity: 0; pointer-events: none; }
.river-app[data-movement="disturb"] .scene-node:not(.is-unavailable):not(.is-pressure-affected):not(.is-active) { opacity: .38; }
.river-app[data-movement="disturb"] .scene-node.is-pressure-affected.is-muted { opacity: .2; box-shadow: none; }
.river-app[data-movement="disturb"] .scene-node.is-pressure-affected.is-pressure-sibling {
  opacity: 1;
  outline: 3px dashed var(--eco-yellow);
  outline-offset: 5px;
  box-shadow: 0 0 0 7px rgba(248,224,78,.16);
}
.river-app[data-movement="disturb"] .scene-node.is-pressure-affected:not(.is-muted),
.river-app[data-movement="disturb"] .scene-node.is-active { opacity: 1; }
.river-app[data-movement="disturb"] .scene-node.is-active { z-index: 5; box-shadow: 0 0 0 10px rgba(255,255,255,.36), 0 0 34px var(--eco-yellow); }
.river-app[data-movement="disturb"] #close-selection { display: none; }
.scene-node.is-pressure-affected::after { content: attr(data-pressure-stage); position: absolute; right: -5px; top: -7px; z-index: 1; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: var(--ink); background: var(--eco-yellow); border: 2px solid white; font-size: .75rem; font-weight: 900; }

.river-app[data-movement="disturb"][data-pressure-path="riverbank-cover"][data-pressure-step]:not([data-pressure-step="0"]) .creek-scene::before {
  content: ""; position: absolute; z-index: 1; inset: 0 45% 42% 0; pointer-events: none;
  background: linear-gradient(165deg, rgba(122,91,43,.58), transparent 65%); mix-blend-mode: multiply;
}
.river-app[data-movement="disturb"][data-pressure-path="enclosed-trap"][data-pressure-step="2"] .creek-scene::before {
  content: "Route to air blocked"; position: absolute; z-index: 4; left: 52%; top: 47%; width: 135px; padding: .5rem;
  color: white; background: rgba(160,63,45,.92); border: 2px solid white; border-radius: 8px; font-size: .75rem; font-weight: 850; text-align: center;
}

.river-app[data-movement="disturb"] .thread-panel > h3 { margin-bottom: .65rem; font-size: clamp(1.55rem, 2.2vw, 2.25rem); line-height: 1.08; }
.river-app[data-movement="disturb"] .thread-panel > #scene-copy { margin: .5rem 0 .7rem; }

@media (max-width: 760px) {
  .river-app,
  .world,
  .creek-world { overflow: visible; }
  .creek-world { grid-template-rows: auto auto auto; align-content: start; }
  .creek-world > .ecosystem-breadcrumbs { grid-column: 1; grid-row: 1; }
  .creek-world > .creek-scene { grid-column: 1; grid-row: 2; }
  /* Disturb keeps the Connect layout: scene above panel, matching DOM order,
     so the staged sediment/stage-badge feedback stays on screen while the
     user advances the sequence and keyboard order matches the visual order. */
  .creek-world > .thread-panel { grid-column: 1; grid-row: 3; }
  .creek-world > .creek-scene {
    min-height: 340px;
    height: clamp(340px, 42svh, 360px);
    max-height: 360px;
  }
  .creek-world > .thread-panel { height: auto; }
  .thread-panel { padding-top: 1rem; }
  .ecosystem-breadcrumbs { top: var(--header-h); grid-template-columns: 1fr auto; gap: .35rem; padding: .5rem .55rem; }
  .ecosystem-breadcrumbs > strong { grid-column: 1; }
  .ecosystem-breadcrumbs ol { grid-column: 1 / -1; grid-row: 2; padding-bottom: .12rem; }
  .ecosystem-breadcrumbs .breadcrumb-controls { grid-column: 2; grid-row: 1; }
  .ecosystem-breadcrumbs .breadcrumb-start { display: none; }
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .ecosystem-breadcrumbs {
    top: var(--header-h);
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr);
  }
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .ecosystem-breadcrumbs > strong,
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .ecosystem-breadcrumbs .breadcrumb-controls { display: none; }
  .river-app[data-waterbugs-view]:not([data-waterbugs-view="closed"]) .ecosystem-breadcrumbs ol {
    grid-column: 1;
    grid-row: 1;
  }
  .ecosystem-breadcrumbs button,
  .ecosystem-breadcrumbs a,
  .ecosystem-breadcrumbs [aria-current],
  .ecosystem-breadcrumbs .pressure-stage-nodes span[aria-current="step"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .connect-starters { grid-template-columns: 1fr; }
  .connect-preview { grid-template-columns: 1fr 1fr; }
  .waterbug-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .connect-mobile-key { display: block; }
  #movement-action .focus-relationship-list button { min-height: 132px; grid-template-columns: auto minmax(0, 1fr); }
  .focus-relationship-list .relationship-route,
  .focus-relationship-list .relationship-copy,
  .focus-relationship-list .relationship-follow { grid-column: 2; }
  .river-app[data-movement="connect"] .scene-node.is-connect-visible .node-label,
  .river-app[data-movement="disturb"] .scene-node:not(.is-unavailable).is-pressure-affected:not(.is-muted) .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-pressure-sibling .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active .node-label {
    visibility: visible; opacity: 1;
  }
  .river-app[data-movement="connect"] .scene-node[data-node-id="leaves-and-wood"] .node-label,
  .river-app[data-movement="connect"] .scene-node[data-node-id="flow"] .node-label {
    top: auto; bottom: calc(100% + 5px);
  }
  .river-app[data-movement="connect"] .scene-node[data-node-id="varied-bed"] .node-label {
    top: calc(100% + 5px); bottom: auto;
  }
  .river-app[data-movement="connect"] .scene-node.is-connect-visible:not(.is-active):not(.is-connect-entry) .node-label {
    visibility: hidden !important;
    opacity: 0 !important;
  }
  .river-app[data-movement="connect"] .scene-node[data-scene-option]:not(.is-active)::after { display: none; }
  .river-app[data-movement="connect"] .scene-node[data-scene-option]:not(.is-active)::before {
    content: attr(data-scene-option);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ink);
    background: var(--eco-yellow);
    font-size: .8rem;
    font-weight: 900;
  }
  .river-app[data-movement="connect"] .scene-node.is-connect-option {
    box-shadow: 0 0 0 6px rgba(248,224,78,.32), 0 0 14px rgba(248,224,78,.72);
  }
  .river-app[data-movement="connect"] .scene-node.is-active {
    box-shadow: 0 0 0 7px rgba(255,255,255,.36), 0 0 14px var(--eco-yellow);
  }
  .river-app[data-movement="connect"] .scene-node.is-active .node-label,
  .river-app[data-movement="connect"] .scene-node.is-connect-entry .node-label {
    min-width: 0;
    width: max-content;
    max-width: 118px;
    white-space: normal;
    text-align: center;
  }
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="riverbank-plants"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="bank-roots"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="leaves-and-wood"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="restoration"] .node-label {
    left: 0;
    right: auto;
    transform: none;
  }
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="platypus"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="flow"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="monitoring"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="enclosed-traps"] .node-label,
  .river-app[data-movement="connect"] .scene-node.is-connect-entry[data-node-id="platypus"] .node-label {
    right: 0;
    left: auto;
    transform: none;
  }
  .river-app[data-movement="connect"] .scene-node.is-active[data-node-id="waterbugs"] .node-label {
    top: calc(100% + 3px);
    right: 0;
    bottom: auto;
    left: auto;
    min-width: 0;
    width: max-content;
    max-width: 88px;
    padding: .15rem .35rem;
    transform: none;
    white-space: nowrap;
    font-size: .75rem;
    line-height: 1.15;
  }
  .pressure-paths { grid-template-columns: 1fr; }
  #movement-action .pressure-paths button { grid-template-columns: 1fr auto; align-items: center; }
  .pressure-breadcrumbs .pressure-branch-stage { grid-template-columns: 1fr; }
  .pressure-breadcrumbs > strong::after { content: " · scroll path →"; color: var(--eco-yellow); letter-spacing: .02em; text-transform: none; }
  .pressure-breadcrumb-list { padding-right: 1rem !important; mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%); }
  .pressure-breadcrumbs .pressure-stage-nodes { align-items: stretch; }
  .pressure-focus-card { order: -1; }
  .selected-card { margin-bottom: .5rem; }
  .scene-start-prompt { left: .6rem; bottom: 2rem; max-width: calc(100% - 1.2rem); font-size: .8rem; }
  .scene-start-prompt-below { display: inline; }
  .scene-start-prompt-arrow::before { content: "↓"; }
}

@media (max-width: 390px) {
  .ecosystem-breadcrumbs button { padding: .48rem .58rem; font-size: .75rem; }
  .connect-guide { padding: .75rem; }
  .connect-current { padding: .85rem; }
  .connect-current h4 { padding-right: 2.9rem; font-size: 1.55rem; }
  .connect-current p { padding-right: 0; }
  .pressure-focus-card { padding: .85rem; }
  .pressure-focus-card h4 { padding-right: 2.9rem; font-size: 1.5rem; }
  .pressure-focus-card p { padding-right: 0; }
  .pressure-branch-note > div { grid-template-columns: 1fr; }
  #movement-action .focus-relationship-list button { padding: .68rem; }
  .river-app[data-movement="disturb"] .scene-node:not(.is-active) .node-label {
    visibility: hidden !important;
    opacity: 0 !important;
  }
  .river-app[data-movement="disturb"] .scene-node[data-scene-option]:not(.is-active)::after { display: none; }
  .river-app[data-movement="disturb"] .scene-node[data-scene-option]:not(.is-active)::before {
    content: attr(data-scene-option);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ink);
    background: var(--eco-yellow);
    font-size: .8rem;
    font-weight: 900;
  }
  .river-app[data-movement="disturb"] .scene-node.is-active .node-label {
    min-width: 0;
    width: max-content;
    max-width: 118px;
    white-space: normal;
    text-align: center;
  }
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="riverbank-plants"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="bank-roots"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="leaves-and-wood"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="restoration"] .node-label {
    left: 0;
    right: auto;
    transform: none;
  }
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="platypus"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="waterbugs"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="flow"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="monitoring"] .node-label,
  .river-app[data-movement="disturb"] .scene-node.is-active[data-node-id="enclosed-traps"] .node-label {
    right: 0;
    left: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .river-app[data-movement="connect"] .scene-node.is-connect-entry { animation: none; }
}
