:root{font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#263c31;background:#f5f5ed;--green:#345f4a;--line:#d7dfd1;--label:116px;--step:29px}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;background:#fffef9;border:1px solid var(--line);border-radius:7px;padding:10px 14px;min-height:42px;color:inherit;font-size:12px;font-weight:650;white-space:nowrap}button:hover{background:#e9efe2;border-color:#a3b69a}button:disabled{opacity:.42;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #d47b3a;outline-offset:2px}button.primary{background:var(--green);color:white;border-color:var(--green)}button.primary:hover{background:#244c39}button[aria-pressed=true]{background:#dce7d6;border-color:#73946d}.stop{border-color:#ad7a61}.local{font-size:11px;color:#62825a}.eyebrow{font-size:9px;letter-spacing:1.6px;font-weight:750;color:#75816b;margin:0 0 8px}header{display:flex;justify-content:space-between;align-items:center;padding:18px 30px;border-bottom:1px solid var(--line);background:#f9faf3;gap:16px}h1{font-size:25px;margin:0;letter-spacing:-.7px}h1 span{font-size:12px;font-weight:500;letter-spacing:0;color:#76816f;margin-left:12px}.header-actions{display:flex;align-items:center;gap:9px}main{max-width:1500px;margin:auto;padding:24px 30px}.intro{display:flex;gap:32px;align-items:center;justify-content:space-between;margin-bottom:22px}h2{font-size:33px;line-height:1.05;letter-spacing:-1.2px;margin:0;font-weight:650}.intro>p{max-width:530px;font-size:13px;line-height:1.8;color:#70806b;margin:0}.intro strong{color:#35543f;font-weight:600}h3{font-size:16px;margin:0}.workbench,.arrangement{background:#fffef9;border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 8px 20px #304d2605}.workbench-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 16px;border-bottom:1px solid var(--line)}#patternMeta{font-size:11px;color:#74816a;margin:5px 0 0}.pattern-tabs{display:flex;gap:5px}.pattern-tabs button{text-align:left;min-width:118px;padding:8px 12px;font-size:15px}.pattern-tabs button span{display:block;font-size:9px;font-weight:400;color:#728369;margin-top:3px}.pattern-tabs button[aria-selected=true]{background:#e7eedf;border-color:#819b70}.edit-tools{display:flex;gap:4px}.pattern-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:10px 16px;background:#f1f4eb}.pattern-toolbar>div{display:flex;gap:15px;align-items:center}.pattern-toolbar label{font-size:11px;color:#64745b;white-space:nowrap}input[type=number]{width:58px;padding:8px;border:1px solid #cbd5c2;border-radius:5px;background:#fffef9}select{padding:8px;border:1px solid #cbd5c2;border-radius:5px;background:#fffef9;color:#324b39;font-size:11px}.pattern-toolbar p{font-size:10px;color:#7a876f;margin:0}.grid-scroll{overflow:auto;overscroll-behavior:contain;padding-bottom:4px}.grid-row{display:grid;grid-template-columns:var(--label) repeat(32,minmax(var(--step),1fr));gap:3px;padding-right:12px;min-width:1080px;align-items:center}.grid-label{position:sticky;left:0;background:#fffef9;z-index:2;padding:0 12px;font-size:11px;display:flex;align-items:center;gap:7px;height:30px}.grid-label:before{content:'';width:6px;height:6px;border-radius:50%;background:var(--drum,#9aa785)}.grid-row.ruler{height:32px;margin:5px 0}.ruler>span:not(.grid-label){font-size:9px;color:#6a7a5f;text-align:center;white-space:nowrap}.ruler .grid-label:before{display:none}.step{min-height:26px;height:26px;padding:0;border-radius:4px;border:1px solid #e0e5d9;background:#f8f9f3;position:relative;touch-action:none;margin-bottom:3px}.step.beat{background:#edf1e6}.step.bar-two{border-left:2px solid #758e65}.step.on{background:color-mix(in srgb,var(--drum) 21%,white);border-color:var(--drum)}.step.on:after{content:'';display:block;margin:auto;width:var(--dot,9px);height:var(--dot,9px);border-radius:50%;background:var(--drum)}.step.playing{box-shadow:inset 0 0 0 2px #da6b30}.step .micro{position:absolute;right:2px;bottom:1px;font-size:8px;color:#5c6154}.editor-foot{padding:8px 16px;border-top:1px solid #e8eadf;display:flex;justify-content:space-between;font-size:10px;color:#7a866f;gap:15px}#playPosition{white-space:nowrap;color:#a26138}.suggestions{display:flex;gap:15px;justify-content:space-between;align-items:center;padding:14px 16px;border-top:1px solid var(--line);background:#f8faf4}.suggestions>div{display:flex;gap:7px}.suggestions p{font-size:11px;line-height:1.5;color:#6d7e62;margin:0;max-width:390px}.selection-action{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:10px 16px;border-top:1px solid var(--line)}.selection-action p{font-size:11px;color:#6a7a60;margin:0}.selection-action button{background:#eee8d9;border-color:#bca880}.arrangement{margin-top:20px}.arrange-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:16px}.arrange-heading p:not(.eyebrow){font-size:11px;color:#78846d;margin:6px 0 0}.arrange-heading>div:last-child{display:flex;gap:6px}.stage-scroll{overflow:auto;overscroll-behavior:contain}.stage-row{display:grid;grid-template-columns:215px repeat(8,minmax(65px,1fr));min-width:800px;border-top:1px solid var(--line);align-items:stretch}.stage-label{padding:9px 12px;background:#fbfcf7;position:sticky;left:0;z-index:2;border-right:1px solid var(--line);display:flex;gap:6px;align-items:center;flex-wrap:wrap}.stage-label strong{font-size:11px;flex:1;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kind{font-size:8px;color:#7b876d;font-weight:500;text-transform:uppercase;letter-spacing:1px}.mute{padding:3px 8px;min-height:27px;font-size:9px}.stage-cell{min-height:48px;border-radius:0;border:0;border-right:1px solid #e5e9dd;background:#fffef9;touch-action:none;padding:4px;font-size:9px;font-weight:500;color:#7a8c6a}.stage-cell.active{background:#e1e9d9;border-bottom:3px solid #81a16f}.stage-cell.playing{box-shadow:inset 2px 0 #d46d37}.stage-ruler{font-size:9px;color:#7e8974}.stage-ruler>span{padding:7px 12px;background:#f3f5ed}.stage-hint{font-size:10px;padding:9px 16px;margin:0;color:#7c886f;border-top:1px solid var(--line)}#status{font-size:12px;color:#526b49;min-height:18px;margin:14px 2px}.about{border-top:1px solid var(--line);padding:13px 0;font-size:11px;line-height:1.7;color:#718168}.about summary{cursor:pointer;color:#4e6846}.about p{max-width:900px}#metrics{font-family:ui-monospace,monospace;font-size:10px}footer{font-size:9px;color:#87917e;display:flex;justify-content:space-between;margin-top:8px;gap:10px}[hidden]{display:none!important}#stopAll{position:relative}.busy #generate{opacity:.5}.grid-scroll:focus{outline-offset:-2px}@media(max-width:1100px){:root{--label:104px;--step:26px}.grid-row{min-width:1000px}.workbench-heading{gap:10px}.pattern-tabs button{min-width:100px}.pattern-tabs button span{font-size:8px}.edit-tools button{padding:9px}.intro>p{max-width:440px}.suggestions{align-items:flex-start;flex-direction:column;gap:8px}.suggestions p{max-width:none}}@media(max-width:750px){header{padding:14px 16px;flex-wrap:wrap;gap:12px}.header-actions{width:100%}.header-actions .local{margin-right:auto}h1 span{font-size:11px}main{padding:18px 12px}.intro{display:block;margin-bottom:18px}h2{font-size:29px}.intro>p{margin-top:12px;font-size:12px}.workbench-heading{flex-wrap:wrap;padding:12px}.workbench-heading>div:first-child{width:100%}.pattern-tabs{flex:1}.pattern-tabs button{min-width:74px;flex:1;font-size:13px}.pattern-tabs button span{font-size:8px}.edit-tools{width:100%}.pattern-toolbar{flex-wrap:wrap;padding:10px 12px}.pattern-toolbar>div{gap:9px;flex-wrap:wrap}.pattern-toolbar>p{width:100%}.editor-foot{flex-direction:column;gap:5px;padding:8px 12px}.suggestions{padding:12px}.suggestions>div{flex-wrap:wrap}.selection-action{align-items:flex-start;flex-direction:column;gap:10px;padding:12px}.selection-action button{width:100%}.arrange-heading{flex-wrap:wrap;padding:12px}.arrange-heading>div:last-child{flex-wrap:wrap}.stage-row{grid-template-columns:180px repeat(8,65px);min-width:700px}footer{flex-direction:column}.grid-label{font-size:10px}}
/* Keep the emergency stop reachable and layer names readable. */
header{position:sticky;top:0;z-index:20}.stage-label strong{flex:1 0 100%;max-width:100%}
/* Rhythm experiment 02: expandable comparisons, finer grids and miniature notes. */
.workbench-heading{flex-wrap:wrap;gap:12px}.compare-controls{display:flex;align-items:center;gap:5px;min-width:0;flex:1;max-width:850px}.pattern-tabs{overflow-x:auto;min-width:0;padding:3px;scrollbar-width:thin}.pattern-tabs button{flex:none;min-width:100px}.add-possibility{flex:none;min-width:44px;min-height:46px;padding:5px;font-size:24px;font-weight:400}.rhythm-controls{display:flex;align-items:center;gap:22px;padding:10px 16px;border-bottom:1px solid var(--line);background:#fafbf5;flex-wrap:wrap}.swing-control{font-size:11px;color:#52694b;min-width:210px}.swing-control>span{display:flex;justify-content:space-between;gap:12px}.swing-control output{font-variant-numeric:tabular-nums;color:#7b866d}.swing-control input{width:210px;display:block;accent-color:var(--green);margin:6px 0 0}.subdivision-controls{display:flex;align-items:center;gap:7px;font-size:11px;color:#62765b}.subdivision-controls button{min-width:42px;min-height:36px;padding:6px;font-size:15px}.subdivision-controls>span:last-child{font-size:10px;color:#7b866d}#swingHelp{font-size:10px;line-height:1.5;color:#7b866d;margin:0;max-width:270px}.grid-row{grid-template-columns:var(--label) repeat(var(--columns,32),minmax(var(--step),1fr));min-width:calc(var(--label) + var(--columns,32) * (var(--step) + 3px) + 12px)}.stage-cell{position:relative;min-height:66px;padding:5px 3px;overflow:hidden}.rhythm-mini{display:block;width:100%;height:54px;pointer-events:none}.mini-beat{stroke:#9eae90;stroke-opacity:.28;stroke-width:.5}.mini-wave{stroke:#688b78;stroke-width:1}.stage-cell.playing{box-shadow:none}.stage-cell.playing:after{content:'';position:absolute;top:0;bottom:0;left:var(--playhead,0%);width:2px;background:#d46d37;pointer-events:none}.stage-cell.active:hover{background:#d7e4ca}.stage-ruler>span{position:relative}.stage-ruler>span:first-child{position:sticky;left:0;z-index:3}.pattern-tabs button:focus-visible{outline-offset:-3px}
@media(max-width:750px){.compare-controls{flex:1 0 100%;width:100%;max-width:100%}.pattern-tabs{flex:1}.pattern-tabs button{min-width:76px;font-size:13px;flex:none}.rhythm-controls{padding:10px 12px;gap:14px}.swing-control{flex:1}.swing-control input{width:100%}.subdivision-controls{flex-wrap:wrap}.rhythm-controls #swingHelp{max-width:none}.stage-cell{min-height:66px}.edit-tools{flex:none}}
/* Letter buttons generate; their small play buttons revisit a saved draft. */
.pattern-tabs{gap:6px}.possibility{display:flex;flex:none;border:1px solid transparent;border-radius:8px;overflow:hidden}.possibility.selected{border-color:#819b70;background:#e7eedf}.possibility button{border:0;border-radius:0;min-width:60px;background:transparent}.possibility>button:first-child{text-align:left}.possibility.selected>button:first-child{background:#e7eedf}.possibility .hear-saved{min-width:30px;padding:6px;color:#527847;font-size:11px;border-left:1px solid #d7dfd1}.possibility:not(.selected){background:#fafbf5;border-color:#e0e5d9}.pattern-tabs button span{font-size:9px}.grid-row{grid-template-columns:var(--grid-template)}.step.grouped:after{display:none}.cell-hits{display:block;width:100%;height:24px;color:var(--drum);pointer-events:none}.step.grouped{overflow:hidden}#resetGrid{font-size:11px;min-width:80px}
@media(max-width:750px){.possibility button{min-width:65px}.possibility .hear-saved{min-width:28px}}
.language-toggle{display:flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;flex:none}.language-toggle button{border:0;border-radius:0;padding:6px 8px;min-height:32px;font-size:11px}.language-toggle button[aria-pressed=true]{background:#e0e9d7}.header-actions{flex-wrap:wrap;justify-content:flex-end}html[lang=zh-CN] .pattern-tabs button span{font-size:10px}html[lang=zh-CN] .intro>p{line-height:1.8}@media(max-width:750px){.header-actions{gap:7px;justify-content:flex-start}.language-toggle{margin-right:auto}.header-actions .local{margin-right:0}.header-actions #save{margin-left:auto}.pattern-tabs .possibility>button:first-child{padding:8px}}
.language-toggle button[aria-pressed=true]{text-decoration:underline;text-underline-offset:4px}
@media(max-width:750px){header>div:first-child{max-width:calc(100% - 120px)}h1 span{display:block;margin:5px 0 0}.header-actions .language-toggle{position:absolute;top:14px;right:16px;margin:0}.header-actions .local{margin-right:auto}.header-actions #save{margin-left:0}.header-actions{width:100%}}
/* Fit/Expand and the optional circular rhythm tray. Subdivisions share one width. */
:root{--base-step:29px}.view-tools{gap:5px!important;flex-wrap:wrap}.view-tools button{min-height:34px;padding:6px 9px;font-size:11px}.pattern-toolbar{flex-wrap:wrap}.pattern-toolbar #hitSummary{margin-left:auto}.grid-row{--step:calc(var(--base-step) / var(--subdivision,1));gap:calc(3px / var(--subdivision,1));min-width:calc(var(--label) + 32 * (var(--base-step) + 3px) + 12px)}.step{min-width:0;overflow:hidden}.step.on:after{max-width:75%;max-height:75%}.rhythm-fit .grid-row{min-width:0;grid-template-columns:var(--grid-fit-template);--label:90px;padding-right:6px}.rhythm-fit .step{border:0;box-shadow:inset 0 0 0 .5px #d9e1d1}.rhythm-fit .step.on{box-shadow:inset 0 0 0 .65px var(--drum)}.rhythm-fit .step.playing{box-shadow:inset 0 0 0 1.5px #da6b30}.rhythm-fit .ruler>span:not(.grid-label){overflow:visible;position:relative;font-size:8px;z-index:1}.rhythm-fit .step .micro{display:none}#patternPanel{display:flex;min-width:0;position:relative;align-items:stretch}.grid-scroll{flex:1;min-width:0}.circle-tray{position:relative;flex:0 0 var(--circle-size,320px);width:var(--circle-size,320px);height:var(--circle-size,320px);background:#f3f7ec;border-left:1px solid #d2dfc6;overflow:hidden}.circle-tray svg{display:block;width:100%;height:100%;padding:8px 20px 34px}.circle-title{font-size:17px;font-weight:650;fill:#31583f}.circle-caption{font-size:9px;fill:#7e9670}.circle-beat{font-size:10px;fill:#6d875f}#closeCircle{position:absolute;right:4px;top:4px;z-index:2;border:0;background:transparent;min-height:28px;min-width:28px;padding:2px;font-size:21px;color:#496941}#circleLegend{position:absolute;bottom:4px;left:8px;right:8px;margin:0;display:flex;justify-content:center;flex-wrap:wrap;gap:3px 9px;font-size:9px;color:#617956}#circleLegend span:before{content:'';display:inline-block;width:5px;height:5px;background:var(--ring-color);border-radius:50%;margin-right:4px}.circle-overlay .circle-tray{position:absolute;right:0;top:0;z-index:6;box-shadow:-8px 0 18px #263c3122;max-width:100%;max-height:100%;aspect-ratio:1;width:min(var(--circle-size),100%);height:auto}.rhythm-expanded header{padding:8px 16px}.rhythm-expanded header .eyebrow,.rhythm-expanded .intro,.rhythm-expanded .arrangement,.rhythm-expanded .about,.rhythm-expanded footer,.rhythm-expanded main>#status{display:none}.rhythm-expanded main{max-width:none;padding:8px}.rhythm-expanded .workbench{height:calc(100dvh - var(--app-header-height,70px) - 16px);display:flex;flex-direction:column;overflow:auto}.rhythm-expanded #patternPanel{flex:1;min-height:200px}.rhythm-expanded .grid-scroll{height:100%;padding:0}.rhythm-expanded #noteGrid{height:100%;display:flex;flex-direction:column}.rhythm-expanded .grid-row.ruler{flex:0 0 26px;height:26px;margin:0}.rhythm-expanded .grid-row:not(.ruler){flex:1;min-height:18px}.rhythm-expanded .step{height:calc(100% - 3px);min-height:15px;margin:0}.rhythm-expanded .grid-label{height:100%}.rhythm-expanded .workbench-heading{padding:8px 12px}.rhythm-expanded .pattern-toolbar,.rhythm-expanded .rhythm-controls{padding:6px 12px}.rhythm-expanded #swingHelp,.rhythm-expanded .editor-foot>span:first-child,.rhythm-expanded .selection-action p{display:none}.rhythm-expanded .suggestions{padding:6px 12px;flex-direction:row;align-items:center}.rhythm-expanded .suggestions button,.rhythm-expanded .selection-action button{min-height:32px;padding:6px 10px}.rhythm-expanded .selection-action{padding:5px 12px;flex-direction:row;justify-content:flex-end}.rhythm-expanded .editor-foot{padding:4px 12px;min-height:20px}.rhythm-expanded .header-actions button{min-height:32px}.rhythm-expanded .cell-hits{height:100%}
@media(max-width:1100px){:root{--base-step:26px}}
@media(max-width:750px){.pattern-toolbar .view-tools{width:100%}.pattern-toolbar #hitSummary{margin:0}.rhythm-fit .grid-row{--label:74px}.rhythm-fit .grid-label{padding:0 6px;font-size:9px}.rhythm-fit .grid-label:before{width:4px;height:4px;flex:none}.rhythm-expanded .workbench-heading>div:first-child{display:none}.rhythm-expanded .workbench-heading{gap:5px}.rhythm-expanded .edit-tools button{min-height:30px;padding:5px 9px}.rhythm-expanded .rhythm-controls{gap:6px}.rhythm-expanded .swing-control{min-width:135px}.rhythm-expanded .subdivision-controls{gap:4px}.rhythm-expanded .subdivision-controls button{min-height:30px}.rhythm-expanded .suggestions p{font-size:9px}.rhythm-expanded .selection-action button{width:auto}.rhythm-expanded h1{font-size:21px}.rhythm-expanded h1 span{font-size:9px}.rhythm-expanded #patternPanel{min-height:200px}.rhythm-expanded .suggestions #rules{display:none}}
/* Templates resolve custom properties on the grid that owns them. */
#noteGrid{--step:calc(var(--base-step) / var(--subdivision,1))}.rhythm-fit #noteGrid{--label:90px}@media(max-width:750px){.rhythm-fit #noteGrid{--label:74px}}
