@charset "UTF-8";

/* V1.4 mobile workbench
   Desktop and tablet retain the established layout. JavaScript measures the
   live sticky stack and may replace these safe defaults with inline values. */
:root {
  --mobile-full-stage-height: clamp(380px, 57svh, 480px);
  --mobile-header-height: 64px;
  --mobile-rail-height: 60px;
  --mobile-toolbar-height: 56px;
  --mobile-stage-content-offset: 69px;
  --mobile-sticky-offset: calc(var(--mobile-header-height) + var(--mobile-rail-height));
  --mobile-sticky-stack-height: calc(
    var(--mobile-sticky-offset) +
    var(--mobile-toolbar-height) +
    clamp(160px, 24svh, 208px)
  );
}

/* Mobile-only helpers must never alter the verified desktop/tablet flow. */
.mobile-workbench-sentinel,
.mobile-stage-toolbar-slot,
.mobile-stage-placeholder,
.mobile-actions-slot,
.mobile-wardrobe-hint,
.job-disclosure-toggle,
.stage-preview-expand-btn {
  display: none;
}

.mobile-preview-details,
#mobile-stage-status {
  display: none;
}

.mobile-full-stage-sizer {
  position: fixed;
  width: 0;
  height: var(--mobile-full-stage-height);
  visibility: hidden;
  pointer-events: none;
  contain: strict;
}

/* Touch-action applies before JS receives pointerdown, including hybrid devices. */
.buddy-drag-handle {
  touch-action: pan-y;
}

/* A collapsed mobile disclosure is always expanded again on desktop. */
#job-disclosure-panel,
#job-disclosure-panel[hidden] {
  display: block !important;
}

