:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171614;
  --bg-deep: #0e0e0d;
  --panel: rgba(27, 26, 24, 0.9);
  --panel-solid: #1b1a18;
  --ink: #f0ede6;
  --muted: #b9b2a8;
  --faint: #9d978f;
  --line: rgba(232, 226, 215, 0.14);
  --line-strong: rgba(232, 226, 215, 0.28);
  --accent: #b86856;
  --accent-soft: rgba(184, 104, 86, 0.14);
  --signal: #8fa1ad;
  --pending: #c58a63;
  --topbar: linear-gradient(180deg, rgba(14, 14, 13, 0.96), rgba(14, 14, 13, 0.76));
  --body-glow: rgba(71, 68, 63, 0.62);
  --grid-line: rgba(214, 207, 195, 0.08);
  --button-surface: rgba(38, 36, 33, 0.76);
  --button-selected: rgba(63, 68, 72, 0.74);
  --glass-surface: rgba(24, 23, 21, 0.78);
  --readout-surface: rgba(14, 14, 13, 0.72);
  --loading-surface: rgba(14, 14, 13, 0.84);
  --card-surface: rgba(14, 14, 13, 0.58);
  --logo-groove: #68635c;
  --logo-shadow: rgba(0, 0, 0, 0.76);
  --logo-highlight: rgba(255, 255, 255, 0.2);
  --khaki: #d9c9a6;
  --wood: #5b4637;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
  --font-brand: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --font-data: "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 0.6875rem;
  --text-sm: 0.75rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --control-radius: 8px;
  --container-radius: 12px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ece9e2;
  --bg-deep: #d9d5cd;
  --panel: rgba(247, 244, 237, 0.92);
  --panel-solid: #f4f1ea;
  --ink: #252421;
  --muted: #5f5b54;
  --faint: #68635c;
  --line: rgba(37, 36, 33, 0.14);
  --line-strong: rgba(37, 36, 33, 0.26);
  --accent: #a65242;
  --accent-soft: rgba(166, 82, 66, 0.12);
  --signal: #536b77;
  --pending: #845237;
  --topbar: linear-gradient(180deg, rgba(247, 244, 237, 0.97), rgba(247, 244, 237, 0.82));
  --body-glow: rgba(255, 252, 244, 0.86);
  --grid-line: rgba(52, 49, 44, 0.08);
  --button-surface: rgba(255, 252, 245, 0.76);
  --button-selected: rgba(213, 218, 220, 0.78);
  --glass-surface: rgba(247, 244, 237, 0.8);
  --readout-surface: rgba(247, 244, 237, 0.74);
  --loading-surface: rgba(236, 233, 226, 0.88);
  --card-surface: rgba(255, 252, 245, 0.66);
  --logo-groove: #8e8980;
  --logo-shadow: rgba(51, 48, 43, 0.34);
  --logo-highlight: rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(78% 92% at 38% 42%, var(--body-glow), transparent 66%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: var(--font-ui);
  overflow: hidden;
  touch-action: pan-y;
  transition: color 180ms ease, background-color 180ms ease;
}

body.is-intro-active {
  overflow: hidden;
}

.brand-intro {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color: #eee9df;
  background:
    radial-gradient(circle at 50% 46%, rgba(105, 97, 84, 0.24), transparent 34%),
    radial-gradient(circle at 50% 50%, #24221e 0%, #151411 54%, #0b0b0a 100%);
  opacity: 1;
}

.brand-intro[hidden] {
  display: none;
}

.brand-intro::before,
.brand-intro::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.brand-intro::before {
  width: min(78vw, 700px);
  aspect-ratio: 1;
  border: 1px solid rgba(232, 225, 211, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 8vw rgba(232, 225, 211, 0.012),
    0 0 0 16vw rgba(232, 225, 211, 0.009);
  opacity: 0;
  transform: scale(0.72);
  animation: intro-sonar-pulse 1500ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.brand-intro::after {
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(226, 214, 194, 0.035) 49.8%,
    rgba(226, 214, 194, 0.13) 50%,
    transparent 50.4%
  );
  opacity: 0;
  transform: translateY(-48%);
  animation: intro-scan 1280ms 120ms cubic-bezier(0.36, 0, 0.18, 1) forwards;
}

.intro-grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: 0;
  background-image:
    linear-gradient(rgba(224, 216, 202, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 216, 202, 0.035) 1px, transparent 1px);
  background-position: center;
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 70%);
  animation: intro-grid-in 700ms 100ms ease-out forwards;
}

.intro-console {
  width: min(88vw, 560px);
  display: grid;
  place-items: center;
  transform: translateY(-2vh);
}

.intro-emblem {
  position: relative;
  width: clamp(100px, 13vw, 136px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.86);
  animation: intro-emblem-in 720ms 100ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.intro-emblem svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
}

.intro-logo-shadow,
.intro-logo-highlight,
.intro-logo-groove,
.intro-logo-trace {
  fill: none;
}

