/* Live studio — horizontal pipeline · full-width viewport · TECH PACK HUD over canvas */

#live-studio {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(6, 6, 14, 0.4), var(--bg));
  /* Tech pack HUD — cap is max width; real width also bounded by live-viewport via min(..., 100% - insets) */
  --live-tp-inset: clamp(0.35rem, 1.2vw, 0.75rem);
  --live-tp-panel-cap: 168px;
  --live-tp-canvas-gutter: 0.4rem;
}

#live-studio .live-studio-inner {
  max-width: min(1560px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  min-height: min(78vh, 820px);
}

/* Horizontal pipeline (Product creation · Content · …) */
#live-studio .live-pipeline-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  background: rgba(10, 10, 18, 0.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  /* body.live-studio-open uses touch-action: none — allow horizontal scroll here */
  touch-action: pan-x pan-y;
  /* Let the strip shrink inside flex parents (otherwise min-width:auto clips the whole studio) */
  min-width: 0;
  max-width: 100%;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip {
  /* intrinsic width + left packing (flex-grow would stretch chips across the bar) */
  flex: 0 1 auto;
  min-width: min(104px, 28vw);
  max-width: 220px;
  min-height: 48px;
  width: auto;
  justify-content: center;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip .live-tool-body {
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0.45rem;
  text-align: center;
  min-width: 0;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip .live-tool-icon {
  width: 22px;
  height: 22px;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip .live-tool-name {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-wrap: balance;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip .live-tool-phase {
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
  text-wrap: balance;
}

#live-studio .live-pipeline-strip .live-tool-btn--strip .live-tool-meta {
  width: 100%;
  overflow-wrap: break-word;
}

#live-studio .live-workspace {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-height: min(68vh, 760px);
  min-width: 0;
}

/* TECH PACK — overlay; width never exceeds live-viewport (vw-based sizes were clipping on mobile) */
#live-studio .live-techpack-sidebar {
  position: absolute;
  z-index: 7;
  top: var(--live-tp-inset);
  left: var(--live-tp-inset);
  right: auto;
  box-sizing: border-box;
  width: min(var(--live-tp-panel-cap), calc(100% - 2 * var(--live-tp-inset)));
  max-width: min(var(--live-tp-panel-cap), calc(100% - 2 * var(--live-tp-inset)));
  min-width: 0;
  max-height: min(calc(100% - 0.85rem), 78vh);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.4rem 0.32rem 0.45rem;
  background: rgba(10, 10, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#live-studio .live-techpack-sidebar[hidden] {
  display: none !important;
}

#live-studio .live-techpack-swatches {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

#live-studio .live-techpack-swatches .colorup-materials-heading {
  text-align: left;
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  padding-bottom: 0.28rem;
}

#live-studio .live-techpack-swatches .colorup-part-rows {
  gap: 0.55rem;
}

#live-studio .live-techpack-swatches .colorup-part-row {
  align-items: flex-start;
}

#live-studio .live-techpack-swatches .colorup-part-label {
  text-align: left;
}

#live-studio .live-techpack-swatches .colorup-part-swatches {
  justify-content: flex-start;
}

#live-studio .live-techpack-swatches .colorup-part-swatches .colorup-drag-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

#live-studio .live-techpack-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

#live-studio .live-techpack-seed,
#live-studio .live-techpack-reset {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#live-studio .live-techpack-action-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  pointer-events: none;
}

#live-studio .live-techpack-seed {
  border: 1px solid rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.14);
  color: #e8dcb8;
}

#live-studio .live-techpack-seed:hover {
  background: rgba(201, 168, 76, 0.24);
}

#live-studio .live-techpack-reset {
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

#live-studio .live-techpack-reset:hover {
  background: rgba(251, 113, 133, 0.22);
}

#live-studio .live-techpack-seed[hidden],
#live-studio .live-techpack-reset[hidden] {
  display: none !important;
}

#live-studio .live-tool-btn {
  --mod: #94a3b8;
  --mod-glow: rgba(148, 163, 184, 0.35);
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  width: 100%;
  min-height: 52px;
  padding: 0.4rem 0.35rem 0.4rem 0.15rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

