:root {
  color-scheme: dark;
  --bg: #030610;
  --line: #26303d;
  --muted: #a0adbb;
  --gold: #f7cd81;
  --ice: #99dadb;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 62% -38%, #11172b 0, transparent 56%), var(--bg);
  color: #eef1f4;
  font: 15px/1.5 var(--sans);
  min-height: 100svh;
}
button,
a,
input {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  color: inherit;
  background: none;
  border: 0;
}
button:disabled {
  opacity: 0.32;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button:not(:disabled):hover,
a:hover {
  color: #ffdb9b;
}
.skip {
  position: fixed;
  top: -8rem;
  z-index: 10;
  background: #181e26;
  padding: 0.8rem;
}
.skip:focus {
  top: 0.4rem;
}
.mast,
main,
footer {
  max-width: 1770px;
  margin: auto;
  padding-inline: clamp(17px, 3.5vw, 72px);
}
.mast {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 46px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 15px var(--mono);
  letter-spacing: 0.11em;
}
.brand > b {
  font-size: 16px;
}
.brand > span:last-child {
  color: #bac2ce;
  font-weight: 400;
}
.logo-orbit {
  width: 35px;
  height: 35px;
  display: grid;
  place-content: center;
  position: relative;
  border: 1px solid #aa915f;
  border-radius: 50%;
  font:
    italic 27px Georgia,
    serif;
  color: var(--gold);
  margin-right: 5px;
}
.logo-orbit:before {
  content: "";
  position: absolute;
  inset: 9px -5px;
  transform: rotate(-38deg);
  border: 1px solid #e0b977;
  border-radius: 50%;
}
.mast nav {
  display: flex;
  align-self: stretch;
  gap: 26px;
  align-items: stretch;
}
.mast nav a {
  display: grid;
  align-items: center;
  font-size: 13px;
  position: relative;
  color: var(--muted);
}
.mast nav a[aria-current] {
  color: #e9e8e4;
}
.mast nav a[aria-current]:after {
  position: absolute;
  content: "";
  height: 2px;
  background: var(--gold);
  bottom: 0;
  inset-inline: 0;
}
.mast-actions {
  margin-left: auto;
  display: flex;
  gap: 18px;
  align-items: center;
}
.mast-actions button {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.mast-actions kbd {
  border: 1px solid #3d4654;
  border-radius: 4px;
  padding: 0 4px;
  color: #b6c1cb;
}
.mast-actions #find > span:first-child {
  font: 23px/1 var(--sans);
}
#lang {
  font: 12px var(--mono);
  border-left: 1px solid var(--line);
  padding-left: 22px;
  min-height: 23px;
}
.topline {
  padding: clamp(18px, 2.8vh, 34px) 0 19px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1em;
}
.overline {
  color: var(--gold);
  font: 10px/1.3 var(--mono);
  letter-spacing: 0.18em;
  margin: 0 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.overline i {
  width: 17px;
  height: 1px;
  background: var(--gold);
}
h1 {
  font: 550 clamp(30px, 3.35vw, 54px) / 1.14 var(--sans);
  letter-spacing: -0.045em;
  margin: 0;
}
html[lang="en"] h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.047em;
}
.switch {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid #333a44;
  background: #0b0e15;
  border-radius: 9px;
}
.switch button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 15px;
  font-size: 13px;
  border-radius: 5px;
  color: var(--muted);
}
.switch b {
  font-weight: 500;
}
.switch button span {
  font: 20px/1 var(--mono);
}
.switch button[aria-pressed="true"] {
  background: #e9c98e;
  color: #201d19;
  box-shadow: 0 1px 8px #0006;
}
.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(242px, 20.6vw, 340px);
  border: 1px solid #3c4551;
  background: #0d131e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 55px #01030a38;
}
.viewport {
  isolation: isolate;
  position: relative;
  min-width: 0;
  height: clamp(420px, 58svh, 820px);
  background: #080e1b;
  overflow: hidden;
}
.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(
      180deg,
      #050b1745,
      transparent 32%,
      transparent 76%,
      #050a14a8
    ),
    url("./deep-field.webp");
  background-size: cover;
  background-position: center;
}
.maphead,
.maptools,
.legend,
.pager {
  position: absolute;
  z-index: 1;
}
.maphead {
  top: 17px;
  left: 20px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #d8dfeb;
  font: 11px var(--mono);
  letter-spacing: 0.06em;
  pointer-events: none;
  text-shadow: 0 1px 5px black;
}
.scope-cross {
  color: var(--gold);
  font: 22px/1 serif;
}
.maptools,
.pager {
  display: flex;
  align-items: center;
  border: 1px solid #43506499;
  border-radius: 5px;
  background: #080d16dc;
  color: #e1e6ed;
  font: 10px var(--mono);
}
.maptools {
  top: 14px;
  right: 15px;
}
.maptools output {
  min-width: 33px;
  text-align: center;
  color: #afbac9;
}
.maptools button,
.pager button {
  min-width: 29px;
  height: 29px;
  font: 19px/1 var(--sans);
  padding: 0;
}
#fit {
  border-left: 1px solid #3a4352;
  font-size: 20px;
}
.legend {
  left: 19px;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  color: #c4cbd7;
  text-shadow: 0 1px 5px black;
  pointer-events: none;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  width: 6px;
  height: 6px;
  display: inline-block;
  background: var(--c);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--c);
}
.pager {
  right: 12px;
  bottom: 11px;
}
.pager[hidden] {
  display: none;
}
#universe {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
#universe.drag {
  cursor: grabbing;
}
.graticule {
  stroke: #a1b1cc;
  opacity: 0.16;
  fill: none;
  stroke-width: 0.75;
  stroke-dasharray: 2 7;
  pointer-events: none;
}
.faint-ring {
  stroke: #b6a37a;
  opacity: 0.21;
  fill: none;
  stroke-width: 0.65;
  pointer-events: none;
}
.thread {
  fill: none;
  stroke: var(--edge, #a6becd);
  stroke-width: 1.25;
  opacity: 0.53;
  pointer-events: none;
}
.thread.lit {
  stroke-width: 2.1;
  opacity: 0.97;
}
.thread-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
}
.link-object:hover .thread,
.link-object:focus-visible .thread {
  stroke: white;
  stroke-width: 2.8;
  opacity: 1;
}
.traveller {
  fill: #fff4d4;
  pointer-events: none;
}
.celestial {
  cursor: pointer;
  outline: 0;
}
.celestial .star-core {
  fill: var(--c);
  stroke: #fffff2;
  stroke-width: 1.2;
}
.celestial .diffraction {
  fill: var(--c);
  opacity: 0.92;
}
.celestial .halo {
  opacity: 0.55;
  mix-blend-mode: screen;
}
.celestial .reticle {
  stroke: var(--c);
  fill: none;
  stroke-width: 1;
  opacity: 0.8;
}
.celestial .hit {
  fill: transparent;
}
.celestial:hover .star-core,
.celestial:focus-visible .star-core {
  stroke: white;
  stroke-width: 4;
}
.celestial:hover .reticle,
.celestial:focus-visible .reticle {
  stroke: white;
  opacity: 1;
}
.celestial text {
  fill: #eef4fa;
  font: 500 13px var(--sans);
  paint-order: stroke;
  stroke: #090c18;
  stroke-width: 4;
  stroke-linejoin: round;
}
.celestial text.tiny {
  fill: #bfcad8;
  font: 11px var(--mono);
}
.celestial.active text {
  fill: #ffe5ae;
}
.celestial text.secondary {
  opacity: 0;
}
.celestial:hover text.secondary,
.celestial:focus-visible text.secondary,
.closeup .celestial text.secondary {
  opacity: 1;
}
.pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse 3.8s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.28;
    transform: scale(1.14);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .traveller {
    display: none;
  }
}
#inspector {
  border-left: 1px solid #30394a;
  padding: clamp(16px, 1.7vw, 31px);
  height: clamp(420px, 58svh, 820px);
  overflow: auto;
  scrollbar-color: #3d4656 transparent;
  background: linear-gradient(147deg, #10182a, #090f1d 65%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
.instrument {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: var(--gold);
  font: 10px var(--mono);
  letter-spacing: 0.12em;
}
.instrument .count {
  color: #abb7c6;
  letter-spacing: 0.04em;
}
.emblem {
  width: 57px;
  height: 57px;
  border: 1px solid #a2a0a867;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  font: italic 29px Georgia;
  color: var(--c);
  margin: 19px 0 13px;
  background: radial-gradient(ellipse at 45% 40%, #47516744, transparent 70%);
}
.emblem:before,
.emblem:after {
  content: "";
  position: absolute;
  inset: 7px -6px;
  border: 1px solid var(--c);
  opacity: 0.55;
  transform: rotate(-32deg);
  border-radius: 50%;
}
.emblem:after {
  inset: -4px 14px;
  transform: rotate(32deg);
  opacity: 0.3;
}
#inspector h2 {
  font: 550 clamp(20px, 1.65vw, 28px) / 1.26 var(--sans);
  letter-spacing: -0.025em;
  margin: 0 0 9px;
}
#inspector p {
  font-size: 13px;
  line-height: 1.62;
  margin: 0 0 12px;
  color: #c8d0dc;
}
#inspector .fine {
  font-size: 11px;
  color: #9eafc2;
}
#inspector .inspect-key {
  margin: 7px 0 5px;
  color: #9eafc2;
  font: 11px/1.5 var(--sans);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}
