/*
 * Urban Avatar Studio — route shell + responsive Studio layout.
 * Desktop keeps the approved side-by-side mock.
 * Mobile stacks preview above a docked customizer (most traffic is phone).
 */

/* ── Route iframe shell (outer Urban Chat page) ── */

.uc-avatar-studio-route {
  position: fixed;
  inset: 0;
  z-index: 11900;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--uc-chrome);
}

.uc-avatar-studio-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--uc-chrome);
}

.studio-option-selected {
  color: var(--uc-text-on-gold) !important;
  background: var(--uc-gold-dim) !important;
  border-color: var(--uc-gold) !important;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: scale(1.02);
  animation: studioPulseSelect 0.25s ease-out;
}

.studio-expanded-option-btn,
.facialhair-option-btn,
.mouth-option-btn,
.hair-option-btn,
.hat-option-btn,
.glasses-option-btn,
.chain-option-btn,
.piercing-option-btn,
.outfit-option-btn,
.preset-btn {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.studio-expanded-option-btn:hover,
.facialhair-option-btn:hover,
.mouth-option-btn:hover,
.hair-option-btn:hover,
.hat-option-btn:hover,
.glasses-option-btn:hover,
.chain-option-btn:hover,
.piercing-option-btn:hover,
.outfit-option-btn:hover,
.preset-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.studio-expanded-option-btn:active,
.facialhair-option-btn:active,
.mouth-option-btn:active,
.hair-option-btn:active,
.hat-option-btn:active,
.glasses-option-btn:active,
.chain-option-btn:active,
.piercing-option-btn:active,
.outfit-option-btn:active,
.preset-btn:active {
  transform: scale(0.95) !important;
}

@keyframes studioPulseSelect {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1.02); }
}

html:has(.uc-avatar-studio-route),
body:has(.uc-avatar-studio-route) {
  overflow: hidden;
}

/* ── Shared Studio document (studio.html) ── */

html.uc-studio-html,
body.uc-studio-shell {
  height: 100%;
  max-height: 100dvh;
}

body.uc-studio-shell {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--uc-chrome);
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.uc-studio-shell #mainViewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.uc-studio-shell #canvasContainer {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

body.uc-studio-shell #avatarCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

body.uc-studio-shell aside.uc-studio-dock {
  flex: 0 0 420px;
  width: 420px;
  max-width: 42vw;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.uc-studio-shell .uc-studio-dock-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body.uc-studio-shell .uc-studio-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.uc-studio-shell .uc-studio-rail {
  max-width: min(95vw, 920px);
}

/* Touch targets */
body.uc-studio-shell .nav-tab,
body.uc-studio-shell .expression-btn,
body.uc-studio-shell .preset-btn,
body.uc-studio-shell .uc-studio-toolbar button {
  min-height: 44px;
}

/* ── Tablet ── */

@media (max-width: 1100px) {
  body.uc-studio-shell aside.uc-studio-dock {
    flex-basis: 360px;
    width: 360px;
    max-width: 40vw;
  }

  body.uc-studio-shell #mainViewport > header {
    align-items: flex-start;
    gap: 12px;
  }

  body.uc-studio-shell .uc-studio-toolbar {
    max-width: 62%;
    justify-content: flex-end;
  }
}

/* ── Phone / small tablet: stacked preview + dock ── */