#live-studio .live-tool-btn[data-stage="0"] {
  --mod: #22d3ee;
  --mod-glow: rgba(34, 211, 238, 0.45);
}
#live-studio .live-tool-btn[data-stage="1"] {
  --mod: #818cf8;
  --mod-glow: rgba(129, 140, 248, 0.45);
}
#live-studio .live-tool-btn[data-stage="2"] {
  --mod: #f472b6;
  --mod-glow: rgba(244, 114, 182, 0.45);
}
#live-studio .live-tool-btn[data-stage="3"] {
  --mod: #34d399;
  --mod-glow: rgba(52, 211, 153, 0.45);
}

#live-studio .live-tool-node {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0 0.15rem 0 0.2rem;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--mod) 55%, rgba(255, 255, 255, 0.12));
  background: rgba(10, 10, 18, 0.95);
  box-shadow: 0 0 0 2px rgba(10, 10, 18, 0.95);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
  z-index: 1;
}

#live-studio .live-tool-btn:hover .live-tool-node {
  border-color: color-mix(in srgb, var(--mod) 85%, white);
  transform: scale(1.06);
}

#live-studio .live-tool-btn.is-active .live-tool-node {
  background: var(--mod);
  border-color: var(--mod);
  box-shadow:
    0 0 0 2px rgba(10, 10, 18, 0.95),
    0 0 14px var(--mod-glow);
}

#live-studio .live-tool-body {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
  padding: 0.2rem 0.35rem 0.2rem 0.15rem;
  border-radius: 9px;
}

#live-studio .live-tool-btn:hover .live-tool-body {
  background: color-mix(in srgb, var(--mod) 12%, transparent);
}

#live-studio .live-tool-btn.is-active .live-tool-body {
  background: color-mix(in srgb, var(--mod) 18%, transparent);
}

#live-studio .live-tool-btn.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--mod) 40%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mod) 25%, transparent);
}

#live-studio .live-tool-btn .live-tool-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: block;
  color: color-mix(in srgb, var(--mod) 70%, var(--text-2));
}

#live-studio .live-tool-btn.is-active .live-tool-icon {
  color: var(--mod);
}

#live-studio .live-tool-btn .live-tool-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#live-studio .live-tool-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.15;
}

#live-studio .live-tool-name {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

#live-studio .live-tool-phase {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  opacity: 0.88;
}

#live-studio .live-tool-btn.is-active .live-tool-phase {
  color: color-mix(in srgb, var(--mod) 65%, var(--text-2));
}

/* Main viewport — single “app” surface */
#live-studio .live-viewport {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  min-height: min(72vh, 760px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(6, 6, 14, 0.5);
  overflow: hidden;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Viewport accent follows active pipeline stage (after base so it wins) */
#live-studio .live-viewport[data-active-stage="0"] {
  border-color: color-mix(in srgb, #22d3ee 42%, var(--border));
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(34, 211, 238, 0.12),
    inset 0 0 80px rgba(34, 211, 238, 0.04);
}
#live-studio .live-viewport[data-active-stage="1"] {
  border-color: color-mix(in srgb, #818cf8 42%, var(--border));
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(129, 140, 248, 0.12),
    inset 0 0 80px rgba(129, 140, 248, 0.04);
}
#live-studio .live-viewport[data-active-stage="2"] {
  border-color: color-mix(in srgb, #f472b6 42%, var(--border));
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(244, 114, 182, 0.12),
    inset 0 0 80px rgba(244, 114, 182, 0.04);
}
#live-studio .live-viewport[data-active-stage="3"] {
  border-color: color-mix(in srgb, #34d399 42%, var(--border));
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(52, 211, 153, 0.12),
    inset 0 0 80px rgba(52, 211, 153, 0.04);
}

/* Stacked stages */
#live-studio .live-stage {
  position: absolute;
  inset: 0;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}

#live-studio .live-stage.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

#live-studio .live-stage-inner {
  padding: clamp(0.75rem, 2vw, 1.25rem);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#live-studio .live-colorup-slot {
  width: 100%;
  height: 100%;
  min-height: min(68vh, 700px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

/* Product stage — visible CUCO viewport + chrome (where ColorUp mounts) */
#live-studio .live-cuco-chrome {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.15rem 0.65rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
}

#live-studio .live-cuco-chrome--compact {
  margin-bottom: 0.35rem;
  padding-bottom: 0.4rem;
}

