:root {
  --bg: #f7f3ec;
  --paper: #fffaf1;
  --ink: #262422;
  --muted: #7b7067;
  --line: #e1d6c8;
  --coral: #e96b4c;
  --coral-dark: #b84832;
  --teal: #1f8b91;
  --blue: #4f86c7;
  --moss: #526b3f;
  --clay: #bdb4aa;
  --shadow: 0 22px 54px rgba(64, 44, 28, 0.17);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.92), transparent 34rem),
    linear-gradient(180deg, #efe8dd, var(--bg));
  color: var(--ink);
}

button {
  font: inherit;
}

.phone-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 8px;
}

.app-screen {
  width: min(100%, 430px);
  height: min(820px, calc(100svh - 16px));
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  border: 1px solid rgba(94, 77, 58, 0.2);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(246, 239, 229, 0.97)),
    var(--bg);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  max-width: 292px;
  margin: 0;
  font-size: clamp(20px, 6vw, 27px);
  line-height: 1.08;
  letter-spacing: 0;
}

.icon-button {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.status-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(225, 214, 200, 0.88);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.67);
}

.status-strip span:first-child {
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-strip strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statusCount {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #23211f;
  color: #fffaf1;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  align-content: center;
  gap: 8px;
}

.artwork-card,
.space-stage,
.model-stage,
.archive-card {
  grid-area: 1 / 1 / 3 / 2;
  transition: opacity 320ms ease, transform 320ms ease;
}

.artwork-card {
  grid-area: 1 / 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 9px;
  border: 1px solid rgba(225, 214, 200, 0.9);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 250, 241, 0.9));
  box-shadow: 0 14px 32px rgba(66, 48, 31, 0.1);
}

.artwork {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(35svh, 340px);
  border-radius: 20px;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02) drop-shadow(0 8px 18px rgba(88, 58, 31, 0.12));
  transition: filter 280ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.structure-overlay {
  position: absolute;
  inset: 9px;
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  pointer-events: none;
}

.layer-outline {
  vector-effect: non-scaling-stroke;
  stroke-width: 2;
  stroke-dasharray: 7 9;
  opacity: 0.2;
  filter: drop-shadow(0 5px 8px rgba(20, 28, 22, 0.25));
  transition: fill 280ms ease, opacity 240ms ease, stroke-width 240ms ease;
}

.layer-outline.selected {
  opacity: 0.78;
  stroke-dasharray: none;
}

.layer-outline.active {
  opacity: 1;
  stroke-width: 3.5;
  animation: region-reveal 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.outline-trees {
  fill: rgba(82, 107, 63, 0.03);
  stroke: rgba(214, 232, 174, 0.88);
}

.outline-house {
  fill: rgba(255, 250, 241, 0.04);
  stroke: rgba(255, 251, 234, 0.92);
}

.outline-water {
  fill: rgba(31, 139, 145, 0.03);
  stroke: rgba(139, 202, 209, 0.92);
}

.outline-trees.selected { fill: rgba(105, 132, 72, 0.18); }
.outline-house.selected { fill: rgba(255, 248, 219, 0.2); }
.outline-water.selected { fill: rgba(50, 148, 157, 0.19); }

.outline-trees.active { fill: rgba(126, 158, 80, 0.31); }
.outline-house.active { fill: rgba(255, 249, 221, 0.34); }
.outline-water.active { fill: rgba(66, 168, 177, 0.3); }

.artwork-card.has-active .artwork {
  filter: saturate(0.78) brightness(0.86) contrast(1.04) drop-shadow(0 8px 18px rgba(88, 58, 31, 0.12));
  transform: scale(1.012);
}

.scan-line {
  position: absolute;
  z-index: 2;
  left: 12%;
  right: 12%;
  top: 11%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 237, 0.95), transparent);
  box-shadow: 0 0 14px rgba(255, 252, 237, 0.85);
  opacity: 0;
  pointer-events: none;
  animation: scan-artwork 2.6s 450ms ease-in-out 1;
}

.structure-point {
  position: absolute;
  z-index: 4;
  width: 112px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(255, 252, 242, 0.84);
  border-radius: 9px;
  background: rgba(247, 243, 236, 0.88);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 8px 20px rgba(36, 31, 25, 0.2);
  transform: translate(-50%, -50%) scale(1);
  transition: background 220ms ease, color 220ms ease, transform 220ms ease, border-color 220ms ease;
  backdrop-filter: blur(10px);
}

.structure-point:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.point-index {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 10px;
  font-weight: 900;
}

.point-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.point-copy b {
  font-size: 12px;
  line-height: 1.1;
}

.point-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
}

.structure-point.selected {
  border-color: rgba(226, 239, 198, 0.82);
  background: rgba(56, 72, 42, 0.93);
  color: white;
}

.structure-point.selected .point-index {
  background: #d7e8ad;
  color: #2f4025;
}