@media (max-width: 900px) {
  body.uc-studio-shell {
    flex-direction: column;
  }

  body.uc-studio-shell #mainViewport {
    flex: 0 0 auto;
    height: min(48dvh, 420px);
    max-height: 48dvh;
  }

  body.uc-studio-shell #mainViewport > header {
    position: relative;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, var(--uc-scrim-strong) 70%, transparent 100%);
    pointer-events: auto;
  }

  body.uc-studio-shell #mainViewport > header > div:first-child {
    width: 100%;
    gap: 10px;
  }

  body.uc-studio-shell #mainViewport > header h1 {
    font-size: clamp(1.15rem, 5.5vw, 1.55rem);
    letter-spacing: 0.04em;
  }

  body.uc-studio-shell #mainViewport > header p {
    display: none;
  }

  body.uc-studio-shell .uc-studio-brand-badge {
    display: none;
  }

  body.uc-studio-shell .uc-studio-toolbar {
    width: 100%;
    max-width: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.uc-studio-shell .uc-studio-toolbar::-webkit-scrollbar {
    display: none;
  }

  /* Compact action chips: keep icons + short labels readable */
  body.uc-studio-shell .uc-studio-toolbar button {
    flex: 0 0 auto;
    padding: 10px 12px;
    font-size: 10px;
    min-height: 42px;
  }

  body.uc-studio-shell #canvasContainer {
    min-height: 0;
    padding: 0 8px 56px;
  }

  body.uc-studio-shell #avatarCanvas {
    width: min(100%, 360px);
    max-height: calc(48dvh - 132px);
    height: auto;
  }

  /* Expressions + presets rail sits over the stage bottom */
  body.uc-studio-shell .uc-studio-rail {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 16px);
    max-width: none;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }

  body.uc-studio-shell aside.uc-studio-dock {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: none;
    height: auto;
    min-height: 0;
    border-left: 0 !important;
    border-top: 1px solid var(--uc-veil-soft);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.45);
  }

  body.uc-studio-shell aside.uc-studio-dock > nav {
    flex-shrink: 0;
    padding: 8px;
    gap: 6px;
  }

  body.uc-studio-shell aside.uc-studio-dock .nav-tab {
    padding: 10px 12px;
    font-size: 11px;
  }

  body.uc-studio-shell .uc-studio-dock-scroll {
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.uc-studio-shell .uc-studio-dock-scroll .grid {
    gap: 8px;
  }

  /* Larger color swatches for fingers */
  body.uc-studio-shell .uc-studio-dock-scroll #skinColorPalette button,
  body.uc-studio-shell .uc-studio-dock-scroll #eyeColorPalette button,
  body.uc-studio-shell .uc-studio-dock-scroll #hairColorPalette button,
  body.uc-studio-shell .uc-studio-dock-scroll #hatColorPalette button,
  body.uc-studio-shell .uc-studio-dock-scroll #outfitColorPalette button {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    min-height: 42px;
  }
}

/* Narrow phones */
@media (max-width: 430px) {
  /* Stage sizing for narrow phones is set once in the consolidated block further
     down — it used to be declared here too (44dvh) and again later (52dvh), so
     whichever came last silently won. */

  body.uc-studio-shell #mainViewport > header h1 {
    font-size: 1.1rem;
  }

  body.uc-studio-shell .uc-studio-brand-mark {
    width: 40px !important;
    height: 40px !important;
  }

  body.uc-studio-shell .uc-studio-toolbar .uc-studio-tool-label-long {
    display: none;
  }
}

/* Short landscape phones: keep customizer usable */
@media (max-height: 520px) and (orientation: landscape) {
  body.uc-studio-shell {
    flex-direction: row;
  }

  body.uc-studio-shell #mainViewport {
    flex: 1 1 48%;
    height: 100% !important;
    max-height: none !important;
  }

  body.uc-studio-shell aside.uc-studio-dock {
    flex: 1 1 52%;
    width: auto !important;
    max-width: none !important;
    height: 100%;
    border-top: 0 !important;
    border-left: 1px solid var(--uc-veil-soft) !important;
    border-radius: 0 !important;
    box-shadow: none;
  }

  body.uc-studio-shell #mainViewport > header {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
  }

  body.uc-studio-shell .uc-studio-brand-badge {
    display: none;
  }

  body.uc-studio-shell #canvasContainer {
    padding-bottom: 48px;
  }

  body.uc-studio-shell #avatarCanvas {
    max-height: calc(100dvh - 96px);
    max-width: min(100%, 320px);
  }
}

/* ── Dev-only controls ──
   Review tooling (share code / review pack / load / engine badge) is hidden
   unless the <html> element carries .uc-dev, which the head script sets. The
   rule is written "hidden unless opted in" so production is the default even
   if that script fails to run. */

html:not(.uc-dev) [data-uc-dev-only] {
  display: none !important;
}