#live-studio .live-cuco-chrome--compact .live-cuco-meta {
  font-size: 0.68rem;
  max-width: none;
  margin-top: 0.3rem;
}

#live-studio .live-cuco-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(34, 211, 238, 0.85);
  margin-right: 0.65rem;
  vertical-align: middle;
}

#live-studio .live-cuco-title {
  display: block;
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

#live-studio .live-cuco-cuco {
  font-weight: 600;
  font-style: normal;
  color: rgba(34, 211, 238, 0.92);
  text-transform: lowercase;
}

#live-studio .live-cuco-meta {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 52ch;
}

#live-studio .live-cuco-code {
  font-size: 0.65rem;
  padding: 0.08rem 0.28rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: rgba(165, 243, 252, 0.82);
}

#live-studio .live-cuco-viewport {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: min(62vh, 640px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background:
    linear-gradient(145deg, rgba(34, 211, 238, 0.05) 0%, transparent 42%),
    radial-gradient(ellipse 90% 75% at 50% 40%, rgba(34, 211, 238, 0.07), rgba(6, 6, 14, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  padding: clamp(0.45rem, 1.2vw, 0.85rem);
  /* Reserve HUD lane — same min(cap, 100%−insets) as left sidebar so canvas sits in clear band */
  padding-left: calc(
    min(var(--live-tp-panel-cap), calc(100% - 2 * var(--live-tp-inset))) + var(--live-tp-inset) + var(--live-tp-canvas-gutter)
  );
  overflow: hidden;
}

#live-studio .live-cuco-viewport #colorup-root {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

#live-studio .live-cuco-viewport #colorup-root.colorup-root--inline .colorup-canvas-wrap--solo {
  flex: 1;
  min-height: min(56vh, 600px);
  min-width: 0;
  max-width: 100%;
}

/* fitCanvas sets width+height with same scale — do not clamp width alone (breaks aspect). */
#live-studio .live-cuco-viewport .colorup-canvas-wrap--solo #colorup-cv {
  max-width: none;
  box-sizing: content-box;
}

/* Sidebar provides Reset — hide duplicate FAB on canvas */
#live-studio .colorup-seed-fab,
#live-studio .colorup-reset-fab {
  display: none !important;
}

/* Floating HUD — stages 1–4 (#eco-stage-hud); product uses left tech pack sidebar */
#live-studio .live-overlay-hud {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  max-width: min(280px, 42vw);
  max-height: min(52vh, 420px);
  overflow: auto;
  pointer-events: auto;
}

#live-studio .live-overlay-hud .colorup-techpack-hud,
#live-studio .live-overlay-hud .live-hud-panel {
  margin: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#live-studio .live-hud-panel {
  padding: 10px 12px;
  background: rgba(15, 15, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--text-2);
}

#live-studio .live-hud-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.65rem;
  line-height: 1.45;
  color: rgba(165, 243, 252, 0.88);
  max-height: min(44vh, 360px);
  overflow: auto;
}

#live-studio .live-hud-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

/* Swatch carousel — bottom overlay */
#live-studio .live-overlay-carousel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 7;
  padding: 10px 12px 14px;
  pointer-events: none;
}

#live-studio .live-overlay-carousel.is-visible {
  pointer-events: auto;
}

#live-studio .live-carousel-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px 10px;
  background: rgba(6, 6, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#live-studio .live-carousel-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#live-studio .live-carousel-scroller::-webkit-scrollbar {
  height: 6px;
}
#live-studio .live-carousel-scroller::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.35);
  border-radius: 99px;
}

/* Content / mfg / marketing / dist compact in live mode */
#live-studio .live-stage--content .content-cms {
  max-width: 100%;
  margin: 0;
}

#live-studio .live-stage--marketing .marketing-collage {
  max-width: min(920px, 100%);
  margin-inline: auto;
}

#live-studio .live-stage--dist .listing-grid {
  max-width: 1000px;
  margin: 0 auto;
}

