/* SPDX-FileCopyrightText: 2026 Olivier Guyon et al
   SPDX-License-Identifier: LGPL-3.0-or-later */

.hero-banner {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.45rem 1.6rem;
  background:
    radial-gradient(circle at 92% 12%, var(--accent-glow), transparent 46%),
    linear-gradient(135deg, var(--accent-soft), var(--surface-alt));
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.35rem;
}

.hero-banner h1 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}

.hero-banner > p {
  max-width: 84ch;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.95fr);
  gap: 1.4rem;
  align-items: stretch;
}

@media (max-width: 1040px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.16rem 0.65rem;
  margin-bottom: 0.65rem;
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.hero-showcase {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero-showcase-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.hero-media-frame {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #080e1a;
  text-decoration: none;
}

.hero-media-frame video,
.hero-media-frame img {
  display: block;
  width: 100%;
  max-height: 245px;
  object-fit: cover;
  background: #080e1a;
}

.hero-media-tag {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.hero-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 0.45rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.hero-stat-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.hero-stat strong {
  font-size: 0.98rem;
  color: var(--text);
}

.hero-delta {
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--muted);
}

.hero-delta-good {
  color: var(--good);
}

.hero-showcase-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.guide-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  background: var(--surface);
  margin-bottom: 1.35rem;
}

.guide-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.guide-hdr h2 {
  margin: 0;
  border-bottom: none;
  padding: 0;
  font-size: 1.08rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.75rem;
}

.guide-step {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem 0.85rem;
  background: var(--surface-alt);
  font-size: 0.84rem;
}

.guide-step-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
}

.guide-step p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

kbd {
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 0.9rem 0 1.6rem;
}

.domain-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.08rem 1.18rem;
  background: var(--surface-alt);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.domain-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.domain-card.domain-wavefront-control { border-top-color: var(--domain-wavefront-control); }
.domain-card.domain-calibration-sysid { border-top-color: var(--domain-calibration-sysid); }
.domain-card.domain-coronagraphy-lowfs { border-top-color: var(--domain-coronagraphy-lowfs); }
.domain-card.domain-bench-runtime { border-top-color: var(--domain-bench-runtime); }
.domain-card.domain-hardware-dynamics { border-top-color: var(--domain-hardware-dynamics); }
.domain-card.domain-atmosphere-optics { border-top-color: var(--domain-atmosphere-optics); }

.domain-card-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.domain-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.domain-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.domain-card-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.83rem;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.52rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border);
  text-decoration: none;
  white-space: nowrap;
}

.domain-badge.domain-wavefront-control {
  background: var(--domain-wavefront-control-soft);
  color: var(--domain-wavefront-control-text);
  border-color: var(--domain-wavefront-control);
}

.domain-badge.domain-calibration-sysid {
  background: var(--domain-calibration-sysid-soft);
  color: var(--domain-calibration-sysid-text);
  border-color: var(--domain-calibration-sysid);
}

.domain-badge.domain-coronagraphy-lowfs {
  background: var(--domain-coronagraphy-lowfs-soft);
  color: var(--domain-coronagraphy-lowfs-text);
  border-color: var(--domain-coronagraphy-lowfs);
}

.domain-badge.domain-bench-runtime {
  background: var(--domain-bench-runtime-soft);
  color: var(--domain-bench-runtime-text);
  border-color: var(--domain-bench-runtime);
}

.domain-badge.domain-hardware-dynamics {
  background: var(--domain-hardware-dynamics-soft);
  color: var(--domain-hardware-dynamics-text);
  border-color: var(--domain-hardware-dynamics);
}

.domain-badge.domain-atmosphere-optics {
  background: var(--domain-atmosphere-optics-soft);
  color: var(--domain-atmosphere-optics-text);
  border-color: var(--domain-atmosphere-optics);
}

blockquote.callout {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

blockquote.callout p { margin: 0.25rem 0; }

.param-list,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0.35rem 0;
}

.metric-pill {
  display: inline-block;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.metric-pill-accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.param-pill {
  display: inline-block;
  padding: 0.12rem 0.44rem;
  border-radius: 6px;
  font-size: 0.77rem;
  line-height: 1.35;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--muted);
}