/* ── Mobile action drawer ──
   The toolbar used to be a horizontal scroll strip on phones, which pushed
   Export / Use Avatar off-screen where nobody found them. Below 900px the same
   toolbar element becomes a slide-in drawer — no cloned nodes, so every existing
   button id and listener keeps working. */

.uc-studio-menu-toggle,
.uc-studio-menu-close,
.uc-studio-menu-heading {
  display: none;
}

@media (max-width: 900px) {
  body.uc-studio-shell .uc-studio-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(23, 23, 23, 0.94);
    border: 1px solid var(--uc-veil-soft);
    color: var(--uc-text-on-primary);
    font-size: 18px;
    box-shadow: 0 4px 14px var(--uc-scrim);
  }

  body.uc-studio-shell .uc-studio-menu-toggle:active {
    transform: scale(0.94);
  }

  body.uc-studio-shell .uc-studio-menu-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--uc-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--uc-veil-soft);
  }

  body.uc-studio-shell .uc-studio-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--uc-veil-weak);
    border: 1px solid var(--uc-veil-soft);
    color: var(--uc-text-on-primary);
    font-size: 15px;
  }

  body.uc-studio-shell .uc-studio-toolbar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 70;
    width: min(84vw, 330px);
    height: 100dvh;
    max-width: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 9px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(22px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, var(--uc-chrome) 0%, var(--uc-chrome) 100%);
    border-left: 1px solid var(--uc-veil-soft);
    box-shadow: -20px 0 44px var(--uc-scrim-strong);
    transform: translateX(102%);
    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    visibility: hidden;
  }

  body.uc-studio-shell.uc-studio-menu-open .uc-studio-toolbar {
    transform: translateX(0);
    visibility: visible;
  }

  /* The drawer lives inside <header> (z-index 20), so its own z-index is scoped
     to that stacking context and the dock (z-index 30) painted over it. Lift the
     header itself while the drawer is open. */
  body.uc-studio-shell.uc-studio-menu-open #mainViewport > header {
    z-index: 80;
  }

  body.uc-studio-shell .uc-studio-toolbar > button,
  body.uc-studio-shell .uc-studio-toolbar > span {
    width: 100%;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
    font-size: 12px;
    min-height: 52px;
    border-radius: 14px;
    /* These carry Tailwind's `transition-all`, which also animates the
       inherited visibility flip — leaving them visibility:hidden for the
       length of the slide, so focus() on open was a silent no-op.
       Transition only the paint properties. */
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  }

  /* Labels are the whole point of the drawer — keep them even on narrow phones. */
  body.uc-studio-shell .uc-studio-toolbar .uc-studio-tool-label-long {
    display: inline !important;
  }

  body.uc-studio-shell .uc-studio-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 69;
    background: var(--uc-scrim-strong);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.uc-studio-shell.uc-studio-menu-open .uc-studio-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Reclaim vertical space for the avatar ──
     Measured on a 812px phone the stage only got 41% of the screen, with 57px
     going to an engine-credits footer and 66px to the tab strip. Trim the chrome
     and hand the difference to the stage. */

  /* Engine credit line is desktop chrome; on a phone it is 57px of nothing. */
  body.uc-studio-shell aside.uc-studio-dock > footer {
    display: none;
  }

  /* Slimmer category strip. */
  body.uc-studio-shell aside.uc-studio-dock > nav {
    padding: 5px 8px !important;
    gap: 4px;
  }

  body.uc-studio-shell aside.uc-studio-dock .nav-tab {
    padding: 8px 11px;
    font-size: 10.5px;
  }

  /* Compact the pose/expression rail and stop reserving so much canvas padding. */
  body.uc-studio-shell .uc-studio-rail {
    bottom: 6px;
    gap: 5px;
    padding: 5px;
    border-radius: 14px;
  }

  body.uc-studio-shell .uc-studio-rail button {
    padding: 7px 10px;
    font-size: 10.5px;
    min-height: 38px;
  }

  body.uc-studio-shell #canvasContainer {
    padding: 0 8px 46px;
  }

  body.uc-studio-shell #mainViewport {
    height: min(60dvh, 520px);
    max-height: 60dvh;
  }

  body.uc-studio-shell #avatarCanvas {
    width: min(100%, 440px);
    max-height: calc(60dvh - 78px);
  }

  /* ── Swipeable option rails ──
     The Face tab alone stacked 11 two-column grids: 3688px of content in a 287px
     window, ~13 screens of scrolling to reach the last option. Each grid becomes
     a single horizontal rail instead, so a category is a swipe rather than a
     scroll hunt, and the whole tab collapses to roughly a third of the height. */
  body.uc-studio-shell .uc-studio-dock-scroll .grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Bleed to the screen edges so the rail reads as scrollable. */
    margin-inline: -14px;
    padding-inline: 14px;
    padding-bottom: 2px;
  }

  body.uc-studio-shell .uc-studio-dock-scroll .grid::-webkit-scrollbar {
    display: none;
  }

  body.uc-studio-shell .uc-studio-dock-scroll .grid > button {
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 52px;
    scroll-snap-align: start;
    border-radius: 16px;
    font-size: 11.5px;
    padding: 12px 14px;
  }

  /* Colour swatches stay circular and finger-sized in their rail. */
  body.uc-studio-shell .uc-studio-dock-scroll #skinColorPalette > button,
  body.uc-studio-shell .uc-studio-dock-scroll #eyeColorPalette > button,
  body.uc-studio-shell .uc-studio-dock-scroll #hairColorPalette > button,
  body.uc-studio-shell .uc-studio-dock-scroll #hatColorPalette > button,
  body.uc-studio-shell .uc-studio-dock-scroll #outfitColorPalette > button {
    min-width: 46px !important;
    width: 46px !important;
    height: 46px !important;
    min-height: 46px;
    border-radius: 999px;
  }

  /* Tighter rhythm between sections now that each is one row tall. */
  body.uc-studio-shell .uc-studio-dock-scroll {
    padding: 12px 14px calc(84px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.uc-studio-shell .uc-studio-dock-scroll > div,
  body.uc-studio-shell .uc-studio-dock-scroll .border-t {
    padding-top: 12px !important;
  }

  body.uc-studio-shell .uc-studio-dock-scroll h3 {
    margin-bottom: 8px !important;
  }

  /* ── Persistent quick actions ──
     Shuffle + Use Avatar are the whole loop for a casual user; without this they
     live behind the hamburger and every try-something costs three taps. */
  body.uc-studio-shell .uc-studio-quickbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(10, 10, 12, 0.72) 0%, rgba(10, 10, 12, 0.97) 45%);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--uc-veil-weak);
  }

  body.uc-studio-shell .uc-studio-quickbar button {
    flex: 1 1 0;
    min-height: 52px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--uc-veil-soft);
    color: var(--uc-text-on-primary);
    background: var(--uc-veil-weak);
  }

  body.uc-studio-shell .uc-studio-quickbar button:active {
    transform: scale(0.97);
  }

  body.uc-studio-shell .uc-studio-quickbar .uc-quick-shuffle {
    background: linear-gradient(135deg, var(--uc-warning), var(--uc-gold-dim));
    border-color: var(--uc-veil-strong);
    color: var(--uc-text-on-gold);
  }

  body.uc-studio-shell .uc-studio-quickbar .uc-quick-save {
    background: var(--uc-surface);
    color: var(--uc-border-strong);
    border-color: var(--uc-border);
  }

  /* Drawer and its backdrop must clear the quick bar. */
  body.uc-studio-shell.uc-studio-menu-open .uc-studio-quickbar {
    display: none;
  }
}

