.bifurcation-app .lab-stage-shell {
  width: min(2000px, calc(100% - 2rem));
}

.bifurcation-app-layout {
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
}

.bifurcation-app .control-panel {
  position: static;
  max-height: none;
  overflow: visible;
}

.bifurcation-app .control-panel select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

.bifurcation-app .control-panel > p {
  font-size: 0.88rem;
}

.bifurcation-app .control-group legend,
.bifurcation-app .field-label {
  font-size: 0.72rem;
}

.bifurcation-app .field-label {
  letter-spacing: 0.03em;
  text-transform: none;
}

.bifurcation-app .math-symbol {
  text-transform: none;
}

.bifurcation-app .lab-button {
  min-height: 44px;
}

.parameter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.parameter-label label {
  min-width: 0;
}

.parameter-readout {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.42rem;
}

.bifurcation-app .parameter-play {
  display: inline-grid;
  width: 1.8rem;
  min-width: 1.8rem;
  height: 1.8rem;
  min-height: 1.8rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(11, 87, 72, 0.45);
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font-size: 0.62rem;
  line-height: 1;
}

.bifurcation-app .parameter-play:hover,
.bifurcation-app .parameter-play[aria-pressed="true"] {
  background: var(--forest);
  color: var(--white);
}

.bifurcation-app .parameter-play:focus-visible {
  outline: 3px solid rgba(217, 167, 63, 0.7);
  outline-offset: 2px;
}

.full-width-button {
  width: 100%;
  margin-top: 0.65rem;
}

.family-parameter-control {
  margin-top: 0.7rem;
  padding: 0.72rem;
  border: 1px solid rgba(11, 87, 72, 0.2);
  background: rgba(240, 238, 229, 0.72);
}

.family-parameter-control[hidden] {
  display: none;
}

.dynamic-family-controls[hidden],
.control-error[hidden],
.hysteresis-controls[hidden],
.hysteresis-panel[hidden] {
  display: none;
}

.family-parameter-control .field-label {
  margin-bottom: 0.35rem;
}

.family-parameter-control input[type="range"] {
  width: 100%;
}

.family-parameter-control .control-help {
  margin-top: 0.45rem;
}

.equation-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.equation-input-row > span {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.bifurcation-app .control-panel input[type="number"],
.bifurcation-app .control-panel input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
}

.bifurcation-app .control-panel input[aria-invalid="true"] {
  border-color: var(--orange);
  box-shadow: inset 3px 0 0 var(--orange);
}

.control-details {
  margin-top: 0.7rem;
}

.control-details summary {
  min-height: 44px;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.compact-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.65rem;
}

.compact-field-grid label {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.control-error {
  margin: 0.65rem 0 0;
  color: var(--orange);
  font-size: 0.76rem;
  line-height: 1.45;
}

.control-row-spaced,
.field-label-spaced {
  margin-top: 0.8rem;
}

.control-help,
.keyboard-help {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.control-help {
  margin: 0.65rem 0 0;
}

.keyboard-help {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

.nowrap {
  white-space: nowrap;
}

.equation-card {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid rgba(11, 87, 72, 0.22);
  background: #f0eee5;
}

.equation-card > span,
.equation-card > small {
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
}

.equation-card > span {
  text-transform: uppercase;
}

.equation-card code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.45;
}

.equation-card > small {
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: none;
}

.bifurcation-stage-heading {
  align-items: center;
}

.stage-heading-status {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
}

.stage-heading-status > p {
  margin: 0;
}

.stage-heading-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.stage-heading-toolbar > p {
  margin: 0;
}

.workspace-fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-color: rgba(11, 87, 72, 0.35);
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
}

.workspace-fullscreen-toggle[hidden] {
  display: none;
}

.stage-mini-telemetry {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.8rem;
}

.stage-mini-telemetry > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  white-space: nowrap;
}

.stage-mini-telemetry small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: none;
}