.intro-logo-shadow {
  stroke: rgba(0, 0, 0, 0.86);
  stroke-width: 10;
  transform: translate(-1.4px, -1.4px);
}

.intro-logo-highlight {
  stroke: rgba(255, 248, 235, 0.18);
  stroke-width: 9;
  transform: translate(1.5px, 1.6px);
}

.intro-logo-groove {
  stroke: #69635a;
  stroke-width: 7.4;
}

.intro-logo-trace {
  stroke: #d3c6ad;
  stroke-width: 1.35;
  stroke-dasharray: 255;
  stroke-dashoffset: 255;
  filter: drop-shadow(0 0 7px rgba(211, 198, 173, 0.24));
  animation: intro-logo-draw 900ms 240ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.intro-reticle {
  position: absolute;
  inset: 4%;
  border: 1px solid rgba(211, 198, 173, 0.18);
  border-radius: 50%;
  opacity: 0;
  transform: rotate(-32deg) scale(0.72);
  animation: intro-reticle-in 900ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.intro-reticle::before,
.intro-reticle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: #a79d8d;
  transform: translate(-50%, -50%);
}

.intro-reticle::before {
  width: calc(100% + 20px);
  height: 1px;
}

.intro-reticle::after {
  width: 1px;
  height: calc(100% + 20px);
}

.intro-reticle--inner {
  inset: 17%;
  border-style: dashed;
  animation-delay: 300ms;
  animation-direction: normal;
}

.intro-reticle--inner::before,
.intro-reticle--inner::after {
  display: none;
}

.intro-lockup {
  margin-top: clamp(18px, 2.8vh, 30px);
  text-align: center;
}

.intro-system-label {
  min-height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 9px;
  color: #817b72;
  font: 600 0.58rem/1 var(--font-data);
  letter-spacing: 0.24em;
  opacity: 0;
  transform: translateY(5px);
  animation: intro-meta-in 420ms 720ms ease-out forwards;
}

.intro-system-label i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a05f50;
}

.intro-wordmark {
  display: block;
  color: #eee9df;
  font: 780 clamp(4.5rem, 12vw, 8rem)/0.78 var(--font-brand);
  letter-spacing: 0.055em;
  text-indent: 0.055em;
  text-shadow:
    -1px -1px 0 rgba(255, 255, 255, 0.18),
    1px 2px 0 rgba(0, 0, 0, 0.8),
    0 16px 42px rgba(0, 0, 0, 0.38);
  clip-path: inset(0 100% 0 0);
  transform: translateY(12px);
  animation: intro-wordmark-reveal 720ms 650ms cubic-bezier(0.65, 0, 0.15, 1) forwards;
}

.intro-submark {
  margin: 15px 0 0;
  color: #b7afa3;
  font: 650 0.74rem/1 var(--font-brand);
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  opacity: 0;
  transform: translateY(6px);
  animation: intro-meta-in 420ms 1180ms ease-out forwards;
}

.intro-signal {
  width: min(72vw, 360px);
  height: 1px;
  margin-top: clamp(28px, 4vh, 44px);
  overflow: hidden;
  background: rgba(218, 208, 190, 0.11);
  opacity: 0;
  animation: intro-meta-in 200ms 1260ms linear forwards;
}

