.demo-chaos {
  background: var(--ch-paper, #08090a);
  color: var(--ch-text, #dfdfd2);
  --atlas-acid: var(--ch-accent, #d7fe38);
  --atlas-line: var(--ch-line, #303633);
  --atlas-surface: var(--ch-surface, #111815);
}

.chaos-atlas {
  width: min(100%, 1660px);
  margin-inline: auto;
  padding: 0 clamp(16px, 3vw, 44px);
}

.chaos-public .hub-header {
  padding: 8px clamp(16px, 3vw, 44px);
}

.atlas-exhibit {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  column-gap: 20px;
  padding-top: 14px;
}

.atlas-exhibit > * { grid-column: 2; min-width: 0; }
.atlas-workspace { display: contents; }
.atlas-model-heading { grid-column: 2; padding: 0 0 14px; min-width: 0; }
.atlas-exhibit > .atlas-downloads { grid-column: 1 / -1; }

.atlas-model-heading h1 {
  margin: 0;
  font-size: clamp(24px, 3.6vw, 42px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.atlas-small {
  margin: 0;
  color: var(--ch-muted, #a6b2a4);
  font-size: 13px;
  line-height: 1.4;
}

.atlas-model-heading p { margin-top: 4px; }

.atlas-picker {
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 4;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: var(--ch-surface, #101913);
  border: 1px solid var(--ch-line, #3b483b);
  border-radius: 5px;
}

.atlas-model-field > label {
  display: block;
  margin-bottom: 3px;
  color: var(--ch-muted, #bdc8b7);
  font-size: 14px;
  line-height: 1.25;
}

.atlas-picker #atlas-count { grid-column: 1 / -1; }
#atlas-count:empty { display: none; }

.atlas-picker select,
.atlas-filter-form input,
.atlas-calculation input,
.atlas-calculation select,
.atlas-params input,
.atlas-appearance select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--atlas-surface);
  border: 1px solid var(--ch-line, #545e50);
  color: var(--ch-text, #e3e9df);
  font: inherit;
}

.atlas-picker button,
.atlas-picker summary,
.atlas-controls button,
.atlas-controls summary,
.hub-inline-research > .hub-research > .hub-actions button,
.atlas-calculation button {
  min-height: 44px;
  padding: 8px 12px;
  background: var(--ch-surface, #111612);
  border: 1px solid var(--ch-line, #485447);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
}

.atlas-picker button:disabled,
.atlas-picker select:disabled,
.atlas-controls button:disabled,
.atlas-calculation button:disabled {
  opacity: .55;
  cursor: default;
}

.atlas-controls #atlas-distortion-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-color: var(--ch-strong-line, #7d9149);
  background: var(--ch-soft, #192111);
  font-weight: 600;
}

.atlas-controls #atlas-distortion-switch[aria-checked="true"] {
  border-color: var(--atlas-acid);
}

.atlas-switch-track {
  position: relative;
  flex: none;
  inline-size: 32px;
  height: 18px;
  border: 1px solid var(--ch-muted, #a6b2a4);
  border-radius: 10px;
  background: var(--ch-line, #353d35);
}

.atlas-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ch-on-accent, #f0f3e9);
}

#atlas-distortion-switch[aria-checked="true"] .atlas-switch-track {
  border-color: var(--atlas-acid);
  background: var(--atlas-acid);
}

#atlas-distortion-switch[aria-checked="true"] .atlas-switch-track::after {
  transform: translateX(14px);
  background: var(--ch-on-accent, #191f12);
}

.atlas-switch-state {
  min-width: 5ch;
  color: var(--ch-muted, #c1cdbc);
  text-align: right;
  font-size: 13px;
}

#atlas-distortion-switch[aria-checked="true"] .atlas-switch-state { color: var(--atlas-acid); }
#atlas-distortion-switch[aria-checked="false"] .atlas-switch-on,
#atlas-distortion-switch[aria-checked="true"] .atlas-switch-off {
  display: none;
}

.chaos-atlas :focus-visible {
  outline: 2px solid var(--atlas-acid);
  outline-offset: 3px;
}

.atlas-picker .atlas-filter-panel > summary {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
  list-style: none;
}

.atlas-filter-panel > summary::-webkit-details-marker { display: none; }
.atlas-filter-panel[open] > summary { border-color: var(--atlas-acid); }

.atlas-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-top: 12px;
}

.atlas-filter-form label {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  color: var(--ch-muted, #cfdbce);
  font-size: 14px;
}

.atlas-search-field, .atlas-filter-actions { grid-column: 1 / -1; }

.atlas-filter-actions,
.atlas-controls,
.atlas-appearance-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.atlas-filter-actions a { font-size: 14px; }

.atlas-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(310px, calc(100svh - 260px), 690px);
  background: var(--ch-surface, #050607);
  border: 1px solid var(--ch-line, #3b483b);
  border-radius: 5px;
}

.atlas-stage > #atlas-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.atlas-stage > #atlas-canvas:active { cursor: grabbing; }
.atlas-stage > #atlas-canvas:focus-visible { outline-offset: -4px; }
.atlas-signal-plots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.atlas-stage-formula {
  position: absolute;
  z-index: 0;
  inset: 20px 24px 48px;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  pointer-events: none;
  opacity: .8;
  color: var(--ch-text, #e2e7d5);
  font-size: 13px;
}

.atlas-stage-formula math {
  flex: none;
  margin: 0;
  transform-origin: top left;
  font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', math;
}

.atlas-stage-caption {
  position: absolute;
  z-index: 2;
  inset: auto 16px 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  pointer-events: none;
  color: var(--ch-muted, #a9b6a2);
  font: 11px/1.4 monospace;
  letter-spacing: .04em;
}

#atlas-effect-label { color: var(--ch-danger, #c1a4c7); }

.atlas-stage-identity { display: grid; gap: 4px; min-width: 0; max-width: 100%; }
#atlas-system-citation { color: var(--ch-text, #d0d9c9); font: 12px/1.45 system-ui, sans-serif; overflow-wrap: anywhere; }
#atlas-system-citation a { color: inherit; pointer-events: auto; text-decoration: none; }
#atlas-system-citation a:hover { text-decoration: underline; }

.atlas-stage #atlas-loading {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 28px;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px;
  background: var(--ch-overlay, #080a09e8);
  color: var(--atlas-acid);
  font: 14px/1.4 monospace;
}

.atlas-controls { padding: 10px 0; }

.atlas-appearance[open] { flex-basis: 100%; }
.atlas-appearance[open] > summary { width: fit-content; }

.atlas-appearance-fields { padding: 10px 0 0; }

.atlas-appearance-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--ch-muted, #c6cdc2);
  font-size: 14px;
}

.atlas-appearance select { width: auto; max-width: 225px; }
.atlas-appearance input { width: 110px; accent-color: var(--atlas-acid); }
.atlas-appearance .atlas-axes input { width: auto; }

.atlas-details { border-top: 1px solid var(--atlas-line); }
.atlas-details > summary { padding: 14px 0; cursor: pointer; }
.atlas-details.atlas-research .hub-lab { padding: 12px 0 20px; border-top: 0; }
.atlas-plot-settings-form { display: grid; gap: 16px; padding: 0 0 20px; }
.atlas-plot-settings-form fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--ch-line, #354138);
}
.atlas-plot-settings-form legend { padding: 0 6px; color: var(--ch-text, #d5dfcc); font-size: 14px; }
.atlas-plot-settings-form label, .hub-series-window label { display: grid; align-content: start; gap: 6px; min-width: 0; color: var(--ch-muted, #bdc8b7); font-size: 13px; }
.atlas-plot-settings-form input, .atlas-plot-settings-form select, .hub-series-window select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  background: var(--ch-surface, #111815);
  color: var(--ch-text, #e0e7d9);
  border: 1px solid var(--ch-line, #465444);
  border-radius: 3px;
  font: 14px system-ui, sans-serif;
}
.atlas-plot-settings-form input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--atlas-acid); }
.atlas-plot-settings-form input[type=range], .hub-series-window input[type=range] { padding: 0; accent-color: var(--atlas-acid); }
.atlas-plot-settings-form :disabled { opacity: .4; }
.hub-inline-research .hub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.hub-inline-research .hub-status { color: var(--ch-muted, #adbfac); font-size: 13px; line-height: 1.5; }
.hub-inline-research canvas { display: block; width: 100%; height: auto; background: var(--ch-surface, #080e0b); border: 1px solid var(--ch-line, #354138); }
.hub-series-window { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 14px; margin: 14px 0; }

.atlas-model-note { margin: 0; color: var(--ch-muted, #bdc8b7); font-size: 15px; }
.atlas-method { color: var(--ch-muted, #adbba3); font: 14px/1.6 monospace; }

.atlas-equation-mobile { display: none; }
@media (max-width: 1000px) and (hover: none) and (pointer: coarse) {
  .atlas-equation-desktop { display: none; }
  .atlas-equation-mobile { display: block; }
}

.atlas-details :is(#atlas-equations, #atlas-mobile-equations) {
  max-height: 460px;
  overflow: auto;
  padding: 16px;
  background: var(--ch-surface, #111610);
  border: 1px solid var(--ch-line, #384633);
  color: var(--ch-text, #d7e1c7);
  font: 15px/1.6 monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.atlas-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.atlas-params label,
.atlas-calculation label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--ch-muted, #c6d0bf);
  font-size: 15px;
}

.atlas-calculation {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}

.atlas-calculation label { flex: 1 1 135px; }
.atlas-calculation button, .atlas-noscript a { color: var(--atlas-acid); }
.atlas-notes { padding-left: 22px; color: var(--ch-muted, #aeba9f); font-size: 15px; }
.atlas-sources, #atlas-download-links { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.atlas-sources { padding-bottom: 16px; }
.atlas-downloads { padding: 24px 0; border-top: 1px solid var(--atlas-line); }
.atlas-downloads h2 { margin: 10px 0; font-size: clamp(22px, 3vw, 30px); }
.atlas-downloads > p { max-width: 78ch; }
.atlas-downloads a, .atlas-sources a { color: var(--atlas-acid); overflow-wrap: anywhere; }
.hub-passport a { overflow-wrap: anywhere; }
#atlas-download-links a { padding: 10px; border: 1px solid var(--ch-line, #56644b); text-decoration: none; }
.atlas-noscript { padding: 16px; }
.chaos-atlas [hidden] { display: none !important; }

@media (max-width: 1000px) {
  .atlas-exhibit { display: block; }
  .atlas-workspace { display: grid; gap: 12px; padding-bottom: 12px; }
  .atlas-model-heading { grid-column: auto; padding-bottom: 0; }
  .atlas-picker { grid-column: auto; grid-row: auto; }
  .atlas-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .chaos-public .hub-header { padding-block: 8px; gap: 4px 12px; }
  .chaos-public .hub-header nav { gap: 4px 12px; }
  .chaos-public .hub-header nav a { font-size: 14px; }
  .atlas-workspace { grid-template-columns: minmax(0, 1fr); }
  .atlas-stage { height: clamp(360px, 58svh, 540px); }
  .atlas-stage-formula { inset: 12px 12px 44px; }
  .atlas-model-heading p { margin-top: 2px; }
}

@media (max-width: 450px) {
  .atlas-picker button, .atlas-controls button, .atlas-controls summary { padding-inline: 8px; font-size: 14px; }
  .atlas-filter-form { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .atlas-filter-actions { gap: 6px; }
  .atlas-stage-caption { inset-inline: 10px; }
}

.atlas-orbit-status{margin:0 0 12px;color:var(--ch-muted, #c5d4b5);font-size:15px;line-height:1.5;overflow-wrap:anywhere}.atlas-controls #atlas-next-generator{border-style:dashed}

.atlas-code-jump {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .55rem;
  min-height: 2rem;
  border: 1px solid var(--ch-line, #485447);
  border-radius: 4px;
  background: var(--ch-surface, #111612);
  font-size: .86rem;
  text-decoration: none;
}
.atlas-code-jump:hover { border-color: var(--atlas-acid); }
.atlas-psd-range { display: flex; flex-wrap: wrap; align-items: end; gap: .3rem .55rem; margin-block-end: .45rem; }
.atlas-psd-range label { display: grid; gap: .15rem; font-size: .8rem; }
.atlas-psd-range :is(select,button,input) {
  min-height: 2rem;
  border: 1px solid var(--ch-line, #526050);
  border-radius: 4px;
  padding: .18rem .46rem;
  color: inherit;
  background: var(--ch-surface, #111815);
  font: inherit;
}
.atlas-psd-range input { width: 6.5rem; }
.atlas-psd-range button { cursor: pointer; }

.atlas-filter-form label.atlas-map-filter { display: flex; align-items: center; gap: .5rem; }
.atlas-filter-form .atlas-map-filter input { width: 1.2rem; min-height: 1.2rem; height: 1.2rem; padding: 0; accent-color: var(--atlas-acid); }
.atlas-share-tool { position: relative; }
.atlas-share-result { position: absolute; inset-block-start: calc(100% + .3rem); z-index: 8; width: max-content; max-width: min(19rem, 88vw); padding: .45rem .65rem; border: 1px solid var(--atlas-line); border-radius: 4px; color: var(--ch-text, #e3e9df); background: var(--ch-soft, #17201c); font-size: .85rem; }
.atlas-share-result input { width: 100%; min-width: 0; font: inherit; }
@media (max-width: 650px) { .atlas-share-tool { position: static; } .atlas-controls:has(.atlas-share-tool) { position: relative; } .atlas-share-result { inset-inline-start: 0; } }