.stage-mini-telemetry strong {
  max-width: 190px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.84rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dynamics-workbench {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(440px, 1.35fr) minmax(340px, 0.85fr);
  background: #0c2621;
}

.dynamics-panel {
  min-width: 0;
  border-bottom: 1px solid rgba(235, 247, 243, 0.16);
}

.branches-panel {
  border-right: 1px solid rgba(235, 247, 243, 0.16);
  background: #e9e4d7;
}

.slope-panel {
  background: #09211d;
  color: var(--white);
}

.phase-panel {
  grid-column: 1 / -1;
  background: #f4f1e7;
}

.dynamics-heading {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.05rem;
  border-bottom: 1px solid rgba(23, 33, 29, 0.16);
}

.dynamics-heading > div:not(.pitchfork-surface-minimap) {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.65rem;
}

.dynamics-heading > div:not(.pitchfork-surface-minimap) > span {
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.dynamics-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.dynamics-heading p {
  max-width: 180px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  text-align: right;
}

.dynamics-heading-dark {
  border-bottom-color: rgba(235, 247, 243, 0.16);
  background: #0d2b25;
}

.dynamics-heading-dark > div > span {
  color: #79d8c5;
}

.dynamics-heading-dark p {
  color: rgba(235, 247, 243, 0.7);
}

.canvas-frame {
  position: relative;
  overflow: hidden;
}

.canvas-frame-large {
  min-height: clamp(390px, 48vh, 515px);
  background: #f4f1e7;
}

.canvas-frame-dark {
  background: #071c18;
}

.canvas-frame-phase {
  min-height: 170px;
  background: #f4f1e7;
}

.canvas-frame canvas,
.microscope-plot canvas,
.hysteresis-plot canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#bifurcation-canvas,
#slope-canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: pan-y;
}

#bifurcation-canvas[data-dragging="parameter"] {
  cursor: ew-resize;
}

#bifurcation-canvas[data-dragging="pan"] {
  cursor: grabbing;
}

#bifurcation-canvas[data-hover-candidate] {
  cursor: pointer;
}

.branches-heading {
  position: relative;
}

.branches-panel.has-pitchfork-surface .branches-heading {
  min-height: 104px;
  align-items: flex-start;
  padding-right: 10rem;
}

.branches-panel.has-pitchfork-surface .branches-heading > p {
  position: absolute;
  bottom: 0.62rem;
  left: 1.05rem;
  display: block;
  max-width: calc(100% - 11rem);
  font-size: 0.62rem;
  line-height: 1.3;
  text-align: left;
}

.pitchfork-surface-minimap {
  --surface-rest-width: 146px;
  --surface-rest-height: 88px;
  --surface-expanded-width: min(360px, calc(100% - 1.1rem));
  --surface-expanded-height: 270px;
  position: absolute;
  z-index: 6;
  top: 0.5rem;
  right: 0.55rem;
  display: grid;
  width: var(--surface-rest-width);
  height: var(--surface-rest-height);
  box-sizing: border-box;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0.32rem 0.4rem 0.3rem;
  overflow: hidden;
  border: 1px solid rgba(231, 246, 241, 0.25);
  background: rgba(7, 28, 24, 0.94);
  box-shadow: 0 10px 26px rgba(7, 28, 24, 0.2);
  color: #e7f0ec;
  pointer-events: auto;
  overscroll-behavior: contain;
  transition: width 160ms ease, height 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.pitchfork-surface-minimap[hidden] {
  display: none;
}

.pitchfork-surface-minimap:is([data-expanded="true"], .is-interacting),
.pitchfork-surface-minimap:has(#pitchfork-surface-canvas:focus),
.pitchfork-surface-minimap:has(.pitchfork-surface-reset:focus) {
  width: var(--surface-expanded-width);
  height: var(--surface-expanded-height);
  box-shadow: 0 16px 36px rgba(7, 28, 24, 0.34);
}

@media (hover: hover) {
  .pitchfork-surface-minimap:hover {
    width: var(--surface-expanded-width);
    height: var(--surface-expanded-height);
    box-shadow: 0 16px 36px rgba(7, 28, 24, 0.34);
  }
}

.pitchfork-surface-heading,
.pitchfork-surface-caption {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  font-family: var(--mono);
  letter-spacing: 0.035em;
}

.pitchfork-surface-heading {
  gap: 0.3rem;
  padding-bottom: 0.2rem;
  color: #e7f0ec;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.pitchfork-surface-heading strong {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitchfork-surface-heading span {
  flex: 0 0 auto;
  color: #79d8c5;
  font-size: 0.58rem;
}

#pitchfork-surface-beta {
  display: none;
}

.pitchfork-surface-expand,
.pitchfork-surface-reset {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(231, 246, 241, 0.28);
  background: rgba(231, 246, 241, 0.06);
  color: #e7f0ec;
  font: inherit;
}

.pitchfork-surface-expand {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  line-height: 1;
}

.pitchfork-surface-expand:hover,
.pitchfork-surface-expand:focus-visible,
.pitchfork-surface-reset:hover,
.pitchfork-surface-reset:focus-visible {
  border-color: rgba(242, 201, 105, 0.82);
  background: rgba(242, 201, 105, 0.12);
  color: #fffdf7;
}

.pitchfork-surface-minimap canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}