.intro-signal span {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, transparent, #b86856 18%, #d1c4ad 84%, transparent);
  transform: translateX(-104%);
  animation: intro-signal-run 620ms 1320ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.intro-status {
  margin: 10px 0 0;
  color: #777168;
  font: 600 0.6rem/1 var(--font-data);
  letter-spacing: 0.18em;
  opacity: 0;
  animation: intro-meta-in 320ms 1780ms ease-out forwards;
}

.intro-enter-prompt {
  min-width: 164px;
  min-height: 48px;
  display: grid;
  place-content: center;
  gap: 4px;
  margin-top: 24px;
  border: 1px solid rgba(232, 225, 211, 0.18);
  border-radius: 999px;
  color: #d7d0c4;
  background: rgba(20, 19, 17, 0.46);
  text-align: center;
  opacity: 0;
  transform: translateY(7px);
  animation:
    intro-meta-in 360ms 1940ms ease-out forwards,
    intro-enter-pulse 2200ms 2400ms ease-in-out infinite;
}

.intro-enter-prompt span {
  font: 650 var(--text-sm)/1 var(--font-ui);
  letter-spacing: 0.08em;
}

.intro-enter-prompt small {
  color: #777168;
  font: 600 0.56rem/1 var(--font-data);
  letter-spacing: 0.18em;
}

.intro-enter-target {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.intro-enter-target:focus-visible {
  outline-color: #d3c6ad;
  outline-offset: -5px;
}

.brand-intro.is-leaving {
  animation: intro-curtain-out 480ms cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.brand-intro.is-leaving .intro-console {
  animation: intro-content-out 300ms ease-in forwards;
}

@keyframes intro-grid-in {
  to { opacity: 1; }
}

@keyframes intro-scan {
  10% { opacity: 1; }
  80% { opacity: 0.7; }
  to { opacity: 0; transform: translateY(48%); }
}

@keyframes intro-sonar-pulse {
  20% { opacity: 0.6; }
  to { opacity: 0; transform: scale(1.18); }
}

@keyframes intro-emblem-in {
  to { opacity: 1; transform: scale(1); }
}

@keyframes intro-reticle-in {
  to { opacity: 1; transform: rotate(0deg) scale(1); }
}

@keyframes intro-logo-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes intro-wordmark-reveal {
  to { clip-path: inset(0 0 0 0); transform: translateY(0); }
}

@keyframes intro-meta-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-signal-run {
  to { transform: translateX(104%); }
}

@keyframes intro-enter-pulse {
  50% {
    border-color: rgba(232, 225, 211, 0.34);
    background: rgba(44, 41, 36, 0.58);
  }
}

@keyframes intro-content-out {
  to { opacity: 0; transform: scale(1.025); }
}

@keyframes intro-curtain-out {
  70% { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

@media (max-width: 480px) {
  .intro-console {
    transform: translateY(-1vh);
  }

  .intro-system-label {
    gap: 7px;
    letter-spacing: 0.18em;
  }

  .intro-submark {
    letter-spacing: 0.4em;
    text-indent: 0.4em;
  }

  .intro-enter-prompt {
    margin-top: 20px;
  }
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: none) and (pointer: coarse) {
  button:focus-visible {
    outline: none;
  }
}

.utility-label {
  margin: 0;
  color: var(--muted);
  font: 600 var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.12em;
}

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-lockup h1 {
  margin: 3px 0 0;
  font: 720 1.45rem/1 var(--font-ui);
  letter-spacing: -0.015em;
}

.brand-lockup .utility-label {
  font-family: var(--font-brand);
  letter-spacing: 0.16em;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  display: block;
  fill: none;
  stroke-linecap: round;
}

.logo-groove-shadow,
.logo-groove-highlight,
.logo-groove-core {
  fill: none;
}

.logo-groove-shadow {
  stroke: var(--logo-shadow);
  stroke-width: 3.2;
  transform: translate(-0.55px, -0.55px);
}

.logo-groove-highlight {
  stroke: var(--logo-highlight);
  stroke-width: 3.2;
  transform: translate(0.55px, 0.65px);
}

.logo-groove-core {
  stroke: var(--logo-groove);
  stroke-width: 2.5;
}

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

.theme-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--glass-surface);
  cursor: pointer;
  font: 600 var(--text-xs)/1 var(--font-ui);
  letter-spacing: 0.08em;
}

.theme-icon {
  width: 14px;
  height: 14px;
  display: block;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transform: rotate(-28deg);
}

.release-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 600 var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.release-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(143, 161, 173, 0.13);
}

.studio-shell {
  position: fixed;
  inset: 74px 0 0;
}

.viewer-panel,
.viewer-stage {
  position: absolute;
  inset: 0;
}

.viewer-stage::before {
  position: absolute;
  inset: 0 382px 0 0;
  content: "";
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 48% 48%, black, transparent 72%);
}

#viewer {
  position: absolute;
  inset: 0 382px 0 0;
  width: calc(100% - 382px);
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#viewer:active {
  cursor: grabbing;
}

.viewer-title-block {
  position: absolute;
  z-index: 3;
  top: 28px;
  left: 30px;
  max-width: 28rem;
  pointer-events: none;
}

.viewer-title-block h2 {
  margin: 9px 0 4px;
  font: 750 clamp(2.7rem, 5vw, 5.8rem)/0.9 var(--font-ui);
  letter-spacing: -0.055em;
}

.viewer-title-block p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  letter-spacing: 0.04em;
}

.viewer-actions {
  position: absolute;
  z-index: 4;
  top: 28px;
  right: 406px;
  display: flex;
  gap: 8px;
}

.quiet-button,
.motion-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--glass-surface);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
  font-size: var(--text-sm);
}

.button-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-icon--small {
  width: 16px;
  height: 16px;
}

.icon-close {
  display: none;
}

.immersive-toggle[aria-pressed="true"] .icon-expand {
  display: none;
}

.immersive-toggle[aria-pressed="true"] .icon-close {
  display: inline;
}

.motion-toggle.is-on {
  border-color: rgba(239, 91, 63, 0.56);
  color: #ff8b73;
  background: rgba(53, 24, 19, 0.78);
}

.motion-icon {
  height: 14px;
  display: flex;
  align-items: end;
  gap: 2px;
}