@media (max-width: 720px) {
  html:not(.mobile-workbench-ready) .workspace {
    visibility: hidden;
  }

  html {
    width: 100%;
    max-width: 100%;
    scroll-padding-top: calc(var(--mobile-header-height) + var(--mobile-rail-height) + 8px);
  }

  body {
    width: 100%;
    max-width: 100%;
  }

  html.mobile-preview-docked {
    scroll-padding-top: calc(var(--mobile-sticky-stack-height) + 8px);
  }

  #game-shell {
    width: 100%;
    max-width: 100%;
  }

  /* Compact, single-line mobile header. */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    width: 100%;
    min-height: 0;
    padding:
      max(6px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      6px
      max(8px, env(safe-area-inset-left));
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 6px;
    overflow: visible;
  }

  .topbar .brand {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    gap: 0;
  }

  .topbar .brand > div:last-child {
    width: 100%;
    min-width: 0;
  }

  .topbar .brand-ornament,
  .topbar .brand-kicker {
    display: none !important;
  }

  .topbar .brand-title {
    display: block;
    width: 100%;
    max-width: 100%;
    padding-block: 0.08em 0.14em;
    overflow: hidden;
    font-size: clamp(0.98rem, 4.8vw, 1.28rem);
    line-height: 1.06;
    letter-spacing: 0.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .utility-actions {
    display: flex;
    flex: 0 0 auto;
    grid-template-columns: none;
    width: auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
  }

  .topbar .utility-actions .utility-btn,
  .topbar .utility-toggle,
  .topbar #music-btn.utility-toggle,
  .topbar #motion-btn.utility-toggle {
    position: relative;
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    overflow: visible;
    border-radius: 13px;
    transform: none;
  }

  .topbar .utility-btn .utility-label,
  .topbar .utility-toggle .utility-label,
  .topbar .utility-switch {
    display: none !important;
  }

  .topbar .utility-toggle .utility-icon,
  .topbar .utility-toggle > span[aria-hidden="true"]:not(.utility-switch),
  .topbar #help-btn > span[aria-hidden="true"] {
    display: grid !important;
    place-items: center;
    color: var(--brass-light);
    font-size: 1.18rem;
    line-height: 1;
  }

  /* A dot communicates state at a glance; the slash makes "off" distinct
     without relying on color alone. */
  .topbar .utility-toggle::before {
    position: absolute;
    right: 5px;
    bottom: 5px;
    z-index: 2;
    width: 8px;
    height: 8px;
    pointer-events: none;
    content: "";
    border: 1px solid rgba(255, 245, 216, 0.82);
    border-radius: 50%;
  }

  .topbar .utility-toggle[aria-pressed="true"] {
    border-color: var(--cyan);
    background: linear-gradient(180deg, #2d7359, #124638);
    box-shadow:
      inset 0 1px rgba(255, 255, 255, 0.18),
      0 3px 0 rgba(25, 12, 8, 0.5),
      0 0 15px rgba(125, 231, 228, 0.31);
    transform: none;
  }

  .topbar .utility-toggle[aria-pressed="true"]::before {
    background: var(--cyan);
    box-shadow: 0 0 7px var(--cyan);
  }

  .topbar .utility-toggle[aria-pressed="false"]::before {
    background: #d8aa73;
    box-shadow: 0 0 0 2px rgba(44, 20, 14, 0.45);
  }

  .topbar .utility-toggle[aria-pressed="false"]::after {
    position: absolute;
    top: 50%;
    left: 8px;
    z-index: 3;
    width: 28px;
    height: 2px;
    pointer-events: none;
    content: "";
    border-radius: 999px;
    background: #ffe2b1;
    box-shadow: 0 1px 0 rgba(42, 18, 12, 0.88);
    transform: translateY(-50%) rotate(-43deg);
    transform-origin: center;
  }

  .topbar .utility-btn:active:not(:disabled) {
    transform: scale(0.96);
  }

  /* Keep the document as the vertical scroller so sticky descendants work. */
  .workspace {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding:
      9px
      max(9px, env(safe-area-inset-right))
      9px
      max(9px, env(safe-area-inset-left));
    flex-direction: column;
    gap: 9px;
    overflow: visible !important;
  }

  .category-rail {
    position: sticky;
    top: var(--mobile-header-height);
    z-index: 26;
    order: 1;
    width: 100%;
    min-width: 0;
    height: var(--mobile-rail-height);
    min-height: var(--mobile-rail-height);
    max-height: var(--mobile-rail-height);
    overflow: hidden;
    box-shadow:
      0 8px 18px rgba(0, 0, 0, 0.32),
      inset 0 0 0 2px rgba(36, 18, 12, 0.78),
      inset 0 0 0 4px rgba(255, 214, 115, 0.08);
  }

  .category-rail-scroll {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-workbench-sentinel {
    display: block;
    order: 2;
    width: 100%;
    height: 1px;
    min-height: 1px;
    margin-bottom: -1px;
    pointer-events: none;
    visibility: hidden;
  }

  .stage-wrap {
    order: 3;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    scroll-margin-top: 0;
  }

  /* The coachmark remains anchored to the canvas after the HUD is moved into
     its own toolbar row. */
  .customization-coachmark {
    top: calc(var(--mobile-stage-content-offset, 69px) + clamp(96px, 23%, 126px));
  }

  .mobile-stage-placeholder {
    order: 4;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .wardrobe {
    position: relative;
    order: 5;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    scroll-margin-top: 0;
  }

  .mobile-actions-slot {
    display: block;
    order: 6;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mobile-actions-slot:empty,
  .mobile-stage-toolbar-slot:empty {
    display: none;
  }

  /* HUD is moved here on mobile; it is intentionally outside the canvas. */
  .mobile-stage-toolbar-slot {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: var(--mobile-toolbar-height);
    overflow: hidden;
    border: 1px solid rgba(242, 196, 88, 0.5);
    border-radius: 16px 13px 12px 11px;
    background:
      linear-gradient(145deg, rgba(17, 62, 49, 0.98), rgba(5, 28, 26, 0.98)),
      repeating-linear-gradient(90deg, transparent 0 38px, rgba(255, 255, 255, 0.025) 39px 41px);
    box-shadow:
      inset 0 0 0 2px rgba(36, 18, 12, 0.72),
      0 6px 15px rgba(0, 0, 0, 0.28);
  }

  #stage-hud {
    --stage-hud-control-height: 44px;
    position: static;
    inset: auto;
    z-index: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: var(--mobile-toolbar-height);
    padding: 5px;
    align-items: center;
    gap: 5px;
    pointer-events: none;
  }

  #stage-hud .stage-status-cluster {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    width: 100%;
    min-width: 0;
    max-width: none;
    align-items: center;
    gap: 5px;
  }

  #stage-hud .stage-status-cluster .status-pill {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 44px;
    padding: 5px 9px;
    align-items: center;
    border-radius: 13px;
    font-size: clamp(0.64rem, 2.7vw, 0.73rem);
    line-height: 1.14;
    text-overflow: clip;
    white-space: normal;
  }

  #stage-hud #stage-status {
    display: -webkit-box;
    min-width: 0;
    max-height: 2.3em;
    overflow: hidden;
    line-height: 1.14;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* Preserve the intentionally quiet, orb-only state. */
  #stage-hud .stage-status-cluster .status-pill.is-orb-only {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding: 0;
    justify-content: center;
  }

  #stage-hud .status-pill.is-orb-only #stage-status {
    display: none;
  }

  .stage-wrap.is-resetting #stage-hud .status-dot {
    animation: reset-status-pulse 640ms ease-in-out infinite alternate;
  }

  #stage-hud .stage-undo-btn,
  #stage-preview-expand-btn {
    position: relative;
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 220, 137, 0.5);
    border-radius: 12px;
    color: var(--cream);
    background: rgba(4, 24, 22, 0.94);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: auto;
  }

  #stage-preview-expand-btn {
    display: none;
  }

  .mobile-preview-docked #stage-hud {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .mobile-preview-docked #stage-preview-expand-btn {
    display: inline-grid;
  }

  #stage-preview-expand-btn:hover:not(:disabled),
  #stage-preview-expand-btn[aria-expanded="true"] {
    border-color: var(--cyan);
    color: #fff;
    background: linear-gradient(180deg, rgba(34, 88, 70, 0.98), rgba(8, 42, 37, 0.98));
    box-shadow:
      0 3px 10px rgba(0, 0, 0, 0.24),
      inset 0 1px rgba(255, 255, 255, 0.11),
      0 0 13px rgba(125, 231, 228, 0.2);
  }

  .stage-preview-expand-icon {
    color: var(--brass-light);
    font-size: 1.12rem;
    line-height: 1;
    transform: translate(-1px, 1px);
  }

  #stage-preview-expand-btn[aria-expanded="true"] .stage-preview-expand-icon {
    transform: rotate(180deg) translate(-1px, 1px);
  }

  .topbar .utility-btn:focus-visible,
  #stage-hud .stage-undo-btn:focus-visible,
  #stage-preview-expand-btn:focus-visible,
  #job-disclosure-toggle:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(125, 231, 228, 0.23), 0 0 16px rgba(125, 231, 228, 0.2);
  }

  #stage-hud .stage-undo-label,
  .stage-preview-expand-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  /* The canvas no longer carries a competing drag instruction. It remains in
     the accessibility tree through aria-describedby. */
  #stage-hud .drop-hint {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .mobile-wardrobe-hint {
    display: block;
    width: 100%;
    margin: 0 0 9px;
    padding: 7px 10px;
    border: 1px solid rgba(125, 231, 228, 0.34);
    border-radius: 11px;
    color: var(--cream-2);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.018em;
    line-height: 1.3;
    text-align: center;
    background: rgba(5, 37, 33, 0.72);
  }

  .mobile-wardrobe-hint:empty {
    display: none;
  }

  /* Portrait docking is class-driven so short landscape keeps normal flow. */
  .mobile-preview-docked .stage-wrap {
    position: sticky;
    top: var(--mobile-sticky-offset);
    z-index: 24;
    align-self: stretch;
    background: var(--midnight);
    opacity: 1;
    transform: translateZ(0);
    transition: opacity 160ms ease, transform 180ms ease;
  }

  .mobile-preview-docked .stage-card {
    flex: 0 0 auto;
    width: 100%;
    height: clamp(160px, 24svh, 208px);
    min-height: 0 !important;
    max-height: 208px;
    opacity: 1;
    transform: translateZ(0);
    transition-property: opacity, transform;
    transition-duration: 160ms, 180ms;
    transition-timing-function: ease, ease;
  }

  .mobile-preview-docked .mobile-stage-placeholder {
    display: block;
  }

  .mobile-preview-docked .stage-wrap,
  .mobile-preview-docked .wardrobe,
  .mobile-preview-docked .item-grid,
  .mobile-preview-docked .profile-card,
  .mobile-preview-docked #job-disclosure-toggle,
  .mobile-preview-docked #job-disclosure-panel {
    scroll-margin-top: 0;
  }

  .mobile-preview-docked .speech-bubble {
    top: 11px;
    left: 10px;
    width: min(54%, 205px);
    max-height: calc(100% - 22px);
    padding: 7px 9px;
    overflow: hidden;
    font-size: clamp(0.66rem, 2.65vw, 0.78rem);
    line-height: 1.16;
  }

  /* Wardrobe and job choices remain ordinary document content. */
  .wardrobe .item-grid,
  .wardrobe .profile-card,
  .wardrobe .personality-grid {
    max-height: none;
    overflow: visible;
  }

  .job-disclosure-toggle {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px 8px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255, 218, 133, 0.38);
    border-radius: 12px;
    color: var(--cream);
    text-align: left;
    background: linear-gradient(145deg, rgba(16, 63, 50, 0.94), rgba(7, 35, 31, 0.96));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 3px 0 rgba(25, 12, 8, 0.5);
  }

  .job-disclosure-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
  }

  .job-disclosure-eyebrow {
    color: var(--brass-light);
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  #job-disclosure-summary {
    min-width: 0;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 0.92rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .job-disclosure-chevron {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    margin: 0 5px 5px 0;
    border-right: 3px solid var(--brass-light);
    border-bottom: 3px solid var(--brass-light);
    transform: rotate(45deg);
    transition: transform 160ms ease, margin 160ms ease;
  }

  #job-disclosure-toggle[aria-expanded="true"] .job-disclosure-chevron {
    margin-top: 6px;
    margin-bottom: 0;
    transform: rotate(225deg);
  }

  #job-disclosure-panel,
  #job-disclosure-panel:not([hidden]) {
    display: block !important;
  }

  #job-disclosure-panel[hidden] {
    display: none !important;
  }

  #job-disclosure-toggle + #job-disclosure-panel {
    margin-top: 10px;
  }

  #job-disclosure-panel > .profile-heading {
    display: none;
  }

  /* Reparented action deck: Surprise | Talk, then two full-width decisions. */
  .mobile-actions-slot > .workbench-controls,
  .workbench-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 7px;
    gap: 8px;
  }

  .workbench-controls > #surprise-btn {
    grid-column: 1;
    grid-row: 1;
  }

  .workbench-controls > #talk-action {
    grid-column: 2;
    grid-row: 1;
  }

  .workbench-controls > #reset-btn {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workbench-controls > .finish-cta {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .workbench-controls > #surprise-btn,
  .workbench-controls > #talk-action,
  .workbench-controls > #reset-btn,
  .workbench-controls > .finish-cta,
  .workbench-controls #talk-btn,
  .workbench-controls #finish-btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .workbench-controls > #talk-action,
  .workbench-controls > .finish-cta {
    display: grid;
  }

  .workbench-controls #talk-btn,
  .workbench-controls #finish-btn {
    height: 100%;
  }
}