.pitchfork-surface-minimap canvas[data-dragging="rotate"] {
  cursor: grabbing;
}

.pitchfork-surface-minimap canvas:focus-visible {
  outline: 2px solid #f2c969;
  outline-offset: -2px;
}

.pitchfork-surface-caption {
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-top: 0.16rem;
  color: rgba(231, 240, 236, 0.76);
  font-size: 0.56rem;
  text-transform: none;
}

.pitchfork-surface-nav-hint {
  display: none;
  color: #f2c969;
  text-align: right;
}

.pitchfork-surface-reset {
  display: none;
  min-height: 1.5rem;
  padding: 0.08rem 0.32rem;
  white-space: nowrap;
}

.pitchfork-surface-minimap:is([data-expanded="true"], .is-interacting) .pitchfork-surface-reset,
.pitchfork-surface-minimap:has(#pitchfork-surface-canvas:focus) .pitchfork-surface-reset,
.pitchfork-surface-minimap:has(.pitchfork-surface-reset:focus) .pitchfork-surface-reset {
  display: inline-flex;
}

.pitchfork-surface-minimap:is([data-expanded="true"], .is-interacting) .pitchfork-surface-caption,
.pitchfork-surface-minimap:has(#pitchfork-surface-canvas:focus) .pitchfork-surface-caption,
.pitchfork-surface-minimap:has(.pitchfork-surface-reset:focus) .pitchfork-surface-caption {
  display: grid;
}

.pitchfork-surface-minimap:is([data-expanded="true"], .is-interacting) #pitchfork-surface-beta,
.pitchfork-surface-minimap:has(#pitchfork-surface-canvas:focus) #pitchfork-surface-beta,
.pitchfork-surface-minimap:has(.pitchfork-surface-reset:focus) #pitchfork-surface-beta {
  display: inline;
}

.pitchfork-surface-minimap:is([data-expanded="true"], .is-interacting) .pitchfork-surface-nav-hint,
.pitchfork-surface-minimap:has(#pitchfork-surface-canvas:focus) .pitchfork-surface-nav-hint,
.pitchfork-surface-minimap:has(.pitchfork-surface-reset:focus) .pitchfork-surface-nav-hint {
  display: inline;
}

@media (hover: hover) {
  .pitchfork-surface-minimap:hover #pitchfork-surface-beta {
    display: inline;
  }

  .pitchfork-surface-minimap:hover .pitchfork-surface-caption {
    display: grid;
  }

  .pitchfork-surface-minimap:hover .pitchfork-surface-reset {
    display: inline-flex;
  }

  .pitchfork-surface-minimap:hover .pitchfork-surface-nav-hint {
    display: inline;
  }
}

#phase-canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: pan-y;
}

#microscope-canvas {
  cursor: grab;
  touch-action: none;
}

#microscope-canvas[data-dragging="pan"] {
  cursor: grabbing;
}

.microscope-nav-hint {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.7rem;
  color: rgba(231, 240, 236, 0.7);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-transform: uppercase;
}

