/* ==========================================================================
   studio-upgrades.css — V6 Unified Architectural Studio Loft System
   Supports Gallery Daylight (Light) ↔ Obsidian Screening (Dark),
   Consistent Capsule Route Dock, and Swiss Editorial Dual-Track Index
   ========================================================================== */

.za-boot-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--acc) 55%, transparent 100%);
  transform-origin: left center;
  animation: zaBootPulse 1.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  transition: opacity 0.45s ease;
}
body.badge-entry-ready .za-boot-bar,
body.za-gate-locked .za-boot-bar {
  opacity: 0;
}
/* First-Visit Swiss Minimalist Passcode Gate */
#zaPassGate {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--studio-bg) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.42s ease;
}
#zaPassGate.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.za-gate-card {
  width: min(400px, 100%);
  padding: 32px 28px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.14);
}
.za-gate-kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--acc);
  margin-bottom: 10px;
}
.za-gate-title {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 8px;
}
.za-gate-sub {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mut);
  margin-bottom: 22px;
}
.za-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.za-gate-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--studio-bg);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.za-gate-input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent);
}
.za-gate-card.is-shake {
  animation: zaGateShake 0.36s ease;
}
@keyframes zaGateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  55% { transform: translateX(7px); }
  80% { transform: translateX(-4px); }
}
.za-gate-err {
  min-height: 18px;
  font-size: 12px;
  color: var(--acc);
  margin: 0;
}
.za-gate-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--mut);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@keyframes zaBootPulse {
  0% { transform: scaleX(0.15) translateX(-20%); opacity: 0.55; }
  55% { transform: scaleX(0.75) translateX(25%); opacity: 1; }
  100% { transform: scaleX(0.2) translateX(480%); opacity: 0; }
}
/* 1. Atmospheric subtle grain across both themes */
#badgeBackdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.032;
  background-image: radial-gradient(rgba(128, 128, 128, 0.4) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

/* 2. Borderless Swiss Editorial Top Header & Action Rail (Zero Pill Clutter!) */
.topline::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 96px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--studio-bg) 76%, transparent) 0%, color-mix(in srgb, var(--studio-bg) 34%, transparent) 55%, transparent 100%);
}
.za-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  padding: 2px 4px 2px 0;
  border: 0;
  border-radius: 0;
  min-height: 32px;
  transition: opacity 0.2s, color 0.2s;
}
.za-brand-mark:hover {
  opacity: 0.78;
}
.za-brand-seal {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--studio-bg);
  font-family: var(--f-d);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  display: grid;
  place-items: center;
  border: 0;
}
html[data-studio-theme="dark"] .za-brand-seal {
  background: linear-gradient(135deg, #e8683f 0%, #c1441f 100%);
  color: #fff;
}
.za-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.za-brand-text strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
}
.za-brand-text small {
  font-family: var(--f-d);
  font-size: 11px;
  color: var(--mut);
  letter-spacing: 0.08em;
}

.za-top-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
}

.za-top-pill {
  min-height: 30px;
  padding: 4px 2px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  backdrop-filter: none;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, border-color 0.2s;
}
.za-top-pill[hidden] {
  display: none !important;
}
.za-top-pill:hover {
  border-bottom-color: var(--acc);
  background: transparent;
  color: var(--acc);
}
.za-top-pill.accent {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
  background: transparent;
  color: var(--acc);
  font-weight: 700;
}
.za-top-pill.accent:hover {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--ink);
}
html[data-studio-theme="dark"] .za-top-pill,
html[data-studio-theme="dark"] .za-brand-mark,
html[data-studio-theme="dark"] .undock {
  color: #f3f1ea;
  background: transparent;
}
.za-lamp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
}
.za-lamp-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 3. Unified Studio Overlay (3D lanyard cleanly retracts when docked) */
body.is-room-overlay::after {
  opacity: 0 !important;
}
body.is-room-overlay #b3d {
  z-index: 8;
  pointer-events: auto !important;
}

/* Unified Architectural Bottom Route Ruler (Permanent across ALL 00..05 Stations!) */
.studio-route-dock {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 39;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--studio-bg) 74%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
}
html[data-studio-theme="dark"] .studio-route-dock {
  background: rgba(14, 16, 22, 0.84);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}