@media (max-width: 430px) {
  .customization-coachmark {
    top: calc(var(--mobile-stage-content-offset, 69px) + clamp(88px, 22%, 112px));
  }
}

@media (max-width: 720px) and (hover: none) and (pointer: coarse) {
  .mobile-preview-docked .buddy-drag-handle {
    pointer-events: none;
    touch-action: pan-y;
  }
}

/* Short landscape keeps the conventional stage flow even if a stale class
   survives rotation. The category rail remains available below the header. */
@media (max-width: 720px) and (orientation: landscape) and (max-height: 560px) {
  html,
  html.mobile-preview-docked {
    scroll-padding-top: 8px;
  }

  .topbar,
  .category-rail {
    position: relative;
    top: auto;
  }

  .stage-wrap,
  .wardrobe,
  .item-grid,
  .profile-card,
  #job-disclosure-toggle,
  #job-disclosure-panel {
    scroll-margin-top: 8px;
  }

  .mobile-preview-docked #stage-hud {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-preview-docked #stage-preview-expand-btn {
    display: none;
  }

  .mobile-preview-docked .stage-wrap {
    position: relative;
    top: auto;
    z-index: auto;
    transform: none;
  }

  .mobile-preview-docked .stage-card {
    height: auto;
    min-height: clamp(280px, 72svh, 380px) !important;
    max-height: none;
    transform: none;
  }

  .mobile-preview-docked .mobile-stage-placeholder {
    display: none;
  }

  .mobile-preview-docked .stage-wrap,
  .mobile-preview-docked .wardrobe,
  .mobile-preview-docked .item-grid,
  .mobile-preview-docked .profile-card,
  .mobile-preview-docked #job-disclosure-toggle,
  .mobile-preview-docked #job-disclosure-panel {
    scroll-margin-top: 8px;
  }
}

