/* Score first: scoped to screen tools; printed scores keep their existing geometry. */
@media screen {
  #app > .topbar .song-heading { display:none; }
  #app.is-focused > .topbar .song-heading { display:flex; }
  .song-heading .song-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .song-heading .song-credit { display:none; }
  #dialog .workspace-appearance > h3 { margin-top:0; font-size:14px; }
  #dialog .workspace-preferences .appearance-choice { min-height:68px; gap:7px; padding:10px; }
  #dialog .workspace-preferences .appearance-description { display:none; }
  #dialog .workspace-preferences .appearance-swatches { min-height:16px; margin:0; }
  #dialog .workspace-preferences .appearance-swatches > span { height:16px; width:23px; }
  #dialog.pitch-dialog { width:min(710px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); }
  #dialog.pitch-dialog .dialog-body { padding:18px 24px; }
  .pitch-studio-intro { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom:18px; }
  .pitch-studio-intro h3 { margin:0 0 5px; font-size:19px; letter-spacing:-.35px; }
  .pitch-studio-intro p { margin:0; color:var(--muted); font-size:12px; }
  .pitch-palette-state { flex:none; padding:5px 8px; color:var(--muted); background:var(--surface); border-radius:5px; font-size:10px; }
  .pitch-choices { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
  #dialog .pitch-choice { position:relative; display:flex; flex-direction:column; gap:3px; min-width:0; min-height:64px; padding:8px 4px; color:var(--note-color); background:var(--canvas); border:1px solid var(--edge); border-radius:9px; }
  .pitch-choice strong { font:650 19px var(--mono); }
  .pitch-choice small { font:10px var(--mono); opacity:1; }
  .pitch-choice small:empty { min-height:12px; }
  #dialog .pitch-choice[aria-pressed=true] { border-color:var(--selection); outline:2px solid var(--selection); outline-offset:2px; }
  .pitch-edit { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:18px 0 14px; margin-top:14px; border-top:1px solid var(--border); }
  .pitch-edit-name { flex:none; display:grid; place-items:center; width:58px; height:62px; color:var(--note-color); font:600 32px var(--mono); }
  #dialog .pitch-edit .field { margin:0; }
  .pitch-edit input[type=color] { width:64px; height:38px; padding:3px; cursor:pointer; }
  .pitch-edit input[type=text] { width:116px; font-family:var(--mono); }
  .pitch-edit > button { margin-left:auto; }
  .pitch-studio-detail { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:center; margin-top:18px; padding-top:14px; border-top:1px solid var(--border); }
  .pitch-studio-detail .pitch-edit { display:grid; grid-template-columns:40px 64px minmax(0,1fr); gap:8px 12px; margin:0; border:0; padding:0; }
  .pitch-studio-detail .pitch-edit-name { width:40px; font-size:29px; }
  .pitch-studio-detail .pitch-edit > button { grid-column:2 / -1; justify-self:start; margin:0; padding:5px 0; }
  .pitch-studio-detail .pitch-edit input[type=text] { width:100%; }
  .pitch-edit-status { min-height:0; margin:5px 0; color:var(--playing-clash,var(--ink)); font-size:12px; }
  .pitch-edit-status:empty { position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .pitch-preview { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:14px 16px 8px; border:1px solid var(--border); background:var(--canvas); border-radius:10px; }
  .pitch-preview > div { min-width:0; }
  .pitch-preview .eyebrow { font-size:9px; }
  .pitch-preview .pitch-sample .note-pitch-label { font:10px var(--mono); }
  #dialog .pitch-preview .pitch-sample { display:block; width:100%; height:82px; min-width:0; margin:0; }
  .pitch-preview .pitch-piano-sample { position:relative; height:82px; min-height:0; border:0; border-radius:0; background:repeating-linear-gradient(to bottom,transparent 0 25px,var(--border) 26px 27px); }
  .pitch-preview .pr-note { left:15%; top:26px; width:68%; height:27px; min-height:0; font-size:11px; padding-left:8px; }
  .pitch-coding { display:flex; align-items:end; gap:20px; margin-top:18px; }
  #dialog .pitch-coding .field { flex:0 0 175px; margin:0; }
  .pitch-coding p { margin:0; }
  #dialog .workspace-notes { display:flex; align-items:center; gap:16px; padding-top:16px; border-top:1px solid var(--border); }
  .workspace-note-copy { flex:1; min-width:0; }
  .workspace-note-copy > strong { display:block; font-size:13px; margin-bottom:4px; }
  .workspace-note-copy > small { display:block; color:var(--muted); font-size:11px; }
  .workspace-pitch-strip { display:flex; flex:0 0 auto; gap:3px; }
  .workspace-pitch-strip span { width:6px; height:24px; border-radius:3px; background:var(--note-color); }
}
@media screen and (min-width:1101px) {
  #app > .topbar { gap:15px; }
  #app > .topbar .song-heading { display:flex; flex-direction:column; align-items:start; gap:1px; flex:1 1 130px; min-width:80px; max-width:240px; padding:4px 0; text-align:left; }
  .song-heading .song-title { max-width:100%; font-size:14px; font-weight:650; }
  .song-heading .song-credit { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; font-weight:400; color:var(--muted); }
  #app > .topbar .top-actions { gap:4px; }
  #app > .topbar .top-actions .command-launch { width:34px; gap:0; padding-inline:7px; font-size:0; }
  #app > .topbar .top-actions .command-launch kbd { display:none; }
  #app > .topbar .saved-state { max-width:116px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; margin-right:4px; }
  #app > .topbar .saved-state[data-state] { font-size:0; overflow:visible; }
  #app > .topbar .saved-state[data-state]::after { content:'Saved' / ''; font-size:11px; }
  #app > .topbar .saved-state[data-state=saving]::after { content:'Saving…' / ''; }
  #app > .topbar .saved-state[data-state=downloaded]::after { content:'Downloaded' / ''; }
  #app > .topbar .saved-state[data-state=changed-since-download]::after { content:'Changed' / ''; }
  #app > .topbar .saved-state[data-state=failed]::after { content:'Not saved' / ''; }
  #app > .topbar .saved-state[data-state=conflict]::after { content:'Saved separately' / ''; }
  #app > .topbar .saved-state[data-state=unreadable]::after { content:'Draft protected' / ''; }
  #app:not(.is-focused) .main > .workspace-header { display:none; }
  #app:not(.is-focused) .main { padding-top:8px; }
  #app:not(.is-focused) .main > .quiet-transport { margin-bottom:10px; }
  #app[data-workflow=write]:not(.is-focused) .main > .workflow-write { margin:0 0 12px; padding:1px 0; border:0; border-radius:0; background:transparent; box-shadow:none; }
  #app[data-workflow=write] #write-band { color:var(--ink); border:1px solid var(--border); background:var(--surface); font-weight:550; }
  #app[data-workflow=write]:not(.is-focused) .main > .arrangement-section { margin-bottom:10px; }
  #app[data-workflow=write]:not(.is-focused) .arrangement-heading { margin-bottom:5px; }
  #app[data-workflow=write]:not(.is-focused) .bars-scroll { margin-bottom:0; padding-bottom:4px; }
  #app[data-workflow=write]:not(.is-focused) .bar-card.compact { height:42px; min-height:42px; padding-block:5px; }
  #app[data-workflow=write]:not(.is-focused) .bar-card.compact .bar-mini { height:17px; }
  #app[data-workflow=write]:not(.is-focused) .add-bar-card { height:42px; min-height:42px; }
  #app[data-workflow=write]:not(.is-focused) .arrangement-section:has(.compact-rail) { display:flex; flex-wrap:wrap; align-items:center; gap:12px 16px; }
  #app[data-workflow=write]:not(.is-focused) .arrangement-section:has(.compact-rail) .arrangement-heading { flex:0 0 230px; display:flex; flex-direction:column; align-items:start; justify-content:center; gap:3px; margin:0; }
  #app[data-workflow=write]:not(.is-focused) .arrangement-section:has(.compact-rail) #arrangement { flex:1 1 calc(100% - 246px); min-width:0; }
  #app[data-workflow=write]:not(.is-focused) .arrangement-section:has(.compact-rail) > :not(.arrangement-heading):not(#arrangement) { flex:1 1 100%; }
  #app[data-workflow=write]:not(.is-focused) .arrange-tools button { min-height:28px; padding:4px 6px; font-size:10px; }
}
@media screen and (min-width:1101px) and (pointer:fine) {
  #app:not(.is-focused) .editor-heading { min-height:44px; padding-block:5px; }
  #app:not(.is-focused) .compose-controls { min-height:44px; padding-block:5px; }
}
@media screen and (max-width:900px) {
  #app.is-focused > .topbar .song-heading { display:none; }
}
@media screen and (max-width:560px) {
  #dialog.pitch-dialog .dialog-body { padding:16px; }
  #dialog.pitch-dialog .dialog-header .icon-button { width:44px; height:44px; }
  #dialog.pitch-dialog .dialog-footer button { min-height:44px; }
  .pitch-studio-intro { flex-direction:column; gap:9px; margin-bottom:14px; }
  .pitch-choices { gap:5px; }
  #dialog .pitch-choice { min-height:56px; }
  .pitch-choice strong { font-size:17px; }
  .pitch-edit { gap:8px; padding-block:12px; }
  .pitch-edit-name { width:35px; font-size:27px; }
  #dialog.pitch-dialog .pitch-edit input[type=color],#dialog.pitch-dialog .pitch-edit input[type=text] { min-height:44px; }
  .pitch-edit > button { margin-left:0; font-size:11px; min-height:44px; }
  .pitch-coding { flex-direction:column; align-items:stretch; gap:9px; }
  #dialog .pitch-coding .field { flex:auto; }
  .pitch-preview { gap:10px; padding-inline:10px; }
  .pitch-studio-detail { grid-template-columns:1fr; gap:12px; margin-top:14px; padding-top:10px; }
  #dialog .workspace-notes { flex-wrap:wrap; gap:12px; }
  .workspace-pitch-strip { margin-left:auto; }
  .workspace-notes > button { width:100%; min-height:44px; }
}

/* Short landscape keeps the pitch choices beside their values and preview. */
@media screen and (min-width:650px) and (max-height:500px) {
  #dialog.pitch-dialog .dialog-header { padding:4px 16px; min-height:52px; }
  #dialog.pitch-dialog .dialog-header h2 { font-size:18px; }
  #dialog.pitch-dialog .dialog-header .icon-button { width:44px; height:44px; }
  #dialog.pitch-dialog .dialog-footer { padding:8px 16px; }
  #dialog.pitch-dialog .dialog-footer button { min-height:44px; }
  #dialog.pitch-dialog .dialog-body { padding:12px 16px; }
  .pitch-customizer { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 16px; }
  .pitch-studio-intro { grid-column:1 / -1; align-items:center; margin:0; }
  .pitch-studio-intro h3 { display:none; }
  .pitch-studio-intro p { font-size:11px; line-height:1.4; }
  .pitch-studio-intro .pitch-palette-state { padding:4px 6px; font-size:9px; line-height:13px; }
  .pitch-choices { grid-column:1; gap:6px 5px; }
  #dialog.pitch-dialog .pitch-choice { min-height:44px; padding:3px 2px; gap:0; border-radius:7px; }
  .pitch-choice strong { font-size:15px; }
  .pitch-choice small { font-size:9px; }
  .pitch-choice small:empty { min-height:11px; }
  .pitch-studio-detail { grid-column:2; grid-row:2 / span 2; display:flex; flex-direction:column; align-items:stretch; gap:8px; margin:0; padding:0; border:0; }
  .pitch-studio-detail .pitch-edit { grid-template-columns:32px 50px minmax(0,1fr) 44px; gap:4px 8px; }
  .pitch-studio-detail .pitch-edit-name { align-self:end; width:32px; height:44px; font-size:24px; }
  #dialog.pitch-dialog .pitch-edit input[type=color] { width:50px; min-height:44px; }
  #dialog.pitch-dialog .pitch-edit input[type=text] { min-height:44px; min-width:0; }
  .pitch-studio-detail .pitch-edit > button { grid-column:auto; justify-self:stretch; align-self:end; width:44px; min-height:44px; padding:0; border:1px solid var(--border); border-radius:7px; font-size:10px; }
  .pitch-preview { padding:7px 10px; gap:10px; }
  .pitch-preview .eyebrow { display:block; line-height:11px; }
  #dialog .pitch-preview .pitch-sample { height:56px; }
  .pitch-preview .pitch-piano-sample { height:56px; }
  .pitch-preview .pr-note { top:18px; height:26px; }
  .pitch-coding { grid-column:1; align-self:end; margin:0; }
  #dialog .pitch-coding .field { display:flex; flex-direction:row; align-items:center; flex:1; gap:8px; }
  #dialog .pitch-coding .field > label { flex:none; font-size:10px; }
  #dialog .pitch-coding select { flex:1; min-width:0; min-height:44px; }
  .pitch-coding > .fine-print { display:none; }
  .pitch-customizer > .fine-print { grid-column:1 / -1; margin:0; line-height:1.4; }
}

@media screen and (max-width:700px), screen and (max-height:500px) {
  #dialog.pitch-dialog .dialog-header .icon-button { width:44px; height:44px; }
  #dialog.pitch-dialog .dialog-footer button { min-height:44px; }
  #dialog.pitch-dialog .pitch-edit input[type=color],#dialog.pitch-dialog .pitch-edit input[type=text] { min-height:44px; }
}

/* Phone editing: the part route and note values stay in sight in either tool. */
@media screen and (max-width:700px) {
  #app:not(.is-focused) #editor > .editor-heading { display:grid; grid-template-columns:minmax(0,1fr) 66px 60px; gap:4px; }
  #app:not(.is-focused) #editor > .editor-heading > .part-title { display:flex; grid-column:1; grid-row:1; justify-content:flex-start; min-width:0; gap:4px; }
  #app:not(.is-focused) #editor .part-title > .track-dot { display:none; }
  #app:not(.is-focused) #editor > .editor-heading > #focus-writing { grid-column:2; grid-row:1; }
  #app:not(.is-focused) #editor > .editor-heading > .phone-editor-tools { grid-column:3; grid-row:1; }
  #app:not(.is-focused) #editor > .editor-heading > .editor-zoom { display:flex; grid-column:1; grid-row:2; justify-self:start; margin:0; font-size:0; }
  #app:not(.is-focused) #editor > .editor-heading > .bar-nav { grid-column:2/4; grid-row:2; justify-content:flex-end; }
  #app:not(.is-focused) #editor > .editor-heading > .pattern-actions { grid-column:1/-1; }
  #app #editor .compose-controls > .compose-swap { overflow:visible; min-height:0; padding:0; }
  #app #editor .compose-swap > :is(.editor-tools,#note-context) { width:100%; min-width:0; flex-wrap:wrap; gap:6px; }
  #app #editor .compose-swap > .editor-tools { align-content:start; }
  #app #editor .compose-controls :is(#note-context .context-unit,.editor-tools .compact-control) { flex-shrink:1; }
  #app #editor .compose-controls .edit-tool-switch button { min-height:44px; }
  #app #editor #note-context > .context-identity { order:3; flex-basis:auto; margin-right:auto; font-size:10px; }
  #app #editor #note-context > .note-advanced { order:4; flex:0 1 auto; }
  #app #editor #note-context > .note-advanced[open] { flex-basis:100%; }
  #app #editor .compose-controls .note-advanced-body { position:static; box-sizing:border-box; width:100%; min-width:0; max-height:none; overflow:visible; }
  #app #editor .compose-controls .note-advanced-body .context-unit { flex-wrap:wrap; }
  #app #editor #note-context .note-advanced-body :is(input,select,button) { min-height:44px; height:44px; }
  #app #editor .compose-controls :is(#entry-length,#context-length,#entry-snap) { min-height:44px; height:44px; }
  #app[data-workflow=write].is-focused .workflow-write:not(:has(.capture-listening,.memo-record.is-recording,.memo-record:disabled:not([aria-pressed]),.memo-pending,.memo-play.is-playing,.practice-save-warning)) { display:none; }
}
.learn-setup-phone { display:none; }
/* Landscape reading shares one row for transport and Setup, leaving room for all strings. */
@media screen and (min-width:650px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app[data-workflow=learn].is-focused > .layout > .main { display:grid; grid-template-columns:minmax(0,1fr) 152px; grid-template-rows:auto minmax(0,1fr); gap:4px; }
  #app[data-workflow=learn].is-focused .main > .transport { grid-column:1; grid-row:1; margin:0; }
  #app[data-workflow=learn].is-focused .transport-main { grid-template-columns:54px 44px 88px 54px 56px 54px minmax(44px,1fr) 44px; }
  #app[data-workflow=learn].is-focused .quiet-transport :is(.number-control,select,.transport-focus) { min-width:0; padding-inline:2px; }
  #app[data-workflow=learn].is-focused .main > .workflow-bar { grid-column:2; grid-row:1; margin:0; padding:2px 4px; min-width:0; }
  #app[data-workflow=learn].is-focused .learn-options > summary { gap:4px; padding:0; }
  #app[data-workflow=learn].is-focused .learn-options:not([open]) > summary .learn-setup-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #app[data-workflow=learn].is-focused .learn-options:not([open]) .learn-setup-phone { display:flex; flex-direction:column; gap:1px; min-width:0; }
  .learn-setup-phone strong { color:var(--ink); font-size:12px; font-weight:550; }
  .learn-setup-phone small { color:var(--muted); font-size:9px; white-space:nowrap; }
  .learn-setup-phone small { overflow:hidden; text-overflow:ellipsis; }
  .learn-setup-phone .is-altered { color:var(--ink); font-weight:600; }
  .learn-setup-phone .practice-pin-count { font-size:9px; color:var(--muted); font-weight:400; }
  #app[data-workflow=learn].is-focused .main > .work-area { grid-column:1/-1; grid-row:2; }
  #app[data-workflow=learn].is-focused .main > .continuity-notices { grid-column:1/-1; }
  #app[data-workflow=learn].is-focused:has(.learn-options[open]) > .layout > .main { display:flex; }
  #app[data-workflow=learn].is-focused:has(.learn-options[open]) .main > .transport { width:auto; align-self:stretch; }
  #app[data-workflow=learn].is-focused:has(.learn-options[open]) .main > .workflow-bar { width:auto; align-self:stretch; }
}

@media screen and (min-width:650px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app.is-focused #editor > .editor-canvas:has([data-compact-read=true]) { padding-block:2px; scrollbar-width:thin; }
}

@media screen and (max-width:700px) {
  /* Pace and Clean are immediate; ladder setup and best speed remain in Setup. */
  #app.is-focused .is-phone-focus > .learn-speed { justify-content:flex-start; flex-wrap:nowrap; gap:4px; }
  #app.is-focused .is-phone-focus > .learn-speed :is(.learn-ladder,.learn-best) { display:none; }
}

@media screen and (min-width:650px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  /* Recovery is never squeezed into the compact Setup column. */
  #app[data-workflow=learn].is-focused:has(.learn-hero > .practice-save-warning,.learn-hero > .memo-control .memo-pending) > .layout > .main { display:flex; }
  #app[data-workflow=learn].is-focused:has(.learn-hero > .practice-save-warning,.learn-hero > .memo-control .memo-pending) .main > :is(.transport,.workflow-bar) { width:auto; align-self:stretch; }
}

@media screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app.is-focused .quiet-transport #playback-options { position:relative; }
  #app.is-focused #playback-options .performance-badge { position:absolute; top:5px; right:5px; width:7px; height:7px; min-width:0; padding:0; border-radius:50%; background:var(--play); font-size:0; }
}

@media screen and (max-width:700px), screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app.is-focused .learn-options-body > .workflow-pins { flex-wrap:wrap; gap:6px; }
  #app.is-focused .learn-options-body > .workflow-pins .workflow-pin { min-height:44px; }
}