.motion-icon i {
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.motion-icon i:nth-child(2) {
  height: 13px;
}

.motion-icon i:nth-child(3) {
  height: 9px;
}

.motion-toggle.is-on .motion-icon i {
  animation: pulse-bar 0.65s ease-in-out infinite alternate;
}

.motion-toggle.is-on .motion-icon i:nth-child(2) {
  animation-delay: -0.23s;
}

.motion-toggle.is-on .motion-icon i:nth-child(3) {
  animation-delay: -0.41s;
}

@keyframes pulse-bar {
  to { transform: scaleY(0.42); }
}

.viewer-hint,
.source-mark {
  position: absolute;
  z-index: 3;
  bottom: 79px;
  margin: 0;
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.1em;
  pointer-events: none;
}

.viewer-hint {
  left: 30px;
}

.source-mark {
  right: 406px;
}

.viewer-readout {
  position: absolute;
  z-index: 3;
  right: 382px;
  bottom: 0;
  left: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--readout-surface);
  backdrop-filter: blur(12px);
}

.viewer-readout > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
}

.readout-label {
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.08em;
}

.viewer-readout strong {
  overflow: hidden;
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint-mobile,
.immersive-palette,
.mobile-control-tabs {
  display: none;
}

.loading-state {
  position: absolute;
  z-index: 10;
  inset: 0 382px 0 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--muted);
  background: var(--loading-surface);
  transition: opacity 220ms ease, visibility 220ms ease;
  font: var(--text-sm)/1 var(--font-data);
  letter-spacing: 0.1em;
}

.loading-rule {
  width: 180px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.loading-rule i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--accent);
  transition: width 180ms ease;
}

.loading-state.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-state.is-error {
  color: #ff9c88;
}

.control-panel {
  position: absolute;
  z-index: 12;
  inset: 0 0 0 auto;
  width: 382px;
  overflow: auto;
  padding: 98px 20px 20px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.control-section + .control-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-kicker {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-kicker span {
  color: var(--accent);
  font: 600 var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.12em;
}

.section-kicker strong {
  font: 680 var(--text-lg)/1 var(--font-ui);
  letter-spacing: 0;
}

.scene-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.scene-button,
.part-button,
.color-button {
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--button-surface);
  cursor: pointer;
}

.scene-button {
  min-height: 54px;
  padding: 11px 12px;
  text-align: left;
}

.scene-button span,
.scene-button small {
  display: block;
}

.scene-button span {
  font: 650 var(--text-base)/1.2 var(--font-ui);
}

.scene-button small {
  margin-top: 5px;
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.08em;
}

.scene-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.part-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.part-button {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
}

.part-button::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--part-color, var(--khaki));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.part-button-copy {
  min-width: 0;
}

.part-name,
.part-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part-name {
  font-size: var(--text-base);
  font-weight: 620;
}

.part-meta {
  margin-top: 3px;
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.05em;
}

.part-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.color-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scope-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--container-radius);
  background: var(--card-surface);
}

.scope-controls[hidden] {
  display: none;
}

.scope-controls button {
  min-height: 34px;
  border: 0;
  border-radius: var(--control-radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
}

.scope-controls button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.color-history-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.color-history-actions button {
  min-height: 38px;
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--muted);
  background: var(--button-surface);
  cursor: pointer;
  font-size: var(--text-sm);
}

.color-history-actions button:disabled {
  cursor: default;
  opacity: 0.42;
}

.color-history-actions button span {
  display: none;
}

.color-button {
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.color-slab {
  height: 44px;
  display: block;
  border-bottom: 1px solid var(--line);
}

.color-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
}

.color-name,
.color-finish {
  display: block;
}

.color-name {
  font-size: var(--text-base);
  font-weight: 650;
}

.color-finish {
  margin-top: 3px;
  color: var(--faint);
  font-size: var(--text-xs);
}

.status-tag {
  color: var(--signal);
  font-family: var(--font-data);
  font-size: var(--text-xs);
  line-height: 1;
  white-space: nowrap;
}

.status-tag--pending {
  color: var(--pending);
}

.color-button[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 3px var(--accent);
}

.palette-note {
  margin: 11px 0 0;
  color: var(--faint);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.product-nav,
.wish-sort {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-surface);
}

.product-nav button,
.wish-sort button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
}

.product-nav button[aria-pressed="true"],
.wish-sort button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--button-selected);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

#wishCountBadge {
  min-width: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--panel-solid);
  background: var(--ink);
  font: 700 0.6rem/1 var(--font-data);
}

#wishCountBadge[hidden] {
  display: none;
}

.custom-color-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--control-radius);
  background: var(--card-surface);
}

.custom-color-control label span,
.custom-color-control label strong {
  display: block;
}

.custom-color-control label span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.custom-color-control label strong {
  margin-top: 4px;
  font: 650 var(--text-sm)/1 var(--font-data);
  letter-spacing: 0.05em;
}

.custom-color-control input[type="color"] {
  width: 44px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.custom-color-control button,
.publish-wish-button,
.wish-wall-actions button,
.primary-action,
.comment-form button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--ink);
  background: var(--button-surface);
  cursor: pointer;
  font-weight: 650;
}

.publish-section p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.publish-wish-button,
.primary-action,
.wish-wall-actions > :first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8f1;
}

.publish-wish-button {
  width: 100%;
  min-height: 46px;
}

.studio-shell[hidden],
.wish-wall[hidden] {
  display: none;
}