.studio-route-dock.on {
  display: inline-flex;
}
.studio-route-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: #514e47;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.18s, background-color 0.18s;
  white-space: nowrap;
}
html[data-studio-theme="dark"] .studio-route-dock .studio-route-btn {
  color: rgba(243, 241, 234, 0.74) !important;
}
html[data-studio-theme="dark"] .studio-route-dock .studio-route-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.07);
}
.studio-route-btn b {
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 700;
  opacity: 0.65;
}
.studio-route-btn:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.studio-route-btn.active {
  background: var(--ink);
  color: var(--studio-bg);
  font-weight: 600;
}
html[data-studio-theme="dark"] .studio-route-dock .studio-route-btn.active {
  background: #e8683f !important;
  color: #0b0c10 !important;
  font-weight: 700;
}
html[data-studio-theme="dark"] .studio-route-dock .studio-route-btn.active b {
  color: #0b0c10 !important;
  opacity: 1;
}
.studio-route-btn.active b {
  opacity: 1;
}
.studio-route-sep {
  width: 8px;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
}
body.is-fullscreen .studio-route-dock {
  display: none !important;
}

/* Fullscreen 3D Brand & Packaging Loft Host */
.pack-showroom-host,
.brand-room-host {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 4;
  overflow: hidden;
  background: var(--studio-bg);
  transition: background-color 0.45s ease;
}
.pack-showroom-host.is-inspecting,
.brand-room-host.is-inspecting {
  z-index: 40;
}
.brand-room-host.is-shared-canvas {
  background: transparent !important;
  pointer-events: none !important;
  z-index: 34;
}
.brand-room-host.is-shared-canvas .brand-rm-canvas {
  display: none !important;
}
.brand-room-host.is-shared-canvas .brand-rm-bar,
.brand-room-host.is-shared-canvas .pack-sr-editor-dock,
.brand-room-host.is-shared-canvas .brand-rm-inspect.open {
  pointer-events: auto;
}
.pack-showroom-host[hidden],
.brand-room-host[hidden] {
  display: none !important;
}
.pack-sr-canvas,
.brand-rm-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.pack-sr-canvas:active,
.brand-rm-canvas:active {
  cursor: grabbing;
}
.pack-sr-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  pointer-events: none !important;
}
.pack-sr-loading[hidden] {
  display: none !important;
}
.pack-sr-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--acc);
  animation: packSpin 0.8s linear infinite;
}
@keyframes packSpin {
  to { transform: rotate(360deg); }
}

.pack-sr-tooltip,
.brand-rm-tooltip {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.pack-sr-tooltip[hidden],
.brand-rm-tooltip[hidden] {
  display: none !important;
}
.pack-sr-toast {
  position: absolute;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  z-index: 10;
  padding: 8px 18px;
  border-radius: 99px;
  background: var(--panel-solid);
  border: 1px solid var(--acc);
  color: var(--acc);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  white-space: nowrap;
}
.pack-sr-toast[hidden] {
  display: none !important;
}

.pack-sr-bar,
.brand-rm-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  bottom: calc(60px + var(--safe-bottom));
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}
.brand-room-host.is-portrait .brand-rm-bar {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(54px + var(--safe-bottom));
}
.pack-sr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.pack-sr-hint,
.brand-rm-hint {
  display: none !important;
}
.pack-sr-pill {
  pointer-events: auto;
  padding: 7px 15px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--pill-bg);
  backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.pack-sr-pill:hover,
.pack-sr-pill.active {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}
.pack-sr-pill[hidden] {
  display: none !important;
}

