/* SOLAR density/readability tuning layered over solar.css. */

.solar-module-head {
  min-height: 36px;
  margin-bottom: 4px;
  padding: 4px 10px 6px;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--special, #5e02ff) 8%, var(--foreground, #0f0f0f)),
      color-mix(in srgb, var(--foreground, #0f0f0f) 96%, transparent));
  border-top: 1px solid rgba(255,255,255,.035);
  border-bottom: 1px solid color-mix(in srgb, var(--special, #5e02ff) 18%, rgba(255,255,255,.06));
}

.solar-module-head .solar-kicker,
.solar-record-count,
.solar-result-count {
  color: color-mix(in srgb, var(--standard, #404040) 50%, #ffffff 50%);
}

.solar-title-block h1 {
  color: color-mix(in srgb, var(--special, #5e02ff) 76%, #ffffff 24%);
}

.solar-home {
  border-color: color-mix(in srgb, var(--special, #5e02ff) 25%, rgba(255,255,255,.08));
  background: color-mix(in srgb, var(--foreground, #0f0f0f) 94%, var(--special, #5e02ff) 6%);
}

/* Reference plates: deliberately thumbnail-sized; tap still opens fullscreen. */
.solar-atlas-strip {
  grid-auto-columns: minmax(82px, 22vw);
  gap: 5px;
  padding: 0 10px 5px;
}

.solar-atlas-card {
  height: 58px;
  border-radius: 4px;
}

.solar-atlas-card::after {
  inset: 24% 0 0;
}

.solar-atlas-card > span {
  left: 5px;
  right: 5px;
  bottom: 4px;
}

.solar-atlas-card strong {
  font-size: 7px;
  line-height: 1.05;
  letter-spacing: .02em;
}

.solar-atlas-card small {
  display: none;
}

.solar-atlas-frame {
  position: relative;
  min-width: 0;
  height: 58px;
  scroll-snap-align: start;
}

.solar-atlas-frame .solar-atlas-card {
  width: 100%;
  height: 100%;
  scroll-snap-align: none;
}

.solar-atlas-frame .solar-atlas-card img {
  object-position: 50% 43%;
}

.solar-atlas-alt {
  appearance: none;
  position: absolute;
  z-index: 5;
  top: 4px;
  right: 4px;
  min-width: 29px;
  height: 17px;
  padding: 0 5px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 4px;
  background: rgba(4,4,9,.84);
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  font: 6.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
}

.solar-lightbox-bar > .solar-atlas-patch-title {
  display: grid;
}

.solar-lightbox-bar > .solar-atlas-patch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.solar-atlas-patch-switch {
  appearance: none;
  min-width: 40px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px;
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.9);
  font: 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .055em;
}

.solar-atlas-patch-lightbox .solar-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
}

/* Slightly clearer controls without turning the module into a flashlight. */
.solar-filter-chip {
  color: color-mix(in srgb, var(--solar-chip-color, var(--special, #5e02ff)) 48%, #ffffff 52%);
}

.solar-search,
.solar-search::placeholder {
  color: color-mix(in srgb, var(--standard, #404040) 46%, #ffffff 54%);
}

.solar-search::placeholder {
  opacity: .72;
}

.solar-major-chip {
  --solar-chip-color: #76649a;
}

/* Remove the artificial sticky offset so the table header starts directly below controls. */
.solar-table th {
  top: 0;
  height: 58px;
}

/* 80%ish data-row density: 22px -> 18px, planet rows 25px -> 20px. */
.solar-table th,
.solar-table td {
  height: 18px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.solar-table tr.is-planet td {
  height: 20px;
}

/* Table-local pinch zoom stage. */
.solar-table-wrap {
  touch-action: pan-x pan-y;
}

.solar-table-zoom {
  position: relative;
  display: block;
  width: max-content;
}

.solar-table-zoom > .solar-table {
  position: absolute;
  top: 0;
  left: 0;
}

.solar-table-wrap.is-zoomed {
  cursor: grab;
}

/* User-requested black table text. */
.solar-table,
.solar-table th,
.solar-table td,
.solar-table tbody td,
.solar-column-label,
.solar-column-symbol,
.solar-column-formula,
.solar-sort-arrow,
.solar-object-name,
.solar-object-code,
.solar-table tr.is-planet td {
  color: #000;
}

.solar-table tbody tr[hidden] {
  display: none;
}

/* Table geometry: compact object label, intrinsic-fit data columns. */
.solar-table {
  table-layout: auto;
  width: max-content;
  min-width: 0;
}

.solar-table th:nth-child(1),
.solar-table td:nth-child(1) {
  width: 74px;
  min-width: 74px;
  max-width: 74px;
}

.solar-table th:nth-child(n+2),
.solar-table td:nth-child(n+2) {
  width: auto;
  min-width: 0;
  max-width: none;
}

@media (min-width: 700px) {
  .solar-atlas-strip {
    grid-auto-columns: 120px;
  }

  .solar-atlas-card,
  .solar-atlas-frame {
    height: 58px;
  }
}

/* Fresh SOLAR table pass: hierarchy, calculated column, and unit control. */
.solar-table tr.is-planet .solar-object-cell {
  grid-template-columns: auto auto;
  justify-content: end;
  text-align: right;
}

.solar-table tr.is-planet .solar-object-name {
  text-align: right;
}

/* MAJ = Star, Planet, Dwarf. Everything else is 85% of the standard 18px row. */
.solar-table tr.is-nonmajor td {
  height: 15.3px;
  padding-top: 0;
  padding-bottom: 0;
}

.solar-unit-chip {
  --solar-chip-color: #3b6fa5;
}

.solar-table th[data-solar-speed],
.solar-table td[data-solar-speed] {
  min-width: 76px;
}

.solar-calculated-column {
  cursor: default;
}

.solar-table tr.is-neptune-system td:first-child {
  background: var(--solar-row-bg);
}