.param-pill-diff {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.param-pill-base {
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 600;
}

.default-sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.17rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--default-badge-bg);
  color: var(--default-badge-text);
  border: 1px solid var(--default-badge-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.default-sim-badge-sm {
  padding: 0.13rem 0.46rem;
  font-size: 0.68rem;
}

.default-sim-badge-xs {
  padding: 0.08rem 0.36rem;
  font-size: 0.63rem;
  letter-spacing: 0.05em;
}

.param-pill-default {
  background: var(--default-row-bg);
  border: 1px solid var(--default-badge-border);
  color: var(--cat-calibration-text);
  font-weight: 700;
}

blockquote.callout.default-sim-callout {
  border-left-color: var(--default-badge-bg);
  background: var(--default-row-bg);
}

.stage1-sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.17rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--stage1-badge-bg);
  color: var(--stage1-badge-text);
  border: 1px solid var(--stage1-badge-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14);
  line-height: 1.25;
  vertical-align: middle;
  white-space: nowrap;
}

.stage1-sim-badge-sm {
  padding: 0.13rem 0.46rem;
  font-size: 0.68rem;
}

.stage1-sim-badge-xs {
  padding: 0.08rem 0.36rem;
  font-size: 0.63rem;
  letter-spacing: 0.05em;
}

.param-pill-stage1 {
  background: var(--stage1-row-bg);
  border: 1px solid var(--stage1-badge-border);
  color: var(--cat-loop_operation-text);
  font-weight: 700;
}

blockquote.callout.stage1-sim-callout {
  border-left-color: var(--stage1-badge-bg);
  background: var(--stage1-row-bg);
}

.btn-stage1 {
  background: var(--stage1-badge-bg);
  border-color: var(--stage1-badge-border);
  color: var(--stage1-badge-text);
}

.btn-stage1:hover {
  filter: brightness(1.08);
  color: var(--stage1-badge-text);
  border-color: var(--stage1-badge-border);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.kpi-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kpi-value {
  font-size: 1.26rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  margin: 0.18rem 0;
}
.kpi-sub { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.subpage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}

.subpage-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 1.02rem;
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.subpage-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.subpage-card h3 { margin: 0 0 0.35rem; font-size: 1.02rem; color: var(--accent); }
.subpage-card p { margin: 0; font-size: 0.84rem; color: var(--muted); }
.subpage-cta { margin-top: 0.65rem; font-size: 0.82rem; font-weight: 600; color: var(--accent); }

.chip-btn,
.btn-sm {
  padding: 0.28rem 0.62rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.chip-btn:hover,
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

.chip-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn {
  display: inline-block;
  padding: 0.36rem 0.76rem;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--surface-alt); color: var(--accent); }

.toc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  margin: 0.75rem 0 1.25rem;
  font-size: 0.8rem;
}

.toc-label { font-weight: 700; color: var(--muted); margin-right: 0.25rem; }

.toc-chip {
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.toc-chip:hover { border-color: var(--accent); color: var(--accent); }

.figure-stack,
.figure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  margin: 1rem 0 1.4rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
  margin: 0.85rem 0 1.35rem;
}

figure.report-figure {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-alt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

figure.report-figure:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

figure.report-figure a.lightbox-trigger {
  display: block;
  position: relative;
}

figure.report-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 82vh;
  height: auto;
  margin: 0 auto;
  border-radius: 7px;
  background: var(--surface);
  cursor: zoom-in;
  transition: filter 0.2s ease;
}

/* Optional dark-mode plot tone-mapping: softens white-background line/summary
   matplotlib figures while leaving PSF/pupil/DM/WFS colormaps untouched. */
:root[data-theme="dark"][data-dark-plots="adapt"] figure.report-figure img.is-light-plot,
:root[data-theme="dark"][data-dark-plots="adapt"] .lightbox-backdrop img.is-light-plot {
  filter: invert(0.905) hue-rotate(180deg) contrast(0.96);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-dark-plots="adapt"] figure.report-figure img.is-light-plot,
  :root:not([data-theme="light"])[data-dark-plots="adapt"] .lightbox-backdrop img.is-light-plot {
    filter: invert(0.905) hue-rotate(180deg) contrast(0.96);
  }
}

figure.report-figure video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 82vh;
  height: auto;
  margin: 0 auto;
  border-radius: 7px;
  background: #080e1a;
}

figure.report-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

.mermaid-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 1.05rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}

pre.mermaid {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  margin: 0;
  text-align: center;
}

.mermaid-wrap svg {
  max-width: 100%;
  height: auto;
}

.checklist { display: flex; flex-direction: column; gap: 0.7rem; margin: 0.8rem 0; }

.checklist-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-alt);
}