/* Quick bar is phone-only; desktop keeps the full toolbar. */
.uc-studio-quickbar {
  display: none;
}

/* ── Looks picker ──
   Centred dialog on desktop, bottom sheet on phones. Replaces the 26 preset
   buttons that used to sit inline in the pose rail. */

.uc-looks-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uc-looks-modal[hidden] {
  display: none;
}

.uc-looks-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(3px);
}

.uc-looks-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 32px));
  max-height: min(74dvh, 620px);
  background: linear-gradient(180deg, var(--uc-chrome) 0%, var(--uc-chrome) 100%);
  border: 1px solid var(--uc-veil-soft);
  border-radius: 22px;
  box-shadow: 0 26px 60px var(--uc-scrim-strong);
  overflow: hidden;
}

.uc-looks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--uc-veil-weak);
  flex-shrink: 0;
}

.uc-looks-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--uc-veil-weak);
  border: 1px solid var(--uc-veil-soft);
  color: var(--uc-text-on-primary);
}

.uc-looks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.uc-looks-grid .preset-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--uc-veil-weak);
  border: 1px solid var(--uc-veil-weak);
  color: var(--uc-text-on-primary);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.uc-looks-grid .preset-btn:hover {
  background: var(--uc-accent-wash);
  border-color: var(--uc-accent-wash-strong);
}

