.atlas-visual {
  min-width: 0;
  position: relative;
  container: atlas-view / inline-size;
  --atlas-side-width: clamp(290px, 34%, 370px);
  --atlas-scene-height: clamp(310px, calc(100svh - 260px), 690px);
}
.atlas-side, .atlas-view-toolbar, .atlas-map-resources, .atlas-metric-dock { color: var(--ch-text, #e2e7d5); min-width: 0; font-size: .875rem; }
.atlas-view-toolbar {
  display: flex;
  align-items: start;
  gap: .35rem .65rem;
}
.atlas-view-toolbar > .atlas-controls { flex: 1 0 auto; position: relative; }
.atlas-view-toolbar > .atlas-side-bar { flex: 0 1 auto; min-width: 0; margin-inline-start: auto; }
.atlas-view-toolbar .atlas-appearance[open] { flex-basis: auto; }
.atlas-view-toolbar .atlas-appearance-fields {
  position: absolute;
  z-index: 4;
  inset: calc(100% + .25rem) auto auto 0;
  width: min(100%, 36rem);
  padding: .65rem;
  border: 1px solid var(--atlas-line);
  border-radius: 5px;
  background: var(--ch-surface, #111815);
}
.atlas-view-toolbar .atlas-switch-state { display: none; }
.atlas-side-bar, .atlas-side-view-controls, .atlas-side-tabs {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.atlas-side-bar { justify-content: flex-end; }
.atlas-side-view-controls { flex-wrap: wrap; justify-content: flex-end; }
.atlas-view-toolbar .atlas-side-bar button {
  min-height: 2rem;
  padding: .22rem .42rem;
  font-size: .81rem;
  line-height: 1.15;
  white-space: nowrap;
}
.atlas-side :is(button,select), .atlas-side-bar :is(button,select), .atlas-map-resources :is(button,select), .atlas-metric-dock :is(button,select) {
  color: inherit; background: var(--ch-surface, #111815); border: 1px solid var(--ch-line, #526050);
  border-radius: 4px; padding: .38rem .62rem; font: inherit; min-width: 0;
}
.atlas-side button, .atlas-side-bar button, .atlas-map-resources :is(summary,button), .atlas-metric-dock button { cursor: pointer; }
.atlas-side button:is(:hover,:focus-visible,[aria-pressed="true"]),
.atlas-metric-dock button:is(:hover,:focus-visible,[aria-pressed="true"]),
.atlas-side-bar button:is(:hover,:focus-visible,[aria-selected="true"],[aria-pressed="true"]) { border-color: var(--atlas-acid); color: var(--atlas-acid); }
.atlas-side label { display: inline-flex; flex-wrap: wrap; gap: .28rem .45rem; align-items: center; min-width: 0; }
.atlas-side input[type="checkbox"] { accent-color: var(--atlas-acid); }
.atlas-side-status { margin: .5rem 0 0; color: var(--ch-warm, #e7c596); font-size: .875rem; }
.atlas-parameter-panel { container: atlas-map / inline-size; display: flex; flex: 1; flex-direction: column; gap: .35rem; min-width: 0; }
.atlas-visual .atlas-side { background: var(--ch-surface, #0b100d); border: 1px solid var(--atlas-line); border-radius: 5px; padding: .55rem .65rem; display: flex; flex-direction: column; gap: .4rem; }
.atlas-side-options { display: flex; gap: .5rem 1rem; align-items: center; flex-wrap: wrap; }

.atlas-parameter-panel :is(p, dl, h3, h4) { margin: .48rem 0; }
.atlas-parameter-panel h3 { font-size: 1.04rem; }
.atlas-parameter-panel h4 { font-size: .95rem; }
.atlas-map-row { display: grid; gap: .7rem; }
.atlas-map-figure { min-width: 0; margin: 0; }

.atlas-map-figure figcaption { overflow-wrap: anywhere; font-size: .875rem; }
.atlas-map-axis-x, .atlas-map-axis-y { display: flex; justify-content: space-between; gap: .3rem; color: var(--ch-muted, #c5d4b5); font-size: .8rem; }
.atlas-map-axis-x { margin: .28rem 0; }
.atlas-map-y { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem; }
.atlas-map-y > .atlas-map-plot { align-self: start; }
.atlas-map-axis-y { flex-direction: column-reverse; align-items: end; }
.atlas-map-plot { position: relative; min-width: 0; touch-action: pinch-zoom; -webkit-touch-callout: none; }
.atlas-map-row[data-touch-locked] .atlas-map-plot { touch-action: pan-y pinch-zoom; }
.atlas-map-thumb-list { -webkit-touch-callout: none; }
.atlas-map-plot canvas.atlas-parameter-map { display: block; width: 100%; image-rendering: pixelated; cursor: crosshair; }
.atlas-map-plot svg, .atlas-map-representatives { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.atlas-map-representatives button { pointer-events: auto; }
.atlas-map-representatives svg line { stroke: #fff; stroke-width: .55; opacity: 0; }
.atlas-map-representatives svg line.active { opacity: 1; }
.atlas-map-hopf {
  fill: none;
  stroke: #f8ffd6;
  stroke-width: 1.5px;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 1px #18282c);
}
.atlas-profile-chart {
  display: grid; width: 100%; grid-template-columns: max-content minmax(0,1fr);
  gap: .25rem .35rem; font: .7rem/1.15 system-ui,sans-serif; font-variant-numeric: tabular-nums;
  color: var(--ch-muted, #b6c8b8);
}
.atlas-profile-chart canvas.atlas-parameter-map { min-height: 8.5rem; }
.atlas-profile-grid line { stroke: var(--ch-grid, #35453b); stroke-width: 1; vector-effect: non-scaling-stroke; }
.atlas-profile-grid .atlas-profile-zero { stroke: var(--ch-strong-line, #758974); }
.atlas-profile-scale { display: grid; grid-template-rows: minmax(0,1fr); text-align: end; }
.atlas-profile-scale span { grid-area: 1 / 1; align-self: start; position: relative; transform: translateY(-50%); }
.atlas-profile-name { font-weight: 700; font-size: .8rem; }
.atlas-profile-empty {
  position: absolute; left: 50%; transform: translate(-50%,-50%); pointer-events: none;
  background: var(--ch-surface, #0b100d); color: var(--ch-muted, #b6c8b8); padding-inline: .3rem;
}
.atlas-profile-parameter { text-align: end; }
.atlas-profile-ticks { position: relative; height: 1.2em; }
.atlas-profile-ticks span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.atlas-profile-ticks span:first-child:not(:only-child) { transform: none; }
.atlas-profile-ticks span:last-child:not(:only-child) { transform: translateX(-100%); }
.atlas-profile-cursor {
  position: absolute; pointer-events: none; border-left: 1px dashed var(--ch-strong-line, #e5efd099);
}
.atlas-profile-cursor::before {
  content: ''; position: absolute; width: .55rem; height: .55rem; box-sizing: border-box;
  border: 2px solid #f3ffcf; background: #273623; border-radius: 50%;
  box-shadow: 0 0 0 1px #111a14; transform: translate(calc(-50% - .5px),-50%);
}
@container atlas-map (max-width: 340px) {
  .atlas-profile-ticks span:nth-child(even) { display: none; }
}
.atlas-compare-cell:not(.active) .atlas-profile-ticks span:nth-child(even) { display: none; }
.atlas-compare-cell:not(.active) .atlas-profile-chart canvas.atlas-parameter-map { min-height: 5.5rem; }
.atlas-side button.atlas-map-mark, .atlas-side button.atlas-map-thumb {
  position: absolute; padding: 0; border-radius: 3px; color: #101915; background: #f4f8e9;
  border-color: #36443a; font-size: .75rem; line-height: 1; min-width: 1.15rem; min-height: 1.15rem;
}
.atlas-side button.atlas-map-mark { transform: translate(-50%, -50%); }
.atlas-side button.atlas-reference-star { background: #182620bb; color: white; }
.atlas-side button.atlas-map-thumb { width: 18%; aspect-ratio: 1.55; overflow: hidden; }
.atlas-map-thumb-list:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 4.5rem), 1fr));
  gap: .32rem;
  margin-block-start: .4rem;
}
.atlas-map-thumb-list button.atlas-map-thumb {
  position: relative; width: 100%; min-width: 0; min-height: 0;
}
.atlas-map-thumb canvas { display: block; width: 100%; height: 100%; }
:is(.atlas-map-representatives,.atlas-map-thumb-list)[aria-busy="true"] .atlas-map-thumb::after {
  content: '…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.atlas-map-thumb span { position: absolute; inset: 2px auto auto 2px; padding: 1px 3px; background: #ffffffd9; border-radius: 3px; }
.atlas-map-figure .atlas-map-thumb.active {
  outline: 2px solid #fff; z-index: 2; box-shadow: 0 0 0 4px #192319b0;
}
.atlas-side-note, .atlas-map-readout { font-size: .875rem; color: var(--ch-muted, #c5d4b5); overflow-wrap: anywhere; }
.atlas-map-point { padding: .85rem; text-align: left; }
.atlas-map-footer { margin-block-start: auto; }
.atlas-map-layers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .24rem .55rem;
  padding: .3rem .48rem;
  background: var(--ch-soft, #17231a);
  border: 1px solid var(--ch-line, #4b6049);
  border-radius: 5px;
}
.atlas-map-group-label { font-size: .74rem; font-weight: 650; color: var(--ch-text, #e4edcf); }
.atlas-map-footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; }
.atlas-map-footer-actions label { gap: .32rem; cursor: pointer; }
.atlas-map-footer-actions label:has(input:focus-visible) { outline: 2px solid var(--atlas-acid); outline-offset: 2px; }
.atlas-map-footer-actions input { margin: 0; }
.atlas-map-archive-link { margin-inline-start: auto; }
.atlas-map-legend { margin-block-start: .4rem; border-block-start: 1px solid var(--atlas-line); padding-block-start: .28rem; }
.atlas-map-legend .atlas-map-group-label { margin: 0; color: var(--ch-muted, #b2bfaa); }
.atlas-map-key { display: flex; flex-wrap: wrap; gap: .2rem .65rem; margin: .18rem 0 0; font-size: .8rem; }
.atlas-map-key span { display: inline-flex; gap: .25rem; align-items: center; }
.atlas-map-key i { display: inline-block; width: .8rem; height: .8rem; border: 1px solid var(--ch-line, #afb29c); }
.atlas-map-gradient { flex-basis: 100%; height: 8px; background: linear-gradient(to right, #20345d, #477cb0, #4cb5a4, #d7fe38); }
@media (min-width: 1101px), (min-width: 840px) and (max-width: 1000px) {
  .atlas-visual { display: grid; grid-template-columns: minmax(0, 1fr) var(--atlas-side-width); gap: .45rem .65rem; }
  .atlas-view-toolbar {
    display: grid;
    grid-column: 1 / -1;
    /* Let the view controls reserve only their own width at the end of the toolbar. */
    grid-template-columns: minmax(0, 1fr) max-content;
  }
  .atlas-view-toolbar > .atlas-controls { grid-column: 1; min-width: 0; }
  .atlas-view-toolbar > .atlas-side-bar { grid-column: 2 / -1; }
  .atlas-stage { height: auto; min-height: var(--atlas-scene-height); }
  .atlas-stage > #atlas-canvas { position: absolute; inset: 0; }
  .atlas-visual > .atlas-metric-dock { grid-column: 2; }
  .atlas-set-comparison { grid-column: 2 / -1; }
  .atlas-visual.atlas-side-expanded { --atlas-side-width: clamp(355px, 51%, 650px); }
  .atlas-map-row .atlas-map-figure[data-dimension="2"] {
    width: min(100%, clamp(270px, calc(100svh - 370px), 530px));
  }
}
@media (max-width: 839px), (min-width: 1001px) and (max-width: 1100px) {
  .atlas-visual { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .atlas-view-toolbar { display: contents; }
  .atlas-view-toolbar > .atlas-controls { grid-row: 1; }
  .atlas-visual .atlas-stage { grid-row: 2; }
  .atlas-view-toolbar > .atlas-side-bar { grid-row: 3; }
  .atlas-visual .atlas-side { grid-row: 4; }
  .atlas-visual > .atlas-metric-dock { grid-row: 5; }
  .atlas-set-comparison { grid-row: 6; }
  #atlas-side-size { display: none; }
}
.atlas-map-plot canvas:focus-visible {
  outline: 2px solid var(--atlas-acid); outline-offset: -2px;
}
.atlas-map-mark:focus-visible, .atlas-map-thumb:focus-visible { outline: 2px solid #fff; }
.atlas-side :is(button,select), .atlas-side-bar :is(button,select) { padding: .18rem .46rem; min-height: 2rem; }
.chaos-public .atlas-controls { gap: .29rem; padding: 0; }
.chaos-public .atlas-controls button, .chaos-public .atlas-controls summary {
  min-height: 2rem; padding: .22rem .55rem; font-size: .86rem;
}
.atlas-view-toolbar .atlas-tool-icon { display: var(--tool-icon, none); }
.atlas-view-toolbar .atlas-tool-label {
  position: var(--label-position, static); clip-path: var(--label-clip, none);
  white-space: nowrap; inline-size: var(--label-size, auto); block-size: var(--label-size, auto); overflow: var(--label-overflow, visible);
}
.atlas-view-toolbar :is(.atlas-tool-primary, .atlas-tool-secondary) {
  display: var(--tool-display, revert); place-items: center; vertical-align: middle;
}
.atlas-view-toolbar .atlas-code-jump { display: var(--tool-display, inline-flex); }
.atlas-view-toolbar #atlas-play[aria-pressed="true"] svg:nth-of-type(2),
.atlas-view-toolbar #atlas-play[aria-pressed="false"] svg:first-of-type { display: none; }
/* Preserve full labels until the rendered controls in the current language need more room. */
.atlas-view-toolbar:is([data-density="actions"], [data-density="icons"]) .atlas-controls .atlas-tool-secondary,
.atlas-view-toolbar[data-density="icons"] .atlas-controls .atlas-tool-primary {
  --tool-display: inline-grid; --tool-icon: block; --label-position: absolute; --label-clip: inset(50%);
  --label-size: 1px; --label-overflow: hidden;
  min-inline-size: 2rem; padding-inline: .35rem;
}
@container atlas-view (max-width: 23rem) {
  .atlas-view-toolbar .atlas-controls { gap: .1rem; }
  .atlas-view-toolbar[data-density="icons"] .atlas-controls :is(.atlas-tool-primary, .atlas-tool-secondary) { min-inline-size: 1.5rem; padding-inline: .1rem; }
  .atlas-view-toolbar #atlas-distortion-switch { gap: .2rem; padding-inline: .2rem; font-size: .8rem; }
  .atlas-view-toolbar .atlas-switch-track { inline-size: 22px; height: 14px; }
  .atlas-view-toolbar .atlas-switch-track::after { width: 8px; height: 8px; }
  .atlas-view-toolbar #atlas-distortion-switch[aria-checked="true"] .atlas-switch-track::after { transform: translateX(8px); }
}
.chaos-public .atlas-model-heading { padding-bottom: .4rem; }
.atlas-map-header { display: flex; align-items: center; justify-content: space-between; gap: .3rem .75rem; }
.atlas-map-header .atlas-map-readout {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .16rem;
  color: var(--ch-text, #e4edcf);
  line-height: 1.24;
}
.atlas-map-readout .atlas-map-position, .atlas-map-readout .atlas-map-node-metric {
  margin: 0;
  overflow-wrap: anywhere;
}
.atlas-map-position { color: var(--ch-muted, #c5d4b5); font-variant-numeric: tabular-nums; }
.atlas-map-node-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .08rem .48rem;
}
.atlas-map-metric-label { color: var(--ch-text, #d5dfc7); }
.atlas-map-metric-value { color: var(--ch-accent, #eeffad); font-variant-numeric: tabular-nums; }
.atlas-lyapunov-values {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .08rem .62rem;
  font-variant-numeric: tabular-nums;
}
.atlas-map-node-metric .atlas-lyapunov-values { color: var(--ch-accent, #eeffad); }
.atlas-lyapunov-term { white-space: nowrap; }
.atlas-lyapunov-term[data-active="true"] { font-weight: 650; }
.atlas-lyapunov-term[data-active="false"] { color: var(--ch-muted, #aeb7aa); }
.atlas-map-preview-status {
  position: absolute;
  z-index: 3;
  inset: auto auto 3.4rem .8rem;
  margin: 0;
  max-width: calc(100% - 1.6rem);
  padding: .25rem .5rem;
  color: var(--ch-text, #e6f2cc);
  background: var(--ch-overlay, #152319ed);
  border: 1px solid var(--ch-line, #465846);
  font-size: .82rem;
  pointer-events: none;
}
.atlas-signal-surface { position: relative; height: clamp(230px, 53svh, 500px); }
.atlas-signal-surface.compact { height: clamp(200px, 42svh, 400px); }
.atlas-signal-surface:empty, .atlas-signal-surface:has(canvas[hidden]) { display: none; }
.atlas-map-row { padding-bottom: .25rem; }


.atlas-set-comparison {
  min-width: 0;
  padding: .45rem .65rem;
  border: 1px solid var(--atlas-line);
  border-radius: 5px;
  background: var(--ch-surface, #0b100d);
  color: var(--ch-text, #e2e7d5);
  font-size: .875rem;
}
.atlas-set-comparison table { width: 100%; border-collapse: collapse; }
.atlas-set-comparison caption { text-align: start; padding: .2rem .3rem .4rem; color: var(--ch-text, #d0d9c4); }
.atlas-set-comparison :is(th,td) {
  padding: .3rem .4rem;
  border-top: 1px solid var(--atlas-line);
  text-align: start;
  overflow-wrap: anywhere;
}
.atlas-set-comparison .active { background: var(--ch-active, #172119); }
.atlas-set-comparison i {
  display: inline-block;
  width: .7rem;
  height: .7rem;
  margin-inline-end: .35rem;
  border: 1px solid var(--ch-line, #9ca293);
}
.atlas-set-comparison i[hidden] { display: none; }

/* The shortcuts sit in their own column outside the map frame. */
.atlas-metric-dock {
  display: grid;
  gap: .45rem;
  align-content: start;
  align-self: start;
  width: min(100%, 7rem);
}
@media (min-width: 1101px), (min-width: 840px) and (max-width: 1000px) {
  .atlas-visual:has(> .atlas-metric-dock:not([hidden])) {
    --atlas-dock-width: clamp(5rem, 8.5%, 7rem);
    grid-template-columns: minmax(0, 1fr) minmax(245px, calc(var(--atlas-side-width) - var(--atlas-dock-width) * .56)) var(--atlas-dock-width);
  }
  .atlas-visual > .atlas-metric-dock { grid-column: 3; grid-row: 2; }
}
@media (min-width: 530px) and (max-width: 839px), (min-width: 1001px) and (max-width: 1100px) {
  .atlas-visual:has(> .atlas-metric-dock:not([hidden])) { grid-template-columns: minmax(0, 1fr) 5.6rem; }
  .atlas-view-toolbar > .atlas-controls, .atlas-view-toolbar > .atlas-side-bar,
  .atlas-visual > .atlas-stage, .atlas-visual > .atlas-set-comparison { grid-column: 1 / -1; }
  .atlas-visual > .atlas-side { grid-column: 1; }
  .atlas-visual > .atlas-metric-dock { grid-row: 4; grid-column: 2; }
}
.atlas-metric-current { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.atlas-metric-current .atlas-metric-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  min-height: 2.35em;
  margin: 0;
  font-size: .78rem;
  line-height: 1.17;
  color: var(--ch-text, #e4edcf);
}
.atlas-metric-dock .atlas-metric-help { padding: 0; flex: 0 0 1.6rem; min-height: 1.6rem; }
.atlas-metric-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .24rem; }
.atlas-metric-dock .atlas-metric-tile {
  appearance: none;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  padding: .15rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .12rem;
  background: var(--ch-surface, #111a16);
  line-height: 1;
  font-size: clamp(.46rem, .7vw, .62rem);
  white-space: nowrap;
}
.atlas-metric-dock .atlas-metric-tile[aria-pressed="true"] {
  color: var(--ch-accent, #e6ff7a);
  background: var(--ch-active, #29391b);
  box-shadow: inset 0 0 0 1px var(--atlas-acid);
}
.atlas-metric-tile:focus-visible { outline: 2px solid var(--atlas-acid); outline-offset: 2px; }
.atlas-metric-tile svg {
  width: min(68%, 1.18rem);
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.atlas-channel-group { display: grid; gap: .22rem; }
.atlas-channel-label { color: var(--ch-muted, #c5d4b5); font-size: .7rem; line-height: 1; }
.atlas-channel-keys { display: grid; gap: .19rem; }
.atlas-metric-dock .atlas-channel-key {
  padding: .05rem .08rem;
  min-width: 0;
  min-height: 1.65rem;
  aspect-ratio: 1;
  background: var(--ch-surface, #111a16);
  font-size: .83rem;
  font-weight: 650;
  font-style: italic;
  line-height: 1;
}
.atlas-metric-dock .atlas-channel-key[data-long] { font-size: .56rem; }
.atlas-metric-dock .atlas-channel-key[aria-pressed="true"] {
  color: var(--ch-accent, #e6ff7a);
  background: var(--ch-active, #29391b);
  box-shadow: inset 0 0 0 1px var(--atlas-acid);
}
.atlas-metric-dock .atlas-metric-other, .atlas-metric-other select { display: block; width: 100%; }
.atlas-metric-other select { padding-inline: .3rem; font-size: .75rem; text-overflow: ellipsis; }
.atlas-set-controls {
  display: grid;
  gap: .3rem;
  min-width: 0;
  border-top: 1px solid var(--atlas-line);
  padding-top: .4rem;
  font-size: .75rem;
  line-height: 1.2;
}
.atlas-set-controls label { display: grid; gap: .2rem; }
.atlas-set-controls label > span { color: var(--ch-muted, #c5d4b5); overflow-wrap: anywhere; }
.atlas-set-controls :is(button,select) { width: 100%; min-height: 2rem; padding: .25rem .35rem; }
.atlas-set-controls button { overflow-wrap: anywhere; }
.atlas-lyapunov-choices { display: flex; gap: .25rem; }
.atlas-lyapunov-choices button {
  flex: 1;
  min-width: 0;
  padding: .15rem .2rem;
  font-variant-numeric: tabular-nums;
}
.atlas-lyapunov-choices button[aria-pressed="true"] { background: var(--ch-active, #29391b); }
.atlas-map-row.hide-hopf .atlas-map-hopf { display: none; }
/* The thumbnails keep their grid tracks while the active map occupies the viewport. */
.atlas-map-row.is-comparing { display: flex; flex: 1; min-height: 0; }
.atlas-compare-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .28rem;
  min-width: 0;
  min-block-size: clamp(15rem, 50svh, 25rem);
}
.atlas-compare-nav { display: flex; flex-wrap: wrap; gap: .22rem; }
.atlas-compare-nav button { min-height: 1.65rem; font-size: .72rem; line-height: 1; padding: .15rem .34rem; }
.atlas-compare-nav button[aria-pressed="true"] { background: var(--ch-active, #283519); }
.atlas-compare-maps {
  position: relative;
  isolation: isolate;
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: .22rem;
}
.atlas-compare-cell { min-width: 0; aspect-ratio: 1.06; }
.atlas-compare-cell .atlas-map-figure[data-dimension="2"], .atlas-compare-cell .atlas-map-figure {
  width: 100%;
  padding: .25rem;
  border: 1px solid var(--ch-line, #344031);
  border-radius: 4px;
  background: var(--ch-surface, #111714);
}
.atlas-compare-cell.active .atlas-map-figure {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-color: var(--ch-accent, #a4bd55);
  background: var(--ch-surface, #101813);
  container: atlas-zoom / size;
}
.atlas-compare-cell.active .atlas-map-figure > :is(.atlas-map-y,.atlas-map-axis-x) {
  width: min(100cqi, calc(100cqb - 2.15rem));
}
.atlas-compare-cell:not(.active) .atlas-map-thumb-list:not([hidden]) {
  grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin-block-start: 2px;
}
.atlas-compare-cell.active .atlas-map-figure[data-dimension="1"] > :is(.atlas-map-plot,.atlas-map-axis-x,.atlas-map-thumb-list) { width: 100%; }
.atlas-compare-cell figcaption { margin-block-end: .16rem; font-size: .72rem; }
.atlas-compare-cell :is(.atlas-map-axis-x,.atlas-map-axis-y) { font-size: clamp(.52rem, 1vw, .72rem); }
.atlas-compare-cell .atlas-map-axis-x span { overflow: hidden; text-overflow: ellipsis; }
.atlas-side .atlas-compare-cell .atlas-map-mark {
  min-width: .75rem;
  min-height: .75rem;
  font-size: .55rem;
}
.atlas-compare-cell .atlas-map-thumb span {
  inset: 0 auto auto 0;
  max-width: 60%;
  padding: 0 1px;
  font-size: .52rem;
}
.atlas-side .atlas-compare-cell.active .atlas-map-mark { min-width: 1.08rem; min-height: 1.08rem; font-size: .7rem; }
.atlas-compare-cell.active .atlas-map-thumb span { font-size: .7rem; padding-inline: 3px; }
.atlas-side .atlas-compare-cell button.atlas-reference { min-height: 0; font-size: .62rem; }
.atlas-side .atlas-compare-cell.active button.atlas-reference { position: absolute; inset: .2rem .2rem auto auto; }
.atlas-map-cursor {
  position: absolute;
  z-index: 3;
  width: .8rem;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #314128;
  pointer-events: none;
}
.atlas-map-cursor:is([data-pinned], [data-representative]) { width: 1.85rem; border-width: 2px; }
.atlas-map-plot.is-dragging .atlas-map-cursor { width: 2.5rem; border-width: 2px; }
.atlas-compare-cell:not(.active) .atlas-map-cursor:is([data-pinned], [data-representative]) { width: 1.35rem; }
.atlas-map-cursor[data-representative] { border-color: #efff74; }
.atlas-map-plot .atlas-map-mark.active { z-index: 2; background: #efff74; color: #11190e; }

@container atlas-map (max-width: 310px) {
  .atlas-compare-cell:not(.active) .atlas-map-axis-y span { display: none; }
  .atlas-compare-cell:not(.active) .atlas-map-axis-y { justify-content: center; }
  .atlas-compare-cell figcaption { font-size: .65rem; }
}

.atlas-metric-guide, .atlas-metric-reader {
  box-sizing: border-box; width: min(34rem, calc(100vw - 20px)); max-width: none;
  max-height: calc(100dvh - 20px); overflow: auto; overscroll-behavior: contain;
  padding: clamp(.7rem, 1.5vw, 1.15rem); margin: 0;
  background: var(--ch-surface, #182022); color: var(--ch-text, #f5f0de); border: 1px solid var(--ch-line, #788580); border-radius: .45rem;
  box-shadow: 0 .65rem 2.8rem var(--ch-shadow, #0009); font: 1rem/1.45 system-ui, sans-serif; text-align: start;
}
.atlas-metric-guide { position: fixed; z-index: 120; }
.atlas-metric-guide[hidden], .atlas-metric-reader:not([open]), .atlas-guide-figure [hidden] { display: none; }
.atlas-metric-reader[open] { width: min(46rem, calc(100vw - 16px)); margin: auto; }
.atlas-metric-reader::backdrop { background: #0a1012bb; }
.atlas-guide-header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; margin: 0 0 .65rem; }
.atlas-guide-header h3 { margin: 0; color: var(--ch-text, #f6eedc); font: 570 clamp(1.35rem, 2.5vw, 1.75rem)/1.14 Georgia, serif; overflow-wrap: anywhere; }
.atlas-guide-close { flex: none; width: 2.4rem; height: 2.4rem; font: 1.65rem/1 system-ui; border: 1px solid var(--ch-line, #75827d); color: var(--ch-text, #f3eddd); background: var(--ch-soft, #243031); border-radius: .25rem; cursor: pointer; }
.atlas-guide-figure { margin: 0; }
.atlas-guide-sheet { max-width: 100%; overflow-x: auto; }
.atlas-guide-zoom { display: none; }
.atlas-guide-figure img { display: block; width: 100%; height: auto; aspect-ratio: 400 / 255; max-height: min(51dvh, 24rem); object-fit: contain; border-radius: .16rem; background: #f5eedf; }
.atlas-guide-figure[data-theme="scope"] img { background: var(--ch-scope-paper, #19242b); outline: 1px solid var(--ch-line, #404d51); outline-offset: -1px; }
.atlas-guide-caption { display: block; padding: .65rem 0 0; font: inherit; color: var(--ch-text, #f1ecdb); }
.atlas-guide-caption small, .atlas-guide-point span, .atlas-guide-related span, .atlas-guide-steps > span { display: block; margin-bottom: .15rem; color: var(--ch-muted, #c3ccc4); font: 550 .82rem/1.35 system-ui, sans-serif; }
.atlas-guide-method, .atlas-guide-point, .atlas-guide-related { margin: .75rem 0 0; }
.atlas-guide-method { padding-top: .7rem; border-top: 1px solid var(--ch-line, #445352); }
.atlas-guide-point { margin: 0 0 .65rem; padding-inline-start: .65rem; border-inline-start: 2px solid var(--ch-warm, #e9be7a); }
.atlas-guide-spectrum { list-style: none; margin: .3rem 0; padding: 0; font-variant-numeric: tabular-nums; }
.atlas-guide-spectrum li { display: grid; grid-template-columns: minmax(0, 16ch) minmax(3rem, 8rem); align-items: center; gap: .8rem; color: var(--ch-muted, #c1cac4); }
.atlas-guide-spectrum li[aria-current="true"] { color: var(--ch-warm, #ffda9e); font-weight: 650; }
.atlas-guide-scale { position: relative; height: .9rem; }
.atlas-guide-scale::before { content: ""; position: absolute; left: 50%; height: 100%; border-left: 1px solid var(--ch-line, #889a92); }
.atlas-guide-scale i { position: absolute; top: 32%; height: 36%; min-width: 2px; background: currentColor; }
.atlas-guide-point strong { font-variant-numeric: tabular-nums; }
.atlas-guide-steps, .atlas-guide-related { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.atlas-guide-steps { margin-top: .6rem; }
.atlas-guide-steps > span, .atlas-guide-related > span { margin: 0 .25rem 0 0; }
.atlas-guide-step, .atlas-guide-zoom, .atlas-guide-link { font: inherit; font-size: .94rem; cursor: pointer; padding: .3rem .55rem; min-height: 2.45rem; color: var(--ch-text, #ecebdd); border: 1px solid var(--ch-line, #73817c); border-radius: .25rem; background: var(--ch-soft, #202b2d); }
.atlas-guide-step[aria-pressed="true"] { border-color: var(--ch-warm, #f2bd74); background: var(--ch-soft, #3b3328); color: var(--ch-warm, #ffdb9e); box-shadow: inset 0 -2px var(--ch-warm, #edb369); }
.atlas-guide-link { margin-block: .25rem; text-decoration: underline; text-underline-offset: .2em; }
.atlas-guide-source { display: inline-block; margin:.4rem 0; color:var(--ch-cool, #b3dbe4); text-decoration: underline; }
.atlas-guide-zoom:focus-visible, .atlas-guide-sheet:focus-visible, .atlas-guide-header button:focus-visible, .atlas-guide-steps button:focus-visible, .atlas-guide-link:focus-visible, .atlas-guide-source:focus-visible { outline: 2px solid var(--ch-focus, #f3ce91); outline-offset: 2px; }
@media (max-width: 650px) {
  .atlas-metric-reader[open] { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .atlas-metric-reader .atlas-guide-header { position: sticky; z-index: 1; top: -.7rem; padding-block: .25rem; background: var(--ch-surface, #182022); }
  .atlas-guide-step, .atlas-guide-link, .atlas-guide-close { min-height: 44px; min-width: 44px; }
}
.atlas-metric-reader .atlas-guide-figure img { max-height: 30rem; }
@media (max-width: 46rem), (pointer: coarse) {
  .atlas-guide-zoom { display: inline-block; min-height: 44px; margin-top: .45rem; }
  .atlas-metric-reader .atlas-guide-figure img { max-height: none; }
  .atlas-guide-sheet[data-zoom="true"] img { width: max(100%, 32rem); max-width: none; }
}
/* The point inspector occupies the same disclosure row as the other research tools. */
.atlas-map-resources { font-size: inherit; }
.atlas-point-panel { scroll-margin-block-start: 1rem; }
.atlas-point-panel[open] { padding-bottom: 1rem; }
.atlas-point-context { margin: 0 0 .45rem; font-weight: 650; overflow-wrap: anywhere; }
.atlas-point-note { margin: .4rem 0 .7rem; color: var(--ch-muted, #b8c6b6); font-size: .85rem; line-height: 1.45; }
.atlas-point-toolbar, .atlas-point-sources, .atlas-point-toolbar label {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem;
}
.atlas-point-toolbar { gap: .5rem 1rem; font-size: .85rem; }
.atlas-point-panel [hidden] { display: none !important; }
.atlas-point-sources button[aria-pressed="true"] { border-color: var(--atlas-acid); color: var(--atlas-acid); }
.atlas-point-vitals, .atlas-point-groups, .atlas-point-list {
  display: grid; gap: .4rem .8rem; margin: .55rem 0;
}
.atlas-point-vitals { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.atlas-point-vitals > div { min-width: 0; border-inline-start: 2px solid var(--ch-line, #536c54); padding-inline-start: .65rem; }
.atlas-point-vitals dd, .atlas-point-list dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.atlas-point-groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.atlas-point-groups > details { min-width: 0; border: 1px solid var(--atlas-line); border-radius: .3rem; background: var(--ch-surface, #101712); }
.atlas-point-groups summary { padding: .45rem .65rem; font-size: .9rem; }
.atlas-point-groups .atlas-point-note { margin: 0 .65rem .5rem; }
.atlas-point-list { padding: 0 .65rem .35rem; font-size: .85rem; }
.atlas-point-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: .65rem; border-top: 1px solid var(--atlas-line); padding-block-start: .22rem; }
.atlas-point-list dt, .atlas-point-list dd { min-width: 0; overflow-wrap: anywhere; }
.atlas-point-list dd { text-align: end; }
.atlas-point-panel button.atlas-point-help {
  padding: 0; color: var(--ch-text, #cdddbe); background: none; border: 0; font: inherit; text-align: start;
  text-decoration: underline dotted; text-underline-offset: .18em;
}
.atlas-point-panel button.atlas-point-help:is(:hover,:focus-visible) { color: var(--atlas-acid); }
.atlas-point-panel canvas { display: block; width: min(100%, 740px); aspect-ratio: 2.4; background: var(--ch-surface, #090e0b); }
/* SVG curves and labels respond immediately, including when a node is pinned. */
.atlas-profile-name.atlas-profile-active { color: var(--ch-accent, #d7fe38); }
.atlas-profile-name.atlas-profile-inactive { color: var(--ch-secondary-profile, #a7bab0); }
polyline.atlas-profile-active { stroke: var(--ch-accent, #d7fe38); }
polyline.atlas-profile-inactive { stroke: var(--ch-secondary-profile, #a7bab0); }

.atlas-map-loading canvas {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--ch-line) 6px 7px);
}
.atlas-map-loading[data-dimension="1"] canvas { height: 6.25rem; }
.atlas-map-loading figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.atlas-map-loading progress { width: 7rem; max-width: 100%; }
