/* Viewing room: preserve the source frame. UI controls are not media protection. */
.shell:has(#member:not([hidden])){max-width:1120px;padding-top:24px}
#member{padding:26px 30px;border-radius:20px;box-shadow:0 18px 65px #20475009}
.member-heading h1{font-size:23px}.member-heading p{color:var(--muted)}
.member-tabs{display:flex;overflow-x:auto;flex-wrap:nowrap;gap:8px;padding:6px 0 16px;margin:18px 0 24px}
.member-tabs button{flex:1 0 auto;padding:10px 18px;border-radius:24px;background:transparent;border-color:transparent}
.member-tabs button[aria-pressed=true]{background:var(--ink)}
.music-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.eyebrow{font-size:10px;letter-spacing:.16em;color:#337887;margin:0 0 8px;font-weight:650}
#member-music h2{margin:0;font-size:25px}.music-heading .intro{font-size:14px;margin:6px 0}
.collection-label{background:#ebf6f7;color:#277080;font-size:12px;border-radius:20px;padding:6px 12px;white-space:nowrap}
#music-status{margin:6px 0 12px;color:var(--muted)}
.music-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.82fr);gap:28px;align-items:start}
.listening-player{border:0;background:#f3f8f8;border-radius:16px}
.listening-stage{aspect-ratio:1;max-height:none!important;width:100%;isolation:isolate}
.listening-stage>img{display:block;pointer-events:none;opacity:.28;filter:blur(24px);transform:scale(1.12)}
.listening-stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.player-badge{position:relative;display:flex;gap:7px;align-items:center;font-size:12px;color:#123d49;background:#edf6f8;padding:10px 14px;pointer-events:none}
.player-badge img{border-radius:50%}.player-badge span:last-child{margin-left:auto;font-size:10px}
.music-controls{position:absolute;bottom:12px;left:12px;right:12px;border:1px solid #ffffff99;border-radius:14px;background:#f4fbf9ed;padding:7px 10px;backdrop-filter:blur(10px)}
.transport{display:flex;align-items:center;justify-content:space-between;gap:4px}.transport button{min-height:40px;padding:5px 9px;font-size:12px;background:transparent;border:0;border-radius:20px}
.transport #music-toggle{background:var(--ink);color:white;min-width:68px}.transport #music-mute{font-size:11px;color:var(--ink)}
.seek-row{display:flex;align-items:center;gap:8px;font-size:10px;font-variant-numeric:tabular-nums;color:#44616b}
.seek-row input{width:100%;min-width:0;accent-color:#177a87;height:24px;cursor:pointer}
.listening-caption{padding:16px 18px 18px}.listening-caption h3{font-size:21px}.listening-caption p{font-size:13px;line-height:1.6}
.music-library{min-width:0}.library-heading{display:flex;align-items:center;justify-content:space-between}.library-heading h3{margin:0 0 14px;font-size:16px}.library-heading span{font-size:12px;color:var(--muted)}
.search-label{font-size:12px;margin:0 0 6px;color:var(--muted)}input[type=search],select,textarea{font:inherit;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:white}
.listening-tracks{display:grid;grid-template-columns:1fr;gap:9px;margin:14px 0}
.listening-tracks button{padding:12px;border-color:transparent;background:#f4f8f8;gap:13px;border-radius:12px}
.listening-tracks img{width:54px;height:54px;border-radius:8px}.listening-tracks .track-copy{display:grid;gap:3px}.track-copy small{font-size:11px;color:var(--muted);font-weight:400}.track-copy strong{font-size:14px;font-weight:600}
.music-services{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:linear-gradient(110deg,#eaf6f5,#e2f1fc);border-radius:14px;margin-top:24px;padding:18px 20px}
.music-services div{flex:1 1 300px}.music-services h3{font-size:16px;margin:0 0 5px}.music-services p{margin:0;font-size:12px;color:var(--muted)}.music-services button{background:white;font-size:12px}
.account-actions{border-top:1px solid #e4eef0;margin-top:28px;padding-top:16px;gap:4px 14px}.account-actions a,.account-actions button{padding:3px 0;border:0;background:none;font-size:12px;min-height:36px}
#member-studio{max-width:780px;margin:0 auto}#member-studio h2{font-size:25px;margin:0 0 8px}#studio-form fieldset{border:1px solid var(--line);border-radius:14px;padding:18px 20px}#studio-form legend{padding:0 8px;font-size:14px}#studio-form fieldset:disabled{opacity:.65}#studio-media{max-width:100%;font:inherit;font-size:13px}#studio-result{display:block;max-width:100%;max-height:65vh;margin:16px auto;background:#eaf5f7;border-radius:12px}
@media(max-width:700px){.shell:has(#member:not([hidden])){padding:16px 10px 30px}#member{padding:18px 14px}.brand{font-size:20px;margin:4px 4px 14px}.member-tabs{gap:3px;padding-bottom:12px;margin:16px -2px 20px}.member-tabs button{padding:8px 12px;font-size:12px}.music-layout{grid-template-columns:1fr;gap:22px}.listening-player{width:100%;max-width:440px;justify-self:center}.music-heading .intro{font-size:12px}#member-music h2{font-size:23px}.collection-label{display:none}.music-services{padding:15px}.music-services button{flex:1}.account-actions{justify-content:center;gap:0 14px}#studio-form fieldset{padding:12px}.music-library>button{width:100%}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Video-first desktop layout, compact touch layout. No forced orientation/cropping. */
.shell:has(#member:not([hidden])){max-width:1440px}
#member{border-radius:16px;box-shadow:none}
.music-layout{grid-template-columns:minmax(0,1fr) 300px;gap:20px}
.listening-player{background:#c4dce2;border:1px solid #9ebfc9;border-radius:12px;color:#123e50}
.player-badge{background:linear-gradient(115deg,#d4e5ea,#b2ced8);color:#123e50;padding:10px 16px;border-bottom:1px solid #ffffff40}
.player-badge span:last-child{color:#204d5e;background:#ffffff40;border-radius:4px;padding:2px 6px}
.listening-stage{aspect-ratio:16/9;background:#e0ebee}
.listening-stage video{object-fit:contain;background:transparent}
.listening-caption{padding:16px 18px;background:linear-gradient(115deg,#d9e8ed,#b9d2dc)}
.listening-caption h3{font-size:20px;color:#123e50;font-weight:650}
.listening-caption p{color:#244e60;margin-top:5px}
.listening-caption{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;align-items:center}
.listening-caption h3{grid-column:1;grid-row:1;margin:0}
.listening-caption p{grid-column:1/-1;grid-row:2}
.music-membership-entry{grid-column:2;grid-row:1;margin:0;padding:6px 12px;min-height:40px;border:1px solid #80aab7;border-radius:22px;background:#f4fafb;color:#153f4c;font-size:12px;white-space:nowrap}
.player-badge .music-membership-entry{margin-left:auto;pointer-events:auto;min-height:44px;padding:4px 8px;border:0;background:transparent;font-size:12px;color:#21576a;text-decoration:underline;text-underline-offset:4px}
.player-badge:has(.music-membership-entry){padding-block:2px}
.shell>.brand{display:flex;align-items:center;gap:10px}
.shell>.brand img{width:38px;height:38px;flex:none}
.shell>.brand span{margin:0;font-size:20px;letter-spacing:0}
.shell>.brand small{font-size:12px;font-weight:500;margin-left:6px}
.shell:has(#sign-in:not([hidden]))>.site-navigation{display:none}
#sign-in .login-help{font-size:12px;color:var(--muted);margin-top:14px}
#sign-in .login-help summary{min-height:36px;display:flex;align-items:center}
@media(max-width:600px){.shell:has(#sign-in:not([hidden])){padding-top:22px}.shell>.brand{margin:0 4px 22px}.shell>.brand span{font-size:19px}#sign-in{padding:22px 20px}#sign-in .tabs{gap:6px}#sign-in .tabs button{padding:8px 12px}}
#music-status:empty{display:none}
.site-navigation{display:flex;flex-wrap:wrap;gap:8px 22px;margin:0 0 20px;align-items:center;font-size:14px;color:#153f4c}
.site-navigation a,.site-navigation span{padding:10px 0;min-height:44px;box-sizing:border-box}.site-navigation [aria-current]{font-weight:700;border-bottom:2px solid #25849b}
.listening-stage>#music-toggle{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;width:64px;height:64px;min-height:44px;padding:0;border:1px solid #e4f8ffb0;border-radius:50%;background:#154c65b8;color:white;font-size:0;box-shadow:0 4px 20px #082e4540;transition:opacity .18s,background .18s;cursor:pointer}
.listening-stage>#music-toggle::before{content:'';display:block;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:16px solid white;margin:auto;transform:translateX(2px)}
.listening-stage>#music-toggle[aria-pressed=true]::before{width:14px;height:20px;border:0;border-left:5px solid white;border-right:5px solid white;box-sizing:border-box;transform:none}
.listening-stage>#music-toggle:hover{background:#1b6585e8}
.listening-stage>#music-toggle:focus-visible{outline:3px solid #75eeec;outline-offset:4px}
.listening-stage>#music-toggle[aria-pressed=true]:not(:focus-visible){opacity:0;pointer-events:none;transition:none}
.music-controls{bottom:0;left:0;right:0;border:0;border-radius:0;background:linear-gradient(transparent,#103541ed);padding:28px 16px 8px;backdrop-filter:none;display:flex;flex-direction:column-reverse;transition:opacity .18s}
.transport{justify-content:flex-start;gap:8px}
.transport button,.transport #music-toggle,.transport #music-mute{color:#f4f6fa;background:transparent;border-radius:5px;min-width:0;min-height:36px;padding:6px 10px;font-size:12px}
.transport button:hover{background:#ffffff1a}.transport #music-toggle{font-weight:700}
.transport #music-mute{margin-left:auto}
.seek-row{color:#e6e9ef;gap:10px}
.seek-row input{accent-color:#37c9cb;height:18px;margin:0}
.music-library{padding:18px;background:#f6f7f9;border:1px solid #e8eaee;border-radius:12px}
.listening-tracks{gap:4px;margin-bottom:0}
.listening-tracks button{background:transparent;padding:10px 8px;border-radius:8px}
.listening-tracks button:hover{background:#e9edf1}
.listening-tracks button[aria-pressed=true]{background:#e0f0f0;border-color:transparent;box-shadow:inset 3px 0 #138b91}
.track-copy small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.music-services{background:#f3f6f8;border:1px solid #e6ebee}
.listening-stage:fullscreen,.listening-stage.page-fullscreen{width:100%;height:100%;max-height:none;aspect-ratio:auto;background:#e0ebee}
.listening-stage.page-fullscreen{position:fixed;inset:0;z-index:1000;height:100dvh;border-radius:0}
.listening-stage:fullscreen .music-controls,.listening-stage.page-fullscreen .music-controls{padding:40px max(20px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
.immersive-exit{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:3;background:#103541d9;color:#fff;border:1px solid #b7dce880;min-height:44px;padding:8px 14px;border-radius:24px;font-size:13px}
.immersive-exit:focus-visible{outline:3px solid #6de2df;outline-offset:3px}
.listening-stage.controls-idle:has(.immersive-exit:hover){cursor:auto}
.listening-stage.controls-idle{cursor:none}
.listening-stage.controls-idle .music-controls,.listening-stage.controls-idle>#music-toggle{opacity:0;pointer-events:none}
/* Remain in the tab order: keyboard focus immediately restores the controls. */
.shell>.brand{gap:9px;margin-bottom:14px}
.shell>.brand img{width:34px;height:34px}
.shell>.brand span{font-size:19px;font-weight:650;line-height:1.3}
.shell>.brand small{font:inherit;margin-left:3px}
.site-navigation a{text-decoration:none}
@media(max-width:600px){
 .shell>.brand span,.shell>.brand small{font-size:18px}
 .shell:has(#member:not([hidden])){padding:16px 12px 28px}
 .site-navigation{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px;font-size:12px;text-align:center}
 .site-navigation a,.site-navigation span{padding:8px 0;min-height:36px;white-space:nowrap}
 #member{padding:16px 12px}
 .member-heading h1{font-size:20px}
 .member-heading p{font-size:12px;margin:4px 0 0}
 .member-heading button{font-size:12px;min-height:40px;padding:7px 10px}
 .member-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;overflow:visible;margin:14px 0;padding:0 0 12px}
 .member-tabs button{font-size:12px;padding:7px 4px;min-height:40px}
 #member-music .eyebrow{display:none}
 #member-music h2{font-size:20px}
 .music-heading{margin-bottom:12px}
 .music-heading .intro{margin-bottom:0}
}
@media(prefers-reduced-motion:reduce){.music-controls{transition:none}}
/* Shared mini-program navigation language; player and entitlement logic stay intact. */
.secondary-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;background:linear-gradient(100deg,#def4ee,#d8eef8);padding:12px 20px;margin-bottom:24px}
.secondary-heading h1{font-size:19px;margin:0}.secondary-heading>span{font-size:12px;letter-spacing:.15em;color:#65909b}.secondary-heading button{background:#ffffff80;border:0;border-radius:22px;color:#285a71}
#member-studio,#member-purchase,#member-records,#member-security,#member-profile,#member-demo,#member-channel{padding:22px;border:1px solid #d7e9ec;border-radius:20px;background:linear-gradient(150deg,#fff,#f1fafb);min-width:0}
.process-steps{padding:13px 14px;border-radius:12px;background:#e5f4f5;color:#357184;line-height:1.9;font-size:14px}
#member-security summary{min-height:44px;color:#285a71;cursor:pointer}#member-purchase h2,#member-studio h2{color:#194e70}
@media(max-width:600px){#member-studio,#member-purchase,#member-records,#member-security,#member-profile,#member-demo,#member-channel{padding:16px;border-radius:16px}.secondary-heading{padding:10px 14px;margin-bottom:16px}.secondary-heading h1{font-size:18px}.process-steps{font-size:12px;padding:11px 8px}}
.listening-stage.audio-artwork>#music-backdrop{opacity:1;filter:none;transform:none;object-fit:contain;background:#102e3b}
.listening-stage.audio-artwork>#music-video{opacity:0}
.home-masthead,.home-channels,.home-bottom{display:flex;align-items:center}
.home-masthead{justify-content:space-between;padding:20px 22px;background:#d9f2f3;color:#174566;font-size:23px;letter-spacing:.04em}
.home-masthead button{background:#ffffff80;border:1px solid #badde0;border-radius:24px;font-size:13px;padding:8px 14px}
.home-channels{background:linear-gradient(100deg,#def4ee,#d8eef8);padding:0 12px;gap:4px;margin-bottom:24px}
.home-channels button{flex:1;background:none;border:0;border-bottom:3px solid transparent;border-radius:0;color:#65818c;padding:15px 4px;min-height:48px}
.home-channels button[aria-pressed=true]{color:#194e70;border-bottom-color:#2497a6;font-weight:700}
.member-session .shell>.brand,.member-session .shell>.site-navigation{display:none}
.member-session .shell{max-width:1120px;padding:0 20px 120px}
.member-session #member{padding:0 0 24px;border:0;background:#f8fafb;box-shadow:none;overflow:visible}
#member>section,#member>.account-actions,#member>.hint{margin-left:22px;margin-right:22px}
.member-session .music-layout{grid-template-columns:minmax(0,1fr);gap:24px}
.member-session .listening-player{width:100%;max-width:none;justify-self:stretch}
.member-session .listening-tracks{grid-template-columns:repeat(2,minmax(0,1fr))}
.member-session .music-library{padding:0}
.member-session .music-services{background:linear-gradient(110deg,#d6eeee,#dcecf7);border:1px solid #c4e2e6}
.home-bottom{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(1080px,100%);z-index:40;justify-content:space-around;gap:4px;border-top:1px solid #c5e4e9;background:#effafbfa;box-shadow:0 -6px 24px #1760790a;padding:8px 10px max(10px,env(safe-area-inset-bottom));box-sizing:border-box}
.home-bottom button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:20%;min-height:58px;background:none;border:0;border-radius:12px;color:#718791;font-size:14px;padding:4px}
.home-bottom button>span{font-size:27px;line-height:1.1}
.home-bottom button[aria-pressed=true]{color:#194e80;background:#dff1f5}
.home-bottom .soundcode-launch{position:relative;color:#194e80;background:transparent;margin-top:-28px}
.home-bottom,.home-bottom .soundcode-launch{overflow:visible}
.soundcode-launch::before,.soundcode-launch::after{content:"";position:absolute;top:4px;left:50%;width:74px;height:74px;box-sizing:border-box;border:2px solid rgba(68,205,228,.85);border-radius:50%;box-shadow:0 0 12px rgba(99,211,228,.5);transform:translateX(-50%) scale(.62);opacity:0;pointer-events:none}
.soundcode-launch.ripple-active::before{animation:moiy-soundcode-ripple 4s cubic-bezier(.16,.74,.32,1) 1 forwards}
.soundcode-launch.ripple-active::after{border-color:rgba(160,229,239,.8);animation:moiy-soundcode-ripple 4s cubic-bezier(.16,.74,.32,1) 2s 1 forwards}
.soundcode-launch img,.soundcode-launch strong{position:relative;z-index:1}
@keyframes moiy-soundcode-ripple{0%{transform:translateX(-50%) scale(.62);opacity:1}54%{opacity:.72}86%{opacity:.2}100%{transform:translateX(-50%) scale(2.25);opacity:0}}
@media(max-width:600px){.soundcode-launch::before,.soundcode-launch::after{width:68px;height:68px}}
@media(prefers-reduced-motion:reduce){.soundcode-launch.ripple-active::before,.soundcode-launch.ripple-active::after{animation:none}}
.soundcode-launch img{width:68px;height:68px;border-radius:50%;border:3px solid #e8fafb;box-shadow:0 0 0 1px #b5e1e9,0 4px 18px #13799330;background:#d8f3f5}
.home-bottom .soundcode-launch[aria-pressed=true]{background:transparent}.soundcode-launch[aria-pressed=true] img{box-shadow:0 0 0 3px #2e94a8,0 4px 18px #13799330}
.profile-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:24px 0}.profile-links button{min-height:72px;background:#eaf5f6;border:1px solid #cce4e8;border-radius:16px;color:#235772}
#member-channel{min-height:42vh;padding-top:28px}#channel-description{max-width:600px;line-height:1.9;color:#617d88}
.home-bottom button:focus-visible,.home-channels button:focus-visible{outline:3px solid #2497a6;outline-offset:-3px}
@media(max-width:600px){.member-session .shell{padding:0 0 115px}.member-session #member{padding:0 0 20px;border-radius:0}.home-masthead{font-size:20px;padding:18px 16px}.home-masthead button{font-size:12px}.home-channels{margin-bottom:18px;padding:0 8px}.home-channels button{font-size:14px}#member>section,#member>.account-actions,#member>.hint{margin-left:14px;margin-right:14px}.member-session .music-heading .intro{font-size:13px}.member-session .listening-tracks{grid-template-columns:1fr}.home-bottom button{font-size:12px}.soundcode-launch img{width:62px;height:62px}}
@media(max-width:900px){.music-layout{grid-template-columns:minmax(0,1fr)}.listening-player{max-width:none}.music-library{padding:14px}.music-controls{padding:24px 10px 6px}.transport{gap:2px}.transport button{padding:6px 7px}.listening-caption{padding:14px}.listening-caption h3{font-size:18px}}
/* One shared page width, including the persistent navigation. */
.media-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0}.media-choices button{background:#e2f3f4;border:1px solid #c6e3e7;min-height:70px;color:#245d76;border-radius:16px}.creation-section details{margin-top:14px}.creation-section summary{cursor:pointer;color:#527889}
#music-audio{display:none!important}
.listening-stage.audio-artwork>#music-backdrop{z-index:1;pointer-events:none;display:block;opacity:1;filter:none;transform:none;object-fit:contain}
.listening-stage.audio-artwork>.music-controls,.listening-stage.audio-artwork>.immersive-exit{z-index:3}
.catalog-search:has(#music-keyword[hidden]){grid-template-columns:1fr}
.catalog-search:has(#music-keyword[hidden]) label[for=music-picker]{grid-column:1;grid-row:1}
.catalog-search:has(#music-keyword[hidden]) #music-picker{grid-column:1;grid-row:2}
#music-keyword{grid-column:1;grid-row:1 / 3}#music-keyword label{display:block;margin-bottom:6px}
body.member-session{--page-width:1080px;background:#edf5f7}
body.member-session .shell:has(#member:not([hidden])){width:min(var(--page-width),100%);max-width:var(--page-width);padding:0 0 110px;background:#f8fafb;min-height:100dvh}
body.member-session .home-bottom{width:min(var(--page-width),100%);box-shadow:none;border-left:1px solid #d7e9ec;border-right:1px solid #d7e9ec}
body.member-session #member-studio{max-width:none}
.catalog-search{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin:0 0 22px;padding:16px;border:1px solid #cce4e8;background:#edf8f9;border-radius:16px}
.catalog-search label{margin:0;color:#397486}.catalog-search label[for=music-search]{grid-column:1;grid-row:1}.catalog-search #music-search{grid-column:1;grid-row:2}.catalog-search label[for=music-picker]{grid-column:2;grid-row:1}.catalog-search #music-picker{grid-column:2;grid-row:2}.catalog-search .hint{grid-column:1/-1;margin:2px 0 0}
#studio-form fieldset{border:0;padding:0}#studio-form legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.creation-section{padding:18px;margin:18px 0;background:white;border:1px solid #d1e7ea;border-radius:16px}.creation-section h3{margin:0;color:#245d76}.creation-section label{font-size:14px}
@media(max-width:600px){.catalog-search{grid-template-columns:1fr;padding:12px}.catalog-search label[for=music-picker]{grid-column:1;grid-row:3}.catalog-search #music-picker{grid-column:1;grid-row:4}.creation-section{padding:14px}}

/* Shared home/member artwork and title row. Preserve the entire source frame. */
.listening-caption{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:12px;row-gap:6px}
.listening-caption #music-title{grid-column:1;grid-row:1;margin:0;overflow-wrap:anywhere}
.listening-caption #music-credit{grid-column:2;grid-row:1;text-align:right;font-size:12px;color:#496c7c}
.listening-caption #music-intro{grid-column:1 / -1;grid-row:2;margin:0}
.listening-stage:is(:fullscreen,.page-fullscreen){max-height:none!important;height:100dvh}
.listening-stage:is(:fullscreen,.page-fullscreen)>video,
.listening-stage.audio-artwork:is(:fullscreen,.page-fullscreen)>#music-backdrop{width:100%;height:100%;object-fit:contain;filter:none;transform:none;background:#102e3b}

/* Keep the immersive entry reachable on narrow touch screens. */
@media(max-width:600px){.transport{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px}.transport button{width:100%;min-height:44px;padding:6px 4px;white-space:nowrap}.transport #music-mute{margin-left:0}.transport #music-fullscreen{grid-column:span 2}.listening-stage.page-fullscreen{height:100vh;height:100dvh}}

/* Normal playback reserves a separate controls row; artwork stays unobscured. */
.listening-player>.music-controls{position:relative;inset:auto;padding:8px 12px;background:#eaf4f6;opacity:1;pointer-events:auto;z-index:2}
.listening-player>.music-controls .seek-row{color:#244f61}
.listening-player>.music-controls .transport button{color:#244f61}
@media(max-width:600px){.transport{grid-template-columns:1fr 1fr 1fr 1fr 1.5fr;gap:0}.transport #music-fullscreen{grid-column:auto}.transport button{padding:6px 2px;font-size:12px;min-height:44px}.listening-player>.music-controls{padding:6px 8px}.listening-stage:is(:fullscreen,.page-fullscreen) .music-controls{padding:18px 8px max(8px,env(safe-area-inset-bottom))}}

/* User-controlled fit: complete frame by default, explicit fill opt-in. */
.immersive-fit{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));z-index:5;min-width:48px;min-height:44px;padding:6px 10px;border:1px solid #b7dce880;border-radius:12px;background:#103541df;color:#fff;font-size:13px;cursor:pointer}
.immersive-fit[hidden]{display:none}.immersive-fit:focus-visible{outline:3px solid #6de2df;outline-offset:3px}
.listening-stage:is(:fullscreen,.page-fullscreen) .music-controls{bottom:64px}
.listening-stage.frame-fill:is(:fullscreen,.page-fullscreen)>video,
.listening-stage.frame-fill.audio-artwork:is(:fullscreen,.page-fullscreen)>#music-backdrop{object-fit:cover}
/* Ordered photo selection shares the existing creation form. */
#studio-inputs{min-width:0}
.studio-selection{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:12px}
.studio-asset{min-width:0;border:1px solid #c8e1e2;border-radius:12px;padding:8px}
.studio-asset img,.studio-asset video{display:block;width:100%;height:110px;object-fit:contain;background:#f0f7f7;border-radius:8px}
.studio-asset p{overflow-wrap:anywhere;font-size:13px}
.studio-asset button{font-size:12px;padding:6px;margin:2px}

#library-player { width: 100%; max-height: 70vh; object-fit: contain; }

/* One shared editor; thumbnails select the active asset. */
.studio-canvas{height:300px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#edf5f6;border-radius:16px}
.studio-canvas img,.studio-canvas video{max-width:100%;max-height:100%;object-fit:contain}
.studio-canvas .rotation-90{transform:rotate(90deg);max-width:260px;max-height:260px}
.studio-canvas .rotation-180{transform:rotate(180deg)}
.studio-canvas .rotation-270{transform:rotate(270deg);max-width:260px;max-height:260px}
.studio-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.studio-toolbar button{background:#e4f3f4;color:#235772;border:1px solid #c8e1e2;border-radius:20px;padding:8px 14px}
.studio-selection{grid-template-columns:repeat(3,minmax(0,1fr))}
button.studio-asset{background:#f3f9fa;color:#235772;padding:6px;text-align:left}
button.studio-asset[aria-pressed=true]{outline:2px solid #329bab;outline-offset:-2px}

#library-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.soundcode-card{min-width:0;overflow:hidden;border:1px solid #cce4e8;border-radius:16px;background:#f8fcfc;padding:0 0 12px}
#library-items .soundcode-cover{display:block;width:100%;min-height:0;padding:0;border:0;border-radius:0;background:#e4f0f2;aspect-ratio:16/9}
.soundcode-cover img{display:block;width:100%;height:100%;object-fit:cover}
.soundcode-card h3{font-size:17px;margin:12px 12px 6px;overflow-wrap:anywhere}
.soundcode-card p,.soundcode-card small{display:block;margin:6px 12px;color:#587580;overflow-wrap:anywhere}
.soundcode-card small{font-size:11px}
.soundcode-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:10px 10px 0}
#library-items .soundcode-actions button,#library-items .soundcode-action-panel button{min-height:36px;margin:0;padding:7px 4px;font-size:13px;border-radius:9px}
.soundcode-action-panel{padding:0 10px}.soundcode-action-panel:empty{display:none}.soundcode-action-panel select{max-width:100%}.soundcode-action-panel label{font-size:12px}.soundcode-action-panel input{width:auto}.soundcode-action-panel a{display:block;padding:12px;color:#23627b}
@media(min-width:1000px){#library-items{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Member actions follow the content, above persistent main navigation. */
.member-bottom-actions{margin-top:24px;padding-top:16px;border-top:1px solid #d5e7ea}
.member-bottom-actions>.profile-links{margin:14px 0 0}
.member-bottom-actions>button{min-height:42px;border-radius:22px;background:#e5f3f4;color:#235772;border:1px solid #c8e1e2}
.member-session .site-navigation{display:none}

.studio-preview-shell{position:relative;margin:12px 0;border:1px solid #bedee3;border-radius:16px;overflow:hidden}
#studio-add{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;border-radius:50%;border:1px solid #88cbd3;background:#effbfbea;color:#258096;font-size:42px;line-height:1;padding:0}
.studio-preview-shell.has-media #studio-add{left:auto;top:auto;right:12px;bottom:12px;transform:none;width:44px;height:44px;font-size:30px}
#studio-choices[hidden],#studio-toolbar[hidden]{display:none}

.studio-song-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.studio-song-heading h3{margin:0;font-size:17px}.studio-start-field{display:flex;align-items:center;gap:8px}.studio-start-field label{margin:0;font-size:13px;white-space:nowrap}#studio-clip-start{width:76px;margin:0;padding:8px}
.studio-preview-shell .studio-canvas{height:480px;max-height:65vh;min-height:280px}
@media(max-width:600px){.studio-song-heading{gap:8px}.studio-song-heading h3{font-size:14px}.studio-start-field{gap:4px}.studio-start-field label{font-size:11px}#studio-clip-start{width:55px;padding:6px}.studio-preview-shell .studio-canvas{height:420px}}

.studio-preview-shell .studio-selection{padding:10px;display:flex;gap:8px;overflow-x:auto;box-sizing:border-box;background:#f1f8f9}
.studio-preview-shell .studio-selection:empty{display:none}
.studio-preview-shell button.studio-asset{flex:0 0 82px;padding:3px}.studio-preview-shell .studio-asset img,.studio-preview-shell .studio-asset video{height:60px}.studio-preview-shell .studio-asset p{font-size:11px;max-height:28px;overflow:hidden;margin:2px}
.studio-preview-shell.has-media #studio-add{top:12px;bottom:auto}
#studio-camera-live{width:100%;max-height:55vh;object-fit:contain;background:#112d38;border-radius:16px}
#studio-capture[hidden]{display:none}

/* Compact composer actions: one source row, one editing row, paired footer. */
#studio-choices{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:10px 0}
#studio-choices button{min-width:0;min-height:44px;padding:7px 3px;font-size:13px;white-space:nowrap;border-radius:12px}
#studio-toolbar{display:grid;grid-template-columns:1.4fr repeat(4,minmax(0,1fr));gap:5px}
#studio-toolbar button{min-width:0;min-height:44px;padding:6px 2px;font-size:12px;white-space:nowrap;border-radius:12px}
#member-studio .demo-actions{display:flex;flex-wrap:wrap;gap:8px;width:100%}
#member-studio .demo-actions button{flex:1 1 0;min-width:0;min-height:44px;padding:8px 4px;font-size:13px;margin:0;border-radius:12px}
#member-studio .member-bottom-actions{display:block}
#studio-capture .studio-toolbar button{flex:1 1 auto;min-height:44px;padding:6px 8px;font-size:13px}
@media(max-width:360px){#studio-choices button{font-size:12px}#studio-choices{gap:4px}}

.studio-preview-shell .studio-canvas.photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:4px;padding:4px;height:420px;min-height:280px}
.photo-grid .studio-asset,.photo-grid .studio-empty{position:relative;min-width:0;min-height:0;width:100%;height:100%;margin:0;padding:0;overflow:hidden;border-radius:8px;border:1px solid #c6e3e7;background:#eff8f8}
.photo-grid .studio-empty{color:#6da8b2;font-size:28px}
.photo-grid .studio-asset img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;border-radius:0}
.photo-grid .studio-asset p{position:absolute;left:3px;top:3px;margin:0;padding:1px 5px;border-radius:8px;background:#174f66d9;color:white;font-size:11px}
.studio-preview-shell:has(.photo-grid) #studio-add{display:block}
.studio-canvas>video{width:100%;height:100%;object-fit:contain}
@media(max-width:600px){.studio-preview-shell .studio-canvas.photo-grid{height:360px}}

#library-items .soundcode-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:8px}
#library-items .soundcode-actions button{min-height:36px;padding:5px 2px;font-size:12px;border-radius:10px}
.soundcode-viewer{position:fixed;inset:0;z-index:10000;background:#071b24;display:flex;align-items:center;justify-content:center}
.soundcode-viewer #library-player{width:100%;height:100%;max-height:100%;object-fit:contain}
.soundcode-viewer-back{position:absolute;right:14px;top:max(14px,env(safe-area-inset-top));z-index:2;background:#123e50dc;color:white;border:1px solid #88b7c6;border-radius:24px;min-height:44px}
.soundcode-entry-dialog{width:min(420px,calc(100% - 32px));max-height:80dvh;overflow:auto;border:1px solid #bcdde0;border-radius:20px;background:#f5fbfb;color:#153e49;padding:20px}
.soundcode-entry-dialog::backdrop{background:#082e4770}
.soundcode-entry-dialog select{width:100%;min-height:44px}.soundcode-entry-dialog button{margin:6px 5px 0 0}

/* Preserve portrait/landscape covers; keep all card actions at one fixed height. */
#library-items{display:block;columns:2;column-gap:14px}
#library-items .soundcode-card{display:inline-block;width:100%;break-inside:avoid;margin:0 0 14px;vertical-align:top}
#library-items .soundcode-cover{margin:0;min-height:0;height:auto}
#library-items .soundcode-actions{align-items:center}
#library-items .soundcode-actions button{display:flex;align-items:center;justify-content:center;min-height:36px;height:36px;max-height:36px;line-height:1;padding:0 2px;white-space:nowrap;align-self:center}
.soundcode-viewer-transport{position:absolute;bottom:max(72px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:8px;max-width:96%;white-space:nowrap}
.soundcode-viewer-transport button{font-size:13px;background:#eff9f5ed;color:#214d5b;padding:8px}
@media(min-width:1000px){#library-items{columns:3}}
#member-discover .listening-tracks button{min-height:90px;text-align:left}

.soundcode-viewer-status{position:absolute;top:80px;left:12px;right:12px;text-align:center;color:white;pointer-events:none}
.soundcode-viewer-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;min-height:52px;padding:12px 24px;border-radius:28px;background:#e9f8f6;color:#164c5c}
.soundcode-viewer-transport{gap:4px}.soundcode-viewer-transport button{font-size:12px;padding:8px 6px}

/* Ratio applies to the entire card, including copy and actions. */
#library-items .soundcode-card{--card-unit:240px;position:relative;display:inline-flex;flex-direction:column;height:var(--card-unit);padding:0;box-sizing:border-box}
#library-items .soundcode-card.portrait{height:calc(var(--card-unit)*2)}
#library-items .soundcode-cover{flex:1 1 0;min-height:0;aspect-ratio:auto;overflow:hidden}
#library-items .soundcode-card h3{flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:8px 10px 4px;font-size:15px}
#library-items .soundcode-card>p{flex:none;height:40px;line-height:20px;font-size:13px;margin:4px 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#library-items .soundcode-actions{flex:none}
#library-items .soundcode-card>.soundcode-action-panel:not(:empty){position:absolute;bottom:52px;left:0;right:0;background:#f1faf9;max-height:75%;overflow:auto;border-top:1px solid #cce4e8;padding:8px;z-index:1}
.soundcode-viewer{inset:auto;left:50%;top:50%;width:100vw;height:100dvh;transform:translate(-50%,-50%);transform-origin:center}
.soundcode-viewer:fullscreen{left:0;top:0;transform:none!important;width:100%!important;height:100%!important}

.challenge-history-card{padding:14px;margin:10px 0;border:1px solid #cce4e8;border-radius:14px;background:#f5fbfb}.challenge-history-card p{margin:6px 0}.challenge-history-card small{color:#587580}

.challenge-history-actions{display:flex;gap:8px;margin-top:12px}.challenge-history-actions button{min-height:38px;padding:6px 12px}.soundcode-entry-dialog textarea{width:100%;box-sizing:border-box;font:inherit;resize:vertical}

#showcase-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.challenge-public-card{overflow:hidden;border:1px solid #cce4e8;border-radius:14px;padding:0 0 12px;background:#f5fbfb}.challenge-public-card>button{padding:0;width:100%;border:0;aspect-ratio:1}.challenge-public-card img{width:100%;height:100%;object-fit:cover}.challenge-public-card h3,.challenge-public-card p,.challenge-public-card small{display:block;margin:8px 10px;overflow-wrap:anywhere}.challenge-showcase-player{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:0;background:#071b24;color:white}.challenge-showcase-player video{width:100%;height:100%;object-fit:contain}.challenge-showcase-player button{position:absolute;right:16px;top:16px}.challenge-showcase-player p{position:absolute;left:16px;right:16px;top:64px;text-align:center}

/* Keep the image dominant, with a compact stable caption/action footer. */
#library-items .soundcode-card h3{font-size:14px;line-height:20px;margin:6px 8px 2px}
#library-items .soundcode-card>p{height:18px;line-height:18px;font-size:12px;margin:2px 8px;-webkit-line-clamp:1}
#library-items .soundcode-actions{padding:6px;gap:4px}
#library-items .soundcode-actions button{height:32px;min-height:32px;max-height:32px;font-size:12px;border-radius:8px}
.soundcode-viewer-transport{flex-wrap:wrap;justify-content:center;width:max-content;max-width:94%}

/* Natural media proportions; captions never steal or crop the cover. */
#library-items .soundcode-card,#library-items .soundcode-card.portrait{height:auto;display:inline-flex}
#library-items .soundcode-cover{flex:none;height:auto;aspect-ratio:auto}
#library-items .soundcode-cover img{height:auto;width:100%;object-fit:contain;aspect-ratio:auto}
#library-items .soundcode-card h3{white-space:normal;overflow-wrap:anywhere}
#library-items .soundcode-card>p{display:block;height:auto;min-height:18px;overflow:visible;-webkit-line-clamp:unset;margin:4px 8px;line-height:1.5}

#library-items .soundcode-cover img:not([src]){aspect-ratio:16/9;min-height:80px;color:#426977;font-size:12px}

/* Challenge author identity and server-authoritative interactions. */
.challenge-author{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:13px;overflow-wrap:anywhere}
.challenge-avatar{flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#e0f1ee;display:grid;place-items:center;overflow:hidden}
.challenge-avatar img{width:30px!important;height:30px!important;object-fit:cover}
.challenge-interactions{display:flex;gap:8px;padding:4px 12px 10px;flex-wrap:wrap}
.challenge-public-card .challenge-interactions button{width:auto;min-height:32px;padding:4px 12px;border:1px solid #b7d9d6;border-radius:18px;background:#edf8f6;color:#215c66;font-size:13px}
.challenge-public-card .challenge-interactions button[aria-pressed=true]{background:#d0ebe7}
.challenge-public-card>small[role=status]{display:block;padding:0 12px 6px;color:#627b80}

#member-community{padding:16px;border:1px solid #d2e7e5;border-radius:20px;margin:12px 0;background:#f3faf9}#member-community input,#member-community textarea,#member-community select{display:block;width:100%;box-sizing:border-box;margin:6px 0 12px}#member-community button{min-height:34px;width:auto;padding:6px 14px;margin:4px;border-radius:18px;background:#e2f2ef;color:#205967;border:1px solid #bad9d5}

/* Shared compact profile, consistent with miniapp hierarchy. */
#member-profile #member-label{display:none}
#member-profile #member-community{margin:0 0 20px;padding:18px;background:linear-gradient(120deg,#f2faf8,#e7f2f5);border-radius:18px}
.profile-identity{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.profile-avatar{display:grid;place-items:center;width:54px;height:54px;flex:0 0 54px;border-radius:50%;background:#cbe6e6;color:#225568;font-size:11px;letter-spacing:1px}
#member-community .profile-display-name{font-size:21px;font-weight:650;margin:0}
#member-community .profile-statistics{font-size:14px;padding:10px 0;border-block:1px solid #d4e7e6;text-align:center}
#member-community .profile-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
#member-community .profile-shortcuts button,#member-community .profile-shortcuts a{margin:0;min-width:0;min-height:38px;padding:7px 4px;font-size:13px;text-align:center;border:1px solid #bad9d5;border-radius:20px;background:#f7fcfb;color:#205967;text-decoration:none;box-sizing:border-box;display:grid;place-items:center}
#member-community .challenge-interactions{padding:0;gap:6px;display:flex;flex-wrap:wrap}
#member-community .challenge-interactions button{font-size:12px;margin:0;padding:6px 10px;min-height:34px}
#member-community p:empty{display:none}
#member-community .profile-points{margin-top:12px;border-top:1px solid #d4e7e6;padding-top:10px}
#member-community .profile-points h3{display:inline;font-size:14px;margin:0 12px 0 0}
#member-community .profile-points>p{display:inline;font-size:16px}
#member-community .profile-points details{margin-top:8px;font-size:12px}
#member-profile>.member-bottom-actions button{font-size:13px;min-height:36px;padding:7px 12px}
@media(min-width:800px){#member-community{display:grid;grid-template-columns:1fr 1fr;gap:10px 24px}#member-community .profile-identity{grid-column:1}#member-community .profile-shortcuts{grid-column:2;grid-row:1;align-self:center}#member-community form{grid-column:1/-1}#member-community .profile-statistics{align-self:center}}

.profile-identity>div{min-width:0;flex:1}.profile-public-id{display:block;overflow-wrap:anywhere;font-size:11px;color:#66858c;margin-top:4px}.profile-bio{font-size:13px;margin:6px 0 0;color:#476c73}.profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
#member-community .profile-message-button{font-size:12px;align-self:flex-start;margin:0;padding:5px 10px;min-height:32px}
.profile-edit-panel{width:min(460px,calc(100vw - 48px));max-height:80dvh;overflow:auto;border:1px solid #c2dcda;border-radius:20px;padding:22px;background:#f8fcfb;color:#204c58}.profile-edit-panel::backdrop{background:#102f4059}.profile-edit-panel label{display:block;font-size:14px;margin:14px 0}.profile-edit-panel input,.profile-edit-panel textarea,.profile-edit-panel select{box-sizing:border-box;display:block;width:100%;margin-top:6px;padding:10px;border:1px solid #c4dcd8;border-radius:9px}.profile-edit-panel button{font-size:14px;min-height:38px;padding:7px 18px;margin:8px 6px 0 0;border:1px solid #b8d8d4;border-radius:18px;background:#e5f3ef;color:#205967}

#member-community{display:block!important}#member-community .profile-identity{background:linear-gradient(110deg,#cff2e9,#b7e2f1);margin:-18px -18px 0;padding:20px 16px;border-radius:18px 18px 0 0}#member-community .profile-avatar{width:66px;height:66px;flex-basis:66px;background:#5dcad8;border:2px solid white}#member-community .profile-statistics{display:grid;grid-template-columns:repeat(3,1fr);background:white;border:0;border-radius:14px;margin:14px 0 8px;padding:12px 0}#member-community .profile-statistics strong,#member-community .profile-statistics small{display:block}#member-community .profile-statistics small{font-size:12px;color:#71878f;margin-top:5px}#member-community .profile-statistics>div+div{border-left:1px solid #e1ecec}#member-community .profile-points{border:0;margin:0;padding:14px 0}.profile-edit-panel .profile-panel-close{position:sticky;top:0;float:right;z-index:2;background:#e6f4f0}.profile-edit-panel h2{font-size:20px;clear:none;margin:10px 0 22px}@media(min-width:800px){#member-community .profile-shortcuts{max-width:600px;margin-inline:auto}#member-community .profile-identity{padding:22px 28px}}

.profile-panel-header{position:sticky;top:-22px;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f8fcfb;padding:10px 0;border-bottom:1px solid #d5e7e4}.profile-panel-header h2{margin:0}.profile-panel-header button{margin:0;flex-shrink:0}
#member-community .profile-shortcuts{align-items:stretch;justify-items:stretch}#member-community .profile-shortcuts>*{display:flex!important;align-items:center;justify-content:center;text-align:center;line-height:1.35}#member-community .challenge-interactions{justify-content:center}#member-profile .member-bottom-actions>.profile-links{justify-content:center}#member-profile .member-bottom-actions button{text-align:center}

/* Keep cropped media inside the viewport, in either device orientation. */
.listening-stage{overflow:hidden;min-width:0;box-sizing:border-box}
.listening-stage:is(:fullscreen,.page-fullscreen){inset:0;margin:0!important;padding:0!important;width:100vw!important;max-width:100vw!important;height:100vh;height:100dvh;min-height:0;overflow:hidden;border-radius:0}
.listening-stage:is(:fullscreen,.page-fullscreen)>video,
.listening-stage:is(:fullscreen,.page-fullscreen)>#music-backdrop{position:absolute;inset:0;min-width:0;min-height:0;max-width:100%;max-height:100%;width:100%;height:100%;object-position:center;transform:none}

/* Mobile immersion: separate direction from cropping; keep one exit action. */
.immersive-directions{position:absolute;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));z-index:5;display:flex;align-items:center;gap:6px;max-width:65%;flex-wrap:wrap}
.immersive-directions[hidden]{display:none}
.immersive-directions button{padding:6px 10px;min-height:40px;border-radius:18px;border:1px solid #a9cdd7;background:#eaf5f6e8;color:#214b5b;font-size:12px}
.immersive-directions span{width:100%;font-size:12px;color:#214b5b;background:#eaf5f6e8;border-radius:6px}
.listening-stage:is(:fullscreen,.page-fullscreen){background:linear-gradient(145deg,#d5e9ed,#b7d7e0)}
.listening-stage:is(:fullscreen,.page-fullscreen)>video,
.listening-stage.audio-artwork:is(:fullscreen,.page-fullscreen)>#music-backdrop{background:transparent}
.listening-stage:is(:fullscreen,.page-fullscreen) .transport #music-fullscreen[hidden]{display:none}
.listening-stage.controls-idle .immersive-directions,.listening-stage.controls-idle .immersive-fit{opacity:0;pointer-events:none}
.listening-stage:focus-within .immersive-directions:focus-within,.listening-stage .immersive-fit:focus-visible{opacity:1;pointer-events:auto}
@media(max-width:600px){.listening-stage:is(:fullscreen,.page-fullscreen) .transport{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Compact mobile composer: keep the canvas close to song selection. */
#member-studio .studio-legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#member-studio .studio-search-details{margin:0 0 8px}
@media(max-width:600px){
 #member-studio>h2{font-size:22px;margin:8px 0}
 #studio-status{font-size:13px;line-height:1.45;margin:6px 0}
 #studio-inputs{padding:0;border:0;min-width:0}
 #member-studio .creation-section{padding:10px;margin:8px 0;border-radius:12px}
 #member-studio .creation-section h3{font-size:14px}
 #member-studio .studio-song-heading{margin-bottom:6px}
 #member-studio .studio-search-details{font-size:12px}
 #studio-song{margin:4px 0 8px;padding:9px;font-size:14px}
 #studio-preview-clip{padding:7px 10px;min-height:36px;font-size:13px}
 #studio-clip-range,#studio-selection-count{font-size:12px;margin:5px 0}
 #member-studio .studio-preview-shell{margin:6px 0}
 #member-studio .studio-preview-shell .studio-canvas{height:clamp(220px,36svh,320px);min-height:220px;max-height:320px}
 #studio-active-label:empty{display:none}
}

/* Full viewport lip-sync capture, independent of the composer card. */
#studio-capture.studio-capture-full{position:fixed;inset:0;z-index:10000;box-sizing:border-box;height:100dvh;background:#103b48;color:white;padding:max(12px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:8px;overflow:auto}
#studio-capture.studio-capture-full #studio-camera-live{flex:1;min-height:0;max-height:none;width:100%;object-fit:contain;background:#0b2831;border-radius:12px}
#studio-capture.studio-capture-full #studio-camera-status{text-align:center;font-size:20px;min-height:28px;margin:0}
#studio-capture.studio-capture-full .studio-toolbar{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
#studio-capture.studio-capture-full select{width:auto;max-width:150px;padding:8px;margin:0}
#studio-capture.studio-capture-full button{min-height:44px;padding:10px 16px}

.soundcode-viewer-transport[hidden],.soundcode-viewer-back[hidden]{display:none}

/* Capture overlay: controls float above an uncompressed viewfinder. */
#studio-capture.studio-capture-full{display:block;padding:0;overflow:hidden;background:#153f4a}
#studio-capture.studio-capture-full #studio-camera-live{position:absolute;inset:0;width:100%;height:100%;max-height:none;min-height:0;object-fit:contain;background:#153f4a;border:0;border-radius:0;margin:0}
#studio-capture.studio-capture-full>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#studio-capture.studio-capture-full #studio-camera-facing{position:absolute;z-index:2;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));width:auto;max-width:132px;min-height:40px;font-size:14px;background:#e6f3f3e6;color:#164552;border:1px solid #a8c9cd;border-radius:20px;padding:8px 12px}
#studio-capture.studio-capture-full #studio-camera-status{position:absolute;z-index:2;top:max(16px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));max-width:55%;font-size:14px;line-height:1.4;min-height:0;padding:5px 10px;border-radius:16px;background:#153f4abf;color:white}
#studio-capture.studio-capture-full .studio-toolbar{position:absolute;z-index:2;bottom:max(14px,env(safe-area-inset-bottom));left:12px;right:12px;margin:0;display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
#studio-capture.studio-capture-full .studio-toolbar button{flex:0 0 auto;width:auto;min-width:88px;min-height:44px;padding:10px 18px;font-size:14px;border:1px solid #b0d0d2;border-radius:24px;background:#e6f3f3e6;color:#164552}

/* Compact member identity mirrors the miniapp: tier, points and growth. */
#member-community .profile-identity{padding:12px 16px}
#member-community .profile-avatar{width:48px;height:48px;flex-basis:48px}
.profile-tier-badge{display:inline-block;margin-top:5px;padding:2px 9px;border-radius:20px;background:#e6f6ff;color:#176681;font-size:12px;font-weight:600}
#member-community .profile-points{padding:10px 0 4px}
.growth-stats{display:flex;gap:32px}.growth-stats strong,.growth-stats small{display:block}.growth-stats strong{font-size:20px;color:#163f4b}.growth-stats small{font-size:11px;color:#617e87}
.growth-progress-label{display:block;font-size:11px;margin:6px 0;color:#547682}
.profile-points progress{display:block;width:100%;height:4px;accent-color:#1a8fb6;border:0;border-radius:9px;overflow:hidden}.profile-points progress::-webkit-progress-bar{background:#e2e8f0}.profile-points progress::-webkit-progress-value{background:#1a8fb6}
#member-community .profile-statistics{padding:0;margin:8px 0;gap:0}
#member-community .profile-statistics>button{border:0;border-radius:0;background:transparent;padding:6px;min-height:44px;color:#163f4b}
#member-community .profile-statistics>div{padding:6px}
#member-community .profile-statistics small{margin-top:2px}
#member-community .profile-shortcuts{margin:4px 0;gap:8px}
#member-community .challenge-interactions{margin:0}#member-community .challenge-interactions button{font-size:11px;padding:4px 8px;min-height:30px}
#member-community>p:empty{display:none}
#member-profile>h3{margin:14px 0 8px}
#studio-inputs:disabled{opacity:1}
.studio-preview-shell.has-result #studio-canvas,.studio-preview-shell.has-result #studio-add,.studio-preview-shell.has-result #studio-selection{visibility:hidden;pointer-events:none}
.studio-preview-shell #studio-result{position:absolute;inset:0;width:100%;height:100%;max-height:none;margin:0;object-fit:contain;border-radius:0;background:#eaf5f7}
.studio-preview-shell #studio-result[hidden]{display:none}
.studio-preview-shell[aria-busy=true]::after{content:'正在生成…';position:absolute;bottom:12px;left:12px;background:#164653e6;color:white;border-radius:18px;padding:7px 12px;font-size:13px;pointer-events:none}
@media(max-width:600px){#member-community .profile-identity{padding:10px 12px}#member-community .profile-shortcuts button,#member-community .profile-shortcuts a{padding:6px 10px;font-size:12px;min-height:36px}#studio-selection-count{font-size:11px}#member-studio .creation-section:first-of-type h3{margin:0 0 4px}}

#member-profile .member-bottom-actions .profile-shortcuts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px}#member-profile .profile-shortcuts>*{font-size:12px;white-space:nowrap}
