html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Match every sound control and leave enough room to drag it on a tablet. */
input.sound-volume-slider.sound-volume-slider.sound-volume-slider { appearance:none; -webkit-appearance:none; box-sizing:border-box; display:block; height:44px; margin:0; padding:0; border:0; background:transparent; cursor:pointer; touch-action:none; }
input.sound-volume-slider.sound-volume-slider.sound-volume-slider::-webkit-slider-runnable-track { box-sizing:border-box; height:6px; border:1px solid #c9b7c4; border-radius:999px; background:linear-gradient(to right,#834468 var(--sound-volume-fill,0%),#e7e2e6 0); box-shadow:none; }
input.sound-volume-slider.sound-volume-slider.sound-volume-slider::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; box-sizing:border-box; width:20px; height:20px; margin-top:-8px; border:0; border-radius:50%; background:#834468; box-shadow:none; }
input.sound-volume-slider.sound-volume-slider.sound-volume-slider::-moz-range-track { box-sizing:border-box; height:6px; border:1px solid #c9b7c4; border-radius:999px; background:linear-gradient(to right,#834468 var(--sound-volume-fill,0%),#e7e2e6 0); box-shadow:none; }
input.sound-volume-slider.sound-volume-slider.sound-volume-slider::-moz-range-thumb { box-sizing:border-box; width:20px; height:20px; border:0; border-radius:50%; background:#834468; box-shadow:none; }



a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

:root { --app-background:#873568; }
html, body { margin:0; min-height:100%; width:100%; background:var(--app-background); }
#app { min-height:100dvh; background:var(--app-background); }

/* Game controls should never drag-select labels or display scrollbars. */
html, body { overflow:hidden; }
/* Desktop/tablet workspaces retain their intrinsic minimum height in short
   windows. Scroll the document instead of clipping the piano or status bar;
   compact phone layouts continue to own their viewport. */
html:has(.home-page:not(.phone-layout)) { overflow-y:auto; }
body:has(.home-page:not(.phone-layout)) { overflow:visible; }
*, *::before, *::after {
    -webkit-user-select:none;
    user-select:none;
    scrollbar-width:none;
}
*::-webkit-scrollbar { display:none; width:0; height:0; }

/* Shared readable type and touch sizes for game settings. */
:root {
    --popup-heading-size:1.5rem;
    --popup-text-size:1.0625rem;
    --popup-help-size:.9375rem;
    --popup-muted:#71556b;
    --popup-touch-size:48px;
}

/* Scrollable content extends into a clipped gutter to hide native overlay bars. */
.popup-scroll { max-height:inherit; overflow-x:hidden; overflow-y:auto; margin-right:-24px; padding:20px 44px 20px 20px; box-sizing:border-box; scrollbar-width:none; }
.popup-scroll::-webkit-scrollbar { display:none; width:0; height:0; }

/* Phone landscape dialogs use the available width while avoiding the sensor housing. */
@media (orientation:landscape) and (max-height:600px) {
 body:has(.phone-layout) { --popup-heading-size:1.15rem; --popup-text-size:.9rem; --popup-help-size:.8rem; --popup-touch-size:44px; --phone-dialog-inset:max(12px,env(safe-area-inset-left),env(safe-area-inset-right)); }
 body:has(.phone-layout) .ledger-range-popover,
 body:has(.phone-layout) .reports-dialog:not(.reports-concept),
 body:has(.phone-layout) .midi-dialog,
 body:has(.phone-layout) .safari-midi-help { width:min(900px,calc(100vw - 2 * var(--phone-dialog-inset))); max-width:none; max-height:calc(100dvh - 16px); box-sizing:border-box; border-radius:14px; }
 body:has(.phone-layout) .reports-dialog.summary-view { width:min(780px,calc(100vw - 2 * var(--phone-dialog-inset))); }
 body:has(.phone-layout) .ledger-heading { min-height:44px; padding:8px 60px 8px 16px; box-sizing:border-box; }
 body:has(.phone-layout) .ledger-heading h2 { font-size:1.15rem; line-height:1.2; }
 body:has(.phone-layout) .ledger-heading p { margin:2px 0 0; font-size:.8rem; }
 body:has(.phone-layout) .ledger-heading .popup-close { top:4px; right:8px; }
 body:has(.phone-layout) .ledger-body { padding:10px 14px; gap:10px; }
 body:has(.phone-layout) .ledger-content { margin-top:10px; gap:10px; }
 body:has(.phone-layout) .ledger-range-panel,
 body:has(.phone-layout) .ledger-preview-panel { padding:10px; }
 body:has(.phone-layout) .ledger-keyboard-shell { margin-top:26px; }
 body:has(.phone-layout) .ledger-keyboard { height:72px; }
 body:has(.phone-layout) .ledger-footer { padding:4px 14px; }
 body:has(.phone-layout) .ledger-footer button { min-height:40px; padding:5px 16px; }
 body:has(.phone-layout) .reports-content { max-height:calc(100dvh - 18px); padding:12px 16px; }
 body:has(.phone-layout) .reports-heading { margin-bottom:8px; }
 body:has(.phone-layout) .reports-heading h2 { font-size:1.2rem; }
 body:has(.phone-layout) .reports-tabs { margin-bottom:8px; }
 body:has(.phone-layout) .safari-midi-help header { padding:10px 16px; }
 body:has(.phone-layout) .safari-help-body { padding:10px 16px; }
 body:has(.phone-layout) .safari-midi-help footer { padding:8px 16px; }
 body:has(.phone-layout) .home-page.phone-layout .transport-controls .key-popover,
 body:has(.phone-layout) .home-page.phone-layout .transport-controls .clef-popover,
 body:has(.phone-layout) .home-page.phone-layout .transport-controls .slider-popover { top:48px; left:var(--phone-dialog-inset); max-width:calc(100vw - 2 * var(--phone-dialog-inset)); max-height:calc(100dvh - 56px); }
 body:has(.phone-layout) .home-page.phone-layout .transport-controls .popup-scroll { padding:12px 36px 12px 12px; }
 body:has(.phone-layout) .key-list { max-height:none; min-height:0; overflow:visible; margin:0; padding:0; }
 body:has(.phone-layout) .key-option,
 body:has(.phone-layout) .clef-option { min-height:44px; padding:8px; margin-top:4px; }
 /* Wide Android phones still need popups outside the scrolling toolbar. */
 body:has(.home-page.android-layout.phone-layout) .home-page.phone-layout .transport-controls :is(.interval-popover,.key-popover,.clef-popover,.slider-popover) { position:fixed; right:auto; }
}

/* Approved clef modal: Android and iPhone landscape phones. */
@media (orientation:landscape) and (max-height:600px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .transport-controls .clef-popover {
  --clef-side-inset:max(12px,env(safe-area-inset-left),env(safe-area-inset-right));
  --clef-vertical-inset:max(8px,env(safe-area-inset-top),env(safe-area-inset-bottom));
  position:fixed; top:50%; left:50%; right:auto; bottom:auto; z-index:100;
  transform:translate(-50%,-50%); width:min(1000px,calc(100vw - 2 * var(--clef-side-inset)));
  height:min(360px,calc(100dvh - 2 * var(--clef-vertical-inset)));
  max-width:none; max-height:none; margin:0; padding:0; border:1px solid #dfcddd; border-radius:18px;
  background:linear-gradient(145deg,#fffdfc,#fbf4f8);
  box-shadow:0 16px 48px #25102250,0 0 0 100vmax #27152899;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:auto auto minmax(0,1fr) auto;
  gap:8px 12px; height:100%; max-height:none; margin:0; padding:16px 18px 12px; overflow:auto;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll>strong {
  grid-column:1 / -1; min-height:28px; padding-right:54px; color:#32152f; font-size:23px; line-height:1.2;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll>p {
  grid-column:1 / -1; margin:0; padding:0 54px 10px 0;
  border-bottom:1px solid #e1d2de; font-size:13px; line-height:1.3;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-option {
  position:relative; display:grid; grid-template-rows:minmax(44px,1fr) auto; gap:8px;
  align-items:center; justify-items:center; min-width:0; min-height:128px; margin:0; padding:10px 8px;
  border:1px solid #d8c1d4; border-radius:14px; background:#fffdfd; color:#32152f; text-align:center;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-option.selected {
  border-color:#8b4a72; background:linear-gradient(125deg,#f0ddec,#fcf3f9); box-shadow:inset 0 0 0 1px #8b4a72;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-option>.clef-symbol { display:none; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-staff-preview {
  display:block; width:100%; height:100%; min-height:0; pointer-events:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-staff-preview svg { display:block; width:100%; height:100%; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-name { width:100%; font-size:16px; font-weight:700; line-height:1.2; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-name small { margin-top:6px; font-size:12px; line-height:1.3; min-height:2.6em; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-check { position:absolute; top:8px; right:8px; width:24px; height:24px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-selection-footer {
  grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:6px;
  padding-top:8px; border-top:1px solid #e1d2de; color:#63435d; font-size:13px; line-height:1.3;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-footer-check {
  display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#8b4a72; color:#fff; font-weight:700;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-selection-help { margin-left:auto; font-size:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover>.popup-close {
  top:12px; right:12px; width:44px; height:44px; border-radius:50%; background:#fff9fc; box-shadow:none;
 }
}
@media (orientation:landscape) and (max-height:600px) and (max-width:740px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll { column-gap:6px; padding-left:12px; padding-right:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-option { padding:8px 5px; gap:4px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-name { font-size:14px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-name small { font-size:11px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-check { top:5px; right:5px; width:20px; height:20px; font-size:13px; }
}
@media (orientation:landscape) and (max-height:300px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll { row-gap:6px; padding-top:8px; padding-bottom:8px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll>strong { min-height:24px; font-size:21px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .popup-scroll>p { padding-bottom:6px; font-size:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-option { min-height:112px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-selection-footer { padding-top:6px; font-size:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover .clef-selection-help { font-size:11px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .clef-popover>.popup-close { top:6px; }
}

/* Approved key picker: Android and iPhone landscape phone idioms. */
@media (orientation:landscape) and (max-height:600px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .transport-controls .key-popover {
  position:fixed; inset:0; z-index:100; width:100vw; max-width:none;
  height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0;
  background:linear-gradient(145deg,#fffdfc,#fbf5f8); box-shadow:0 12px 48px #32132b40;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .popup-scroll {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,.95fr) 44px;
  grid-template-rows:auto minmax(0,1fr) auto; gap:14px 20px;
  height:100%; max-height:none; margin:0; overflow:auto;
  padding:max(12px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover>.popup-close {
  top:max(12px,env(safe-area-inset-top)); right:max(20px,env(safe-area-inset-right));
  width:44px; height:44px; border-radius:50%; background:#fff9fc; box-shadow:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading {
  grid-area:1 / 1; align-self:center; gap:12px; margin:0; padding:0;
  min-width:0; border:0; border-radius:0; background:none; box-shadow:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading-icon {
  width:36px; height:36px; flex-basis:36px; border:0; background:none; box-shadow:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading strong {
  font-size:23px; line-height:1.15; color:#32152f;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading div span {
  font-size:12px; line-height:1.3;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-mode-tabs {
  grid-area:1 / 2; align-self:center; margin:0; padding:3px;
  border-radius:28px; background:#f1eaf1; box-shadow:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-mode-tabs button {
  min-height:44px; padding:6px 10px; border-radius:24px; font-size:15px; white-space:nowrap;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-mode-tabs button.active {
  background:linear-gradient(120deg,#94567f,#7b3f66); color:#fff; box-shadow:inset 0 1px #ffffff40;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-list-viewport {
  grid-area:2 / 1 / 3 / -1; min-height:0; overflow:auto; padding:2px;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-list {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(52px,1fr));
  gap:10px; height:100%; min-height:176px; max-height:none; margin:0; padding:0; overflow:visible;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option {
  position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto;
  align-items:center; gap:8px; min-width:0; min-height:52px; margin:0; padding:10px 12px;
  border:1px solid #d9c5d6; border-radius:12px; background:#fffdfd; box-shadow:none;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option:hover { transform:none; background:#fcf0f7; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option.selected {
  border-color:#8b4a72; background:linear-gradient(115deg,#efd1e3,#faeaf3); box-shadow:inset 0 0 0 1px #8b4a72;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option-name {
  font-size:15px; font-weight:650; line-height:1.25; color:#32152f;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-signature {
  display:grid; place-items:center; min-width:32px; height:32px; padding:0 3px; box-sizing:border-box;
  border:0; border-radius:50%; background:#f1e8f1; color:#58364f; font-size:13px; font-weight:500;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-check { display:none; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option.selected .key-option-name::before {
  content:'✓'; display:inline-grid; place-items:center; width:20px; height:20px; margin-right:6px;
  border-radius:50%; background:#8b4a72; color:white; font-size:13px; vertical-align:middle;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-footer {
  grid-area:3 / 1 / 4 / -1; justify-content:flex-start; gap:6px; margin:0; padding:10px 0 0;
  border:0; border-top:1px solid #e1d2de; border-radius:0; background:none; box-shadow:none;
  font-size:13px; line-height:1.3;
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-selection-help {
  display:block; margin-left:auto; font-size:12px;
 }
}
@media (orientation:landscape) and (max-height:600px) and (max-width:760px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .popup-scroll {
  grid-template-columns:minmax(0,1fr) minmax(210px,1fr) 44px; gap:8px 10px;
  padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right));
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover>.popup-close { right:max(12px,env(safe-area-inset-right)); }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading { gap:6px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading-icon { display:none; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-heading strong { font-size:19px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-mode-tabs button { padding:4px 6px; font-size:14px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-list { gap:6px; min-height:144px; grid-template-rows:repeat(3,minmax(44px,1fr)); }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option { grid-template-columns:1fr; justify-items:center; align-content:center; gap:2px; min-height:44px; padding:4px; text-align:center; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option-name { font-size:14px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-signature { min-width:26px; height:20px; font-size:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-option.selected .key-option-name::before { width:16px; height:16px; margin-right:3px; font-size:11px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-footer { padding-top:6px; font-size:12px; }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .key-selection-help { font-size:11px; }
}

@media (orientation:landscape) and (max-height:300px) {
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover .popup-scroll {
  row-gap:6px; padding-top:max(8px,env(safe-area-inset-top)); padding-bottom:max(8px,env(safe-area-inset-bottom));
 }
 body .home-page.phone-layout:is(.android-layout,.iphone-layout) .key-popover>.popup-close { top:max(8px,env(safe-area-inset-top)); }
}

/* One modal frame for landscape phones. Geometry deliberately overrides the
   individual responsive popup sizes above; interiors keep their own layouts. */
dialog[data-toolbar-dialog] { margin:0; }
dialog[data-toolbar-dialog]:not([open]) { display:none; }
@media (orientation:landscape) and (max-height:600px) {
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) {
  --phone-modal-x:max(12px,env(safe-area-inset-left),env(safe-area-inset-right));
  --phone-modal-y:max(8px,env(safe-area-inset-top),env(safe-area-inset-bottom));
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-range-popover,.interval-popover,.key-popover,.clef-popover,.slider-popover,.reports-dialog:not(.reports-concept),.midi-dialog,.safari-midi-help,.choice-popup:not([hidden])) {
  position:fixed!important; inset:0!important; transform:none!important; margin:auto!important;
  width:calc(100vw - 2 * var(--phone-modal-x))!important;
  height:calc(100dvh - 2 * var(--phone-modal-y))!important;
  max-width:none!important; max-height:none!important; min-width:0; min-height:0;
  box-sizing:border-box; padding:0!important; overflow:hidden!important;
  border:1px solid #d8c1d3!important; border-radius:16px!important;
  background:linear-gradient(145deg,#fffdfc,#fbf4f8); color:#51334b;
  box-shadow:0 16px 48px #25102250!important;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) dialog::backdrop {
  background:#27152899; backdrop-filter:none;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.popup-close,.close-button,.safari-help-close) {
  width:44px; height:44px; min-width:44px; min-height:44px; flex:0 0 44px;
  border-radius:50%; background:#fff9fc; box-shadow:none;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-heading) {
  position:static; padding:10px 72px 10px 16px; min-height:64px;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-heading) .popup-close { top:12px; right:12px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-heading h2,.reports-heading h2) { font-size:23px; line-height:1.2; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-body,.safari-help-body) { flex:1; min-height:0; overscroll-behavior:contain; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-footer) { padding:6px 16px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-footer) button { min-height:44px; }

 /* Ledgers: keep the toggles beside the two staff previews, with the range
    keyboard using the full width of the other column. Small screens scroll. */
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-body {
  display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); grid-auto-rows:max-content; align-content:start; gap:10px 14px; padding:12px 16px;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-body>.ledger-popup-toggle { grid-column:2; grid-row:1; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-content { display:contents; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-range-panel { grid-column:1; grid-row:1 / 4; align-self:stretch; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel {
  grid-column:2; grid-row:2; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 10px;
 }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel>h3,
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel>p { grid-column:1 / -1; margin:0; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel .ledger-staff-preview+.ledger-staff-preview { padding:0; border:0; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel svg { height:90px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-body>.chord-expand { grid-column:2; grid-row:3; margin:0; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-popup-toggle { min-height:44px; padding:8px; gap:8px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-popup-toggle strong { font-size:14px; line-height:1.25; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-popup-toggle small { font-size:11px; line-height:1.25; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-notice { grid-column:1 / -1; grid-row:4; margin:0; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-keyboard { height:90px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .range-heading { display:flex; flex-wrap:wrap; gap:4px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .range-caption { margin-top:6px; font-size:11px; line-height:1.3; }

 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .reports-dialog:not(.reports-concept) .reports-content { height:100%; max-height:none; margin:0; box-sizing:border-box; overflow:auto; padding:12px 16px; overscroll-behavior:contain; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .reports-dialog:not(.reports-concept) .reports-heading { position:static; padding-right:54px; min-height:48px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .reports-dialog:not(.reports-concept) .reports-heading .close-button { position:absolute; top:12px; right:12px; z-index:2; }

 /* Instrument choices remain a combobox list inside the MIDI modal. */
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-popup:not([hidden]) { display:flex; flex-direction:column; z-index:120; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-popup-heading { flex:0 0 auto; min-height:56px; padding:16px 72px 12px 16px; box-sizing:border-box; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-popup .popup-close { top:8px; right:12px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-list-viewport { flex:1; min-height:0; overflow:hidden; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; height:100%; max-height:none!important; margin:0; padding:8px 12px; box-sizing:border-box; overflow:auto; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-group { grid-column:1 / -1; }
}
@media (orientation:landscape) and (max-height:300px) {
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) :is(.ledger-heading) { min-height:54px; padding-top:6px; padding-bottom:6px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-preview-panel svg { height:68px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .ledger-keyboard { height:64px; }
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .choice-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Chord Types owns its interior padding inside the shared safe-area frame. */
@media (orientation:landscape) and (max-height:600px) {
 body:has(.home-page.phone-layout:is(.iphone-layout,.android-layout)) .transport-controls .interval-popover { padding:10px 12px!important; }
}

/* Shared visual finish for the approved dialog family. Layout and safe-area
   geometry stay with each component; this layer owns their common appearance.
   Important declarations intentionally supersede older OS-specific skins. */
.dialog-family {
 --dialog-ink:#50203f; --dialog-muted:#805b73; --dialog-accent:#85436b;
 --dialog-line:#e3cddd; --dialog-surface:#fffafd; --dialog-card:#fff9fc;
 --dialog-selected:#f3e6ef; --dialog-title:28px; --dialog-help:14px;
 --dialog-label:16px; --dialog-section:19px; --dialog-caption:12px;
 --dialog-close-inset:14px;
 --popup-text-size:var(--dialog-label); --popup-help-size:var(--dialog-help);
 --dialog-action:14px; --dialog-action-height:44px;
 --accent:var(--dialog-accent); --ink:var(--dialog-ink); --muted:var(--dialog-muted); --line:var(--dialog-line);
 background:var(--dialog-surface)!important; color:#51334b!important;
 border:1px solid #d7bacf!important; border-radius:16px!important;
 font-family:'Helvetica Neue',Helvetica,Arial,sans-serif!important; font-size:var(--dialog-label); line-height:1.35; text-shadow:none!important;
 color-scheme:light;
}
.dialog-family::backdrop { background:#27152899!important; backdrop-filter:blur(3px); }
.dialog-family :is(button,input,select) { font-family:inherit!important; }
.dialog-family :is(.ledger-heading h2,.picker-heading strong,.key-heading strong,.popup-scroll>strong,.game-setup-heading h2,.settings-heading h2,.reports-heading h2,.dialog-header h2,.midi-event-dialog header h2,.safari-midi-help header h2,.choice-popup-heading) {
 color:var(--dialog-ink)!important; font-size:var(--dialog-title)!important;
 font-weight:700!important; line-height:1.15!important; letter-spacing:-.02em!important;
}
.dialog-family :is(.ledger-heading p,.chord-subtitle,.key-heading div span,.clef-popover .popup-scroll>p,.game-setup-heading p,.settings-heading p,.reports-title p,.dialog-header p,.midi-event-dialog header p) {
 color:var(--dialog-muted)!important; font-size:var(--dialog-help)!important; line-height:1.3!important;
}
.dialog-family :is(.exercise-column-heading p,.exercise-option small:not(.range-warning),.selection-summary,.range-caption,.range-heading>span,.ledger-preview-panel p,.settings-option small,.card-note,.clue-scale,.clue-duration-setting p,.settings-footer>span,.reports-help,.rating-guide,.monitor-empty) { color:var(--dialog-muted)!important; }
.dialog-family :is(.ledger-heading,.key-heading,.safari-midi-help>header) { background:var(--dialog-surface)!important; box-shadow:none!important; }
.dialog-family :is(h3,.card-heading h3) { color:var(--dialog-ink)!important; font-size:var(--dialog-section)!important; font-weight:700!important; line-height:1.2!important; }
.dialog-family :is(.popup-close,.close-button,.safari-help-close) {
 box-sizing:border-box!important; width:44px!important; height:44px!important;
 min-width:44px!important; min-height:44px!important; flex-basis:44px!important;
 padding:0!important; border:1px solid #dfc9d9!important; border-radius:50%!important;
 background:#fffbfe!important; color:#673452!important; box-shadow:none!important;
}
.dialog-family :is(.popup-close,.close-button,.safari-help-close) svg { display:block!important; width:22px!important; height:22px!important; fill:none!important; stroke:currentColor!important; stroke-width:1.8!important; stroke-linecap:round!important; stroke-linejoin:round!important; }
.dialog-family :is(.popup-close,.close-button,.safari-help-close):hover { background:#f3e6ef!important; }
.dialog-family :is(button,input,select,a,[tabindex]):focus-visible { outline:2px solid #974e79; outline-offset:3px; }
.dialog-family :is(.ledger-footer button,.chord-footer button,.game-setup-footer button,.settings-done,.reports-actions .primary-button,.midi-event-dialog footer button,.safari-midi-help footer button,.sample-button) {
 min-height:var(--dialog-action-height)!important; min-width:104px; padding:8px 18px;
 border:1px solid var(--dialog-accent)!important; border-radius:8px!important;
 background:var(--dialog-accent)!important; color:#fff!important; box-shadow:none!important;
 font-size:var(--dialog-action)!important; font-weight:500!important; line-height:1.2!important;
}
.dialog-family :is(.quiet-button,.find-button,.panic-button,.event-log-button,.safari-midi-note>button) {
 min-height:var(--dialog-action-height)!important; font-size:var(--dialog-action)!important;
 border-color:#ba8da9!important; border-radius:8px!important; background:#fffbfe!important;
 color:#673452!important; box-shadow:none!important; font-weight:500!important;
}
.dialog-family :is(.quiet-button,.find-button,.panic-button,.event-log-button,.safari-midi-note>button):hover:enabled { background:#f3e6ef!important; }
.dialog-family :is(.ledger-footer button,.chord-footer button,.game-setup-footer button,.settings-done,.reports-actions .primary-button,.midi-event-dialog footer button,.safari-midi-help footer button,.sample-button):hover:enabled { background:#73385d!important; }
.dialog-family :is(.settings-card,.exercise-column,.sound-panel,.input-panel,.ledger-range-panel,.ledger-preview-panel,.add-player) {
 border-color:var(--dialog-line)!important; background:var(--dialog-card)!important;
}
.dialog-family :is(.key-option,.clef-option,.exercise-option,.player-row,.choice-list button) { box-shadow:none!important; }
.dialog-family :is(.key-option.selected,.clef-option.selected,.exercise-option:has(input:checked),.player-row.selected,.choice-list button[aria-selected=true]) {
 border-color:#d6b2c9!important; background:var(--dialog-selected)!important; color:var(--dialog-ink)!important;
}
.dialog-family :is(.key-mode-tabs,.reports-tabs) { border:1px solid var(--dialog-line)!important; border-radius:9px!important; background:#fbf5f9!important; box-shadow:none!important; }
.dialog-family :is(.key-mode-tabs button,.reports-tabs button) { border-radius:8px!important; }
.dialog-family :is(.key-mode-tabs button.active,.reports-tabs button.active) { background:#e9d6e3!important; color:#54203f!important; box-shadow:none!important; }
.dialog-family :is(.key-check,.clef-check) { box-sizing:border-box; border:2px solid #a87997; background:transparent!important; color:transparent!important; box-shadow:none!important; }
.dialog-family :is(.key-option.selected .key-check,.clef-option.selected .clef-check) { border-color:#77345d; background:radial-gradient(circle,#77345d 0 42%,transparent 46%)!important; }
.dialog-family .key-option.selected .key-option-name::before { content:''!important; box-sizing:border-box; border:2px solid #77345d; background:radial-gradient(circle,#77345d 0 42%,transparent 46%)!important; }
.dialog-family .ledger-popup-toggle input[type=checkbox] {
 appearance:none; -webkit-appearance:none; order:2; position:relative; display:block;
 box-sizing:border-box; flex:0 0 44px; width:44px; height:26px; margin:0 0 0 auto;
 border:0; border-radius:999px; background:#b9b2bc; cursor:pointer;
}
.dialog-family .ledger-popup-toggle input[type=checkbox]::before { content:''; position:absolute; top:2px; left:2px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px #39223d26; }
.dialog-family .ledger-popup-toggle input[type=checkbox]:checked { background:var(--dialog-accent); }
.dialog-family .ledger-popup-toggle input[type=checkbox]:checked::before { transform:translateX(18px); }
.dialog-family .ledger-popup-toggle span { flex:1; min-width:0; }
.dialog-family .ledger-popup-toggle input:disabled { opacity:.5; cursor:default; }
.dialog-family .thru-switch { background:#b9b2bc; }
.dialog-family .midi-thru-option input:checked+.thru-switch { background:var(--dialog-accent); }
.dialog-family :is(.exercise-option,.all-option) input[type=checkbox] {
 appearance:none; -webkit-appearance:none; box-sizing:border-box; display:grid; place-content:center;
 border:1.5px solid #a87997; border-radius:6px; background:#fffbfe;
}
.dialog-family :is(.exercise-option,.all-option) input[type=checkbox]::before { content:''; width:10px; height:6px; border-left:2px solid white; border-bottom:2px solid white; transform:translateY(-1px) rotate(-45deg) scale(0); }
.dialog-family :is(.exercise-option,.all-option) input[type=checkbox]:checked { background:var(--dialog-accent); border-color:var(--dialog-accent); }
.dialog-family :is(.exercise-option,.all-option) input[type=checkbox]:checked::before { transform:translateY(-1px) rotate(-45deg); }
.dialog-family .all-option input[aria-checked=mixed] { background:var(--dialog-accent); border-color:var(--dialog-accent); }
.dialog-family .all-option input[aria-checked=mixed]::before { height:2px; border:0; background:white; transform:none; }
.dialog-family :is(.ledger-footer,.chord-footer,.settings-footer,.game-setup-footer,.players-actions,.logs-actions,.dialog-footer,.safari-midi-help>footer,.midi-event-dialog>footer) { border-top-color:#e7d9e3!important; }
@media(max-width:700px) { .dialog-family { --dialog-title:24px; } }
@media(orientation:landscape) and (max-height:600px) {
 .dialog-family { --dialog-title:22px; --dialog-help:11px; --dialog-label:14px; --dialog-section:16px; --dialog-caption:11px; --dialog-action:12px; --dialog-action-height:36px; --dialog-close-inset:8px; }
 /* The outer frame already avoids the notch; do not apply safe insets twice. */
 .dialog-family.key-popover .popup-scroll { padding-left:20px!important; padding-right:20px!important; }
 .dialog-family :is(.ledger-footer button,.chord-footer button,.game-setup-footer button,.settings-done,.reports-actions .primary-button,.midi-event-dialog footer button,.safari-midi-help footer button,.sample-button) { padding:6px 16px; }
}
@media(orientation:landscape) and (min-height:361px) and (max-height:600px) {
 body:has(.home-page.phone-layout) .ledger-body { row-gap:6px; }
 .dialog-family .ledger-preview-panel { padding:6px!important; }
 .dialog-family .ledger-preview-panel svg { height:54px!important; }
 /* The two named staff previews convey this caption visually. Keep it in the
    accessibility tree while reserving room for both switches on safe-area phones. */
 .dialog-family .ledger-preview-panel>p { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
}

/* Every close belongs to its own frame, outside header and body scrolling. */
.dialog-family:is(dialog,.choice-popup)>:is(.popup-close,.close-button,.safari-help-close) {
 position:absolute!important; top:var(--dialog-close-inset)!important; right:var(--dialog-close-inset)!important;
 bottom:auto!important; left:auto!important; z-index:10; display:grid!important; place-items:center!important;
 margin:0!important; transform:none!important; line-height:0!important; cursor:pointer; touch-action:manipulation;
}
.dialog-family :is(.settings-option strong,.exercise-name,.clef-name,.player-choice,.key-option-name,.setup-row label,.ledger-popup-toggle strong,.device-name) {
 font-size:var(--dialog-label)!important; font-weight:600!important; color:var(--dialog-ink);
}
.dialog-family :is(.settings-option small,.exercise-column-heading p,.clef-name small,.ledger-popup-toggle small,.add-player-heading p,.card-note) {
 font-size:var(--dialog-help)!important; line-height:1.3!important; color:var(--dialog-muted)!important;
}
.dialog-family :is(.selection-summary,.exercise-details small,.settings-footer>span,.players-actions p,.reports-help,.help-eyebrow,.eyebrow) {
 font-size:var(--dialog-caption)!important; color:var(--dialog-muted)!important;
}
.dialog-family :is(.ledger-heading,.settings-heading,.reports-heading,.game-setup-heading,.midi-event-dialog>header,.safari-midi-help>header) { padding-right:76px; }
.dialog-family.reports-dialog.summary-view .reports-heading { padding-right:52px; }
.dialog-family.midi-event-dialog>header,.dialog-family.safari-midi-help>header { padding-right:76px!important; }
.dialog-family .monitor-history table { font-family:inherit; font-size:var(--dialog-caption); }
@media(orientation:landscape) and (max-height:600px) {
 .dialog-family :is(.settings-heading,.reports-heading,.game-setup-heading,.midi-event-dialog>header,.safari-midi-help>header) { padding-right:64px; }
 .dialog-family.midi-event-dialog>header,.dialog-family.safari-midi-help>header { padding-right:64px!important; }
}

/* iPhone landscape only: match Help to the compact transport icons/captions. */
@media (orientation:landscape) and (max-height:600px) {
 .home-page.phone-layout.iphone-layout .score-display strong {
  min-width:18px; padding:0; border:0; border-radius:0; background:none; box-shadow:none;
  color:var(--score-rose); font-weight:500; text-shadow:none; text-align:left;
 }
 .home-page.phone-layout.iphone-layout .score-display strong[data-score=hits] { color:var(--score-hit); }
 /* Short dividers between the player, each score field and the camera. */
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div+div { position:relative; padding-left:12px; border-left:0; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div+div::before { content:""; position:absolute; left:0; top:50%; width:1px; height:14px; transform:translateY(-50%); background:#c58bad80; pointer-events:none; }
 /* Restore the approved compact Settings scale on iPhone; keep 44px input
    rows, both full range controls, and scrolling on smaller phone screens. */
 .home-page.phone-layout.iphone-layout .settings-popover {
  --dialog-title:21px; --dialog-section:14px; --dialog-label:12px;
  --dialog-help:10.5px; --dialog-caption:10.5px;
 }
 .home-page.phone-layout.iphone-layout .settings-heading { min-height:52px; padding:6px 64px 6px 16px; }
 .home-page.phone-layout.iphone-layout .settings-body { padding:4px 10px; gap:6px; }
 .home-page.phone-layout.iphone-layout .settings-card { padding:6px 10px; }
 .home-page.phone-layout.iphone-layout .card-heading { min-height:24px; margin-bottom:4px; }
 .home-page.phone-layout.iphone-layout .dependent-settings { margin-top:6px; padding-left:12px; }
 .home-page.phone-layout.iphone-layout .card-note { padding:6px 8px; }
 .home-page.phone-layout.iphone-layout .settings-footer { min-height:44px; padding:3px 8px; }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:700px) {
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div+div { padding-left:6px; }
}

/* Landscape phones only: uniform auxiliary toolbar buttons and inline meters. */
@media (orientation:landscape) and (max-height:600px) {
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.phone-help,.phone-about-button) {
  display:grid; grid-template-rows:24px 12px; align-content:center; justify-items:center; gap:0;
  flex:0 0 44px; width:44px; min-width:44px; height:40px; padding:0; box-sizing:border-box;
  border:1px solid transparent; border-radius:4px; background:transparent; color:#343945;
  font-size:10px; font-weight:650; line-height:12px; text-shadow:0 1px #fff;
 }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.phone-help,.phone-about-button) svg {
  width:var(--android-tool-size,21px); height:var(--android-tool-size,21px); align-self:center; padding:3px; box-sizing:border-box; border:1px solid #cbb1c2;
  border-radius:50%; background:linear-gradient(#fff,#f2e9ef); color:#85436b;
 }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.phone-help,.phone-about-button) svg circle { display:none; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.phone-help,.phone-about-button)>span { display:block; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status {
  --status-font:11px; --status-number:10px; --status-icon:14px; --status-gap:5px; --group-padding:10px; --rail-height:6px;
  height:32px; grid-template-columns:.75fr .75fr 1.25fr 1.25fr; grid-template-rows:1fr; padding:0; gap:0;
 }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status .status-group { height:100%; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status :is(.midi-content,.bottom-meter) { display:flex; flex-wrap:nowrap; align-items:center; gap:var(--status-gap); min-width:0; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status .progress-caption { display:flex; flex:0 0 auto; align-items:center; gap:var(--status-gap); }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status :is(.status-label,b,output,.activity-dot,.status-chevron) { flex:0 0 auto; margin:0; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status :is(.midi-level,progress) { flex:1 1 10px; min-width:8px; height:6px; grid-area:auto; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status :is(b,output) { font-size:var(--status-number); min-width:0; padding:0; text-shadow:none; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status .status-group+.status-group::before { height:18px; }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:700px) {
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status { --status-font:10px; --status-number:9px; --status-gap:4px; --group-padding:7px; }
}

/* One flat feedback treatment for landscape phone toolbar actions. */
@media (orientation:landscape) and (max-height:600px) {
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .game-dashboard { background:linear-gradient(180deg,#fffafd,#f6edf5) 0 0 / 100% 44px no-repeat; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display { flex-basis:28px; height:28px; padding-block:0; align-items:center; box-shadow:inset 0 -1px #bd72a34d; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .game-dashboard { border-bottom:1px solid #42132f; box-shadow:0 1px 2px #160b2140; position:relative; z-index:2; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div { height:100%; align-items:center; padding-block:0; margin-block:0; box-sizing:border-box; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div>* { position:relative; top:1px; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display>div>:is(span,strong) { display:flex; align-items:center; height:100%; margin-block:0; line-height:1; box-sizing:border-box; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display .players-open-button { height:100%; min-height:0; align-items:center; padding-block:0; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display .selected-player-name { display:flex; align-items:center; line-height:1; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .score-display .player-chevron { align-self:center; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls { --phone-pressed:#eadde7; background:linear-gradient(180deg,#fffafd,#f6edf5); border-bottom-color:#d9bed1; box-shadow:inset 0 1px #fff; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.game-toggle,.stop-game,.game-reset,.reports-open-button,.midi-open-button,.phone-about-button,.phone-help,.ledger-toolbar-button,.interval-picker>summary,.key-picker>summary,.clef-picker>summary,.general-settings-picker>summary,.toolbar-slider-picker>summary) {
  background:transparent!important; border-color:transparent!important; border-radius:6px!important; box-shadow:none!important;
  -webkit-tap-highlight-color:transparent;
 }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(.game-toggle,.stop-game,.game-reset,.reports-open-button,.midi-open-button,.phone-about-button,.phone-help,.ledger-toolbar-button,.interval-picker>summary,.key-picker>summary,.clef-picker>summary,.general-settings-picker>summary,.toolbar-slider-picker>summary):is(:active:not(:disabled),[aria-pressed="true"],[aria-expanded="true"]),
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls details[open]>summary { background:var(--phone-pressed)!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(button,summary):not(:focus-visible) { outline:none!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) :is(.transport-controls,.score-display) :is(button,summary):focus-visible { outline:none!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout)[data-keyboard-navigation="true"] :is(.transport-controls,.score-display) :is(button,summary):focus-visible { outline:1px solid #b58ba7!important; outline-offset:-3px!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(button,summary):active:not(:disabled),
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls details[name="toolbar-popup"][open]>summary { outline:1px solid #b58ba7!important; outline-offset:-3px!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls :is(button,summary):active :is(svg,.key-icon,.clef-symbol),
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls .game-toggle:active::before { box-shadow:none!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .transport-controls .stop-game:active svg { background:linear-gradient(#fff,#f2e9ef)!important; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .direction-choices { border-color:transparent; background:transparent; box-shadow:none; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .direction-choice input:checked+.direction-control,
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .direction-choice:active .direction-control { border-color:transparent; background:var(--phone-pressed); color:#85436b; box-shadow:none; }
 .home-page.phone-layout:is(.iphone-layout,.android-layout) .workspace-status .bottom-meter .status-label { font-size:9px; }
}