/* Publish-Hidden Layout Editor Dock (?edit=1 or Shift+E) */
.pack-sr-editor-dock {
  position: absolute;
  left: 104px;
  right: 24px;
  bottom: calc(76px + var(--safe-bottom));
  z-index: 9;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pack-sr-editor-dock[hidden] {
  display: none !important;
}
.pack-sr-ed-row {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(20, 23, 30, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(232, 104, 63, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
}
.pack-sr-ed-tag {
  font-size: 11px;
  font-weight: 700;
  color: #ffb895;
  letter-spacing: 0.06em;
  padding-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}
.pack-sr-ed-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pack-ed-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #f3f1ea;
  font-size: 11.5px;
  font-weight: 500;
  transition: all 0.16s;
}
.pack-ed-btn:hover {
  border-color: #e8683f;
  background: rgba(232, 104, 63, 0.22);
  color: #fff;
}
.pack-ed-btn.accent {
  background: #e8683f;
  border-color: #e8683f;
  color: #090b0f;
  font-weight: 700;
}
.pack-sr-ed-slider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #d6d2c7;
  padding: 0 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}
.pack-sr-ed-slider input[type="range"] {
  width: 84px;
  accent-color: #e8683f;
}
.pack-sr-ed-slider em {
  font-style: normal;
  font-family: var(--f-d);
  font-size: 11px;
  color: #ffb895;
  min-width: 28px;
}

/* Brand 3D Room Sub-Zone Anchor Strip (sits gracefully above permanent .studio-route-dock) */
.brand-rm-zones {
  pointer-events: auto;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--studio-bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.brand-rm-zones::-webkit-scrollbar {
  display: none;
}
.brand-zone-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 0;
  background: transparent;
  color: var(--mut);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.16s, background-color 0.16s;
  white-space: nowrap;
}
.brand-zone-btn:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.brand-zone-btn.active {
  background: color-mix(in srgb, var(--acc) 18%, transparent);
  color: var(--acc);
}
html[data-studio-theme="dark"] .brand-zone-btn.active {
  background: color-mix(in srgb, var(--acc) 22%, transparent);
  color: #ffb89a;
}

/* Frosted Close-Up 360° Inspector */
.pack-sr-inspect,
.brand-rm-inspect {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: rgba(239, 236, 230, 0.74);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.34s ease, background-color 0.35s ease;
}
html[data-studio-theme="dark"] .pack-sr-inspect,
html[data-studio-theme="dark"] .brand-rm-inspect {
  background: rgba(14, 16, 22, 0.78);
}
.pack-sr-inspect.open,
.brand-rm-inspect.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.pack-sri-canvas,
.brand-ri-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  transform: scale(0.92);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.pack-sr-inspect.open .pack-sri-canvas,
.brand-rm-inspect.open .brand-ri-canvas {
  transform: scale(1);
}
.pack-sri-canvas:active,
.brand-ri-canvas:active {
  cursor: grabbing;
}
.brand-ri-top {
  position: absolute;
  top: 76px;
  right: 26px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.brand-ri-extra {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pack-sri-btn {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.pack-sri-btn:hover {
  border-color: var(--acc);
  color: var(--acc);
}
.pack-sri-btn.active,
.pack-sri-btn.primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}
.pack-sri-cap,
.brand-ri-cap {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 22px;
  border-radius: 14px;
  background: var(--panel-solid);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
  max-width: min(620px, 88%);
  pointer-events: none;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}
.pack-sri-cap strong,
.brand-ri-cap strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pack-sri-cap span,
.brand-ri-cap span {
  font-size: 12px;
  color: var(--mut);
}

/* Keep ALL 5 Bays' 3D wall titles 100% unobstructed: suppress duplicate 2D HUD title & place quiet meta cleanly on top-left */
body.is-exhibiting .hud-right {
  top: calc(52px + var(--safe-top)) !important;
  left: clamp(16px, 2.8vw, 34px) !important;
  right: auto !important;
  width: auto !important;
  pointer-events: none;
}
body.is-exhibiting .cat-cap {
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  border-radius: 0;
  border: 0;
  width: max-content;
  max-width: min(460px, calc(100vw - 120px));
  gap: 10px;
  align-items: center;
  pointer-events: auto;
}
body.is-exhibiting .cat-cap b {
  display: none !important;
}
body.is-exhibiting .cat-cap :is(span, .archive-meta) {
  max-width: none !important;
  font-size: 11px !important;
  white-space: nowrap;
  background: color-mix(in srgb, var(--studio-bg) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink);
  min-height: 32px;
}
body.is-room-overlay.is-exhibiting .ctrl-row {
  display: none !important;
}
body.is-campus-overview .brand-rm-bar {
  display: none !important;
}

.book-fs-pill {
  pointer-events: auto;
  margin-left: 12px;
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid var(--acc);
  background: color-mix(in srgb, var(--acc) 12%, var(--pill-bg));
  color: var(--acc);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.book-fs-pill:hover {
  background: var(--acc);
  color: #fff;
}

/* 4. Dual-Track Swiss Editorial Executive Index (Concept 04 Realized) */
#zaEditorialIndex {
  position: fixed;
  inset: 0;
  z-index: 7500;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  transition: background-color 0.35s ease, color 0.35s ease;
}
#zaEditorialIndex.open {
  display: flex;
}
.za-webgl-fallback {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent);
  background: color-mix(in srgb, var(--acc) 9%, var(--paper));
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.za-webgl-fallback[hidden] {
  display: none !important;
}
.za-ed-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 4vw, 56px);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.za-ed-brand {
  font-family: var(--f-d);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.za-ed-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.za-ed-body {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 36px clamp(20px, 4vw, 56px) 72px;
}
.za-ed-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(4, minmax(120px, 1fr));
  border-bottom: 1px solid var(--line);
  padding-bottom: 34px;
  margin-bottom: 36px;
}
.za-ed-lead {
  padding-right: 28px;
}
.za-ed-kicker {
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--acc);
  margin-bottom: 12px;
  word-break: keep-all;
}
.za-ed-lead h1 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.za-ed-lead p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--mut);
  max-width: 58ch;
}
.za-ed-metric {
  border-left: 1px solid var(--line);
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.za-ed-metric strong {
  font-family: var(--f-d);
  font-size: clamp(28px, 2.8vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.za-ed-metric strong em {
  font-style: normal;
  color: var(--acc);
}
.za-ed-metric span {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--mut);
}

.za-ed-sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.za-ed-sec-head h2 {
  font-family: var(--f-d);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.za-ed-sec-head small {
  font-size: 12px;
  color: var(--mut);
}
.za-ed-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 38px;
}
.za-flow-step {
  text-align: left;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.za-flow-step:hover {
  border-color: var(--acc);
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--acc) 5%, transparent);
}
.za-flow-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
  overflow: hidden;
  background: var(--studio-bg);
}
.za-flow-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.za-flow-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.za-flow-meta i {
  font-style: normal;
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 800;
  color: var(--acc);
}
.za-flow-meta b {
  font-size: 13.5px;
  font-weight: 700;
}
.za-flow-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--mut);
}