#bifurcation-canvas:focus-visible,
#microscope-canvas:focus-visible,
#phase-canvas:focus-visible {
  z-index: 3;
  outline: 3px solid #0b5748;
  outline-offset: -5px;
}

#slope-canvas:focus-visible {
  z-index: 3;
  outline: 3px solid #f2c969;
  outline-offset: -5px;
}

.local-popover {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: absolute;
  z-index: 8;
  width: min(700px, calc(100% - 24px));
  border: 2px solid #b38419;
  background: var(--paper);
  box-shadow: 0 18px 46px rgba(7, 28, 24, 0.28);
  color: var(--ink);
}

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

.local-popover::before {
  position: absolute;
  top: clamp(18px, var(--pointer-y), calc(100% - 18px));
  width: 13px;
  height: 13px;
  border: solid #b38419;
  background: var(--paper);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.local-popover[data-side="left"]::before {
  left: -8px;
  border-width: 0 0 2px 2px;
}

.local-popover[data-side="right"]::before {
  right: -8px;
  border-width: 2px 2px 0 0;
}

.local-popover[data-side="top"]::before {
  top: -8px;
  left: clamp(18px, var(--pointer-x), calc(100% - 18px));
  border-width: 2px 0 0 2px;
  transform: translateX(-50%) rotate(45deg);
}

.local-popover[data-side="bottom"]::before {
  top: auto;
  bottom: -8px;
  left: clamp(18px, var(--pointer-x), calc(100% - 18px));
  border-width: 0 2px 2px 0;
  transform: translateX(-50%) rotate(45deg);
}

.local-popover-heading {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.48rem 0.58rem 0.48rem 0.8rem;
  border-bottom: 1px solid var(--hairline);
  background: #efeadd;
}

.local-popover-heading > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.6rem;
}

.local-popover-heading span {
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.local-popover-heading strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-popover-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
  font: 1.25rem/1 var(--sans);
  cursor: pointer;
}

.local-popover-close:hover,
.local-popover-close:focus-visible {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--white);
}

.local-popover-body {
  display: grid;
  grid-template-columns: minmax(235px, 0.9fr) minmax(275px, 1.1fr);
}

.local-popover-plot {
  min-height: 330px;
  border-right: 1px solid var(--hairline);
}

.local-popover-copy {
  padding: 0.75rem;
}

.local-popover-copy .classification-row {
  gap: 0.55rem;
  padding-bottom: 0.55rem;
}

.local-popover-copy > p {
  margin: 0.55rem 0;
  font-size: 0.72rem;
  line-height: 1.42;
}

.local-popover-copy .formula-block {
  margin-top: 0.48rem;
  padding: 0.55rem;
}

.local-popover-copy .formula-block code {
  font-size: 0.78rem;
  line-height: 1.35;
}

.jet-details {
  margin-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}

