/* Shared full-screen Warm Graphite studio, including the offline iOS view. */
:root{--bg:#cfc4b5;--surface:#e3d9cb;--line:#b9aa97;--muted:#665b4f;--text:#302c27;--lime:#a94e38;--orange:#984028;--soft:#cbb5a2;--grid:#ece3d6;--grid-alt:#e6dccd;--four:#8a745d;--bar:#b0a08c;--half:#d5c9b9;--label-width:160px;color-scheme:light}
html,body{background:var(--bg);color:var(--text)}
main{width:100%;max-width:none;padding:18px 24px 32px}
html:not([data-native]) .topbar{padding:10px 24px;background:var(--surface);border-color:var(--line);min-height:64px}
.pattern-card,.filter-row,.search,dialog,.sound-card,.global-channel,.welcome-choices>button,.master-label,.effect-slot{background:var(--surface);border-color:var(--line);color:var(--text)}
.button,.icon-button,.card-open,.library-tabs button,.page-controls button,.note-toolbar select,.selection-actions select,.pad-transport select,.editor-utility button,.editor-options select,.track-tools button,.track-tools select,.track-tools input{background:var(--surface);border-color:var(--line);color:var(--text);border-radius:6px}
.button.primary,.library-tabs button[aria-pressed=true],.edit-mode button[aria-pressed=true],#save-variant.save-main{background:var(--lime);border-color:var(--lime);color:#fffaf3}
.sound-title,.sound-card h3,.global-channel h3{color:var(--text)}
.hint,.card-desc,.card-meta,.sound-volume,.sample-duration,.settings-caption,.grid-hint,.source-status{color:var(--muted)}
.name-input,.welcome-choices>button:hover,.filter-row:hover{background:var(--grid);border-color:var(--line)}
input[type=range]{accent-color:var(--lime)}
.pattern-list{grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}
.pattern-card{border-radius:10px;box-shadow:none}
.intro{padding:14px 0 20px}.intro h1{font-size:38px}
.workspace{grid-template-columns:190px minmax(0,1fr)}
#editor,#editor[open],html:not([data-native]) #editor,html[data-native] #editor{width:100%;max-width:100%;height:100dvh;max-height:100dvh;inset:0;margin:0;border:0;border-radius:0;padding:0 16px 16px 192px;overflow-y:auto;background:var(--bg)}
#editor>.dialog-head{position:sticky;top:0;z-index:7;min-height:64px;background:var(--surface);padding:10px 12px;margin:0 -16px 0 0;border-bottom:1px solid var(--line);gap:12px}
#editor-title{font:600 18px/1.25 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:0}
#editor>.dialog-head .eyebrow{font-size:11px;margin-bottom:3px;letter-spacing:.6px}
#editor>.dialog-head .icon-button{min-height:34px;width:34px;height:34px;border-radius:6px}
#save-variant.save-main{min-height:36px;border-radius:6px;padding:7px 11px;font-size:12px;max-width:160px}
#editor-description{display:none}
.studio-top-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:10px 0 8px;align-items:center}
.studio-top-controls>.transport{position:static;top:auto;box-shadow:none;border:0;border-radius:0;background:transparent;margin:0;padding:0;gap:8px;min-height:36px;flex-wrap:wrap}
.transport #play{min-width:100px;min-height:36px;font-size:13px;padding:6px 10px}
.tempo-group{border-color:var(--line);background:var(--surface);border-radius:6px;gap:2px}
.tempo-adjust{background:transparent;color:var(--text);min-height:34px;min-width:26px;padding:2px}
.tempo input{background:transparent;border:0;font-size:17px!important;width:49px;padding:4px;color:var(--text)}
.step-readout{font-size:11px;color:var(--muted);letter-spacing:0;margin-left:10px}
.studio-top-controls>.edit-actions{margin:0;gap:5px;flex-wrap:nowrap}
.edit-actions button{font-size:12px;min-height:34px;padding:6px 9px;flex:none}
.studio-top-controls>.source-status{grid-column:1/-1;margin:0;font-size:11px;line-height:1.4}
.editor-utility{margin:0;gap:5px;padding:0;border:0;justify-content:flex-start;background:transparent;flex-wrap:wrap}
.editor-utility label{font-size:12px}.editor-utility input{width:67px;background:var(--surface);border:1px solid var(--line);border-radius:5px;min-height:30px;padding:3px 5px;font-size:13px!important}
.editor-utility button{min-height:30px;font-size:12px;padding:3px 8px}
.editor-options{font-size:11px;margin:0;max-width:310px;justify-self:end}
.editor-options summary{min-height:32px;padding:6px 8px;color:var(--muted)}
.editor-options[open]{grid-column:1/-1;max-width:none;width:100%}
.length-controls{margin:3px 0;padding:5px;background:var(--surface)}
.editor-workspace{display:flex;flex-direction:column;gap:0;align-items:stretch}
.editor-timeline{width:100%;min-width:0}
.page-controls{margin:4px 0 6px;padding:0;min-height:32px;display:flex;align-items:center}
.page-controls strong{font-size:12px;font-weight:400;display:flex;align-items:center;gap:6px}
#view-steps{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:4px;min-height:30px;font-size:12px!important;color:var(--text)}
.page-controls button{font-size:18px;min-height:30px;height:30px;min-width:30px;padding:0}
#page-readout{color:var(--muted);font-size:11px}
.note-toolbar{margin:0 0 8px;gap:8px;justify-content:flex-start;font-size:12px}
.note-toolbar label{font-size:12px}.note-toolbar select{min-height:31px;font-size:12px!important;padding:3px 6px;max-width:170px}
.edit-mode{padding:2px;border-radius:6px;background:var(--surface)}
.edit-mode button{min-height:30px;font-size:12px;border-radius:4px;padding:4px 8px}
.table-scroll{border:1px solid var(--line);border-radius:6px;background:var(--grid);max-width:100%;overflow:auto;scrollbar-color:var(--line) var(--surface)}
#sequencer{width:calc(var(--timeline-width) + var(--label-width));padding:0;min-width:100%!important;--lane-height:36px}
.studio-ruler{display:grid;grid-template-columns:var(--label-width) var(--timeline-width);width:calc(var(--timeline-width) + var(--label-width));background:var(--surface);border-bottom:1px solid var(--line)}
.ruler-caption{position:sticky;left:0;z-index:4;display:flex;align-items:center;background:var(--surface);padding:5px 10px;font-size:11px;color:var(--muted);border-right:1px solid var(--line)}
.ruler-time{min-width:0}.phrase-numbers,.bar-numbers{display:flex;width:var(--timeline-width);font-size:11px;color:var(--muted)}
.phrase-numbers{border-bottom:1px solid var(--line);text-transform:uppercase;font-size:11px}
.phrase-numbers span{flex:none;padding:4px 6px;border-left:2px solid var(--four)}
.bar-numbers span{flex:none;padding:4px 6px;border-left:1px solid var(--bar)}
.bar-numbers .phrase-start{border-left:2px solid var(--four);color:var(--text)}
#sequencer .step-numbers{height:22px;background:var(--surface);border-color:var(--line)}
#sequencer .step-numbers span{font-size:11px;line-height:22px;border:0;color:var(--muted)}
#sequencer .studio-lane{display:grid;grid-template-columns:var(--label-width) var(--timeline-width);height:var(--lane-height);width:calc(var(--timeline-width) + var(--label-width));border-bottom:1px solid color-mix(in srgb,var(--line) 55%,transparent);background:var(--surface)}
#sequencer .lane-header{width:var(--label-width);height:var(--lane-height);max-width:none;position:sticky;left:0;gap:3px;padding:0 6px;background:var(--surface);border-right:1px solid var(--line);z-index:4}
#sequencer .track-selected .lane-header{background:var(--soft)}
#sequencer .lane-header .track-select{font-size:12px;min-height:32px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;gap:5px;color:var(--text)}
.track-select:before{height:15px;width:4px;border-radius:1px}
#sequencer .lane-header .lane-mute,#sequencer .lane-header .instrument-preview{min-width:25px;width:25px;min-height:30px;height:30px;background:transparent;color:var(--muted);font-size:15px;padding:0;border:0}
#sequencer .timeline{height:var(--lane-height);border:0;background-color:var(--grid);background-image:linear-gradient(to right,var(--four) 2px,transparent 2px),linear-gradient(to right,var(--bar) 1px,transparent 1px),linear-gradient(to right,var(--half) 1px,transparent 1px),linear-gradient(to right,var(--grid) 50%,var(--grid-alt) 50%);background-size:var(--four-bar-width) 100%,var(--bar-width) 100%,var(--half-bar-width) 100%,calc(var(--bar-width)*2) 100%}
.timeline:before{display:none}
#sequencer .note-block{top:calc((var(--lane-height) - 18px)/2);height:18px;min-height:18px;min-width:4px;border:0;border-radius:3px;box-shadow:none;font-size:0;line-height:1;touch-action:pan-x pan-y}
.note-block:before,.note-block.selected:after{display:none}
#sequencer .note-block.selected{outline:1px solid var(--text);outline-offset:2px;z-index:3}
.note-resize{display:none;position:absolute;right:0;top:0;bottom:0;width:9px;cursor:ew-resize;touch-action:none}
.note-block.selected .note-resize{display:block}
.note-resize:after{content:"";position:absolute;right:2px;top:3px;bottom:3px;width:2px;border-radius:1px;background:#fffaf3}
.playhead{background:var(--text);width:1.5px;box-shadow:none;z-index:5}
.grid-hint{margin:7px 0 9px;font-size:11px}
.editor-inspectors{padding:0;width:100%;min-width:0}
.note-inspector,#native-track-settings{border:1px solid var(--line);border-radius:6px;background:var(--surface);margin:4px 0 8px;padding:12px}
.note-inspector .section-top{margin-bottom:8px}.note-inspector h3{font-size:14px}
.note-inspector #selection-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 20px}
.note-inspector label{font-size:12px;margin:0}.note-inspector output{font-size:11px;color:var(--muted)}
.note-inspector input[type=range]{min-height:28px;height:28px;margin:1px 0}
.note-inspector select{background:var(--grid);border-color:var(--line);border-radius:5px;font-size:12px!important;min-height:30px}
.note-inspector .selection-actions{grid-column:1/-1;margin:0;gap:6px}
.selection-actions .button,.selection-actions select{min-height:31px;font-size:12px!important;padding:4px 8px}
#native-track-settings h3{font-size:15px}.settings-caption{font-size:11px;margin:3px 0 10px}
#native-track-settings .track-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 20px}
#native-track-settings .track-controls label{font-size:12px}.track-controls output{font-size:11px}
.track-tools{margin-top:9px;padding-top:9px}.track-tools .button,.track-tools button,.track-tools input,.track-tools select{min-height:32px;max-width:none;border-radius:5px;font-size:12px!important;padding:4px 8px}
.back-to-grid{display:none}.editor-bottom{gap:8px;margin:2px 0}
.editor-bottom .button{flex:none;min-height:34px;font-size:12px!important;padding:6px 10px;border-radius:6px}
.studio-help{font-size:11px;margin-top:10px}.studio-help p{font-size:12px}
#variant-status:empty,#audio-status:empty{display:none}
.studio-library{position:fixed;left:0;top:0;bottom:0;width:176px;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;gap:4px;padding:18px 12px;overflow-y:auto;z-index:8}
.studio-wordmark{font-size:15px;font-weight:700;letter-spacing:1px;margin-bottom:22px;white-space:nowrap}.studio-wordmark span{font-size:10px;color:var(--lime)}
.studio-library>.eyebrow{font-size:11px;margin:12px 6px 5px;letter-spacing:.7px}
.studio-library button{display:block;width:100%;background:transparent;border:0;color:var(--text);text-align:left;min-height:32px;padding:6px 8px;border-radius:5px;font-size:12px;font-weight:400}
.studio-library button:hover{background:var(--soft)}
.studio-offline{margin-top:auto;font-size:11px;line-height:1.6;color:var(--muted);padding:20px 8px 0}
.pad-button{background:color-mix(in srgb,var(--lane,#a94e38) 16%,var(--grid));border-color:var(--line);border-radius:8px;box-shadow:none;color:var(--text)}
.pad-button.empty-pad,.pad-button:before{color:var(--muted)!important;background:transparent}
.pad-sequence-roll,.pad-sequence-numbers{background:var(--surface);border-color:var(--line)}
.pad-sequence-numbers span{border-color:transparent;color:var(--muted)}
.pad-sequence-numbers .bar-start{border-left:1px solid var(--bar)}
.pad-sequence-lanes{background-color:var(--grid);background-image:linear-gradient(to right,var(--four) 2px,transparent 2px),linear-gradient(to right,var(--bar) 1px,transparent 1px),linear-gradient(to right,var(--half) 1px,transparent 1px);background-size:calc(100%/var(--pad-steps)*64) 100%,calc(100%/var(--pad-steps)*16) 100%,calc(100%/var(--pad-steps)*8) 100%}
#pads-dialog[open]{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;inset:0;border-radius:0;border:0;background:var(--bg)}
@media(pointer:coarse){#sequencer{--lane-height:42px}#sequencer .lane-header .track-select{min-height:40px}#sequencer .lane-header .lane-mute,#sequencer .lane-header .instrument-preview{min-height:40px;width:30px;min-width:30px}.note-resize{width:14px}}
@media(min-width:1600px){.studio-library{width:190px}#editor,#editor[open],html:not([data-native]) #editor,html[data-native] #editor{padding-left:208px}.pattern-list{grid-template-columns:repeat(auto-fill,minmax(270px,1fr))}}
@media(max-width:1050px){.studio-top-controls{grid-template-columns:1fr}.studio-top-controls>.edit-actions{grid-row:2;flex-wrap:wrap}.editor-options{justify-self:start;max-width:none}.note-toolbar{gap:6px}.note-toolbar select{max-width:150px}.studio-library{width:150px;padding:16px 8px}#editor,#editor[open],html:not([data-native]) #editor,html[data-native] #editor{padding-left:162px;padding-right:12px}.studio-wordmark{font-size:13px}.studio-wordmark span{font-size:9px}.studio-top-controls>.source-status{grid-row:3}.editor-utility{grid-row:4}.editor-options{grid-row:5}}
@media(max-width:759px){:root{--label-width:118px}main{padding:12px}.workspace{display:block}.intro h1{font-size:32px}.studio-library{display:none}#editor,#editor[open],html:not([data-native]) #editor,html[data-native] #editor{padding:0 10px 14px}#editor>.dialog-head{margin:0 -10px;padding:8px 10px;min-height:58px;gap:8px}#editor-title{font-size:17px}#editor>.dialog-head .eyebrow{font-size:10px}#save-variant.save-main{font-size:11px;max-width:115px}.studio-top-controls{gap:5px;padding-top:8px}.step-readout{margin-left:auto}.note-toolbar{gap:7px}.edit-mode{width:auto}.edit-mode button{padding:4px 7px;font-size:11px}.note-toolbar label{font-size:11px}.note-toolbar select{max-width:130px;font-size:12px!important}.editor-options{grid-row:auto}.page-controls strong{font-size:11px}.note-inspector #selection-controls{grid-template-columns:1fr;gap:10px}.note-inspector label{font-size:13px}#native-track-settings .track-controls{grid-template-columns:1fr;gap:10px}.selection-actions .button,.selection-actions select{min-height:40px}.note-inspector .selection-actions{grid-column:1}.note-inspector input[type=range]{min-height:36px}.table-scroll{border-radius:5px}#sequencer .lane-header{padding:0 4px;gap:2px}#sequencer .lane-header .track-select{font-size:11px}#sequencer .lane-header .lane-mute,#sequencer .lane-header .instrument-preview{min-width:24px;width:24px}.editor-bottom .button{flex:1;font-size:11px!important}.sound-list{grid-template-columns:1fr}}

#editor #note-inspector #selection-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 20px}
#editor #native-track-settings .track-controls{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 20px}
@media(min-width:760px){#editor>.dialog-head{margin-right:0}}
@media(min-width:901px) and (max-width:1050px){.studio-top-controls{grid-template-columns:minmax(0,1fr) auto}.studio-top-controls>.edit-actions{grid-row:1;grid-column:2}.studio-top-controls>.source-status{grid-row:2}.editor-utility{grid-row:3}.editor-options{grid-row:3;grid-column:2;justify-self:end}}
@media(max-width:759px){#editor #note-inspector #selection-controls,#editor #native-track-settings .track-controls{grid-template-columns:1fr}}

/* Public downloadable sound collections. */
#instruments-dialog{width:min(1200px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:20px}.server-library-top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:16px 0}.server-library-top h3{margin:0;font-size:18px}.server-library-top .hint{margin:4px 0}.server-library-top .library-tabs{margin:0}.server-filters{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.server-filters>input{flex:1;min-width:180px;max-width:100%;font-size:14px!important;min-height:42px;padding:8px}.library-filter{display:grid;gap:4px;font-size:12px;color:var(--muted);min-width:120px}.library-filter select{min-height:42px;max-width:230px;background:var(--grid);color:var(--text);border:1px solid var(--line);border-radius:6px;font-size:13px!important;padding:7px}.library-download-status{font-size:12px;color:var(--muted);margin:12px 0;min-height:20px}.server-sounds{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));margin-top:12px}.server-sounds .sound-card{gap:9px;padding:14px;border-radius:9px;align-content:start}.server-sounds .sound-card .button{min-height:38px;font-size:12px;padding:7px 9px}.server-sounds .sound-title{font-size:15px}.server-sounds .sound-title h3{font-size:15px}.download-badge{font-size:11px;color:var(--muted);display:inline-block}.download-badge.complete{color:#385c3c}.server-sounds .sample-duration{margin-left:auto}.library-pagination{display:flex;justify-content:center;align-items:center;gap:12px;margin-top:18px;font-size:12px}.library-pagination button{min-height:40px}.library-pack .sound-title{width:100%}.library-pack .hint{width:100%}.library-pack .button:disabled{opacity:.65}#instruments-dialog>.library-tabs{flex-wrap:wrap}#instruments-dialog>.library-tabs button{min-width:90px;flex:1;font-size:12px}
@media(max-width:599px){#instruments-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;inset:0;border-radius:0;padding:15px}.server-sounds{grid-template-columns:1fr}.server-filters{gap:8px}.server-filters>input{width:100%}.library-filter{min-width:0;flex:1}.library-filter select{width:100%;max-width:100%;font-size:14px!important}.server-sounds .sound-card .button{min-height:44px}.server-library-top{gap:8px}}
