/* Musical routes budget real space for the score, overview and shared transport. */
.music-route{--stage-gutter:var(--page-gutter);height:100dvh;min-height:640px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto auto;padding:0}
.music-route>.masthead{grid-column:1;grid-row:1}
.music-route>.breadcrumbs{grid-row:2;max-width:none;width:100%;min-height:26px;padding:4px var(--stage-gutter);font-size:11px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}
.music-route>main.wrap{grid-row:3;min-height:0;min-width:0;max-width:none;width:100%;display:flex;flex-direction:column;padding:0 var(--stage-gutter) 8px}
.music-route .page-footer{display:none}
.stage-identity{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:16px;margin:8px 0;padding:0;min-width:0}
.stage-identity>div:first-child{min-width:0}.stage-identity .eyebrow{display:none}
.stage-identity h1{font:700 clamp(24px,2.5vw,32px)/1.16 var(--serif);letter-spacing:-.3px;margin:0 0 5px;overflow-wrap:anywhere}
.stage-identity p{font:16px/1.4 var(--serif)}.identity-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
/* Equal outer columns keep the title and credit at the page center, independent of actions. */
.masthead.has-stage{position:relative;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(76px,auto) 36px;column-gap:24px;border-bottom:0}
.masthead.has-stage::after{content:'';grid-column:1/-1;grid-row:1;align-self:end;height:1px;margin-inline:calc(-1 * var(--page-gutter));background:var(--line);pointer-events:none}
.masthead.has-stage>.masthead-start{grid-column:1;grid-row:1;align-self:stretch;display:flex;align-items:center;gap:var(--masthead-gap);min-width:0}
.masthead.has-stage>.stage-identity,.masthead.has-stage>.stage-identity>div:first-child{display:contents}
.masthead.has-stage .stage-identity h1{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;gap:12px;min-width:0;margin:0;padding-block:8px;font-size:clamp(24px,2.35vw,32px);line-height:1.15;text-align:center;text-wrap:balance}
.masthead.has-stage .stage-identity h1::before,.masthead.has-stage .stage-identity h1::after{content:'';flex:1 100 40px;min-width:0;max-width:90px;height:1px;background:var(--accent);opacity:.65}
.masthead.has-stage .stage-identity p:not(.eyebrow){grid-column:2;grid-row:2;align-self:center;text-align:center;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.masthead.has-stage .identity-actions{grid-column:3;grid-row:1;justify-content:flex-end;gap:4px}
.masthead.has-stage .identity-actions>.button,.masthead.has-stage .identity-actions>details>summary{min-height:38px;padding:8px 12px;font-size:12px;background:transparent;border-color:transparent}
.masthead.has-stage .identity-actions>.button:hover,.masthead.has-stage .identity-actions>details>summary:hover{background:var(--hover)}
.music-route:has(.masthead.has-stage)>.breadcrumbs{position:relative;grid-column:1;grid-row:1;align-self:end;justify-self:start;margin:0;z-index:1;max-width:calc((100% - 2 * var(--page-gutter) - 48px) / 3 + var(--page-gutter));height:36px;padding-block:0;font-size:10px}
.music-route:has(.masthead.has-stage)>.breadcrumbs a{min-width:0;overflow:hidden;text-overflow:ellipsis}
.music-route:has(.masthead.has-stage)>main.wrap{padding-top:4px}
.stage-options{position:relative}.stage-options>summary{list-style:none}.stage-options>summary::-webkit-details-marker{display:none}
.stage-options>summary:not(.button){text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.options-panel{position:absolute;right:0;top:calc(100% + 8px);width:330px;max-width:calc(100vw - 24px);max-height:70dvh;overflow:auto;z-index:35;display:grid;gap:15px;padding:20px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:6px;box-shadow:0 12px 35px #352a2624;font-size:13px}
.options-panel h2{font-size:21px}.options-panel p{line-height:1.5}.options-panel .review-note{font-size:12px;padding:0;background:none;border:0}
.alignment-info{display:flex;align-items:baseline;gap:8px 14px;flex-wrap:wrap;margin:0 0 5px;padding:0;border:0;background:none;border-radius:0;font-size:11px;color:var(--muted)}
.alignment-info strong{font-weight:600;color:var(--ink)}.alignment-info a{margin-left:auto;white-space:nowrap}
#media-stage{flex:1;min-height:0;display:flex;flex-direction:column;gap:0}
.display-tabs{display:flex;align-items:center;gap:0;height:36px;border-radius:5px;overflow:hidden;background:var(--hover)}
.display-tabs button{align-self:stretch;padding:7px 22px;background:none;border:0;font-size:12px;color:var(--muted)}
.display-tabs button[aria-pressed=true]{color:var(--on-accent);background:var(--primary-fill)}
#notes-display,#sound-display{display:flex;flex-direction:column;flex:1;min-height:0}
#media-stage .score-ribbon,#media-stage .audio-visuals{height:100%;margin:0;min-height:0;flex:1}
#stage-timing-status{text-align:center}.player-foot #measure{margin-left:auto;white-space:nowrap}
.comparison-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:4px 0 6px}
.comparison-card{display:grid;grid-template-columns:44px minmax(0,1fr) 38px;align-items:end;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:8px 10px;min-width:0}
.comparison-card.active{border-color:var(--selection-line);background:var(--peach)}
.comparison-card>.button{padding:0;font-size:16px;height:42px}.comparison-card>.button[aria-pressed=true]{background:var(--accent);color:var(--on-accent)}
.comparison-card>.field{gap:2px;font-size:10px}.comparison-card>.field select{height:38px;font-size:13px;padding:5px 8px}
.comparison-card>.stage-options>summary{min-width:38px;padding:7px 9px;height:38px}
#comparison-status{font-size:11px;line-height:1.35;color:var(--muted);margin:3px 0;min-height:15px}
.music-route>#recording-overview{grid-row:4;margin:12px var(--stage-gutter);width:calc(100% - 2 * var(--stage-gutter));height:54px;min-height:54px}
.music-route .overview-caption{font-size:11px;margin-bottom:4px}
.music-route .overview-plot{height:36px}
.music-route>.player{grid-row:5;position:relative;inset:auto;box-shadow:none}
.music-route .player-main{max-width:none;width:100%;padding:14px var(--stage-gutter) 9px}.music-route .player-foot{max-width:none;padding-inline:var(--stage-gutter);padding-bottom:10px}
.music-route.waveform-transport .timeline{display:none}
.music-route.waveform-transport .player-main{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
.music-route.waveform-transport .transport{display:flex;grid-column:auto;grid-row:auto;justify-content:center}
.music-route.waveform-transport .player-actions{grid-column:auto;grid-row:auto;justify-self:end}
.music-route #player-settings .settings-panel{bottom:calc(100% + 12px)}
#media-stage .score-ribbon{border:0;border-radius:6px}.music-route .ribbon-tools{border-bottom:0;padding:8px 0 12px}.music-route .ribbon-bottom{border-top:0;padding:8px 0}.music-route .ribbon-reading button{font-size:11px;color:var(--muted)}.music-route .ribbon-reading button[aria-pressed=true]{color:var(--accent);border-color:transparent;border-bottom-color:var(--accent);border-radius:0;background:transparent}
.music-route .score-ribbon[data-timing=true] .ribbon-tools{padding:0 12px}
.music-route #timing-page{display:flex;flex:1;flex-direction:column;min-height:0}
.music-route .alignment-intro{flex-shrink:0}.music-route .alignment-intro h1{font-size:26px}
.music-route[data-page=timing] #timing-page{gap:4px}
.music-route[data-page=timing]>main.wrap{padding-bottom:0}
.music-route[data-page=timing] #editor{row-gap:8px}
.music-route[data-page=timing] .alignment-intro{margin:0;position:relative}
.music-route[data-page=timing] .alignment-intro h1{font-size:24px;line-height:1.12;margin-bottom:2px}
.music-route[data-page=timing] .alignment-intro p{font-size:11px;line-height:1.3}
.save-actions{gap:7px}.save-actions>.button{min-height:36px;padding:7px 10px;font-size:12px}.save-actions a,.save-actions .text-button{font-size:12px}
.editor-information{display:flex;align-items:baseline;gap:14px;justify-content:space-between;font-size:11px;margin-bottom:7px;flex-shrink:0}
.editor-information #editor-status{min-height:0;font-size:11px;line-height:1.4}.editor-information>.stage-options{flex-shrink:0}
.music-route[data-page=timing] .editor-information{margin-bottom:0}
.editor-information .options-panel{width:400px}.editor-information .options-panel p{font-size:12px}
#lyrics-text{white-space:pre-wrap;font:17px/1.9 var(--serif);margin:22px 0 0}
#expanded-controls{position:relative;z-index:40;display:flex;gap:8px;align-items:center;flex-shrink:0;margin-left:auto}
#fullscreen-status{position:absolute;right:0;top:calc(100% + 4px);font-size:11px;width:280px;color:var(--muted);text-align:right}
#stage-actions-menu{width:290px;padding:8px}
#stage-actions-menu .identity-actions{display:flex;flex-direction:column;align-items:stretch;gap:4px}
#stage-actions-menu .button{width:100%;justify-content:flex-start;text-align:left;border-color:transparent;background:transparent}
#stage-actions-menu .button:hover{background:var(--hover)}
#stage-actions-menu .options-panel{position:static;width:auto;max-width:none;max-height:none;margin:4px 0 8px;padding:12px;box-shadow:none}
.expanded{--stage-gutter:32px;color:var(--ink);color-scheme:dark;background:radial-gradient(ellipse at 50% 25%,var(--surface) 0%,var(--paper) 70%);grid-template-rows:minmax(0,1fr) auto auto}
.expanded .recording-overview{--overview-ink:var(--muted);--overview-marker:var(--accent)}
.expanded>.masthead,.expanded>.breadcrumbs{display:none}
.expanded>main.wrap{grid-row:1;padding:24px var(--stage-gutter) 0}
.expanded>#recording-overview{grid-row:2}.expanded>.player{grid-row:3;background:var(--paper);border-color:var(--line)}
.expanded .stage-identity{display:flex;align-items:center;flex-wrap:wrap;gap:16px 24px;margin:0 0 14px}.expanded .stage-identity>div:first-child{flex:1;min-width:0}.expanded [data-expand]{display:none}
.expanded .field input,.expanded .field select{color-scheme:dark}
.expanded :is(.score-ribbon,.audio-visuals,.alignment-panel){color-scheme:light;color:var(--ink)}
.expanded #media-stage .ribbon-tools,.expanded #media-stage .av-toolbar{padding-inline:16px}
.expanded #media-stage .ribbon-bottom,.expanded #media-stage .av-footer{padding-inline:16px}
@media(max-width:1260px){
 .masthead.has-stage{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:76px auto 36px;row-gap:0;padding-bottom:4px}
 .masthead.has-stage .stage-identity h1{grid-column:1/-1;grid-row:2;padding-top:18px;font-size:28px}
 .masthead.has-stage .stage-identity h1::before,.masthead.has-stage .stage-identity h1::after{max-width:70px}
 .masthead.has-stage .stage-identity p:not(.eyebrow){grid-column:1/-1;grid-row:3;font-size:14px;min-width:0}
 .masthead.has-stage .identity-actions{grid-column:2;grid-row:1;flex-wrap:nowrap}
 .music-route:has(.masthead.has-stage)>.breadcrumbs{display:none}
}
@media(max-width:900px){
 .stage-identity{align-items:start;flex-wrap:wrap}.stage-identity>div:first-child{flex:1 1 280px}.identity-actions{flex-wrap:wrap;justify-content:end}
 .masthead.has-stage{column-gap:20px}
 .music-route .alignment-intro{flex-wrap:wrap;gap:6px}.save-actions{width:100%}
}
@media(max-width:700px){
 .masthead.has-stage{grid-template-rows:76px auto auto auto;padding-bottom:8px}
 .masthead.has-stage>.masthead-start{display:contents}
 .masthead.has-stage .brand{grid-column:1;grid-row:1}.masthead.has-stage .app-nav{grid-column:2;grid-row:1;justify-self:end}
 .masthead.has-stage .stage-identity p:not(.eyebrow){padding-top:6px}
 .masthead.has-stage .identity-actions{grid-column:1/-1;grid-row:4;justify-content:center;padding-top:8px}
}
@media(max-width:600px){
 .masthead.has-stage{grid-template-rows:64px auto auto auto;column-gap:12px;padding-bottom:8px}
 .masthead.has-stage .stage-identity h1{font-size:25px;gap:12px;padding-top:18px}
 .masthead.has-stage .stage-identity h1::before,.masthead.has-stage .stage-identity h1::after{min-width:16px;max-width:40px}
 .masthead.has-stage .identity-actions>.button,.masthead.has-stage .identity-actions>details>summary{min-height:36px;padding:6px 12px;font-size:11px}
}
@media(max-width:550px){
 .music-route,.expanded{--stage-gutter:12px}
 .music-route>.breadcrumbs{padding:3px 12px;min-height:24px}
 .music-route>.breadcrumbs>:not(:first-child):not(:last-child){display:none}.music-route>.breadcrumbs>:last-child::before{content:'›';margin-right:9px}
 .music-route>main.wrap{padding:0 12px 8px}.music-route .player-main,.music-route .player-foot{padding-left:12px;padding-right:12px}
 .music-route .stage-identity h1{font-size:23px}.stage-identity p{font-size:14px}.stage-identity{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 .identity-actions{gap:8px;max-width:none;justify-content:flex-start}.identity-actions .button{font-size:11px;min-height:34px;padding:6px 8px}
 .alignment-info{gap:2px 8px;font-size:10px;line-height:1.4}.alignment-info a{margin-left:0}
 .comparison-grid{gap:6px}.comparison-card{grid-template-columns:32px minmax(0,1fr);gap:6px;padding:6px}
 .comparison-card>.button{height:40px;font-size:14px}.comparison-card>.field select{font-size:12px;padding:5px 3px;min-width:0;height:40px}
 .comparison-card>.stage-options{grid-column:1/-1;justify-self:end;height:18px}.comparison-card>.stage-options>summary{height:18px;min-height:18px;min-width:28px;padding:0 6px;font-size:11px}
 .comparison-card>.field{font-size:9px}.comparison-card .options-panel{position:fixed;top:150px;right:12px;left:12px;width:auto}
 #stage-timing-status{line-height:1.3;max-width:130px}
 .music-route[data-page=timing]>#recording-overview{display:none}
 .editor-information{font-size:10px;margin-bottom:4px;gap:6px}.editor-information #editor-status{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}
 .music-route .alignment-intro h1{font-size:23px}.alignment-intro p{font-size:10px}.save-actions{gap:6px;flex-wrap:wrap}
 .music-route[data-page=timing] .alignment-intro>div:first-child{width:100%}.music-route[data-page=timing] .alignment-intro h1{padding-right:135px;font-size:23px}
 .music-route[data-page=timing] .alignment-intro [data-expand]{position:absolute;right:0;top:0}
 .music-route[data-page=timing] .alignment-intro{gap:5px}.music-route[data-page=timing] .alignment-intro p{font-size:10px}
 .save-actions>.button{font-size:11px;padding:5px 7px;min-height:32px}.save-actions a,.save-actions .text-button{font-size:10px}
 #expanded-controls{margin-left:0;gap:6px}.expanded>main.wrap{padding-top:16px}
 #expanded-controls>.button,#expanded-controls>details>summary{min-height:36px;padding:7px 10px;font-size:12px}
 #stage-actions-menu{position:fixed;left:12px;right:12px;top:auto;width:auto;max-width:none;max-height:60dvh;margin-top:8px}
 .expanded .stage-identity{display:flex;align-items:flex-start;gap:12px}.expanded .stage-identity>div:first-child{flex-basis:100%}.expanded .settings-panel{background:var(--surface)}
 .options-panel{width:min(330px,calc(100vw - 24px));max-height:calc(100dvh - 170px)}
}
@media(max-width:700px){
 .display-tabs button{padding-inline:16px}
 .music-route.waveform-transport .player-main{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px}
 .music-route.waveform-transport .transport{display:contents}
 .music-route.waveform-transport .now-playing{grid-column:1;grid-row:1}
 .music-route.waveform-transport .display-tabs{grid-column:2;grid-row:1;justify-self:end}
 .music-route.waveform-transport .transport-buttons{grid-column:1;grid-row:2;justify-self:start}
 .music-route.waveform-transport .player-actions{grid-column:2;grid-row:2}
}
/* Readable document flow when controls need more space (zoom, open forms, short screens). */
@media(max-height:650px){
 .music-route{height:auto;min-height:100dvh;grid-template-rows:auto auto auto auto auto}
 .music-route #media-stage{min-height:370px}.music-route #editor{min-height:540px}
 .music-route>.player{position:sticky;bottom:0}.expanded{grid-template-rows:auto auto auto}
}
@media(max-width:1099px){
 .music-route:has(#mark-inspector[open]):has(#timing-page:not([hidden])){height:auto;min-height:100dvh}
}
@media(max-width:550px) and (max-height:800px){
 .music-route[data-page=timing]{height:auto;min-height:100dvh;grid-template-rows:auto auto auto auto auto}
 .music-route[data-page=timing].expanded{grid-template-rows:auto auto auto}
 .music-route[data-page=timing]>.player{position:sticky;bottom:0}
}
@media(max-width:600px) and (max-height:800px){
 .music-route:is([data-page=listen],[data-page=compare]):not(.expanded){height:auto;min-height:100dvh;grid-template-rows:auto auto auto auto auto}
 .music-route:is([data-page=listen],[data-page=compare]):not(.expanded) #media-stage{min-height:340px}
 .music-route:is([data-page=listen],[data-page=compare]):not(.expanded)>.player{position:sticky;bottom:0}
}
/* Three navigation destinations get their own row on phones. */
@media(max-width:760px){
 .masthead.has-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 44px auto auto auto;column-gap:0}
 .masthead.has-stage>.masthead-start{display:contents}
 .masthead.has-stage .brand{grid-column:1;grid-row:1;justify-self:start;padding-top:12px}
 .masthead.has-stage .app-nav{grid-column:1;grid-row:2;justify-self:start;gap:24px}
 .masthead.has-stage::after{grid-column:1;grid-row:2}
 .masthead.has-stage .stage-identity h1{grid-column:1;grid-row:3}
 .masthead.has-stage .stage-identity p:not(.eyebrow){grid-column:1;grid-row:4}
 .masthead.has-stage .identity-actions{grid-column:1;grid-row:5;justify-content:center;padding-top:8px}
}