.chips button {
  padding: 3px 8px;
  text-align: left;
  border-radius: 4px;
  font-size: 11px;
  background: #101722;
  border: 1px solid #3e4856;
  color: #d3dce8;
}
.actions {
  margin-top: auto;
  padding-top: 12px;
  width: 100%;
  display: grid;
  gap: 6px;
}
.action {
  padding: 8px 10px;
  border: 1px solid #3c4959;
  color: #d0dcea;
  border-radius: 5px;
  font-size: 12px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.action:first-child {
  color: var(--gold);
  border-color: #716044;
  background: #d6ad6421;
}
.action:hover {
  background: #354051;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper button {
  height: 26px;
  width: 26px;
  border: 1px solid #475261;
  border-radius: 50%;
  font: 14px var(--mono);
}
.course-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 17px 0 9px;
  font-size: 12px;
  color: #bec6d1;
}
.course-head span:last-child {
  font: 11px var(--mono);
  color: #96a3b4;
}
.course {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.course button {
  border: 1px solid #2b3541;
  background: #0f1520;
  border-radius: 6px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: #cdd5e0;
  min-width: 0;
}
.course button[aria-pressed="true"] {
  border-color: #a08353;
  background: linear-gradient(105deg, #2a261f, #171b22);
  color: #ffe4b4;
}
.course b {
  font-size: 12px;
  font-weight: 550;
}
.course small {
  display: block;
  margin-top: 3px;
  font: 10px var(--mono);
  color: #98a6b7;
}
.course .glyph {
  color: var(--c);
  font: italic 21px Georgia;
  min-width: 25px;
  text-align: center;
}
footer {
  display: flex;
  gap: 24px;
  align-items: center;
  padding-block: 17px 20px;
  color: #a6b2c2;
  font-size: 11px;
}
footer .engine {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c1cbd6;
}
footer img {
  object-fit: contain;
}
.engine span {
  font: 10px var(--mono);
}
#library {
  margin-left: auto;
}
dialog {
  width: min(530px, 94vw);
  padding: 0;
  background: #111a27;
  color: #edf1f7;
  border: 1px solid #5d697d;
  border-radius: 10px;
  box-shadow: 0 18px 80px #000b;
}
dialog::backdrop {
  background: #050810ba;
  backdrop-filter: blur(5px);
}
.findbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.findbar > span {
  font-size: 24px;
}
.findbar input {
  width: 100%;
  background: none;
  color: inherit;
  border: 0;
  font-size: 15px;
}
.findbar button {
  font-size: 24px;
}
#matches {
  max-height: 52svh;
  overflow: auto;
  padding: 7px;
}
#matches button {
  display: flex;
  gap: 12px;
  align-items: baseline;
  text-align: left;
  width: 100%;
  padding: 8px;
  border-radius: 4px;
}
#matches button:hover {
  background: #243040;
}
#matches small {
  min-width: 60px;
  font: 10px var(--mono);
  color: var(--gold);
}
#matches span,
#matches p {
  font-size: 13px;
}
@media (min-width: 1600px) {
  .course button {
    padding: 15px;
  }
  .mast {
    height: 76px;
  }
}
@media (max-width: 900px) {
  .mast {
    gap: 25px;
  }
  .console {
    grid-template-columns: minmax(0, 1fr) 222px;
  }
  .course {
    grid-template-columns: repeat(3, 1fr);
  }
  .viewport,
  #inspector {
    height: clamp(410px, 56svh, 650px);
  }
  .legend {
    gap: 8px;
  }
  .course button {
    padding: 8px;
  }
}
@media (max-width: 700px) {
  .mast {
    height: 52px;
    gap: 14px;
  }
  .brand {
    font-size: 11px;
    gap: 4px;
  }
  .brand > b {
    font-size: 12px;
  }
  .logo-orbit {
    width: 25px;
    height: 25px;
    font-size: 21px;
  }
  .logo-orbit:before {
    inset: 6px -3px;
  }
  .mast nav {
    gap: 12px;
  }
  .mast nav a {
    font-size: 11px;
  }
  .mast nav a:first-child {
    display: none;
  }
  .mast-actions {
    gap: 5px;
  }
  .mast-actions #find span:nth-child(2),
  kbd {
    display: none;
  }
  #lang {
    padding-left: 10px;
  }
  .topline {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 17px 0 12px;
    gap: 10px;
  }
  .overline {
    font-size: 8px;
    margin-bottom: 5px;
  }
  .switch {
    margin-left: auto;
    align-self: flex-end;
    padding: 2px;
  }
  .switch button {
    padding: 6px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .switch button span {
    font-size: 14px;
  }
  h1 {
    font-size: 27px;
  }
  .console {
    display: flex;
    flex-direction: column;
  }
  .viewport {
    height: clamp(344px, 52svh, 520px);
  }
  #inspector {
    border: 0;
    border-top: 1px solid #384151;
    height: auto;
    max-height: none;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .emblem {
    display: none;
  }
  .instrument {
    margin-bottom: 7px;
  }
  .stepper button {
    width: 30px;
    height: 30px;
  }
  #inspector h2 {
    font-size: 21px;
  }
  #inspector p {
    font-size: 13px;
    margin-bottom: 7px;
  }
  #inspector .actions {
    display: flex;
    flex-wrap: wrap;
    padding-top: 5px;
  }
  .actions .action {
    flex: 1;
    min-width: max-content;
  }
  .maphead {
    left: 12px;
    top: 14px;
    font-size: 10px;
  }
  .maptools {
    right: 9px;
    top: 10px;
  }
  .legend {
    left: 12px;
    bottom: 10px;
    gap: 9px;
    font-size: 9px;
  }
  .maptools button {
    height: 31px;
    min-width: 29px;
  }
  .course {
    gap: 5px;
  }
  .course button {
    padding: 7px 5px;
    gap: 3px;
  }
  .course b {
    font-size: 10px;
  }
  .course small {
    font-size: 9px;
  }
  .course .glyph {
    min-width: 20px;
    font-size: 16px;
  }
  .course-head {
    margin-top: 14px;
  }
  footer {
    flex-wrap: wrap;
    gap: 6px 15px;
    padding-block: 14px;
    font-size: 10px;
  }
  footer .engine img {
    width: 46px;
  }
  .pager {
    bottom: 29px;
  }
}
.maphead button {
  pointer-events: auto;
  font: 10px var(--sans);
  letter-spacing: 0;
  border: 1px solid #596373;
  background: #0c1320cf;
  padding: 4px 7px;
  border-radius: 4px;
}
.maphead button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
}
.wires {
  width: 100%;
  font-size: 11px;
  color: #b6c3d3;
  margin: 5px 0;
}
.wires summary {
  cursor: pointer;
}
.wires div {
  max-height: 150px;
  overflow: auto;
  display: grid;
}
.wires button {
  text-align: left;
  border-bottom: 1px solid #354050;
  padding: 5px 0;
}
.wires summary:focus-visible {
  outline: 1px solid var(--gold);
}
@media (max-width: 410px) {
  .topline {
    display: block;
  }
  .switch {
    width: max-content;
    margin: 9px 0 0;
  }
  .course .glyph {
    display: none;
  }
  .maphead {
    gap: 4px;
  }
  .maphead button {
    font-size: 9px;
  }
}

