*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #080d14;
  --bg-elevated: rgba(14, 22, 34, 0.84);
  --surface: rgba(18, 28, 42, 0.76);
  --surface-hover: rgba(25, 39, 58, 0.92);
  --border: rgba(145, 224, 240, 0.16);
  --border-strong: rgba(145, 224, 240, 0.38);
  --text: #eef5fa;
  --muted: #8fa9bc;
  --accent: #5ad8dc;
  --accent-soft: rgba(90, 216, 220, 0.16);
  --amber: #f5d89a;
  --amber-soft: rgba(245, 216, 154, 0.16);
  --green: #6ee7b7;
  --green-soft: rgba(110, 231, 183, 0.14);
  --red: #fca5a5;
  --red-soft: rgba(252, 165, 165, 0.15);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background:
    radial-gradient(circle at 14% 10%, rgba(45, 165, 178, 0.14), transparent 38%),
    radial-gradient(circle at 86% 14%, rgba(236, 185, 110, 0.09), transparent 36%),
    radial-gradient(circle at 50% 94%, rgba(56, 118, 175, 0.12), transparent 48%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.studio-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Top Bar */
.topbar {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(10, 16, 25, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 20;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(90, 216, 220, 0.9);
  flex-shrink: 0;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f6fbff;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 650px;
}

.search-input {
  flex: 1;
  min-width: 140px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--accent-soft);
  color: #b4f7fa;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-rw {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(110, 231, 183, 0.32);
}

.pill-ro {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 216, 154, 0.34);
}

.pill-pass {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(110, 231, 183, 0.3);
}

.pill-warn {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 216, 154, 0.35);
}

.pill-fail {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(252, 165, 165, 0.35);
}

.pill-info {
  background: var(--accent-soft);
  color: #a8f5f7;
  border: 1px solid rgba(90, 216, 220, 0.32);
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e4f0f8;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-strong);
}

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

.btn-primary {
  background: rgba(90, 216, 220, 0.2);
  border-color: rgba(90, 216, 220, 0.45);
  color: #bdf9fc;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: rgba(90, 216, 220, 0.32);
  color: #ffffff;
}

.btn-amber {
  background: rgba(245, 216, 154, 0.18);
  border-color: rgba(245, 216, 154, 0.42);
  color: #fde9ba;
  font-weight: 600;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 7px;
}

/* Fallback Banner */
.banner-ro {
  padding: 7px 16px;
  background: rgba(245, 216, 154, 0.12);
  border-bottom: 1px solid rgba(245, 216, 154, 0.28);
  color: #fbe4ae;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.banner-ro.visible {
  display: flex;
}

.banner-ro code {
  font-family: var(--mono);
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
}

.hot-toast {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(90, 216, 220, 0.2);
  border: 1px solid var(--accent);
  color: #c2fbfd;
  font-size: 11.5px;
  cursor: pointer;
}

.hot-toast.visible {
  display: inline-flex;
}

/* Main 3-Column Workspace */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 390px;
  min-height: 0;
  overflow: hidden;
}

/* Left Rail */
.left-rail {
  border-right: 1px solid var(--border);
  background: rgba(10, 17, 27, 0.72);
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-group-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f8ca1;
  padding: 0 8px 6px;
}

.rail-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #c5d9e7;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.rail-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rail-item.active {
  background: var(--accent-soft);
  border-color: rgba(90, 216, 220, 0.35);
  color: #b8f9fb;
  font-weight: 600;
}

.rail-count {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #9eb7c9;
}

.rail-upload {
  margin-top: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(145, 224, 240, 0.32);
  background: rgba(90, 216, 220, 0.05);
  text-align: center;
  font-size: 11.5px;
  color: #a6edf2;
  cursor: pointer;
}

.rail-upload:hover {
  background: rgba(90, 216, 220, 0.12);
}

.rail-upload input {
  display: none;
}

/* Center Pane */
.center-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.gallery-view {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
}

