/* ==========================================================================
   GlintAir 3D Models 3-Pane Fixed-Viewport Workbench (/3d-models/)
   Inherits GlintAir tokens & .site-header from /styles.css
   ========================================================================== */

@layer components {
[hidden] {
  display: none !important;
}

.workbench-body {
  --wb-header-h: 58px;
  --wb-border: rgba(148, 163, 184, 0.14);
  --wb-border-strong: rgba(56, 189, 248, 0.34);
  --wb-panel: rgba(6, 11, 23, 0.88);
  --wb-card: rgba(12, 20, 38, 0.86);
  --wb-diff: #a78bfa;
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-obsidian, #02040b);
}

/* Compact Workbench Header */
.workbench-header {
  position: relative;
  min-block-size: var(--wb-header-h);
  block-size: var(--wb-header-h);
  flex-shrink: 0;
  padding-block: 0;
  padding-inline: 16px;
  background: rgba(3, 7, 18, 0.92);
  border-bottom: 1px solid var(--wb-border);
}

.workbench-header-inner {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wb-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wb-brand-wrap .brand {
  min-block-size: 38px;
}

.wb-brand-wrap .brand-icon {
  width: 28px;
  height: 28px;
}

.wb-brand-wrap .brand-wordmark {
  font-size: 1rem;
}

.wb-title-sep {
  color: rgba(148, 163, 184, 0.38);
  font-size: 0.95rem;
}

.wb-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sky-bright, #7dd3fc);
  white-space: nowrap;
}

.workbench-header .nav-links {
  gap: 0.2rem 1.15rem;
}

.workbench-header .nav-links a {
  min-block-size: 36px;
  font-size: 0.84rem;
}

.workbench-header .header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wb-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-status-pill.is-live {
  border-color: rgba(52, 211, 153, 0.3);
}

.wb-status-pill.is-local {
  border-color: rgba(56, 189, 248, 0.34);
}

.wb-status-pill.is-fallback {
  border-color: rgba(245, 196, 105, 0.34);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-emerald { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.dot-sky { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.6); }
.dot-gold { background: #f5c469; box-shadow: 0 0 8px rgba(245, 196, 105, 0.6); }

/* 3-Column Fixed-Viewport Workbench */
.workbench {
  flex: 1 1 0%;
  min-height: 0;
  height: calc(100dvh - var(--wb-header-h));
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 338px;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--wb-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-catalog {
  border-right: 1px solid var(--wb-border);
  overflow: hidden;
}

.panel-inspector {
  border-left: 1px solid var(--wb-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 13px;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

/* ==========================================================================
   Left Sidebar: Categories, Search, Collapsible Model List, Direct ID Load
   ========================================================================== */
.category-bar {
  display: flex;
  gap: 5px;
  padding: 9px 10px 7px;
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
}

.cat-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: 140ms ease;
}

.cat-tab:hover {
  color: var(--text-primary, #f8fafc);
  background: rgba(148, 163, 184, 0.08);
}

.cat-tab.active {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.34);
}

.cat-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.66rem;
  color: var(--text-secondary, #cbd5e1);
}

.subcategory-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--wb-border);
  background: rgba(8, 13, 25, 0.55);
  flex-shrink: 0;
}

.subcat-pill {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
  color: var(--text-muted, #94a3b8);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: 120ms ease;
}

.subcat-pill:hover {
  color: var(--text-primary, #f8fafc);
  border-color: rgba(56, 189, 248, 0.36);
}

.subcat-pill.active {
  color: #f8fafc;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.2);
}

.sidebar-search-row {
  padding: 8px 10px 6px;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 9px;
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 32px;
  padding: 5px 28px 5px 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-primary, #f8fafc);
  font-size: 0.78rem;
  outline: none;
}

.search-input:focus {
  border-color: rgba(56, 189, 248, 0.52);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary, #f8fafc);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.catalog-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px 7px;
  font-size: 0.69rem;
  color: var(--text-muted, #94a3b8);
  border-bottom: 1px solid var(--wb-border);
  flex-shrink: 0;
}

.source-badge {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.1);
  color: var(--sky-bright, #7dd3fc);
  font-size: 0.64rem;
  font-weight: 600;
}

.model-list {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.cat-group {
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 13, 25, 0.56);
  overflow: hidden;
  flex-shrink: 0;
}

.cat-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
}

.cat-group-head:hover {
  background: rgba(30, 41, 59, 0.75);
  color: #f8fafc;
}

.cat-group-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cat-group-caret {
  font-size: 0.66rem;
  color: var(--sky, #38bdf8);
  transition: transform 140ms ease;
}

.cat-group.is-collapsed .cat-group-caret {
  transform: rotate(-90deg);
}

.cat-group-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.cat-group.is-collapsed .cat-group-body {
  display: none;
}

/* Compact Sidebar Selectable Model Card */
.repo-model-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: var(--wb-card);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
  text-align: left;
}

.repo-model-card:hover {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(16, 28, 52, 0.94);
}

.repo-model-card.is-highlighted {
  border-color: rgba(56, 189, 248, 0.78);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(15, 23, 42, 0.95));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 6px 16px rgba(2, 6, 23, 0.45);
}

.card-thumb-mini {
  position: relative;
  width: 60px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: #080d19;
  border: 1px solid rgba(148, 163, 184, 0.16);
  flex-shrink: 0;
}

.card-thumb-mini img,
.card-thumb-mini .blueprint-cover,
.card-thumb-mini svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-mini-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-title-link {
  color: var(--text-primary, #f8fafc);
  font-size: 0.78rem;
  font-weight: 660;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title-link:hover {
  color: var(--sky-bright, #7dd3fc);
}

.card-icao {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--sky-bright, #7dd3fc);
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 700;
}

.card-mini-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
}

.mini-pill {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary, #cbd5e1);
}

.mini-pill.is-diff {
  background: rgba(167, 139, 250, 0.16);
  color: #ddd6fe;
}

.mini-pill.is-wt {
  background: rgba(52, 211, 153, 0.14);
  color: #a7f3d0;
}

.direct-path-form {
  flex-shrink: 0;
  padding: 7px 10px;
  border-top: 1px solid var(--wb-border);
  background: rgba(3, 7, 18, 0.86);
}

.direct-path-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.direct-path-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.82);
  color: var(--text-primary, #f8fafc);
  font-family: var(--font-mono, monospace);
  font-size: 0.71rem;
  outline: none;
}

.direct-path-input:focus {
  border-color: rgba(56, 189, 248, 0.5);
}

.direct-path-submit {
  min-block-size: 30px;
  padding: 4px 10px;
  font-size: 0.72rem;
}

.direct-path-error {
  margin: 4px 0 0;
  min-height: 0;
  font-size: 0.68rem;
  color: #fca5a5;
}

.direct-path-error:empty {
  display: none;
}

/* ==========================================================================
   Center Stage & Toolbar
   ========================================================================== */
.stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(20, 35, 66, 0.45), rgba(5, 9, 20, 0.96));
}

.stage-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--wb-border);
  background: rgba(6, 11, 23, 0.92);
}

.dock-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 16, 0.72);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: 130ms ease;
}

