/* Gravitational Architect — the instrument.
   Full-bleed canvas, hairline panels, monospace readouts, cyan lattice, amber sun. */

body.app {
  --top-h: 58px;
  --bar-h: 112px;
  --rail-w: 220px;
  --panel-w: 352px;
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
}

body.app main {
  padding: 0;
}

/* ------------------------------------------------------------------ stage -- */

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  z-index: 0;
}

#stage:active {
  cursor: grabbing;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, transparent 30%, rgba(5, 8, 11, 0.5) 100%),
    linear-gradient(to bottom, rgba(5, 8, 11, 0.55), transparent 18%);
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  background: var(--void);
}

.fallback h2 {
  margin: 0;
}

.fallback p {
  margin: 0 auto;
}

/* --------------------------------------------------------------- top strip -- */

.hud-top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 6;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-inline: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(5, 8, 11, 0.94), rgba(5, 8, 11, 0.66));
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: var(--glow);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -4px -8px;
  border: 1px solid rgba(94, 204, 225, 0.55);
  border-radius: 50%;
  transform: rotate(-22deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-text span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hud-top .site-nav {
  gap: var(--space-3);
  margin-left: var(--space-2);
}

.hud-top .site-nav a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.readouts {
  display: flex;
  gap: var(--space-3);
  margin: 0 0 0 auto;
  padding: 0;
  flex: 0 0 auto;
}

.readouts > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 4.6rem;
}

.readouts dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.readouts dd {
  margin: 0;
  font-size: 0.76rem;
  color: var(--accent);
}

.hud-top-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.hud-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(94, 204, 225, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.hud-btn:hover,
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(94, 204, 225, 0.12);
}