#live-studio .live-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  #live-studio {
    --live-tp-panel-cap: 148px;
    --live-tp-canvas-gutter: 0.35rem;
  }
  #live-studio .live-workspace {
    min-height: min(64vh, 620px);
  }
  #live-studio .live-techpack-sidebar {
    max-height: min(calc(100% - 0.75rem), 74vh);
    padding: 0.38rem 0.28rem 0.4rem;
  }
  #live-studio .live-techpack-swatches .colorup-part-swatches .colorup-drag-swatch {
    width: 24px;
    height: 24px;
  }
  #live-studio .live-viewport {
    flex: 1 1 0;
    min-width: 0;
    min-height: min(58vh, 540px);
  }
  #live-studio .live-pipeline-strip {
    overflow-x: visible;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 0.35rem;
  }
  #live-studio .live-pipeline-strip .live-tool-btn--strip {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 640px) {
  #live-studio {
    --live-tp-panel-cap: 124px;
    --live-tp-inset: 0.3rem;
    --live-tp-canvas-gutter: 0.28rem;
  }
  #live-studio .live-studio-inner {
    min-height: unset;
    padding-left: clamp(0.4rem, 2vw, 0.75rem);
    padding-right: clamp(0.4rem, 2vw, 0.75rem);
  }
  #live-studio .live-techpack-swatches .colorup-part-swatches .colorup-drag-swatch {
    width: 22px;
    height: 22px;
  }
  #live-studio .live-overlay-hud {
    max-width: min(200px, calc(100% - 1.25rem));
    font-size: 0.65rem;
  }
}

@media (max-width: 380px) {
  #live-studio {
    --live-tp-panel-cap: 108px;
    --live-tp-inset: 0.25rem;
    --live-tp-canvas-gutter: 0.22rem;
  }
  .live-studio-shell #live-studio {
    --live-tp-panel-cap: 102px;
    --live-tp-inset: 0.22rem;
    --live-tp-canvas-gutter: 0.2rem;
  }
  #live-studio .live-techpack-swatches .colorup-part-swatches .colorup-drag-swatch {
    width: 20px;
    height: 20px;
  }
  #live-studio .live-techpack-seed,
  #live-studio .live-techpack-reset {
    width: 2.1rem;
    height: 2.1rem;
  }
}

/* ── Stage content (shared with ecosystem-canvas.js) — scoped vars ── */
#live-studio {
  --ec-elevated: rgba(15, 15, 24, 0.92);
  --ec-muted: rgba(244, 242, 237, 0.55);
  --ec-transition: 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

#live-studio .live-stage--content {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#live-studio .live-stage--content .live-stage-inner {
  align-items: stretch;
}

#live-studio .stage-content-layout {
  padding-top: 0.35rem;
  width: 100%;
  flex: 0 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Content: shot strip (4×1 thumbs) + attributes panel below */
#live-studio .content-cms {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  flex: 0 0 auto;
  min-width: 0;
  overflow: visible;
}

#live-studio .content-cms-kicker {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ec-muted);
  flex: 0 0 auto;
}

#live-studio .content-cms-list {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  flex: 0 0 auto;
  min-width: 0;
}

#live-studio .content-cms-list--strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto;
  overflow: hidden;
}

@media (max-width: 480px) {
  #live-studio .content-cms-list--strip {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
}

#live-studio .content-asset-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  background: var(--ec-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#live-studio .content-cms-list--strip .content-asset-card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.2rem;
  gap: 0;
}

#live-studio .content-asset-card:hover {
  border-color: color-mix(in srgb, #818cf8 45%, var(--border));
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.12);
}

#live-studio .content-asset-card:focus-visible {
  outline: 2px solid rgba(129, 140, 248, 0.65);
  outline-offset: 2px;
}

#live-studio .content-asset-card.is-selected {
  border-color: color-mix(in srgb, #818cf8 55%, var(--border));
  box-shadow:
    0 0 0 2px rgba(129, 140, 248, 0.28),
    0 2px 12px rgba(0, 0, 0, 0.25);
}

#live-studio .content-asset-thumb-wrap {
  flex: 0 0 auto;
  align-self: center;
}

#live-studio .content-cms-list--strip .content-asset-thumb-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#live-studio .content-asset-thumb {
  display: block;
  width: 56px;
  height: auto;
  border-radius: 6px;
  background: #0a0a12;
  vertical-align: middle;
}

#live-studio .content-cms-list--strip .content-asset-thumb {
  width: 100%;
  max-width: 92px;
  height: auto;
}

#live-studio .content-cms-attributes {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.45rem 0.4rem 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.18);
  background: rgba(8, 8, 18, 0.55);
  overflow: visible;
}