.sky {
  opacity: var(--cloud, .44);
  filter: contrast(1.22) brightness(.8) saturate(1.5);
  transition: opacity .23s ease;
}
.sky::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(110deg,#294aa3 12%,#313780 52%,#6e468a 91%);
  mix-blend-mode:color;opacity:.67;pointer-events:none;
}
.source-view{--cloud:.34}
.viewport[data-nebula="off"]{--cloud:0}
.viewport[data-nebula="soft"]{--cloud:.14}
.viewport[data-nebula="vivid"]{--cloud:.75}
@media(prefers-reduced-motion:reduce){.sky{transition:none}}
.viewport {
  background: radial-gradient(
    ellipse at 64% 49%,
    #08132a 0,
    #050b1c 48%,
    #020511 90%
  );
}

.sky-control{display:flex;align-items:center;gap:2px;padding:0 3px 0 6px;border-right:1px solid #394455;color:#dfc797}
.sky-control span{font-size:14px}
#nebula{font:11px var(--sans);color:inherit;background:#070c16;border:0;max-width:76px;height:31px;cursor:pointer}
#nebula option{background:#0a1020;color:#e4eaf1}
.line-caption {
  font: 11px var(--sans);
  fill: #cbdae6;
  paint-order: stroke;
  stroke: #0d1726;
  stroke-width: 4;
  stroke-linejoin: round;
  cursor: pointer;
}
.link-object:hover .line-caption {
  fill: #ffe5ae;
}
#relations {
  position: absolute;
  top: 54px;
  right: 15px;
  max-width: 46%;
  color: #ccd8e6;
  background: #0d1723e6;
  border: 1px solid #3d495c;
  border-radius: 4px;
  font: 11px var(--sans);
  padding: 4px 5px;
}
.crumb {
  margin: 8px 0 0;
  padding: 0;
  color: #adbfce;
  font-size: 11px;
}
.crumb:hover {
  text-decoration: underline;
}
.trail {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.trail .crumb {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-formula {
  font:
    italic 14px/1.5 Georgia,
    serif;
  padding: 8px 10px;
  border-left: 2px solid #a88e5e;
  background: #b99c6710;
  color: #efdcba;
  margin: 1px 0 8px;
  overflow-wrap: anywhere;
}
.source-view .maphead {
  max-width: calc(100% - 158px);
  line-height: 1.35;
}

/* The route position stays above both views while the reader explores evidence. */
.compass,
.lens-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: #111925;
  border: 1px solid #394556;
  border-bottom: 0;
}
.compass {
  border-radius: 12px 12px 0 0;
}
.compass-place {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.compass-place > span {
  font-size: 27px;
  color: var(--gold);
}
.compass-place small,
.arrival small,
.citation-work small {
  display: block;
  color: #a5b5c8;
  font: 11px/1.5 var(--sans);
}
.compass-place strong {
  font: 550 16px/1.4 var(--sans);
  color: #edf4ff;
}
#journey-controls,
#lens-options,
.evidence-entries > div {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
#journey-controls button,
#lens-options button,
.evidence-entries button,
.finish-route {
  padding: 7px 11px;
  border: 1px solid #455367;
  border-radius: 5px;
  color: #dce7f1;
  font: 12px/1.35 var(--sans);
  background: #17202d;
}
#journey-controls [aria-pressed="true"],
#lens-options [aria-pressed="true"] {
  border-color: #83cdcb;
  color: #b1fcf2;
  background: #183137;
}
#journey-controls .action {
  color: #acf1e7;
  border-color: #587a77;
}
.lens-bar {
  flex-wrap: wrap;
  gap: 8px;
  background: #0f1722;
}
.lens-bar[hidden] {
  display: none;
}
#lens-options small {
  color: #a5b8c6;
  font-family: var(--mono);
}
#lens-help {
  color: #bac9d7;
  font: 12px/1.5 var(--sans);
  margin: 0;
}
.compass ~ .console {
  border-radius: 0 0 12px 12px;
}
.route-guide {
  font: 600 15px var(--sans);
  fill: #aebfcd;
  letter-spacing: 0.06em;
  paint-order: stroke;
  stroke: #101723;
  stroke-width: 3px;
}
#inspector > .instrument {
  margin-bottom: 12px;
}
#inspector h2 {
  margin-top: 4px;
}
#inspector .explanation {
  font-size: 14px;
  color: #e3e9f1;
  line-height: 1.65;
}
.route-choices,
.inputs,
.evidence-entries,
.arrival,
.neighbours,
.math-detail,
.citation-work {
  width: 100%;
  margin: 4px 0 10px;
}
.route-choices h3,
.neighbours h3,
.inputs summary,
.evidence-entries > span,
.math-detail summary {
  display: block;
  color: #a6e0d9;
  font: 600 12px/1.5 var(--sans);
  margin: 3px 0 6px;
}
.inputs summary,
.math-detail summary {
  display: list-item;
  cursor: pointer;
  color: #bdcbd8;
}
.route-hop,
.neighbour button,
.citation-work button {
  display: block;
  text-align: start;
  width: 100%;
  border: 1px solid #3c4c5e;
  background: #15202d;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0;
  color: #edf4fb;
}
.route-hop:hover,
.neighbour button:hover,
.evidence-entries button:hover,
.citation-work button:hover {
  background: #213140;
  border-color: #88bfbb;
}
.route-hop span {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 600 14px/1.4 var(--sans);
}
.route-hop small {
  font: 11px var(--mono);
  color: #99d8d2;
}
.route-hop i,
.neighbour i {
  margin-left: auto;
  color: #a4efe1;
  font-style: normal;
}
.route-hop em {
  display: block;
  font: 12px/1.5 var(--sans);
  color: #b9c8d6;
  margin-top: 4px;
}
.evidence-entries button {
  padding: 5px 8px;
}
.arrival,
.citation-work {
  border-left: 2px solid #718b9d;
  padding-left: 10px;
}
#inspector .arrival p,
.citation-work button {
  font-size: 12px;
  line-height: 1.55;
  margin: 2px 0;
}
.citation-work button {
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #c2d0f1;
}
.finish-route {
  margin: 3px 0 10px;
  color: #b0eee3;
}
.neighbour {
  display: flex;
  align-items: stretch;
  gap: 3px;
}
.neighbour small,
.neighbour b {
  display: block;
  max-width: 90%;
  overflow-wrap: anywhere;
}
.neighbour small {
  color: #acbdcd;
  font-size: 10px;
}
.neighbour b {
  font-size: 13px;
  font-weight: 550;
}
.neighbour button:first-child {
  position: relative;
}
.neighbour i {
  position: absolute;
  right: 9px;
  top: 35%;
}
.neighbour .why-link {
  width: 36px;
  flex: none;
  text-align: center;
  padding: 0;
  color: #bbcad9;
}
.formal-name {
  color: #b1c7d4;
  font-size: 11px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
#inspector .actions {
  margin: 0 0 9px;
}
.trail {
  margin: 0 0 8px;
}
@media (min-width: 1000px) {
  .console {
    grid-template-columns: minmax(0, 1fr) clamp(310px, 26vw, 405px);
  }
}
@media (max-width: 700px) {
  .compass,
  .lens-bar {
    padding: 9px 10px;
    gap: 6px;
  }
  .compass-place {
    gap: 5px;
  }
  .compass-place > span {
    font-size: 18px;
  }
  .compass-place strong {
    font-size: 13px;
  }
  #journey-controls button,
  #lens-options button {
    padding: 6px 7px;
    font-size: 11px;
  }
  .route-guide {
    font-size: 13px;
  }
  .lens-bar {
    align-items: start;
    flex-direction: column;
  }
}
.resume-rail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 16px;
  background: #242322;
  border: 1px solid #585046;
  border-bottom: 0;
}
.resume-rail[hidden] {
  display: none;
}
.resume-rail span {
  color: #d4c4a9;
  font: 12px var(--sans);
}
.resume-rail button {
  background: transparent;
  border: 0;
  color: #f2d099;
  font: 600 12px var(--sans);
  padding: 4px 0;
}
.route-hop .seen {
  color: #a0b5c7;
  font-size: 10px;
  font-family: var(--sans);
}

