:root{font-family:system-ui,sans-serif;color:#202133;background:#f8f5f7;--primary:#805169;--cell:28px}
#test{width:100%;max-width:100%;margin-inline:auto}
#test .toolbar{max-width:1200px;margin-inline:auto}
body.pf-shell.test-active main{height:100svh;display:flex;flex-direction:column;overflow:hidden}
body.test-active #test{display:flex;flex-direction:column;flex:1;min-height:0}
body.test-active .page-head,body.test-active #toolbar,body.test-active #mode{flex-shrink:0}
body.test-active #language{display:none}
body.pf-shell.test-active header.page-head{display:none}
body.test-active #toolbar{width:100%;position:relative}
body.pf-shell.test-active #viewport{flex:1;min-height:0;max-height:none}
body.pf-shell.test-active #mode{width:100%;height:44px;min-height:44px;margin-top:0;margin-bottom:0;overflow:auto}
#viewOptions{position:relative;margin-left:auto}
#viewOptionsToggle{list-style:none;font-size:1rem}
#viewOptionsToggle::-webkit-details-marker{display:none}
body.pf-shell.pf-compact #viewOptionsToggle{min-height:30px;height:30px;padding:0 10px;font-size:.75rem;line-height:1.5}
#researcherInfo #setupLinks{margin:12px 0 0;width:auto;max-width:none}
#previousTestControls{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:12px}
#clearPrevious{color:var(--pf-muted)}
.view-options-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:5;width:260px;padding:16px;background:white;border:1px solid #e8e0e5;border-radius:12px;box-shadow:0 8px 24px #5c35451a}
.view-options-panel label{display:block;margin-bottom:10px}
.view-options-panel input{width:100%;accent-color:var(--brand)}
body.pf-shell #mode{max-width:1200px;margin-inline:auto}
body.pf-shell #viewport{width:calc(40 * var(--cell) + 50px);max-width:100%;margin-inline:auto;overflow-x:hidden}
#grid{margin-inline:auto}
#matrix{position:relative;width:max-content;margin-inline:auto}
#minuteLines,#gapLayer{position:absolute;inset:0;pointer-events:none}
#gapLayer{pointer-events:auto;cursor:crosshair;z-index:1}
.minute-line,#gapPreview{position:absolute;pointer-events:none;border-radius:1px}
.minute-line{width:2.5px;background:#075bb5}
#gapPreview{width:6px;background:#1565c044;transform:translateX(-3px)}
#gapOptions{position:absolute;inset:0;pointer-events:none}
.gap-option{position:absolute;width:2px;background:#1565c066;pointer-events:none}
body.test-ready #minuteLines{filter:blur(12px);opacity:.35}
body.test-ready.sizing-preview #minuteLines{filter:none;opacity:1}
body.boundary-mode #grid button.cursor{outline:none;background:white}
body.boundary-mode #grid button:focus,body.boundary-mode #grid button:focus-visible{outline:none;box-shadow:none}
#sheetScroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;width:calc(100% + 48px);margin-inline:-24px;padding-inline:24px;scrollbar-width:thin;scrollbar-color:#ded7dc transparent;scrollbar-gutter:stable both-edges;overscroll-behavior:contain}
#sheetScroll{scrollbar-width:auto;scrollbar-color:#99838f #eee9ec}
#sheetScroll:hover{scrollbar-color:#805064 #eee9ec}
#sheetScroll::-webkit-scrollbar{width:10px;height:10px}
#sheetScroll::-webkit-scrollbar-track{background:#eee9ec}
#sheetScroll::-webkit-scrollbar-thumb{background:#99838f;border-radius:3px}
#sheetScroll:hover::-webkit-scrollbar-thumb{background:#805064}
body.pf-shell.test-active #viewport{overflow:visible;max-height:none;min-height:100%}
body.pf-shell.test-ready #sheetScroll{overflow-y:hidden}
body.pf-shell.test-ready #viewport{height:100%;overflow:hidden}
body.pf-shell.test-ready.sizing-preview #sheetScroll{overflow-y:auto}
body.pf-shell.test-ready.sizing-preview #viewport{height:auto;min-height:100%;overflow:visible}
@media(max-width:700px){#sheetScroll{width:calc(100% + 32px);margin-inline:-16px;padding-inline:16px}}
body.pf-shell.test-ready main{height:100svh;display:flex;flex-direction:column;overflow:hidden}
body.pf-shell.test-ready header.page-head{display:none}
body.test-ready #toolbar{width:100%;position:relative}
body #toolbar #start{min-width:110px}
body.test-ready #timer{visibility:hidden}
body #toolbar #setupLinks{width:auto;max-width:none;margin:0}
body #toolbar #language{margin-left:0}
body.test-ready #test{display:flex;flex-direction:column;flex:1;min-height:0}
body.pf-shell.test-ready #viewport{position:relative;flex:1;min-height:0;max-height:none;overflow:hidden}
body.test-ready #grid{filter:blur(12px);opacity:.35;pointer-events:none;user-select:none}
body.test-ready.sizing-preview #grid{filter:none;opacity:1}
body.test-ready.sizing-preview #readyOverlay{visibility:hidden;pointer-events:none}
body.pf-shell.test-ready.sizing-preview #viewport{overflow-y:auto}
body.test-active #viewOptions{display:none}
#readyOverlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:24px;background:#f8f5f74d;z-index:2}
#readyPanel{width:100%;max-width:640px;max-height:100%}
#readyPanel .researcher-info{margin:0;padding:16px 24px;background:#f8f5f7;border-radius:12px}
#finishError{color:#a22d20}
body.pf-shell #grid button.crossed::after{width:112%;left:-6%;height:2.5px;background:#075bb5}
body.pf-shell.test-active #notice{flex-shrink:0;margin:6px 0 0;font-size:.85rem}
body.pf-shell main{padding:32px 24px}
body.pf-shell:not(.test-active) main{min-height:100svh;display:flex;flex-direction:column;justify-content:center}
body.pf-shell header.page-head{width:100%;max-width:640px;margin:0 auto 18px;padding:0;background:transparent;border:0}
#setupLinks{width:100%;max-width:640px;margin:0 auto 16px}
body.pf-shell #setupLinks .home-link{padding:0;border:0;border-radius:0;min-height:0;background:transparent;font-weight:500}
body.pf-shell .card{width:100%;max-width:640px;margin:0 auto}
body.pf-shell .card p{line-height:1.6}
.setup-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
.setup-actions .btn{margin:0}
body.pf-shell #qr{border:1px solid var(--pf-border);border-radius:12px;padding:20px}
body.pf-shell #timer{color:var(--brand-dark)}
@media(max-width:700px){body.pf-shell main{padding:24px 16px}}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}header{display:flex;align-items:center;gap:24px;padding:16px 28px;background:white;border-bottom:1px solid #e8e0e5}header a{color:var(--primary);font-weight:700;text-decoration:none}h1{font-size:22px;margin:0;flex:1}h2{font-size:22px}main{padding:24px}p{line-height:1.6}button,select{font:inherit;border-radius:12px;padding:12px 18px;border:1px solid var(--primary);background:var(--primary);color:white;cursor:pointer}button:disabled{opacity:.45;cursor:default}button.secondary,select{background:white;color:var(--primary)}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #1976d2;outline-offset:3px}.card{max-width:850px;margin:24px auto;background:white;border:1px solid #e8e0e5;border-radius:20px;padding:28px}.card button{margin:8px 8px 0 0}.note{color:#606473;font-size:14px}.toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;position:sticky;top:0;z-index:3;background:#f8f5f7;padding:12px 0}.toolbar label{display:flex;align-items:center;gap:8px;font-size:14px}.toolbar strong{font-variant-numeric:tabular-nums;min-width:64px;font-size:21px}#mode{min-height:26px;color:#604052;font-weight:600;margin:4px 0 12px}#viewport{overflow:auto;max-height:calc(100vh - 210px);border:1px solid #ded6da;background:white;border-radius:12px;overscroll-behavior:contain}#grid{width:max-content;padding:12px;display:grid;grid-template-columns:repeat(40,var(--cell));gap:0}#grid button{border:0;border-radius:0;background:white;color:#222;font-family:Georgia,'Times New Roman',serif;font-size:calc(var(--cell)*.66);width:var(--cell);height:calc(var(--cell)*1.25);padding:0;position:relative;user-select:none;touch-action:manipulation}#grid button:hover{background:#f0e8ed}#grid button.crossed:after{content:'';position:absolute;width:95%;height:2px;background:#1565c0;left:3%;top:50%;transform:rotate(45deg)}#grid button.boundary:before{content:'';position:absolute;right:0;top:6%;height:88%;width:2px;background:#1565c0}#grid button.selected{outline:2px solid var(--primary);outline-offset:-2px;background:#f0e8ed}#grid button:last-child{border:0}#qr{padding:24px;background:white;width:max-content;max-width:100%;margin:24px auto}#qr img,#qr canvas{max-width:100%;height:auto}#notice{color:#a22d20;text-align:center}dialog{max-width:520px;border:1px solid #e8e0e5;border-radius:20px;padding:28px}dialog::backdrop{background:#0006}.actions{display:flex;justify-content:flex-end;gap:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(max-width:700px){header{padding:16px;gap:12px}main{padding:12px}.card{padding:20px}h1{font-size:18px}}

body #viewOptions .view-options-panel{position:static;display:flex;align-items:center;gap:12px;width:auto;padding:0;background:transparent;border:0;border-radius:0;box-shadow:none}
body #viewOptions label{margin:0;white-space:nowrap;font-size:.8rem}
body #viewOptions input{width:150px;margin:0}
/* Slim sizing control; keep a comfortable pointer target. */
body #viewOptions #size{appearance:none;-webkit-appearance:none;height:24px;background:transparent;cursor:pointer}
body #viewOptions #size::-webkit-slider-runnable-track{height:2px;background:#d5cbd0;border-radius:1px}
body #viewOptions #size::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:10px;height:10px;margin-top:-4px;border:0;border-radius:50%;background:#805064}
body #viewOptions #size::-moz-range-track{height:2px;background:#d5cbd0;border-radius:1px}
body #viewOptions #size::-moz-range-progress{height:2px;background:#805064}
body #viewOptions #size::-moz-range-thumb{width:10px;height:10px;border:0;border-radius:50%;background:#805064}

#previousTestControls{display:block} .saved-test-row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0} #clearPrevious{margin-top:8px}

body.pf-shell #setupLinks{display:flex;align-items:center;gap:10px;width:auto;max-width:none;margin:0} body.pf-shell #setupLinks .home-link,body.pf-shell #setupLinks #backInstructions{min-height:30px;height:30px;padding:0 12px;border:1px solid #d9cdd5;border-radius:3px;background:transparent;font-size:.75rem;font-weight:500;white-space:nowrap} body.pf-shell header.page-head{justify-content:flex-end;gap:12px}

#readyPanel{position:relative} #readyPanel .researcher-info{position:absolute;top:100%;left:0;right:0;border-radius:6px} #researcherContent{overflow:hidden} @media(prefers-reduced-motion:reduce){#researcherContent{scroll-behavior:auto}}

#sheetScroll{position:relative} #readyOverlay{scrollbar-width:auto;scrollbar-color:#99838f #eee9ec} #readyOverlay::-webkit-scrollbar{width:10px} #readyOverlay::-webkit-scrollbar-track{background:#eee9ec} #readyOverlay::-webkit-scrollbar-thumb{background:#99838f;border-radius:3px} #readyOverlay:hover::-webkit-scrollbar-thumb{background:#805064} body.pf-shell.test-ready.sizing-preview #viewport{overflow:visible}
body.pf-shell.test-ready #sheetScroll{scrollbar-gutter:auto}
body.pf-shell.pf-compact #confirmFinish{width:340px;max-width:calc(100vw - 40px);padding:24px;border:1px solid #d9cdd5;border-radius:6px;background:#fff;color:#202133;font-family:inherit;box-shadow:0 12px 40px #2021331a}
body.pf-shell.pf-compact #confirmFinish h2{margin:0 0 24px;font-size:18px;line-height:1.4;font-weight:600}
body.pf-shell.pf-compact #confirmFinish .actions{display:flex;justify-content:flex-end;gap:12px}
body.pf-shell.pf-compact #confirmFinish .btn{min-width:104px;height:36px;min-height:36px;margin:0;padding:0 14px;border-radius:3px;font-size:.84rem}
body.pf-shell #confirmFinish::backdrop{background:#20213355}

#moreRows{position:fixed;right:24px;bottom:20px;z-index:4;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:1px solid #d9cdd5;border-radius:4px;background:#fffffff0;color:#805064;pointer-events:none}

.saved-test-row,.completed-test-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid #e8e0e5}.saved-test-info{font-size:.8rem;color:#756a72}.saved-test-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}body.pf-shell.pf-compact .saved-test-actions .btn{margin:0;min-height:32px;height:32px;padding:0 12px;font-size:.8rem;border-radius:3px}body.pf-shell.pf-compact #confirmRemove{width:360px;max-width:calc(100vw - 40px);padding:24px;border-radius:6px;border:1px solid #d9cdd5;background:#fff}#confirmRemove h2{font-size:18px;font-weight:600;margin:0 0 12px}#confirmRemove p{font-size:.9rem;margin:0 0 24px}#confirmRemove .actions{display:flex;justify-content:flex-end;gap:12px}#confirmRemove .btn{min-width:104px}
body.pf-shell.pf-compact .saved-qr-dialog{width:fit-content;max-width:calc(100vw - 32px);max-height:calc(100svh - 32px);padding:24px;border:1px solid #d9cdd5;border-radius:6px;background:#fff;overflow:auto} .saved-qr-dialog::backdrop{background:#20213366} #savedQrCode{width:420px;max-width:100%;background:#fff} #savedQrCode img,#savedQrCode canvas{display:block;max-width:100%;height:auto}



#moreRows{right:auto;left:50%;transform:translateX(-50%);width:32px;height:32px;border:0;border-radius:0;background:transparent;color:#805064;box-shadow:none} #moreRows.scroll-hint-intro{animation:more-rows-descend 1.8s cubic-bezier(.2,.6,.3,1) 1} @keyframes more-rows-descend{from{transform:translate(-50%,var(--hint-start,0px))}to{transform:translate(-50%,0)}} @media(prefers-reduced-motion:reduce){#moreRows.scroll-hint-intro{animation:none}}
@media(max-width:899px){
  body.pf-shell.test-ready #viewOptions{display:none}
  body.pf-shell.test-ready #toolbar{flex-wrap:nowrap;align-items:center;gap:8px;width:100%}
  body.pf-shell.pf-compact.test-ready #toolbar #start{min-width:72px;min-height:30px;height:30px;padding:0 10px;font-size:.75rem;flex-shrink:0}
  body.pf-shell.test-ready #toolbar #setupLinks{margin-left:auto;flex-shrink:0}
  body.pf-shell.test-ready #toolbar #language{margin-left:0;flex-shrink:0}
  body.pf-shell.test-ready #toolbar #setupLinks .home-link{padding:0 10px}
}
