/* Compact workshop. Scoped to the constructor, preserving other site pages. */
.drums-workshop{--site-ink:#252a27;--site-muted:#606a62;--site-line:#dcded6;--workshop-paper:#fdfdfb;--workshop-green:#345a46;--workshop-sage:#e5ede6;--workshop-hit:#829986;--workshop-amber:#b98232;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .site-header{background:var(--workshop-paper);z-index:10}
.drums-workshop .site-header .site-nav{padding:10px 20px;min-height:48px;gap:12px 28px}
.drums-workshop .site-header .site-nav a{font-size:13px}
.drums-workshop main>header{padding:22px 0 18px;text-align:left;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 24px}
.drums-workshop h1{font-size:28px;margin:0;letter-spacing:-.4px}
.drums-workshop .tool-links{margin:0;gap:20px;display:flex;flex-wrap:wrap}
.drums-workshop main>header .hint{flex-basis:100%;margin:0;font-size:12px}
.drums-workshop .workspace-tabs{gap:6px;margin:0 0 14px}
.drums-workshop .workspace-tabs button{border:0;background:transparent;color:var(--site-muted);border-radius:6px;padding:10px 16px;min-height:44px}
.drums-workshop .workspace-tabs button[aria-selected=true]{background:var(--workshop-sage);color:var(--workshop-green)}
.drums-workshop .editor{background:var(--workshop-paper);border:1px solid var(--site-line);border-radius:10px;padding:20px 22px}
.drums-workshop button{border-radius:5px;border-color:var(--site-line);touch-action:manipulation}
.drums-workshop .primary{background:var(--workshop-green);border-color:var(--workshop-green);color:#fff;font-weight:500}
.drums-workshop .primary:hover{background:#294936}
.drums-workshop .mode-switch{border-color:var(--site-line);border-radius:6px}
.drums-workshop .mode-switch button{background:#fff;color:var(--site-muted)}
.drums-workshop .mode-switch button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green)}
.drums-workshop .notation-heading{padding:0;border:0;gap:12px;justify-content:flex-start;flex-direction:row;align-items:center;flex-wrap:wrap}
.drums-workshop .notation-heading h2{font-size:18px;margin-right:auto}
.drums-workshop summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;color:var(--site-muted);list-style:none}
.drums-workshop summary::before{content:'›';font-size:18px;display:inline-block}
.drums-workshop details[open]>summary::before{transform:rotate(90deg)}
.drums-workshop summary::-webkit-details-marker{display:none}
.drums-workshop summary:focus-visible{outline:2px solid var(--workshop-green);outline-offset:3px}
.drums-workshop .score-panel{padding-top:0}
.drums-workshop .score-zoom{position:static;flex:none;width:40px;height:40px;padding:8px;background:transparent;border-color:transparent}
.drums-workshop #score-viewport{margin-top:8px}
.drums-workshop .notation-help{margin:4px 0 8px;font-size:12px}
.drums-workshop .notation-help summary{min-height:32px}
.drums-workshop .legend{margin:0 0 10px;font-size:12px;gap:8px 18px}
.drums-workshop .toolbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px;padding:14px 0;margin:0;background:var(--workshop-paper);border-top:1px solid var(--site-line);border-bottom:1px solid var(--site-line)}
.drums-workshop .desktop-grid{overflow-x:auto}
.drums-workshop #play{min-width:142px;min-height:44px;font-size:16px;background:var(--workshop-green);border-color:var(--workshop-green);border-radius:5px}
.drums-workshop #play:hover{background:#294936}
.drums-workshop #play::before{content:'';width:0;height:0;background:transparent;border:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:8px solid currentColor;margin:0}
.drums-workshop #play[aria-pressed=true]::before{content:'';width:10px;height:10px;border:0;background:currentColor}
.drums-workshop .metronome-control{display:flex;align-items:center;gap:8px;font-size:13px}
.drums-workshop .metronome-control input{width:18px;height:18px;margin:0;accent-color:var(--workshop-green)}
.drums-workshop .workshop-settings{margin-left:auto;font-size:13px}
.drums-workshop .workshop-settings-body{border-top:1px solid var(--site-line);display:flex;gap:16px 24px;flex-wrap:wrap;padding:16px 0 4px}
.drums-workshop .workshop-settings-body>.editor-mode{width:100%;margin:0;justify-content:flex-start}
.drums-workshop .workshop-settings-body .sound{display:flex;align-items:center;gap:8px;font-size:13px}
.drums-workshop .workshop-settings-body select,.drums-workshop .workshop-settings-body input[type=number]{font:inherit;padding:9px;border:1px solid var(--site-line);border-radius:5px;background:#fff;max-width:100%;min-height:44px}
.drums-workshop .meter-control input{width:58px}
.drums-workshop .instrument-picker{width:100%;margin:0;padding:0;border:0}
.drums-workshop .division-controls{width:100%;margin:0}
.drums-workshop .division-hint{width:100%;margin:0;font-size:12px}
.drums-workshop #clear{margin:0;min-height:44px;color:var(--site-muted);background:transparent}
.drums-workshop #simple-context{width:100%;margin:0}
.drums-workshop .grid-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:18px 0 12px}
.drums-workshop .grid-heading h2{font-size:16px}
.drums-workshop .edit-tools{margin:0}
.drums-workshop .edit-tools button{min-height:40px;padding:7px 12px;font-size:13px}
.drums-workshop .grid-heading .dynamics-help{width:100%;margin:0}
.drums-workshop .beat-navigation{display:none}
.drums-workshop .cell{background:#f3f5f1;border-color:var(--site-line);border-radius:5px}
.drums-workshop .cell[data-value="1"]{background:var(--workshop-hit);border-color:var(--workshop-hit)}
.drums-workshop .cell[data-value="2"]{background:var(--workshop-green);border-color:var(--workshop-green)}
.drums-workshop .cell[data-value="3"]{background:var(--workshop-sage);color:var(--workshop-green);border-color:var(--workshop-hit)}
.drums-workshop .cell.current{box-shadow:inset 0 0 0 3px var(--workshop-amber)}
.drums-workshop .instrument-label button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green);border-color:var(--workshop-sage)}
.drums-workshop .grid .row-label.instrument-label{display:grid;grid-template-columns:minmax(0,1fr) 56px 62px;align-items:center;gap:6px;min-height:44px;padding:0 6px 0 0;font-size:13px}
.drums-workshop .grid .instrument-label button{width:100%;min-height:32px;padding:5px 3px;font-size:12px}
.drums-workshop .track-control-help{margin:10px 0 0;font-size:12px;color:var(--site-muted)}
.drums-workshop .workshop-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.drums-workshop .notation-choice{width:auto;min-width:0;max-width:380px}
.drums-workshop .notation-choice select{width:100%;font-size:14px;min-height:44px;border-radius:5px}
.drums-workshop .mode-switch{display:inline-grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.drums-workshop .editor-mode .mode-switch{width:320px;max-width:100%}
.drums-workshop .edit-tools{width:240px;max-width:100%}
.drums-workshop .mode-switch button{min-height:44px;padding:8px 12px;font-size:14px;border:0;border-radius:0}
.drums-workshop .mode-switch button+button{border-left:1px solid var(--site-line)}
.drums-workshop #grid-hint{font-size:12px;margin:12px 0}
.drums-workshop #status{font-size:12px;margin:10px 0 0;color:var(--site-muted)}
.drums-workshop .sequence-add{display:flex;align-items:center;gap:10px 20px;flex-wrap:wrap;margin:14px 0}
.drums-workshop .sequence-add button{min-height:44px;font-size:13px}
.drums-workshop .sequence-add p:empty{display:none}
.drums-workshop .sequence-panel{border-color:var(--site-line);border-radius:10px;background:var(--workshop-paper)}
.drums-workshop .dynamics-toast{bottom:max(20px,env(safe-area-inset-bottom))}
@media(max-width:600px){
 .drums-workshop .site-header .site-nav{padding:8px 12px;gap:8px 16px;min-height:44px}
 .drums-workshop .site-header .site-nav a{font-size:11px}
 .drums-workshop main>header{padding:16px 0 12px;gap:8px}
 .drums-workshop h1{font-size:25px;margin:0}
 .drums-workshop .tool-links{gap:16px;width:100%;margin:0}
 .drums-workshop .tool-links a{font-size:13px;min-height:32px;display:flex;align-items:center}
 .drums-workshop main>header .hint{font-size:11px}
 .drums-workshop .workspace-tabs{margin-bottom:10px}
 .drums-workshop .workspace-tabs button{font-size:12px;padding:9px 8px}
 .drums-workshop .editor{padding:12px;border-radius:8px}
 .drums-workshop .notation-heading{gap:4px 8px}
 .drums-workshop .notation-heading h2{font-size:16px}
 .drums-workshop .score-zoom{width:44px;height:44px;padding:9px}
 .drums-workshop .toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px;padding:12px 0;align-items:center}
 .drums-workshop #play{min-width:0;width:100%;font-size:16px}
 .drums-workshop .tempo{justify-content:flex-end;font-size:12px;gap:5px}
 .drums-workshop .tempo input{width:56px;font-size:16px}
 .drums-workshop .metronome-control{grid-column:1;min-height:44px;font-size:12px}
 .drums-workshop .workshop-settings-body{gap:12px}
 .drums-workshop .workshop-settings-body>.editor-mode{gap:12px}
 .drums-workshop .workshop-settings-body .kit-control{grid-column:auto;display:flex;width:100%;justify-content:space-between}
 .drums-workshop .workshop-settings-body .meter-control{display:flex;width:100%;font-size:13px}
 .drums-workshop .meter-control input{width:56px}
 .drums-workshop .meter-control select{width:64px}
 .drums-workshop .workshop-settings-body select,.drums-workshop .workshop-settings-body input[type=number]{font-size:16px}
 .drums-workshop .editor-mode .sound{font-size:12px}
 .drums-workshop .editor[data-mode=simple] #clear{grid-column:auto;min-width:0}
 .drums-workshop .grid-heading{margin:14px 0 8px;gap:8px}
 .drums-workshop .grid-heading h2{font-size:14px}
 .drums-workshop .edit-tools{display:inline-flex;width:auto;max-width:100%}
 .drums-workshop .edit-tools button{min-height:44px;padding:8px 10px;font-size:12px}
 .drums-workshop .beat-navigation{display:flex;gap:6px;overflow-x:auto;padding:2px 0 8px;max-width:100%}
 .drums-workshop .beat-navigation button{min-width:44px;min-height:44px;padding:8px 12px;flex:1;background:transparent}
 .drums-workshop .beat-navigation button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green);border-color:var(--workshop-sage)}
 .drums-workshop .beat-navigation button[data-playing=true]{box-shadow:inset 0 -3px var(--workshop-amber)}
 .drums-workshop .mobile-grid{display:block}
 .drums-workshop .beat-card[data-selected=false]{display:none}
 .drums-workshop .beat-card{padding:8px 0 0;border:0;overflow-x:auto}
 .drums-workshop .beat-card h3{font-size:12px;margin-bottom:8px}
 .drums-workshop .beat-grid{gap:6px}
 .drums-workshop .beat-grid .cell{height:48px;min-height:44px}
 .drums-workshop .beat-grid .row-label.instrument-label{font-size:12px;min-height:48px;padding:0}
 .drums-workshop .sequence-add button{width:100%}
}
@media(max-width:600px){
 .drums-workshop .notation-heading h2{flex-basis:100%;margin-bottom:4px}
 .drums-workshop .notation-choice{width:calc(100% - 52px);max-width:none;flex:1}
 .drums-workshop .notation-choice select{font-size:16px}
 .drums-workshop .edit-tools{display:inline-grid;width:200px}
 .drums-workshop .edit-tools button{min-height:44px;font-size:14px;padding:8px}
 .drums-workshop .track-control-help{display:none}
}
@media(pointer:coarse) and (min-width:601px){.drums-workshop .grid .instrument-label button{min-height:44px}}
@media(max-width:380px){.drums-workshop .notation-heading h2{flex-basis:100%;margin-bottom:2px}}