.wish-wall {
  position: fixed;
  inset: 74px 0 0;
  overflow: auto;
  padding: 34px clamp(22px, 4vw, 64px) 64px;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(70% 90% at 15% 0%, var(--body-glow), transparent 68%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-size: 52px 52px, 52px 52px, auto, auto;
}

.wish-wall-hero {
  max-width: 1260px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 30px;
}

.wish-wall-hero h2 {
  margin: 9px 0 8px;
  font: 760 clamp(2.8rem, 6vw, 6.7rem)/0.86 var(--font-ui);
  letter-spacing: -0.065em;
}

.wish-wall-hero > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-lg);
}

.wish-wall-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
}

.color-demand-panel,
.wish-feed {
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--container-radius);
  background: var(--panel);
  backdrop-filter: blur(20px);
}

.color-demand-panel {
  margin-bottom: 18px;
}

.popular-color-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.popular-color-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--card-surface);
}

.popular-color-rank {
  color: var(--faint);
  font: 600 var(--text-xs)/1 var(--font-data);
}

.popular-color-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.popular-color-copy {
  min-width: 0;
}

.popular-color-copy strong,
.popular-color-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-color-copy strong {
  font-size: var(--text-sm);
}

.popular-color-copy small,
.popular-color-score {
  margin-top: 3px;
  color: var(--faint);
  font-size: var(--text-xs);
}

.popular-color-score {
  color: var(--accent);
  font-family: var(--font-data);
  white-space: nowrap;
}

.wish-feed-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.wish-feed-toolbar h3 {
  margin: 7px 0 0;
  font-size: 1.5rem;
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wish-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--container-radius);
  background: var(--card-surface);
  transition: border-color 160ms ease, transform 160ms ease;
}

@media (hover: hover) {
  .wish-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
  }
}

.wish-card-open {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, var(--body-glow), transparent 68%),
    var(--bg-deep);
  cursor: pointer;
}

.wish-card-visual {
  aspect-ratio: 16 / 9;
  display: block;
  padding: 12px;
}

.wish-model-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  color: var(--ink);
  filter: drop-shadow(0 13px 10px rgba(0, 0, 0, 0.14));
  shape-rendering: geometricPrecision;
}

.wish-model-runner {
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.wish-model-prop-guard {
  stroke-linecap: round;
  filter: drop-shadow(3px 4px 2px rgba(0, 0, 0, 0.12));
}

.wish-model-blade {
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-opacity: 0.18;
}

.wish-model-detail-line {
  opacity: 0.24;
}

.wish-card-copy {
  padding: 14px;
}

.wish-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.wish-card-heading h3,
.wish-card-heading p,
.wish-note {
  margin: 0;
}

.wish-card-heading h3 {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-card-heading p,
.wish-date {
  margin-top: 4px;
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
}

.wish-note {
  min-height: 2.9em;
  display: -webkit-box;
  margin-top: 11px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.like-button,
.comment-count,
.danger-action,
.comment-hide {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
}

.like-button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.wall-state,
.wall-placeholder {
  margin: 0;
  padding: 30px 12px;
  color: var(--faint);
  text-align: center;
  font-size: var(--text-sm);
}

.wish-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--ink);
  background: var(--panel-solid);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.detail-dialog {
  width: min(760px, calc(100vw - 28px));
}

.wish-dialog::backdrop {
  background: rgba(8, 8, 7, 0.72);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  max-height: min(88vh, 820px);
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 20px;
  overflow: auto;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-header h2 {
  margin: 7px 0 0;
  font-size: 1.6rem;
}

.dialog-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--button-surface);
  cursor: pointer;
  font-size: 1.4rem;
}

.publish-preview,
.detail-model-preview {
  height: 210px;
  padding: 8px 24px;
  border: 1px solid var(--line);
  border-radius: var(--container-radius);
  background:
    radial-gradient(circle at 50% 48%, var(--body-glow), transparent 68%),
    var(--bg-deep);
}

.field-label {
  display: grid;
  gap: 7px;
}

.field-label > span {
  font-size: var(--text-sm);
  font-weight: 650;
}

.field-label small {
  color: var(--faint);
  font-weight: 400;
}

.field-label input,
.field-label textarea,
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--ink);
  background: var(--button-surface);
  font: var(--text-base)/1.5 var(--font-ui);
  resize: vertical;
}

.field-label input:focus,
.field-label textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-message {
  min-height: 1.2em;
  margin: 0;
  color: #ff9c88;
  font-size: var(--text-sm);
}

.dialog-actions,
.wish-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions button {
  min-width: 96px;
}

.detail-copy {
  padding: 0 2px;
}

.detail-author,
.detail-note {
  margin: 0;
}

.detail-author {
  color: var(--faint);
  font: var(--text-xs)/1.4 var(--font-data);
}

.detail-note {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.danger-action,
.comment-hide {
  border-color: rgba(255, 114, 94, 0.35);
  color: #ff9c88;
}

.comments-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--card-surface);
}

.comment-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.comment-item strong {
  font-size: var(--text-sm);
}

