.poly-wave-launch{padding:7px 12px;border:1px solid #73c9c0;border-radius:8px;background:#19434b;color:#edf9f7;font:inherit;cursor:pointer}
dialog.poly-wave-builder{box-sizing:border-box;width:min(1040px,96vw);max-width:96vw;height:auto;max-height:94dvh;padding:18px;border:1px solid #6b8f9e;border-radius:14px;background:#182737;color:#eaf3fb;font:15px system-ui,sans-serif;overflow:auto}
.poly-wave-builder::backdrop{background:rgb(10 20 30 / .72)}
.poly-wave-builder header{display:flex;justify-content:space-between;align-items:start;gap:12px}.poly-wave-builder h2{margin:0;font-size:23px}.poly-wave-builder p{margin:5px 0 12px;color:#b9cede}
.poly-wave-builder button,.poly-wave-builder select,.poly-wave-builder input:not([type=range]){font:inherit;border:1px solid #7394a7;border-radius:7px;background:#283e53;color:#eaf3fb;padding:7px 10px;min-height:36px}
.poly-wave-builder button{cursor:pointer}.poly-wave-builder button:hover{background:#35556b}.poly-wave-builder button[aria-pressed=true],.poly-wave-builder [data-action=use]{background:#167d74;color:#f0fcfa;border-color:#72d4c9}.poly-wave-builder button:disabled{opacity:.55;cursor:default}.poly-wave-builder :focus-visible{outline:3px solid #f2c572;outline-offset:2px}
.poly-wave-builder .wave-close{font-size:23px;line-height:1;min-width:36px}.wave-tabs{display:flex;gap:8px;border-bottom:1px solid #557186;padding-bottom:10px;margin-bottom:12px}
.poly-wave-builder [hidden]{display:none!important}.wave-pane{min-height:188px}.wave-pane[data-pane=basic],.wave-pane[data-pane=presets]{display:flex;align-content:start;align-items:start;flex-wrap:wrap;gap:10px}
.wave-source{direction:ltr;display:grid;grid-template-columns:65px minmax(100px,1.1fr) minmax(100px,1.2fr) 75px minmax(90px,1fr) minmax(90px,1fr);gap:12px;align-items:center;padding:5px 0;border-bottom:1px solid #344b60}.wave-source label{display:flex;flex-direction:column;gap:3px;font-size:12px;position:relative;text-align:start}.wave-source input[type=range]{direction:ltr;width:100%;margin:0;accent-color:#66d1c5}.wave-source output{position:absolute;inset-inline-end:0;top:0;font-size:11px}.wave-source strong{font-size:12px}.wave-source select{min-width:0;width:100%;padding:4px;font-size:13px}.wave-source label:has(select){direction:rtl}html[lang=en] .wave-source label:has(select){direction:ltr}
.wave-plots{display:grid;grid-template-columns:1fr 1fr;direction:ltr;gap:14px;margin:12px 0}.wave-plots figure{margin:0;min-width:0}.wave-plots figcaption{font-weight:650;margin-bottom:5px}.wave-plots canvas{display:block;width:100%;height:110px;background:#102131;border:1px solid #456479;border-radius:7px}
.poly-wave-builder .wave-actions{display:flex!important;flex-wrap:wrap;align-items:end;gap:9px;padding:0!important;margin:0!important;color:inherit!important;font-size:14px!important}.wave-actions label{display:flex;flex-direction:column;gap:3px;font-size:12px;flex:1;min-width:130px}.wave-actions input{width:100%;box-sizing:border-box}.wave-status{display:flex;align-items:center;flex-wrap:wrap;gap:14px;min-height:25px;margin-top:10px;font-size:13px}.wave-status a{color:#8ee4dc;text-decoration:underline}
@media(max-height:900px){dialog.poly-wave-builder{padding:12px}.wave-plots canvas{height:85px}.wave-pane{min-height:165px}.wave-source{padding:3px 0}.poly-wave-builder h2{font-size:20px}}
@media(max-width:700px){.wave-source{grid-template-columns:50px 1fr 1fr;gap:6px}.wave-source label{font-size:11px}.wave-source label:nth-last-child(-n+3){display:none}.wave-plots canvas{height:85px}.wave-tabs{gap:5px}.wave-tabs button{font-size:13px;padding:6px}.wave-actions button{flex:1}.wave-pane{min-height:188px}}
@media(max-height:900px){.wave-source select{min-height:30px}.wave-source label{gap:1px}.wave-source{padding:2px 0}.poly-wave-builder p{margin-bottom:8px}.wave-tabs{margin-bottom:8px}}
/* Keep physical control order identical in Hebrew and English. */
.wave-tabs,.wave-pane[data-pane=basic],.wave-pane[data-pane=presets],.poly-wave-builder .wave-actions{direction:ltr}
.wave-actions label{direction:rtl}html[lang=en] .wave-actions label{direction:ltr}
#soundContainer .sound-chip{position:relative;touch-action:manipulation}
#soundContainer .sound-chip::after{content:'▶';position:absolute;left:7px;top:5px;font-size:10px;color:var(--text-muted)}
.poly-sound-hint{color:var(--text-muted);font:12px/1.4 system-ui;margin-top:6px}
.poly-wave-builder[data-view=presets] .wave-plots,.poly-wave-builder[data-view=presets] .wave-actions,.poly-wave-builder[data-view=presets] .wave-status{display:none!important}
.poly-wave-builder[data-view=presets] .wave-pane{min-height:0;padding-block:6px 14px}
#soundContainer .sound-chip.is-previewing{outline:2px solid var(--accent,#6fd6cb);outline-offset:-3px}
#soundContainer .sound-chip.is-previewing::after{content:'♪';font-size:16px;color:var(--text)}
.poly-wave-builder[data-view=presets]{height:fit-content!important;width:min(920px,96vw)}
