.my-room-page .container { padding-bottom: 90px; }
.my-room-page [hidden] { display: none !important; }
html:has(.my-room-page), .my-room-page, .my-room-page * { scrollbar-width: none; }
html:has(.my-room-page)::-webkit-scrollbar, .my-room-page::-webkit-scrollbar, .my-room-page *::-webkit-scrollbar { display: none; width: 0; height: 0; }
.my-room-page h2 { font-size: 14px; font-weight: 700; margin: 12px 0 8px; color: var(--text-primary, #2a2328); }
.my-room-page .custom-cast-button, .room-dialog .custom-cast-button { min-height: 44px; background: #f3f4f6; color: #2a2328; border: 0; border-radius: 8px; box-shadow: none; padding: 8px 12px; font: inherit; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.room-icon { display: inline-block; flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.room-swatch { display: inline-block; flex: 0 0 auto; width: 16px; height: 16px; box-sizing: border-box; border: 1px solid rgb(42 35 40 / 18%); border-radius: 50%; }
.my-room-page button:disabled { opacity: 0.45; }
.room-viewport { position: relative; width: calc(100% + 2 * var(--app-content-inline-padding)); margin: 0 calc(-1 * var(--app-content-inline-padding)); }
.room-toolbar { position: absolute; inset: 15px 12px auto auto; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.room-switcher { position: absolute; top: 12px; left: 12px; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgb(255 255 255 / 78%); }
.room-switcher button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: #6e626a; font: inherit; font-size: 11px; }
.room-switcher button[aria-pressed="true"] { background: #fff; color: #2a2328; font-weight: 700; }
.room-toolbar .room-note { margin: 0; padding: 4px 0; }
.room-toolbar .custom-cast-button { pointer-events: auto; min-width: 52px; padding: 8px 12px; background: rgb(255 255 255 / 90%); font-size: 12px; font-weight: 600; }
.room-toolbar .room-icon { display: none; }
.room-note { font-size: 12px; line-height: 1.7; color: var(--text-secondary, #6e626a); margin: 8px 0; }
.room-stage { width: 100%; aspect-ratio: 1 / 1.04; background: #f5eee7; border-radius: 0; overflow: hidden; margin: 0; }
.room-stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.room-editor { border: 0; padding: 0; margin: 0; min-width: 0; }
.room-tabs, .room-choices, .room-actions { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.room-choices button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; background: transparent; color: #6e626a; min-height: 36px; min-width: 44px; padding: 0; font: inherit; font-size: 12px; }
.room-choices button[aria-pressed="true"] { color: #2a2328; font-weight: 700; }
.room-tabs { gap: 6px; padding-bottom: 0; }
.room-tabs button { box-sizing: border-box; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 36px; min-width: 44px; border: 0; background: transparent; padding: 0; color: #6e626a; font: inherit; font-size: 12px; line-height: 1.35; }
.room-tabs button > span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 28px; box-sizing: border-box; padding: 4px 8px; border: 0; border-radius: 999px; background: transparent; }
.room-tabs button[aria-pressed="true"] > span { background: #eef0f3; color: #2a2328; font-weight: 700; }
.room-setting-row { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 8px; }
.my-room-page .room-setting-row h2 { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; margin: 0; font-size: 12px; }
.room-setting-row .room-choices { min-width: 0; gap: 4px; padding: 0; }
.room-palette { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
.room-item { flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; border: 0; border-radius: 8px; background: transparent; padding: 0 0 8px; min-height: 100px; color: #2a2328; font: inherit; font-size: 11px; }
.room-item img { display: block; width: 96px; height: 84px; border-radius: 8px; object-fit: contain; }
.room-item svg { width: 54px; height: 44px; overflow: visible; }
.room-preview { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 96px; height: 84px; }
.room-preset .room-preview { width: 124px; height: 100px; }
.room-preset-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.my-room-page .room-preset-heading h2 { display: inline-flex; align-items: center; margin: 0; font-size: 12px; }
.room-preset-heading .custom-cast-button { background: transparent; font-size: 12px; padding: 4px 8px; }
.room-presets { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; }
.room-preset { display: flex; flex: 0 0 124px; flex-direction: column; align-items: center; gap: 6px; padding: 0 0 4px; border: 0; background: transparent; color: #6e626a; font: inherit; font-size: 11px; }
.room-preset img { display: block; width: 124px; height: 100px; object-fit: contain; border-radius: 8px; }
.room-preset[aria-pressed="true"] { color: #2a2328; font-weight: 700; }
.room-preset[aria-pressed="true"] img { outline: 1px solid #aaa5aa; outline-offset: -1px; }
.room-selected { padding: 0; margin-top: 0; }
.room-range { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #6e626a; margin: 8px 0; min-height: 44px; }
.room-range input { flex: 1; min-width: 0; accent-color: #6e626a; height: 44px; }
.room-cast { gap: 8px; margin-top: 12px; }
.room-cast img { width: 36px; height: 44px; object-fit: cover; border-radius: 4px; }
.room-person-settings { display: grid; margin: 4px 0; }
.room-person-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 52px; }
.room-person-row > span, .room-person-row > label { font-size: 12px; color: #6e626a; }
.room-choice-content { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 28px; box-sizing: border-box; padding: 4px 8px; border-radius: 999px; }
#roomPoses { text-align: right; text-align-last: right; appearance: none; -webkit-appearance: none; min-height: 44px; max-width: 100%; padding: 8px 24px 8px 12px; border: 0; border-radius: 0; background: transparent; color: #2a2328; font: inherit; font-size: 13px; }
.room-selected > summary { position: relative; padding-right: 24px; min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: #6e626a; font-size: 12px; list-style: none; }
.room-selected > summary::-webkit-details-marker { display: none; }
.my-room-page #roomChooseCast { position: relative; justify-self: end; justify-content: flex-end; min-width: 0; max-width: 100%; margin: 0; padding: 4px 24px 4px 12px; background: transparent; font-size: 13px; text-align: left; }
#roomChooseCast > span { min-width: 0; overflow-wrap: anywhere; }
#roomChooseCast > .room-icon, #roomPoses .room-icon { display: none; }
.room-person-settings .room-cast img { width: 24px; height: 30px; flex-shrink: 0; }
.room-pose-select { position: relative; justify-self: end; max-width: 100%; }
#roomChooseCast::after, .room-pose-select::after, .room-selected > summary::after { content: ''; position: absolute; right: 4px; top: 50%; width: 6px; height: 6px; box-sizing: border-box; border-top: 1px solid #6e626a; border-right: 1px solid #6e626a; transform: translateY(-50%) rotate(45deg); pointer-events: none; }
.room-shoot-area { display: grid; gap: 8px; margin: 12px 0 24px; }
.room-cast-hint { margin: 4px 0 0; font-size: 11px; text-align: center; }
.room-self-note, .room-photo-people, .room-photo-people > span { display: flex; align-items: center; gap: 8px; }
.room-self-note img, .room-photo-people img { width: 24px; height: 30px; border-radius: 4px; object-fit: cover; }
.room-photo-people { flex-wrap: wrap; gap: 12px; margin: 8px 0; font-size: 12px; }
#roomShoot, #roomGenerate { width: 100%; font-weight: 700; }
.room-gallery-section { padding-top: 8px; }
.room-gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-room-page .room-gallery-heading h2 { margin: 0; }
.room-album-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; color: var(--text-secondary, #6e626a); font-size: 12px; text-decoration: none; }
.room-gallery-section > .room-note { margin: 4px 0 0; }
.room-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.room-gallery:empty { display: none; }
.room-gallery button { padding: 0; background: transparent; border: 0; }
.room-gallery img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.room-dialog { box-sizing: border-box; border: 0; border-radius: 12px; padding: 20px 16px; width: calc(100% - 24px); max-width: 440px; max-height: 90dvh; overflow-y: auto; color: #2a2328; font-family: inherit; }
.room-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.room-dialog h2 { margin-top: 4px; padding-right: 28px; }
.room-photo { display: block; width: 100%; max-height: 57dvh; aspect-ratio: 3 / 4; object-fit: contain; margin: 12px auto; border-radius: 8px; }
.room-search { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px; border: 1px solid #d4d1d4; border-radius: 8px; margin-top: 12px; font: inherit; font-size: 14px; }
.room-cast-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.room-cast-results button { position: relative; display: block; box-sizing: border-box; min-width: 0; min-height: 44px; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #6E626A; color: var(--text-primary); font: inherit; box-shadow: none; }
.room-cast-results img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: inherit; }
.room-cast-results span { position: absolute; right: 4px; bottom: 4px; left: 4px; box-sizing: border-box; padding: 4px 2px; border-radius: 5px; background: rgba(42, 35, 40, .4); color: #FFF; font-size: 10px; font-weight: 500; line-height: 1.4; text-align: center; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.room-cast-results button[aria-pressed="true"] span { background: rgba(255, 255, 255, .94); color: var(--text-primary); font-weight: 700; text-shadow: none; }
.room-cast-results button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }

.room-loading { width: calc(100% + 2 * var(--app-content-inline-padding)); margin: 0 calc(-1 * var(--app-content-inline-padding)); }
.room-loading-stage { width: 100%; height: auto; aspect-ratio: 1 / 1.04; border-radius: 0; }
@media (prefers-reduced-motion: reduce) {
    .room-loading-stage::after { animation: none; }
}

/* Keep the finished photo as the surface, with touch controls over the image. */
.room-photo-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 6px; }
.room-photo-media { position: relative; }
.room-photo-dialog .room-photo { width: 100%; max-height: calc(100dvh - 128px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: 0; border-radius: 8px; }
.room-photo-dialog[data-state="result"] .room-photo { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.room-photo-dialog #roomPhotoClose { position: absolute; z-index: 4; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 90%); color: #2a2328; font-size: 24px; box-shadow: none; }
.room-photo-dialog .room-photo-download { position: absolute; z-index: 3; right: 8px; bottom: 8px; display: grid; place-items: center; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; background: rgb(255 255 255 / 90%); color: #2a2328; text-decoration: none; }
.room-photo-download .room-icon { width: 20px; height: 20px; }
.room-photo-dialog:not([data-state="result"]) .room-photo-download { display: none; }
.room-photo-dialog > .room-note, .room-photo-dialog > .room-photo-people, .room-photo-dialog > .error-message { margin: 12px 10px; }
.room-photo-dialog > .room-note:empty { display: none; }
.room-photo-dialog #roomGenerate { width: calc(100% - 16px); margin: 0 8px 8px; }
.room-photo-creating { box-sizing: border-box; min-height: min(420px, 62dvh); display: flex; flex-direction: column; justify-content: center; padding: 40px 8px 16px; }
.room-photo-creating .dress-up-generation-stage { width: min(240px, 66vw, 38dvh); }
.room-photo-dialog[data-state="creating"] .room-photo { display: none; }
.room-photo-dialog[data-state="creating"] > .room-note { text-align: center; margin: 0 8px 24px; }
.room-photo-dialog[data-state="loading"] .room-photo { visibility: hidden; }
.room-photo-dialog[data-state="result"][data-reveal="true"] .room-photo-media { animation: room-photo-reveal 520ms ease-out both; }
@keyframes room-photo-reveal {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .room-photo-dialog[data-state="result"][data-reveal="true"] .room-photo-media,
    .room-photo-creating .dress-up-generation-sparkle { animation: none; }
}

/* A quiet navigation row and one primary action keep attention on the room. */
#roomTabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
#roomTabs button { box-sizing: border-box; position: relative; min-height: 36px; font-size: 13px; }
#roomTabs button > span { padding: 4px 0; border-radius: 0; }
#roomTabs button[aria-pressed="true"] > span { background: transparent; }
#roomTabs button[aria-pressed="true"]::after { content: ''; position: absolute; bottom: -1px; left: calc(50% - 12px); width: 24px; height: 2px; border-radius: 2px; background: #2a2328; }
.room-shot-modes { justify-content: center; gap: 16px; }
.room-shot-modes button { font-size: 12px; }
.room-shot-modes button > span { padding: 4px 0; }
.room-shot-modes button[aria-pressed="true"] > span { background: transparent; }
.room-shot-modes .room-icon { display: none; }
.my-room-page #roomShoot { min-height: 48px; border-radius: 10px; background: #2a2328; color: #fff; font-size: 13px; font-weight: 600; }
.my-room-page .room-gallery-heading h2 { font-size: 12px; font-weight: 500; color: #6e626a; }