.comment-item time {
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
}

.comment-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
}

.comment-hide {
  min-height: 28px;
  margin-top: 8px;
  font-size: var(--text-xs);
}

.comment-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-top: 12px;
}

.comment-form .turnstile-slot,
.comment-form .form-message {
  grid-column: 1 / -1;
}

.comment-form button {
  min-height: 43px;
}

.toast {
  position: fixed;
  z-index: 300;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  color: var(--ink);
  background: var(--panel-solid);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  font-size: var(--text-sm);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1000px) {
  .wish-grid,
  .popular-color-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .release-stamp {
    display: none;
  }
}

.selection-card {
  position: fixed;
  z-index: 15;
  top: 94px;
  right: 20px;
  width: 342px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-solid);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.selection-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.selection-chip {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(5, 13, 11, 0.16);
}

.selection-value,
.selection-note {
  margin: 0;
}

.selection-value {
  margin-top: 5px;
  font-size: var(--text-base);
  font-weight: 650;
}

.selection-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--text-sm);
}

@media (max-width: 1040px) {
  .control-panel {
    width: 340px;
  }

  #viewer,
  .viewer-stage::before,
  .loading-state {
    right: 340px;
  }

  #viewer {
    width: calc(100% - 340px);
  }

  .viewer-actions,
  .source-mark {
    right: 360px;
  }

  .viewer-readout {
    right: 340px;
  }

  .selection-card {
    width: 300px;
  }
}

@media (max-width: 820px) {
  :root {
    --mobile-topbar-height: 62px;
    --mobile-viewer-height: clamp(300px, 40svh, 360px);
  }

  body {
    overflow: auto;
  }

  .topbar {
    height: var(--mobile-topbar-height);
    padding: 0 14px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-lockup h1 {
    font-size: 1.25rem;
  }

  .release-stamp {
    padding: 7px 9px;
    font-size: var(--text-xs);
  }

  .studio-shell {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 100vh;
    padding-top: var(--mobile-topbar-height);
  }

  .viewer-panel {
    position: sticky;
    inset: auto;
    top: var(--mobile-topbar-height);
    z-index: 13;
    background:
      radial-gradient(90% 120% at 45% 48%, var(--body-glow), transparent 68%),
      linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
  }

  .viewer-stage {
    position: relative;
    inset: auto;
    height: var(--mobile-viewer-height);
    min-height: 0;
  }

  #viewer,
  .viewer-stage::before,
  .loading-state {
    inset: 0;
  }

  #viewer {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
  }

  .viewer-title-block {
    top: 16px;
    left: 14px;
  }

  .viewer-title-block .utility-label {
    display: none;
  }

  .viewer-title-block h2 {
    margin-top: 0;
    font-size: clamp(1.72rem, 8vw, 2.1rem);
  }

  .viewer-title-block p:last-child {
    display: none;
  }

  .viewer-actions {
    top: 14px;
    right: 14px;
    align-items: center;
  }

  .quiet-button,
  .motion-toggle {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0 11px;
  }

  .immersive-toggle,
  #resetView {
    width: 44px;
    display: grid;
    place-items: center;
    gap: 0;
    padding: 0;
  }

  .immersive-toggle .button-label,
  #resetView .button-label {
    display: none;
  }

  .viewer-hint,
  .source-mark {
    display: none;
  }

  .hint-desktop {
    display: none;
  }

  .hint-mobile {
    display: inline;
  }

  .viewer-readout {
    display: none;
  }

  .control-panel {
    position: relative;
    z-index: 1;
    inset: auto;
    width: 100%;
    max-height: none;
    display: grid;
    gap: 10px;
    overflow: visible;
    padding: 12px 12px calc(56px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-left: 0;
    background: var(--panel-solid);
    backdrop-filter: none;
  }

  .selection-card {
    top: calc(var(--mobile-topbar-height) + var(--mobile-viewer-height) - 60px);
    right: auto;
    left: 12px;
    width: calc(100% - 24px);
    min-height: 48px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--glass-surface);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px) saturate(120%);
  }

  .selection-chip {
    width: 32px;
    height: 32px;
  }

  .selection-card .utility-label {
    display: none;
  }

  .selection-value {
    margin-top: 0;
  }

  .selection-note {
    margin-top: 2px;
  }

  .scene-section .section-kicker {
    display: none;
  }

  .control-section,
  .control-section + .control-section {
    margin-top: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card-surface);
  }

  .scene-section {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .section-kicker {
    align-items: center;
    margin-bottom: 12px;
  }

  .section-kicker span {
    display: block;
    color: var(--faint);
    font-size: 0.625rem;
    letter-spacing: 0.14em;
  }

  .section-kicker strong {
    font-size: 0.95rem;
  }

  .scene-button {
    min-height: 44px;
    padding: 8px 12px;
    text-align: center;
  }

  .scene-button[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--button-selected);
    box-shadow: inset 0 0 0 1px var(--ink);
  }

  .scene-button small {
    display: none;
  }

  .part-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .part-button {
    min-height: 56px;
    grid-template-columns: 7px minmax(0, 1fr);
    gap: 6px;
    justify-content: center;
    padding: 8px 7px;
    border-radius: 12px;
    text-align: center;
  }

  .part-button::before {
    width: 7px;
    height: 7px;
  }

  .part-name {
    overflow: visible;
    font-size: 0.78rem;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
  }

  .part-meta {
    display: none;
  }

  .part-button[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--button-selected);
    box-shadow: inset 0 0 0 1px var(--ink);
  }

  .scope-controls {
    gap: 3px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 12px;
  }

  .scope-controls button {
    min-height: 40px;
    font-size: 0.76rem;
  }

  .scope-controls button[aria-pressed="true"] {
    background: var(--button-selected);
    box-shadow: inset 0 0 0 1px var(--ink);
  }

  .color-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .color-button {
    min-width: 0;
    border-radius: 12px;
  }

  .color-slab {
    height: 34px;
  }

  .color-copy {
    min-height: 58px;
    display: block;
    padding: 8px;
  }

  .color-name {
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .color-finish {
    display: none;
  }

  .status-tag {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    font-size: 0.58rem;
    text-overflow: ellipsis;
  }

  .color-button[aria-pressed="true"] {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
  }

  .palette-note {
    margin-top: 10px;
    font-size: 0.7rem;
    line-height: 1.5;
  }

  .color-history-actions button {
    min-height: 44px;
    width: 44px;
  }

  .scene-button,
  .part-button,
  .color-button,
  .scope-controls button {
    -webkit-tap-highlight-color: transparent;
  }

  .scene-button:active,
  .part-button:active,
  .color-button:active,
  .scope-controls button:active {
    transform: scale(0.97);
  }
}