.structure-point.selected .point-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.layer-panel {
  grid-area: 2 / 1;
  min-height: 82px;
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(225, 214, 200, 0.9);
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 12px 24px rgba(66, 48, 31, 0.09);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.app-screen[data-phase="select"] .layer-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.layer-preview-wrap {
  position: relative;
  width: 84px;
  height: 70px;
}

.layer-panel img {
  width: 84px;
  height: 70px;
  border-radius: 11px;
  object-fit: contain;
  background: #f4ede4;
  mix-blend-mode: multiply;
}

.layer-preview-wrap span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(38, 36, 34, 0.84);
  color: white;
  font-size: 8px;
  font-weight: 900;
}

.layer-panel p {
  display: flex;
  gap: 7px;
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 900;
}

#layerDepth {
  color: var(--coral-dark);
}

#layerName {
  color: var(--teal);
}

.layer-panel strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.space-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(225, 214, 200, 0.9);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 250, 241, 0.92));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
}

.space-copy {
  display: grid;
  gap: 4px;
}

.space-copy strong {
  font-size: 15px;
  line-height: 1.25;
}

.space-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.depth-workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
}

.depth-axis {
  position: relative;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  padding: 8px 0;
}

.depth-axis::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16%;
  bottom: 16%;
  width: 2px;
  background: linear-gradient(180deg, var(--moss), #8a8f78, var(--teal));
  opacity: 0.38;
}

.depth-axis span {
  z-index: 1;
  display: grid;
  place-items: center;
}

.depth-axis i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #d9d4cb;
  color: #6d675f;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(40, 35, 30, 0.12);
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.depth-axis span.done i {
  background: var(--coral);
  color: white;
  transform: scale(1.08);
}

.space-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.space-layer {
  min-height: 0;
  display: grid;
  grid-template-columns: 25px 76px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(66, 48, 31, 0.08);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, background 220ms ease;
}

.layer-trees-card { margin-right: 26px; }
.layer-house-card { margin-left: 13px; margin-right: 13px; }
.layer-water-card { margin-left: 26px; }

.space-order {
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 900;
  writing-mode: vertical-rl;
}

.space-layer img {
  width: 76px;
  height: 68px;
  border-radius: 9px;
  object-fit: contain;
  background: #f4ede4;
  mix-blend-mode: multiply;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.space-layer-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.space-layer-copy strong {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.space-layer-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
}

.space-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(38, 36, 34, 0.08);
  color: transparent;
  font-size: 11px;
  font-weight: 900;
  transition: background 220ms ease, color 220ms ease;
}

.space-layer.selected {
  border-color: var(--coral);
  background: rgba(233, 107, 76, 0.1);
  transform: translateX(5px);
}

.space-layer.selected img {
  transform: scale(1.08) translateY(-2px);
}

.space-layer.selected .space-check {
  background: var(--coral);
  color: white;
}

.point-sky { left: 22%; top: 15%; }
.point-subject { left: 63%; top: 47%; }
.point-base { left: 24%; top: 82%; }

.model-stage {
  --model-progress: 0%;
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(225, 214, 200, 0.9);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(230, 224, 216, 0.18)),
    radial-gradient(circle at 50% 48%, rgba(82, 107, 63, 0.18), transparent 11rem);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
}

.model-hint {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.glb-viewer {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 390px;
  height: 48svh;
  max-height: 500px;
  --poster-color: transparent;
}

.model-loader {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 22px;
  width: min(76%, 290px);
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid rgba(225, 214, 200, 0.92);
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: 0 12px 28px rgba(45, 38, 31, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(12px);
}

.model-stage.model-loading .model-loader {
  opacity: 1;
  transform: translate(-50%, 0);
}

.model-progress-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 36, 34, 0.12);
}

.model-progress-track i {
  display: block;
  width: var(--model-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  transition: width 180ms ease;
}

.model-loader strong {
  font-size: 12px;
  line-height: 1.2;
}

.model-loader small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.model-fallback {
  display: none;
  position: absolute;
  z-index: 2;
  inset: 0;
  margin: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #e9e3d9;
}

.model-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-fallback figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: rgba(27, 28, 26, 0.82);
  color: white;
  backdrop-filter: blur(10px);
}

.model-fallback figcaption strong {
  font-size: 12px;
}

.model-fallback figcaption span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 700;
}

#modelRetry {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.model-stage.model-failed .glb-viewer {
  display: none;
}

.model-stage.model-failed .model-fallback {
  display: block;
}

.model-stage.model-failed .model-loader,
.model-stage.model-ready .model-loader {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.archive-card {
  max-height: 100%;
  overflow-y: auto;
  align-self: center;
  padding: 22px;
  border: 1px solid rgba(225, 214, 200, 0.92);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(248, 242, 232, 0.98));
  box-shadow: 0 18px 42px rgba(66, 48, 31, 0.13);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
}