.dock-btn:hover:not(:disabled) {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.12);
}

.dock-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dock-btn.active {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
}

.dock-btn.dock-btn-diff.active {
  color: #ede9fe;
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.5);
}

.dock-btn.icon-btn {
  min-width: 28px;
  padding: 4px 7px;
  font-size: 0.9rem;
}

.angle-slider {
  width: 96px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.angle-readout,
.zoom-readout {
  min-width: 34px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sky-bright, #7dd3fc);
}

/* 360 Turntable Viewport */
.turntable-viewport {
  flex: 1 1 0%;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #080d19;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.turntable-viewport.is-dragging {
  cursor: grabbing;
}

.turntable-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.vp-status-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(8, 15, 32, 0.94);
  font-size: 0.82rem;
  color: var(--text-primary, #f8fafc);
}

.vp-status-card p {
  margin: 0;
}

.vp-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  animation: wb-spin 0.8s linear infinite;
}

@keyframes wb-spin {
  to { transform: rotate(360deg); }
}

.stage-hud-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 3;
}

.stage-hud-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.stage-hud-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #f8fafc;
}

.stage-mode-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--sky-bright, #7dd3fc);
  font-size: 0.67rem;
  font-weight: 600;
}

.stage-hud-hint {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.69rem;
  color: var(--text-muted, #94a3b8);
}

/* ==========================================================================
   Center Views 2 & 3: Studio & X-Ray + Photomatch Diffs Gallery Stage
   ========================================================================== */
.stage-gallery-view,
.diff-gallery-stage {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.diff-stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.diff-stage-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.diff-stage-sub {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.diff-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.stage-gallery-filters,
.diff-section-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diff-sec-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(12, 20, 38, 0.82);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: 130ms ease;
}

.diff-sec-pill:hover {
  border-color: rgba(167, 139, 250, 0.45);
  color: #f8fafc;
}

.diff-sec-pill.active {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.56);
  color: #f5f3ff;
}

.tab-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(2, 6, 16, 0.65);
  font-size: 0.66rem;
}

