@import url("./control-primitives.css");
:root {
  --ink: #171a2b;
  --muted: #777987;
  --purple: #7851ed;
  --line: #eae9f0;
  --paper: #faf9fc;
  --soft: #f0ecfd;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    sans-serif;
  color: var(--ink);
  background: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  color: inherit;
  background: white;
  font-size: 12px;
}
button:hover {
  border-color: var(--purple);
  color: var(--purple);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.selected,
.primary {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}
a {
  color: inherit;
  text-decoration: none;
}
header {
  height: 90px;
  margin: 0 5.5%;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 50px;
}
.brand {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -1.8px;
}
.brand span {
  color: var(--purple);
}
nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
nav .active {
  color: var(--purple);
}
.quiet {
  border-color: transparent;
  background: transparent;
}
main {
  margin: 0 5.5%;
}
.intro {
  padding: 68px 0 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--purple);
  font-weight: 650;
}
.intro h1 {
  font-size: 50px;
  line-height: 1.32;
  letter-spacing: -2px;
  font-weight: 650;
  margin: 24px 0;
}
.intro h1 span {
  color: var(--purple);
}
.lede {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
}
.intro-aside {
  width: 280px;
  text-align: right;
  padding-right: 20px;
}
.orb {
  display: block;
  font-size: 126px;
  font-weight: 300;
  color: var(--purple);
  line-height: 1.2;
}
.intro-aside p {
  font-size: 13px;
  letter-spacing: 3px;
  line-height: 1.5;
}
.intro-aside small {
  font-size: 11px;
  color: var(--muted);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
h2 {
  font-size: 19px;
  font-weight: 650;
}
h2 small {
  font-size: 12px;
  color: var(--muted);
  margin-left: 9px;
  font-weight: 400;
}
.admin-tools {
  display: flex;
  gap: 7px;
  align-items: center;
}
.draft-note {
  font-size: 11px;
  color: #987042;
}
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 27px;
  gap: 14px;
}
.filters button {
  border: 0;
  border-radius: 20px;
  background: transparent;
  padding: 8px 16px;
  color: var(--muted);
}
.filters button.selected {
  background: var(--soft);
  color: var(--purple);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: var(--ink);
}
#search {
  width: 245px;
  font-size: 12px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  display: block;
  transition: transform 0.2s;
  background: #fff;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px #27203708;
}
.card-art {
  aspect-ratio: 2 / 1;
  background: linear-gradient(135deg, #f4f1fc, #eceaf4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card:nth-child(3n + 2) .card-art {
  background: linear-gradient(135deg, #edf4f0, #e3eee9);
}
.card:nth-child(3n + 3) .card-art {
  background: linear-gradient(135deg, #f6f1e9, #eee8de);
}
.card-art svg {
  width: 108px;
  height: 100px;
  stroke: #8d82b0;
  fill: #ffffff90;
  stroke-width: 1;
  transform: rotate(-5deg);
}
.card:nth-child(3n + 2) svg {
  stroke: #809e91;
}
.card:nth-child(3n + 3) svg {
  stroke: #ab9779;
}
.card-art .index {
  position: absolute;
  top: 17px;
  left: 18px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #94909f;
}
.card-art .type {
  position: absolute;
  bottom: 15px;
  left: 18px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #777;
}
.card-art .badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ffffffb0;
  border-radius: 20px;
  padding: 5px 8px;
  font-size: 9px;
  color: #777;
}
.card-body {
  padding: 19px;
}
.card h3 {
  font-size: 14px;
  margin: 0 0 11px;
  line-height: 1.5;
}
.card-meta {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.card .arrow {
  color: var(--purple);
}
footer {
  margin: 65px 5.5% 0;
  border-top: 1px solid var(--line);
  padding: 25px 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
footer nav {
  margin-left: auto;
  flex-wrap: wrap;
  gap: 18px;
}
#empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border-radius: 12px;
}
.detail-top {
  margin: 20px 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 11px;
  color: var(--muted);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  margin: 0 3%;
  gap: 27px;
}
.stage-wrap {
  position: relative;
  height: calc(100vh - 182px);
  min-height: 480px;
  background: #eeedf2;
  border-radius: 14px;
  overflow: hidden;
}
.stage-wrap:fullscreen {
  height: 100vh;
  border-radius: 0;
}
#stage {
  position: absolute;
  inset: 0;
}
#stage canvas,
#stage iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.stage-label {
  position: absolute;
  left: 20px;
  top: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  pointer-events: none;
  gap: 20px;
}
.stage-label span {
  background: #ffffffe6;
  padding: 7px 10px;
  border-radius: 20px;
  max-width: 70%;
}
.stage-bottom {
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: #fffffff0;
  padding: 5px;
  gap: 4px;
  border-radius: 11px;
  box-shadow: 0 4px 20px #0001;
}
.stage-bottom button {
  border: 0;
  white-space: nowrap;
  padding: 8px 12px;
}
#help {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #686579;
  pointer-events: none;
}
.inspector {
  padding: 6px 0;
  max-height: calc(100vh - 180px);
  overflow: auto;
}
.inspector h2 {
  font-size: 23px;
  line-height: 1.5;
  margin: 16px 0;
}
.inspector > p:not(.eyebrow) {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.inspector section {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 20px;
}
h3 {
  font-size: 12px;
  font-weight: 650;
  margin: 0 0 13px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta span {
  font-size: 10px;
  background: var(--paper);
  padding: 5px 8px;
  border-radius: 5px;
}
.camera-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.camera-list button {
  font-size: 11px;
}
.small {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}
#models {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#models button {
  font-size: 10px;
}
#models label {
  font-size: 11px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
#notice {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 12px;
  max-width: 80vw;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 27px;
  width: min(680px, 90vw);
  box-shadow: 0 30px 100px #171a2b22;
  color: var(--ink);
}
dialog::backdrop {
  background: #171a2b66;
}
dialog p,
dialog label {
  font-size: 13px;
  line-height: 1.8;
}
textarea {
  width: 100%;
  font-family: monospace;
  font-size: 12px;
  margin-top: 10px;
}
.error {
  color: #af4444;
  min-height: 18px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  header {
    gap: 20px;
    height: 72px;
  }
  .brand {
    font-size: 23px;
  }
  nav {
    gap: 15px;
    font-size: 10px;
  }
  .intro {
    padding: 40px 0;
  }
  .intro h1 {
    font-size: 38px;
  }
  .intro-aside {
    width: 150px;
  }
  .orb {
    font-size: 95px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .inspector {
    max-height: none;
  }
  .stage-wrap {
    height: 60vh;
  }
  .filters {
    align-items: stretch;
    flex-direction: column;
  }
  .draft-note {
    display: none;
  }
}
@media (max-width: 520px) {
  header nav a:not(.active) {
    display: none;
  }
  header {
    margin: 0 5%;
  }
  .intro-aside {
    display: none;
  }
  .intro h1 {
    font-size: 37px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .filters #filters {
    display: flex;
    overflow: auto;
    white-space: nowrap;
  }
  .filters button {
    padding: 8px 11px;
  }
  #search {
    width: 100%;
  }
  .stage-wrap {
    min-height: 420px;
  }
  .stage-bottom button {
    padding: 7px 9px;
  }
  footer span:nth-child(2) {
    display: none;
  }
  .detail-top {
    flex-wrap: wrap;
  }
}
.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 420ms cubic-bezier(.2,.75,.25,1);
}
.cover-image.cover-ready { opacity: 1; }
.cover-image.cover-ready ~ svg {
  display: none;
}
.card-art:has(.cover-image) .type {
  background: #ffffffdd;
  padding: 4px 7px;
  border-radius: 4px;
}
.card-art .index,
.card-art .badge {
  z-index: 1;
}
#metadata-form label {
  display: block;
  margin: 15px 0;
}
#metadata-form input,
#metadata-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
}
#tour-select {
  width: 100%;
  font-size: 11px;
  margin-bottom: 10px;
}
.stage-wrap.native .stage-bottom,
.stage-wrap.native #help {
  display: none;
}
.stage-wrap.native .stage-label {
  top: 8px;
  left: 8px;
  right: 8px;
  opacity: 0.75;
}
.stage-wrap.native .stage-label span {
  font-size: 9px;
  padding: 4px 6px;
}
.reference-input {
  display: flex;
  gap: 8px;
  margin: 10px 0 22px;
}
.reference-input input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
details summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  margin: 12px 0;
}
.model-pane {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.stage-wrap.comparing {
  display: grid;
  grid-template-columns: minmax(240px, 42%) minmax(0, 1fr);
}
#photo-panel {
  background: #faf9fc;
  padding: 20px;
  overflow: auto;
  border-right: 1px solid #e1dfeb;
}
#photo-panel h3 {
  margin: 0;
  font-size: 14px;
}
.photo-frame {
  height: 55%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
}
.photo-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#photo-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
#photo-label {
  font-weight: 600;
}
#photo-panel.enlarged {
  position: absolute;
  inset: 0;
  z-index: 20;
}
#photo-panel.enlarged .photo-frame {
  height: 70%;
}
#compare.selected {
  background: #7754df;
  color: #fff;
}
@media (max-width: 760px) {
  .stage-wrap.comparing {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .stage-wrap.comparing #photo-panel {
    height: 450px;
    border-right: 0;
    border-bottom: 1px solid #e1dfeb;
  }
  .stage-wrap.comparing .model-pane {
    height: 480px;
    flex: none;
  }
  .stage-wrap.comparing #photo-panel.enlarged {
    position: fixed;
    inset: 0;
    height: 100dvh;
  }
}
.photo-editor-row {
  border: 1px solid #e3e0eb;
  border-radius: 12px;
  margin: 16px 0;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.photo-editor-row label {
  margin: 0;
  min-width: 0;
}
.photo-editor-row input:not([type="checkbox"]),
.photo-editor-row select {
  width: 100%;
}
.photo-row-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}
@media (max-width: 520px) {
  .photo-editor-row {
    grid-template-columns: 1fr;
  }
}
#history-version {
  width: 100%;
  max-width: 100%;
  margin-bottom: 12px;
}