@media (max-width: 360px) {
  .topbar {
    gap: 3px;
  }

  .topbar .utility-actions {
    gap: 2px;
  }

  .topbar .brand-title {
    font-size: 0.94rem;
  }

  .workbench-controls > #surprise-btn {
    padding-right: 6px;
    padding-left: 42px !important;
    font-size: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-preview-docked .stage-wrap,
  .mobile-preview-docked .stage-card,
  .stage-preview-expand-icon,
  .job-disclosure-chevron,
  .topbar .utility-btn {
    transition: none !important;
  }
}

html[data-motion="gentle"] .mobile-preview-docked .stage-wrap,
html[data-motion="gentle"] .mobile-preview-docked .stage-card,
html[data-motion="gentle"] .stage-preview-expand-icon,
html[data-motion="gentle"] .job-disclosure-chevron {
  transition: none !important;
}

@media (forced-colors: active) and (max-width: 720px) {
  .mobile-stage-toolbar-slot,
  .mobile-wardrobe-hint,
  .job-disclosure-toggle,
  #stage-hud .status-pill,
  #stage-hud .stage-undo-btn,
  #stage-preview-expand-btn {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
    box-shadow: none;
  }

  .topbar .utility-toggle[aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -3px;
    box-shadow: none;
  }

  .topbar .utility-toggle::before,
  .topbar .utility-toggle[aria-pressed="true"]::before,
  .topbar .utility-toggle[aria-pressed="false"]::before,
  .topbar .utility-toggle[aria-pressed="false"]::after {
    border-color: ButtonText;
    background: ButtonText;
    box-shadow: none;
  }

  .job-disclosure-chevron {
    border-color: ButtonText;
  }

  .category-btn[aria-pressed="true"],
  .personality-btn[aria-pressed="true"] {
    outline: 3px solid Highlight;
    outline-offset: -4px;
  }
}
@media (hover: none), (pointer: coarse) {
  .item-card:hover:not(:disabled)[aria-pressed="true"],
  .item-card.is-selected:hover:not(:disabled),
  .item-card.active:hover:not(:disabled),
  .item-card[data-selected="true"]:hover:not(:disabled) {
    border-color: var(--cyan);
    background:
      radial-gradient(circle at 50% 28%, rgba(125, 231, 228, 0.23), transparent 43%),
      linear-gradient(150deg, #326e57, #163f35);
    box-shadow:
      inset 0 0 0 1px rgba(125, 231, 228, 0.17),
      0 0 0 1px var(--cocoa),
      0 5px 14px rgba(8, 25, 22, 0.38),
      0 0 15px rgba(125, 231, 228, 0.22);
    transform: none;
  }

  .personality-btn:hover:not(:disabled)[aria-pressed="true"],
  .personality-btn.is-active:hover:not(:disabled),
  .personality-btn.active:hover:not(:disabled) {
    color: var(--cocoa);
    border-color: #fff3c6;
    background: linear-gradient(145deg, var(--brass-light), var(--brass));
    box-shadow: 0 0 0 2px var(--cocoa), 0 0 15px rgba(255, 205, 98, 0.2);
    transform: none;
  }
}

/* V1.6: readable feedback and a clear, head-to-toe mobile fitting room. */
@media (max-width: 720px) {
  .stage-card {
    height: var(--mobile-full-stage-height);
    min-height: var(--mobile-full-stage-height);
  }

  #stage-hud {
    padding: 3px;
    gap: 4px;
    min-height: 50px;
  }

  #stage-hud .stage-status-cluster {
    gap: 4px;
  }

  #stage-hud .stage-status-cluster .status-pill {
    padding: 4px 7px;
    font-size: 13px;
    line-height: 1.25;
  }

  /* The original live region keeps its detailed copy and accessibility role. */
  #stage-hud #stage-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    max-height: none;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap !important;
    border: 0 !important;
  }

  #mobile-stage-status {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
  }

  .is-orb-only #mobile-stage-status {
    display: none;
  }

  .mobile-wardrobe-hint {
    font-size: 13px;
    letter-spacing: 0;
  }

  .stage-nameplate-role {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .stage-card > .speech-bubble {
    top: 14px;
    left: 12px;
    width: min(calc(100% - 36px), 280px);
    max-height: none;
    overflow: visible;
    font-size: 13px;
    line-height: 1.3;
  }

  #talk-action,
  .life-action {
    display: grid;
    grid-template-rows: minmax(44px, auto) auto;
    gap: 2px;
  }

  .workbench-controls #talk-btn {
    height: auto;
  }

  .coming-soon-action .coming-soon-popover {
    position: static !important;
    display: block !important;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 3px 6px;
    border: 0;
    color: var(--brass-light);
    background: none;
    box-shadow: none;
    font-size: 11px;
    line-height: 1.15;
    letter-spacing: 0;
    text-align: center;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    pointer-events: none;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .mobile-preview-docked .stage-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(116px, 0.9fr);
    column-gap: 8px;
    row-gap: 4px;
    padding-bottom: 4px;
  }

  .mobile-preview-docked .mobile-stage-toolbar-slot {
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .mobile-preview-docked .stage-card {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    height: clamp(160px, 24svh, 208px);
    min-height: 160px !important;
    max-height: none;
  }

  .mobile-preview-docked .mobile-preview-details {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    align-self: center;
    flex-direction: column;
    gap: 7px;
  }

  .mobile-preview-details .stage-nameplate,
  .mobile-preview-details .stage-nameplate:active:not(:disabled) {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    margin: 0;
    padding: 7px 6px;
    gap: 0;
    border-radius: 12px;
    box-shadow: inset 0 1px rgba(255, 246, 211, 0.15);
    transform: none !important;
    animation: none !important;
  }

  .mobile-preview-details .stage-nameplate::before,
  .mobile-preview-details .stage-nameplate::after,
  .mobile-preview-details .stage-nameplate-role {
    display: none;
  }

  .mobile-preview-details .stage-nameplate .stage-nameplate-name {
    overflow: visible;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-preview-details .speech-bubble {
    position: static;
    display: -webkit-box;
    width: 100%;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    max-height: 3.9em;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    overflow-wrap: anywhere;
    transform: none !important;
    animation: none !important;
  }

  .mobile-preview-details .speech-bubble:empty,
  .mobile-preview-details .speech-bubble::after {
    display: none;
  }

  .mobile-reaction-card {
    position: relative;
    min-width: 0;
    padding: 9px;
    border: 1px solid #b58b47;
    border-radius: 12px;
    background: #f7e6bb;
  }

  .mobile-reaction-card.has-more {
    padding-bottom: 28px;
  }

  .mobile-reaction-more:not([hidden]) {
    position: absolute;
    inset: 0;
    display: flex;
    min-height: 44px;
    width: 100%;
    padding: 6px 9px;
    align-items: flex-end;
    justify-content: flex-start;
    border: 0;
    border-radius: 12px;
    color: #543313;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    text-align: left;
    transform: none;
  }

  .mobile-reaction-more:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
  }
}