.archive-code {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.archive-card h2 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1;
}

.archive-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.archive-card div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.archive-card dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.archive-card dd {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.archive-media {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.archive-media::-webkit-scrollbar {
  display: none;
}

.archive-media img {
  flex: 0 0 46%;
  width: 46%;
  aspect-ratio: 1 / 0.78;
  border: 1px solid var(--line);
  border-radius: 14px;
  object-fit: cover;
}

.product-styles {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.product-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.product-heading strong {
  font-size: 15px;
  font-weight: 900;
}

.product-heading span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

#packPreview {
  display: block;
  width: 100%;
  aspect-ratio: 1.34 / 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  object-fit: contain;
  background: #eee6da;
  opacity: 1;
  transition: opacity 160ms ease;
}

#packPreview:not([src]) {
  background: linear-gradient(110deg, #eee6da 30%, #f8f3ea 50%, #eee6da 70%);
  background-size: 220% 100%;
  animation: pack-loading 1.4s ease-in-out infinite;
}

#packPreview.switching {
  opacity: 0.46;
}

@keyframes pack-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.pack-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.pack-tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pack-tab.active {
  border-color: var(--coral);
  background: rgba(233, 107, 76, 0.12);
  color: var(--coral-dark);
}

.app-screen[data-phase="layers"] .artwork-card,
.app-screen[data-phase="layers"] .layer-panel,
.app-screen[data-phase="model"] .artwork-card,
.app-screen[data-phase="model"] .layer-panel,
.app-screen[data-phase="archive"] .artwork-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px) scale(0.96);
}

.space-stage,
.model-stage,
.archive-card {
  display: none;
}

.app-screen[data-phase="layers"] .space-stage,
.app-screen[data-phase="model"] .model-stage {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.app-screen[data-phase="archive"] .archive-card {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.step {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.step span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(38, 36, 34, 0.08);
}

.step.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}

.step.active span,
.step.done span {
  background: var(--coral);
  color: white;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.primary-action,
.secondary-action,
.tertiary-action {
  width: 100%;
  border: 0;
  border-radius: 17px;
  font-weight: 900;
}

.primary-action {
  grid-column: 1 / -1;
  min-height: 54px;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 24px rgba(38, 36, 34, 0.18);
}

.primary-action:disabled {
  background: #8f8981;
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  cursor: not-allowed;
}

button:focus-visible {
  outline: 3px solid rgba(31, 139, 145, 0.4);
  outline-offset: 2px;
}

.secondary-action,
.tertiary-action {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--teal);
  font-size: 13px;
}

.tertiary-action[hidden] {
  display: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(233, 107, 76, 0.34), 0 8px 18px rgba(129, 59, 42, 0.24); }
  70% { box-shadow: 0 0 0 13px rgba(233, 107, 76, 0), 0 8px 18px rgba(129, 59, 42, 0.24); }
  100% { box-shadow: 0 0 0 0 rgba(233, 107, 76, 0), 0 8px 18px rgba(129, 59, 42, 0.24); }
}

@keyframes scan-artwork {
  0% { top: 11%; opacity: 0; }
  14% { opacity: 0.9; }
  78% { opacity: 0.7; }
  100% { top: 89%; opacity: 0; }
}

@keyframes region-reveal {
  0% { opacity: 0.1; stroke-dasharray: 2 16; }
  100% { opacity: 1; stroke-dasharray: none; }
}

@media (max-height: 720px) {
  .app-screen {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 10px;
    border-radius: 22px;
  }

  h1 {
    font-size: 20px;
  }

  .artwork {
    max-height: 31svh;
  }

  .app-screen[data-phase="select"] .artwork-card.has-active {
    height: 330px;
    align-self: start;
  }

  .app-screen[data-phase="select"] .stage {
    grid-template-rows: 330px 70px;
  }

  .layer-panel {
    min-height: 70px;
    grid-template-columns: 70px 1fr;
  }

  .layer-preview-wrap,
  .layer-panel img {
    width: 70px;
    height: 58px;
  }

  .space-layer {
    grid-template-columns: 22px 64px minmax(0, 1fr) 20px;
  }

  .space-layer img {
    width: 64px;
    height: 56px;
  }

  .model-stage {
    min-height: 338px;
  }

  .glb-viewer {
    min-height: 320px;
    height: 42svh;
  }

  .archive-card {
    padding: 16px;
  }

  .archive-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
  }
}

@media (max-width: 370px) {
  .app-screen {
    padding-left: 10px;
    padding-right: 10px;
  }

  .structure-point {
    width: 101px;
    gap: 6px;
    padding-right: 6px;
  }

  .space-layer-copy small {
    display: none;
  }
}

@media (min-width: 620px) {
  .app-screen {
    height: min(820px, calc(100svh - 16px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