.za-ed-spaces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}
.za-ed-space-btn {
  text-align: left;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: all 0.18s;
}
.za-ed-space-btn:hover {
  border-color: var(--acc);
  background: color-mix(in srgb, var(--acc) 7%, transparent);
}
.za-ed-space-btn > span {
  display: block;
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 5px;
}
.za-ed-space-btn b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  text-wrap: balance;
}
.za-ed-space-btn small {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.45;
}

.za-wechat-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--acc) 7%, var(--paper));
}
.za-qr-box {
  width: 104px;
  height: 104px;
  padding: 7px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.za-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Quick WeChat Modal */
#zaWechatModal {
  position: fixed;
  inset: 0;
  z-index: 8200;
  background: rgba(12, 14, 19, 0.65);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#zaWechatModal.open {
  display: flex;
}
.za-wx-card {
  width: min(460px, 92vw);
  padding: 28px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}
.za-wx-info {
  flex: 1;
  min-width: 200px;
}
.za-wx-kicker {
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--acc);
}
.za-wx-title {
  font-size: 18px;
  margin: 4px 0 6px;
}
.za-wx-desc {
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.6;
  margin-bottom: 12px;
}
.za-wx-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.za-wx-head strong {
  font-size: 16px;
}
.za-wx-body {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.za-wx-id {
  font-family: var(--f-d);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.za-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--studio-bg);
  font-family: var(--f-b);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
.za-btn-primary:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #ffffff;
}
html[data-studio-theme="dark"] .za-btn-primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #0b0c10;
}
html[data-studio-theme="dark"] .za-btn-primary:hover {
  background: #f3f1ea;
  border-color: #f3f1ea;
  color: #0b0c10;
}