.checklist-item.done { border-color: var(--good); background: var(--good-soft); }
.checklist-item.cat-simulation { border-left: 4px solid var(--cat-simulation); }
.checklist-item.cat-calibration { border-left: 4px solid var(--cat-calibration); }
.checklist-item.cat-loop_operation { border-left: 4px solid var(--cat-loop_operation); }
.checklist-item.cat-analysis { border-left: 4px solid var(--cat-analysis); }

.checklist-hdr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  cursor: pointer;
}

.progress-track {
  width: 180px;
  height: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill { height: 100%; background: var(--good); transition: width 0.15s; }

.cat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.95rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  margin: 0.7rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-alt);
  font-size: 0.8rem;
}

.cat-legend-item { display: inline-flex; align-items: center; gap: 0.38rem; }

.cat-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.32rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.11rem 0.48rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.cat-badge.cat-simulation {
  background: var(--cat-simulation-soft);
  border-color: var(--cat-simulation-border);
  color: var(--cat-simulation-text);
}
.cat-badge.cat-simulation .cat-dot { background: var(--cat-simulation); }

.cat-badge.cat-calibration {
  background: var(--cat-calibration-soft);
  border-color: var(--cat-calibration-border);
  color: var(--cat-calibration-text);
}
.cat-badge.cat-calibration .cat-dot { background: var(--cat-calibration); }

.cat-badge.cat-loop_operation {
  background: var(--cat-loop_operation-soft);
  border-color: var(--cat-loop_operation-border);
  color: var(--cat-loop_operation-text);
}
.cat-badge.cat-loop_operation .cat-dot { background: var(--cat-loop_operation); }

.cat-badge.cat-analysis {
  background: var(--cat-analysis-soft);
  border-color: var(--cat-analysis-border);
  color: var(--cat-analysis-text);
}
.cat-badge.cat-analysis .cat-dot { background: var(--cat-analysis); }

.section-cat-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  vertical-align: middle;
  margin-left: 0.45rem;
}

/* --- Lightbox v2: Pan/Zoom, Filmstrip & Pin-to-Compare --- */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  z-index: 100;
  color: #f1f5f9;
}

.lightbox-backdrop.open { display: flex; }

.lightbox-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  padding: 0.62rem 1rem;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  flex: none;
}

.lightbox-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
  white-space: nowrap;
}

.lightbox-cap {
  font-size: 0.88rem;
  font-weight: 500;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.lb-btn {
  padding: 0.28rem 0.62rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.lb-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #60a5fa;
  color: #ffffff;
}

.lb-btn.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

.lb-zoom-readout {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  min-width: 3.1rem;
  text-align: center;
}

.lightbox-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  overflow: hidden;
  position: relative;
}

.lightbox-stage.is-compare {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .lightbox-stage.is-compare {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

.lightbox-pane {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 14, 26, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.lightbox-pane.is-zoomed {
  cursor: grab;
}

.lightbox-pane.is-dragging {
  cursor: grabbing;
}

.lightbox-pane-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.65rem;
  z-index: 4;
  padding: 0.18rem 0.56rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  max-width: calc(100% - 1.3rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

.lightbox-stage.is-compare .lightbox-pane-badge {
  display: inline-block;
}

.lightbox-pane-badge.is-pinned {
  border-color: #f59e0b;
  color: #fde68a;
}

.lightbox-pane img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.lightbox-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 2.4rem;
  height: 3.4rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.78);
  color: #f1f5f9;
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.lightbox-nav-arrow:hover {
  background: rgba(37, 99, 235, 0.88);
  border-color: #93c5fd;
}

.lightbox-nav-prev { left: 0.75rem; }
.lightbox-nav-next { right: 0.75rem; }

.lightbox-filmstrip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem 0.65rem;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.92);
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  flex: none;
}

.lightbox-filmstrip.hidden { display: none; }

.lb-thumb {
  position: relative;
  flex: none;
  width: 68px;
  height: 46px;
  padding: 2px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: rgba(30, 41, 59, 0.9);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.68;
  transition: opacity 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.lb-thumb:hover {
  opacity: 0.96;
  transform: translateY(-1px);
}

.lb-thumb.active {
  opacity: 1;
  border-color: #60a5fa;
}

.lb-thumb.pinned {
  opacity: 1;
  border-color: #f59e0b;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  background: #ffffff;
  display: block;
}

.lb-thumb-tag {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0 0.24rem;
  border-radius: 3px;
  background: #f59e0b;
  color: #0f172a;
}

.lightbox-hint-bar {
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 0 1rem 0.42rem;
  background: rgba(15, 23, 42, 0.92);
  flex: none;
}