.uc-looks-grid .preset-btn:active {
  transform: scale(0.97);
}

/* Hero look — flagged so it reads as the showcase entry. */
.uc-looks-grid .preset-btn.uc-look-hero {
  background: var(--uc-accent-wash);
  border-color: var(--uc-accent-wash-strong);
  color: var(--uc-gold);
}

.uc-looks-grid .preset-btn.uc-look-hero:hover {
  background: var(--uc-accent-wash);
}

@media (min-width: 901px) {
  .uc-looks-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .uc-looks-modal {
    align-items: flex-end;
  }

  .uc-looks-sheet {
    width: 100%;
    max-height: 80dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  /* The dock turns every .grid into a horizontal rail on phones — the looks
     grid is a real grid and must opt out of that. */
  .uc-looks-grid {
    display: grid !important;
    overflow-x: hidden !important;
    margin-inline: 0 !important;
  }
}

/* Narrow phones: single source of truth for stage sizing. */
@media (max-width: 430px) {
  body.uc-studio-shell #mainViewport {
    height: min(58dvh, 470px);
    max-height: 58dvh;
  }

  body.uc-studio-shell #avatarCanvas {
    max-height: calc(58dvh - 74px);
  }
}

/* Landscape phones: drawer slides from the right over a row layout too. */
@media (max-height: 520px) and (orientation: landscape) {
  body.uc-studio-shell #mainViewport {
    height: 100% !important;
  }

  body.uc-studio-shell #avatarCanvas {
    max-height: calc(100dvh - 88px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #avatarCanvas,
  .animate-pulse,
  .animate-ping {
    animation: none !important;
  }

  body.uc-studio-shell .uc-studio-toolbar,
  body.uc-studio-shell .uc-studio-menu-backdrop {
    transition: none !important;
  }
}

/* ── Pose Angle, Shimmer Glow & Toast Feedback Pill ── */

.active-pose {
  background: var(--uc-gold-dim) !important;
  color: var(--uc-text-on-gold) !important;
  font-weight: 800 !important;
  border-color: var(--uc-gold) !important;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.4);
}

.canvas-ambient-shimmer {
  filter: drop-shadow(0 0 25px rgba(234, 179, 8, 0.45)) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.7)) !important;
  animation: canvasAmbientPulse 3s ease-in-out infinite alternate;
}

@keyframes canvasAmbientPulse {
  0% {
    filter: drop-shadow(0 0 15px rgba(234, 179, 8, 0.25)) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.7));
  }
  100% {
    filter: drop-shadow(0 0 35px rgba(234, 179, 8, 0.6)) drop-shadow(0 25px 35px rgba(0, 0, 0, 0.85));
  }
}

#ucSharePillToast.uc-toast-show {
  opacity: 1 !important;
  transform: translate(-50%, 0) scale(1) !important;
}

/* Pro option advertising (locks only; preview stays selectable) */
.uc-studio-pro-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 3.25rem;
}

.uc-studio-pro-option-label {
  display: block;
  line-height: 1.2;
}

.uc-studio-pro-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fef3c7;
  border: 1px solid rgba(234, 179, 8, 0.55);
  background: rgba(234, 179, 8, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.uc-studio-pro-option.uc-studio-pro-locked {
  border-color: rgba(234, 179, 8, 0.35) !important;
}

.uc-studio-pro-option.uc-studio-pro-locked .uc-studio-pro-badge {
  color: #fde68a;
}