/* Supporting sound controls always offer a direct route back to the score. */
.sound-feel-panel .sound-feel-close { margin-left:auto; min-width:44px; min-height:44px; flex-shrink:0; }

@media screen and (max-width:700px), screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app[data-workflow=learn] .learn-hero :is(button,input:not([type=checkbox]):not([type=radio]),select) { min-height:44px; }
  #app[data-workflow=learn] .learn-hero button { min-width:44px; }
  #app .editor-zoom select { min-width:76px; padding-inline:6px 20px; }
  #app[data-workflow=learn] .learn-hero label:has(input[type=checkbox]) { min-height:44px; }
}

/* Secondary phone controls need the same deliberate hit area as the main actions. */
@media screen and (max-width:700px), screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #app .quiet-transport :is(.speaker-mute,.history-actions button,#playback-options) { min-width:44px; min-height:44px; }
  #app .playback-options :is(button,select) { min-height:44px; }
  #app .sidebar :is(.part-select,.part-controls > button,#add-part) { min-height:44px; }
  #app .sidebar .part-controls > button, #app #add-part { min-width:44px; }
  #app .arrange-tools button, #app #editor .bar-tools :is(button,summary), #app #inspector :is(button,select,summary) { min-height:44px; }
  #app #editor .compose-controls :is(input,select) { min-height:44px; }
  #app #editor .canvas-footer :is(button,summary) { min-height:44px; }
  #app #editor .canvas-footer button { min-width:44px; }
  /* Override the legacy compact Playing check height, including mouse-driven phone previews. */
  #app #editor .canvas-footer .playing-check-toggle { min-height:44px!important; }
  .library-topbar .library-utility { min-width:44px; min-height:44px; }
  #dialog .simple-mixer :is(button,input[type=range]), #dialog .mixer-output button { min-height:44px; }
  #dialog .dialog-header > button { min-width:44px; min-height:44px; }
}

