*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#fff;color:#151515;font-family:Arial,Helvetica,sans-serif}
button,input{font:inherit}button{color:inherit}
#artwork{position:relative;width:100%;height:100%;background:#fff}
#field{display:block;width:100%;height:100%;touch-action:none}
.masthead{position:absolute;left:20px;top:22px;padding:12px 14px;background:#fffffff2;pointer-events:none;transition:opacity .5s}
#readme-link{display:inline-block;pointer-events:auto;color:#555;font-size:14px;line-height:1.4;padding:7px 0 2px;text-decoration:underline;text-underline-offset:3px}
#readme-link:focus-visible{outline:2px solid #222;outline-offset:3px}
.masthead:focus-within{opacity:1}
h1{margin:0;font-size:15px;font-weight:500;letter-spacing:.035em}
.actions{position:absolute;right:24px;top:22px;display:flex;gap:6px;transition:opacity .5s}
button{display:grid;place-items:center;width:42px;height:42px;padding:10px;border:1px solid transparent;background:#fffffff2;border-radius:50%;cursor:pointer}
button:hover{border-color:#bbb;background:#fff}
button:focus-visible{outline:2px solid #222;outline-offset:3px}
button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.study-bar{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);display:flex;align-items:center;padding:4px 5px;gap:3px;background:#fffffff5;border:1px solid #dedede;border-radius:5px;transition:opacity .5s}
.study-bar>button{background:transparent;border-radius:3px}
#collection-toggle{display:flex;align-items:center;gap:15px;width:auto;min-width:245px;padding:8px 12px}
#study-count{font-size:12px;color:#666;font-variant-numeric:tabular-nums;white-space:nowrap}
#study-title{font-size:14px;font-weight:500;white-space:nowrap}
.grid-icon{margin-left:auto;display:flex;align-items:center}
.grid-icon svg{width:14px;height:14px}
#collection{position:absolute;bottom:88px;left:24px;display:flex;flex-direction:column;width:456px;max-width:calc(100% - 48px);max-height:calc(100% - 160px);background:#fffffffa;border:1px solid #d8d8d8;box-shadow:0 8px 36px #0000000d;padding:12px}
.collection-heading{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding-left:8px}
h2{font-size:15px;font-weight:500;margin:0}
#collection-close{font-size:23px;font-weight:400;background:transparent}
#study-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;overflow:auto;overscroll-behavior:contain;padding:4px;min-height:0;scrollbar-width:thin}
.study-choice{display:flex;align-items:center;gap:9px;text-align:left;width:100%;height:auto;min-height:68px;padding:5px;border:1px solid #e2e2e2;border-radius:2px;background:#fff}
.study-choice img{display:block;object-fit:cover;width:66px;height:50px;flex:none;background:#fff}
.study-choice .choice-label{font-size:13px;line-height:1.3;overflow-wrap:break-word}
.study-choice .choice-number{display:block;font-size:12px;color:#777;margin-bottom:3px;font-variant-numeric:tabular-nums}
.study-choice[aria-pressed=true]{border-color:#181818;background:#f3f3f3}
.study-choice:disabled{opacity:.45;cursor:not-allowed}
#study-description{font-size:13px;line-height:1.5;color:#555;margin:12px 8px 5px;min-height:39px}
#controls{position:absolute;top:78px;right:28px;width:260px;max-height:calc(100% - 165px);overflow:auto;background:#fffffffa;border:1px solid #dedede;padding:22px 22px 14px;box-shadow:0 10px 40px #00000008}
#controls label{display:block;font-size:14px;margin-bottom:22px}
output{float:right;color:#666;font-size:12px;font-variant-numeric:tabular-nums}
input[type=range]{display:block;width:100%;margin:13px 0 0;accent-color:#222;cursor:pointer}
#controls p{font-size:12px;color:#666;line-height:1.8;margin:0}
.quiet .masthead,.quiet .actions,.quiet .study-bar{opacity:0}
.quiet .masthead:focus-within,.quiet .masthead:hover{opacity:1}
.quiet .actions:hover,.quiet .actions:focus-within,.quiet .study-bar:hover,.quiet .study-bar:focus-within{opacity:1}
#error{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:420px;font-size:16px;line-height:1.6;background:#fff;padding:24px}
#error[hidden],#controls[hidden],#collection[hidden]{display:none}
#preparing-status{position:absolute;left:50%;bottom:132px;transform:translateX(-50%);padding:6px 12px;background:#fffffff2;color:#555;font-size:12px;pointer-events:none;visibility:hidden}
#artwork[aria-busy=true] #preparing-status{visibility:visible}
@media(max-width:600px){
 .masthead{left:10px;top:15px;max-width:calc(100% - 155px);padding:10px}h1{font-size:14px;line-height:1.4}
 .actions{right:10px;top:12px;gap:0}
 #controls{right:16px;top:65px;width:min(260px,calc(100% - 32px))}
 .study-bar{bottom:16px;max-width:calc(100% - 24px);width:344px;justify-content:space-between;gap:0}
 #collection-toggle{min-width:0;gap:10px;flex:1;padding:6px}#study-title{font-size:13px}#study-count{font-size:12px}
 #collection{left:12px;bottom:78px;max-width:calc(100% - 24px);max-height:calc(100% - 150px);padding:8px}
 .study-choice{gap:6px;min-height:67px}.study-choice img{width:42px;height:48px}.study-choice .choice-label{font-size:13px}.grid-icon{display:none}
}
@media(pointer:coarse){button{min-width:44px;min-height:44px}}
@media(prefers-reduced-motion:reduce){.masthead,.actions,.study-bar{transition:none}}

.study-group{grid-column:1/-1;margin:12px 0 4px;font-size:12px;letter-spacing:.04em;color:#666;font-weight:400}.study-group:first-child{margin-top:2px}

#controls{width:316px;padding:16px 22px 20px;max-height:calc(100% - 220px);scrollbar-width:thin}
.parameters-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
#parameters-close{font-size:23px;background:transparent}
#controls select{display:block;width:100%;margin-top:10px;padding:10px 28px 10px 10px;border:1px solid #ccc;background:#fff;color:#171717;border-radius:2px;font:inherit;font-size:14px}
#study-options{border-bottom:1px solid #ddd;margin-bottom:22px}
#controls #variation-description{font-size:13px;line-height:1.5;margin:-6px 0 20px;color:#555}
[hidden]{display:none!important}
#study-title{white-space:normal;line-height:1.3}#collection-toggle{max-width:340px;min-height:44px;height:auto}
.study-choice .choice-label{font-size:14px}.study-group{font-size:13px}
@media(max-width:600px){#controls{top:90px;width:min(316px,calc(100% - 32px));max-height:calc(100% - 225px)}#collection-toggle{min-width:0}#study-title{font-size:13px}.study-choice .choice-label{font-size:13px}}

.study-bar{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;width:max-content;max-width:calc(100% - 24px)}
.random-actions{grid-column:1/-1;display:flex;justify-content:center;gap:8px;border-top:1px solid #e5e5e5;padding-top:4px}
.random-actions button{width:auto;height:34px;padding:6px 16px;border-radius:3px;background:transparent;font-size:14px}
.random-actions button:hover{background:#eee;border-color:transparent}
#collection{bottom:132px;max-height:calc(100% - 202px)}
#reset-defaults{width:auto;height:auto;padding:8px 12px;margin:-6px 0 20px;border:1px solid #ddd;border-radius:3px;font-size:14px}
#wave-help{display:block;margin-top:9px;font-size:12px;color:#666;line-height:1.45;font-weight:400}
@media(max-width:600px){.study-bar{width:344px}#collection{bottom:128px;max-height:calc(100% - 198px)}}
