/* Distance view (views/distance.js) and the "Distance to" pop-up (components/distance.js). Builds on card.css,
   map.css (.lbl labels) and manual.css (glyphs, buttons). */

body[data-view="distance"] .masthead,
body[data-view="distance"] .savelist { display: none; }
body:not([data-view="distance"]) .dist { display: none; }

.dist { position: fixed; inset: 0; z-index: 3; font-family: var(--card-font); color: var(--card-text); }
.dist__scene, .dist__labels { position: absolute; inset: 0; }
.dist__scene canvas { display: block; }
.dist__labels { pointer-events: none; z-index: 1; }

/* The two system labels: From to the left of its star, To to the right, so they don't cover each other far out. */
.dist__lbl--a .t { transform: translateX(calc(-50% - 14px)); text-align: right; }
.dist__lbl--a small { left: auto; right: 0; }
.dist__ly {
  padding: 0.1765em 0.6471em; background: rgba(6, 4, 14, 0.7); border: 1px solid rgba(255, 214, 150, 0.45);
  font-family: var(--card-font-caps); font-size: 0.85em; font-weight: 600; letter-spacing: 0.06em; color: #ffd696;
  white-space: nowrap; transform: translateY(-1.5294em);
}

.dist__panel {
  position: absolute; z-index: 2; top: calc(1em + env(safe-area-inset-top, 0px)); right: 1.2em;
  width: min(22em, calc(100vw - 6em)); padding: 0.9em 1.1em 1em;
  background: var(--card-body); backdrop-filter: blur(6px); box-shadow: var(--card-frame);
  border-top: 2px solid rgba(255, 214, 150, 0.5);
}
.dist__path {
  font-family: var(--card-font-caps); font-size: 0.72em; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--card-muted);
}
.dist__big { font-size: 2.1em; font-weight: 500; line-height: 1.1; margin-top: 0.0714em; color: #ffd696; font-variant-numeric: tabular-nums; }
.dist__sub { font-size: 0.9em; font-weight: 300; color: var(--card-muted); margin-bottom: 0.7778em; }
.dist__sys { padding: 0.55em 0 0.5em; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.dist__sys-head { display: flex; align-items: center; gap: 0.5em; margin-bottom: 0.3em; min-width: 0; }
.dist__role {
  font-family: var(--card-font-caps); font-size: 0.7em; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--card-dim); width: 3.7143em; flex: none;
}
.dist__dot { width: 0.5em; height: 0.5em; transform: rotate(45deg); box-shadow: 0 0 0.45em currentColor; flex: none; }
.dist__name { font-size: 1.1em; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist__facts { font-size: 0.82em; font-weight: 300; color: var(--card-dim); margin-top: 0.3049em; }
.dist__btns { display: flex; flex-wrap: wrap; gap: 0.4em; margin-top: 0.7em; }
.dist__btns .manual__btn { padding: 0.5333em 0.8667em; font-size: 0.75em; }

/* Pop-up */
.dist-from { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3em 0.7em; margin: 0 0 0.9em 0.6em; }
.dist-from__name { font-size: 1.1em; font-weight: 500; }
.dist-result { margin: -0.4em 0 0.9em 0.6em; min-height: 1.2em; }
.dist-result[data-tone="warn"] { color: var(--tone-special); }
.dist-result__ly { font-size: 1.35em; font-weight: 500; color: #ffd696; }

@media (max-width: 560px) {
  .dist__panel { left: 1em; right: 1em; width: auto; top: auto; bottom: calc(1em + env(safe-area-inset-bottom, 0px)); }
  .dist__big { font-size: 1.6em; }
}