@media screen {
  #dialog.pitch-dialog .pitch-coding { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; }
  #dialog.pitch-dialog .pitch-coding .field { display:grid; gap:4px; min-width:0; margin:0; }
  #dialog.pitch-dialog .pitch-coding select { width:100%; min-width:0; min-height:44px; }
  #dialog.pitch-dialog .pitch-coding .fine-print { grid-column:1 / -1; margin:0; }
}

/* Stage 2: purposeful states and a direct song-start workflow. */
@media screen {
  .main .transport .play-button { background:var(--play); color:var(--play-ink); }
  .secondary, .active-toggle { border-color:var(--edge); }
  #app > .topbar .songs-home-link { padding:6px 0; min-height:36px; color:var(--muted); }
  #app > .topbar .songs-home-link:hover { color:var(--ink); }
  .home-start-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 20px; }
  .home-start-actions :is(.home-action,.learn-entry-card) { display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto auto; align-content:center; justify-content:stretch; align-items:center; gap:2px 12px; min-height:76px; padding:12px 16px; border:1px solid var(--edge); border-radius:var(--radius-lg); background:var(--panel); color:var(--ink); text-align:left; white-space:normal; box-shadow:none; }
  .home-start-actions :is(.home-action,.learn-entry-card):hover { background:var(--hover); border-color:var(--nav); transform:none; }
  .home-start-actions :is(.home-action-icon,.learn-entry-icon) { grid-row:1 / 3; width:24px; height:28px; min-height:0; background:transparent; color:var(--muted); }
  .home-start-actions :is(.home-action,.learn-entry-card) > strong { min-width:0; font-size:14px; line-height:20px; }
  .home-start-actions :is(.home-action-description,.learn-entry-card > span:not(.learn-entry-icon)) { font-size:12px; line-height:18px; color:var(--muted); }
  .home-start-actions :is(.home-action-arrow,.learn-entry-card > .icon) { display:none; }
  .learn-entry .learn-entry-main { max-width:980px; }
  .song-current { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 12px; margin:0 0 16px; }
  .song-current > .eyebrow { grid-column:1; }
  .song-current > strong { grid-column:1; overflow-wrap:anywhere; font-size:18px; line-height:24px; }
  .song-current > button { grid-column:2; grid-row:1 / 3; min-height:44px; white-space:normal; text-align:left; }
  .song-current > button .icon { transform:rotate(180deg); }
  .song-current-actions { display:flex; flex-wrap:wrap; gap:6px; padding-block:16px; }
  .song-current-actions > button { min-height:40px; }
  .song-start-choices .dialog-choice:first-child { border-color:var(--edge); }
}
@media screen and (max-width:700px) {
  .home-start-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:16px; }
  .home-start-actions :is(.home-action,.learn-entry-card) { min-height:76px; padding:10px; gap:2px 8px; }
  .home-start-actions :is(.home-action,.learn-entry-card):last-child { grid-column:1 / -1; min-height:54px; grid-template-columns:auto auto 1fr; grid-template-rows:auto; }
  .home-start-actions :is(.home-action,.learn-entry-card):last-child > :is(.home-action-icon,.learn-entry-icon) { grid-row:auto; }
  .home-start-actions :is(.home-action,.learn-entry-card):last-child > :is(.home-action-description,span:not(.learn-entry-icon)) { justify-self:end; }
  .home-start-actions :is(.home-action,.learn-entry-card) > strong { font-size:13px; }
  .song-current { grid-template-columns:minmax(0,1fr); gap:4px; }
  .song-current > button { grid-column:1; grid-row:auto; width:fit-content; padding-left:0; }
  .song-current-actions > button { flex:1 1 auto; min-height:44px; }
}
@media screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  .home-main,.learn-entry-main { padding-top:16px; }
  .home-heading { margin-bottom:12px; }
  .home-start-actions { margin-bottom:12px; }
  .home-start-actions :is(.home-action,.learn-entry-card) { min-height:64px; padding:8px 12px; }
  .home-primary { min-height:110px; padding:18px; }
}