.diff-xray-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(8, 15, 32, 0.78);
  font-size: 0.72rem;
  color: var(--text-secondary, #cbd5e1);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.swatch-cyan { background: #22d3ee; box-shadow: 0 0 8px rgba(34, 211, 238, 0.55); }
.swatch-amber { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.55); }
.swatch-magenta { background: #e879f9; box-shadow: 0 0 8px rgba(232, 121, 249, 0.55); }
.swatch-emerald { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.55); }

.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

.diff-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(11, 18, 34, 0.92);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.diff-card:hover {
  border-color: rgba(167, 139, 250, 0.55);
  transform: translateY(-2px);
}

.diff-card-img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: #060a14;
  overflow: hidden;
}

.diff-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050914;
  display: block;
}

.diff-card-badges {
  position: absolute;
  top: 7px;
  left: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.diff-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 18, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-size: 0.63rem;
  font-weight: 600;
}

.diff-card-body {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-card-title {
  font-size: 0.79rem;
  font-weight: 660;
  color: var(--text-primary, #f8fafc);
  line-height: 1.3;
}

.diff-card-meta {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.35;
}

.diff-card-attrib {
  font-size: 0.66rem;
  color: #cbd5e1;
}

/* ==========================================================================
   Right Inspector Panel
   ========================================================================== */
.inspector-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cat-chip,
.stage-meta-chip,
.watertight-chip,
.diff-count-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
}

.chip-aircraft {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.34);
}

.chip-airports {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.34);
}

.stage-meta-chip {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.stage-meta-chip.is-mono {
  font-family: var(--font-mono, monospace);
}

.watertight-chip {
  background: rgba(52, 211, 153, 0.14);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.diff-count-chip {
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
  border: 1px solid rgba(167, 139, 250, 0.36);
}

.stage-model-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
  line-height: 1.22;
  color: var(--text-primary, #f8fafc);
}

.card-repo-path {
  font-family: var(--font-mono, monospace);
  font-size: 0.69rem;
  color: var(--sky, #38bdf8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-desc {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.48;
  color: var(--text-secondary, #cbd5e1);
}

.inspector-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 18, 35, 0.78);
}

.stage-commerce-card {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(155deg, rgba(14, 165, 233, 0.1), rgba(10, 18, 35, 0.88));
}

.inspector-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inspector-label {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #cbd5e1);
}

.inspector-desc {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted, #94a3b8);
}

.inspector-skills-note a {
  color: var(--sky-bright, #7dd3fc);
}

.store-account-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  font-size: 0.65rem;
  font-weight: 700;
}

.store-account-pill.is-owned {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.store-account-pill.is-signed-in {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
}

.stage-full-btn {
  width: 100%;
  justify-content: center;
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: 1px solid rgba(110, 231, 183, 0.4);
}

.btn-diff-accent {
  border-color: rgba(167, 139, 250, 0.38);
  color: #ede9fe;
}

.btn-diff-accent:hover {
  border-color: rgba(167, 139, 250, 0.65);
  background: rgba(167, 139, 250, 0.16);
}

.store-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.store-status-msg {
  margin: 0;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 0.7rem;
  color: #e0f2fe;
}

.store-status-msg.is-error {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.store-external-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.external-links-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.external-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ext-store-pill {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
}

.ext-store-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #f8fafc;
}

/* Photomatch Diffs 2x2 Inspector Preview */
.diff-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.diff-sec-chip {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.26);
  color: #ddd6fe;
  font-size: 0.62rem;
  font-weight: 600;
}

.diff-sec-chip.is-xray {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
}

.diff-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.diff-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #060a14;
  overflow: hidden;
  cursor: pointer;
}

.diff-thumb:hover {
  border-color: rgba(167, 139, 250, 0.58);
}

.diff-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050914;
  display: block;
}