#live-studio .content-attr-heading {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ec-muted);
  flex: 0 0 auto;
  text-align: center;
}

#live-studio .content-attr-layout {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.65rem;
  overflow: visible;
}

#live-studio .content-attr-layout--two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 0.55rem 0.75rem;
  align-items: start;
  width: 100%;
}

#live-studio .content-attr-col--primary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

#live-studio .content-attr-col--secondary {
  min-width: 0;
}

#live-studio .content-attr-layout--two-col .content-attr-preview-aspect {
  width: 100%;
  max-width: min(280px, 100%);
  align-self: flex-start;
}

#live-studio .content-attr-preview-aspect {
  width: min(260px, 92vw);
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#live-studio .content-attr-preview-wrap {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0a12;
  display: flex;
  justify-content: center;
  align-items: center;
}

#live-studio .content-attr-preview-aspect .content-attr-preview-wrap {
  align-self: stretch;
}

#live-studio .content-attr-preview-canvas {
  display: block;
  width: 120px;
  height: auto;
  max-height: 180px;
  border-radius: 6px;
  background: #0a0a12;
  vertical-align: middle;
}

#live-studio .content-attr-layout--two-col .content-attr-preview-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(34vh, 300px);
}

#live-studio .content-attr-dl {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.35rem 0.75rem;
  align-content: start;
  font-size: 0.62rem;
  line-height: 1.35;
}

#live-studio .content-attr-dl--colorway-bar {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  max-width: min(440px, 100%);
  margin: 0;
  text-align: center;
}

#live-studio .content-attr-layout--two-col .content-attr-dl--colorway-bar {
  max-width: none;
  text-align: left;
}

#live-studio .content-attr-dl--primary-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
  min-width: 0;
}

#live-studio .content-attr-dl--meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.55rem;
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
  min-width: 0;
  align-content: start;
}

#live-studio .content-attr-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.28rem 0.32rem;
  border-radius: 8px;
  background: rgba(15, 15, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#live-studio .content-attr-dl dt {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ec-muted);
  font-size: 0.55rem;
}

#live-studio .content-attr-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

#live-studio .content-attr-dl--colorway-bar .content-attr-row--colorway {
  align-items: center;
}

#live-studio .content-attr-layout--two-col .content-attr-dl--colorway-bar .content-attr-row--colorway {
  align-items: flex-start;
}

#live-studio .content-attr-colorway-dd {
  min-height: 1.35em;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

#live-studio .content-attr-layout--two-col .content-attr-colorway-dd {
  justify-content: flex-start;
}

#live-studio .content-attr-swatch-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#live-studio .content-attr-swatch {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
  #live-studio .content-attr-layout:not(.content-attr-layout--two-col) {
    flex-direction: column;
  }
  #live-studio .content-attr-layout:not(.content-attr-layout--two-col) .content-attr-preview-wrap {
    align-self: center;
  }
  #live-studio .content-attr-layout--two-col {
    grid-template-columns: 1fr;
  }
  #live-studio .content-attr-layout--two-col .content-attr-preview-aspect {
    max-width: min(280px, 88vw);
    margin-inline: auto;
  }
  #live-studio .content-attr-layout--two-col .content-attr-dl--colorway-bar {
    text-align: center;
  }
  #live-studio .content-attr-layout--two-col .content-attr-dl--colorway-bar .content-attr-row--colorway {
    align-items: center;
  }
  #live-studio .content-attr-layout--two-col .content-attr-colorway-dd {
    justify-content: center;
  }
  #live-studio .content-attr-dl--meta {
    grid-template-columns: 1fr;
  }
  #live-studio .content-attr-layout--two-col .content-attr-preview-canvas {
    max-height: min(40vh, 340px);
  }
}

#live-studio .content-shot {
  margin: 0;
  text-align: center;
  background: var(--ec-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem;
  min-width: 0;
}
#live-studio .content-shot canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #0a0a12;
  vertical-align: middle;
}
#live-studio .content-shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ec-muted);
}