.jet-details summary {
  min-height: 34px;
  padding-top: 0.35rem;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.jet-details .derivative-grid {
  margin: 0 0 0.45rem;
}

.jet-details .derivative-grid > div {
  padding: 0.4rem;
}

.jet-details .derivative-grid dd {
  font-size: 0.64rem;
}

.method-notes {
  border: 1px solid var(--hairline);
  border-top: 0;
  background: #ece8dd;
}

.method-notes summary {
  min-height: 44px;
  padding: 0.8rem 1rem;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.method-notes .app-note {
  margin: 0;
  padding: 0 1rem 1rem;
}

.plot-legend,
.microscope-legend,
.hysteresis-legend {
  position: absolute;
  z-index: 2;
  right: 0.8rem;
  bottom: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid rgba(23, 33, 29, 0.15);
  background: rgba(244, 241, 231, 0.88);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  backdrop-filter: blur(8px);
  pointer-events: none;
  text-transform: none;
}

.plot-legend span,
.microscope-legend span,
.hysteresis-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.microscope-legend [hidden] {
  display: none;
}

.plot-legend i,
.microscope-legend i,
.hysteresis-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  background: #79d8c5;
}

.plot-legend .legend-unstable {
  height: 0;
  border-top: 3px dashed #9c4528;
  background: transparent;
}

.plot-legend .legend-stable {
  background: #0b6f60;
}

.plot-legend .legend-current {
  background: #8a6200;
}

.phase-readout {
  display: flex;
  min-height: 38px;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 1rem;
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
  background: #ece8dd;
}

.equilibrium-chip {
  padding: 0.25rem 0.42rem;
  border: 1px solid rgba(23, 33, 29, 0.14);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.equilibrium-chip[data-stability="stable"] {
  border-left: 4px solid #188b76;
}

.equilibrium-chip[data-stability="unstable"] {
  border-left: 4px dashed #9c4528;
}

.equilibrium-chip[data-stability="neutral"] {
  border-left: 4px double #8a6200;
}

.bifurcation-telemetry .telemetry-item strong {
  font-size: 1.06rem;
}

.microscope-panel,
.hysteresis-panel {
  overflow: hidden;
}

.microscope-grid,
.hysteresis-grid {
  display: grid;
  grid-template-columns: minmax(440px, 1.25fr) minmax(300px, 0.75fr);
  min-height: 360px;
}

.microscope-plot,
.hysteresis-plot {
  position: relative;
  min-height: 360px;
  border-right: 1px solid var(--hairline);
  background: #071c18;
}

.microscope-copy,
.hysteresis-copy {
  padding: clamp(1rem, 2.2vw, 1.6rem);
  background: #f4f1e7;
}

.classification-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

#classification-badge {
  padding: 0.35rem 0.5rem;
  background: var(--forest);
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#candidate-coordinate {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.5;
  text-align: right;
}

.microscope-copy > p,
.hysteresis-copy > p {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.62;
}

.derivative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}

.derivative-grid > div {
  min-width: 0;
  padding: 0.65rem;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.derivative-grid dt {
  color: var(--forest);
  font-family: var(--serif);
  font-style: italic;
}

.derivative-grid dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.formula-block {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.72rem;
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  background: var(--white);
}

.formula-block > span {
  color: var(--forest);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.formula-block code {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.55;
}

.formula-block-accent {
  border-left: 4px solid #d9a73f;
}

.local-caveat {
  margin-bottom: 0;
  font-size: 0.76rem !important;
}

.microscope-legend,
.hysteresis-legend {
  border-color: rgba(235, 247, 243, 0.16);
  background: rgba(7, 28, 24, 0.82);
  color: rgba(235, 247, 243, 0.76);
}

.microscope-legend .legend-exact {
  background: #fffdf7;
}

.microscope-legend .legend-taylor {
  background: #79d8c5;
}

.microscope-legend .legend-normal {
  background: #b5a1df;
}

.hysteresis-legend .legend-forward {
  background: #e5b95f;
}

.hysteresis-legend .legend-backward {
  height: 0;
  border-top: 3px dashed #b5a1df;
  background: transparent;
}

.hysteresis-grid {
  grid-template-columns: minmax(440px, 1.4fr) minmax(280px, 0.6fr);
  min-height: 310px;
}

.hysteresis-plot {
  min-height: 310px;
}

.hysteresis-copy {
  display: flex;
  flex-direction: column;
}

.memory-readout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-top: 1px solid var(--hairline);
}

.memory-readout > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: none;
}

.memory-readout > strong {
  text-align: right;
  font-family: var(--serif);
  font-weight: 500;
}

.memory-readout-wide {
  grid-template-columns: 1fr;
}

.memory-readout-wide > strong {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: left;
}

#hysteresis-panel-button {
  width: 100%;
  margin-top: auto;
}

.local-popover .local-popover-plot {
  position: relative;
  min-height: 320px;
  border-right: 1px solid var(--hairline);
  background: #071c18;
}

.local-popover .local-popover-copy {
  padding: 0.75rem;
}

.local-popover .local-popover-copy > p {
  margin: 0.55rem 0;
  font-size: 0.72rem;
  line-height: 1.42;
}

.local-popover .local-popover-copy .formula-block {
  margin-top: 0.48rem;
  padding: 0.55rem;
}

