:root{--pad:clamp(12px,2vw,28px);--hi:#c1fa71;--top:max(var(--pad),env(safe-area-inset-top));--bottom:max(var(--pad),env(safe-area-inset-bottom));--dock:56px}
body,main{display:block;overflow:hidden;background:#000}
body{height:100vh;height:100dvh}
main,canvas{width:100%;height:100%}
main{position:relative;isolation:isolate;user-select:none;-webkit-user-select:none}
canvas{display:block;touch-action:none;cursor:crosshair}
.glass,#hint{background:rgba(19,19,20,.92);border:1px solid #ffffff30;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 3px 16px #0003}
header{position:absolute;top:var(--top);left:max(var(--pad),env(safe-area-inset-left));right:max(var(--pad),env(safe-area-inset-right));height:auto;padding:0;border:0;justify-content:space-between;background:none;pointer-events:none}
.brand,.playback{pointer-events:auto;display:flex;align-items:center;border-radius:32px;height:46px;padding:3px}
.brand{padding-inline:15px 18px;gap:12px}
h1{font-weight:500;font-size:12px;letter-spacing:-.02em}
h1:before{margin:0 12px 0 0}
#back{height:100%;color:#c9c9cc}
.playback button,.controls button{border-radius:30px;padding:0;min-height:100%;width:40px}
.playback button svg,.controls button>svg{height:19px;width:19px;stroke-width:1.7}
.dock,#hint{position:absolute;bottom:var(--bottom);left:50%;transform:translateX(-50%)}
.controls{display:flex;align-items:stretch;padding:5px;background:#f6f6f5;color:#131313;border-radius:50px;box-shadow:0 4px 30px #0009;height:var(--dock);gap:2px}
.controls button{width:46px;position:relative}
.controls button[aria-controls]:has(b){width:auto;padding:0 18px 0 13px;gap:9px}
.controls button:hover:enabled{background:#dfdfdd;color:black}
.controls button[aria-expanded=true]{background:#1c1c1c;color:white}
.controls button[aria-expanded=true]:hover:enabled{background:#303031;color:white}
.controls b{display:grid;place-items:center;min-width:24px;font:600 22px/1 Arial,sans-serif}
.controls b svg,.grid svg{height:21px;width:21px;fill:currentColor;stroke:none}
.chevron{width:6px;height:6px;border:solid currentColor;border-width:1.5px 1.5px 0 0;transform:rotate(-45deg) translate(-1px,1px);margin-left:3px}
[aria-expanded=true] .chevron{transform:rotate(135deg)}
.controls button+button:before{content:"";position:absolute;background:#0002;left:-1px;height:17px;width:1px}
.controls button[aria-expanded=true]:before,.controls button[aria-expanded=true]+button:before{display:none}
.sheets{width:min(372px,calc(100vw - 24px));position:absolute;left:50%;transform:translateX(-50%);bottom:calc(100% + 12px)}
section.glass{border-radius:22px;padding:16px;max-height:calc(100vh - var(--top) - var(--bottom) - var(--dock) - 74px);max-height:calc(100dvh - var(--top) - var(--bottom) - var(--dock) - 74px);overflow:auto;overscroll-behavior:contain;animation:rise .22s ease-out}
@keyframes rise{from{opacity:0;transform:translateY(8px)}}
h2{letter-spacing:.08em;margin:0 2px 10px;color:#bbbcc1}
h2 button.txt{color:#fff}
.modes,.grid,.sets{display:grid;gap:4px;grid-template-columns:repeat(2,1fr)}
.modes{margin-bottom:12px;background:#0006;border-radius:12px;padding:3px}
section button{background:#ffffff0c;border-radius:9px;min-height:38px}
.modes button{background:none;color:#cbcbce}
.modes button[aria-pressed=true]{color:#fff;background:#39393c}
.grid{grid-template-columns:repeat(7,1fr)}
.grid.icons{grid-template-columns:repeat(6,1fr)}
.grid button{font:500 20px/1 Arial,sans-serif;padding:0}
.grid button[aria-pressed=true],.sets button[aria-pressed=true]{background:var(--hi);color:#0f140c}
.sets{margin-top:12px;padding-top:12px;border-top:1px solid #ffffff25;grid-template-columns:repeat(3,1fr)}
.sets button{font-size:11px}
.range{grid-template-columns:85px 1fr 48px;height:42px}
#save{width:100%;margin-top:10px}
#hint{border-radius:20px;padding:10px 18px;white-space:nowrap;pointer-events:none}
body.full header,body.full .dock{display:none}
@media(max-width:520px){
 :root{--dock:52px}
 .brand{padding-inline:10px 15px;gap:7px}
 #back{width:22px}
 .controls{padding:4px;gap:0}
 .controls button{width:41px}
 .controls button[aria-controls]:has(b){padding:0 13px 0 9px;gap:5px}
 .controls b{font-size:20px;min-width:20px}
 .chevron{width:5px;height:5px}
 .grid button{min-height:40px}
}
@media(max-width:365px){
 .controls{font-size:11px}
 .controls button[aria-controls]:has(b){padding-inline:7px;gap:4px}
 .controls button{width:40px}
 .chevron{display:none}
 section.glass{padding:12px}
 .sets button{font-size:10px;padding:0}
}
@media(prefers-reduced-motion:reduce){section.glass{animation:none}}
#hint{display:flex;align-items:center;gap:8px;bottom:calc(var(--bottom) + var(--dock) + 12px)}
body.full #hint{bottom:var(--bottom)}
.controls button:disabled{opacity:1;color:#aaa}
.controls b svg:has(path:not([fill])){stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.controls .mix{display:flex;align-items:flex-start;font:600 19px/1 Arial,sans-serif}
.controls .mix svg{width:11px;height:11px;margin:0 0 0 1px}
#color-chip{width:21px;height:21px;border-radius:50%;transform:rotate(40deg);justify-content:center;box-shadow:inset 0 0 0 1px #0001}
#color-chip:not(.enabled):after{content:"";background:#f6f6f5;border-radius:50%;width:11px;height:11px}
.controls [aria-expanded=true] #color-chip:after{background:#1c1c1c}
#gradient h2{margin-block:-4px 7px}
#map-toggle{min-height:34px;padding:0 1px 0 10px;background:none;color:#ddd;font-weight:400;font-size:11px}
#map-toggle i{width:33px;height:20px;border-radius:12px;padding:3px;background:#515157}
#map-toggle i:before{content:"";width:14px;height:14px;border-radius:50%;background:white}
#map-toggle[aria-checked=true] i{background:var(--hi);justify-content:flex-end}
#map-toggle[aria-checked=true] i:before{background:#182210}
#palettes{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
#palettes button{padding:3px;background:transparent;border:1px solid transparent;border-radius:10px}
#palettes button:before{content:"";background:var(--ramp);height:30px;width:100%;border-radius:6px}
#palettes button:hover{border-color:#fff7}
#palettes button[aria-pressed=true]{border-color:white}
.color-row{display:flex;align-items:center;gap:12px;margin:13px 0 15px}
#ramp{flex:1;display:flex;justify-content:space-between;align-items:center;border-radius:18px;height:14px;margin-inline:12px}
#ramp input{width:30px;height:30px;padding:0;border-radius:50%;box-shadow:0 1px 5px #0006}
#ramp input:first-child{margin-left:-12px}
#ramp input:last-child{margin-right:-12px}
#ramp input::-webkit-color-swatch-wrapper{padding:0}
#ramp input::-webkit-color-swatch{border:3px solid white;border-radius:50%}
#ramp input::-moz-color-swatch{border:3px solid white;border-radius:50%}
#reverse{width:39px}
#gradient .modes{margin:0}
#direction{margin-top:5px}
@media(max-width:365px){.controls button{width:38px}.controls button[aria-controls]:has(b){padding-inline:6px}}