#live-studio .stage-marketing-layout {
  padding-top: 0.25rem;
  width: 100%;
  align-items: stretch;
}
#live-studio .marketing-collage {
  column-count: 2;
  column-gap: 0.75rem;
  width: 100%;
}
#live-studio .marketing-tile {
  position: relative;
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--ec-elevated);
  animation: live-poster-float 7s ease-in-out infinite;
}
#live-studio .marketing-tile--portrait {
  width: 260px;
}
#live-studio .marketing-tile--square {
  width: 300px;
}
#live-studio .marketing-tile--story {
  width: 240px;
  animation: none;
}
#live-studio .marketing-tile--banner.marketing-tile--span-all {
  width: 560px;
}
#live-studio .marketing-tile--catalog {
  width: 200px;
}
#live-studio .marketing-tile--landscape {
  width: 360px;
}
#live-studio .marketing-tile--thumb {
  width: 280px;
}
#live-studio .marketing-tile:nth-child(1) {
  animation-delay: 0s;
}
#live-studio .marketing-tile:nth-child(2) {
  animation-delay: -1s;
}
#live-studio .marketing-tile:nth-child(3) {
  animation-delay: -2s;
}
#live-studio .marketing-tile:nth-child(4) {
  animation-delay: -2.5s;
}
#live-studio .marketing-tile:nth-child(5) {
  animation-delay: -3.5s;
}
#live-studio .marketing-tile:nth-child(6) {
  animation-delay: -4.5s;
}
#live-studio .marketing-tile:nth-child(7) {
  animation-delay: -5.5s;
}
#live-studio .marketing-tile--span-all {
  column-span: all;
  max-width: 100%;
}
@keyframes live-poster-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.005);
  }
}
@media (max-width: 560px) {
  #live-studio .marketing-collage {
    column-count: 1;
  }
}
#live-studio .poster-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
#live-studio .poster-tag {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#live-studio .stage-dist-layout {
  padding-top: 0.25rem;
  width: 100%;
}
#live-studio .listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  #live-studio .listing-grid {
    grid-template-columns: 1fr;
  }
}
#live-studio .listing-card {
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ec-transition), box-shadow 0.35s;
}
#live-studio .listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

/* —— Amazon.in-style PDP snippet —— */
#live-studio .listing-card--amazon {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #fff;
  color: #0f1111;
}
#live-studio .listing-amazon-top {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  background: #131921;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.2;
}
#live-studio .listing-amazon-top__az {
  color: #febd69;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#live-studio .listing-amazon-top__in {
  color: #fff;
  font-weight: 500;
}
#live-studio .listing-preview__media--amazon {
  background: #fff;
  padding: 0.65rem 0.85rem 0.5rem;
  border-bottom: 1px solid #e7e7e7;
}
#live-studio .listing-card--amazon .listing-thumb {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #fff;
  max-height: min(220px, 38vh);
}
#live-studio .listing-amazon-body {
  padding: 0.65rem 0.75rem 0.85rem;
  flex: 1;
  text-align: left;
}
#live-studio .listing-amazon-body__title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  color: #007185;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#live-studio .listing-amazon-body__rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
}
#live-studio .listing-amazon-body__stars {
  color: #de7921;
  letter-spacing: -0.06em;
}
#live-studio .listing-amazon-body__count {
  color: #007185;
}
#live-studio .listing-amazon-body__divider {
  height: 1px;
  background: #e7e7e7;
  margin: 0.25rem 0 0.45rem;
}
#live-studio .listing-amazon-body__priceblock {
  margin-bottom: 0.35rem;
}
#live-studio .listing-amazon-body__price {
  font-size: 1.05rem;
  color: #0f1111;
  font-weight: 400;
}
#live-studio .listing-amazon-body__cur {
  font-size: 0.72rem;
  vertical-align: top;
}
#live-studio .listing-amazon-body__mrp-wrap {
  font-size: 0.65rem;
  color: #565959;
  margin-top: 0.15rem;
}
#live-studio .listing-amazon-body__mrp {
  margin-left: 0.2rem;
}
#live-studio .listing-amazon-body__prime {
  margin: 0 0 0.45rem;
  font-size: 0.65rem;
  color: #565959;
  line-height: 1.4;
}
#live-studio .listing-amazon-body__prime-badge {
  display: inline-block;
  padding: 0.08rem 0.28rem 0.1rem;
  margin-right: 0.25rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #93d4f0, #56b8e0);
  border-radius: 3px;
  vertical-align: middle;
}
#live-studio .listing-amazon-body__prime-txt strong {
  color: #0f1111;
  font-weight: 600;
}
#live-studio .listing-amazon-body__bullets {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.65rem;
  color: #565959;
  line-height: 1.5;
}