/* A compact identity strip keeps the collection in the first viewport. */
#gallery { margin-inline: 3.5%; }
#gallery .intro { padding: 16px 0; gap: 16px; border-bottom: 1px solid var(--line); justify-content: flex-start; }
#gallery .orb { font-size: 60px; line-height: 1; flex-shrink: 0; }
#gallery .intro-copy { display: grid; grid-template-columns: auto auto; column-gap: 20px; align-items: baseline; }
#gallery .intro .eyebrow { margin: 0 0 5px; grid-column: 1 / -1; }
#gallery .intro h1 { font-size: 24px; line-height: 1.3; letter-spacing: -.7px; margin: 0; }
#gallery .lede { margin: 0; font-size: 12px; line-height: 1.6; }
#gallery .intro-aside { width: auto; flex-shrink: 0; padding: 0; margin-left: auto; display: flex; align-items: center; gap: 18px; }
#gallery .intro-aside .orb { order: 2; }
#gallery .intro-aside small { font-size: 12px; }
#gallery .collection > .section-head { margin-top: 10px; }
#gallery .collection h2 { margin: 8px 0; font-size: 17px; }
#gallery .filters { margin: 6px 0 14px; }
#gallery .cards { gap: 20px 18px; }
#gallery .card-art { height: auto; aspect-ratio: 2 / 1; }
#gallery .card-body { padding: 15px 16px; }
@media (min-width: 1200px) {
  #gallery .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #gallery .collection { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; padding-top: 12px; }
  #gallery .collection > .section-head { display: contents; }
  #gallery .collection h2 { grid-column: 1; grid-row: 1; align-self: center; }
  #gallery .admin-tools { grid-column: 2; grid-row: 1; }
  #gallery .draft-note { display: none; }
  #gallery .filters { grid-column: 1; grid-row: 1; margin: 0; }
  #gallery #filters { white-space: nowrap; }
  #gallery .filters button { padding-inline: 12px; }
  #gallery #search { width: 210px; }
  #gallery .cards, #gallery #empty { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  #gallery .intro-copy { display: block; }
  #gallery .lede { margin-top: 5px; }
  #gallery .intro-aside small { display: none; }
}
@media (max-width: 520px) {
  #gallery { margin-inline: 5%; }
  #gallery .orb { font-size: 42px; }
  #gallery .intro { gap: 12px; }
  #gallery .intro h1 { font-size: 20px; }
  #gallery .collection > .section-head { flex-wrap: wrap; gap: 4px; }
  #gallery .filters { margin-top: 10px; }
}

