/* Fluid studio chrome: viewport for transport, available canvas width for editing. */
.app-header{height:clamp(60px,5.7vw,78px);min-height:60px;padding:7px clamp(12px,1.8vw,24px);gap:clamp(8px,1.4vw,18px);box-sizing:border-box}
.app-header .brand{font-size:clamp(23px,2.25vw,31px);gap:clamp(6px,.8vw,11px)}
.app-header .brand .brand-mark{width:clamp(38px,4.3vw,56px);height:clamp(38px,4.3vw,56px)}
.app-header .brand-type{gap:3px}.app-header .brand .brand-tagline{font-size:.405em}
.app-header .project-heading{min-width:0;min-height:0;height:auto!important}
.app-header .project-heading>.project-name{height:30px!important;padding:3px 5px;font-size:clamp(11px,1.05vw,14px)}
.app-header .group-badge{height:clamp(32px,3.5vw,42px);min-height:32px;max-width:clamp(92px,13vw,170px);width:auto;gap:6px;padding:3px 7px;font-size:clamp(10px,1vw,13px);box-sizing:border-box}
.app-header .header-actions{gap:6px;padding-left:10px}.app-header .header-actions .file-button{height:clamp(34px,3.5vw,44px);min-height:34px;border-radius:11px;padding:0 10px;font-size:clamp(10px,1vw,12px)}
.app-header .header-actions .file-button .icon-svg{width:clamp(21px,2vw,26px);height:clamp(21px,2vw,26px)}
.transport-bar{--transport-size:clamp(34px,3.6vw,44px);display:flex;height:auto;min-height:0;align-items:center;flex-wrap:nowrap;gap:clamp(7px,1vw,14px);padding:9px clamp(10px,1.8vw,24px);box-sizing:border-box}
.transport-bar .transport-group{display:flex;align-items:center;justify-content:flex-start;flex:0 0 auto;gap:clamp(5px,.7vw,9px);border:0!important;padding:0!important;margin:0;grid-column:auto;grid-row:auto}
.transport-bar .transport-group>div,.transport-bar .edit-tools{order:0}
.transport-bar .play-controls,.transport-bar .transport-toggles,.transport-bar .edit-tools{gap:clamp(4px,.6vw,7px);margin:0;padding:0;border:0;flex:0 0 auto}
.transport-bar .play-button,.transport-bar .stop-button,.transport-bar .transport-toggle,.transport-bar .edit-tools .icon-button{box-sizing:border-box;width:var(--transport-size);min-width:var(--transport-size);height:var(--transport-size);min-height:var(--transport-size);padding:0;border-radius:clamp(9px,1vw,13px)}
.transport-bar .icon-svg{width:clamp(21px,2.25vw,28px);height:clamp(21px,2.25vw,28px)}
.transport-bar .time-display{display:flex;align-items:center;flex:0 0 auto;gap:5px;margin:0;padding:0;min-width:0;height:var(--transport-size)}
.transport-bar .musical-position,.transport-bar .clock-position{box-sizing:border-box;height:var(--transport-size);min-width:0;padding:4px 7px;border-radius:clamp(9px,1vw,13px);gap:1px;margin:0}
.transport-bar .musical-position{width:clamp(51px,5.4vw,72px)}
.transport-bar .clock-position{width:clamp(91px,9.2vw,122px);grid-template-columns:auto auto;column-gap:4px}
.transport-bar .musical-position>strong,.transport-bar .clock-position>strong{font-size:clamp(15px,1.65vw,21px);line-height:1.1;font-weight:700}
.transport-bar .counter-caption{font-size:clamp(7px,.7vw,9px);line-height:1.05}
.transport-bar .clock-position .total-time,.transport-bar #projectLength{font-size:clamp(8px,.83vw,11px);line-height:1.2;white-space:nowrap}
.transport-bar .transport-music{display:flex;grid-template-columns:none;gap:5px;border-top:0;padding-top:0;order:0}
.transport-bar .tempo-control,.transport-bar .key-control{width:auto;order:0;min-width:0}
.transport-bar .transport-music .tempo-control>button,.transport-bar .transport-music .key-control>button{box-sizing:border-box;height:var(--transport-size);min-height:var(--transport-size);min-width:0;border-radius:clamp(9px,1vw,13px)}
.transport-bar .transport-music .tempo-control>button{width:clamp(73px,7.7vw,102px);gap:4px;padding:0 6px}
.transport-bar .tempo-control>button strong{font-size:clamp(14px,1.5vw,19px)}
.transport-bar .tempo-control>button>span:last-child{font-size:clamp(7px,.7vw,9px)}
.transport-bar .transport-music .key-control>button{width:clamp(76px,7.8vw,104px);padding:3px 7px;font-size:clamp(10px,1vw,13px)}
.transport-bar .key-caption{font-size:clamp(7px,.7vw,9px)}
.transport-bar .meter-badge{min-width:26px;box-sizing:border-box;padding:0 2px;margin:0;font-size:clamp(14px,1.5vw,19px)}
.transport-bar .transport-spacer{display:block;flex:1;min-width:0}
.transport-bar .edit-tools{grid-column:auto;grid-row:auto;order:0}
.library-heading{min-height:28px;margin-bottom:10px;gap:7px;padding:0 2px}
.library-heading h1{font-size:clamp(12px,1.1vw,15px);font-weight:650;letter-spacing:0;color:#687991}
.library-heading .library-emblem{width:22px;height:22px}.library-heading .library-emblem .icon-svg{width:22px;height:22px}
.library-toggle{width:30px;height:28px;min-height:28px;flex-basis:30px;border-radius:8px;box-shadow:none}.library-toggle .icon-svg{width:20px;height:20px}
.arrangement{container-type:inline-size}
.arrangement .arrangement-heading{--edit-hit:clamp(28px,3.15cqw,38px);--edit-art:clamp(18px,2.2cqw,26px);display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:0;padding:5px 8px;box-sizing:border-box}
.arrangement-heading>#clipActions{flex:1 1 auto;width:auto;max-width:100%;min-height:calc(var(--edit-hit) + 10px);padding:4px;gap:5px;flex-wrap:nowrap;border-radius:11px}
.arrangement-heading #selectionName{box-sizing:border-box;display:flex;align-items:center;flex:0 1 auto;max-width:clamp(56px,14cqw,180px);min-width:0;min-height:var(--edit-hit);height:var(--edit-hit);padding:3px 7px;font-size:clamp(10px,1.1cqw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.arrangement-heading #clipActions>.selection-mode{display:flex;flex:0 0 auto;max-width:none;gap:1px;border-radius:8px}
.arrangement-heading .selection-mode>button,.arrangement-heading #selectIdea.idea-selection-toggle{height:var(--edit-hit);min-height:var(--edit-hit);padding:3px 6px;gap:4px;font-size:clamp(10px,1.05cqw,12px);border-radius:7px}
.arrangement-heading .selection-mode [data-phrase-icon]>.instrument-picture,.arrangement-heading .selection-mode>button .icon-svg,.arrangement-heading #selectIdea>.icon-svg,.arrangement-heading #selectIdea>span>.icon-svg{width:var(--edit-art);height:var(--edit-art);flex:0 0 var(--edit-art)}
.arrangement-heading .clip-action-tools{gap:1px;flex:0 0 auto}
.arrangement-heading #clipActions .clip-action-tools>button{width:var(--edit-hit);min-width:var(--edit-hit);height:var(--edit-hit);min-height:var(--edit-hit);padding:4px;border-radius:7px}
.arrangement-heading #clipActions .clip-action-tools>button .icon-svg{width:var(--edit-art);height:var(--edit-art)}
.arrangement-heading .timeline-tools{flex:0 0 auto;gap:6px;width:auto;margin-left:auto;justify-content:flex-end}
.arrangement-heading .timeline-tools .zoom-tools{gap:1px;min-height:calc(var(--edit-hit) + 10px);padding:4px;border-radius:11px}
.arrangement-heading .zoom-tools .icon-button{width:var(--edit-hit);min-width:var(--edit-hit);height:var(--edit-hit);min-height:var(--edit-hit);padding:4px;border-radius:7px}
.arrangement-heading .zoom-tools .icon-svg{width:var(--edit-art);height:var(--edit-art)}
.arrangement-heading .action-divider,.arrangement-heading .zoom-axis-divider{height:calc(var(--edit-hit) - 8px);margin:0 3px}
.arrangement-heading #extendTimeline{height:var(--edit-hit);min-height:var(--edit-hit);padding:3px 7px;gap:4px;font-size:clamp(10px,1.05cqw,12px);border-radius:8px}
.arrangement-heading #extendTimeline .icon-svg{width:var(--edit-art);height:var(--edit-art);flex:0 0 var(--edit-art)}
.idea-label-short{display:none}
@container (max-width:740px){.idea-label-long{display:none}.idea-label-short{display:inline}}
@container (max-width:520px){.arrangement-heading>#clipActions{flex-basis:100%;width:100%}.arrangement-heading .timeline-tools{width:100%;justify-content:flex-end}.arrangement-heading #selectionName{flex:1 1 auto;max-width:none}.arrangement-heading .timeline-tools .zoom-tools{margin-right:0}}
@media(max-width:1180px){
 .app-header{display:grid;grid-template-columns:auto minmax(60px,1fr) auto auto;grid-template-rows:auto;min-height:60px;gap:8px;padding:7px 12px}
 .app-header .brand{grid-column:1;grid-row:1}.app-header .project-heading{grid-column:2;grid-row:1}.app-header .group-badge{grid-column:3;grid-row:1;width:auto;justify-self:end;max-width:130px}.app-header .header-actions{grid-column:4;grid-row:1;margin:0;padding:0;border:0}
 .app-header .header-actions .file-button{width:36px;min-width:36px;padding:0}.app-header .header-actions .file-button>span:not(:first-child){display:none}
 .app-header .save-status{display:none}
}
@media(max-width:760px){
 .app-header .brand{font-size:24px}.app-header .brand .brand-mark{width:38px;height:38px}.app-header .project-heading>.project-name{font-size:11px;height:28px!important}
 .transport-bar{gap:7px;padding:8px 10px;min-height:0;grid-template-columns:none}
 .transport-bar .transport-spacer{display:none}.transport-bar .transport-options{grid-column:auto;grid-row:auto}
 .transport-bar .key-panel{left:auto;right:0}
 .studio-shell{height:calc(100dvh - var(--studio-top,120px) - 20px);min-height:260px;display:flex;flex-direction:column;overflow:hidden}
 .library,.library-collapsed .library{box-sizing:border-box;flex:0 0 auto;padding:4px 10px 5px;max-height:min(39dvh,300px);min-height:0;overflow:hidden;background:#fbfcff}
 .library-heading,.library-collapsed .library-heading{min-height:26px;height:26px;margin:0 0 3px;padding:0;justify-content:flex-start}
 .library-heading h1,.library-collapsed .library-heading h1{display:block;font-size:12px;font-weight:600;color:#78859b}.library-heading .library-toggle{margin-left:auto;width:28px;height:26px;min-height:26px;flex-basis:28px}.library-heading .library-toggle .icon-svg{width:18px;height:18px}
 .library-collapsed .library-heading{margin:0}.library-content{min-height:0;max-height:calc(min(39dvh,300px) - 38px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
 .arrangement{flex:1 1 auto;min-height:0;height:auto;overflow:hidden}.arrangement-heading{flex-shrink:0}.timeline-scroll{min-height:0;flex:1 1 auto}
 .library-content>.ideas-library{max-height:190px}.library-content>.harmony-library{max-height:180px}
}
@media(max-width:620px){
 .transport-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"playback edits" "music options";gap:6px 8px;--transport-size:34px}
 .transport-bar .transport-playback{grid-area:playback;justify-content:flex-start;gap:7px}.transport-bar .transport-music{grid-area:music;justify-content:flex-start}.transport-bar .transport-options{grid-area:options;justify-content:flex-end}.transport-bar .edit-tools{grid-area:edits;justify-content:flex-end}
 .transport-bar .transport-spacer{display:none}.transport-bar .meter-badge{font-size:15px}
}
@media(max-width:520px){
 .app-header{grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto 23px;min-height:0;height:auto;padding:6px 10px;gap:3px 7px}
 .app-header .brand{grid-column:1;grid-row:1;font-size:22px;gap:5px}.app-header .brand .brand-mark{width:34px;height:34px}.app-header .brand .version-badge{font-size:8px;padding:3px;margin-left:0}
 .app-header .group-badge,.app-header .group-badge.is-guest,body.is-playground .app-header .group-badge.is-guest{grid-column:2;grid-row:1;max-width:100px;height:30px;min-height:30px;padding:3px 6px;width:auto;font-size:9px;gap:4px}
 .app-header .header-actions{grid-column:3;grid-row:1}.app-header .header-actions .file-button{width:32px;min-width:32px;height:32px;min-height:32px;border-radius:10px}
 .app-header .project-heading{grid-column:1/-1;grid-row:2;height:23px!important;min-height:0}.app-header .project-heading>.project-name{height:23px!important;padding:0 3px;font-size:11px;max-width:100%}
 .app-header .brand-tagline{font-size:.4em}.app-header .group-badge .identity-picture{width:22px;height:22px;flex-basis:22px}
}
@media(max-width:360px){.transport-bar{--transport-size:31px;gap:5px;padding:7px 8px}.transport-bar .clock-position{width:83px}.transport-bar .musical-position{width:46px}.transport-bar .play-controls,.transport-bar .edit-tools{gap:3px}.transport-bar .time-display{gap:3px}.app-header .brand{font-size:20px}.app-header .brand .brand-mark{width:31px;height:31px}.app-header .group-badge{max-width:78px}}

/* Override older full-width mobile declarations without overlapping the key picker. */
.transport-bar .transport-music>div{width:auto;flex:0 0 auto;grid-area:auto}
.transport-bar .transport-music>div>button{width:auto}
.transport-bar .transport-music>.tempo-control>button{width:clamp(73px,7.7vw,102px)}
.transport-bar .transport-music>.key-control>button{width:clamp(76px,7.8vw,104px)}
.arrangement .arrangement-heading:has(#clipActions:not([hidden]))>#clipActions{flex:1 1 auto;width:auto;max-width:100%}
@container(max-width:520px){.arrangement .arrangement-heading:has(#clipActions:not([hidden]))>#clipActions{flex-basis:100%;width:100%}}
/* A single ribbon of phrases leaves the arrangement visible on tablets. */
@media(max-width:760px){
 .library-content>.genre-selector{margin:0 0 5px}.genre-trigger{min-height:38px;padding:4px 8px}.genre-badge{width:27px;height:27px;flex-basis:27px}.genre-choice strong{font-size:12px}.genre-choice small{font-size:8px}
 .library-sections{gap:5px;margin:0 0 5px}.library-sections>button{min-height:43px;padding:4px 5px;gap:3px}.library-sections strong{font-size:9px;min-height:0}.library-sections [data-library-tab=harmony] strong{font-size:8px}.library-sections .icon-svg{width:22px;height:22px}.library-sections small{font-size:8px}
 .pattern-library-panel>.search{height:30px;min-height:30px;margin-bottom:3px}.pattern-library-panel>.search input{font-size:11px;padding-block:4px}
 .pattern-library-panel>.loop-list.has-open-family{height:123px;min-height:123px;max-height:123px;margin-top:4px;flex:0 0 auto}
 .has-open-family>.phrase-category.is-open>h2>button{height:31px;min-height:31px;padding:3px 7px}.has-open-family>.phrase-category.is-open>h2 .instrument-picture{width:23px;height:23px;flex-basis:23px}
 .pattern-library-panel .has-open-family .phrase-category-clips{display:grid;grid-template-rows:82px;grid-auto-flow:column;grid-auto-columns:clamp(128px,calc((100% - 12px)/3),230px);gap:6px;flex:0 0 auto;max-height:90px;height:90px;padding:3px 4px 5px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-x:contain;touch-action:pan-x pan-y}
 .pattern-library-panel .has-open-family .phrase-category-clips .loop-card{width:auto;min-width:0;height:82px;min-height:82px;max-height:82px;scroll-snap-align:start;padding:5px 6px;grid-template-columns:minmax(0,1fr) 27px;gap:2px 4px}
 .pattern-library-panel .has-open-family .phrase-category-clips .sample-name{font-size:10px}.pattern-library-panel .has-open-family .phrase-category-clips .sample-meta{font-size:8px}.pattern-library-panel .has-open-family .phrase-category-clips .sample-preview{width:25px;height:25px}.pattern-library-panel .has-open-family .phrase-category-clips .sample-add{width:27px;height:34px}.pattern-library-panel .has-open-family .phrase-category-clips .sample-preview .icon-svg,.pattern-library-panel .has-open-family .phrase-category-clips .sample-add .icon-svg{width:21px;height:21px}
}

.phrase-scroll-controls{display:none}
@media(max-width:760px){.has-open-family>.phrase-category.is-open>h2{display:flex;align-items:center;background:color-mix(in srgb,var(--family-color) 15%,white)}.has-open-family>.phrase-category.is-open>h2>button{flex:1;min-width:0}.phrase-scroll-controls{display:flex;flex:0 0 auto;gap:3px;padding-right:4px}.phrase-scroll-controls button{display:grid;place-items:center;width:28px;min-width:28px;height:27px;min-height:27px;border:1px solid color-mix(in srgb,var(--family-color) 30%,white);border-radius:7px;background:#ffffffd9;padding:3px;cursor:pointer}.phrase-scroll-controls .icon-svg{width:18px;height:18px}}

.profile-login-settings{margin:14px 0;padding:12px;border:1px solid #ddd4ec;border-radius:12px;background:#faf7ff}.profile-login-settings>summary{cursor:pointer;color:#6c50a0;font-weight:650}.profile-login-settings[open]>summary{margin-bottom:12px}.sound-bank-settings .sound-profile-choice>span:has(strong){display:flex;align-items:center}.sound-bank-settings fieldset{margin-bottom:0}

.class-member img{width:36px;height:36px;border-radius:12px;object-fit:cover;flex:none}.class-member>span{display:flex;align-items:center;gap:9px}