/* Keep controls outside SVG coordinates, including during pinch zoom. */
.viewport{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.chart-toolbar,.chart-footer{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;padding:9px 12px}
.chart-toolbar{background:linear-gradient(#030713c9,transparent)}
.chart-footer{background:linear-gradient(transparent,#030713c9)}
.chart-toolbar .maphead,.chart-toolbar .maptools,.chart-toolbar #relations,.chart-footer .legend,.chart-footer .pager{position:static}
.chart-toolbar .maphead{max-width:none;flex:1 1 135px;min-width:0;flex-wrap:wrap}
.chart-toolbar .maptools{margin-inline-start:auto;flex:none}
.chart-toolbar #relations{margin-inline-start:auto;max-width:100%}
.chart-footer .legend{flex:1 1 160px;flex-wrap:wrap;gap:4px 10px}
.chart-footer .pager{margin-inline-start:auto}
#universe{min-height:0;min-width:0}
#inspector>*{flex-shrink:0}
.celestial .wrapped-label{font-size:var(--label-size,13px);font-weight:550;stroke:#020611}
@media(max-width:540px){.chart-toolbar,.chart-footer{padding:7px 9px}.chart-toolbar .maphead{letter-spacing:0}}

.compass{position:sticky;top:0;z-index:3;flex-wrap:wrap}
.atlas-travel{display:flex;align-items:center;gap:6px;margin-inline-start:auto}
.atlas-travel button,.atlas-travel a{display:inline-flex;align-items:center;min-height:32px;padding:5px 10px;border:1px solid #4b6472;border-radius:5px;color:#c9ece9;background:#101f2b;text-decoration:none;font:550 12px var(--sans)}
.atlas-travel button:disabled{opacity:.38}
@media(max-width:700px){.compass{gap:4px 8px}.atlas-travel button,.atlas-travel a{padding:4px 6px;font-size:11px}#journey-controls{width:100%;justify-content:flex-end}}
