/* Public /gallery page (templates/gallery.html). Dark by default - the
   images are night-sky photos, and /live is dark too - with a light
   variant for viewers whose system asks for one. Same token names as
   admin.css. No theme toggle here (there is none on /live either), so
   unlike admin.css there's no [data-theme] copy of the palette. */
:root {
  --bg: #0b0f16;
  --fg: #e5e7eb;
  --panel-bg: #141b26;
  --panel-border: #263142;
  --muted-fg: #9aa4b2;
  --link: #60a5fa;
  --chip-bg: #1c2531;
  --chip-fg: #cbd5e1;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8;
    --fg: #222;
    --panel-bg: #fff;
    --panel-border: #ddd;
    --muted-fg: #555;
    --link: #2563eb;
    --chip-bg: #f0f0f0;
    --chip-fg: #333;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
}
a { color: var(--link); }
.hide { display: none !important; }
.muted { color: var(--muted-fg); }

#galleryHeader {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1400px; margin: 0 auto 12px;
}
#galleryHeader h1 { margin: 0; font-size: clamp(20px, 4vw, 28px); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* The Live | Gallery | Distances switch itself is in page-switch.css (shared with /live). */
.header-btn {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--panel-border);
  background: transparent; color: var(--muted-fg); font-size: 13px; cursor: pointer;
}
.header-btn:hover { color: var(--fg); }
.header-btn.active { color: var(--fg); border-color: #2563eb; }
.header-btn:disabled { opacity: 0.6; cursor: default; }

.kind-filter { display: flex; gap: 6px; max-width: 1400px; margin: 0 auto 14px; }
.chip {
  padding: 5px 14px; border-radius: 999px; border: 1px solid var(--panel-border);
  background: var(--chip-bg); color: var(--chip-fg); font-size: 13px; cursor: pointer;
}
.chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }

main { max-width: 1400px; margin: 0 auto; }
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.card {
  position: relative; display: block; overflow: hidden; border-radius: 8px;
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  color: inherit; text-decoration: none; aspect-ratio: 4 / 3;
}
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.card:hover img, .card:focus-visible img { transform: scale(1.03); }
.caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); color: #fff;
}
.caption-title { font-weight: 600; font-size: 15px; }
.caption-sub { font-size: 12px; opacity: 0.8; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; background: #b45309;
}
.card .badge { position: absolute; top: 8px; left: 8px; }

.empty { text-align: center; color: var(--muted-fg); margin: 60px 0; }

/* Images published while the page was open (gallery.js's
   checkForUpdates()) - floats at the top of the viewport, so it's seen
   wherever the viewer has scrolled to. */
.new-items-pill {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 20; padding: 8px 16px; border: 0; border-radius: 999px;
  background: #2563eb; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.new-items-pill:hover { background: #1d4ed8; }

/* Lightbox: the image fills the left, details on the right; stacked on
   narrow screens (image on top, details scroll below). */
#lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: #05070b; color: #e5e7eb; overflow: hidden;
}
#lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lb-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100%; }
/* A size container, so the frame below can size itself against this cell
   with cq units. */
.lb-image {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 12px; container-type: size;
}
/* Wraps the <img> and the overlay SVG, which fills it via position:
   absolute, so the two must have exactly the image's aspect ratio
   (--lb-aspect = width / height, set per item by gallery.js's
   fillLightbox()) - the largest such box that fits the cell. Sizing the
   <img> with max-width/max-height plus object-fit: contain instead (as
   this used to) gave the <img> element the full cell width whenever the
   height was the limiting side, letterboxing the picture inside it, and
   the overlay stretched to match: the Moon circle turned into an oval and
   the RA/Dec grid got skewed - on portrait and square images, or any
   image in a short window. --lb-max-width (the image's own width) keeps
   a small image from being scaled up past its natural size, as before. */
