/* Assessment uses the available viewport; content remains scrollable if a
   user's text size or an unusually small window needs more space. */
body.is-assessing .site-header{height:72px}
body.is-assessing main{margin-top:20px;padding-bottom:20px}
.assessment-view{--blue:#347cff;--night:#17202f;--ice:#f3f6ff}
.assessment-view .workspace-heading{height:40px;margin-bottom:16px;flex-wrap:nowrap;align-items:center}
.assessment-view .section-label{margin:0;color:var(--ink);font:400 32px/1.15 Georgia,"Times New Roman",serif;letter-spacing:-.8px}
.result-stage{min-height:0}
.analysis-panel{position:relative;isolation:isolate;overflow:hidden;height:clamp(240px,calc(100dvh - 455px),300px);padding:22px 30px;border-radius:12px;background:var(--night);color:var(--ice)}
.analysis-phase{position:relative;z-index:2;margin:0 0 18px;font-size:12px;line-height:18px;color:#c5d2eb;letter-spacing:.2px}
.analysis-panel.is-processing .analysis-phase{animation:phase-breathe 1.8s ease-in-out infinite}
.result-sheet{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);align-items:center;gap:40px;padding:0;border:0;min-height:158px;transition:filter .8s cubic-bezier(.16,1,.3,1),opacity .8s ease}
.result-reading{height:158px}
.result-reading h1{font:400 36px/1.12 Georgia,"Times New Roman",serif;letter-spacing:-1.2px;max-width:380px;min-height:82px;color:#fff}
.result-description{color:#c4cee1;font-size:12px;line-height:1.65;margin:12px 0 8px;max-width:360px;min-height:41px}
.result-summary{margin:0;gap:8px;color:#b4c2db;font-size:10px;line-height:14px}
.score-panel{background:none;min-height:0;margin:0;padding:0;color:var(--ice);align-self:center}
.score-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 23px}
.score-heading label{color:#cbd6ee;font-size:11px}
#score-value{font:20px/1.2 ui-monospace,SFMono-Regular,monospace;letter-spacing:-.7px;color:white}
.score-track{height:20px;position:relative;margin:0 0 16px}
#result-score.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0)}
.score-rail{position:absolute;inset:0;overflow:hidden;background:#44516a;mask-image:repeating-linear-gradient(90deg,#000 0 5px,transparent 5px 9px);-webkit-mask-image:repeating-linear-gradient(90deg,#000 0 5px,transparent 5px 9px)}
.score-fill{position:absolute;inset:0 auto 0 0;width:var(--score,100%);height:100%;background:#5896ff;min-width:0}
.score-mark{top:26px;height:4px;background:#8190aa;width:1px}
.score-ends{font-size:10px;color:#c2cce0;margin:14px 0 0;line-height:16px}
.analysis-particles i{position:absolute;left:var(--x);top:var(--y);width:var(--size);height:var(--size);border-radius:50%;background:#c8e3ff;animation:speck-drift var(--speed) linear infinite;animation-delay:var(--delay);opacity:var(--alpha);will-change:transform}
.analysis-particles{position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.2;transition:opacity .7s}
.analysis-particles i{box-shadow:0 0 12px 2px #5a91ff55}
.analysis-panel.is-processing .analysis-particles,.analysis-panel.is-pending .analysis-particles{opacity:.9}
.analysis-panel.is-processing:before,.analysis-panel.is-pending:before{content:"";position:absolute;z-index:0;width:75%;height:76px;top:135px;right:-4%;border-radius:100px;background:#347cff;filter:blur(30px);opacity:.65;animation:field-drift 7s ease-in-out infinite alternate;pointer-events:none}
.analysis-panel.is-processing:after,.analysis-panel.is-pending:after{content:"";position:absolute;z-index:0;width:52%;height:46px;top:165px;left:5%;border-radius:100px;background:#7651e8;filter:blur(32px);opacity:.6;animation:field-drift 9s ease-in-out infinite alternate-reverse;pointer-events:none}
.result-sheet.is-locked{filter:blur(11px);opacity:.55;pointer-events:none;user-select:none}
.result-sheet.is-locked .result-reading{min-height:182px}
.result-sheet.is-locked .result-reading h1{height:82px;min-height:82px;background:#94b1e6;width:83%;border-radius:8px;color:transparent;margin:0}
.result-sheet.is-locked .result-description{height:41px;min-height:41px;background:#5b83bf;width:67%;border-radius:5px;margin-top:12px}
.result-sheet.is-locked .result-summary,.result-sheet.is-locked .score-heading,.result-sheet.is-locked .score-ends,.result-sheet.is-locked .score-mark{visibility:hidden}
.result-sheet.is-locked .score-fill{width:100%}
.analysis-veil{position:absolute;z-index:3;inset:42px 0 0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity .3s;opacity:0;visibility:hidden}
.analysis-panel.is-pending .analysis-veil{opacity:1;visibility:visible}
.analysis-veil span{font-size:13px;letter-spacing:.1px;color:#f7f9ff;text-shadow:0 1px 10px #17202f}
.assessment-response{display:grid;align-items:start;position:relative;min-height:0;padding-top:20px}
.analysis-wait{position:static;min-height:0;display:flex;align-items:flex-start;gap:12px;padding:16px 0;background:none}
.analysis-wait p{margin:0;font-size:12px;color:#617187}
.waiting-line{width:30px;height:2px;margin-top:8px;background:#347cff;transform-origin:left;animation:waiting-line 1.4s ease-in-out infinite}
.vote-inline{position:relative;display:block;width:100%;max-width:760px;margin:0 auto;padding:0;border:0;background:none;opacity:1;transition:opacity .22s ease}
.vote-inline.is-leaving{opacity:0;pointer-events:none}
.vote-inline.is-concealed{visibility:hidden;opacity:0;pointer-events:none}
.vote-heading{display:flex;align-items:baseline;justify-content:space-between;gap:24px;margin-bottom:16px}
.vote-heading h2{font:400 24px/1.25 Georgia,"Times New Roman",serif;letter-spacing:-.6px;margin:0;color:#202b3c}
.vote-heading .text-button{font-size:11px;color:#5b6d85;padding:3px 0;white-space:nowrap}
.vote-inputs{min-width:0}
.vote-inline .kss-options{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:0;padding:4px;border:1px solid #d5dce6;border-radius:10px;background:#e8ecf2}
.vote-inline .kss-choice{isolation:isolate;min-width:0;padding:0 2px}
.vote-inline .kss-choice:not(:last-child):after{content:"";position:absolute;right:-1px;top:13px;width:1px;height:16px;background:#c8d2df;z-index:-1}
.vote-inline .kss-choice>span{height:40px;min-height:40px;position:relative;pointer-events:none;border:0;border-radius:6px;color:#3f526d;font:400 15px/1 ui-monospace,SFMono-Regular,monospace;transition:background .12s,color .12s}
.vote-inline .kss-choice:hover>span{background:#d6dfec;color:#244b88}
.vote-inline .kss-choice input:checked+span{background:#2f6ce0;color:#fff;box-shadow:0 2px 5px #21488324}
.vote-inline .kss-choice input:focus-visible+span{outline:2px solid #2f6ce0;outline-offset:2px}
.vote-inline .scale-labels{margin:8px 2px 0;font-size:11px;color:#5e6d82}
.vote-status{display:grid;height:38px;align-items:center;min-width:0}
.vote-status>*{grid-area:1/1;max-height:38px;overflow:auto}
.vote-status .kss-description{min-height:0;line-height:1.5;font-size:12px;color:#2d5898}
.vote-status .error-message{margin:0;padding:6px 9px;font-size:11px;line-height:1.5}
.vote-status:has(#vote-error:not([hidden])) .kss-description{visibility:hidden}
.vote-footer{display:flex;align-items:center;gap:18px;justify-content:space-between;padding-top:10px}
.vote-consent{display:flex;flex:1;align-items:flex-start;gap:12px;cursor:pointer;color:var(--ink);line-height:1.5;padding:12px;border:1px solid #c6d1e1;background:#e8edf4;border-radius:8px;min-width:0}
.vote-consent:has(input:checked){background:#e5edfc;border-color:#6896de}
.vote-consent input{width:18px;height:18px;flex-shrink:0;accent-color:#2f6ce0;margin:1px 0 0}
.vote-consent strong{display:block;font-size:13px;font-weight:600}
.vote-consent small{display:block;margin-top:3px;color:#526580;font-size:11px;line-height:1.5}
.vote-footer>.button{flex-shrink:0;min-width:148px;min-height:46px;background:#2f6ce0;border-radius:6px;color:white;padding:12px 20px;height:46px}
.vote-footer>.button:hover:not(:disabled){background:#2058bd}
.vote-footer>.button:disabled{background:#dce3ee;color:#57667e;opacity:1}
#vote-title:focus,#result-title:focus{outline:none}
.result-actions{display:flex;flex-direction:column;align-items:stretch;width:100%;max-width:760px;margin:0 auto;gap:10px;padding:0;opacity:1;animation:result-appear .3s ease both}
.self-report-result{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:0 0 12px;border-bottom:1px solid var(--line)}
.self-report-result h2{font:400 22px/1.25 Georgia,"Times New Roman",serif;letter-spacing:-.5px;margin:0}
.self-report-result p{font-size:12px;line-height:1.5;color:#526580;margin:8px 0 0;max-width:590px}
#self-report-value{white-space:nowrap;color:#2e5fa7;font:400 24px/1.25 ui-monospace,SFMono-Regular,monospace;letter-spacing:-.8px}
.result-actions>.button{align-self:flex-end;background:transparent;color:var(--ink);border:1px solid #bac5d4;border-radius:24px;min-width:0;min-height:44px;padding:10px 18px;gap:8px;font-size:12px}
.result-actions>.button:hover{background:#e8edf4;border-color:#91a2ba}
.result-actions .quality-warnings{width:100%;margin:0;padding:8px 12px;font-size:11px;line-height:1.5}
.result-actions .research-result{width:100%;margin:0;min-height:22px;font-size:11px;color:#526580;gap:10px}
.result-actions .saved-dot{display:none}
.result-actions .research-result.is-saved #saved-status{color:#2e5fa7}
.result-actions .error-message{width:100%;margin:0}
@keyframes speck-drift{0%{transform:translate(-16px,8px)}50%{transform:translate(20px,-9px)}100%{transform:translate(56px,8px)}}
@keyframes field-drift{to{transform:translate(-7%,-14px) rotate(-5deg)}}
@keyframes phase-breathe{50%{opacity:.6}}
@keyframes waiting-line{50%{transform:scaleX(.35);opacity:.45}}
@keyframes result-appear{from{opacity:0}to{opacity:1}}
@media(max-width:850px){
  .result-sheet{gap:26px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .result-reading h1{font-size:34px}
  .vote-inline,.result-actions{max-width:690px}
}
@media(max-width:650px){
  body.is-assessing .site-header{height:60px}
  body.is-assessing main{margin-top:10px;padding-bottom:16px}
  .assessment-view .workspace-heading{margin-bottom:12px;height:36px}
  .assessment-view .section-label{font-size:28px;letter-spacing:-.6px}
  .analysis-panel{height:clamp(230px,calc(100dvh - 410px),300px);padding:18px 22px;border-radius:10px}
  .analysis-phase{font-size:11px;line-height:16px;margin-bottom:16px}
  .result-sheet{display:flex;flex-direction:column;gap:14px;align-items:stretch;min-height:0}
  .result-reading{height:63px}
  .result-reading h1{font-size:28px;line-height:1.12;letter-spacing:-.7px;min-height:63px;max-width:none}
  .result-description,.result-summary{display:none}
  .score-panel{align-self:stretch;padding:0;margin:0;min-height:0}
  .score-heading{margin-bottom:12px;gap:8px;flex-wrap:nowrap}
  .score-heading label{font-size:10px}
  #score-value{font-size:17px}
  .score-track{height:16px;margin-bottom:12px}
  .score-mark{top:21px}
  .score-ends{font-size:9px;line-height:14px;margin-top:10px}
  .result-sheet.is-locked .result-reading{min-height:63px}
  .result-sheet.is-locked .result-reading h1{height:63px;min-height:63px;width:80%}
  .result-sheet.is-locked .score-panel{height:auto}
  .analysis-veil{inset:30px 0 0}
  .analysis-veil span{font-size:12px}
  .analysis-panel.is-processing:before,.analysis-panel.is-pending:before{width:120%;right:-10%;top:55%}
  .analysis-panel.is-processing:after,.analysis-panel.is-pending:after{top:34%;width:100%}
  .assessment-response{min-height:0;padding-top:16px}
  .vote-inline{padding:0}
  .vote-heading{align-items:flex-start;gap:14px;margin-bottom:12px}
  .vote-heading h2{font-size:21px;letter-spacing:-.4px;max-width:240px}
  .vote-heading .text-button{padding-top:4px;font-size:10px}
  .vote-inline .kss-options{padding:3px;gap:0}
  .vote-inline .kss-choice{padding:0 1px}
  .vote-inline .kss-choice>span{height:40px;min-height:40px;font-size:13px}
  .vote-inline .kss-choice:not(:last-child):after{top:13px;height:14px}
  .vote-inline .scale-labels{font-size:10px;margin-top:7px}
  .vote-status{height:40px}
  .vote-status>*{max-height:40px}
  .vote-status .kss-description{font-size:11px}
  .vote-footer{flex-wrap:nowrap;align-items:center;gap:12px;padding-top:8px}
  .vote-consent{padding:10px;gap:8px;min-width:0}
  .vote-consent strong{font-size:12px}
  .vote-consent small{font-size:10.5px;line-height:1.4;margin-top:2px}
  .vote-consent input{width:18px;height:18px}
  .vote-footer>.button{min-width:112px;height:44px;min-height:44px;padding:10px 12px}
  .result-actions{gap:10px;padding:0}
  .self-report-result{gap:15px;padding-bottom:12px}
  .self-report-result h2{font-size:21px}
  .self-report-result p{font-size:12px;line-height:1.5}
  #self-report-value{font-size:22px}
}
/* Short phones retain readable controls; decorative space shrinks first. */
@media(max-width:650px) and (max-height:650px){
  body.is-assessing .site-header{height:44px}
  body.is-assessing main{margin-top:6px;padding-bottom:8px}
  .assessment-view .workspace-heading{height:32px;margin-bottom:8px}
  .assessment-view .section-label{font-size:26px}
  .analysis-panel{height:188px;padding:36px 16px 16px}
  .analysis-phase{position:absolute;top:12px;left:16px;font-size:10px;line-height:15px;margin:0}
  .result-sheet{gap:10px}
  .result-reading{height:54px}
  .result-reading h1{font-size:24px;min-height:54px}
  .result-sheet.is-locked .result-reading{min-height:54px}
  .result-sheet.is-locked .result-reading h1{height:54px;min-height:54px}
  .score-heading{margin-bottom:8px}
  #score-value{font-size:16px}
  .score-track{height:12px;margin-bottom:6px}
  .score-mark{top:16px}
  .score-ends{margin-top:8px;line-height:14px}
  .assessment-response{padding-top:8px}
  .vote-heading{margin-bottom:10px}
  .vote-inline .kss-options{padding:2px}
  .vote-inline .kss-choice>span{height:40px;min-height:40px;font-size:12px}
  .vote-inline .scale-labels{margin-top:5px}
  .vote-status{height:36px}
  .vote-status>*{max-height:36px}
  .vote-footer{gap:10px;padding-top:6px}
  .vote-consent{padding:9px;gap:7px}
  .vote-footer>.button{min-width:108px}
  .self-report-result h2{font-size:20px}
}
/* A shallow wide viewport has room horizontally, so use it. */
@media(min-width:760px) and (max-height:820px){
  body.is-assessing .site-header{height:52px}
  body.is-assessing main{margin-top:8px;padding-bottom:12px}
  .assessment-view .workspace-heading{height:32px;margin-bottom:12px}
  .assessment-view .section-label{font-size:26px}
  .result-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:start}
  .analysis-panel{height:min(400px,calc(100dvh - 128px));min-height:220px;padding:18px}
  .analysis-phase{font-size:10px;line-height:15px;margin-bottom:14px}
  .result-sheet{display:flex;flex-direction:column;gap:14px;align-items:stretch;min-height:0}
  .result-reading{height:63px}
  .result-reading h1{font-size:28px;line-height:1.12;min-height:63px;max-width:none}
  .result-description,.result-summary{display:none}
  .result-sheet.is-locked .result-reading{min-height:63px}
  .result-sheet.is-locked .result-reading h1{height:63px;min-height:63px}
  .score-panel{align-self:stretch}
  .score-heading{margin-bottom:12px;flex-wrap:nowrap}
  .score-heading label{font-size:10px}
  #score-value{font-size:17px}
  .score-track{height:16px;margin-bottom:12px}
  .score-mark{top:21px}
  .score-ends{font-size:9px;line-height:14px;margin-top:10px}
  .assessment-response{padding-top:0;min-height:0}
  .vote-heading{gap:14px;margin-bottom:12px}
  .vote-heading h2{font-size:21px}
  .vote-heading .text-button{font-size:10px}
  .vote-inline .kss-options{padding:2px}
  .vote-inline .kss-choice>span{height:40px;min-height:40px;font-size:13px}
  .vote-inline .scale-labels{font-size:10px;margin-top:7px}
  .vote-status{height:36px}
  .vote-status>*{max-height:36px}
  .vote-footer{gap:12px;padding-top:8px}
  .vote-consent{padding:10px;gap:8px}
  .vote-consent strong{font-size:12px}
  .vote-consent small{font-size:10.5px;line-height:1.4;margin-top:2px}
  .vote-footer>.button{min-width:112px;min-height:44px;height:44px;padding:10px 12px}
  .self-report-result h2{font-size:21px}
  .self-report-result p{font-size:12px}
  #self-report-value{font-size:22px}
}
@media(prefers-reduced-motion:reduce){.assessment-view *,.assessment-view *:before,.assessment-view *:after{animation:none!important;transition:none!important}.analysis-particles i{will-change:auto}}
.assessment-response>*{grid-area:1/1}

.participant-field{display:grid;gap:5px;padding-top:6px;font-size:13px;color:var(--ink)}
.participant-field input{width:min(100%,220px);height:40px;padding:0 10px;font:inherit;color:var(--ink);border:1px solid #b6c4d7;background:#fff;border-radius:6px}
.participant-field small{color:#526580;font-size:11px}

.participant-demographics{display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:13px;color:var(--ink)}
.participant-demographics label,.participant-demographics .custom-select{display:grid;gap:5px;min-width:0}
.participant-demographics small{color:#526580;font-size:11px}
.participant-demographics input[type="text"],.participant-demographics .select-trigger{width:100%;height:40px;padding:0 10px;font:inherit;color:var(--ink);border:1px solid #b6c4d7;background:#fff;border-radius:6px}
body[data-mode="public-analysis"] .vote-footer{justify-content:flex-end}
@media(max-width:380px){.participant-demographics{grid-template-columns:1fr}}