.local-popover .local-popover-copy .formula-block code {
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 1270px) {
  .bifurcation-app-layout {
    grid-template-columns: 1fr;
  }

  .bifurcation-app .control-panel {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 1.2rem;
    overflow: visible;
  }

  .bifurcation-app .control-panel > h2,
  .bifurcation-app .control-panel > p,
  .keyboard-help {
    grid-column: 1 / -1;
  }

}

@media (min-width: 761px) and (max-width: 1270px) {
  .dynamic-family-controls:not([hidden]) {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .dynamics-workbench {
    grid-template-columns: 1fr;
  }

  .branches-panel {
    border-right: 0;
  }

  .phase-panel {
    grid-column: auto;
  }

  .pitchfork-surface-minimap {
    --surface-rest-width: 140px;
    --surface-rest-height: 84px;
    --surface-expanded-width: min(340px, calc(100% - 1rem));
    --surface-expanded-height: 250px;
  }

  .microscope-grid,
  .hysteresis-grid {
    grid-template-columns: 1fr;
  }

  .microscope-plot,
  .hysteresis-plot {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
}

@media (max-width: 760px) {
  .bifurcation-app .control-panel {
    grid-template-columns: 1fr;
  }

  .bifurcation-app .control-panel > h2,
  .bifurcation-app .control-panel > p,
  .keyboard-help {
    grid-column: auto;
  }

  .bifurcation-stage-heading {
    align-items: flex-start;
  }

  .dynamics-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dynamics-heading p {
    max-width: none;
    text-align: left;
  }

  .canvas-frame-large {
    min-height: 390px;
  }

  .stage-heading-status {
    width: 100%;
    justify-items: start;
  }

  .stage-mini-telemetry {
    justify-content: flex-start;
  }

  .local-popover {
    left: 8px !important;
    width: calc(100% - 16px);
    max-height: min(calc(100% - 16px), calc(100vh - 16px));
    overflow: auto;
  }

  .local-popover::before {
    display: none;
  }

  .local-popover-heading {
    position: sticky;
    z-index: 2;
    top: 0;
  }

  .local-popover-body {
    grid-template-columns: 1fr;
  }

  .local-popover .local-popover-plot {
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .plot-legend,
  .microscope-legend,
  .hysteresis-legend {
    right: 0.45rem;
    bottom: 0.45rem;
    left: 0.45rem;
  }

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

@media (max-width: 700px) {
  .bifurcation-app .lab-stage-shell {
    width: min(100% - 0.75rem, 2000px);
  }
}

@media (max-width: 480px) {
  .compact-field-grid {
    grid-template-columns: 1fr;
  }

  .canvas-frame-large {
    min-height: 340px;
  }

  .canvas-frame-phase {
    min-height: 220px;
  }

  .pitchfork-surface-minimap {
    top: 0.45rem;
    right: 0.45rem;
    --surface-rest-width: 116px;
    --surface-rest-height: 76px;
    --surface-expanded-width: calc(100% - 0.9rem);
    --surface-expanded-height: 228px;
    padding: 0.3rem 0.36rem;
  }

  .branches-panel.has-pitchfork-surface .branches-heading {
    min-height: 94px;
    padding-right: 7.6rem;
  }

  .branches-panel.has-pitchfork-surface .branches-heading > p {
    bottom: 0.48rem;
    left: 0.9rem;
    max-width: calc(100% - 8.4rem);
    font-size: 0.56rem;
  }

  .pitchfork-surface-heading {
    font-size: 0.55rem;
  }

  .pitchfork-surface-heading span,
  .pitchfork-surface-caption {
    font-size: 0.5rem;
  }

  .pitchfork-surface-nav-hint {
    display: none;
  }

  .microscope-plot,
  .hysteresis-plot {
    min-height: 330px;
  }

  .classification-row,
  .memory-readout {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  #candidate-coordinate,
  .memory-readout > strong {
    text-align: left;
  }
}

@media (forced-colors: active) {
  #bifurcation-canvas,
  #pitchfork-surface-canvas,
  #slope-canvas,
  #phase-canvas,
  #microscope-canvas,
  #hysteresis-canvas {
    border: 2px solid CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pitchfork-surface-minimap {
    transition: none;
  }

  #bifurcation-canvas,
  #slope-canvas,
  #phase-canvas,
  #hysteresis-canvas {
    scroll-behavior: auto;
  }
}

#bifurcation-workspace.is-fullscreen {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.75rem;
  padding: max(0.65rem, env(safe-area-inset-top)) max(0.65rem, env(safe-area-inset-right)) max(0.65rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
  overflow: hidden;
  background: #e9e4d7;
}

#bifurcation-workspace:fullscreen::backdrop,
#bifurcation-workspace:-webkit-full-screen::backdrop {
  background: #e9e4d7;
}

#bifurcation-workspace.is-fullscreen .control-panel {
  position: static;
  display: block;
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-template-columns: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#bifurcation-workspace.is-fullscreen .stage-stack {
  height: 100%;
  min-height: 0;
  gap: 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#bifurcation-workspace.is-fullscreen .stage-stack > .stage-panel:first-child {
  display: grid;
  min-height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

#bifurcation-workspace.is-fullscreen .stage-heading {
  padding: 0.8rem 1rem;
}

#bifurcation-workspace.is-fullscreen .method-notes {
  display: none;
}

#bifurcation-workspace.is-fullscreen .dynamics-workbench {
  min-height: 0;
  grid-template-columns: minmax(400px, 1.35fr) minmax(300px, 0.85fr);
  grid-template-rows: minmax(260px, 1fr) minmax(220px, 0.38fr);
}