.section-title {
  font-size: 14.5px;
  font-weight: 650;
  color: #e4f2fa;
  margin: 0;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.asset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.asset-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(90, 216, 220, 0.4), 0 12px 26px rgba(0, 0, 0, 0.36);
}

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

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  color: #f4faff;
  word-break: break-word;
}

.card-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.48;
  color: var(--muted);
}

.mono-line {
  font-family: var(--mono);
  font-size: 11px;
  color: #88a4b8;
  word-break: break-all;
}

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

.chip {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c7dae7;
}

.shot-thumb {
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: 10px;
  background: #0d1420;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 3D Viewer Stage */
.viewer-stage {
  position: relative;
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: #101722;
}

.viewer-stage.active {
  display: flex;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(12, 19, 30, 0.88);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}

.viewer-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.viewer-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.viewer-canvas-host {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.viewer-canvas-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.compare-pane {
  width: 44%;
  border-left: 1px solid var(--border);
  background: rgba(10, 15, 23, 0.94);
  display: none;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.compare-pane.visible {
  display: flex;
}

.compare-pane img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  border-radius: 10px;
  background: #080c12;
  border: 1px solid var(--border);
}

.viewer-hud-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.viewer-floating-box {
  pointer-events: auto;
  background: rgba(12, 20, 31, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #cbe0ee;
  max-width: 360px;
}

.node-tree-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 224px;
  max-height: calc(100% - 96px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(12, 20, 31, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 10px;
  z-index: 4;
}

.node-tree-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
}

.node-item {
  border: none;
  background: transparent;
  color: #c2d7e5;
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.node-item.active {
  background: var(--accent-soft);
  color: #b4f8fa;
}

.gaze-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 240px;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(14, 28, 42, 0.86);
  border: 1px solid rgba(94, 234, 212, 0.32);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 11px;
  color: #c4f2f7;
  z-index: 4;
}

.gaze-overlay.visible {
  display: flex;
}

.loading-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 18, 28, 0.9);
  border: 1px solid var(--border-strong);
  color: #b4f7fa;
  font-size: 12.5px;
  display: none;
  z-index: 12;
}

/* Right Drawer */
.right-drawer {
  border-left: 1px solid var(--border);
  background: rgba(10, 17, 27, 0.82);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 21, 33, 0.85);
}

.drawer-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.drawer-tab.active {
  background: var(--accent-soft);
  border-color: rgba(90, 216, 220, 0.34);
  color: #bdf9fc;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-card {
  background: rgba(18, 28, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-card-title {
  font-size: 12.5px;
  font-weight: 650;
  color: #eaf5fb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: #9db7c9;
}

.input, .textarea, .select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 11, 18, 0.56);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
}

.audit-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 11.5px;
}

.code-block {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  background: rgba(5, 9, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  color: #cde9f6;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.knob-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
}

.knob-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #c2d9e8;
}

.knob-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.behavior-box {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 9px;
  background: rgba(8, 14, 22, 0.52);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.behavior-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #e6f4fb;
}

.warn-box {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 216, 154, 0.36);
  color: #fde9ba;
  font-size: 11.5px;
  line-height: 1.45;
}

.task-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 22, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Modal / Lightbox */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  flex-direction: column;
}

.modal.open {
  display: flex;
}

.modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(14, 22, 34, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #0d1420;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}

.lightbox-body img {
  max-width: 95%;
  max-height: 88vh;
  border-radius: 10px;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 196px minmax(0, 1fr) 330px;
  }
}

@media (max-width: 920px) {
  html, body {
    overflow: auto;
  }
  .studio-shell {
    height: auto;
    min-height: 100vh;
  }
  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .left-rail, .right-drawer {
    border: none;
    border-bottom: 1px solid var(--border);
  }
  .viewer-stage.active {
    min-height: 520px;
  }
}

/* Environment Builder & Dual-Camera Roaming */
.cam-mode-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(145, 224, 240, 0.24);
  gap: 2px;
}