@media screen and (min-width:600px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  #dialog.song-dialog .dialog-header { padding:12px 16px; }
  #dialog.song-dialog .dialog-header h2 { font-size:18px; }
  #dialog.song-dialog .dialog-body { padding:12px 16px; }
  #dialog.song-dialog .dialog-footer { padding:8px 16px; }
  #dialog.song-dialog .dialog-footer button { min-height:44px; }
  #dialog.song-dialog .song-current { margin-bottom:8px; }
  #dialog.song-dialog .song-start-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  #dialog.song-dialog .song-start-choices .dialog-choice { flex-direction:column; align-items:flex-start; gap:6px; padding:10px; }
  #dialog.song-dialog .song-start-choices .dialog-choice-icon { display:none; }
  #dialog.song-dialog .song-start-choices .dialog-choice-copy { min-width:0; }
  #dialog.song-dialog .song-start-choices .dialog-choice > .icon:last-child { display:none; }
  #dialog.song-dialog .song-current-actions { padding-block:10px; }
}

/* Home is the activity chooser; song pages retain a visible way back. */
@media screen {
  .home-location { display:flex; align-items:center; gap:8px; flex:1 1 auto; }
  .home-location .home-route-back { min-height:44px; padding:6px 8px; }
  .home-location .home-route-back > .icon { width:14px; transform:rotate(180deg); }
  .home-topbar .home-brand,.learn-entry-top > button.brand { padding:0; min-height:44px; }
  .home-topbar .home-private { display:none; }
  .home-continue-song { min-height:44px; margin-top:20px; }
}
@media screen and (max-width:700px) {
  .home-topbar,.learn-entry-top { gap:6px; padding:16px; flex-wrap:wrap; }
  .home-location { flex:1 1 auto; gap:2px; justify-content:center; }
  .home-location .workflow-switch { min-height:44px; padding:6px; gap:4px; font-size:12px; }
  .home-location .workflow-switch > .workflow-glyph { display:none; }
  .home-location .home-route-back { padding:6px 4px; gap:3px; font-size:12px; }
  .home-topbar .home-brand .brand-name { font-size:22px; }
  .home-topbar .home-top-actions { gap:0; }
  .home-location .workflow-menu { left:auto; right:0; width:min(300px,calc(100vw - 32px)); }
}

@media screen and (max-width:700px) { .home-location .workflow-switch .workflow-name { display:inline; } }

.first-run-main > .home-continue-song { margin:0 0 16px; }