@media(max-width:600px){.drums-workshop main>header{justify-content:center;text-align:center}.drums-workshop .tool-links{justify-content:center}}

/* Settings expand below a stable transport row, rather than moving its trigger. */
.drums-workshop .settings-toggle{margin-left:auto;background:transparent;border-color:transparent;min-height:44px;color:var(--site-muted);font-size:13px}
.drums-workshop .settings-toggle::before{content:'›';display:inline-block;margin-right:8px;font-size:18px}
.drums-workshop .settings-toggle[aria-expanded=true]::before{transform:rotate(90deg)}
.drums-workshop .workshop-settings{margin:0;font-size:13px}
.drums-workshop .workshop-settings-body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;padding:16px 0;border-top:0;border-bottom:1px solid var(--site-line)}
.drums-workshop .workshop-settings-body>.editor-mode,.drums-workshop .workshop-settings-body>.instrument-picker,.drums-workshop .division-controls,.drums-workshop .division-hint,.drums-workshop #simple-context{grid-column:1/-1;width:100%}
.drums-workshop .workshop-settings-body .kit-control{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px}
.drums-workshop .workshop-settings-body .meter-control{display:grid;grid-template-columns:76px 64px 12px 64px;gap:8px;justify-content:start;align-items:center}
.drums-workshop .workshop-settings-body .meter-control input,.drums-workshop .workshop-settings-body .meter-control select{width:64px;min-width:64px;max-width:64px;height:44px;padding:8px}
.drums-workshop .division-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}
.drums-workshop .division-setting{display:flex;flex-direction:column;align-items:stretch;gap:6px;width:100%;min-width:0;font-size:12px}
.drums-workshop .division-setting select{width:100%;min-width:0;height:44px;margin:0}
.drums-workshop #clear{grid-column:1/-1;justify-self:start}
.drums-workshop .beat-grid .instrument-label{position:relative}
.drums-workshop .beat-grid .instrument-label .instrument-name{font:inherit;line-height:1.4;text-align:left;white-space:normal;background:transparent;border:0;padding:4px 2px;min-height:44px;width:100%;color:var(--site-ink)}
.drums-workshop .instrument-name::after{content:'⌄';display:inline-block;margin-left:4px;color:var(--site-muted)}
.drums-workshop .instrument-menu{position:fixed;z-index:35;min-width:180px;max-width:240px;padding:8px;display:grid;gap:6px;border:1px solid var(--site-line);border-radius:7px;background:#fff;box-shadow:0 4px 18px #252a2720}
.drums-workshop .instrument-menu button{min-height:44px;padding:8px 12px;font-size:13px;text-align:left;width:100%}
.drums-workshop .score-dialog{box-sizing:border-box;position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:20px 24px;border:0;border-radius:0;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .score-dialog::backdrop{background:#252a2770}
.drums-workshop .score-dialog-heading{height:44px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.drums-workshop #score-dialog-close{min-height:44px}
.drums-workshop .score-dialog-body{height:calc(100% - 60px);margin-top:16px}
.drums-workshop .score-dialog #score-viewport{height:100%;width:100%;margin:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
.drums-workshop .score-dialog #notation{width:100%!important;min-width:0;min-height:0;height:100%;display:flex;align-items:center;justify-content:center}
.drums-workshop .score-dialog #notation>svg{width:var(--fitted-score-width,100%)!important;height:var(--fitted-score-height,100%)!important;max-width:100%;max-height:100%;display:block}
.drums-workshop.score-dialog-open{overflow:hidden}
@media(max-width:600px){
 .drums-workshop .settings-toggle{grid-column:2;justify-self:end;margin:0;padding:6px 0;font-size:12px}
 .drums-workshop .workshop-settings-body{grid-template-columns:minmax(0,1fr);gap:14px}
 .drums-workshop .workshop-settings-body>.editor-mode{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
 .drums-workshop .editor-mode .mode-switch{width:100%}
 .drums-workshop .editor-mode .sound{display:grid;grid-template-columns:110px minmax(0,1fr);width:100%;align-items:center;gap:8px;font-size:12px}
 .drums-workshop .editor-mode .sound select{width:100%;min-width:0}
 .drums-workshop .workshop-settings-body .kit-control{grid-template-columns:110px minmax(0,1fr)}
 .drums-workshop .workshop-settings-body .meter-control{grid-template-columns:110px 56px 12px 56px;gap:6px}
 .drums-workshop .workshop-settings-body .meter-control input,.drums-workshop .workshop-settings-body .meter-control select{width:56px;min-width:56px;max-width:56px}
 .drums-workshop .division-controls{grid-template-columns:minmax(0,1fr)}
 .drums-workshop .division-setting{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px;align-items:center}
 .drums-workshop .beat-card{overflow:visible}
 .drums-workshop .beat-grid{overflow-x:auto;padding-bottom:8px;align-items:center}
}

/* Bound control widths instead of stretching them to fill the settings panel. */
.drums-workshop .editor[data-mode=simple] .solo-button{display:inline-flex}
.drums-workshop .workshop-settings-body{max-width:860px}
.drums-workshop .workshop-settings-body .kit-control{grid-template-columns:76px 200px;justify-content:start}
.drums-workshop .division-controls{grid-template-columns:repeat(auto-fit,200px);justify-content:start}
.drums-workshop .workshop-settings-body .kit-control select,.drums-workshop .division-setting select{width:200px;max-width:100%}
.drums-workshop .score-dialog{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
@media(max-width:600px){
 .drums-workshop .workshop-settings-body{max-width:none}
 .drums-workshop .workshop-settings-body .kit-control{grid-template-columns:110px minmax(0,1fr)}
 .drums-workshop .division-controls{grid-template-columns:minmax(0,1fr)}
 .drums-workshop .workshop-settings-body .kit-control select,.drums-workshop .division-setting select{width:100%}
}

/* Keep score controls in one row in both editor modes; headings stay accessible. */
.drums-workshop .editor[data-mode] .notation-heading{padding:0;justify-content:space-between}
.drums-workshop .grid-heading{justify-content:flex-end}
.drums-workshop .notation-abbreviations{font-size:12px;color:var(--site-muted);line-height:1.6;margin:8px 0 12px}

/* Score preferences share a small, explicit entry point beside the loupe. */
.drums-workshop .editor[data-mode] .notation-heading{justify-content:flex-end;gap:4px;position:relative}
.drums-workshop .score-preferences-toggle{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px;border:0;background:transparent;color:var(--site-muted)}
.drums-workshop .score-preferences-toggle svg{width:24px;height:24px}
.drums-workshop .score-preferences-toggle[aria-expanded=true]{background:var(--workshop-sage);color:var(--workshop-green)}
.drums-workshop .score-preferences-panel{position:absolute;right:0;top:48px;z-index:30;width:340px;max-width:100%;padding:16px;border:1px solid var(--site-line);border-radius:8px;background:var(--workshop-paper);box-shadow:0 8px 28px #252a271a;display:grid;gap:16px}
.drums-workshop .score-preferences-panel label{display:grid;gap:6px;width:100%;max-width:none;font-size:13px;color:var(--site-muted)}
.drums-workshop .score-preferences-panel label span{font:inherit;color:inherit}
.drums-workshop .score-preferences-panel select{width:100%;min-width:0;min-height:44px;border:0;border-radius:6px;background:var(--workshop-sage);padding:10px;font:inherit;font-size:15px;color:var(--site-ink)}
/* Values are quiet, compact controls, with consistent touch targets. */
.drums-workshop .workshop-settings-body select,.drums-workshop .workshop-settings-body input[type=number]{border:0;background:var(--workshop-sage);color:var(--workshop-green);border-radius:6px;font-weight:500}
.drums-workshop .workshop-settings-body .meter-control{grid-column:1/-1}
.drums-workshop .workshop-settings-body .meter-control input,.drums-workshop .workshop-settings-body .meter-control select{text-align:center;font-size:20px}
.drums-workshop .division-controls{grid-template-columns:repeat(auto-fit,minmax(150px,200px));gap:12px}
.drums-workshop .division-setting{gap:6px}
.drums-workshop .tempo{gap:4px}
.drums-workshop .tempo input{border:0;background:transparent;font-size:22px;text-align:center;width:56px;padding:6px 0;appearance:textfield}
.drums-workshop .tempo input::-webkit-inner-spin-button,.drums-workshop .tempo input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.drums-workshop .tempo-step{border:0;background:var(--workshop-sage);color:var(--workshop-green);font-size:22px;width:36px;min-height:44px;padding:4px}
.drums-workshop .metronome-control input{appearance:none;width:34px;height:20px;border:0;border-radius:12px;background:#c9cec9;position:relative;flex:none}
.drums-workshop .metronome-control input::after{content:'';position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:white;transition:transform .15s}
.drums-workshop .metronome-control input:checked{background:var(--workshop-green)}
.drums-workshop .metronome-control input:checked::after{transform:translateX(14px)}
@media(max-width:600px){
 .drums-workshop .tempo{font-size:0;gap:2px}.drums-workshop .tempo span{font-size:10px}
 .drums-workshop .tempo-step{width:32px}.drums-workshop .tempo input{width:46px;font-size:20px}
 .drums-workshop .division-controls{grid-template-columns:minmax(0,1fr)}
 .drums-workshop .division-setting{grid-template-columns:100px minmax(0,1fr)}
 .drums-workshop .score-preferences-panel select{font-size:16px}
}
/* Keep score controls out of its own row. */
.drums-workshop .notation-heading{display:none!important}
.drums-workshop .notation-footer{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.drums-workshop .notation-footer .notation-help{flex:1;min-width:0}
.drums-workshop .notation-footer .score-zoom{width:44px;height:44px}
.drums-workshop .score-preferences{position:relative;margin-left:auto}
.drums-workshop .score-preferences-panel{width:340px;max-width:calc(100vw - 48px);top:48px}
.drums-workshop .score-preferences-panel .editor-mode{display:grid;gap:12px;margin:0}
.drums-workshop .score-preferences-panel .mode-switch{width:100%;max-width:100%}
.drums-workshop .score-preferences-panel .accent-choice{display:flex;align-items:center;gap:8px}
.drums-workshop .meter-picker{position:relative;margin:0}
.drums-workshop .meter-picker>summary{padding:6px 10px;font-size:20px;font-weight:500;color:var(--site-ink);border-radius:6px;min-width:64px;justify-content:center;background:var(--workshop-sage)}
.drums-workshop .meter-picker>summary::before{display:none}
.drums-workshop .meter-popover{position:absolute;left:0;top:50px;z-index:31;width:250px;max-width:calc(100vw - 48px);padding:14px;background:var(--workshop-paper);border:1px solid var(--site-line);border-radius:8px;box-shadow:0 8px 28px #252a271a}
.drums-workshop .meter-presets{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.drums-workshop .meter-presets button{padding:8px;font-size:18px;min-height:44px}
.drums-workshop .meter-presets button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green)}
.drums-workshop .meter-popover .meter-control{display:flex;justify-content:center;align-items:center;gap:8px;margin-bottom:10px}
.drums-workshop .meter-popover #meter-numerator,.drums-workshop .meter-popover #meter-denominator{box-sizing:border-box;width:72px;height:44px;min-width:72px;padding:8px;border:0;border-radius:6px;background:var(--workshop-sage);color:var(--site-ink);font:500 20px/1.2 Arial,sans-serif;text-align:center}
.drums-workshop #meter-apply{width:100%;min-height:44px}
.drums-workshop #eighth-grouping-label{display:grid;gap:8px;font-size:13px;margin-top:12px}
.drums-workshop #eighth-grouping{font:inherit;font-size:16px;min-height:44px;border:0;border-radius:6px;padding:8px;background:var(--workshop-sage)}
.drums-workshop #meter-feedback{font-size:12px;line-height:1.5;margin:8px 0 0}
.drums-workshop #meter-feedback:empty{display:none}
.drums-workshop .score-dialog-heading{justify-content:flex-end;height:44px}
.drums-workshop #score-dialog-close{width:44px;height:44px;padding:9px;border:0;background:transparent}
.drums-workshop #score-dialog-close svg{width:24px;height:24px}
.drums-workshop .score-dialog-body{margin-top:0;height:calc(100% - 44px)}
@media(max-width:600px){
 .drums-workshop .toolbar{grid-template-columns:64px minmax(0,1fr) 44px;gap:8px}
 .drums-workshop #play{grid-column:1;grid-row:1;width:auto;justify-self:start;min-width:130px}
 .drums-workshop .tempo{grid-column:2/4;grid-row:1;justify-self:end}
 .drums-workshop .meter-picker{grid-column:1;grid-row:2}
 .drums-workshop .metronome-control{grid-column:2;grid-row:2;justify-self:center;font-size:12px}
 .drums-workshop .score-preferences{grid-column:3;grid-row:2;margin:0}
 .drums-workshop .score-preferences-panel{right:0}
}
@media(max-width:360px){.drums-workshop #play{min-width:105px;padding:10px}.drums-workshop .tempo-step{width:28px}}

.drums-workshop .editor[data-grouped-eighths=true] .editor-mode .sound.simple-only{display:none}
@media(max-width:600px){
 .drums-workshop .toolbar{grid-template-columns:repeat(4,minmax(0,1fr))}
 .drums-workshop #play{grid-column:1/3;grid-row:1;width:100%;min-width:0}
 .drums-workshop .tempo{grid-column:3/5;grid-row:1}
 .drums-workshop .meter-picker{grid-column:1;grid-row:2}
 .drums-workshop .metronome-control{grid-column:2/4;grid-row:2}
 .drums-workshop .score-preferences{grid-column:4;grid-row:2;justify-self:end}
}
@media(max-width:360px){.drums-workshop .tempo span{display:none}}
/* Unified desktop editor. Mobile retains its current note/dynamics interaction. */
.drums-workshop .unified-desktop #rhythm-settings,.drums-workshop .unified-desktop .editor-mode,.drums-workshop .unified-desktop .grid-heading,.drums-workshop .unified-desktop .grid>span{display:none!important}
.drums-workshop .desktop-beat-header{display:grid;grid-template-columns:repeat(var(--steps),minmax(0,1fr));position:relative;background:var(--workshop-sage);color:var(--workshop-green);border-color:transparent;height:40px;min-width:0;padding:0;font-size:13px}
.drums-workshop .desktop-beat-header{align-items:stretch;line-height:1}
.drums-workshop .desktop-beat-header>span:not(.header-arrow){display:flex;align-items:center;justify-content:center;align-self:stretch;height:100%;line-height:1}
.drums-workshop .desktop-beat-header .header-arrow{position:absolute;right:3px;top:10px;opacity:.6;font-size:12px}
.drums-workshop .desktop-local-menu{position:fixed;z-index:50;width:228px;max-width:calc(100vw - 16px);max-height:320px;overflow:auto;display:grid;gap:4px;padding:8px;background:var(--workshop-paper);border:1px solid var(--site-line);border-radius:7px;box-shadow:0 5px 24px #252a2720}
.drums-workshop .desktop-local-menu button{text-align:left;min-height:36px}
.drums-workshop .desktop-local-menu input{width:100%;min-width:0;font:inherit;padding:8px}
.drums-workshop .desktop-cell-more{position:fixed;z-index:25;width:22px;height:20px;min-height:20px;padding:0;border:0;border-radius:3px;background:var(--workshop-sage);color:var(--workshop-green);font-size:13px}
.drums-workshop .desktop-instrument-picker{position:relative;width:auto;margin-left:auto;min-width:180px}
.drums-workshop .desktop-instrument-picker>summary{justify-content:flex-end}
.drums-workshop .desktop-instrument-picker[open]{width:340px;max-width:55%}
.drums-workshop .desktop-instrument-picker .instrument-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;font-size:12px}
.drums-workshop .desktop-instrument-groups{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}
.drums-workshop .desktop-instrument-groups button{padding:6px 8px;font-size:12px;min-height:32px}
.drums-workshop .desktop-instrument-groups button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green)}
.drums-workshop .desktop-instrument-groups button[data-partial=true]{border-bottom:2px solid var(--workshop-green)}
.drums-workshop .desktop-extra-legend{font-size:12px;color:var(--site-muted)}
.drums-workshop .editor-score-toolbar{display:flex!important}
.drums-workshop .desktop-editor-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;margin:0 0 8px auto;min-width:0;max-width:100%}
.drums-workshop .desktop-editor-actions #clear,.drums-workshop .desktop-editor-actions button{grid-column:auto;margin:0;min-height:44px;max-width:100%;padding:8px 12px;white-space:normal;overflow-wrap:anywhere;background:transparent;color:var(--site-muted)}
.drums-workshop .desktop-editor-actions .primary{background:var(--workshop-green);border-color:var(--workshop-green);color:#fff}
.drums-workshop .desktop-editor-actions .primary:hover{background:#294936}
.drums-workshop .unified-desktop .grid .instrument-label button{display:flex;align-items:center;justify-content:center;white-space:nowrap;height:32px}
.drums-workshop .unified-desktop #score-panel{position:relative;padding-right:30px}
.drums-workshop .unified-desktop #score-zoom{position:absolute;right:0;bottom:8px;top:auto;width:30px;height:30px;padding:5px;border:0;background:transparent;z-index:2}
.drums-workshop .unified-desktop #score-viewport{cursor:zoom-in}
.drums-workshop .score-dialog #score-viewport{cursor:zoom-out}
.drums-workshop .shared-rhythm-dialog{background:var(--workshop-paper);color:var(--site-ink);border:1px solid var(--site-line);border-radius:8px;width:min(900px,95vw);max-height:90vh;padding:20px}
.drums-workshop .shared-rhythm-dialog::backdrop{background:#252a2770}
.drums-workshop .shared-rhythm-dialog h2{font-size:20px;margin:0 0 14px}
.drums-workshop .shared-score{margin:16px 0;width:100%}
.drums-workshop .shared-score svg{width:100%;height:auto}
.drums-workshop .shared-rhythm-dialog>div:last-child{display:flex;gap:10px}
.drums-workshop .desktop-beat-header{column-gap:6px;border:0}
/* Local desktop disclosures overlay the editor rather than pushing it down. */
.drums-workshop .unified-desktop .desktop-instrument-picker[open]{width:auto;max-width:none}
.drums-workshop .unified-desktop .notation-footer .notation-help[open]{margin:4px 0 8px}
.drums-workshop .desktop-detail-overlay{position:fixed;z-index:45;width:360px;max-width:calc(100vw - 16px);overflow:auto;padding:14px;background:var(--workshop-paper);border:1px solid var(--site-line);border-radius:7px;box-shadow:0 5px 24px #252a2720}
.drums-workshop .unified-desktop #score-viewport{overflow-anchor:none}
.drums-workshop .unified-desktop #score-viewport #notation{display:flex;align-items:center;justify-content:center}
.drums-workshop .unified-desktop #score-viewport #notation>svg{max-height:100%}
.drums-workshop .unified-desktop .desktop-local-menu{overflow-y:auto;overflow-x:hidden}
/* Muted cells remain editable; symbols retain their dynamic meaning. */
.drums-workshop .cell[data-audible=false][data-value="1"],.drums-workshop .cell[data-audible=false][data-value="2"]{background:#b9bfba;border-color:#b9bfba;color:#fdfdfb}
.drums-workshop .cell[data-audible=false][data-value="3"]{background:#eeefec;border-color:#b9bfba;color:#858e87}
.drums-workshop .unified-desktop .grid .instrument-label .instrument-name{background:transparent;border:0;justify-content:flex-start;text-align:left;white-space:normal;font:inherit;padding:0 4px 0 0}
.drums-workshop .desktop-header-spacer{display:flex;align-items:center}
.drums-workshop .sticking-toggle{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:6px 0;font-size:13px;background:transparent;border:0;color:var(--site-muted);text-align:left}
.drums-workshop .sticking-toggle:hover{background:transparent}
.drums-workshop .sticking-toggle::after{content:"✓";visibility:hidden}
.drums-workshop .sticking-toggle[aria-pressed=true]{background:transparent;color:var(--workshop-green)}
.drums-workshop .sticking-toggle[aria-pressed=true]::after{visibility:visible}
.drums-workshop .cell{position:relative}
.drums-workshop .sticking-cell-label{position:absolute;right:4px;top:2px;font-size:10px;line-height:1.2;font-weight:500;pointer-events:none}
.drums-workshop .editor[data-sticking-mode=true] .cell[data-value="0"]{opacity:.55}
.drums-workshop .editor[data-sticking-mode=true] .cell:not([data-value="0"]){outline:1px solid var(--workshop-green);outline-offset:-1px}
.drums-workshop .editor[data-sticking-mode=true] #score-viewport{cursor:default}
.drums-workshop [data-sticking-track]{cursor:pointer}
.drums-workshop .score-preferences-panel .sticking-visibility{display:flex;align-items:center;gap:8px;min-height:36px}
.drums-workshop .sticking-visibility input{width:18px;height:18px;accent-color:var(--workshop-green)}
.drums-workshop.hide-sticking #editor-panel [data-sticking-label],.drums-workshop.hide-sticking #editor-panel .sticking-cell-label,.drums-workshop.hide-sticking #score-dialog [data-sticking-label]{visibility:hidden}
/* Mobile editor: quarter navigation remains, controls share the same local menus. */
.drums-workshop .mobile-editor-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0 8px}
.drums-workshop .unified-mobile .sticking-toggle{min-height:44px}
.drums-workshop .unified-mobile .desktop-global-grid{min-height:44px;font-size:13px;padding:6px 10px}
.drums-workshop .unified-mobile .beat-grid>span{display:none}
.drums-workshop .mobile-pulse-button{grid-column:2/-1;display:grid;grid-template-columns:repeat(var(--steps),minmax(0,1fr));gap:6px;min-height:44px;position:relative;padding:0;border:0;background:var(--workshop-sage);color:var(--workshop-green);font-size:13px}
.drums-workshop .mobile-pulse-button::after{content:'⌄';position:absolute;right:3px;top:12px;font-size:12px;opacity:.6}
.drums-workshop .unified-mobile .cell{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.drums-workshop .unified-mobile .desktop-local-menu{width:228px;max-width:calc(100vw - 16px)}
.drums-workshop .unified-mobile .desktop-local-menu button{min-height:44px;font-size:15px}
.drums-workshop .unified-mobile .notation-footer{align-items:center;gap:8px}
.drums-workshop .unified-mobile .desktop-instrument-picker{min-width:0;padding:0;border:0;margin:0;font-size:12px}
.drums-workshop .unified-mobile .desktop-instrument-picker>summary{font-size:12px;min-height:44px}
.drums-workshop .unified-mobile .notation-help{font-size:12px}
.drums-workshop .unified-mobile .desktop-detail-overlay{width:340px;max-width:calc(100vw - 16px);font-size:14px}
.drums-workshop .unified-mobile .desktop-detail-overlay summary,.drums-workshop .unified-mobile .desktop-instrument-groups button{min-height:44px}
.drums-workshop .unified-mobile .desktop-editor-actions{justify-content:flex-end}
.drums-workshop .unified-mobile .desktop-editor-actions button{min-height:44px}
.drums-workshop .unified-mobile .track-control-help{display:none}
.drums-workshop.mobile-workshop .score-preferences-panel{width:300px;max-width:calc(100vw - 16px)}
.drums-workshop.mobile-workshop .score-preferences-panel select{font-size:16px}
.drums-workshop.mobile-workshop .meter-popover{max-width:calc(100vw - 16px)}
@media(pointer:coarse) and (min-width:601px){
 .drums-workshop .unified-mobile .mobile-grid{display:block}
 .drums-workshop .unified-mobile .desktop-grid{display:none}
 .drums-workshop .unified-mobile .beat-card[data-selected=false]{display:none}
 .drums-workshop .unified-mobile .beat-navigation{display:flex;gap:6px;overflow:auto}
 .drums-workshop .unified-mobile .beat-navigation button{flex:1;min-height:44px}
}
.drums-workshop .unified-mobile .beat-navigation button[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green);border-color:var(--workshop-sage)}
/* Align every subdivision with its cell and show the full bar in landscape. */
.drums-workshop .mobile-pulse-button{align-items:center}
.drums-workshop .mobile-pulse-button>span{display:flex;align-items:center;justify-content:center;height:100%;min-height:44px;line-height:1}
@media(orientation:landscape){
 .drums-workshop .unified-mobile .toolbar{position:static}
 .drums-workshop .unified-mobile .beat-navigation,.drums-workshop .unified-mobile .mobile-grid{display:none!important}
 .drums-workshop .unified-mobile .desktop-grid{display:block!important;overflow-x:auto;max-width:100%;margin-top:10px;-webkit-overflow-scrolling:touch}
 .drums-workshop .unified-mobile #grid{grid-template-columns:110px repeat(var(--mobile-steps),minmax(28px,1fr))!important;min-width:calc(110px + var(--mobile-steps) * 34px)!important}
 .drums-workshop .unified-mobile .grid .row-label.instrument-label{display:flex;padding:0 6px 0 0;min-height:44px}
 .drums-workshop .unified-mobile .grid .instrument-label .mute-button,.drums-workshop .unified-mobile .grid .instrument-label .solo-button{display:none}
 .drums-workshop .unified-mobile .grid .instrument-name{font-size:12px;min-height:44px;justify-content:flex-start;text-align:left}
 .drums-workshop .unified-mobile .grid .cell{height:44px}
}

/* Keep layout width independent of the scrollable grid and browser page scale. */
html.drums-viewport{width:100%;min-width:0;overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.drums-workshop{width:100%;min-width:0;max-width:100%;overflow-x:clip}
.drums-workshop main{min-width:0;max-width:1120px}
.drums-workshop .editor,.drums-workshop .desktop-grid,.drums-workshop .mobile-grid{min-width:0;max-width:100%}
.drums-workshop .desktop-grid{width:100%;contain:inline-size}
.drums-workshop .score-dialog{width:100%;height:100dvh;display:none;flex-direction:column}
.drums-workshop .score-dialog[open]{display:flex}
.drums-workshop .score-dialog-heading{flex:0 0 44px}
.drums-workshop .score-dialog-body{flex:1;min-height:0;min-width:0;height:auto;margin:0}
@media(pointer:coarse){.drums-workshop .desktop-local-menu input,.drums-workshop .sequence-panel input,.drums-workshop .sequence-panel select{font-size:16px}}

/* Local explanation for a grid change that would lose existing hits. */
.drums-workshop .grid-change-feedback{position:fixed;z-index:55;width:300px;max-width:calc(100vw - 16px);margin:0;padding:12px 14px;border:1px solid #987547;border-radius:7px;background:var(--workshop-paper);color:var(--site-ink);font-size:13px;line-height:1.5;box-shadow:0 5px 24px #252a2720;pointer-events:none}
.drums-workshop .grid-change-feedback[hidden]{display:none}
.drums-workshop .cell.grid-conflict{outline:2px solid #987547;outline-offset:-2px}

/* Independent instrument grids share proportional time columns. */
.drums-workshop .editor[data-polyrhythm=true] #grid{grid-template-columns:252px var(--poly-columns)!important;min-width:var(--poly-min-width)!important;column-gap:0}
.drums-workshop .editor[data-polyrhythm=true] .cell{width:calc(100% - 6px);min-width:28px;justify-self:start}
.drums-workshop .cell[data-off-grid=true]{visibility:hidden;pointer-events:none}
.drums-workshop .editor[data-polyrhythm=true] .desktop-beat-header,.drums-workshop .editor[data-polyrhythm=true] .mobile-pulse-button{column-gap:0}
.drums-workshop .editor[data-polyrhythm=true] .desktop-beat-header>span:not(.header-arrow),.drums-workshop .editor[data-polyrhythm=true] .mobile-pulse-button>span{padding-right:6px}
.drums-workshop .instrument-name[data-grid-label]:not([data-grid-label=""])::after{content:attr(data-grid-label);display:block;font-size:11px;color:var(--workshop-green)}
.drums-workshop .editor[data-polyrhythm=true] .beat-card{overflow-x:auto}
.drums-workshop .editor[data-polyrhythm=true] .beat-grid{column-gap:0}
@media(pointer:coarse){.drums-workshop .editor[data-polyrhythm=true] .cell{min-width:44px;min-height:44px}}

.drums-workshop .editor-empty{padding:24px 0;text-align:center;color:var(--site-muted)}
.drums-workshop .editor-empty[hidden]{display:none}
.drums-workshop .editor-empty p{margin:0 0 12px}
.drums-workshop .editor[data-empty-editor=true] :is(.desktop-grid,.mobile-grid,.beat-navigation,.mobile-editor-tools,.track-control-help,#grid-hint,.desktop-edit-mode-hint,.mobile-edit-mode-hint){display:none!important}

/* Themes are local to the drum workshop, including chains and score dialogs. */
html[data-drums-theme=light]{color-scheme:light}
html[data-drums-theme=dark]{color-scheme:dark;background:#202723}
html[data-drums-theme=dark] .drums-workshop{--site-ink:#e9ede9;--site-muted:#b5bfb7;--site-line:#465149;--workshop-paper:#202723;--workshop-green:#b7d2bf;--workshop-sage:#33493c;--workshop-hit:#54765d;--workshop-amber:#d7a85c;min-height:100vh}
html[data-drums-theme=dark] .drums-workshop :is(button,input,select,textarea){background:var(--workshop-paper);color:var(--site-ink);border-color:var(--site-line)}
html[data-drums-theme=dark] .drums-workshop :is(button:hover,select:hover){background:#2a352e}
html[data-drums-theme=dark] .drums-workshop :is(button[aria-pressed=true],button[aria-selected=true],.meter-picker>summary,.tempo-step){background:var(--workshop-sage);color:var(--workshop-green)}
html[data-drums-theme=dark] .drums-workshop :is(.primary,#play){background:#4d745b;color:#f3f6f3;border-color:#4d745b}
html[data-drums-theme=dark] .drums-workshop :is(.primary:hover,#play:hover){background:#5b8569}
html[data-drums-theme=dark] .drums-workshop :is(.sticking-toggle,.instrument-name,.score-zoom,.score-preferences-toggle){background:transparent}
html[data-drums-theme=dark] .drums-workshop .sticking-toggle[aria-pressed=true]{color:var(--workshop-green)}
html[data-drums-theme=dark] .drums-workshop :is(.cell,.cell:hover){background:#26302a;color:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop .cell[data-value="1"]{background:var(--workshop-hit);border-color:var(--workshop-hit);color:#f3f6f3}
html[data-drums-theme=dark] .drums-workshop .cell[data-value="2"]{background:#3f654d;border-color:#7c9a86;color:#fff}
html[data-drums-theme=dark] .drums-workshop .cell[data-value="3"]{background:#26352b;border-color:#708b78;color:#c9dfd0}
html[data-drums-theme=dark] .drums-workshop .cell[data-audible=false][data-value="1"],html[data-drums-theme=dark] .drums-workshop .cell[data-audible=false][data-value="2"]{background:#46504a;border-color:#626f65;color:#ced5cf}
html[data-drums-theme=dark] .drums-workshop .cell[data-audible=false][data-value="3"]{background:#252c28;border-color:#58635b;color:#aeb7b0}
html[data-drums-theme=dark] .drums-workshop :is(.instrument-menu,.sequence-card,.sequence-export){background:var(--workshop-paper);border-color:var(--site-line)}
html[data-drums-theme=dark] .drums-workshop :is(.hint,.legend,.intro,.step-label,.tempo,.sound,.meter,.notation-heading span){color:var(--site-muted)}
html[data-drums-theme=dark] .drums-workshop :is(.row-label,h1,h2,h3){color:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop :is(.site-header .site-nav a,.site-footer a){color:var(--site-ink)!important}
html[data-drums-theme=dark] .drums-workshop .site-header .site-nav a[aria-current]{border-color:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop .metronome-control input{background:#526057}
html[data-drums-theme=dark] .drums-workshop .metronome-control input:checked{background:#4d745b}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg{color:var(--site-ink);fill:var(--site-ink);stroke:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg :is([fill="black"],[fill="#000"],[fill="#000000"],[fill="#333"]){fill:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg :is([stroke="black"],[stroke="#000"],[stroke="#000000"],[stroke="#333"]){stroke:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg [stroke="#999999"]{stroke:#738a7b}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg text{fill:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop :is(#notation,.sequence-score,.shared-score) svg :is([data-count-step],[data-sticking-label]){fill:var(--site-muted)}
html[data-drums-theme=dark] .drums-workshop :is(.desktop-beat-header,.mobile-pulse-button){background:var(--workshop-sage);color:var(--workshop-green)}
html[data-drums-theme=dark] .drums-workshop :is(.sequence-panel,.sequence-item,.sequence-export,.site-support,.app-install){border-color:var(--site-line)}
html[data-drums-theme=dark] .drums-workshop .sequence-item[data-active=true]{background:var(--workshop-sage);border-left-color:var(--workshop-green)}
html[data-drums-theme=dark] .drums-workshop :is(.site-support,.app-install,#sequence-status,.sequence-add p){color:var(--site-muted)}
html[data-drums-theme=dark] .drums-workshop :is(.site-support a,.tool-links a){color:var(--site-ink)}

/* Chain views share one execution order; the score has no card borders. */
.drums-workshop .sequence-panel{padding:24px}
.drums-workshop .sequence-panel>h2{margin-bottom:18px}
.drums-workshop .chain-view-toolbar{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:22px;padding-top:20px;border-top:1px solid var(--site-line)}
.drums-workshop .chain-view-toolbar .mode-switch{width:auto;max-width:100%;flex:none}
.drums-workshop .chain-view-toolbar button{min-height:44px}
.drums-workshop #chain-style-label{display:flex;align-items:center;gap:8px;margin-left:auto;color:var(--site-muted);font-size:13px}
.drums-workshop #chain-style{max-width:250px;width:auto;font:inherit;padding:10px;border:1px solid var(--site-line);border-radius:8px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop #chain-view-help{margin:16px 0 24px}
.drums-workshop .chain-rhythm{padding:16px 0 24px;border-bottom:1px solid var(--site-line)}
.drums-workshop .chain-rhythm-heading{border:0;background:transparent;padding:8px 0;color:var(--site-muted);text-align:left;font-size:14px;min-height:44px}
.drums-workshop .chain-rhythm .sequence-score{max-width:780px;margin:8px auto 0;cursor:pointer}
.drums-workshop .chain-paper{min-width:0}
.drums-workshop .chain-system{position:relative;margin:0 0 16px;line-height:0;max-width:100%}
.drums-workshop .chain-system[data-overflow=true]{overflow-x:auto}
.drums-workshop .chain-system-canvas{position:relative}
.drums-workshop .chain-system-canvas>svg{display:block}
.drums-workshop .chain-bar-hit{position:absolute;top:0;height:100%;padding:0;border:0;border-radius:0;background:transparent!important;color:inherit;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.drums-workshop .chain-bar-hit:hover,.drums-workshop .chain-bar-hit[data-selected=true],.drums-workshop .chain-bar-hit[data-active=true]{background:color-mix(in srgb,var(--workshop-hit) 12%,transparent)!important}
.drums-workshop .chain-bar-hit[data-drop=true]{box-shadow:inset 3px 0 var(--workshop-green)}
.drums-workshop .chain-bar-hit[data-dragging=true]{background:color-mix(in srgb,var(--workshop-hit) 24%,transparent)!important;touch-action:none}
.drums-workshop .chain-pagination{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;margin:20px 0;color:var(--site-muted);font-size:13px}
.drums-workshop .chain-menu{position:fixed;z-index:1200;width:310px;max-width:calc(100vw - 16px);padding:16px;background:var(--workshop-paper);color:var(--site-ink);border:1px solid var(--site-line);border-radius:12px;box-shadow:0 12px 30px #0002;overflow:auto;line-height:1.5}
.drums-workshop .chain-menu-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px;font-size:14px}
.drums-workshop .chain-menu-heading strong{font-weight:500}
.drums-workshop .chain-menu-heading button{font-size:12px;min-height:44px;border:0;padding:8px;background:transparent}
.drums-workshop .chain-menu>button{display:block;width:100%;text-align:left;margin:6px 0;min-height:44px;font-size:13px}
.drums-workshop .chain-menu>input{display:block;width:100%;margin-bottom:14px;padding:10px;border:1px solid var(--site-line);border-radius:8px;background:var(--workshop-paper);font:inherit;color:inherit}
.drums-workshop .chain-menu label{display:block;font-size:13px;color:var(--site-muted);margin:12px 0}
.drums-workshop .chain-repeat-controls{display:flex;gap:10px;align-items:center;margin-top:8px}
.drums-workshop .chain-repeat-controls input{min-width:0;width:80px;height:44px;text-align:center;font:inherit;padding:8px;border:1px solid var(--site-line);border-radius:8px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-repeat-controls button{min-width:44px;min-height:44px;padding:8px}
.drums-workshop .chain-menu .hint{margin:12px 0;font-size:12px}
.drums-workshop #chain-print-controls{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 10px}
.drums-workshop .chain-print-preview{padding:16px;background:var(--workshop-sage);overflow:auto;max-height:75vh;border-radius:8px}
.drums-workshop .chain-print-sheet{display:block;width:100%;max-width:800px;height:auto;margin:0 auto 16px;background:white;border:1px solid var(--site-line);color:black}
.drums-workshop .chain-print-preview[data-zoom=true] .chain-print-sheet{width:var(--print-zoom-width,1200px);min-width:var(--print-zoom-width,1200px);max-width:none}
.drums-workshop #sequence-undo{margin-left:auto}
@media(max-width:600px){.drums-workshop .sequence-panel{padding:16px 12px}.drums-workshop .chain-view-toolbar{gap:12px}.drums-workshop .chain-view-toolbar .mode-switch{width:100%}.drums-workshop #chain-style-label{margin-left:0;max-width:100%;flex-wrap:wrap}.drums-workshop #chain-style{max-width:100%;font-size:16px}.drums-workshop .chain-menu input{font-size:16px}}

.print-format {margin:12px 0}.print-format-fields {display:grid;gap:12px;padding:14px 0;max-width:640px}.print-format-fields label {display:flex;gap:8px;flex-wrap:wrap;align-items:center}.print-format-fields label:has(textarea),.print-format-fields label:has(input:not([type=checkbox])) {display:grid;gap:6px}.print-format-fields input:not([type=checkbox]),.print-format-fields textarea,.chain-menu textarea {box-sizing:border-box;width:100%;font:inherit;color:inherit;background:var(--workshop-paper,#fff);border:1px solid #89968c;border-radius:6px;padding:8px}.chain-menu textarea {min-height:80px;resize:vertical}.chain-rhythm-description {white-space:pre-wrap;margin:8px 12px;font-size:.9rem;line-height:1.5}.print-format textarea {resize:vertical}

.drums-workshop .chain-system,.drums-workshop .chain-system-canvas{min-width:0;max-width:100%}.drums-workshop .chain-system-canvas>svg{max-width:100%;height:auto}.drums-workshop .sequence-panel{min-width:0}.drums-workshop .chain-print-preview{min-width:0;max-width:100%;box-sizing:border-box}

.print-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}.print-group{border:1px solid var(--site-line);border-radius:8px;padding:12px;min-width:0}.print-group>summary{font-weight:500;cursor:pointer}.print-group-fields{display:grid;gap:12px;padding-top:12px}.print-group-fields label{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px}.print-group-fields label:has(select),.print-group-fields label:has(textarea),.print-group-fields label:has(input:not([type=checkbox])){display:grid;gap:6px}.print-group-fields :is(select,textarea,input:not([type=checkbox])){width:100%;min-width:0;box-sizing:border-box;font:inherit;color:inherit;background:var(--workshop-paper);padding:8px;border:1px solid var(--site-line);border-radius:6px}.print-actions{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0}@media(max-width:600px){.print-groups{grid-template-columns:1fr}.print-actions button{flex:1}}

.drums-workshop .print-dialog-open{margin-top:20px}.drums-workshop .print-dialog{box-sizing:border-box;width:min(1200px,96vw);height:min(900px,92dvh);max-width:96vw;max-height:92dvh;padding:0;border:1px solid var(--site-line);border-radius:12px;background:var(--workshop-paper);color:var(--site-ink);overflow:hidden}.print-dialog::backdrop{background:#0007}.print-dialog[open]{display:flex;flex-direction:column}.print-dialog-header{padding:14px 20px;border-bottom:1px solid var(--site-line);flex:none}.print-dialog-header h2{margin:0;font-size:18px;font-weight:500}.print-dialog-body{display:grid;grid-template-columns:minmax(0,1fr) 380px;min-height:0;flex:1;overflow:hidden}.print-preview-pane{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--workshop-sage)}.drums-workshop .print-dialog #chain-print-controls{margin:0;padding:10px 14px;flex:none;align-items:center}.print-preview-toolbar button{font-size:13px;min-height:36px;padding:6px 10px}.drums-workshop .print-dialog .chain-print-preview{flex:1;min-height:0;max-height:none;border-radius:0;padding:16px;overflow:auto}.print-settings-pane{min-width:0;overflow-y:auto;padding:8px 16px;border-left:1px solid var(--site-line)}.print-settings-pane .print-group{padding:12px 0;border:0;border-bottom:1px solid var(--site-line);border-radius:0}.print-settings-pane .print-group>summary{font-size:14px;min-height:28px}.print-settings-pane .print-group-fields{gap:9px;padding-top:8px}.print-settings-pane .print-group-fields label:has(select){display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr);align-items:center;gap:8px;font-size:13px}.print-settings-pane .print-group-fields select{padding:6px;font-size:13px;min-height:36px}.print-dialog-footer{flex:none;border-top:1px solid var(--site-line);padding:12px 18px;display:flex;gap:12px;align-items:center;justify-content:space-between}.print-dialog-footer p{margin:0;min-width:0;font-size:12px;color:var(--site-muted)}.print-dialog-footer>div{display:flex;gap:10px;flex:none}.print-mobile-tabs{display:none}@media(max-width:700px){.drums-workshop .print-dialog{width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;border-radius:0;margin:0;border:0}.print-dialog-body{display:flex}.print-preview-pane,.print-settings-pane{width:100%;box-sizing:border-box}.print-mobile-tabs{display:flex;padding:8px 12px;gap:8px;border-bottom:1px solid var(--site-line)}.print-mobile-tabs button{flex:1;min-height:40px;font-size:14px}.print-mobile-tabs button[aria-selected=true]{background:var(--workshop-sage)}.print-dialog-body[data-pane=preview] .print-settings-pane,.print-dialog-body[data-pane=settings] .print-preview-pane{display:none}.print-settings-pane{border-left:0}.print-settings-pane .print-group-fields select,.print-settings-pane textarea,.print-settings-pane input{font-size:16px}.print-dialog-footer{flex-wrap:wrap;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom))}.print-dialog-footer>div{width:100%;justify-content:flex-end}.print-dialog-header{padding:12px}.print-dialog-header h2{font-size:16px}}

.drums-workshop .chain-print-preview[data-zoom=true] .chain-print-sheet{width:var(--print-zoom-width,1200px)!important;max-width:none}.print-dialog-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}@media(max-width:700px){.print-dialog-header{padding:8px 12px}.print-mobile-tabs{padding:5px 10px;gap:6px}.print-mobile-tabs button{min-height:34px;padding:5px;font-size:13px}.drums-workshop .print-dialog #chain-print-controls{padding:6px 10px}.print-preview-toolbar button{min-height:32px;padding:5px 8px}.print-dialog-footer{padding-bottom:calc(18px + env(safe-area-inset-bottom));gap:6px}.print-dialog-footer>div button{min-height:40px}}

.drums-workshop .chain-copy-submit{width:100%;margin:0 0 14px!important;background:var(--workshop-sage)!important;font-weight:500}.drums-workshop .chain-system-canvas{height:auto}.drums-workshop .chain-system-canvas>svg{height:100%}

/* One workshop language for editor, chain menus and print settings. */
.drums-workshop :is(select,textarea,input[type=text],input[type=number]):not(#tempo){box-sizing:border-box;max-width:100%;min-width:0;min-height:44px;border:0;border-radius:6px;padding:10px 12px;background:var(--workshop-sage);color:var(--site-ink);font-family:inherit;font-size:15px;line-height:1.4}
.drums-workshop :is(.chain-view-toolbar,.sequence-toolbar,.chain-menu,.print-group-fields,.score-preferences-panel) label{color:var(--site-muted);font-size:13px;line-height:1.5}
.drums-workshop :is(.chain-view-toolbar,.chain-menu,.print-group-fields) label:has(select){display:grid;gap:6px;align-items:center}
.drums-workshop .chain-menu select{display:block;width:100%;margin-top:6px}
.drums-workshop .chain-view-toolbar :is(#chain-style,#chain-repeats){width:100%;max-width:270px;min-height:44px;border:0;border-radius:6px;background:var(--workshop-sage);color:var(--site-ink);font-size:15px}
.drums-workshop #chain-style-label{display:grid;margin-left:0}
.drums-workshop .sequence-title input,.drums-workshop .chain-menu>input,.drums-workshop .chain-menu textarea{background:var(--workshop-sage);border:0;border-radius:6px}
.drums-workshop .chain-repeat-controls input{width:80px;background:var(--workshop-sage);border:0}
.drums-workshop .print-settings-pane .print-group-fields select{min-height:44px;padding:10px 12px;font-size:15px;background:var(--workshop-sage);border:0}
.drums-workshop label:has(input[type=checkbox]){display:flex;align-items:center;gap:8px;min-height:36px}
.drums-workshop input[type=checkbox]{appearance:none;-webkit-appearance:none;box-sizing:border-box;position:relative;flex:none;width:34px;height:20px;min-width:34px;min-height:20px;max-width:34px;margin:0;padding:0;border:0;border-radius:12px;background:#c9cec9;cursor:pointer}
.drums-workshop input[type=checkbox]::after{content:'';position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .15s}
.drums-workshop input[type=checkbox]:checked{background:var(--workshop-green)}
.drums-workshop input[type=checkbox]:checked::after{transform:translateX(14px)}
.drums-workshop :is(select,input,textarea):focus-visible{outline:2px solid var(--workshop-green);outline-offset:3px}
.drums-workshop :is(select,input,textarea):disabled{opacity:.5;cursor:default}
.drums-workshop :is(select,input,textarea)[aria-invalid=true]{outline:2px solid var(--workshop-amber);outline-offset:2px}
html[data-drums-theme=dark] .drums-workshop :is(select,textarea,input[type=text],input[type=number]):not(#tempo){background:var(--workshop-sage);color:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop input[type=checkbox]{background:#64736a}
html[data-drums-theme=dark] .drums-workshop input[type=checkbox]:checked{background:var(--workshop-green)}
@media(pointer:coarse),(max-width:600px){.drums-workshop :is(select,input[type=number],input[type=text],textarea):not(#tempo),.drums-workshop .chain-view-toolbar :is(#chain-style,#chain-repeats),.drums-workshop .print-settings-pane .print-group-fields select{font-size:16px}}
/* SVG geometry must not enlarge the page's layout viewport during rotation. */
.drums-workshop .chain-paper,.drums-workshop .chain-system-canvas{width:100%;contain:inline-size;min-width:0;max-width:100%;box-sizing:border-box}
.drums-workshop .chain-bar-hit{touch-action:manipulation}
@media(pointer:coarse),(max-width:600px){.drums-workshop.mobile-workshop #score-panel{padding-right:0}.drums-workshop.mobile-workshop #score-panel>.score-zoom{position:static;margin:4px 0 0 auto}.drums-workshop.mobile-workshop #score-viewport{width:100%;max-width:100%}}

/* Chain workshop: transport stays in place; presentation lives in a popover. */
.drums-workshop .chain-header{display:flex;align-items:center;justify-content:space-between;gap:12px 24px;flex-wrap:wrap}
.drums-workshop .chain-header h2{min-width:0;max-width:100%;flex:1 1 190px;margin:0}
.drums-workshop #sequence-rename{display:flex;align-items:center;gap:8px;max-width:100%;min-height:44px;border:0;padding:0;background:transparent;font-size:20px;font-weight:500;text-align:left}
.drums-workshop #sequence-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drums-workshop #sequence-rename svg{width:17px;height:17px;flex:none;color:var(--site-muted)}
.drums-workshop .sequence-toolbar{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap}
.drums-workshop #sequence-play{display:flex;align-items:center;justify-content:center;gap:8px;width:126px;min-width:126px;height:44px;padding:8px;font-size:15px;white-space:nowrap}
.drums-workshop #sequence-play svg{width:18px;height:18px;flex:none}
.drums-workshop .chain-icon-button{display:flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:10px;background:transparent;border:0;color:var(--site-muted)}
.drums-workshop .chain-icon-button svg{width:22px;height:22px;flex:none}
.drums-workshop #sequence-undo{margin:0}
.drums-workshop .chain-tempo{display:flex;align-items:center;gap:4px;font-size:12px;white-space:nowrap}
.drums-workshop .chain-tempo #sequence-tempo{width:52px;height:44px;padding:6px;text-align:center;font-size:18px}
.drums-workshop .chain-loop{font-size:13px;white-space:nowrap}
.drums-workshop .chain-view-toolbar{margin-top:12px;padding-top:12px;gap:10px;align-items:center}
.drums-workshop #chain-view-toggle{max-width:100%;min-height:44px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--workshop-sage);border:0}
.drums-workshop .chain-view-toolbar .print-dialog-open{width:auto;min-height:44px;margin:0 0 0 auto;padding:8px 12px;font-size:14px;order:3}
.drums-workshop #sequence-clear{order:4}
.drums-workshop #sequence-status{height:24px;min-height:24px;margin:4px 0 12px;line-height:24px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--site-muted)}
/* Keep the live region mounted, without reserving a blank message line. */
.drums-workshop #sequence-status:empty{height:0;min-height:0;margin:0}
.drums-workshop .chain-help{margin:8px 0 0;font-size:12px;color:var(--site-muted)}
.drums-workshop .chain-help>summary{cursor:pointer;line-height:20px}
.drums-workshop .chain-help .hint{margin:8px 0}
.drums-workshop .chain-paper{overflow-anchor:none}
.drums-workshop .chain-menu{max-height:calc(100dvh - 16px);overscroll-behavior:contain;overflow-anchor:none;scroll-padding-top:54px}
.drums-workshop .chain-menu .chain-menu-heading{position:sticky;top:-16px;z-index:2;margin:-16px -16px 12px;padding:10px 16px;background:var(--workshop-paper);border-bottom:1px solid var(--site-line)}
.drums-workshop .chain-menu-heading button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;font-size:26px;background:transparent;border:0;flex:none}
.drums-workshop .chain-menu-subtitle{margin:0 0 12px;font-size:13px;color:var(--site-muted);overflow-wrap:anywhere}
.drums-workshop .chain-move-block{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;color:var(--site-muted);font-size:13px}
.drums-workshop .chain-move-controls{display:flex;gap:8px}
.drums-workshop .chain-move-controls button{min-width:44px;min-height:44px;font-size:20px;padding:6px}
.drums-workshop .chain-repeat-controls{display:flex;align-items:center;gap:8px}
.drums-workshop .chain-menu .chain-copy-submit{width:auto;flex:1;min-height:44px;margin:0!important;text-align:center;font-size:14px}
.drums-workshop .chain-menu .chain-repeat-controls input{width:80px;height:44px}
.drums-workshop .chain-source-details{margin:12px 0;border-top:1px solid var(--site-line);padding-top:8px;font-size:13px;color:var(--site-muted)}
.drums-workshop .chain-source-details summary{min-height:44px;line-height:44px;cursor:pointer}
.drums-workshop .chain-source-info{margin:4px 0 10px;line-height:1.6}
.drums-workshop .chain-source-details button{min-height:44px;width:100%;text-align:left;font-size:13px}
.drums-workshop .chain-menu .chain-delete-bar{margin-top:12px;padding-top:12px;border-width:1px 0 0;border-radius:0;background:transparent}
.drums-workshop .chain-view-menu select{width:100%}
.drums-workshop .chain-title-dialog{box-sizing:border-box;width:360px;max-width:calc(100vw - 24px);padding:20px;border:1px solid var(--site-line);border-radius:10px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-title-dialog::backdrop{background:#0005}
.drums-workshop .chain-title-dialog label{display:grid;gap:8px;font-size:13px;color:var(--site-muted)}
.drums-workshop .chain-title-dialog input{width:100%}
.drums-workshop .chain-title-dialog form>button{margin-top:16px;min-height:44px}
@media(max-width:600px){
 .drums-workshop .chain-header{display:block}
 .drums-workshop .chain-header h2{margin-bottom:8px}
 .drums-workshop .sequence-toolbar{display:grid;grid-template-columns:110px 44px minmax(0,1fr);gap:8px}
 .drums-workshop #sequence-play{width:110px;min-width:110px;font-size:14px;gap:6px}
 .drums-workshop .chain-loop{grid-column:1/-1;margin-top:4px}
 .drums-workshop .chain-tempo{justify-content:flex-end}
 .drums-workshop .chain-tempo #sequence-tempo{font-size:16px;width:48px}
 .drums-workshop .chain-view-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px}
 .drums-workshop .chain-view-toolbar .mode-switch{grid-column:1/-1;width:100%;display:grid;grid-template-columns:1fr 1fr}
 .drums-workshop #chain-view-toggle{width:100%;text-align:left;order:1}
 .drums-workshop #sequence-clear{order:2;justify-self:end}
 .drums-workshop .chain-view-toolbar .print-dialog-open{grid-column:1/-1;width:100%;margin:0;order:3}
}
@media(pointer:coarse) and (orientation:landscape){.drums-workshop .chain-header h2{flex-basis:180px}.drums-workshop .chain-loop{white-space:normal}.drums-workshop .chain-menu{overscroll-behavior:contain}}
@media(prefers-reduced-motion:reduce){.drums-workshop input[type=checkbox]::after{transition:none}}

.drums-workshop #sequence-play[aria-busy=true]{font-size:12px}

/* Transport and tempo share the established constructor treatment. */
.drums-workshop #play,.drums-workshop #sequence-play{display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;width:142px;min-width:142px;max-width:100%;height:44px;min-height:44px;padding:8px 12px;font-size:16px;white-space:nowrap;border:1px solid var(--workshop-green);border-radius:5px;background:var(--workshop-green);color:#fff}
.drums-workshop #sequence-play::before{content:'';width:0;height:0;background:transparent;border:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:8px solid currentColor;margin:0;flex:none}
.drums-workshop #sequence-play[aria-pressed=true]::before{width:10px;height:10px;border:0;background:currentColor}
.drums-workshop #play[aria-busy=true],.drums-workshop #sequence-play[aria-busy=true]{font-size:12px}
.drums-workshop .chain-tempo{display:flex;align-items:center;gap:6px;font-size:14px;white-space:nowrap}
.drums-workshop .chain-tempo #sequence-tempo{border:0;background:transparent;color:var(--site-ink);font-size:22px;line-height:1.4;text-align:center;width:56px;height:44px;padding:6px 0;appearance:textfield}
.drums-workshop #sequence-tempo::-webkit-inner-spin-button,.drums-workshop #sequence-tempo::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.drums-workshop .chain-tempo .tempo-step{border:0;border-radius:5px;background:var(--workshop-sage);color:var(--workshop-green);font-size:22px;width:36px;min-width:36px;height:44px;padding:4px}
.drums-workshop .chain-clear-dialog{box-sizing:border-box;width:440px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:24px;border:1px solid var(--site-line);border-radius:10px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-clear-dialog::backdrop{background:#0005}
.drums-workshop .chain-clear-dialog h2{font-size:20px;margin:0 0 12px}
.drums-workshop .chain-clear-dialog p{font-size:15px;line-height:1.6;margin:0 0 20px;color:var(--site-muted)}
.drums-workshop .chain-clear-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.drums-workshop .chain-clear-actions button{min-height:44px}
/* Score bounds do not reserve a column or strip for the loupe. */
.drums-workshop .unified-desktop #score-panel,.drums-workshop.mobile-workshop #score-panel,.drums-workshop #score-panel{position:relative;padding-right:0;padding-left:0;padding-bottom:0}
.drums-workshop #score-panel>#score-zoom,.drums-workshop .unified-desktop #score-zoom,.drums-workshop.mobile-workshop #score-panel>.score-zoom{position:absolute;right:0;bottom:0;top:auto;margin:0;width:44px;height:44px;padding:10px;border:0;background:transparent;z-index:2}
.drums-workshop #score-viewport{width:100%;max-width:100%}
html[data-drums-theme=dark] .drums-workshop .chain-tempo #sequence-tempo{background:transparent;color:var(--site-ink)}
html[data-drums-theme=dark] .drums-workshop .chain-tempo .tempo-step{background:var(--workshop-sage);color:var(--workshop-green)}
html[data-drums-theme=dark] .drums-workshop :is(#play,#sequence-play){background:#4d745b;color:#f3f6f3;border-color:#4d745b}
@media(max-width:600px){
 .drums-workshop #play,.drums-workshop #sequence-play{width:142px;min-width:0;justify-self:start}
 .drums-workshop .sequence-toolbar{grid-template-columns:minmax(0,142px) 44px}
 .drums-workshop .chain-tempo{grid-column:1/-1;justify-content:flex-start;gap:6px}
 .drums-workshop .chain-tempo #sequence-tempo{width:46px;font-size:20px}
 .drums-workshop .chain-tempo .tempo-step{width:32px;min-width:32px}
 .drums-workshop .chain-loop{grid-column:1/-1}
}
@media(max-width:360px){.drums-workshop #play,.drums-workshop #sequence-play{width:110px;padding:8px}.drums-workshop #play[aria-busy=true],.drums-workshop #sequence-play[aria-busy=true]{font-size:11px}.drums-workshop .chain-tempo .tempo-step{width:28px;min-width:28px}}
.drums-workshop #sequence-play:hover{background:#294936}

/* Common tempo: the number stays editable; no layout space depends on digits. */
.drums-workshop .tempo-control{display:inline-flex;align-items:center;justify-content:flex-start;flex:none;gap:4px;box-sizing:border-box;height:44px;min-height:44px;width:212px;min-width:212px;padding:0;border:0;border-radius:6px;background:var(--workshop-sage);color:var(--site-ink);white-space:nowrap}
.drums-workshop .tempo-control .tempo-step{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--workshop-green);font-family:inherit;font-size:22px;line-height:1}
.drums-workshop .tempo-control :is(#tempo,#sequence-tempo){box-sizing:border-box;flex:0 0 56px;width:56px;min-width:56px;max-width:56px;height:44px;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;color:var(--site-ink);font-family:inherit;font-size:22px;font-weight:400;font-variant-numeric:tabular-nums;line-height:44px;text-align:center;appearance:textfield;touch-action:pan-y pinch-zoom}
.drums-workshop .tempo-control input::-webkit-inner-spin-button,.drums-workshop .tempo-control input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.drums-workshop .tempo-control .tempo-unit{display:block;flex:0 0 24px;width:24px;font:400 24px/1 Georgia,serif;text-align:center;color:var(--site-ink)}
.drums-workshop .tempo-control .tempo-bpm{display:block;flex:0 0 28px;width:28px;font:400 12px/1 Arial,Roboto,sans-serif;color:var(--site-muted)}
.drums-workshop .tempo-control .tempo-dragging{user-select:none;-webkit-user-select:none;cursor:ew-resize}
.drums-workshop .tempo-control .tempo-step:hover{background:var(--site-line)}
html[data-drums-theme=dark] .drums-workshop .tempo-control :is(#tempo,#sequence-tempo),html[data-drums-theme=dark] .drums-workshop .tempo-control .tempo-step{background:transparent}
/* Score width and height belong entirely to notation, not the loupe. */
.drums-workshop .unified-desktop #score-panel,.drums-workshop.mobile-workshop #score-panel,.drums-workshop #score-panel{position:relative;min-width:0;max-width:100%;padding-right:0;padding-left:0;padding-bottom:0;contain:inline-size}
.drums-workshop #score-panel>#score-zoom,.drums-workshop .unified-desktop #score-zoom,.drums-workshop.mobile-workshop #score-panel>.score-zoom{position:absolute;right:4px;bottom:4px;top:auto;margin:0;flex:none;width:44px;min-width:44px;height:44px;padding:13px;border:0;background:transparent;z-index:2}
.drums-workshop #score-zoom svg{display:block;width:18px;height:18px}
.drums-workshop #score-viewport,.drums-workshop #notation{min-width:0;max-width:100%;width:100%}
.drums-workshop .notation-footer{display:flex;align-items:flex-start;flex-wrap:wrap;gap:0 12px}
.drums-workshop .notation-footer :is(.notation-help,.desktop-instrument-picker){flex:1 1 auto;min-width:0;width:auto;margin:0}
.drums-workshop .notation-footer :is(.notation-help,.desktop-instrument-picker)>summary{box-sizing:border-box;display:flex;align-items:center;min-height:44px;padding:0;line-height:1.4}
.drums-workshop .notation-footer #score-zoom{position:static;order:3;margin:0 0 0 auto;flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:13px}
@media(max-width:600px){
 .drums-workshop .toolbar{display:flex;flex-wrap:wrap;gap:8px 12px}
 .drums-workshop .toolbar #play{flex:none;width:142px;min-width:142px}
 .drums-workshop .toolbar .tempo-control{margin-left:auto}
 .drums-workshop .sequence-toolbar{display:flex;flex-wrap:wrap;gap:8px}
 .drums-workshop .sequence-toolbar .chain-loop{flex-basis:100%}
 .drums-workshop .sequence-toolbar #sequence-play{flex:none}
 .drums-workshop .notation-footer .desktop-instrument-picker>summary{justify-content:flex-start}
}

/* Keep transport pairs together; compact secondary controls have their own row. */
.drums-workshop .constructor-transport,.drums-workshop .constructor-options{display:contents}
.drums-workshop .sequence-transport{display:inline-flex;align-items:center;flex:none;gap:8px}
@media(max-width:600px),(pointer:coarse) and (max-width:1100px){
 .drums-workshop .toolbar{display:flex;flex-direction:column;align-items:stretch;gap:8px;min-width:0}
 .drums-workshop .constructor-transport{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;width:100%}
 .drums-workshop .constructor-options{display:flex;align-items:center;gap:8px;min-width:0;width:100%}
 .drums-workshop .constructor-options .meter-picker{flex:none;margin:0}
 .drums-workshop .constructor-options .metronome-control{flex:1;justify-content:center;min-width:0;min-height:44px;font-size:13px;white-space:nowrap;margin:0}
 .drums-workshop .constructor-options .score-preferences{flex:0 0 44px;margin:0}
 .drums-workshop .toolbar #play,.drums-workshop #sequence-play{flex:0 0 96px;width:96px;min-width:96px;max-width:96px;height:44px;min-height:44px;padding:6px;gap:6px;font-size:14px}
 .drums-workshop .toolbar #play[aria-busy=true],.drums-workshop #sequence-play[aria-busy=true]{font-size:10px}
 .drums-workshop .tempo-control{flex:0 0 196px;width:196px;min-width:196px;max-width:196px;gap:0;margin:0}
 .drums-workshop .toolbar .tempo-control{margin-left:0}
 .drums-workshop .sequence-toolbar{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px;min-width:0;width:100%}
 .drums-workshop .sequence-toolbar .chain-loop{flex:0 0 100%;margin-top:0;white-space:normal}
}

/* A non-editable readout owns dragging; the input exists only during editing. */
.drums-workshop .tempo-control .tempo-value{display:block;flex:0 0 56px;width:56px;min-width:56px;height:44px}
.drums-workshop .tempo-control .tempo-readout{display:block;box-sizing:border-box;width:56px;min-width:56px;max-width:56px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--site-ink);font-family:inherit;font-size:22px;font-weight:400;font-variant-numeric:tabular-nums;line-height:44px;text-align:center;touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:ew-resize}
.drums-workshop .tempo-control .tempo-readout:hover{background:transparent}
.drums-workshop .tempo-control .tempo-readout.tempo-dragging{background:var(--site-line)}
@media(max-width:600px),(pointer:coarse) and (max-width:1100px){
 .drums-workshop .tempo-control{width:188px;min-width:188px;max-width:188px;flex-basis:188px;gap:0}
 .drums-workshop .tempo-control .tempo-unit{width:16px;flex-basis:16px}
 .drums-workshop #sequence-play{width:80px;min-width:80px;max-width:80px;flex-basis:80px;padding:3px;gap:4px}
 .drums-workshop .sequence-transport{gap:4px}
 .drums-workshop .sequence-toolbar{column-gap:4px;row-gap:4px}
 .drums-workshop .sequence-toolbar .chain-loop{display:inline-flex;align-items:center;flex:0 1 auto;gap:6px;width:auto;min-width:0;min-height:44px;margin:0;padding:0}
 .drums-workshop .chain-view-toolbar{margin-top:6px;padding-top:6px;gap:8px}
}
/* Section controls and temporary range tools do not occupy the transport panel. */
.drums-workshop .chain-section-heading{display:block;min-height:44px;padding:6px 10px;margin:0 0 4px;background:transparent;border:0;text-align:left;font-size:16px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}
.drums-workshop .chain-bar-hit{touch-action:pan-y}
.drums-workshop .chain-bar-hit[data-range-selected=true]{background:color-mix(in srgb,var(--workshop-hit) 26%,transparent)!important;box-shadow:inset 0 0 0 2px var(--workshop-green)}
.drums-workshop .chain-bar-hit[data-range-destination=true]{box-shadow:inset 0 0 0 3px var(--workshop-amber)}
.drums-workshop .chain-range-actions{position:fixed;z-index:1190;box-sizing:border-box;width:480px;max-width:calc(100vw - 16px);padding:10px;display:flex;gap:6px;flex-wrap:wrap;background:var(--workshop-paper);color:var(--site-ink);border:1px solid var(--site-line);border-radius:8px;box-shadow:0 8px 24px #0002;overflow:auto;overscroll-behavior:contain}
.drums-workshop .chain-range-actions[hidden]{display:none}
.drums-workshop .chain-range-actions strong{flex-basis:100%;font-size:13px;font-weight:500}
.drums-workshop .chain-range-actions button{min-height:44px;padding:8px;font-size:13px}
.drums-workshop .chain-group-menu>strong{display:block;font-size:14px;overflow-wrap:anywhere}
.drums-workshop .chain-group-dialog{box-sizing:border-box;width:440px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:24px;border:1px solid var(--site-line);border-radius:10px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-group-dialog::backdrop{background:#0007}
.drums-workshop .chain-group-dialog h2{font-size:18px;margin:0 0 12px}
.drums-workshop .chain-group-dialog p{font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.drums-workshop .chain-group-dialog label{display:grid;gap:8px;font-size:14px}
.drums-workshop .chain-group-dialog input{box-sizing:border-box;min-height:44px;width:100%;font:inherit;padding:8px;background:var(--workshop-sage);color:var(--site-ink);border:0;border-radius:6px}
.drums-workshop .chain-empty-paste{margin-top:12px;min-height:44px}
@media(max-width:600px){.drums-workshop .chain-group-dialog input{font-size:16px}.drums-workshop .chain-group-dialog{padding:18px}.drums-workshop .chain-range-actions{width:calc(100vw - 16px)}}


.drums-workshop .chain-insertion-menu{box-sizing:border-box;padding:10px}
.drums-workshop .chain-insertion-menu .chain-menu-heading{position:static;margin:0 0 6px;padding:0;border:0;font-size:13px;line-height:1.4}
.drums-workshop .chain-insertion-menu .chain-menu-heading strong{overflow-wrap:anywhere}
.drums-workshop .chain-insertion-choices{display:flex;gap:8px}
.drums-workshop .chain-insertion-choices button{flex:1;min-height:44px;padding:8px;font-size:14px}
/* Party operations share the Constructor's existing controls and palette. */
.drums-workshop .editor-playback-group{display:inline-flex;align-items:center;gap:4px;flex:none}
.drums-workshop :is(#editor-undo,#editor-redo){box-sizing:border-box;flex:none;margin:0}
.drums-workshop :is(#editor-undo,#editor-redo):disabled{opacity:.4}
.drums-workshop .part-instrument-menu{z-index:80;overflow:auto;overscroll-behavior:contain}
.drums-workshop .part-instrument-menu button{min-height:44px;white-space:normal;text-align:left}
.drums-workshop .part-instrument-menu .part-clear-action{border-top:1px solid var(--site-line);margin-top:6px}
.drums-workshop .part-paste-dialog{box-sizing:border-box;width:520px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--site-line);border-radius:10px;background:var(--workshop-paper);color:var(--site-ink);overflow:auto;overscroll-behavior:contain}
.drums-workshop .part-paste-dialog::backdrop{background:#0007}
.drums-workshop .part-paste-heading{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;justify-content:space-between;padding:12px 16px;background:var(--workshop-paper);border-bottom:1px solid var(--site-line)}
.drums-workshop .part-paste-heading h2{margin:0;font-size:18px;font-weight:500;line-height:1.4}
.drums-workshop .part-paste-heading button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;font-size:26px}
.drums-workshop .part-paste-body{display:grid;gap:14px;padding:16px}
.drums-workshop .part-paste-body p{margin:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.drums-workshop .part-paste-body label{display:grid;gap:6px;font-size:14px;color:var(--site-muted)}
.drums-workshop .part-paste-body select{box-sizing:border-box;width:100%;min-height:44px;padding:8px;font:inherit;border:0;border-radius:6px;background:var(--workshop-sage);color:var(--site-ink)}
.drums-workshop .part-paste-mode{display:flex;gap:12px;flex-wrap:wrap;margin:0;padding:10px;border:1px solid var(--site-line);border-radius:6px}
.drums-workshop .part-paste-mode[hidden]{display:none}
.drums-workshop .part-paste-mode legend{font-size:13px;color:var(--site-muted)}
.drums-workshop .part-paste-mode label{display:flex;align-items:center;gap:8px;min-height:44px}
.drums-workshop .part-paste-mode input{width:20px;height:20px;accent-color:var(--workshop-green)}
.drums-workshop .part-paste-actions{position:sticky;bottom:0;display:flex;gap:10px;justify-content:flex-end;padding:12px 16px;background:var(--workshop-paper);border-top:1px solid var(--site-line)}
.drums-workshop .part-paste-actions button{min-height:44px;min-width:100px}
.drums-workshop .part-instrument-options{display:grid;gap:6px}
.drums-workshop .part-instrument-option{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;line-height:1.4}
.drums-workshop .part-instrument-option span{min-width:0;overflow-wrap:anywhere}
.drums-workshop label.part-instrument-option{justify-content:flex-start;min-height:44px}
@media(max-width:600px),(pointer:coarse) and (max-width:1100px){.drums-workshop .constructor-transport{gap:8px 4px}.drums-workshop .part-paste-body select{font-size:16px}.drums-workshop .part-paste-heading h2{font-size:16px}}

.drums-workshop .desktop-instrument-picker .instrument-options.part-instrument-options{grid-template-columns:minmax(0,1fr)}

/* Shared spacing for section dialogs; other application dialogs are unchanged. */
.drums-workshop .chain-group-dialog .chain-dialog-heading{display:flex;align-items:flex-start;gap:12px;position:sticky;top:0;background:var(--workshop-paper);z-index:1;margin-bottom:12px}
.drums-workshop .chain-group-dialog .chain-dialog-heading h2{flex:1;margin:10px 0;overflow-wrap:anywhere}
.drums-workshop .chain-group-dialog .chain-dialog-close{width:44px;min-width:44px;height:44px;padding:0;border:0;background:transparent;font-size:25px;color:var(--site-muted)}
.drums-workshop .chain-group-dialog .chain-clear-actions{margin-top:16px}

/* Music scaling controls stay outside the scaled SVG geometry. */
.drums-workshop .note-scale-control{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:100%;font-size:13px;color:var(--site-muted)}
.drums-workshop .note-scale-buttons{display:inline-flex;align-items:center;flex:none;gap:4px}
.drums-workshop .note-scale-buttons button{box-sizing:border-box;min-width:44px;min-height:44px;padding:6px;border:1px solid var(--site-line);background:var(--workshop-paper);color:var(--site-ink);font-size:14px;line-height:1.3}
.drums-workshop .note-scale-buttons button:disabled{opacity:.4;cursor:default}
.drums-workshop .pdf-scale-summary{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px 16px;min-width:0;width:100%}
.drums-workshop .pdf-page-count{font-size:13px;color:var(--site-muted);white-space:nowrap}
.drums-workshop .print-dialog-header{flex-wrap:wrap}
.drums-workshop .chain-system-canvas[data-note-scaled=true]{max-width:none;contain:none}
.drums-workshop .chain-rhythm .sequence-score{overflow-x:auto}
.drums-workshop #notation>svg[data-note-scale]:not([data-note-scale="1"]){flex:none;max-width:none!important}
.drums-workshop .score-dialog[data-note-scaled=true] #score-viewport{overflow:auto;display:block}
.drums-workshop .score-dialog[data-note-scaled=true] #notation{display:block;height:auto!important;min-height:0}
.drums-workshop .score-dialog[data-note-scaled=true] #notation>svg{width:var(--screen-score-width)!important;height:auto!important;max-width:none!important;max-height:none!important}
@media(max-width:600px){.drums-workshop .note-scale-control{flex:none}.drums-workshop .pdf-scale-summary{justify-content:flex-start}}

/* Left-aligned scroll content keeps the first notes reachable when it overflows. */
.drums-workshop .unified-desktop #score-viewport #notation[data-note-scaled=true]{display:block}
.drums-workshop #notation>svg[data-note-scale]:not([data-note-scale="1"]),.drums-workshop #notation>svg[data-min-hit-size]{flex:none;max-width:none!important;max-height:none!important}
/* A fixed interaction lane keeps the selected-bar action clear of musical ink. */
.drums-workshop .chain-bar-selection-toolbar{position:relative;height:48px;flex:none}
.drums-workshop .chain-bar-more{position:absolute;top:2px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;font-size:24px;z-index:2;background:var(--workshop-paper);color:var(--workshop-green);border:1px solid var(--site-line)}
.drums-workshop .chain-bar-hit[data-selected=true]{box-shadow:inset 0 0 0 2px var(--workshop-green)}
/* Instrument-menu selection is amber; listening toggles keep their green state. */

.drums-workshop .editor .instrument-label[data-instrument-menu-selected=true]{background:transparent}
.drums-workshop .instrument-menu-title{display:block;padding:6px 8px;font-size:14px;line-height:1.4;color:var(--site-ink);overflow-wrap:anywhere}
.drums-workshop .instrument-menu .instrument-menu-title{order:-1}
.drums-workshop .instrument-audio-toggle[aria-pressed=true],.drums-workshop .editor :is(.mute-button,.solo-button)[aria-pressed=true]{background:var(--workshop-sage);color:var(--workshop-green);border-color:var(--workshop-green)}
.drums-workshop .instrument-audio-toggle[aria-pressed=true]::after{content:' ✓';float:right}
.drums-workshop .part-instrument-menu .instrument-audio-toggle:disabled,.drums-workshop .editor .mute-button:disabled{opacity:.65;cursor:default}
.drums-workshop .editor-listening-status{margin:8px 0;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}

.drums-workshop .instrument-menu{background:var(--workshop-paper);color:var(--site-ink)}

/* Explicit source append stays in the existing action window. */
.drums-workshop .chain-append-form label{display:grid;gap:6px}
.drums-workshop .chain-append-form input{width:100%;min-width:0;min-height:44px;font:inherit;padding:8px;border:1px solid var(--site-line);border-radius:8px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-append-form select{width:100%;min-width:0;min-height:44px}
.drums-workshop .chain-append-form[hidden]{display:none}
/* Stage 4a: scale belongs to the existing toolbar; the group wraps as a unit. */
.drums-workshop .editor-score-toolbar{flex-wrap:wrap;align-items:center;gap:8px 12px}
.drums-workshop .editor-score-toolbar .note-scale-control{order:0;margin-left:auto}
.drums-workshop .editor-score-toolbar .desktop-editor-actions{order:1;margin-left:0}
.drums-workshop .note-scale-control{position:relative;flex:none;flex-wrap:nowrap;gap:6px;margin:0;max-width:100%}
.drums-workshop .note-scale-value{display:inline-flex;width:64px;flex:none}
.drums-workshop .note-scale-value button,.drums-workshop .note-scale-value input{box-sizing:border-box;width:64px;min-width:0;min-height:44px;margin:0;padding:6px;text-align:center;font-size:14px;font-variant-numeric:tabular-nums;border:1px solid var(--site-line);background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .note-scale-value [hidden]{display:none!important}
.drums-workshop .note-scale-value input[aria-invalid=true]{border-color:#bb5750}
.drums-workshop .note-scale-error{position:absolute;top:100%;right:0;z-index:4;width:260px;max-width:80vw;padding:6px;background:var(--workshop-paper);border:1px solid var(--site-line);color:var(--site-ink);font-size:12px}
@media(max-width:600px){.drums-workshop .editor-score-toolbar .note-scale-control{margin-left:0}.drums-workshop .note-scale-control{flex-shrink:0}.drums-workshop .pdf-scale-summary{flex-wrap:wrap}}

.drums-workshop .note-scale-control>span:first-child{min-width:0;flex-shrink:1}
.drums-workshop .note-scale-value button{user-select:none;cursor:ew-resize}
.drums-workshop .score-dialog-heading:has(.note-scale-control){height:auto;min-height:44px;flex:0 0 auto;flex-wrap:wrap}
@media(max-width:600px){.drums-workshop .chain-view-toolbar>.note-scale-control{grid-column:1/-1;order:3;justify-self:start}.drums-workshop .chain-view-toolbar .print-dialog-open{order:4}}

@media(max-width:600px){.drums-workshop .note-scale-value input{font-size:16px}}

/* View controls retain the existing popovers and their layer/focus boundary. */
.drums-workshop .score-preferences-toggle{width:auto;min-width:44px;padding:8px 12px;font-size:14px}
.drums-workshop .chain-view-menu>button{min-height:44px;width:100%;text-align:left;white-space:normal}
.drums-workshop .chain-view-menu .hint{line-height:1.5;font-size:12px}

/* Acceptance fixes: stable scale controls and matching action baselines. */
.drums-workshop .editor-score-toolbar .desktop-editor-actions{margin-bottom:0}
.drums-workshop .pdf-scale-summary{justify-content:flex-start}
.drums-workshop .pdf-page-count{flex:1;min-width:0;font-variant-numeric:tabular-nums}
.drums-workshop #sequence-redo{margin:0}

/* Closing package 1: compact actions and neutral, consistent count fields. */
.drums-workshop #score-preferences-toggle{background:var(--workshop-sage);border:0;min-height:44px;font-size:14px;color:var(--site-ink)}
.drums-workshop .desktop-editor-actions .editor-clear-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:10px}
.drums-workshop .editor-clear-icon svg{width:22px;height:22px;flex:none}
.drums-workshop .chain-count-control{display:flex;align-items:center;gap:8px;max-width:100%;min-width:0}
.drums-workshop #chain-menu .chain-count-control input{box-sizing:border-box;flex:1;width:64px;min-width:0;height:44px;text-align:center;font:inherit;padding:8px;border:1px solid var(--site-line);border-radius:6px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-count-control button{flex:none;width:44px;min-width:44px;min-height:44px;margin:0;padding:6px;background:var(--workshop-paper);color:var(--site-ink)}
.drums-workshop .chain-count-control button:disabled{opacity:.4;cursor:default}
.drums-workshop .chain-bar-copies .chain-repeat-controls{flex-wrap:wrap}
.drums-workshop .chain-bar-copies .chain-count-control{flex:1 0 100%}
.drums-workshop .chain-menu .chain-copy-submit{background:var(--workshop-paper)!important;border:1px solid var(--site-line);color:var(--site-ink)}
.drums-workshop #chain-menu .chain-bar-visibility select{background:var(--workshop-paper);color:var(--site-ink);border:1px solid var(--site-line)}
.drums-workshop .chain-bar-visibility,.drums-workshop .chain-bar-operations,.drums-workshop .chain-source-details{border-top:1px solid var(--site-line);padding-top:16px;margin-top:16px}
.drums-workshop .chain-source-details{border-bottom:1px solid var(--site-line);padding-bottom:16px}
.drums-workshop .chain-source-details summary{font-weight:500;color:var(--site-ink)}
.drums-workshop .chain-bar-operations>button{display:block;width:100%;min-height:44px;margin:6px 0;text-align:left;font-size:13px}
.drums-workshop .chain-menu .chain-delete-bar{margin-top:16px;padding:12px;border:1px solid var(--site-line);border-radius:6px;background:transparent;color:#a63a32}
.drums-workshop .chain-menu .chain-delete-bar:hover{background:color-mix(in srgb,#b54840 12%,var(--workshop-paper));border-color:currentColor}
.drums-workshop .chain-menu .chain-delete-bar:focus-visible{outline:2px solid currentColor;outline-offset:3px;background:color-mix(in srgb,#b54840 12%,var(--workshop-paper))}
html[data-drums-theme=dark] .drums-workshop .chain-menu .chain-delete-bar{color:#f09b91}

/* One rounded background sits behind the complete instrument row. */
.drums-workshop .editor :is(.grid,.beat-grid){position:relative;isolation:isolate}
.drums-workshop .editor :is(.grid,.beat-grid)::before{content:'';position:absolute;z-index:-1;pointer-events:none;left:0;right:0;top:var(--instrument-row-top,0px);height:var(--instrument-row-height,0px);border-radius:6px;background:color-mix(in srgb,var(--workshop-amber) 12%,transparent)}

/* Section title and the reserved action lane share one row, without moving ink. */
.drums-workshop .chain-system:has(>.chain-section-heading){display:grid;grid-template-columns:minmax(0,1fr)}
.drums-workshop .chain-system>.chain-section-heading{grid-area:1/1;position:relative;z-index:1;justify-self:start;max-width:calc(100% - 52px)}
.drums-workshop .chain-system:has(>.chain-section-heading)>.chain-bar-selection-toolbar{grid-area:1/1;align-self:end}
.drums-workshop .chain-system:has(>.chain-section-heading)>.chain-system-canvas{grid-area:2/1}