.diff-thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 6px;
  background: linear-gradient(transparent, rgba(2, 6, 18, 0.92));
  color: #f1f5f9;
  font-size: 0.61rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.diff-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.diff-preview-actions .btn {
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  padding-block: 6px;
  padding-inline: 10px;
}

.stage-highlights-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary, #cbd5e1);
}

.stats-kv-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.kv-box {
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 16, 0.55);
  min-width: 0;
}

.kv-box.kv-wide {
  grid-column: 1 / -1;
}

.kv-k {
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
}

.kv-v {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fmt-badge {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.8);
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
}

.fmt-badge.is-selected {
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

.stage-license-card {
  background: rgba(6, 11, 22, 0.78);
}

.empty-state-card {
  padding: 18px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.26);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state-card h3 {
  margin: 0;
  font-size: 0.86rem;
}

.empty-state-card p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
}

/* ==========================================================================
   Fullscreen Attribution & Zoom Lightbox
   ========================================================================== */
.render-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: rgba(2, 5, 14, 0.96);
  backdrop-filter: blur(10px);
}

.lightbox-topbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wb-border);
  background: rgba(6, 11, 23, 0.94);
}

.lightbox-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lightbox-title-wrap strong {
  font-size: 0.9rem;
  color: #f8fafc;
}

.lightbox-counter {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
}

.lightbox-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.lightbox-xray-bar {
  flex-shrink: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.lightbox-canvas {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-img {
  border-radius: 8px;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.7);
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-img.zoom-fit {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-img.zoom-100 {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  margin: auto;
}

.lightbox-img.zoom-200 {
  max-width: none;
  max-height: none;
  width: 200%;
  height: auto;
  margin: auto;
}

.lightbox-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--wb-border);
  background: rgba(6, 11, 23, 0.94);
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
}

.lightbox-attrib a {
  color: var(--sky-bright, #7dd3fc);
  font-weight: 600;
}

/* ==========================================================================
   Responsive Stacked Workbench (< 1120px & Mobile)
   ========================================================================== */
@media (max-width: 1120px) {
  .workbench-body {
    height: auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: clip;
  }

  .workbench-header {
    height: auto;
    padding-block: 6px;
  }

  .workbench {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .stage-wrap {
    order: 1;
    min-height: 440px;
  }

  .turntable-viewport {
    min-height: 360px;
    height: 54vh;
    flex: none;
  }

  .panel-inspector {
    order: 2;
    border-left: none;
    border-top: 1px solid var(--wb-border);
    overflow-y: visible;
  }

  .panel-catalog {
    order: 3;
    max-height: 480px;
    border-right: none;
    border-top: 1px solid var(--wb-border);
  }
}

@media (max-width: 720px) {
  .workbench-header {
    padding-inline: 10px;
  }

  .wb-title-sep,
  .wb-subtitle,
  .wb-status-pill {
    display: none;
  }

  .workbench-header .nav-links {
    gap: 0.15rem 0.7rem;
  }

  .workbench-header .nav-links a {
    font-size: 0.78rem;
  }

  .turntable-viewport {
    min-height: 290px;
    height: 46vh;
  }

  .stage-hud-hint {
    display: none;
  }

  .diff-grid {
    grid-template-columns: 1fr;
  }
}
}
