/* Keep the library next to the bar; only the vocabulary list scrolls. */
main{height:100dvh;display:flex;flex-direction:column;max-height:100dvh}header,.settings{flex-shrink:0}header{gap:12px}header .tag{flex:1}header #notation{margin-left:auto;min-height:36px;font-size:14px;max-width:110px}header #help-open{margin-left:0}.workspace{display:flex;flex-direction:column;min-height:0;flex:1;padding-block:10px;overflow:visible}.section-head,.group-key,.bar-footer,.playback,#message{flex-shrink:0}.scroll{max-height:min(24dvh,180px);flex:0 1 auto;min-height:74px}#bar{min-height:44px}.palette{display:flex;flex-direction:column;flex-wrap:nowrap;gap:0;min-height:120px;flex:1;max-height:310px;margin-top:8px;padding-top:8px;overflow:hidden}.library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;padding-bottom:5px;flex-shrink:0}.library-heading span{font-size:12px;color:var(--muted)}#group-rows{overflow-y:auto;overscroll-behavior:contain;min-height:60px;flex:1;scrollbar-gutter:stable;border:1px solid #b5a185;border-radius:7px;background:#f5eddb}.group-row+.group-row{border-top:1px solid #c6b99f}.group-row-head{display:flex;align-items:center;gap:8px;padding:3px 8px;background:#eee4ce}.row-toggle{display:flex;align-items:center;gap:7px;min-height:38px;padding:4px 8px;border:0;box-shadow:none;background:none!important;font-size:14px;flex:1;text-align:left}.row-toggle b{display:inline-grid;place-items:center;background:#31564d;color:#fffbed;border-radius:4px;min-width:26px;height:26px;font-size:16px}.chevron{width:10px}.row-filters{display:flex;gap:3px}.row-filters button{min-height:34px;padding:4px 9px;font-size:13px;background:#fff6e4}.row-filters button[aria-pressed=true]{background:#31564d;color:#fffbed;border-color:#31564d}.group-options{display:flex;flex-wrap:wrap;gap:7px;padding:8px}.group-options[hidden]{display:none}.group-options .tile{min-height:44px;padding:4px 10px;flex:none}.group-options .tile-notes{gap:7px;min-height:30px}.group-options .tile-note{font-size:16px}.group-options .tile-note.first-note{padding:2px 5px}.spare-row{display:flex;align-items:center;gap:10px;flex-shrink:0;padding-top:7px}.spare-row h2{margin:0;white-space:nowrap;font-size:13px}.spare-row .tiles{display:flex;gap:7px;flex:none}.spare-row .tile{min-width:44px;min-height:40px;padding:3px 10px}.spare-row .tile-notes{min-height:28px}.library-note{font-size:12px;color:var(--muted);margin-left:auto}.flam-note{display:inline-flex;align-items:baseline;gap:2px}.flam-note small{display:inline!important;font-size:.65em;position:relative;top:-.3em;font-weight:400}.slot .flam-note{font-size:17px}.playback{display:flex;flex-wrap:nowrap;gap:18px;padding-top:7px;position:relative}.playback .tempo-label{flex:1;max-width:320px;min-width:100px}.sound-settings{margin-left:auto;position:relative}.sound-settings summary{cursor:pointer;list-style:none;border:1px solid #9d8a69;border-radius:7px;background:linear-gradient(#fff9ed,#f0e5cf);min-height:42px;display:flex;align-items:center;padding:7px 12px;font-size:14px;box-shadow:0 2px 2px #48351b29}.sound-settings summary::after{content:'▴';margin-left:9px}.sound-settings[open] summary::after{content:'▾'}.sound-panel{position:absolute;bottom:calc(100% + 8px);right:0;z-index:10;width:225px;background:#fffbed;padding:14px;border:1px solid #9d8a69;border-radius:8px;box-shadow:0 5px 20px #293c3844;display:grid;gap:12px}.sound-panel .pulse-label{grid-area:auto!important}.sound-panel select{width:100%}#audio-hint{display:none}#message{margin:5px 0;font-size:13px;line-height:18px;min-height:18px;max-height:36px;overflow:auto}
@media(max-width:760px){.palette{display:flex}.library-heading{display:flex}.spare-row{display:flex}.palette>div{display:flex}.palette #group-rows{display:block}.palette h2{width:auto}.row-toggle{min-height:40px}.group-options .tile{padding-inline:8px}.group-options .tile-note{font-size:15px}.playback{gap:12px}}
@media(max-width:560px){main{padding:6px 8px}.brand{font-size:20px}header{gap:7px;padding-inline:7px}header #notation{font-size:12px;max-width:94px;padding-inline:7px 23px}header #help-open{font-size:13px;padding:5px 8px}.settings{padding:6px 8px}.workspace{padding:8px;overflow:visible}.scroll{max-height:140px;min-height:72px}.section-head h2{font-size:14px}.group-key{font-size:12px;margin:4px 0}.library-heading{font-size:13px;padding-bottom:4px}.library-heading span{font-size:11px}.palette{min-height:130px;max-height:none;margin-top:5px;padding-top:5px}.group-row-head{padding:2px 4px}.row-filters button{min-height:40px;padding:4px 8px;font-size:12px}.row-toggle{padding-inline:4px;gap:5px}.group-options{gap:6px;padding:6px}.group-options .tile{min-height:44px;padding:4px 8px}.group-options .tile-notes{gap:5px}.spare-row{padding-top:5px;gap:8px}.spare-row .tile{min-width:42px;min-height:40px}.spare-row h2{font-size:12px;width:auto!important}.library-note{display:none}.playback{display:flex;padding-top:5px;gap:10px}.playback #play{min-width:94px;font-size:14px}.playback .tempo-label{min-width:80px;font-size:12px}.sound-settings summary{min-height:42px;font-size:13px;padding:6px 8px}.sound-settings summary:after{margin-left:4px}.sound-panel label{font-size:14px}.sound-panel select{font-size:14px}#message{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-height:18px;min-height:18px;font-size:12px}}
.length-jumps{display:flex;gap:4px}.length-jumps button{font-size:13px;min-width:34px;min-height:32px;padding:3px 7px;font-weight:700}.library-heading{padding-bottom:5px}.length-jumps button:focus-visible{outline-offset:0}
@media(max-width:560px){.length-jumps{gap:3px}.length-jumps button{min-width:32px;min-height:36px;padding:3px 6px}.library-heading{font-size:12px;gap:6px}.palette{min-height:150px}}
.bar-tools{display:flex;align-items:center;gap:12px;margin:5px 0;flex-shrink:0}.edit-modes{display:flex;gap:4px}.edit-modes button{min-height:36px;padding:5px 12px;font-size:14px}.edit-modes button[aria-pressed=true]{background:linear-gradient(#476f62,#214b40);color:#fffbed;border-color:#31564d}.edit-modes button[data-mode=flam][aria-pressed=true]{background:linear-gradient(#be6634,#a74721);border-color:#88401b}#mode-hint{font-size:13px;color:var(--muted)}.workspace[data-mode=flam] .scroll{background:#fae8d255;border-radius:6px}.slot.flam-target{outline:2px dashed #b65327;outline-offset:1px;cursor:pointer}.slot.flam-unavailable{opacity:.5;cursor:not-allowed}.slot.flam-target:hover{box-shadow:0 0 0 3px #f1802e88}.slot:focus-visible{outline:3px solid #293c38;outline-offset:1px}.core-row{display:flex;align-items:center;gap:8px;padding:5px 8px}.core-row h3{display:flex;align-items:center;gap:7px;min-width:68px;margin:0;font-size:12px;font-weight:400;color:var(--muted)}.core-row h3 b{display:grid;place-items:center;background:#31564d;color:#fffbed;border-radius:4px;min-width:28px;height:28px;font-size:16px}.core-row .group-options{padding:0;flex:1}.core-row .tile{min-height:44px}.palette{min-height:110px}.flam-note small{font-size:.62em!important}.slot .flam-note small{font-size:.65em!important}
@media(max-width:560px){.bar-tools{gap:8px;margin:4px 0}.edit-modes button{min-height:38px;padding:5px 9px;font-size:13px}#mode-hint{font-size:12px;line-height:1.2}.core-row{padding:6px;gap:6px}.core-row h3{min-width:30px}.core-row h3 span{display:none}.core-row .group-options{gap:5px}.core-row .tile{padding-inline:6px}.palette{min-height:120px}}

.library-heading #lead{font-size:14px;min-height:40px;margin-left:auto;max-width:125px}.length-jumps{display:none}@media(max-width:560px){.library-heading #lead{font-size:14px;min-height:40px}.library-heading{font-size:14px}}

/* Group colour and accent marks communicate different things. */
.slot.filled.group-note{background:color-mix(in srgb,var(--group-color) 14%,#fffbed);border:1px solid var(--group-color);border-bottom:5px solid var(--group-color);color:#293c38;box-shadow:inset 0 1px 1px #fff}
.slot.group-note.group-start{border-left:4px solid var(--group-color)}.slot.group-note.group-end{border-right:4px solid var(--group-color)}.slot.group-start:after{content:none}
.slot.accent-note{color:#9d3b16!important;font-weight:800}.slot.accent-note:after{content:'>';position:absolute;right:3px;top:0;left:auto;width:auto;height:auto;background:none;font-size:14px;line-height:14px;color:#a74721}
.tile-note.first-note{background:none;color:#9d3b16;border-top:0;position:relative;padding-top:7px!important}.tile-note.first-note:after{content:'>';position:absolute;top:-4px;right:0;font-size:12px;color:#a74721}
@media(max-width:560px){.bar-tools{flex-wrap:wrap;gap:4px}.bar-tools #mode-hint{font-size:12px}.edit-modes button{min-height:36px}}

/* Seven core families; variants expand directly beneath their parent. */
#group-rows{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));align-content:start;align-items:start;gap:8px;padding:8px;border:0;background:none;scrollbar-gutter:stable}
.family-card{border:1px solid #b5a185;border-radius:7px;background:#f5eddb;padding:7px;min-width:0}.family-core{display:flex;align-items:center;gap:7px}.family-size{display:grid;place-items:center;flex:0 0 26px;height:28px;border-radius:4px;background:#31564d;color:#fffbed;font-size:15px;font-weight:700}.family-core .tile{flex:1;justify-content:flex-start;min-height:44px;padding:4px 7px}.family-card .tile-notes{gap:5px;min-height:32px}.family-card .tile-note{font-size:16px}.variation-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:38px;margin-top:5px;padding:4px 7px;font-size:14px;border:0;box-shadow:none;background:none;color:#31564d;text-align:left}.variation-toggle:after{content:'+';font-size:20px;font-weight:700}.variation-toggle[aria-expanded=true]:after{content:'−'}.no-variations{display:block;min-height:38px;padding:10px 7px 0;color:var(--muted);font-size:13px}.family-variations{display:flex;flex-wrap:wrap;gap:7px;border-top:1px solid #c6b99f;margin-top:4px;padding-top:8px}.family-variations[hidden]{display:none}.family-variations .tile{min-height:48px;padding:4px 7px;width:100%;justify-content:flex-start}.palette{max-height:none}.bar-tools{margin-block:3px}#mode-hint{font-size:13px}
@media(max-width:560px){#group-rows{grid-template-columns:1fr;padding:4px;gap:6px}.family-card{padding:6px}.family-core .tile{min-height:44px}.variation-toggle{min-height:44px}.family-card .tile-note{font-size:16px}.family-card .tile-notes{gap:7px}}
@media(min-width:761px){#group-rows{grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:6px;padding:4px}.family-card{padding:5px}.variation-toggle{min-height:28px;margin-top:2px;padding-block:0}.no-variations{min-height:28px;padding-block:6px 0}.family-variations{max-height:160px;overflow-y:auto;overscroll-behavior:contain}}

/* Compact single-symbol cymbal/bass glyphs, with no accent notation. */
.cymbal-glyph{display:inline-block;width:16px;height:28px;vertical-align:middle;flex-shrink:0;overflow:visible}.tile-notes .cymbal-glyph{width:14px;height:25px}.variation-label{display:flex;align-items:center;gap:7px}.variation-label .cymbal-glyph{width:12px;height:22px}.slot.accent-note:after,.tile-note.first-note:after{content:none}.slot.accent-note,.tile-note.first-note{color:inherit!important}.tile-note.first-note{padding:0!important;border:0;background:none}

/* One flat library, organised only by note count. */
#group-rows{display:block!important;padding:0;border:1px solid #b5a185;border-radius:7px;background:#f5eddb}.length-row{display:flex;align-items:flex-start;gap:12px;padding:8px}.length-row+.length-row{border-top:1px solid #c6b99f}.length-row h3{display:flex;align-items:center;gap:6px;flex:0 0 68px;margin:7px 0 0;font-size:13px;font-weight:400;color:var(--muted)}.length-row h3 b{display:grid;place-items:center;min-width:28px;height:28px;background:#31564d;color:#fffbed;border-radius:4px;font-size:16px}.length-tiles{display:flex;flex-wrap:wrap;gap:7px;min-width:0}.length-tiles .tile{min-height:44px;padding:5px 10px}.length-tiles .tile-notes{min-height:30px;gap:7px}.length-tiles .tile-note{font-size:16px}
@media(max-width:560px){.length-row{gap:7px;padding:7px}.length-row h3{flex-basis:28px}.length-row h3 span{display:none}.length-tiles{gap:6px}.length-tiles .tile{padding:5px 8px}.length-tiles .tile-notes{gap:6px}}

/* A group reads as one connected block; only its outer edges are rounded. */
#bar{column-gap:0;row-gap:25px}.slot{margin-inline:3px}.slot.group-note{margin:0;border-radius:0;border-left:0!important;border-right:0!important;box-shadow:none!important;border-top:2px solid var(--group-color);border-bottom:4px solid var(--group-color);background:color-mix(in srgb,var(--group-color) 20%,#fffbed)}
.slot.group-note.block-left{margin-left:3px;border-left:2px solid var(--group-color)!important;border-top-left-radius:8px;border-bottom-left-radius:8px}.slot.group-note.block-right{margin-right:3px;border-right:2px solid var(--group-color)!important;border-top-right-radius:8px;border-bottom-right-radius:8px}.slot.group-note.beat-start:before{font-weight:750}.slot.playing{outline:0;background:#f4ca88!important;box-shadow:inset 0 0 0 2px #a64c20!important;z-index:1}.slot.playing.empty{background:#ede3cf!important}.drag-ghost{background:#fffbed;border:2px solid #31564d;opacity:.88;box-shadow:0 5px 15px #293c3833}.preview-note{position:absolute;inset:-2px -1px -4px;display:flex;align-items:center;justify-content:center;background:#d8eedf;border-top:3px solid #28704e;border-bottom:3px solid #28704e;color:#17462f;pointer-events:none;z-index:4}.drop-preview.preview-first .preview-note{border-left:3px solid #28704e;border-radius:7px 0 0 7px}.drop-preview.preview-last .preview-note{border-right:3px solid #28704e;border-radius:0 7px 7px 0}.drop-preview.preview-first.preview-last .preview-note{border-radius:7px}.drop-invalid .preview-note{background:#f6d8d0;border-color:#a53c2a!important;color:#7d281c}.slot.drop-preview{outline:0}.scroll{padding-inline:3px}.slot.group-note{transition:background-color .08s ease}@media(prefers-reduced-motion:reduce){.slot.group-note{transition:none}}
/* On a desktop, the complete vocabulary fits beside its longest row. */
@media(min-width:1100px){
.settings{padding-block:6px;margin-block:7px}.section-head{margin-bottom:0}.workspace{padding-block:7px}.bar-tools{margin-block:0}.library-heading{padding-bottom:3px}.palette{margin-top:4px;padding-top:4px}
#group-rows{display:grid!important;grid-template-columns:1fr 1fr;grid-template-rows:repeat(4,minmax(52px,1fr));gap:0;min-height:224px;overflow:hidden;scrollbar-gutter:auto}
.length-row{padding:5px 7px;gap:8px;align-items:center}.length-row:nth-child(-n+4){grid-column:1}.length-row:nth-child(5){grid-column:2;grid-row:1;border-top:0;border-left:1px solid #c6b99f;align-items:flex-start;padding-top:8px}.length-row h3{flex-basis:28px;margin:0}.length-row h3 span{display:none}.length-tiles{gap:5px}.length-tiles .tile{padding:4px 7px}.length-tiles .tile-notes{gap:5px}.length-row:last-child .length-tiles{align-content:flex-start}.length-row:nth-child(6){grid-column:2;grid-row:2 / span 3;border-left:1px solid #c6b99f;align-items:flex-start;padding-top:8px}.length-row:last-child .tile{min-width:140px}.length-row:last-child .tile-notes{gap:4px}
}
@media(min-width:1100px){header{margin-bottom:6px}.settings{margin:0}.workspace{margin-top:6px}.palette{flex-shrink:0}.spare-row{padding-top:5px}}
@media(min-width:1100px){.scroll{max-height:74px;min-height:74px;flex-shrink:0}}

/* Wide, shorter browser windows still show the complete library. */
@media(min-width:1100px) and (max-height:850px){
main{display:grid;grid-template-columns:minmax(380px,.85fr) minmax(580px,1.15fr);grid-template-rows:auto minmax(0,1fr);gap:7px;padding:7px 12px}
header{margin:0;min-width:0;gap:9px}header .tag{display:none}header .brand{font-size:22px}header #notation{margin-left:auto}
.settings{margin:0;padding:2px 10px;gap:10px;min-width:0}.settings .total{display:none}.settings label{display:flex;align-items:center;gap:8px}.settings .multiply{padding:0}.settings select{min-height:40px;padding-block:5px}.settings label:nth-of-type(2){flex:1}.settings #division{width:100%}
.workspace{grid-column:1 / -1;margin:0;padding:5px 10px}.bar-tools{display:none}.section-head .actions button{min-height:36px;padding-block:4px}.section-head h2{font-size:16px}.bar-footer{margin-top:4px}.library-heading #lead{min-height:36px}.palette{margin-top:3px;padding-top:3px}.playback{padding-top:4px}.playback #play{min-height:40px}.spare-row{padding-top:4px}#message{margin-block:3px}
}

/* Two-position notation switch; the highlighted half is the active label. */
header #notation.notation-toggle{display:inline-grid;grid-template-columns:1fr 1fr;align-items:center;position:relative;isolation:isolate;flex:0 0 132px;width:132px;max-width:none;min-height:40px;padding:3px;gap:0;border:1px solid #91a397;border-radius:22px;background:#173b32;box-shadow:inset 0 1px 3px #0003;color:#e3eadf;font-size:14px;font-weight:750;letter-spacing:.35px;cursor:pointer}
.notation-toggle:before{content:'';position:absolute;z-index:-1;left:3px;top:3px;bottom:3px;width:calc(50% - 3px);background:#fff6e4;border-radius:18px;box-shadow:0 1px 3px #0003;transition:transform .15s ease}
.notation-toggle[aria-checked=true]:before{transform:translateX(100%)}.notation-toggle span{display:block;text-align:center;padding:7px 4px}.notation-toggle[aria-checked=false] .bass-label,.notation-toggle[aria-checked=true] .kick-label{color:#244d40}
@media(max-width:560px){header #notation.notation-toggle{flex-basis:124px;width:124px;font-size:14px;min-height:40px}header .brand{font-size:20px}}
@media(prefers-reduced-motion:reduce){.notation-toggle:before{transition:none}}

/* BeatWriter transport: orange round play, ticked fader, BPM and tap. */
.playback{gap:14px;align-items:center;padding-top:6px}.tempo-control{flex:1;max-width:530px;min-width:190px}.tempo-control>label{font-size:12px;letter-spacing:1px;font-weight:750;margin-bottom:3px}.tempo-row{display:flex;align-items:center;gap:7px}.tempo-row>button{flex:0 0 34px;min-height:34px;padding:4px;font-size:13px;background:#fffbed;box-shadow:none}.bpm-control{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:400}.bpm-control input{width:50px;min-height:37px;padding:4px;border:1px solid #918875;border-radius:6px;background:linear-gradient(155deg,#fffef7a6,transparent 48%,#bda47f24),#fffbed;box-shadow:inset 0 1px #fffef7,0 2px 3px #45352138;color:#293c38;font:700 20px ui-monospace,monospace;text-align:center}.bpm-control input:focus-visible{outline:2px solid #a74721}
#tempo{appearance:none;flex:1;min-width:40px;width:100%;height:26px;margin:0;border:0;background:repeating-linear-gradient(90deg,#293c3859 0 1px,transparent 1px 10%) 0 calc(50% - 9px)/100% 3px no-repeat,repeating-linear-gradient(90deg,#293c3859 0 1px,transparent 1px 10%) 0 calc(50% + 9px)/100% 3px no-repeat}
#tempo::-webkit-slider-runnable-track{height:7px;border-radius:4px;background:#293c38;box-shadow:0 1px 2px #0005 inset}#tempo::-webkit-slider-thumb{appearance:none;width:24px;height:25px;margin-top:-9px;border:2px solid #8d4d26;border-radius:4px;background:linear-gradient(90deg,#b86d3c,#e6a76e 35%,#fff0c9 45%,#c27e48 60%,#99522a);box-shadow:0 2px 3px #49351f55}#tempo::-moz-range-track{height:7px;border-radius:4px;background:#293c38}#tempo::-moz-range-thumb{width:22px;height:23px;border:2px solid #8d4d26;border-radius:4px;background:linear-gradient(90deg,#b86d3c,#fff0c9,#99522a)}
.playback #play{flex:0 0 88px;width:88px;height:88px;min-width:88px;min-height:88px;border:3px solid #31403b;border-radius:50%;padding:20px;color:#293c38;background:radial-gradient(at 36% 23%,#ffac55,#f98925 58%,#d96310);box-shadow:inset 0 2px 2px #ffca86,inset 0 -2px 3px #873a173d,0 0 0 1px #fffbed,0 0 0 2px #6a7061,0 3px 5px #302e2680;display:grid;place-items:center}.playback #play svg{width:32px;height:32px;fill:currentColor}.playback #play:active{transform:translateY(1px)}.playback #play[aria-pressed=true]{background:radial-gradient(at 36% 23%,#ffac55,#f98925 58%,#d96310)}
#tap-tempo{flex:0 0 60px;width:60px;height:60px;min-height:60px;border-radius:50%;padding:5px;font-size:12px;line-height:1.2;background:linear-gradient(155deg,#fffef7a6,transparent 48%,#bda47f24),#fffbed}.sound-settings{margin-left:auto}
@media(min-width:1100px) and (max-height:660px){.playback #play{flex-basis:64px;width:64px;height:64px;min-width:64px;min-height:64px;padding:13px}#tap-tempo{flex-basis:48px;width:48px;height:48px;min-height:48px;font-size:11px}.playback{gap:12px}}
@media(max-width:760px){.playback{display:grid;grid-template-columns:52px minmax(0,1fr) 48px;gap:5px 9px}.playback #play{grid-column:1;grid-row:1;flex-basis:52px;width:52px;height:52px;min-width:52px;min-height:52px;padding:10px}.playback #play svg{width:26px;height:26px}.tempo-control{grid-column:2 / 4;grid-row:1;min-width:0}.tempo-control>label{display:none}.tempo-row{gap:4px}.tempo-row>button{flex-basis:30px;min-height:36px}.bpm-control{gap:3px}.bpm-control>span{display:none}.bpm-control input{width:43px;font-size:18px}#tap-tempo{grid-row:2;grid-column:1;width:44px;height:44px;min-height:44px;justify-self:center;font-size:10px}.sound-settings{grid-row:2;grid-column:3}.playback{padding-top:4px}.sound-settings summary{min-height:36px}.palette{min-height:80px}}
@media(min-width:1100px) and (max-height:620px){.playback #play{flex-basis:48px;width:48px;height:48px;min-width:48px;min-height:48px;padding:8px}.playback #play svg{width:26px;height:26px}#tap-tempo{flex-basis:44px;width:44px;height:44px;min-height:44px}.library-heading #lead{min-height:30px;padding-block:3px}.library-heading{padding-bottom:2px}}
@media(min-width:1100px) and (max-height:620px){#message{margin-block:0}}
@media(max-width:760px){.playback .sound-settings{margin:0;justify-self:end}}
/* Keep all five five-note patterns on one row in narrow desktop windows. */
@media(min-width:1100px) and (max-width:1249px){.length-row:nth-child(4) .tile{padding-inline:4px}.length-row:nth-child(4) .tile-notes{gap:2px}}

/* Triple strokes are a deliberate choice, separate from an invalid drop. */
.slot.triple-warning{outline:3px solid #b65b20;outline-offset:1px;z-index:5}
.drop-warning .preview-note{background:#ffe1a8;border-color:#a6601b!important;color:#5d350e}
#triple-confirm{width:min(430px,calc(100vw - 28px));padding:20px;border:2px solid #a6601b;max-height:80dvh}
#triple-confirm::backdrop{background:#193b3338}
#triple-confirm h2{font-size:20px;line-height:1.25}#triple-details p{font-size:15px;margin:10px 0;line-height:1.4}
#triple-question{font-weight:700;margin:16px 0 10px}.triple-actions{display:flex;justify-content:flex-end;gap:10px}
#triple-add{background:linear-gradient(#d67c35,#ae4c20);color:#fffbed;border-color:#88401b;font-weight:700}

#scramble{background:linear-gradient(#476f62,#214b40);color:#fffbed;border-color:#31564d;font-weight:700}
@media(max-width:560px){.section-head{flex-wrap:wrap;gap:6px}.section-head>div:first-child{flex-basis:100%}.section-head .actions{width:100%;justify-content:flex-end}.section-head .actions button{min-height:40px}}

#sound-previews{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}#sound-previews button{min-width:0;min-height:44px;padding:4px;font-size:17px;font-weight:700}.sound-preview-hint{font-size:12px;line-height:1.4;margin:0;color:var(--muted)}.sound-panel{max-height:calc(100dvh - 100px);overflow:auto}

/* Three musical families, with length badges instead of hidden variations. */
#group-rows{display:grid!important;grid-template-columns:1fr;grid-template-rows:none;gap:0;padding:0;overflow-y:auto;min-height:60px}
.group-family{min-width:0;padding:9px;border-bottom:1px solid #c6b99f}
.group-family:last-child{border-bottom:0}.group-family h3{font-size:16px;margin:0;font-weight:750;line-height:1.2}
.family-description{font-size:12px;color:var(--muted);margin:3px 0 7px;line-height:1.2}
.family-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.family-tiles .tile{display:flex;align-items:center;justify-content:flex-start;min-width:0;min-height:44px;padding:4px 6px;gap:7px}
.tile-length{display:grid;place-items:center;flex:0 0 20px;height:24px;border-radius:4px;background:#31564d;color:#fffbed;font-size:14px;font-weight:750}
.family-tiles .tile-notes{gap:3px;min-height:28px;display:flex;justify-content:center;flex:1}
.family-tiles .tile-note{font-size:15px;min-width:11px}.family-tiles .cymbal-glyph{width:12px;height:25px}
@media(min-width:1100px){
 #group-rows{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:1fr;min-height:250px;overflow:hidden;scrollbar-gutter:auto}
 .group-family{padding:7px;border-bottom:0}.group-family+.group-family{border-left:1px solid #c6b99f}
 .palette{min-height:340px}.family-tiles{gap:5px}.family-description{margin-bottom:6px}
}

@media(min-width:1100px) and (max-height:660px){.family-description{display:none}.group-family h3{margin-bottom:7px}#group-rows{min-height:224px}.palette{min-height:304px}}

/* The upper letter names the cymbal hand; the small cross names the sound. */
.cymbal-glyph{width:21px;height:31px}.tile-notes .cymbal-glyph,.family-tiles .cymbal-glyph{width:18px;height:28px}.slot .cymbal-glyph{width:23px;height:34px}
.group-family[data-family="cymbal-bass"] .family-tiles .tile:last-child{grid-column:1 / -1}

/* Keep the creator credit visible even when the desktop tagline is hidden. */
header .brand{display:flex;flex-direction:column;justify-content:center;gap:1px;line-height:1.05;padding-block:3px}header .brand-credit{display:block;font-size:12px;line-height:14px;font-weight:400;letter-spacing:.15px;color:#eee4cf}

/* A quiet family footer, with the bar left open when following a link. */
.app-footer{flex-shrink:0;padding-top:5px;margin-top:3px;color:#52645e;font-size:12px;line-height:18px}
.app-footer nav{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 8px}
.app-footer a{color:#31564d;text-decoration:underline;text-decoration-color:#31564d70;text-underline-offset:3px;white-space:nowrap;padding-block:2px}
.app-footer a:hover{color:#a84d20;text-decoration-color:currentColor}
.app-footer a:focus-visible{outline:2px solid #a84d20;outline-offset:3px;border-radius:2px}
@media(min-width:1100px) and (max-height:850px){.tempo-control>label{display:none}.palette{min-height:332px}#group-rows{min-height:242px}}
@media(min-width:1100px) and (max-height:660px){.palette{min-height:298px}#group-rows{min-height:218px}.group-family{padding-top:5px}.group-family h3{margin-bottom:5px}}
@media(max-width:560px){.app-footer nav{column-gap:6px}.app-footer{font-size:11px;line-height:16px;padding-top:3px;margin-top:0}.app-footer a{padding-block:5px}}
@media(pointer:coarse){.app-footer a{min-height:44px;display:inline-flex;align-items:center}}
@media(min-width:1100px) and (max-height:660px){.family-tiles{row-gap:2px}.app-footer{padding-top:0;margin-top:0}}
@media(min-width:1100px) and (max-height:620px){.workspace{padding-block:3px}.section-head .actions button{min-height:30px;padding-block:2px;font-size:13px}}

/* Joined RX / LX: equal cap height, tight spacing, centred foot below. */
.cymbal-glyph.joined-glyph{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;width:24px;height:34px;font:750 16px/1 Arial,sans-serif;letter-spacing:0;gap:1px;color:inherit}
.joined-glyph .cymbal-hand{display:flex;align-items:baseline;gap:0}.joined-glyph .cymbal-x{margin-left:-1.5px}.joined-glyph .cymbal-foot{display:block;text-align:center}
.tile-notes .cymbal-glyph.joined-glyph,.family-tiles .cymbal-glyph.joined-glyph{width:22px;height:31px;font-size:15px}
.slot .cymbal-glyph.joined-glyph{width:27px;height:37px;font-size:18px}
.group-family[data-family="cymbal-bass"] .tile{padding-inline:4px;gap:5px}.group-family[data-family="cymbal-bass"] .tile-notes{gap:2px}

/* Use the free space beside transport controls for the app-family links. */
.playback .app-footer{flex:1 1 210px;min-width:160px;padding:0;margin:0;align-self:center}
.playback .app-footer nav{justify-content:flex-end;column-gap:8px;row-gap:1px}
.playback .sound-settings{flex-shrink:0;margin-left:0}
@media(max-width:760px){.playback .app-footer{grid-column:1 / -1;grid-row:3;min-width:0;width:100%;padding-top:3px}.playback .app-footer nav{justify-content:center}}

/* Long desktop bars show every beat, with a clear 1–4 / 5–8 wrap. */
@media(min-width:1100px){
 .workspace.multi-row .scroll{max-height:none;min-height:0;flex:0 0 auto;overflow:visible;padding-block:22px 6px}
 .workspace.multi-row #bar{row-gap:25px}
}
@media(min-width:1100px) and (max-height:850px){
 .workspace.multi-row .family-description{display:none}
 .workspace.multi-row .group-family{padding-top:5px}
 .workspace.multi-row .group-family h3{margin-bottom:5px}
 .workspace.multi-row .family-tiles{row-gap:2px}
 .workspace.multi-row #group-rows{min-height:170px}
 .workspace.multi-row .palette{min-height:250px}
 .workspace.multi-row [data-family="cymbal-bass"] .family-tiles{grid-template-columns:repeat(6,minmax(0,1fr))}
 .workspace.multi-row [data-family="cymbal-bass"] .tile{grid-column:span 3}
 .workspace.multi-row [data-family="cymbal-bass"] .tile:nth-child(-n+3){grid-column:span 2}
 .workspace.multi-row [data-family="cymbal-bass"] .tile:last-child{grid-column:span 3}
 .workspace.multi-row [data-family="cymbal-bass"] .tile-note{min-width:10px;font-size:14px}
 .workspace.multi-row [data-family="cymbal-bass"] .joined-glyph{width:20px;font-size:14px}
}
@media(min-width:1100px) and (max-height:660px){
 .workspace.multi-row .scroll{padding-block:20px 2px}
 .workspace.multi-row #bar{row-gap:22px}
 .workspace.multi-row .slot{height:40px;min-height:40px}
 .workspace.multi-row .slot .joined-glyph{height:33px;font-size:16px}
}

/* Four families across desktop; two by two on smaller screens. */
#group-rows{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto;align-content:start;align-items:stretch;scrollbar-gutter:auto}
#group-rows .group-family{padding:6px;border:0;border-bottom:1px solid #c6b99f}
#group-rows .group-family:nth-child(even){border-left:1px solid #c6b99f}
#group-rows .group-family:nth-child(n+3){border-bottom:0}
#group-rows .group-family h3{font-size:14px;line-height:16px;margin:0;min-height:32px}
#group-rows .family-description{font-size:12px;line-height:14px;min-height:28px;margin:2px 0 6px}
#group-rows .family-tiles{grid-template-columns:minmax(0,1fr);gap:4px}
#group-rows .family-tiles .tile{grid-column:auto;min-height:44px;padding:4px 3px;gap:3px}
#group-rows .tile-length{flex-basis:16px;min-width:16px;height:22px;font-size:13px}
#group-rows .family-tiles .tile-notes{gap:1px;min-width:0;min-height:28px}
#group-rows .family-tiles .tile-note{min-width:0;font-size:14px}
#group-rows .family-tiles .joined-glyph{width:17px;height:28px;font-size:13px}
@media(min-width:1100px){
 #group-rows{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:1fr;align-content:stretch;min-height:260px}
 #group-rows .group-family{padding:5px;border-bottom:0}
 #group-rows .group-family+.group-family{border-left:1px solid #c6b99f}
 #group-rows .family-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
 #group-rows [data-family$="cymbal-bass"] .tile:last-child{grid-column:1 / -1}
 .palette{min-height:350px}
}
@media(min-width:1100px) and (max-height:850px){
 #group-rows .family-description{display:none}
 #group-rows .group-family h3{min-height:32px;margin-bottom:4px}
 #group-rows [data-family="reverse-cymbal-bass"] h3{font-size:13px;line-height:15px;min-height:32px}
 #group-rows [data-family="reverse-cymbal-bass"] h3::after{content:'Off-hand lead';display:block;font-size:12px;font-weight:400}
 #group-rows{min-height:234px}.palette{min-height:324px}
 .workspace.multi-row #group-rows{min-height:190px}.workspace.multi-row .palette{min-height:270px}
 .workspace.multi-row #group-rows .family-tiles .tile{min-height:32px;height:32px;padding-block:1px}
 .workspace.multi-row #group-rows .tile-notes{min-height:28px}
 .workspace.multi-row #group-rows .family-tiles .joined-glyph{height:26px;font-size:12px}
}
@media(min-width:1100px) and (max-height:660px){
 #group-rows{min-height:230px}.palette{min-height:310px}
 .workspace.multi-row #group-rows{min-height:182px}.workspace.multi-row .palette{min-height:262px}
}

.bar-editor{display:contents}#mobile-links{display:none}
/* Phone layout: one page scroll, visible bar, and an independent transport dock. */
@media(max-width:760px){
 html{scroll-padding-bottom:calc(116px + env(safe-area-inset-bottom));-webkit-text-size-adjust:100%}
 body{overflow-x:hidden}
 main{height:auto;min-height:100dvh;max-height:none;display:block;padding:6px 8px calc(118px + env(safe-area-inset-bottom))}
 header{display:flex;margin-bottom:6px;min-height:50px;padding-inline:7px}
 header .brand{font-size:20px}header #help-open{min-height:40px}
 .settings{margin:0;padding:6px 8px;gap:8px}
 .settings label{font-size:12px;gap:3px}.settings label:first-child{width:66px}
 .settings select{min-height:40px;font-size:16px;padding:6px 24px 6px 8px}
 .settings label:nth-of-type(2){min-width:0;flex:1}
 .workspace{display:block;min-height:0;margin-top:7px;padding:7px 8px;overflow:visible}
 .bar-editor{display:block;position:sticky;top:0;z-index:5;background:#fffbed;padding:5px 0 4px;box-shadow:0 3px 0 #fffbed}
 .workspace.many-rows .bar-editor{position:static}
 .section-head{display:flex;flex-wrap:nowrap;gap:6px;align-items:center;margin:0}
 .section-head>div:first-child{flex:1;min-width:0}
 .section-head h2{font-size:12px;line-height:15px}
 .section-head .actions{width:auto;flex:none;display:flex;gap:4px}
 .section-head .actions button{min-height:40px;padding:5px 7px;font-size:12px}
 .bar-tools{display:none}
 .workspace .scroll{flex:none;min-height:0;max-height:none;height:auto;overflow:visible;scrollbar-gutter:auto;padding:23px 0 4px}
 #bar{row-gap:23px}.slot{height:44px;min-height:44px}
 .slot .joined-glyph{height:35px;font-size:17px}
 .bar-footer{margin-top:4px;font-size:12px;line-height:17px;flex-wrap:nowrap}
 #equation{display:none}
 #message{font-size:11px;line-height:15px;min-height:15px;max-height:15px;margin:2px 0 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
 .palette{display:flex;flex-direction:column;flex:none;min-height:0;max-height:none;height:auto;overflow:visible;margin-top:3px;padding-top:6px}
 .library-heading{order:0;min-height:44px;margin-bottom:5px;padding:0;font-size:14px}
 .library-heading #lead{min-height:44px;font-size:16px;padding:6px 25px 6px 8px}
 .spare-row{order:1;padding:0 0 7px;gap:8px}.spare-row .tile{min-height:44px;min-width:44px}.spare-row .tile-notes{min-height:28px}.spare-row h2{font-size:12px}
 #group-rows{order:2;flex:none;min-height:0;max-height:none;height:auto;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto;align-content:start}
 #group-rows .group-family{padding:6px}
 #group-rows .group-family h3{font-size:14px;min-height:32px}
 #group-rows .family-description{display:none}
 #group-rows [data-family="reverse-cymbal-bass"] h3{min-height:48px}
 #group-rows [data-family="reverse-cymbal-bass"] h3::after{content:'Off-hand lead';display:block;font-size:12px;font-weight:400}
 #group-rows .family-tiles{margin-top:5px;gap:5px}
 #group-rows .family-tiles .tile{min-height:46px}
 .tile,.slot.filled{touch-action:pan-y pinch-zoom;-webkit-user-drag:none}
 .playback{position:fixed;bottom:0;left:0;right:0;z-index:20;display:grid;grid-template-columns:48px minmax(0,1fr) 64px;grid-template-rows:44px 40px;gap:5px 8px;margin:0;padding:7px max(10px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#fffbed;border-top:1px solid #b5a185;box-shadow:0 -3px 12px #293c3818}
 .playback #play{grid-column:1;grid-row:1;min-height:44px;min-width:44px;width:44px;height:44px;padding:8px}
 .playback #play svg{width:24px;height:24px}
 .tempo-control{grid-column:2 / -1;grid-row:1;min-width:0;max-width:none}
 .tempo-row{gap:5px}.tempo-row>button{min-height:40px;flex-basis:32px;font-size:13px}
 .bpm-control input{min-height:40px;width:48px;font-size:20px}
 .playback #tap-tempo{grid-column:1 / 3;grid-row:2;justify-self:start;width:auto;min-height:40px;height:40px;border-radius:6px;padding:4px 12px;font-size:12px;line-height:14px}
 #tap-tempo br{display:none}
 .playback .sound-settings{grid-column:3;grid-row:2;justify-self:end;margin:0}
 .sound-settings summary{min-height:40px;padding:5px 8px;font-size:13px}
 .sound-panel{max-height:calc(100dvh - 150px);width:min(280px,calc(100vw - 24px));bottom:calc(100% + 10px)}
 #mobile-links{display:block;padding:8px 0 2px}
 #mobile-links .app-footer{padding:0;margin:0;font-size:11px;line-height:16px}
 #mobile-links .app-footer a{min-height:40px;display:inline-flex;align-items:center}
 #mobile-links .app-footer nav{gap:0 5px}
}

@media(max-width:760px){
 html{scroll-padding-bottom:calc(76px + env(safe-area-inset-bottom))}
 main{padding-bottom:calc(78px + env(safe-area-inset-bottom))}
 #message{position:absolute;width:1px;height:1px;min-height:0;max-height:none;margin:0;padding:0;overflow:hidden;clip-path:inset(50%)}
 #message.phone-notice{position:fixed;z-index:25;left:10px;right:10px;bottom:calc(70px + env(safe-area-inset-bottom));width:auto;height:auto;clip-path:none;white-space:normal;background:#31564d;color:#fffbed;border-radius:7px;padding:9px 12px;font-size:13px;line-height:18px;box-shadow:0 2px 12px #0003}
 .palette{display:grid;grid-template-columns:minmax(0,1fr) 105px;gap:7px 6px}
 .library-heading{grid-column:2;grid-row:1;min-height:44px;margin:0;justify-content:flex-end}
 .library-heading>b{display:none}.library-heading #lead{font-size:14px;width:105px;min-height:44px;padding:6px 18px 6px 6px}
 .spare-row{grid-column:1;grid-row:1;padding:0;gap:0}
 .spare-row h2{position:absolute;width:1px!important;height:1px;overflow:hidden;clip-path:inset(50%)}
 .spare-row .tiles{gap:4px}.spare-row .tile{width:44px;min-width:44px;flex:none;padding:3px}
 #group-rows{grid-column:1 / -1;grid-row:2}
 .playback{grid-template-columns:44px minmax(0,1fr) 44px 54px;grid-template-rows:44px;gap:6px;padding-top:7px;padding-bottom:calc(7px + env(safe-area-inset-bottom))}
 .tempo-control{grid-column:2;grid-row:1}.tempo-row{gap:4px}.tempo-row>button{flex-basis:28px;padding:3px;font-size:12px}
 #tempo{min-width:24px}.bpm-control input{width:43px;font-size:18px}
 .playback #tap-tempo{grid-column:3;grid-row:1;width:44px;min-height:44px;height:44px;padding:3px;font-size:10px;line-height:12px}
 #tap-tempo br{display:initial}
 .playback .sound-settings{grid-column:4;grid-row:1;width:54px}
 .sound-settings summary{min-height:44px;padding:4px;font-size:12px;justify-content:center}.sound-settings summary::after{margin-left:3px}
}
@media(max-width:350px){
 .palette{grid-template-columns:minmax(0,1fr) 84px;column-gap:4px}.library-heading #lead{width:84px;font-size:12px;padding-left:4px;padding-right:15px}
 .spare-row .tiles{gap:2px}.tempo-row>button{display:none}
}

@media(max-width:760px){
 #group-rows .group-family h3{position:sticky;top:var(--phone-bar-height,208px);z-index:4;background:#f5eddb;padding-block:4px;min-height:36px}
 .workspace.many-rows #group-rows .group-family h3{top:0}
}

/* A quiet reminder to explore the kit, using the existing guidance row. */
.build-guidance{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0;margin:3px 0}
.build-guidance #message{margin:0;min-width:0}
.kit-slogan{margin:0;color:#31564d;font-size:16px;font-weight:600;line-height:20px;white-space:nowrap}
@media(max-width:760px){
 .build-guidance{justify-content:center;margin:12px 0 4px}
 .kit-slogan{font-size:14px;line-height:20px;white-space:normal;text-align:center}
}

/* Independent voice and limb levels stay inside the existing Sound popover. */
.sound-panel{width:280px;max-width:calc(100vw - 24px);gap:9px}
.sound-panel .volume-control{display:grid;gap:0;font-size:14px;color:#31564d}
.volume-control>span{display:flex;align-items:center;justify-content:space-between;gap:12px}
.volume-control output{font-variant-numeric:tabular-nums;font-size:13px}
.volume-control input[type=range]{width:100%;min-width:0;height:32px;margin:0;accent-color:#b65327;cursor:pointer}
@media(pointer:coarse){.volume-control input[type=range]{height:44px}}

/* Pattern storage lives in a panel, keeping the working library clear. */
.bar-heading{display:flex;align-items:center;gap:12px;min-width:0}
#patterns-open{min-height:36px;padding:4px 10px;font-size:14px;color:#31564d;font-weight:700;white-space:nowrap}
#patterns-open.has-changes::after{content:'•';color:#b65327;margin-left:4px}
#patterns-dialog{width:min(560px,calc(100vw - 24px));max-width:560px;max-height:calc(100dvh - 32px);padding:20px;background:#fffbed;color:#293c38;border-color:#9d8a69;overflow:auto}
#patterns-dialog [hidden]{display:none!important}
.patterns-head{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:-20px;z-index:2;background:#fffbed;padding-block:4px 8px}
#patterns-dialog h2{font-size:22px}#patterns-dialog h3{font-size:16px;margin:16px 0 4px}
#patterns-dialog p{color:#53645e;font-size:14px;line-height:1.45;margin:7px 0}
#patterns-dialog label{font-size:14px;color:#31564d;font-weight:600;margin-block:6px}
#patterns-dialog input[type=text],#patterns-dialog input[type=url]{width:100%;min-width:0;min-height:44px;padding:9px;border:1px solid #9d8a69;border-radius:6px;background:#fffdf5;color:#293c38;font:inherit;font-size:16px}
#patterns-dialog button{min-height:44px;font-size:14px;line-height:20px}
.patterns-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
#pattern-save,#pattern-confirm-accept{background:#31564d;color:#fffbed}
#patterns-status:empty{display:none}#patterns-status{padding:8px;background:#edf0e4;border-radius:5px}
#pattern-confirm{border:1px solid #b65327;padding:10px;border-radius:6px;margin-top:10px}
#pattern-current{overflow-wrap:anywhere}#saved-patterns{list-style:none;padding:0;margin:8px 0}
.saved-pattern{display:flex;align-items:flex-start;gap:5px;border-top:1px solid #c6b99f;padding:7px 0}
#patterns-dialog .saved-pattern-open{flex:1;min-width:0;text-align:left;background:none;box-shadow:none;border:0;padding:5px}
.saved-pattern-open strong,.saved-pattern-open>span{display:block;overflow-wrap:anywhere}
.saved-pattern-open>span{font-size:12px;color:#53645e;margin-top:3px;font-weight:400}
.saved-pattern-open .saved-pattern-preview{display:flex;gap:3px;height:7px;max-width:240px;margin-top:6px}
.saved-pattern-preview i{background:var(--saved-color);border-radius:2px;min-width:2px}
.pattern-options summary{list-style:none;display:grid;place-items:center;min-width:44px;min-height:44px;font-size:24px;cursor:pointer}
.pattern-options-menu{display:grid;gap:4px}.pattern-options{flex:none;max-width:115px}
.patterns-backups{border-top:1px solid #c6b99f;margin-top:8px;padding-top:5px}
.patterns-backups>summary{cursor:pointer;min-height:44px;line-height:44px;font-weight:700;color:#31564d}
.patterns-backups form>button{margin-top:7px}
#patterns-dialog .pattern-import-button{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:44px;border:1px solid #9d8a69;border-radius:7px;padding:8px 12px;margin:0;font-size:14px;font-weight:400;cursor:pointer;overflow:hidden}
.pattern-import-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.pattern-import-button:focus-within{outline:3px solid #31564d}
@media(max-width:760px){
 .section-head .bar-heading{flex:none}.bar-heading #bar-title{display:none}
 #patterns-open{min-height:40px;padding:5px 7px;font-size:12px}
 .section-head{justify-content:space-between}
 #patterns-dialog{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:88dvh;border-radius:14px 14px 0 0;padding:14px 16px calc(16px + env(safe-area-inset-bottom))}
 .patterns-head{top:-14px}.pattern-options{max-width:96px}
}

/* Installed mode: keep controls clear of notches without changing the desktop grid. */
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top)}main{height:calc(100dvh - env(safe-area-inset-top));max-height:calc(100dvh - env(safe-area-inset-top))}}
@media(display-mode:standalone) and (max-width:760px){main{height:auto;max-height:none;min-height:calc(100dvh - env(safe-area-inset-top))}}
.install-help{border:1px solid #b5a185;border-radius:8px;padding:12px;margin-block:16px}.install-help h3{margin:0 0 8px}.install-help button[hidden]{display:none}.install-help p:last-child{margin-bottom:0}