@media (max-width: 480px) {
  .brand-lockup {
    min-width: 0;
    gap: 9px;
  }

  .brand-lockup > div {
    min-width: 0;
  }

  .brand-lockup h1 {
    font-size: 1.08rem;
  }

  .release-stamp {
    gap: 5px;
    padding: 6px 8px;
    letter-spacing: 0.08em;
  }

  .release-prefix {
    display: none;
  }

  .theme-toggle {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  #themeLabel {
    display: none;
  }

  .viewer-title-block h2 {
    font-size: 1.8rem;
  }

}

@media (max-width: 360px) {
  .brand-lockup .utility-label {
    display: none;
  }

  .brand-lockup h1 {
    font-size: 0.95rem;
    white-space: nowrap;
  }
}

body.is-immersive-open {
  position: fixed;
  top: var(--immersive-scroll-y, 0);
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

body.is-immersive-open .topbar {
  visibility: hidden;
  pointer-events: none;
}

.viewer-panel.is-immersive,
.viewer-panel:fullscreen,
.viewer-panel:-webkit-full-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(90% 110% at 48% 46%, var(--body-glow), transparent 68%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.viewer-panel.is-immersive .viewer-stage,
.viewer-panel:fullscreen .viewer-stage,
.viewer-panel:-webkit-full-screen .viewer-stage {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
}

.viewer-panel.is-immersive #viewer,
.viewer-panel.is-immersive .viewer-stage::before,
.viewer-panel.is-immersive .loading-state,
.viewer-panel:fullscreen #viewer,
.viewer-panel:fullscreen .viewer-stage::before,
.viewer-panel:fullscreen .loading-state,
.viewer-panel:-webkit-full-screen #viewer,
.viewer-panel:-webkit-full-screen .viewer-stage::before,
.viewer-panel:-webkit-full-screen .loading-state {
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewer-panel.is-immersive #viewer,
.viewer-panel:fullscreen #viewer,
.viewer-panel:-webkit-full-screen #viewer {
  touch-action: none;
}

.viewer-panel.is-immersive .viewer-actions,
.viewer-panel:fullscreen .viewer-actions,
.viewer-panel:-webkit-full-screen .viewer-actions {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  align-items: center;
  flex-direction: row;
}

.viewer-panel.is-immersive .viewer-title-block,
.viewer-panel:fullscreen .viewer-title-block,
.viewer-panel:-webkit-full-screen .viewer-title-block {
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
}

.viewer-panel.is-immersive .viewer-readout,
.viewer-panel.is-immersive .source-mark,
.viewer-panel.is-immersive .selection-card,
.viewer-panel:fullscreen .viewer-readout,
.viewer-panel:fullscreen .source-mark,
.viewer-panel:fullscreen .selection-card,
.viewer-panel:-webkit-full-screen .viewer-readout,
.viewer-panel:-webkit-full-screen .source-mark,
.viewer-panel:-webkit-full-screen .selection-card {
  display: none;
}

.viewer-panel.is-immersive .viewer-hint,
.viewer-panel:fullscreen .viewer-hint,
.viewer-panel:-webkit-full-screen .viewer-hint {
  right: 18px;
  bottom: calc(112px + env(safe-area-inset-bottom));
  left: 18px;
  max-width: none;
  text-align: center;
}

.viewer-panel.is-immersive .immersive-palette,
.viewer-panel:fullscreen .immersive-palette,
.viewer-panel:-webkit-full-screen .immersive-palette {
  position: absolute;
  z-index: 8;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(118px, 0.7fr) minmax(0, 2fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--glass-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(22px) saturate(130%);
}

.immersive-selection span,
.immersive-selection strong {
  display: block;
}

.immersive-selection span {
  color: var(--faint);
  font: var(--text-xs)/1 var(--font-data);
  letter-spacing: 0.08em;
}

.immersive-selection strong {
  margin-top: 6px;
  font-size: 0.78rem;
}

.immersive-color-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62px, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.immersive-color-controls::-webkit-scrollbar {
  display: none;
}

.immersive-color-button {
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--muted);
  background: var(--button-surface);
  cursor: pointer;
  font-size: var(--text-xs);
  white-space: nowrap;
}

.immersive-color-swatch {
  width: 28px;
  height: 28px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.immersive-color-button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

@media (max-width: 620px) {
  .viewer-panel.is-immersive .viewer-title-block,
  .viewer-panel:fullscreen .viewer-title-block,
  .viewer-panel:-webkit-full-screen .viewer-title-block {
    max-width: 44%;
  }

  .viewer-panel.is-immersive .viewer-title-block h2,
  .viewer-panel:fullscreen .viewer-title-block h2,
  .viewer-panel:-webkit-full-screen .viewer-title-block h2 {
    font-size: 2rem;
  }

  .viewer-panel.is-immersive .immersive-palette,
  .viewer-panel:fullscreen .immersive-palette,
  .viewer-panel:-webkit-full-screen .immersive-palette {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .immersive-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .immersive-selection strong {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .product-nav {
    position: static;
    padding: 3px;
    border-color: var(--line-strong);
    background: var(--panel-solid);
    box-shadow: none;
    transform: none;
  }

  .product-nav button {
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .custom-color-control {
    grid-template-columns: minmax(0, 1fr) 48px;
    border-radius: 12px;
  }

  .custom-color-control button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .publish-section {
    margin-bottom: 42px !important;
  }

  .wish-wall {
    position: relative;
    inset: auto;
    min-height: 100vh;
    overflow: visible;
    padding: calc(var(--mobile-topbar-height) + 28px) 12px 100px;
    background-size: 42px 42px, 42px 42px, auto, auto;
  }

  .wish-wall-hero {
    display: block;
    margin-bottom: 20px;
    padding: 0 3px;
  }

  .wish-wall-hero h2 {
    font-size: clamp(2.5rem, 14vw, 4.6rem);
  }

  .wish-wall-hero > div > p:last-child {
    font-size: var(--text-base);
  }

  .wish-wall-actions {
    margin-top: 18px;
    padding: 0;
  }

  .wish-wall-actions button {
    flex: 1;
  }

  .color-demand-panel,
  .wish-feed {
    padding: 14px;
    border-radius: 16px;
    backdrop-filter: none;
  }

  .popular-color-list {
    grid-template-columns: 1fr;
  }

  .wish-feed-toolbar {
    align-items: center;
  }

  .wish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-shell {
    padding: 16px;
  }

  .publish-preview,
  .detail-model-preview {
    height: 180px;
    padding: 4px 12px;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }

  .comment-form .turnstile-slot,
  .comment-form .form-message {
    grid-column: auto;
  }

  .wish-detail-actions {
    flex-wrap: wrap;
  }

  .wish-detail-actions button {
    flex: 1 1 40%;
  }

  .toast {
    right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .topbar .brand-lockup > div {
    display: none;
  }

  .topbar-actions {
    flex: 1;
    justify-content: flex-end;
  }

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

  .wish-card-visual {
    aspect-ratio: 16 / 8;
  }

  .wish-sort button {
    padding: 0 9px;
  }

  .wish-dialog {
    max-height: calc(100dvh - 16px);
  }

  .dialog-shell {
    max-height: calc(100dvh - 16px);
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-intro,
  .brand-intro::before,
  .brand-intro::after,
  .intro-grid,
  .intro-emblem,
  .intro-reticle,
  .intro-logo-trace,
  .intro-system-label,
  .intro-wordmark,
  .intro-submark,
  .intro-signal,
  .intro-signal span,
  .intro-status,
  .intro-enter-prompt {
    animation: none !important;
  }

  .brand-intro::before,
  .brand-intro::after {
    display: none;
  }

  .intro-grid {
    opacity: 0.55;
  }

  .intro-emblem,
  .intro-reticle,
  .intro-system-label,
  .intro-submark,
  .intro-signal,
  .intro-status,
  .intro-enter-prompt {
    opacity: 1;
    transform: none;
  }

  .intro-logo-trace {
    stroke-dashoffset: 0;
  }

  .intro-wordmark {
    clip-path: none;
    transform: none;
  }

  .intro-signal span {
    transform: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