#bifurcation-workspace.is-fullscreen .branches-panel,
#bifurcation-workspace.is-fullscreen .slope-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

#bifurcation-workspace.is-fullscreen .phase-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
}

#bifurcation-workspace.is-fullscreen .canvas-frame-large,
#bifurcation-workspace.is-fullscreen .canvas-frame-phase {
  min-height: 0;
}

@media (min-width: 1280px) {
  #bifurcation-workspace.is-fullscreen.is-hysteresis {
    grid-template-columns: minmax(260px, 280px) minmax(0, 1fr);
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .stage-stack {
    grid-template-columns: minmax(0, 2.3fr) minmax(270px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    scrollbar-gutter: auto;
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .stage-stack > .stage-panel:first-child,
  #bifurcation-workspace.is-fullscreen.is-hysteresis .stage-stack > .hysteresis-panel:not([hidden]) {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .dynamics-workbench {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.38fr);
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-panel:not([hidden]) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-panel .stage-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-panel .stage-heading > p {
    text-align: left;
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-grid {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr);
    overflow: hidden;
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-plot {
    min-width: 0;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }

  #bifurcation-workspace.is-fullscreen.is-hysteresis .hysteresis-copy {
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 1179px) {
  #bifurcation-workspace.is-fullscreen {
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  }

  #bifurcation-workspace.is-fullscreen .control-panel {
    display: block;
  }

  #bifurcation-workspace.is-fullscreen .stage-stack > .stage-panel:first-child {
    display: block;
    min-height: 0;
  }

  #bifurcation-workspace.is-fullscreen .dynamics-workbench {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  #bifurcation-workspace.is-fullscreen .branches-panel,
  #bifurcation-workspace.is-fullscreen .slope-panel,
  #bifurcation-workspace.is-fullscreen .phase-panel {
    display: block;
  }

  #bifurcation-workspace.is-fullscreen .phase-panel {
    grid-column: auto;
  }

  #bifurcation-workspace.is-fullscreen .canvas-frame-large {
    min-height: 390px;
  }

  #bifurcation-workspace.is-fullscreen .canvas-frame-phase {
    min-height: 170px;
  }
}

@media (max-width: 719px) {
  #bifurcation-workspace.is-fullscreen {
    display: block;
    overflow-y: auto;
  }

  #bifurcation-workspace.is-fullscreen .control-panel,
  #bifurcation-workspace.is-fullscreen .stage-stack {
    height: auto;
    overflow: visible;
  }

  #bifurcation-workspace.is-fullscreen .stage-stack {
    margin-top: 0.75rem;
  }

  .stage-heading-toolbar {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }
}
