/**
 * Astral Archive — Live Tracker module styles
 * ---------------------------------------------------------------------------
 * Loaded only by tracker.html. Holds the pieces the tracker needs beyond the
 * compiled utility classes: the snapshot chip row, the freshness pill, the
 * focus ring on the map stage, the text table that mirrors the canvas, and the
 * orbit-globe frame.
 *
 * The globe frame lives here rather than in skymap.css because tracker.html is
 * the only page that renders `[data-orbit-globe-stage]` and it does not load
 * the sky-map sheet. While the rule sat in skymap.css the frame was never
 * matched: the stage had no min-height, no background, no radius and no
 * clipping, so the canvas painted straight onto the page and the panel read as
 * a flat rectangle rather than a viewport. Keep this block in step with any
 * change to the globe module.
 */

/* -------------------------------------------------------------------------- */
/* Map stage                                                                  */
/* -------------------------------------------------------------------------- */
[data-tracker-stage] {
  outline: none;
}

/* The stage is focusable so the map can be read from the keyboard; the ring is
   drawn on the canvas frame rather than the wrapper so it hugs the artwork. */
[data-tracker-stage]:focus-visible {
  box-shadow: 0 0 0 2px rgba(124, 134, 232, 0.75), 0 0 0 5px rgba(124, 134, 232, 0.18);
}

[data-tracker-stage] canvas {
  cursor: crosshair;
}

/* -------------------------------------------------------------------------- */
/* Snapshot chips                                                             */
/* -------------------------------------------------------------------------- */
.tracker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

.tracker-chip-count {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.tracker-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: none;
}

/* -------------------------------------------------------------------------- */
/* Freshness pill                                                             */
/* -------------------------------------------------------------------------- */
.tracker-freshness {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tracker-freshness[data-tone='good'] {
  color: #7FC8B8;
  background: rgba(127, 200, 184, 0.1);
  border-color: rgba(127, 200, 184, 0.28);
}

.tracker-freshness[data-tone='fair'] {
  color: #E0C48F;
  background: rgba(224, 196, 143, 0.1);
  border-color: rgba(224, 196, 143, 0.28);
}

.tracker-freshness[data-tone='stale'] {
  color: #D9A7B8;
  background: rgba(217, 167, 184, 0.12);
  border-color: rgba(217, 167, 184, 0.32);
}

.tracker-freshness[data-tone='unknown'] {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border);
}

/* -------------------------------------------------------------------------- */
/* Position table                                                             */
/* -------------------------------------------------------------------------- */
.tracker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.tracker-table th,
.tracker-table td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.tracker-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.tracker-table tbody td {
  color: var(--text-secondary);
}

.tracker-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tracker-table tbody tr.is-selected {
  background: rgba(124, 134, 232, 0.09);
}

.tracker-table tbody tr.is-selected td,
.tracker-table tbody tr.is-selected th {
  color: var(--text-primary);
}

.tracker-table th[scope='row'] {
  font-weight: 500;
  color: var(--text-primary);
}

.tracker-table th[scope='row'] button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
}

.tracker-table th[scope='row'] button:hover {
  color: #fff;
}

.tracker-table th[scope='row'] button:focus-visible {
  outline: 2px solid rgba(124, 134, 232, 0.8);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Orbit globe frame                                                          */
/* -------------------------------------------------------------------------- */
/* A framed viewport, not a bare canvas. The vendored renderer sizes its canvas
   from the numbers the module hands it, so the stage owns the box and the
   canvas fills it; `overflow: hidden` keeps the sphere inside the rounded
   corners while it turns. */
.orbit-globe-stage {
  position: relative;
  width: 100%;
  min-height: 420px;
  background: #05060a;
  border-radius: 18px;
  overflow: hidden;
}

.orbit-globe-stage canvas {
  display: block;
}

/* Narrow viewports stack the page into one column and the globe would read as
   a tall letterbox at a fixed 420px, so it is given the same aspect ratio the
   sphere is comfortable in and clipped no tighter than that. */
@media (max-width: 640px) {
  .orbit-globe-stage {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }
}