.cam-mode-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.cam-mode-btn.active {
  background: rgba(90, 216, 220, 0.24);
  color: #c2fbfd;
}

.fps-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  z-index: 3;
}

.fps-crosshair::before,
.fps-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(145, 240, 248, 0.78);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.65);
}

.fps-crosshair::before {
  left: 6px;
  top: 0;
  width: 2px;
  height: 14px;
}

.fps-crosshair::after {
  top: 6px;
  left: 0;
  height: 2px;
  width: 14px;
}

.fps-crosshair.visible {
  display: block;
}

.xyz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.xyz-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
}

.xyz-cell .input {
  padding: 5px 6px;
  font-size: 11px;
  font-family: var(--mono);
}

.scene-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.vp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 14, 22, 0.56);
}

/* --- Asset Organization System (v2) --- */
.rail-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
  margin: 12px 6px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rail-mini-btn {
  background: rgba(76, 201, 240, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(76, 201, 240, 0.28);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  cursor: pointer;
}
.col-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.org-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
}
.org-select {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
}
.view-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  overflow: hidden;
}
.view-switcher button {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.view-switcher button.active {
  background: rgba(76, 201, 240, 0.2);
  color: #7dd3fc;
  font-weight: 600;
}

.card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 132px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.14), rgba(11, 18, 32, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-thumb-fallback {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
  text-align: center;
  padding: 8px;
}
.card-select-cb {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  accent-color: #4cc9f0;
  cursor: pointer;
  z-index: 2;
}
.naming-badge-pass {
  color: #43d9a2;
  background: rgba(67, 217, 162, 0.14);
  border: 1px solid rgba(67, 217, 162, 0.3);
}
.naming-badge-warn {
  color: #f5b841;
  background: rgba(245, 184, 65, 0.14);
  border: 1px solid rgba(245, 184, 65, 0.3);
}

/* Table View */
.gallery-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
}
.gallery-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.gallery-table th,
.gallery-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.gallery-table th {
  color: #94a3b8;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.9);
}
.gallery-table tr:hover {
  background: rgba(76, 201, 240, 0.08);
  cursor: pointer;
}

/* Kanban View */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: start;
}
.kanban-col {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 10px;
  min-height: 220px;
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.kanban-card {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.kanban-card:hover {
  border-color: rgba(76, 201, 240, 0.45);
}

/* Floating Batch Bar */
.batch-action-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(76, 201, 240, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}
.batch-action-bar.hidden,
.studio-modal.hidden {
  display: none;
}

/* Studio Modals */
.studio-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
}
.studio-modal-backdrop {
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.studio-modal-card {
  width: min(680px, 96vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  overflow: hidden;
}
.studio-modal-header,
.studio-modal-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.studio-modal-footer {
  border-bottom: none;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  justify-content: flex-end;
}
.studio-modal-body {
  padding: 14px 16px;
  overflow-y: auto;
}
.impact-row {
  padding: 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.55);
  margin-bottom: 8px;
  font-size: 12px;
}
.impact-lock-warn { color: #fca5a5; margin-top: 4px; }
.impact-ok { color: #6ee7b7; margin-top: 4px; }
.impact-warn { color: #fcd34d; margin-top: 4px; }
.impact-sync { color: #93c5fd; margin-top: 4px; }
.col-edit-row {
  display: grid;
  grid-template-columns: 36px 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.col-edit-row input[type="text"] {
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}
.completeness-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin: 6px 0;
}
.completeness-fill {
  height: 100%;
  background: linear-gradient(90deg, #4cc9f0, #43d9a2);
}
.lineage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.lineage-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 12px;
  cursor: pointer;
}
.lineage-chip:hover {
  border-color: rgba(76, 201, 240, 0.45);
}
.meta-collections-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.meta-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 11.5px;
  color: #cbd5e1;
  cursor: pointer;
}
.meta-col-chip input {
  accent-color: #4cc9f0;
  margin: 0;
}
.batch-tag-input {
  width: 140px;
}