.hud-btn[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.icon-btn {
  padding: 0 8px;
  min-height: 28px;
}

/* ------------------------------------------------------------------ rails -- */

.rail {
  position: fixed;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: rgba(15, 20, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(94, 204, 225, 0.05), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.rail-left {
  top: calc(var(--top-h) + 12px);
  left: var(--space-3);
  bottom: calc(var(--bar-h) + 12px);
  width: var(--rail-w);
}

.rail-right {
  top: calc(var(--top-h) + 12px);
  right: var(--space-3);
  bottom: calc(var(--bar-h) + 12px);
  width: var(--panel-w);
}

body:not(.panel-open) .rail-right {
  display: none;
}

body.hud-hidden .rail,
body.hud-hidden .control-bar,
body.hud-hidden .hint {
  display: none;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to right, rgba(94, 204, 225, 0.09), transparent);
}

.rail-head h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.rail-count {
  font-size: 0.62rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------- body index -- */

.body-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.body-list button {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 7px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.body-list button:hover {
  background: rgba(94, 204, 225, 0.08);
  color: var(--ink);
}

.body-list button[aria-current="true"] {
  border-left-color: var(--accent);
  background: rgba(94, 204, 225, 0.12);
  color: var(--ink);
}

.body-list .swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.body-list .au {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-soft);
}

.body-list button[aria-current="true"] .au {
  color: var(--accent);
}

.rail-head-log {
  border-top: 1px solid var(--line);
}

.event-log {
  list-style: none;
  margin: 0;
  padding: 5px 10px 8px;
  max-height: 118px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.event-log li {
  padding: 2px 0;
  border-bottom: 1px dotted var(--line-soft);
}

.event-log li:first-child {
  color: var(--ink);
}

.event-log li[data-kind="impact"] {
  color: var(--danger);
}

.event-log li[data-kind="mode"] {
  color: var(--accent-2);
}

/* ------------------------------------------------------------------- tabs -- */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.tabs [role="tab"] {
  flex: 1;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.tabs [role="tab"]:hover {
  color: var(--ink);
  background: rgba(94, 204, 225, 0.06);
}

.tabs [role="tab"][aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(94, 204, 225, 0.08);
}

.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.panel-scroll [role="tabpanel"]:focus-visible {
  outline-offset: -2px;
}

/* ------------------------------------------------------------ control bar -- */

.control-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 6;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-3);
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(5, 8, 11, 0.96), rgba(5, 8, 11, 0.7));
  backdrop-filter: blur(8px);
}

.transport {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.cbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(94, 204, 225, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 1rem;
  cursor: pointer;
}

.cbtn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(94, 204, 225, 0.14);
}

.cbtn-primary {
  color: var(--accent);
  border-color: rgba(94, 204, 225, 0.5);
  box-shadow: inset 0 0 14px rgba(94, 204, 225, 0.12);
}

.speed {
  flex: 0 1 260px;
  min-width: 160px;
}

.speed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.speed-head label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.speed-head output {
  font-size: 0.72rem;
  color: var(--accent);
}

.speed-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.75;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.toggles {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  overflow-x: auto;
  padding-block: 4px;
  scrollbar-width: thin;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  background: rgba(15, 20, 26, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(94, 204, 225, 0.6);
  background: rgba(94, 204, 225, 0.12);
  box-shadow: inset 0 0 12px rgba(94, 204, 225, 0.1);
}

.chip-quiet {
  color: var(--accent-2);
  border-color: rgba(232, 174, 98, 0.35);
}

.chip-quiet:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.hint {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(var(--bar-h) + 8px);
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(5, 8, 11, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  pointer-events: none;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- loading -- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  background: var(--void);
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loading p {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.loading-bar {
  width: 220px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: sweep 1.1s ease-in-out infinite;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.loading.done {
  opacity: 0;
  visibility: hidden;
}
/* Gravitational Architect — panel contents, the guide, and the phone layout. */

/* ------------------------------------------------------------ facts panel -- */

.fact-hero {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.fact-disc {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: block;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line), 0 0 26px rgba(94, 204, 225, 0.14);
}

.fact-id {
  display: grid;
  gap: 6px;
}

.fact-type {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.fact-symbol {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent-2);
}

.fact-blurb {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.section-title {
  margin: 16px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.vitals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.vitals > div {
  background: var(--surface-2);
  padding: 6px 8px;
}

.vitals dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.vitals dd {
  margin: 2px 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
}

.vitals dd .mono {
  font-size: 0.72rem;
}

/* cross-section diagram */

.xsec {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  align-items: center;
}

.xsec svg {
  width: 116px;
  height: 116px;
  display: block;
}

.xsec circle {
  transform-origin: 60px 60px;
  animation: ring-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes ring-in {
  from { transform: scale(0.2); opacity: 0; }
}

.layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.layer-list li {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.layer-list .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.layer-list .frac {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-soft);
}

/* atmosphere bars */

.bars {
  display: grid;
  gap: 5px;
}

.bar {
  display: grid;
  grid-template-columns: 5.4rem 1fr 2.4rem;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.bar-track {
  height: 6px;
  background: var(--line-soft);
  border: 1px solid var(--line);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(to right, rgba(94, 204, 225, 0.5), var(--accent));
  box-shadow: 0 0 8px rgba(94, 204, 225, 0.45);
  transform-origin: left;
  animation: grow-x 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes grow-x {
  from { transform: scaleX(0); }
}

.bar .pct {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-align: right;
  color: var(--ink);
}

/* extremes */

.extremes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.extremes li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.extremes .mark {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent-2);
  padding-top: 2px;
}

/* live orbital readout */

.live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.live > div {
  background: var(--surface-2);
  padding: 6px 8px;
}

.live dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.live dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

/* ------------------------------------------------------------ draft panel -- */

.draft-note {
  margin: 0 0 12px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.draft-note strong {
  color: var(--ink);
}

.slider-row {
  margin-bottom: 9px;
}

.slider-row .row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.slider-row label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.slider-row output {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

.slider-row .hintline {
  margin: 0;
  font-size: 0.62rem;
  color: var(--ink-soft);
  opacity: 0.8;
}

.panel-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  background: rgba(94, 204, 225, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(94, 204, 225, 0.16);
}

.btn-warm {
  color: var(--accent-2);
  border-color: rgba(232, 174, 98, 0.35);
}

.btn-warm:hover {
  border-color: var(--accent-2);
  background: rgba(232, 174, 98, 0.12);
}

/* ----------------------------------------------------------- forces panel -- */

.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.trio label {
  display: grid;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.trio select {
  width: 100%;
  padding: 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.force-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.force-list li {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 8px 9px;
}

.force-pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.force-pair .who {
  color: var(--ink);
}

.force-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  white-space: nowrap;
}

.force-track {
  height: 3px;
  margin-top: 7px;
  background: var(--line-soft);
}

.force-fill {
  height: 100%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(232, 174, 98, 0.6);
  transform-origin: left;
  animation: grow-x 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.force-meta {
  margin: 5px 0 0;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ink-soft);
}

.perturb {
  border: 1px solid rgba(232, 174, 98, 0.35);
  background: rgba(232, 174, 98, 0.07);
  padding: 10px;
  margin-bottom: 12px;
}

.perturb .big {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--accent-2);
}

.perturb p {
  margin: 4px 0 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.empty {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- guide -- */

.guide {
  width: min(46rem, calc(100vw - 1.5rem));
  max-height: 88dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(94, 204, 225, 0.08), 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  translate: 0 10px;
  transition: opacity 0.22s ease, translate 0.22s ease, overlay 0.22s allow-discrete,
    display 0.22s allow-discrete;
}

.guide[open] {
  opacity: 1;
  translate: 0 0;
}

@starting-style {
  .guide[open] {
    opacity: 0;
    translate: 0 10px;
  }
}

.guide::backdrop {
  background: rgba(5, 8, 11, 0.74);
  backdrop-filter: blur(3px);
}

.guide-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.guide-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.guide-body {
  padding: 4px 16px 20px;
  overflow-y: auto;
  max-height: calc(88dvh - 58px);
}

.guide-body h3 {
  margin: 20px 0 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-body p,
.guide-body li {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.guide-body strong {
  color: var(--ink);
}

.guide-body ul {
  padding-left: 1.1rem;
  margin: 0 0 var(--space-3);
}

.guide-body li {
  margin-bottom: 4px;
}

.keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 4px 16px;
  list-style: none;
  padding: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--ink);
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1240px) {
  body.app {
    --rail-w: 196px;
    --panel-w: 320px;
  }

  .readouts > div:nth-child(n + 4) {
    display: none;
  }
}

@media (max-width: 900px) {
  body.app {
    --top-h: 52px;
    --bar-h: 126px;
  }

  .hud-top {
    gap: var(--space-2);
  }

  .brand-text span {
    display: none;
  }

  .hud-top .site-nav {
    margin-left: 0;
  }

  .readouts {
    gap: var(--space-2);
  }

  .readouts > div {
    min-width: 3.4rem;
  }

  .readouts > div:nth-child(n + 3) {
    display: none;
  }

  .hud-btn-label {
    display: none;
  }

  .rail-left {
    top: calc(var(--top-h) + 8px);
    left: 8px;
    right: 8px;
    bottom: auto;
    width: auto;
  }

  .body-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    scrollbar-width: thin;
  }

  .body-list li {
    flex: 0 0 auto;
  }

  .body-list button {
    grid-template-columns: 10px auto;
    padding: 4px 8px;
    white-space: nowrap;
    font-size: 0.74rem;
  }

  .body-list .au {
    display: none;
  }

  .rail-head-log,
  .event-log {
    display: none;
  }

  .rail-right {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(var(--bar-h) + 8px);
    width: auto;
    max-height: 60dvh;
  }

  .control-bar {
    flex-wrap: wrap;
    align-content: center;
    gap: 6px 10px;
    padding: 8px 10px;
  }

  .speed {
    flex: 1 1 130px;
  }

  .toggles {
    flex-basis: 100%;
    padding-block: 0;
  }

  .hint {
    display: none;
  }

  .fact-hero {
    grid-template-columns: 84px 1fr;
  }

  .fact-disc {
    width: 84px;
    height: 84px;
  }

  .xsec {
    grid-template-columns: 96px 1fr;
  }

  .xsec svg {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 560px) {
  .vitals,
  .live {
    grid-template-columns: 1fr;
  }

  .trio {
    grid-template-columns: 1fr;
  }
}
/* ------------------------------------------------------- facts hero name -- */

.fact-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

/* ------------------------------------------------------------ hide the hud -- */

.hud-top,
.rail,
.control-bar,
.hint {
  transition: opacity 0.25s ease;
}

body.hud-hidden .hud-top,
body.hud-hidden .rail,
body.hud-hidden .control-bar,
body.hud-hidden .hint {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hud-top,
  .rail,
  .control-bar,
  .hint {
    transition: none;
  }
}
/* --------------------------------------------------- control bar overflow -- */

.control-bar {
  flex-wrap: wrap;
}

.toggles {
  flex: 1 1 26rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.toggles::-webkit-scrollbar {
  display: none;
}

/* the moons row spans the whole vitals grid */
.vitals .wide {
  grid-column: 1 / -1;
}
/* ------------------------------------------- control bar: room for the chips -- */

@media (min-width: 901px) {
  body.app {
    --bar-h: 132px;
  }

  .toggles {
    flex: 1 1 100%;
  }
}
/* ------------------------------------------- phone: the menu drops below the bar -- */

@media (max-width: 720px) {
  .hud-top .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px var(--space-3) 10px;
    background: rgba(11, 16, 21, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }

  .hud-top .site-nav a {
    min-height: 40px;
    border-bottom: 1px solid var(--line-soft);
  }

  .hud-top .site-nav a:last-child {
    border-bottom: 0;
  }
}