/* —— Flipkart-style listing —— */
#live-studio .listing-card--flipkart {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #212121;
}
#live-studio .listing-fk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  background: #2874f0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#live-studio .listing-fk-top__genuine {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.92;
}
#live-studio .listing-preview__media--fk {
  background: #fff;
  padding: 0.6rem 0.75rem 0.45rem;
  border-bottom: 1px solid #f0f0f0;
}
#live-studio .listing-card--flipkart .listing-thumb {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #fafafa;
  max-height: min(220px, 38vh);
}
#live-studio .listing-fk-body {
  padding: 0.55rem 0.75rem 0.8rem;
  flex: 1;
  text-align: left;
}
#live-studio .listing-fk-body__assured {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.4rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #212121;
  background: #e8f5e9;
  border-radius: 3px;
}
#live-studio .listing-fk-body__check {
  color: #388e3c;
  font-weight: 800;
}
#live-studio .listing-fk-body__title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  color: #212121;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#live-studio .listing-fk-body__rating-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
  font-size: 0.65rem;
}
#live-studio .listing-fk-body__score {
  font-weight: 700;
  color: #212121;
}
#live-studio .listing-fk-body__star {
  color: #388e3c;
  font-size: 0.75rem;
}
#live-studio .listing-fk-body__ratings {
  color: #878787;
}
#live-studio .listing-fk-body__price-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}
#live-studio .listing-fk-body__price {
  font-size: 1.05rem;
  font-weight: 600;
  color: #212121;
}
#live-studio .listing-fk-body__off {
  font-size: 0.72rem;
  font-weight: 600;
  color: #388e3c;
}
#live-studio .listing-fk-body__was {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.65rem;
  color: #878787;
  text-decoration: line-through;
}
#live-studio .listing-fk-body__hint {
  margin: 0;
  font-size: 0.62rem;
  color: #878787;
  line-height: 1.45;
}

/* —— D2C / humsee.pages.dev-style collectible card —— */
#live-studio .listing-card--humsee {
  border: 1px solid rgba(201, 168, 76, 0.28);
  background: linear-gradient(165deg, rgba(22, 20, 18, 0.98) 0%, rgba(10, 9, 12, 1) 100%);
  color: #f5f0e8;
}
#live-studio .listing-humsee-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.65rem 0.75rem 0.85rem;
  flex: 1;
}
#live-studio .listing-humsee-body__pill {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.88);
  border: 1px solid rgba(201, 168, 76, 0.45);
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.08);
}
#live-studio .listing-preview__media--humsee {
  width: 100%;
  padding: 0.35rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 168, 76, 0.15);
}
#live-studio .listing-card--humsee .listing-thumb {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 6px;
  background: #0a0a0c;
  max-height: min(220px, 38vh);
}
#live-studio .listing-humsee-body__title {
  margin: 0 0 0.35rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  font-weight: 400;
  line-height: 1.25;
  color: #faf6ef;
  letter-spacing: 0.01em;
}
#live-studio .listing-humsee-body__meta {
  margin: 0 0 0.45rem;
  font-size: 0.62rem;
  line-height: 1.45;
  color: rgba(245, 240, 232, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#live-studio .listing-humsee-body__price {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e8d5a8;
  letter-spacing: 0.04em;
}
#live-studio .listing-humsee-body__foot {
  margin: 0;
  font-size: 0.6rem;
  line-height: 1.5;
  color: rgba(245, 240, 232, 0.45);
  max-width: 18rem;
}

/* ── Fullscreen live studio dialog (index.html — opened via data-open-live-studio) ── */
.live-studio-shell {
  position: fixed;
  inset: 0;
  z-index: 10000;
  box-sizing: border-box;
}

.live-studio-shell[hidden] {
  display: none !important;
}

.live-studio-shell__frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: var(--bg);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  box-sizing: border-box;
}