.lb-image-frame {
  position: relative; display: block; aspect-ratio: var(--lb-aspect, 1.5);
  width: min(100cqw, 100cqh * var(--lb-aspect, 1.5), var(--lb-max-width, 100cqw));
}
.lb-image-frame img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; user-select: none; }
/* Zoom and pan (static/js/lightbox-zoom.js): the frame - picture and overlays
   - is moved and scaled by a transform about its middle; the cell clips what
   leaves it. Touch: vertical scrolling of the stacked layout stays with the
   browser until zoomed, then the finger moves the image (and a drag shows its
   hand). --lb-zoom is the scale, for the labels below. */
.lb-image { overflow: hidden; touch-action: pan-y; --lb-zoom: 1; }
.lb-image.zoomed { touch-action: none; cursor: grab; }
.lb-image.zoomed:active { cursor: grabbing; }
.lb-image-frame { transform-origin: 50% 50%; will-change: transform; }
.lb-image-frame.lb-zoom-glide { transition: transform 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .lb-image-frame.lb-zoom-glide { transition: none; } }
/* The overlays' labels stay the size they have at fit (a label is a share of
   the image, so it would grow with the zoom); each shrinks about its own middle. */
.sky-grid-label, .sky-region-dim { fill: rgba(0, 0, 0, 0.45); fill-rule: evenodd; }
.sky-region-box { fill: none; stroke: #fbbf24; stroke-width: 2; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; }
.sky-pointer-label { transform-box: fill-box; transform-origin: center; transform: scale(calc(1 / var(--lb-zoom, 1))); }
.lb-zoom-status {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 6px; background: rgba(10, 14, 20, 0.7); color: #fff; font-size: 12px;
}
.lb-zoom-status .lb-tool-btn { padding: 3px 10px; }
.lb-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky-grid-line { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sky-pointer-ring, .sky-pointer-pulse { fill: none; stroke: #fbbf24; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sky-pointer-pulse { transform-box: fill-box; transform-origin: center; animation: sky-pointer-pulse 1.3s ease-out infinite; }
@keyframes sky-pointer-pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sky-pointer-pulse { animation: none; opacity: 0.45; } }
.sky-pointer-label { fill: #fde68a; stroke: rgba(0, 0, 0, 0.8); paint-order: stroke; font-family: inherit; }
.sky-moon-circle { fill: none; stroke: #fbbf24; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* font-size/stroke-width are set per-label in gallery.js (a fraction of
   the image's own pixel size, so they scale with the image like the grid
   lines do); the halo (paint-order + stroke) just keeps the number
   legible over a bright patch of sky. */
.sky-grid-label { fill: rgba(255, 255, 255, 0.9); stroke: rgba(0, 0, 0, 0.75); paint-order: stroke; font-family: inherit; }

/* Hidden until the image area is hovered (mouse) or tapped once (touch,
   via .toolbox-pinned - see gallery.js) - a small floating toolbar, same
   "overlay chrome on dark imagery" treatment as .lb-nav below. In full
   screen (see #lbLayout:fullscreen further down) this hover-based rule is
   overridden by an idle-timer-driven one instead, since the image then
   fills the whole screen and plain :hover is always true. */
.lb-toolbox {
  position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); display: flex; flex-wrap: wrap; gap: 6px;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.lb-image:hover .lb-toolbox, .lb-image.toolbox-pinned .lb-toolbox { opacity: 1; pointer-events: auto; }
.lb-tool-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 14, 20, 0.7); color: #fff; font-size: 12px; cursor: pointer;
}
.lb-tool-btn:hover { background: rgba(255, 255, 255, 0.15); }
.lb-tool-btn.active { background: #2563eb; border-color: #2563eb; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 32px; cursor: pointer;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-info {
  position: relative; overflow-y: auto; padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  background: rgba(20, 27, 38, 0.92); border-left: 1px solid #263142; font-size: 14px; line-height: 1.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Full screen targets #lbLayout, not the <dialog> (see gallery.js) - CSS
   keys off the native :fullscreen pseudo-class, so it's always in sync
   with the real state. The image takes the whole screen and the info
   panel becomes a floating, rounded, semi-transparent card over its
   top-right corner instead of a docked sidebar; both it and the toolbox
   fade out after a short idle period (.fs-idle, added/removed by the
   mousemove/touchstart-driven timer in gallery.js) rather than on
   :hover - the image fills the entire screen here, so plain hover can't
   tell "idle" apart from "active". Tap-to-pin (.toolbox-pinned /
   .info-pinned) overrides the idle state, same as the windowed hover
   case above. Reset on narrow screens below, where the info panel is
   already a separate stacked row that doesn't need to float or collapse. */
#lbLayout:fullscreen { grid-template-columns: 1fr; }
#lbLayout:fullscreen .lb-toolbox { transition: opacity 0.2s ease; }
#lbLayout:fullscreen.fs-idle .lb-toolbox { opacity: 0; pointer-events: none; }
#lbLayout:fullscreen.fs-idle .lb-image.toolbox-pinned .lb-toolbox { opacity: 1; pointer-events: auto; }
#lbLayout:fullscreen .lb-info {
  position: absolute; top: 20px; right: 20px; bottom: 20px; width: 340px; max-width: calc(100% - 40px);
  height: auto; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#lbLayout:fullscreen.fs-idle .lb-info {
  opacity: 0; transform: translateX(16px); pointer-events: none;
}
#lbLayout:fullscreen.fs-idle.info-pinned .lb-info { opacity: 1; transform: translateX(0); pointer-events: auto; }
/* "Fill screen" (.fs-fill, see applyFsFill() in gallery.js): the frame
   becomes the smallest box of the image's aspect ratio that covers the
   whole cell - centred, the overflowing edges cropped - instead of the
   largest that fits. Upscaling past the image's own size is fine here
   (no --lb-max-width). flex-shrink: 0, or the flex cell would squeeze the
   frame back down to its own width. The overlay sits in the frame, so the
   grid and Moon circle stay on the sky. */
#lbLayout:fullscreen .lb-image.fs-fill { padding: 0; overflow: hidden; }
#lbLayout:fullscreen .lb-image.fs-fill .lb-image-frame {
  flex-shrink: 0; width: max(100cqw, 100cqh * var(--lb-aspect, 1.5));
}
.lb-title-row { display: flex; align-items: flex-start; gap: 6px; padding-right: 32px; }
.lb-info h2 { margin: 6px 0 2px; font-size: 20px; }
.lb-icon-btn {
  flex-shrink: 0; margin-top: 5px; width: 28px; height: 28px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; border: 0; border-radius: 6px;
  background: transparent; color: #9aa4b2; cursor: pointer;
}
.lb-icon-btn:hover, .lb-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.1); color: #e5e7eb; }
.lb-icon-btn .icon-done, .lb-icon-btn.done .icon-link { display: none; }
.lb-icon-btn.done .icon-done { display: block; color: #4ade80; }
.lb-info p { margin: 6px 0; }
.lb-info .muted { color: #9aa4b2; }
.lb-info a { color: #60a5fa; }
.lb-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px;
  border: 0; border-radius: 6px; background: transparent; color: #e5e7eb; font-size: 24px; cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.1); }
.channels, .links { margin: 6px 0; padding-left: 18px; }
.channel-subs { margin: 2px 0 4px; padding-left: 18px; opacity: 0.85; }
/* The session's SNR course (static/js/snr-plot.js), below the totals - in
   the lightbox, which is dark in both color schemes (fixed colors like
   .lb-info's own), so no light variant. */
.snr-figure { margin: 6px 0 0; max-width: 360px; }
.snr-plot { display: block; width: 100%; height: auto;
  --snr-L: #e5e7eb; --snr-R: #f87171; --snr-G: #4ade80; --snr-B: #60a5fa;
  --snr-H: #fb7185; --snr-S: #fbbf24; --snr-O: #22d3ee; --snr-other: #c4b5fd; }
.snr-plot .snr-axis { stroke: #3b4a60; stroke-width: 1; }
.snr-plot .snr-label { fill: #9aa4b2; font-size: 9px; }
.snr-plot .snr-line { fill: none; stroke: var(--snr-color); stroke-width: 1.5; stroke-linejoin: round; }
.snr-plot .snr-ideal { fill: none; stroke: var(--snr-color); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.snr-plot .snr-dot { fill: var(--snr-color); }
.snr-plot .snr-legend { fill: var(--snr-color); font-weight: 600; }
.snr-plot [class*="snr-role-"] { --snr-color: var(--snr-other); }
.snr-plot .snr-role-L { --snr-color: var(--snr-L); }
.snr-plot .snr-role-R { --snr-color: var(--snr-R); }
.snr-plot .snr-role-G { --snr-color: var(--snr-G); }
.snr-plot .snr-role-B { --snr-color: var(--snr-B); }
.snr-plot .snr-role-H { --snr-color: var(--snr-H); }
.snr-plot .snr-role-S { --snr-color: var(--snr-S); }
.snr-plot .snr-role-O { --snr-color: var(--snr-O); }
.snr-figure figcaption { font-size: 0.8em; color: #9aa4b2; }
/* Paragraphs/links/emphasis from static/js/description-view.js, inside the
   collapsible "Description" section (see .lb-section below). */
/* The lightbox's side panel is narrow, so a ragged right edge looks uneven:
   hyphens: auto breaks long words (it follows <html lang>, so German gets
   German hyphenation) and text-wrap: pretty avoids short last lines. Left-aligned
   on purpose - justified text in a ~340px column leaves uneven word gaps. */
.description { margin: 0 0 4px; hyphens: auto; text-wrap: pretty; }
.description p { margin: 0 0 0.7em; }
.description p:last-child { margin-bottom: 0; }
.license { font-size: 12px; margin-top: 12px; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lb-action-btn {
  display: inline-block; padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13px; line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb; text-decoration: none; cursor: pointer;
}
.lb-info a.lb-action-btn { color: #e5e7eb; }
.lb-action-btn:hover { background: rgba(255, 255, 255, 0.14); }

#galleryFooter {
  max-width: 1400px; margin: 28px auto 0; text-align: center;
  font-size: 12px; color: var(--muted-fg);
}
#galleryFooter p { margin: 0 0 6px; }
#galleryFooter a { color: inherit; }
#footerLinks a { text-decoration: none; }
/* The language selector (pybroadcast/templating.py's _lang_switch_html()). */
#footerLinks .lang-switch-link[aria-current] { color: var(--fg); }
#galleryFooter a:hover { color: var(--fg); }

/* "Sky position" (static/js/sky-box.js) - at the bottom of the info
   panel, using its free lower half. Always on the lightbox's dark
   background, so fixed colors like the rest of .lb-info. */
/* Collapsible info-panel sections (<details class="lb-section">): a header
   row with the title and a one-line summary, then the body. The native
   marker is replaced by a rotating arrow. */
.lb-section { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.lb-section > summary {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 0 4px;
  list-style: none; cursor: pointer;
}
.lb-section > summary::-webkit-details-marker { display: none; }
.lb-section > summary::before {
  content: "▸"; flex-shrink: 0; color: #9aa4b2; font-size: 12px; transition: transform 0.15s ease;
}
.lb-section[open] > summary::before { transform: rotate(90deg); }
.lb-section > summary:focus-visible { outline: 1px solid #60a5fa; outline-offset: 2px; border-radius: 4px; }
.lb-section-title { font-size: 14px; font-weight: 600; color: #e5e7eb; flex-shrink: 0; }
.lb-section-summary {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: #9aa4b2;
}
.lb-section[open] .lb-section-summary { visibility: hidden; }
.lb-section-body { padding: 6px 0 4px; }
/* A "pointer word" (static/js/pointer-word.js): text with a dotted underline
   that marks a spot on the image while hovered, focused or tapped. A focusable
   role="button" span, so it flows and wraps with the sentence. */
.pointer-word { border-bottom: 1px dotted currentColor; cursor: help; }
.pointer-word:hover, .pointer-word:focus-visible { color: #fbbf24; border-bottom-color: #fbbf24; outline: none; }
/* No plate solution, or the spot is off this image: plain text, nothing to point at. */
.pointer-word.pointer-word-off { border-bottom-color: transparent; cursor: inherit; pointer-events: none; }
/* A header whose summary is too long for the title's row ("In the cosmos":
   distance, scale and location): the summary goes on a line of its own under
   the title, wraps there, and stays visible when the section is open. */
.lb-section-wrap > summary { flex-wrap: wrap; row-gap: 2px; }
.lb-section-wrap .lb-section-summary {
  flex: 1 0 100%; padding-left: 20px; overflow: visible; text-overflow: clip; white-space: normal;
}
.lb-section-wrap[open] .lb-section-summary { visibility: visible; }
/* One piece of such a summary never breaks in the middle. */
.lb-section-part { white-space: nowrap; }

/* "In the cosmos" (static/js/cosmos-box.js) - same look as the finder
   chart above. */
#cosmosBody p { margin: 0 0 6px; }
.cosmos-map { display: block; width: 100%; border-radius: 8px; }
/* The draggable/pinchable map (map-view.js). touch-action: none hands
   every touch gesture that starts on the map to the map - without it the
   browser would scroll the panel or zoom the page instead. */
.cosmos-map-wrap {
  max-width: 300px; margin-top: 8px; touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.cosmos-map-wrap.dragging { cursor: grabbing; }
.cosmos-hint { margin: 4px 0 0; color: #9aa4b2; font-size: 11px; }
/* Zoom buttons above each map (cosmos-box.js's zoomableMap()). */
.cosmos-zoom { display: flex; gap: 4px; margin-top: 8px; }
.cosmos-zoom button {
  min-width: 28px; padding: 3px 8px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px;
  background: transparent; color: #cbd5e1; font: inherit; font-size: 12px; cursor: pointer;
}
.cosmos-zoom button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.cosmos-zoom button:disabled { opacity: 0.4; cursor: default; }
/* "Picture date | Now" under the Solar System map (solarTimeToggle()). */
.cosmos-time { margin-top: 6px; }
.cosmos-time button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.cosmos-map-bg { fill: #070b14; }
.cosmos-bulge { fill: rgba(253, 230, 138, 0.10); }
.cosmos-arm { fill: none; stroke: rgba(148, 163, 184, 0.22); stroke-linecap: round; stroke-linejoin: round; }
.cosmos-arm-label { fill: rgba(203, 213, 225, 0.75); font-size: 9px; }
.cosmos-label { fill: #9aa4b2; font-size: 9px; }
.cosmos-sun-label { text-anchor: end; fill: #fde047; }
.cosmos-center { text-anchor: middle; }
.cosmos-gc { fill: #fde68a; }
.cosmos-gc-arrow { fill: #9aa4b2; }
.cosmos-scale { stroke: #9aa4b2; stroke-width: 1.5; }
.cosmos-sun { fill: #fde047; }
.cosmos-sightline { stroke: rgba(251, 191, 36, 0.55); stroke-width: 1; stroke-dasharray: 3 3; }
.cosmos-object { fill: none; stroke: #fbbf24; stroke-width: 2; }
.cosmos-orbit { fill: none; stroke: rgba(148, 163, 184, 0.3); stroke-width: 1; }
/* A comet's path, the tick where it is nearest the Sun, and its tail. */
.cosmos-trajectory { fill: none; stroke: rgba(251, 191, 36, 0.55); stroke-width: 1; stroke-dasharray: 5 3; }
.cosmos-perihelion { fill: #fbbf24; }
.cosmos-comet-tail { stroke: rgba(251, 191, 36, 0.7); stroke-width: 2.5; stroke-linecap: round; }
.cosmos-ring { fill: none; stroke: rgba(148, 163, 184, 0.25); stroke-dasharray: 2 3; }
.cosmos-region { fill: rgba(148, 163, 184, 0.05); stroke: rgba(148, 163, 184, 0.4); stroke-dasharray: 5 3; }
.cosmos-region-label { fill: rgba(203, 213, 225, 0.6); font-style: italic; }
.cosmos-member { fill: rgba(203, 213, 225, 0.55); }
.cosmos-galaxy { fill: rgba(203, 213, 225, 0.75); }
.cosmos-milky-way { fill: #93c5fd; }
.cosmos-mw-label { fill: #bfdbfe; }
.cosmos-bar { display: block; width: 100%; max-width: 300px; margin-top: 10px; overflow: visible; }
.cosmos-bar-line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.cosmos-bar-tick { stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.cosmos-bar-label { fill: #9aa4b2; font-size: 8px; text-anchor: middle; }
.cosmos-bar-end { text-anchor: start; font-size: 7px; opacity: 0.8; }
.cosmos-bar-marker { fill: #fbbf24; }
.cosmos-bar-value { fill: #fbbf24; font-size: 9px; font-weight: 600; text-anchor: middle; }
.sky-toggles { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.sky-toggle { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 6px; overflow: hidden; }
.sky-toggle button {
  padding: 4px 9px; border: 0; background: transparent; color: #cbd5e1; font: inherit; font-size: 12px; cursor: pointer;
}
.sky-toggle button + button { border-left: 1px solid rgba(255, 255, 255, 0.18); }
.sky-toggle button.active { background: #2563eb; color: #fff; }
.sky-where { display: flex; gap: 12px; align-items: flex-start; }
.sky-text p { margin: 0 0 3px; }
.sky-when { color: #9aa4b2; font-size: 12px; }
.sky-note { color: #9aa4b2; font-size: 12px; }
.sky-dial { flex: 0 0 72px; width: 72px; height: 72px; }
.sky-dial-rim { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; }
.sky-dial-ring { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
.sky-dial-label { fill: #9aa4b2; font-size: 8px; text-anchor: middle; }
.sky-dial-dot { fill: #fbbf24; }
.sky-dial-dot.below { fill: none; stroke: #9aa4b2; stroke-width: 1.2; }
.sky-chart-box { margin-top: 12px; }
.sky-chart { display: block; width: 100%; max-width: 300px; border-radius: 8px; }
.sky-chart-bg { fill: #070b14; }
.sky-chart-grid { fill: none; stroke: rgba(96, 165, 250, 0.18); stroke-width: 0.6; }
.sky-chart-lines { fill: none; stroke: rgba(148, 163, 184, 0.55); stroke-width: 0.9; }
.sky-chart-star { fill: #f1f5f9; }
.sky-chart-name { fill: rgba(203, 213, 225, 0.6); font-size: 9px; text-anchor: middle; letter-spacing: 0.04em; }
.sky-chart-field { fill: rgba(251, 191, 36, 0.12); stroke: #fbbf24; stroke-width: 1.4; }
.sky-chart-target { fill: none; stroke: #fbbf24; stroke-width: 1.6; }
.sky-chart-dir { fill: #9aa4b2; font-size: 10px; font-weight: 600; text-anchor: middle; }
.sky-caption { margin: 4px 0 0; font-size: 11px; color: #9aa4b2; }
.sky-links { margin: 8px 0 0; font-size: 13px; }
.sky-credit { margin: 6px 0 0; font-size: 11px; color: #9aa4b2; }
.lb-info .sky-credit a { color: inherit; }

/* templates/gallery-item.html's no-redirect fallback body. */
.share-fallback { max-width: 600px; margin: 60px auto; text-align: center; }

@media (max-width: 600px) {
  /* minmax(0, 1fr), not 1fr: a long no-wrap line in the info panel (the collapsed
     description header) must not stretch the column past the screen. */
  .lb-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60vh auto; overflow-y: auto; }
  .lb-info { border-left: 0; border-top: 1px solid #263142; overflow: visible; }
  .lb-nav { width: 36px; height: 52px; font-size: 26px; }
  /* Already a separate stacked row here - don't turn it into a floating,
     collapsing card too (see #lbLayout:fullscreen .lb-info above) - every
     selector there is repeated here so this reset matches or exceeds its
     specificity and actually wins regardless of source order. */
  #lbLayout:fullscreen .lb-info,
  #lbLayout:fullscreen.fs-idle .lb-info,
  #lbLayout:fullscreen.fs-idle.info-pinned .lb-info {
    position: relative; width: auto; max-width: none; height: auto;
    border-radius: 0; border: 0; border-top: 1px solid #263142; box-shadow: none;
    opacity: 1; transform: none; pointer-events: auto;
  }
}