#gallery .filters button { font-size: 11px; padding: 6px 10px; border-radius: 6px; }
#gallery .filters button.selected { background: #f5f3fa; color: #705e9d; }
@media (min-width: 851px) {
  #gallery .filters { flex-direction: row; align-items: center; }
}
@media (max-width: 520px) {
  #gallery .intro-aside { display: flex; }
}

/* Catalog controls stay outside the independently scrolling results. */
html { scrollbar-gutter: stable; }
body.gallery-view { min-height: 100dvh; }
#gallery .collection { display: block; padding-top: 0; }
.catalog-toolbar { position: sticky; top: 0; z-index: 5; background: #fff; padding: 12px 0; border-bottom: 1px solid var(--line); }
#gallery .catalog-toolbar > .section-head { display: flex; margin: 0; justify-content: flex-end; }
#gallery .catalog-toolbar .filters { margin: 8px 0 0; }
#gallery .filters button { font-size: 12px; min-height: 36px; color: #626473; }
#gallery .filters button.selected { color: #6547b0; }
.list-scroll { padding: 16px 0 24px; }
#gallery .cards { align-content: start; }
#catalog-sentinel { height: 1px; }
.page-status { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; color: var(--muted); font-size: 12px; }
.page-status button { font-size: 12px; }
body.gallery-view footer { margin: 0 3.5%; padding: 16px 0; gap: 14px; }
body.gallery-view footer button { font-size: 12px; }
.card { transition: border-color .15s; }
.card:hover { transform: none; box-shadow: none; border-color: #c6bbdf; }
.card-link:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
.card-meta { color: #626473; }
@media (min-width: 1200px) {
  .catalog-toolbar { display: flex; align-items: center; gap: 18px; }
  #gallery .catalog-toolbar > .section-head { order: 2; flex-shrink: 0; }
  #gallery .catalog-toolbar .filters { flex: 1; min-width: 0; margin: 0; }
}
@media (max-width: 520px) {
  body.gallery-view footer { flex-wrap: wrap; gap: 12px; }
  body.gallery-view footer > span { display: none; }
  body.gallery-view footer nav { font-size: 12px; gap: 12px; margin-left: 0; }
  #gallery .catalog-toolbar .filters { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

/* Keep card controls independent from opening the work. */
.card { cursor: pointer; position: relative; }
.card:hover, .card:focus-within { z-index: 1; }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.card-art button.badge { cursor: pointer; z-index: 2; }
.card-art button.badge:disabled { cursor: wait; opacity: .6; }

/* One interaction vocabulary for every renderer. */
.workspace { grid-template-columns:minmax(0,1fr) 344px; gap:22px; }
.inspector { min-width:0; display:flex; flex-direction:column; height:calc(100vh - 182px); min-height:480px; }
.inspector h2 { margin-bottom:8px; }
.inspector > #detail-desc { margin:0 0 12px; }
.interaction-tabs { display:grid; grid-template-columns:repeat(5,1fr); gap:2px; border-bottom:1px solid var(--line); margin-top:16px; }
.interaction-tabs button { padding:12px 3px; border:0; border-radius:0; font-size:12px; color:var(--muted); }
.interaction-tabs [aria-selected=true] { color:var(--purple); background:#f4f0ff; box-shadow:inset 0 -2px var(--purple); }
.interaction-panels { flex:1; min-height:150px; overflow:auto; padding:4px 8px 16px 0; overscroll-behavior:contain; }
.inspector .interaction-panels section { margin:0; border:0; padding:8px 0; }
.interaction-panels h3 { margin:10px 0 14px; }
#interaction-status { min-height:20px; margin-top:8px; color:var(--purple); }
.control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.control-grid > label { grid-column:1/-1; margin:2px 0; display:grid; gap:7px; font-size:12px; color:#50505c; }
.control-grid label.check-control { display:flex; align-items:center; min-height:36px; }
.control-grid input:not([type=checkbox]), .control-grid select { width:100%; min-width:0; margin:0; }
.control-grid button { min-height:38px; line-height:1.5; padding:8px; }
.control-grid button[aria-pressed=true] { background:#eee8fc; border-color:#a592d1; color:var(--purple); }
.control-grid output { float:right; font-variant-numeric:tabular-nums; color:var(--purple); }
.control-grid button:disabled { opacity:.42; cursor:not-allowed; }
.control-grid .json-control { grid-column:1/-1; }
.control-grid input[type=file] { font-size:11px; padding:8px 0; }
#export-controls { grid-template-columns:1fr; }
#object-search, #object-group { width:100%; margin:0 0 8px; }
#object-list { display:grid; gap:4px; max-height:260px; overflow:auto; overscroll-behavior:contain; }
#object-list button { text-align:left; padding:9px 10px; font-size:12px; }
#object-list button small { display:block; margin-top:4px; color:var(--muted); font-size:10px; }
#object-list [aria-pressed=true] { background:#f2edfc; border-color:#aa96d5; }
.selected-object { margin:12px 0; color:var(--purple); }
.work-notes { border-top:1px solid var(--line); padding-top:12px; margin-top:6px; font-size:11px; color:var(--muted); }
.work-notes[open] { max-height:150px; overflow:auto; }
.work-notes summary { cursor:pointer; }
.stage-wrap.native .stage-bottom { display:flex; }
.stage-wrap.native #help { display:block; }
.stage-wrap.native .stage-bottom button:disabled { display:none; }
.stage-bottom { bottom:42px; }
#help { color:#333; background:#ffffffe6; border-radius:5px; padding:4px 9px; left:50%; width:max-content; max-width:95%; transform:translateX(-50%); }
@media(max-width:1050px) { .workspace {grid-template-columns:minmax(0,1fr) 310px; gap:16px;} }
@media(max-width:780px) {
  .workspace {grid-template-columns:1fr;gap:14px;margin:0 16px;}
  .stage-wrap {height:52vh;min-height:320px;}
  .inspector {height:auto;min-height:0;}
  .interaction-panels {max-height:58vh;min-height:160px;}
  .interaction-tabs {position:sticky;top:0;background:white;z-index:2;}
  .detail-top {flex-wrap:wrap;gap:8px;margin:14px 16px;}
  .detail-top > div {display:flex;overflow-x:auto;width:100%;}
  .detail-top > div button {white-space:nowrap;}
  .stage-bottom button {padding:7px 9px;}
  #help {font-size:9px;}
}
.workspace:fullscreen {width:100vw;height:100vh;margin:0;padding:16px;background:white;box-sizing:border-box;}
.workspace:fullscreen .stage-wrap,.workspace:fullscreen .inspector {height:calc(100vh - 32px);}
@media(max-width:780px){.workspace:fullscreen{overflow:auto;display:block}.workspace:fullscreen .stage-wrap{height:55vh}.workspace:fullscreen .inspector{height:auto}}

.workspace .stage-wrap,.workspace .inspector {height:calc(100vh - 128px);}
.inspector {max-height:none;overflow:hidden;}
.inspector > .eyebrow {margin:2px 0 4px;}
.inspector h2 {font-size:22px;margin:4px 0 6px;}
.inspector > #detail-desc {margin-bottom:8px;font-size:11px;}
#interaction-status:empty {min-height:0;margin:0;}
.frame-choice {display:flex;align-items:center;gap:12px;font-size:12px;margin-bottom:12px;}
.frame-choice select {flex:1;margin:0;}
@media(max-width:780px){.workspace .stage-wrap{height:52vh}.workspace .inspector{height:auto;overflow:visible}.workspace:fullscreen .stage-wrap{height:55vh}}
.control-section {grid-column:1/-1;border:1px solid var(--line);border-radius:8px;padding:10px;font-size:12px;order:2;}
.control-section summary {cursor:pointer;color:var(--purple);font-weight:600;}
.control-section[open] > .control-grid {margin-top:12px;}
#cameras label {display:grid;gap:8px;width:100%;font-size:12px;}
#cameras select {width:100%;margin:0;}

.object-filters {display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:6px;}
.object-filters input,.object-filters select {padding:8px;font-size:11px;}
#object-list {margin-top:12px;max-height:190px;}
#object-browser .selected-object {margin:4px 0 8px;}

/* One gentle arrival per card; covers settle independently after decoding. */
.card-arriving { animation: card-arrive 480ms cubic-bezier(.2,.75,.25,1) var(--arrival-delay, 0ms) both; }
@keyframes card-arrive {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card-arriving { animation: none; }
  .cover-image { transition: none; }
}

.stage-tools {position:absolute;right:12px;bottom:12px;display:flex;align-items:center;gap:12px;padding:5px 8px;border-radius:7px;background:#ffffffd9;color:#686579;font-size:11px;z-index:3;}
.stage-tools label,.stage-tools button {display:flex;align-items:center;gap:5px;white-space:nowrap;}
.stage-tools input {margin:0;accent-color:var(--purple);width:13px;height:13px;}
.stage-tools #fullscreen {border:0;background:transparent;color:inherit;padding:3px;font-size:11px;box-shadow:none;}
.stage-tools :focus-visible {outline:2px solid var(--purple);outline-offset:3px;}
.model-pane #help {bottom:12px;left:12px;right:auto;transform:none;width:auto;max-width:calc(50% - 120px);margin:0;padding:3px 8px;background:#ffffff80;font-size:9px;text-align:left;}
.stage-bottom {
  bottom:12px;
  padding:3px;
  gap:2px;
  border:1px solid #ffffff66;
  border-radius:8px;
  background:#ffffff8f;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 2px 8px #0000000d;
}
.stage-bottom button {padding:4px 10px;min-height:24px;font-size:11px;line-height:16px;border-radius:5px;background:transparent;}
.stage-bottom button:hover {background:#ffffff70;}
.stage-bottom button.selected {background:#7954c9c7;color:#fff;}
.stage-bottom button:focus-visible {outline:2px solid var(--purple);outline-offset:2px;}
@media (max-width:600px) {
  .stage-bottom {bottom:46px;}
  .model-pane #help {display:block;max-width:calc(100% - 184px);}
}

.model-loading{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:8;display:grid;gap:12px;width:min(300px,80%);padding:20px 24px;border-radius:14px;background:rgba(255,255,255,.95);color:#292331;box-shadow:0 8px 40px #0002;text-align:center;font-size:13px;pointer-events:none}.model-loading[hidden]{display:none}.model-loading progress{width:100%;height:8px;accent-color:#8261b5}

/* Keep both catalog shells full-height; only their results scroll. */
body.gallery-view {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.gallery-view #gallery {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.gallery-view .intro,
body.gallery-view .catalog-toolbar,
body.gallery-view > footer {
  flex-shrink: 0;
}
body.gallery-view #gallery .collection {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.gallery-view .list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.work-notes .rights-notice {font-size:11px;line-height:1.5;color:var(--muted);}

/* Compact work toolbar; provenance sits beside navigation. */
#detail .detail-top {
  width:94%;max-width:1680px;margin:12px auto;
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:14px;min-height:38px;
}
#detail .detail-top button {
  min-height:32px;padding:6px 11px;font-size:11px;line-height:1.4;
  border-radius:7px;color:#676775;transition:background .15s,color .15s;
}
#detail #back {padding-inline:8px;white-space:nowrap;}
#detail #back:hover {background:#f5f3f9;color:var(--ink);}
#detail #detail-source {
  justify-self:start;max-width:280px;min-width:0;padding-left:14px;
  border-left:1px solid var(--line);overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;font-size:10px;color:#94929e;font-variant-numeric:tabular-nums;
}
#detail .detail-actions {
  display:flex;align-items:center;gap:3px;width:auto;padding:3px;
  border:1px solid #eceaf1;border-radius:11px;background:#faf9fc;
}
#detail .detail-actions button {border-color:transparent;background:transparent;white-space:nowrap;}
#detail .detail-actions button:hover {background:#efecf5;color:var(--ink);}
#detail .detail-actions a {padding:9px 13px;border:1px solid transparent;border-radius:8px;font-size:12px;color:inherit;text-decoration:none;white-space:nowrap;flex-shrink:0;}
#detail .detail-actions a:hover {background:#efecf5;color:var(--ink);}
#detail .detail-actions button[aria-pressed=true] {background:#eee8fb;color:#7052ac;}
#detail .detail-actions #publish {background:#fff;border-color:#e6e0ef;color:#7052ac;}
#detail .detail-actions #publish:hover {background:#f2ecfc;border-color:#cdbfe6;}
#detail .detail-top button:focus-visible {outline:2px solid var(--purple);outline-offset:2px;}
@media(min-width:781px) {
  #detail .workspace .stage-wrap,#detail .workspace .inspector {height:calc(100dvh - 104px);}
  #detail .workspace:fullscreen .stage-wrap,#detail .workspace:fullscreen .inspector {height:calc(100dvh - 32px);}
}
@media(max-width:900px) and (min-width:781px) {
  #detail .detail-top {gap:8px;}
  #detail #detail-source {max-width:150px;padding-left:8px;}
  #detail .detail-top button {padding-inline:8px;}
}
@media(max-width:780px) {
  #detail .detail-top {width:auto;max-width:none;margin:10px 16px 12px;grid-template-columns:auto minmax(0,1fr);gap:8px 12px;}
  #detail .detail-actions {grid-column:1/-1;max-width:100%;overflow-x:auto;scrollbar-width:thin;}
  #detail #detail-source {max-width:100%;}
  #detail .detail-actions button {flex-shrink:0;}
}

/* Shared inspector primitives: all models use the shell's visual language. */
.control-section {padding:14px;background:var(--paper);border-radius:12px;order:initial;}
.control-section summary {list-style:none;display:flex;align-items:center;justify-content:space-between;color:var(--ink);font-weight:600;}
.control-section summary::-webkit-details-marker {display:none;}
.control-section summary::after {content:'＋';color:var(--purple);}
.control-section[open] summary::after {content:'−';}
.control-section .control-grid {gap:12px;}
.control-grid .check-control {justify-content:space-between;flex-direction:row-reverse;padding:4px 0;}
.control-grid .check-control input {margin:0!important;}
.control-grid input[type=number] {border:1px solid var(--line);border-radius:10px;background:white;padding:10px 12px;}
.frame-choice .nb-select {flex:1;}
.control-section[data-section="镜头"],.control-section[data-section="天空与气候"] {order:0;}
.control-section[data-section="漫游"],.control-section[data-section="海面"] {order:1;}
.control-section[data-section="行走控制"],.control-section[data-section="画面与渲染"] {order:2;}
.control-section[data-section="无人机巡游"] {order:3;}
input[type=file]::file-selector-button {font:inherit;border:1px solid var(--line);background:var(--paper);color:var(--purple);padding:8px 12px;border-radius:8px;margin-right:10px;cursor:pointer;}
.nb-confirm {width:min(420px,calc(100vw - 32px));padding:24px;border:1px solid var(--line);border-radius:16px;color:var(--ink);}
.nb-confirm::backdrop {background:#171a2b55;backdrop-filter:blur(3px);}
.nb-confirm h3 {margin:0 0 12px;font-size:16px;}
.nb-confirm p {font-size:13px;line-height:1.7;color:var(--muted);}
.nb-confirm>div {display:flex;justify-content:flex-end;gap:8px;margin-top:20px;}

#scene-publish-dialog {max-height:calc(100dvh - 32px); box-sizing:border-box; overflow:hidden;}
#scene-publish-form {display:flex; flex-direction:column; max-height:calc(100dvh - 90px); min-height:0;}
#scene-publish-form .section-head, #scene-publish-form .dialog-actions {flex-shrink:0;}
#scene-publish-form .publication-body {min-height:0; overflow-y:auto;}
#scene-publish-form label {display:flex; align-items:flex-start; gap:10px; margin:12px 0; line-height:1.6; cursor:pointer;}
#scene-publish-form input[type=checkbox] {appearance:auto; -webkit-appearance:checkbox; flex:0 0 18px; width:18px; height:18px; min-width:18px; padding:0; margin:3px 0 0!important; border-radius:3px; accent-color:var(--purple);}
#scene-publish-form input[type=checkbox]::after {content:none;}

/* Loading remains readable without covering the center or intercepting orbit gestures. */
.model-loading{left:12px;top:48px;transform:none;width:min(300px,calc(100% - 24px));padding:10px 12px;gap:6px;text-align:left;font-size:11px;border-radius:8px;box-shadow:0 2px 12px #0001;background:#fffffff0}
.loading-track{height:4px;border-radius:4px;overflow:hidden;background:#e8e2f0}
.loading-track::before{content:'';display:block;height:100%;width:var(--progress,0%);background:#8261b5}
.loading-track.indeterminate::before{width:35%;animation:loading-sweep 1.6s ease-in-out infinite alternate}
@keyframes loading-sweep{to{transform:translateX(180%)}}
@media(prefers-reduced-motion:reduce){.loading-track.indeterminate::before{animation:none}}
#detail .detail-top{grid-template-columns:auto minmax(0,1fr) auto auto}
#detail .title-version{position:relative;display:block;overflow:visible;width:auto;min-width:0}
#detail #version-toggle{max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--paper);border:1px solid var(--line);color:var(--ink)}
#detail #scene-version-history{position:absolute;right:0;top:calc(100% + 8px);z-index:30;width:min(380px,calc(100vw - 32px));margin:0;padding:10px;background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 30px #0002;max-height:min(60dvh,520px);overflow-y:auto}
#scene-version-history[hidden]{display:none}
#scene-version-history .scene-version-list{margin:0}
@media(max-width:1000px){#detail .detail-top{grid-template-columns:auto minmax(0,1fr) auto}#detail .detail-actions{grid-column:1/-1;justify-self:end;max-width:100%;overflow-x:auto}}
@media(max-width:600px){#detail #version-toggle{max-width:140px}#detail #scene-version-history{position:fixed;top:110px;right:16px}}


.model-pane:has(.model-loading:not([hidden])) #load-status{visibility:hidden}