.live-studio-shell__back {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  left: calc(env(safe-area-inset-left, 0px) + 0.5rem);
  z-index: 10002;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.live-studio-shell__back:hover {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.live-studio-shell__back:focus-visible {
  outline: 2px solid rgba(251, 113, 133, 0.65);
  outline-offset: 2px;
}

.live-studio-shell__back-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.9;
}

.live-studio-shell #live-studio.live-studio--overlay {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  background: linear-gradient(180deg, rgba(6, 6, 14, 0.55), var(--bg));
}

.live-studio-shell #live-studio .live-studio-inner {
  flex: 1;
  min-height: 0 !important;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  /* Top/bottom minimal — safe areas live on .live-studio-shell__frame; pipeline sits in Back row */
  padding: 0.35rem 0 0;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Pipeline — shell frame already applies safe-area insets */
.live-studio-shell #live-studio .live-pipeline-strip {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  padding-right: 0.4rem;
  padding-left: 0;
  margin-top: 0;
  align-self: stretch;
  min-height: 2.7rem;
  min-width: 0;
  max-width: 100%;
  align-items: stretch;
  align-content: flex-start;
  justify-content: flex-start;
  touch-action: pan-x pan-y;
  /* One row: fit-content min-widths often push chip 4 to line 2 despite leftover gap */
  flex-wrap: nowrap;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: thin;
  scroll-padding-inline: 0.35rem;
}

.live-studio-shell #live-studio .live-pipeline-strip .live-tool-btn--strip {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
}

@media (min-width: 641px) {
  .live-studio-shell #live-studio .live-studio-inner {
    padding: 0.4rem clamp(0.75rem, 2vw, 1.25rem) 0;
    gap: 0.4rem;
  }

  .live-studio-shell #live-studio .live-pipeline-strip {
    padding-left: 0;
  }
}

.live-studio-shell #live-studio .live-workspace {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

.live-studio-shell #live-studio .live-viewport {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 0;
}

body.live-studio-open {
  touch-action: none;
  overflow-x: hidden;
}

/* Fullscreen shell — phones: full-width viewport, taller canvas, marketing tiles use rail width */
@media (max-width: 640px) {
  .live-studio-shell #live-studio {
    /* Slightly tighter than inline #live-studio — shell is already edge-to-edge */
    --live-tp-panel-cap: 118px;
    --live-tp-inset: 0.28rem;
    --live-tp-canvas-gutter: 0.26rem;
  }

  .live-studio-shell #live-studio .live-studio-inner {
    padding-top: 0.3rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    gap: 0.3rem;
  }

  .live-studio-shell #live-studio .live-pipeline-strip {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding-right: 0.35rem;
    padding-left: 0;
    scroll-padding-inline: 0.25rem;
  }

  .live-studio-shell #live-studio .live-workspace {
    min-height: 0;
  }

  .live-studio-shell #live-studio .live-viewport {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
  }

  .live-studio-shell #live-studio .live-techpack-sidebar {
    max-height: min(calc(100% - 0.7rem), 68vh);
    padding: 0.4rem 0.35rem 0.45rem;
  }

  .live-studio-shell #live-studio .live-techpack-swatches {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.3rem;
  }

  .live-studio-shell #live-studio .live-techpack-actions {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 0.35rem;
    gap: 0.3rem;
  }

  .live-studio-shell #live-studio .live-techpack-seed,
  .live-studio-shell #live-studio .live-techpack-reset {
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
  }

  .live-studio-shell #live-studio .live-stage-inner {
    padding: 0.4rem 0.3rem;
  }

  .live-studio-shell #live-studio .live-cuco-viewport {
    border-radius: 10px;
    padding: 0.35rem 0.3rem;
    padding-left: calc(
      min(var(--live-tp-panel-cap), calc(100% - 2 * var(--live-tp-inset))) + var(--live-tp-inset) + var(--live-tp-canvas-gutter)
    );
  }

  .live-studio-shell #live-studio .marketing-collage {
    width: 100%;
    column-gap: 0.5rem;
  }

  .live-studio-shell #live-studio .marketing-tile--portrait,
  .live-studio-shell #live-studio .marketing-tile--square,
  .live-studio-shell #live-studio .marketing-tile--story,
  .live-studio-shell #live-studio .marketing-tile--banner.marketing-tile--span-all,
  .live-studio-shell #live-studio .marketing-tile--catalog,
  .live-studio-shell #live-studio .marketing-tile--landscape,
  .live-studio-shell #live-studio .marketing-tile--thumb {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}
