/* The polyrhythm surface follows the selected skin, including its voice displays. */
.poly-panel{--poly-screen:#10383e;--poly-off:#36564f;--poly-a:#90bba0;--poly-b:#e6b94f;--poly-c:#df8059;--poly-radius:1px;--poly-weight:700}
html[data-skin=carlingue] .poly-panel{--poly-face:var(--instrument-face);--poly-weight:400;--poly-screen:#173b3d;--poly-off:#3b5855}
html[data-skin=miami] .poly-panel{--poly-face:'Miami Display',Impact,sans-serif;--poly-weight:400;--poly-radius:9px;--poly-screen:#343956;--poly-off:#5e5977;--poly-a:#b9d9e5;--poly-b:#ebbed4;--poly-c:#efc19e}
html[data-skin=miami][data-theme=dark] .poly-panel{--poly-screen:#46324f;--poly-off:#6f526b;--poly-a:#f3b2d0;--poly-b:#f4bc7e;--poly-c:#c5cee3}
html[data-skin=billie] .poly-panel{--poly-face:var(--billie-face);--poly-weight:800;--poly-style:italic;--poly-radius:2px;--poly-screen:#11190a;--poly-off:#344620;--poly-a:#b6ef20;--poly-b:#edf3d9;--poly-c:#86bd40}
html[data-skin=spider] .poly-panel{--poly-face:var(--spider-face);--poly-weight:800;--poly-style:italic;--poly-radius:2px;--poly-screen:#12213b;--poly-off:#334b70;--poly-a:#f0646f;--poly-b:#84b3f2;--poly-c:#fae8bb}
html[data-skin=saiyan] .poly-panel{--poly-face:var(--ki-face);--poly-weight:800;--poly-style:italic;--poly-radius:3px;--poly-screen:#142c55;--poly-off:#35517a;--poly-a:#ff9c39;--poly-b:#ffe07b;--poly-c:#9dc4ff}
html[data-skin=la] .poly-panel{--poly-face:'Court Condensed',Impact,sans-serif;--poly-weight:800;--poly-style:italic;--poly-radius:3px;--poly-screen:#3b2457;--poly-off:#674f7f;--poly-a:#f4c44a;--poly-b:#e2c0f0;--poly-c:#fff2d4}
html[data-skin][data-theme] .poly-voice{grid-template-columns:40px 52px minmax(0,1fr) 82px;--voice:var(--poly-a)}
html[data-skin][data-theme] .poly-voice[data-voice="1"]{--voice:var(--poly-b)}
html[data-skin][data-theme] .poly-voice[data-voice="2"]{--voice:var(--poly-c)}
html[data-skin][data-theme] .poly-panel :is(#poly-family,.poly-count,.poly-choices button,.poly-speed-actions button,.poly-mute,.poly-heading output,.poly-speed-top){font-family:var(--poly-face,inherit);font-weight:var(--poly-weight);font-style:var(--poly-style,normal);border-radius:var(--poly-radius)}
html[data-skin][data-theme] .poly-panel :is(#poly-family,.poly-count){background:var(--control);color:var(--text);border-color:var(--line)}
html[data-skin][data-theme] .poly-panel :is(.poly-choices button,.poly-speed-actions button){background:var(--control);color:var(--text);border-color:var(--line)}
html[data-skin][data-theme] .poly-panel .poly-speed-actions button[aria-pressed=true]{background:var(--selected);color:var(--selected-ink);border-color:var(--selected)}
html[data-skin][data-theme] .poly-panel .poly-mute{background:var(--poly-screen);border-color:var(--line);color:var(--voice)}
html[data-skin][data-theme] .poly-panel .poly-voice.muted .poly-mute{background:var(--control);color:var(--muted)}
html[data-skin][data-theme] .poly-panel .poly-dots{position:relative;display:block;padding:0;background:var(--poly-screen);border-radius:var(--poly-radius)}
html[data-skin][data-theme] .poly-panel .poly-dots i{position:absolute;top:50%;left:calc(8px + (100% - 16px)*var(--pulse-position));transform:translate(-50%,-50%);width:min(16px,calc((100% - 16px)/var(--pulse-count) - 2px));min-width:2px;max-width:none;height:12px;box-shadow:none;background-color:var(--poly-off);background-image:linear-gradient(var(--poly-screen) 1px,transparent 1px),linear-gradient(90deg,var(--poly-screen) 1px,transparent 1px);background-size:4px 4px;border-radius:0}
html[data-skin][data-theme] .poly-panel .poly-dots i.active,html[data-skin][data-theme] .poly-panel .sustained .poly-dots i{background-color:var(--voice)}
html[data-skin][data-theme] .poly-panel .poly-dots.dense i{height:12px;background-size:3px 4px}
html[data-skin][data-theme] .poly-panel .poly-position{color:var(--voice)}
html[data-skin][data-theme] .poly-panel .poly-rate{color:var(--text);font-variant-numeric:tabular-nums}
html[data-skin=miami] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button,.poly-mute){font-size:1.0625rem;letter-spacing:.025em}
html[data-skin=miami] .poly-panel .poly-heading output{font-size:1.5rem}
html[data-skin=miami] .poly-panel .poly-speed-top{font-size:1rem;letter-spacing:.02em}
html[data-skin=carlingue] .poly-panel :is(.poly-count,.poly-choices select){font-family:var(--poly-face);font-weight:400}
html[data-skin=billie] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button,.poly-mute),html[data-skin=spider] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button,.poly-mute),html[data-skin=saiyan] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button,.poly-mute),html[data-skin=la] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button,.poly-mute){font-family:var(--poly-face);font-size:1rem;font-weight:var(--poly-weight)}
html[data-native-app][data-skin] .poly-voice{grid-template-columns:44px 44px minmax(0,1fr) 76px}
@media(max-width:619px){
 html[data-skin][data-theme] .poly-voice{grid-template-columns:38px 46px minmax(0,1fr) 76px;gap:6px}
 html[data-native-app][data-skin] .poly-voice{grid-template-columns:44px 44px minmax(0,1fr) 76px}
 html[data-skin=miami] .poly-panel :is(#poly-family,.poly-choices select,.poly-choices button,.poly-speed-actions button){font-size:1rem}
}

.poly-common-control{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:10px 0 14px}
html[data-skin][data-theme] .poly-panel #poly-common{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:var(--poly-radius);background:var(--control);color:var(--text);font-family:var(--poly-face,inherit);font-weight:var(--poly-weight);font-size:.8125rem;cursor:pointer}
html[data-skin][data-theme] .poly-panel #poly-common[aria-pressed=true]{background:var(--selected);border-color:var(--selected);color:var(--selected-ink)}
#poly-common-count{font-family:ui-monospace,monospace;font-size:.6875rem;font-weight:400;white-space:nowrap;opacity:.8}
#poly-common-status{font-size:.75rem;color:var(--muted)}
@media(max-width:619px){.poly-common-control{margin:8px 0 12px}html[data-skin][data-theme] .poly-panel #poly-common{width:100%;padding:8px;font-size:.8125rem;gap:7px}}

/* Preview: small pixel rectangles share one responsive cycle axis. */
html[data-skin][data-theme] .poly-panel .poly-dots{overflow:hidden;isolation:isolate}
.poly-grid-canvas{position:absolute;inset:0;display:block;width:100%;height:100%;image-rendering:pixelated}

.poly-ratio-tools{display:flex;align-items:center;flex-shrink:0;gap:6px}
html[data-skin][data-theme] .poly-panel #poly-reverse{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:var(--control);color:var(--text);border:1px solid var(--line);border-radius:var(--poly-radius)}
html[data-skin][data-theme] .poly-panel #poly-reverse:hover{border-color:var(--text)}
html[data-skin][data-theme] .poly-panel #poly-reverse:active{background:var(--selected);color:var(--selected-ink)}
@media(max-width:619px){.poly-ratio-tools{gap:3px}.poly-heading #poly-family{flex:1;min-width:0}.poly-ratio-tools output{font-size:1rem}}