@media (max-width: 960px) {
  .za-ed-hero {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .za-ed-lead {
    grid-column: 1 / -1;
    padding-right: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .za-ed-metric {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 4px 0;
  }
  .za-ed-flow {
    grid-template-columns: 1fr 1fr;
  }
}

.za-rs { display: none; }
@media (max-width: 700px) {
  .za-rf { display: none; }
  .za-rs { display: inline; }
  .topline {
    padding: calc(8px + var(--safe-top)) 14px 0 14px !important;
    gap: 6px !important;
  }
  .za-brand-mark,
  .sound-toggle,
  .za-top-pill,
  .undock.on {
    position: relative;
    top: auto;
    right: auto;
    min-height: 44px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .za-brand-mark { gap: 6px; padding: 2px 4px 2px 0; }
  .za-brand-seal { width: 22px; height: 22px; font-size: 11px; border-radius: 4px; }
  .za-brand-text strong { font-size: 12px; letter-spacing: 0.03em; white-space: nowrap; }
  .za-brand-text strong .za-name-en { display: none; }
  .za-brand-text small { display: none; }
  .za-top-actions { gap: 2px; }
  .sound-toggle { min-width: 44px !important; width: 44px !important; padding: 0 6px !important; }
  .sound-toggle::after,
  .za-top-pill::after,
  .undock::after {
    content: "";
    position: absolute;
    inset: 0 -2px;
  }
  .sound-toggle span { display: none; }
  .za-top-pill { min-width: 44px; padding: 6px 4px; font-size: 11.5px; white-space: nowrap; }
  .za-top-pill .za-pill-label-long { display: none; }
  #studioLampText { display: none; }
  .undock { position: relative; top: auto; right: auto; min-width: 44px; min-height: 44px !important; font-size: 11.5px !important; padding: 6px 4px !important; white-space: nowrap; }
  .studio-route-dock {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    display: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    bottom: calc(10px + var(--safe-bottom));
    padding: 4px;
    gap: 2px;
  }
  .studio-route-dock.on {
    display: grid;
  }
  .studio-route-btn {
    min-height: 44px;
    justify-content: center;
    padding: 6px 2px;
    font-size: 11.5px;
    gap: 2px;
  }
  .studio-route-sep { display: none; }
  .brand-rm-bar,
  .brand-room-host.is-portrait .brand-rm-bar {
    bottom: calc(74px + var(--safe-bottom));
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
  .brand-rm-zones {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 3px 4px;
    gap: 2px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .brand-zone-btn {
    position: relative;
    min-height: 40px;
    padding: 6px 2px;
    font-size: 11px;
    text-align: center;
  }
  .brand-zone-btn::after {
    content: "";
    position: absolute;
    inset: -2px 0;
  }
  .pack-sr-hint,
  .brand-rm-hint { display: none; }
  .za-ed-top { padding: 8px 14px; flex-wrap: wrap; gap: 4px; }
  .za-ed-brand { font-size: 11px; letter-spacing: 0.05em; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .za-ed-actions { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .za-ed-actions .za-top-pill { min-height: 40px; padding: 4px 6px; font-size: 11.5px; }
  .za-ed-flow { grid-template-columns: 1fr; }
  .za-wx-card .za-btn-primary,
  .za-wechat-bar .za-btn-primary { min-height: 44px; padding: 10px 18px; font-size: 13px; }
  body.is-exhibiting .hud-right {
    top: calc(52px + var(--safe-top)) !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
  }
  body.is-exhibiting .cat-cap {
    width: 100% !important;
    max-width: 100% !important;
  }
  body.is-exhibiting .cat-cap :is(span, .archive-meta) {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left !important;
    line-height: 1.35 !important;
    padding: 6px 12px;
    min-height: 36px;
    width: fit-content;
  }
}

@media print {
  body > *:not(#zaEditorialIndex) { display: none !important; }
  #zaEditorialIndex { position: static; display: block !important; overflow: visible; }
  .za-ed-actions { display: none !important; }
}

/* =========================================================================
   Whole-Scene 3D Layout Editor Dock (#zaSceneEditorDock)
   ========================================================================= */
.za-top-pill.is-active {
  background: var(--accent, #ff6a3c) !important;
  color: #ffffff !important;
  border-color: var(--accent, #ff6a3c) !important;
}

.za-scene-editor-dock {
  position: fixed;
  left: 50%;
  bottom: calc(66px + var(--safe-bottom, 0px));
  transform: translateX(-50%);
  z-index: 95;
  width: min(940px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(24, 24, 28, 0.90);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
  color: #f4f2ec;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
}

.za-scene-editor-dock[hidden] {
  display: none !important;
}

.za-se-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.za-se-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.za-se-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #ff6a3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.za-se-sub {
  font-size: 11.5px;
  color: rgba(244, 242, 236, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.za-se-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.za-se-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f2ec;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.za-se-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.30);
}

.za-se-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.za-se-btn.warn {
  color: #ffb49e;
  border-color: rgba(255, 106, 60, 0.35);
}

.za-se-btn.primary {
  background: #ff6a3c;
  border-color: #ff6a3c;
  color: #fff;
  font-weight: 600;
}

.za-se-btn.primary:hover {
  background: #ff5624;
}

.za-se-body {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.za-se-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(244, 242, 236, 0.78);
}

.za-se-select-wrap select {
  max-width: 220px;
  background: rgba(12, 14, 18, 0.88);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}

.za-se-modes {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.za-se-mode {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(244, 242, 236, 0.72);
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.za-se-mode.active {
  background: rgba(255, 106, 60, 0.9);
  color: #fff;
  font-weight: 600;
}

.za-se-snap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: rgba(244, 242, 236, 0.82);
  cursor: pointer;
}

.za-se-snap input {
  accent-color: #ff6a3c;
}

.za-se-nums {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.za-se-num {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  overflow: hidden;
}

.za-se-num span {
  font-size: 10.5px;
  color: rgba(244, 242, 236, 0.68);
  padding: 0 5px;
  font-weight: 600;
}

.za-se-num button {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  width: 20px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.za-se-num button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.za-se-num input {
  width: 48px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0 2px;
}

.za-se-num input::-webkit-inner-spin-button {
  display: none;
}

@media (max-width: 700px) {
  .za-scene-editor-dock {
    bottom: calc(56px + var(--safe-bottom, 0px));
    padding: 8px 10px;
  }
  .za-se-sub {
    display: none;
  }
  .za-se-select-wrap select {
    max-width: 170px;
  }
}

/* Fixed Calm Corner Hover Caption Pills (replaces cursor-chasing tooltips) */
.archive-object-tag,
.brand-rm-tooltip {
  position: fixed !important;
  left: 28px !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(28px + var(--safe-bottom, 0px)) !important;
  transform: none !important;
  max-width: min(360px, calc(100vw - 44px)) !important;
  z-index: 65 !important;
  pointer-events: none !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 11px !important;
}

/* Contextual Magnetic Reticle Cursor (Desktop Fine Pointer) */
.za-cursor-reticle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  will-change: transform;
}
.za-cursor-reticle.is-visible {
  opacity: 1;
}
.za-cursor-reticle.is-hidden {
  opacity: 0 !important;
}
.za-cr-dot {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc, #c85a32);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s, border-color 0.2s;
}
.za-cursor-reticle.has-verb .za-cr-dot {
  left: -23px;
  top: -23px;
  width: 46px;
  height: 46px;
  background: color-mix(in srgb, var(--studio-bg) 35%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--acc) 75%, transparent);
}
.za-cr-verb {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-family: var(--f-d);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.16s ease;
  white-space: nowrap;
}
html[data-studio-theme="dark"] .za-cr-verb {
  color: #f3f1ea;
}
.za-cursor-reticle.has-verb .za-cr-verb {
  opacity: 1;
}
@media (pointer: coarse) {
  .za-cursor-reticle { display: none !important; }
}

/* 3rd-level Inspector Sub-Dock (Tri-Fold Angles & Phone Pages) */
.brand-ri-extra:empty {
  display: none;
}
.brand-ri-subdock {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--studio-bg) 84%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}
.brand-ri-subdock[hidden] {
  display: none !important;
}
body.is-room-inspecting .studio-route-dock {
  display: none !important;
}
.brand-ri-subdock .pack-sri-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  border-radius: 8px;
}
.brand-rm-inspect .brand-ri-cap {
  bottom: calc(74px + var(--safe-bottom)) !important;
}
