:root{font-family:Arial,Helvetica,sans-serif;color:#fff;background:#000;font-size:16px;color-scheme:dark;--blue:#0808bb;--soft-red:#ef4444}*{box-sizing:border-box}body{margin:0;min-height:100dvh}header{background:var(--blue);text-align:center;font-size:25px;font-weight:400;padding:12px 8px;line-height:28px}sup{font-size:.52em;vertical-align:super;line-height:0;margin-left:2px}main{width:100%;max-width:480px;margin:0 auto;padding:18px 18px 28px;outline:none}h1{font-size:25px;line-height:1.3;text-align:center;margin:0 0 20px;font-weight:600}.login h1{margin-bottom:16px}label{display:block;font-size:19px;margin-bottom:7px}input,textarea{width:100%;border:1.5px solid #747780;border-radius:7px;background:#fff;color:#000;color-scheme:light;caret-color:#000;font:inherit;outline:none}input{font-size:23px;line-height:28px;padding:10px 13px;height:51px;letter-spacing:.02em}input::placeholder{font-size:20px;letter-spacing:0;color:#666}input:focus,textarea:focus{border-color:#9bafff;box-shadow:0 0 0 1px #9bafff}input[aria-invalid=true]{border-color:var(--soft-red);box-shadow:0 0 0 1px var(--soft-red)}.field-error{color:var(--soft-red);font-size:14px;min-height:21px;line-height:18px;margin:4px 0 7px}.primary{width:100%;border:0;border-radius:7px;background:var(--blue);color:#fff;padding:13px 12px;font-size:21px;font-weight:600;min-height:51px;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #b6c4ff;outline-offset:3px}button:disabled{opacity:.65;cursor:wait}.vas{padding-top:16px}.vas h1{font-size:clamp(18px,5.25vw,25px);white-space:nowrap;margin-bottom:17px}.tiles{display:grid;gap:7px}.tile{width:100%;min-height:48px;height:clamp(48px,calc((100dvh - 177px)/11),62px);border:0;border-radius:7px;color:#fff;font-size:24px;font-weight:600;cursor:pointer}.tile:first-child,.tile:last-child{font-size:22px}.tile:active{filter:brightness(.82)}.comments h1{font-size:clamp(21px,6vw,26px);white-space:nowrap}.optional{color:#b5b8c1;font-size:16px;font-weight:400}textarea{display:block;font-size:23px;line-height:1.5;padding:14px;min-height:140px;height:clamp(140px,35dvh,290px);resize:vertical}textarea::placeholder{color:#666}.count{text-align:right;font-size:14px;color:#b5b8c1;margin:8px 0 20px}.status{min-height:calc(100dvh - 52px);display:flex;flex-direction:column;justify-content:center;padding:25px 24px 90px;text-align:center}.status h1{font-size:28px;line-height:1.4;font-weight:400;margin-bottom:20px}.status p{color:#bfc2ca;font-size:18px;margin:0}.calm{width:94px;height:94px;margin:0 auto 30px;border:1px solid #424ca2;border-radius:50%;display:grid;place-items:center;background:#0c1023}.calm svg{width:43px;height:43px;stroke:#b7c4ee;fill:none;stroke-width:1.3}.unavailable h1{font-size:26px}.notice{font-size:16px;color:var(--soft-red);text-align:center}.review{max-width:680px;padding-top:32px}.review h1{text-align:left}.review p{font-size:18px;line-height:1.5;color:#c4c7d0}.review a{display:block;background:#181b24;border:1px solid #3a4155;border-radius:9px;padding:16px;color:white;text-decoration:none;margin:10px 0;font-size:18px}.review strong{color:white}.review small{color:#b3b8c6}.review code{color:white}@media(max-height:480px){main.login{padding-top:10px}.login h1{font-size:22px;margin-bottom:9px}header{padding:7px;font-size:23px}.field-error{margin-bottom:3px;min-height:18px}input{height:46px;padding:7px 12px}.primary{padding:10px;min-height:46px}.status{padding-bottom:30px}}@media(prefers-reduced-motion:no-preference){.tile,.primary{transition:filter .12s}} 

button{font-family:inherit}
.patient-logout{align-self:center;background:none;border:0;color:#9bafff;font-size:13px;line-height:18px;margin-top:7px;padding:7px 10px;cursor:pointer}
.patient-logout:hover{text-decoration:underline}

/* Fit the patient flow inside the measured visual viewport, including keyboard changes. */
html,body{height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
#viewport{position:fixed;top:0;left:0;width:100%;height:100svh;display:flex;flex-direction:column;overflow:hidden;--bottom-clearance:12px;--visible-height:100svh}
header{flex:0 0 auto;font-size:24px;line-height:28px;padding:8px}
main{flex:1 1 0;min-height:0;padding:12px 18px max(var(--bottom-clearance),env(safe-area-inset-bottom));display:flex;flex-direction:column}
h1{flex:none;font-size:24px;margin:0 0 12px}
.login h1{margin-bottom:12px}
.login form{display:flex;flex-direction:column;min-height:0;gap:0}
label{font-size:18px;line-height:22px;margin-bottom:5px}
input{flex:none;height:46px;padding:7px 12px;font-size:22px}
.field-error{flex:none;min-height:0;line-height:18px;margin:3px 0 7px;font-size:14px}
.field-error:empty{height:5px;margin:0 0 7px}
.primary{flex:none;min-height:46px;padding:10px 12px;font-size:21px;line-height:26px}
.notice{flex:none;margin:6px 0 0;font-size:14px;line-height:18px}
.notice:empty{display:none}
.vas{padding-top:10px}
.vas h1{font-size:clamp(18px,5.1vw,24px);line-height:1.25;margin-bottom:10px}
.tiles{flex:1;min-height:0;display:grid;grid-template-rows:repeat(11,minmax(0,1fr));gap:5px}
.tile{min-height:0;height:100%;padding:0 4px;font-size:clamp(16px,calc(var(--visible-height)*.032),24px);line-height:1;border-radius:6px;overflow:hidden}
.tile:first-child,.tile:last-child{font-size:clamp(16px,calc(var(--visible-height)*.029),22px)}
.comments h1{font-size:clamp(21px,5.8vw,25px);margin-bottom:12px}
.comments form{flex:1;min-height:0;display:flex;flex-direction:column}
.comments textarea{flex:1;min-height:0;height:auto;max-height:290px;resize:none;padding:10px 12px;font-size:22px;line-height:1.4;overflow-y:auto}
.count{flex:none;margin:5px 0 9px;line-height:18px}
.status{min-height:0;padding-top:24px;padding-bottom:max(var(--bottom-clearance),env(safe-area-inset-bottom));justify-content:center}
#viewport.compact header{font-size:22px;line-height:26px;padding:6px}
#viewport.compact main{padding-top:8px}
#viewport.compact h1{font-size:21px;margin-bottom:8px}
#viewport.compact.editing .login h1{display:none}
#viewport.compact label{font-size:17px;line-height:20px;margin-bottom:4px}
#viewport.compact input{height:44px;padding:6px 12px}
#viewport.compact .primary{min-height:44px;padding:9px 12px}
#viewport.compact .field-error:empty{height:2px;margin-bottom:5px}
#viewport.compact .comments h1{font-size:21px}
#viewport.compact .comments textarea{font-size:20px}
#viewport.compact .count{margin:4px 0 6px}
.review-page{overflow:auto}
.review-page #viewport{position:static;height:auto!important;overflow:visible;display:block}
.review-page main{display:block;min-height:0;padding:28px 18px}

/* Each VAS label scales with its actual tile, including short landscape screens. */
.vas .tiles{gap:clamp(2px,calc(var(--visible-height)*.007),6px)}
.vas .tile{container-type:size;display:flex;align-items:center;justify-content:center}
.vas .tile span{font-size:min(32px,78cqh,8cqw);line-height:1.1;white-space:nowrap}
.vas .tile:first-child span,.vas .tile:last-child span{font-size:min(28px,78cqh,7cqw)}
#viewport.compact .vas{padding-top:5px}
#viewport.compact .vas h1{font-size:clamp(16px,4.8vw,21px);margin-bottom:5px}

/* Keep the action high even when Safari delays reporting keyboard dimensions. */
.comments textarea{flex:0 1 116px;height:116px;max-height:116px}
#viewport.editing .comments textarea{flex-basis:100px;height:100px;max-height:100px}

/* A stable PIN layout: no keyboard-triggered reflow or error-message jumps. */
body.pin-page{position:fixed;inset:0;width:100%;overflow:hidden}
#viewport.pin-screen{overscroll-behavior:none;touch-action:pinch-zoom}
#viewport.pin-screen header{font-size:22px;line-height:26px;padding:6px}
#viewport.pin-screen main{padding-top:8px;overflow:hidden}
#viewport.pin-screen .login h1{display:none}
#viewport.pin-screen label{font-size:17px;line-height:20px;margin-bottom:4px}
#viewport.pin-screen input{height:44px;padding:6px 12px}
#viewport.pin-screen .field-error,#viewport.pin-screen .field-error:empty{height:18px;min-height:18px;line-height:18px;margin:2px 0 4px}
#viewport.pin-screen .primary{height:44px;min-height:44px;padding:9px 12px}

/* Comments stays anchored; only its text area can scroll internally. */
body.comments-page{position:fixed;inset:0;width:100%;overflow:hidden}
#viewport.comments-screen{overscroll-behavior:none}
#viewport.comments-screen header{font-size:22px;line-height:26px;padding:6px}
#viewport.comments-screen main{padding-top:8px;overflow:hidden}
#viewport.comments-screen .comments h1{font-size:21px;margin-bottom:8px}
#viewport.comments-screen label{font-size:17px;line-height:20px;margin-bottom:4px}
#viewport.comments-screen .comments textarea{flex:0 1 100px;height:100px;max-height:100px;font-size:20px;touch-action:pan-y pinch-zoom;overscroll-behavior:none}
#viewport.comments-screen .count{margin:4px 0 6px}
#viewport.comments-screen .primary{height:44px;min-height:44px;padding:9px 12px}

/* Apply the page lock consistently throughout the patient flow. */
body.flow-page{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
#viewport.flow-locked{overflow:hidden;overscroll-behavior:none}
#viewport.flow-locked main{overflow:hidden}
#viewport.flow-locked textarea{overscroll-behavior:none}

.status .close-instruction{color:#fff;font-size:22px;font-weight:600;line-height:1.4}


/* Reserve Safari control clearance even on the shortest keyboard viewport. */
#viewport.pin-screen.very-short header{padding:2px 6px;line-height:24px}
#viewport.pin-screen.very-short main{padding-top:4px}
#viewport.pin-screen.very-short label{line-height:18px;margin-bottom:2px}
#viewport.pin-screen.very-short .field-error,
#viewport.pin-screen.very-short .field-error:empty{margin:0 0 2px}
