:root{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;color:#20242c;background:#edf0f5;font-size:15px;--blue:#007aff;--pale:#e8f2ff;--line:#dce1e8;--muted:#647083;--white:#fff}*{box-sizing:border-box}body{margin:0}#shell{max-width:1220px;margin:24px auto;background:#f6f7fa;border:1px solid #d7dde6;border-radius:24px;box-shadow:0 18px 60px #293b5720;min-height:calc(100vh - 48px);display:flex;flex-direction:column;overflow:hidden}header{display:flex;align-items:center;justify-content:space-between;padding:20px 28px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px}.brand img{width:48px;height:48px;border-radius:12px}.brand strong{font-size:29px;letter-spacing:-1px;display:block}.brand small{color:var(--muted)}.pill{font-size:11px;color:#0068db;font-weight:700;letter-spacing:.06em;background:var(--pale);border-radius:20px;padding:8px 12px}main{padding:24px 28px;flex:1}footer{text-align:center;padding:16px;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}h1,h2,h3,p{margin:0}h1{font-size:29px;letter-spacing:-.6px}h2{font-size:20px}h3{font-size:16px}p{line-height:1.55}small,.muted{color:var(--muted)}.card{background:white;border:1px solid var(--line);border-radius:17px;padding:20px;min-width:0}.stack{display:grid;gap:14px}.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.spread{justify-content:space-between}.center{text-align:center}.narrow{max-width:560px;margin:24px auto}.hero{padding:32px}.hero img{width:64px;border-radius:16px;margin-bottom:12px}.blue{background:var(--pale);border-color:#d1e4ff}.label{font-size:13px;font-weight:600;color:var(--muted)}button,a.btn{appearance:none;font:inherit;font-weight:600;color:#29313d;background:#fff;border:1px solid var(--line);border-radius:11px;padding:11px 15px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;transition:background .14s,border-color .14s}button:hover,a.btn:hover{background:var(--pale);border-color:#9fc8ff}button.primary{background:var(--blue);color:white;border-color:var(--blue)}button.primary:hover{background:#0066dc}button:disabled{background:#e7eaf0;color:#929aa7;cursor:not-allowed;border-color:#e0e4ea}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #80b9ff;outline-offset:2px}button.danger{color:#ae3038}input,select{font:inherit;border:1px solid #cfd6e1;background:white;border-radius:10px;padding:11px;color:inherit;max-width:100%;min-width:0}input[type=checkbox]{width:28px;height:28px;accent-color:var(--blue);flex-shrink:0}input[type=file]{width:100%}label.field{display:grid;gap:6px;font-size:13px;font-weight:600}label.consent{display:flex;align-items:center;gap:12px;cursor:pointer;font-weight:650}.consent:has(input:checked){background:var(--pale);border-color:#83b8ff}.survey{display:grid;grid-template-columns:190px minmax(0,1fr);gap:20px;align-items:start}.sidebar{display:grid;gap:12px}.sidebar .card{padding:15px}.sidebar button{width:100%;justify-content:flex-start}.status{display:inline-block;padding:5px 9px;background:#e1f3e8;color:#286345;border-radius:8px;font-size:12px;font-weight:600}.progress{height:8px;border-radius:10px;background:#dce1e8;overflow:hidden}.progress span{display:block;height:100%;background:var(--blue);border-radius:10px;transition:width .2s}.sentence{min-height:175px;display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;font-size:clamp(22px,3vw,32px);font-weight:650;letter-spacing:-.5px;line-height:1.35}.scale{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.scale button,.scale .anchor{min-height:176px;display:flex;flex-direction:column;justify-content:space-between;gap:8px;text-align:center;padding:14px 7px;border-radius:14px;border:1px solid var(--line);background:white;color:#20242c;overflow-wrap:anywhere}.scale .anchor{min-height:105px}.scale button[aria-checked=true]{background:var(--pale);border:2px solid var(--blue);color:#005dc4;padding:13px 6px}.scale button:hover{background:#f0f6ff}.scale b,.anchor b{font-size:28px}.scale strong,.anchor strong{font-size:13px;line-height:1.3}.scale small,.anchor small{font-size:12px;font-weight:400;line-height:1.3}.radio{width:19px;height:19px;border:2px solid #8c96a5;border-radius:50%;display:inline-block}.scale button[aria-checked=true] .radio{border-color:var(--blue);background:var(--blue);box-shadow:inset 0 0 0 3px #fff}.two{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}.guide .example{background:#f5f7fa;border-radius:11px;padding:12px;display:flex;gap:12px}.number{min-width:46px;align-self:flex-start;padding:7px;background:var(--pale);color:#0068d9;font-weight:700;font-size:20px;border-radius:9px;text-align:center}.guide ul{padding-left:20px;margin:8px 0;line-height:1.6}.guide li::marker{color:var(--blue)}.guide h3{display:flex;gap:8px;align-items:center}.symbol{color:var(--blue);font-size:20px}dialog{border:1px solid var(--line);border-radius:22px;padding:0;max-width:min(900px,94vw);width:850px;max-height:92vh;color:inherit;background:#f6f7fa;box-shadow:0 20px 80px #18274445}dialog::backdrop{background:#25304970;backdrop-filter:blur(3px)}.dialog-inner{padding:20px;max-height:90vh;overflow:auto}.dialog-footer{position:sticky;bottom:-20px;background:#f6f7fa;padding:12px 0 4px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.metric b{display:block;font-size:27px;color:#17243b;margin-top:7px}.tablewrap{overflow:auto;max-height:450px}table{width:100%;border-collapse:collapse;font-size:13px;text-align:left}th,td{padding:10px 9px;border-bottom:1px solid #e9ecf1;white-space:nowrap}th{color:var(--muted);background:#f2f4f8;position:sticky;top:0}td.wrap{white-space:normal;min-width:190px}tr:hover td{background:#f3f7ff}.bar-chart{display:flex;align-items:flex-end;gap:12px;height:180px;padding:12px 4px 0}.bar-col{flex:1;text-align:center;display:flex;flex-direction:column;justify-content:flex-end;gap:4px;height:100%;font-size:12px}.bar-fill{background:#007aff;border-radius:6px 6px 0 0;min-height:0}.bar-track{flex:1;display:flex;align-items:flex-end;justify-content:center;background:#f0f3f8;border-radius:6px}.bar-track span{width:60%;max-width:90px}.line-chart{width:100%;height:auto;max-height:190px}.error{color:#a32e35;background:#fff0f0;padding:10px;border-radius:8px}.dot{width:11px;height:11px;border-radius:50%;display:inline-block}.emotion-list{display:grid;gap:9px}.emotion-list .row{flex-wrap:nowrap}.full{width:100%}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#26344a;color:white;border-radius:12px;padding:12px 18px;z-index:9;display:none;max-width:90vw}.linkbox{overflow-wrap:anywhere;font-size:13px;user-select:all}svg{display:block}.tab.active{background:var(--pale);border-color:#8fbeff;color:#0066d6}.notice{font-size:12px;line-height:1.5}.settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}@media(max-width:760px){#shell{margin:0;border:0;border-radius:0;min-height:100dvh}header{padding:13px 16px}.brand img{width:37px;height:37px}.brand strong{font-size:23px}main{padding:16px}.survey{grid-template-columns:1fr;gap:12px}.sidebar{display:flex;flex-wrap:wrap;gap:7px}.sidebar .card{padding:9px;flex:1}.sidebar .info-session{display:flex;gap:8px;align-items:center;justify-content:space-between}.sidebar .info-session hr{display:none}.sidebar .emotion-list{display:flex;flex-wrap:wrap;gap:8px}.sidebar button{width:auto}.scale{gap:5px}.scale button,.scale .anchor{min-height:150px;padding:8px 3px;border-radius:10px}.scale button[aria-checked=true]{padding:7px 2px}.scale b,.anchor b{font-size:21px}.scale strong,.anchor strong{font-size:10px}.scale small,.anchor small{font-size:9px}.sentence{min-height:130px;font-size:23px;padding:18px}.two{grid-template-columns:1fr}.metrics{grid-template-columns:1fr 1fr}.settings-grid{grid-template-columns:1fr 1fr}.card{padding:14px}h1{font-size:24px}button{padding:10px 12px}.hero{padding:22px}.dialog-inner{padding:14px}.dialog-footer{bottom:-14px}.navrow button{font-size:12px;padding:10px 8px}}@media(max-width:380px){main{padding:10px}.scale strong{font-size:9px}.scale small{font-size:9px}.scale{gap:3px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
@media(max-width:760px){.scale button,.scale .anchor{min-height:178px}.scale strong,.anchor strong{font-size:11px}.scale small,.anchor small{font-size:10.5px}}@media(max-width:380px){.scale strong,.anchor strong{font-size:10.5px}.scale small,.anchor small{font-size:10px}}

/* v2.0 Beta 2: compact survey shell and stable example badges. */
#shell{width:calc(100% - 48px);max-width:1220px}
body[data-view="survey"] #shell{max-width:1100px;min-height:0;margin:24px auto}
body[data-view="survey"] .survey{grid-template-columns:180px minmax(0,1fr);gap:18px}
body[data-view="survey"] .sentence{font-size:clamp(23px,2.3vw,29px);min-height:164px;overflow-wrap:break-word}
body[data-view="survey"] .scale button{min-height:170px}
body[data-view="instructions"] #shell{max-width:1180px;min-height:0}
.guide .example{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:start;gap:10px}
.guide .example > div{min-width:0;overflow-wrap:break-word}
.guide .example .number{display:inline-flex;align-items:center;justify-content:center;width:42px;min-width:42px;height:34px;padding:0 4px;border-radius:10px;font-size:15px;font-weight:650;line-height:1;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.2px}
@media(max-width:760px){
 #shell,body[data-view="survey"] #shell{width:100%;margin:0;min-height:100dvh}
 body[data-view="survey"] .survey{grid-template-columns:minmax(0,1fr);gap:12px}
 body[data-view="survey"] .sentence{font-size:23px;min-height:130px}
 body[data-view="survey"] .scale button{min-height:178px}
 .guide .example{grid-template-columns:38px minmax(0,1fr);gap:8px}
 .guide .example .number{width:38px;min-width:38px;height:32px;font-size:14px}
}
@media(min-width:761px){body[data-view="survey"]{min-height:100vh;display:flex;align-items:center}}

/* Beta 3: personal greeting above the task heading; scoped to the initial guide. */
.instruction-heading{display:grid;gap:12px;min-width:0}
.instruction-greeting{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px;min-width:0}
.instruction-greeting h1{font-size:clamp(30px,4vw,44px);line-height:1.12;font-weight:750;letter-spacing:-1.25px;color:#101827;min-width:0;overflow-wrap:anywhere}
.participant-badge{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;background:#dceaff;color:#17243b;border-radius:999px;padding:9px 16px;font-size:19px;font-weight:700;line-height:1.15;white-space:nowrap;font-variant-numeric:tabular-nums}
.participant-badge svg{color:#007aff;flex-shrink:0}
.instruction-title{border-left:5px solid var(--blue);padding-left:12px;font-size:26px;line-height:1.15;letter-spacing:-.5px;font-weight:700;color:#101827}
@media(max-width:760px){.instruction-heading{gap:10px}.instruction-greeting{gap:8px 12px}.instruction-greeting h1{font-size:30px;letter-spacing:-.7px}.participant-badge{font-size:15px;padding:7px 12px}.participant-badge svg{width:17px;height:17px}.instruction-title{font-size:22px;padding-left:9px;border-left-width:4px}}
/* v2.1: centered sequential Q1/Q2, stable question slot and progress. */
body[data-protocol=q2][data-view=survey] #shell{max-width:1140px;width:calc(100% - 32px);margin:12px auto;min-height:0}body[data-protocol=q2][data-view=survey] header{padding:12px 24px}body[data-protocol=q2][data-view=survey] main{padding:12px 18px}body[data-protocol=q2][data-view=survey] footer{padding:10px}body[data-protocol=q2][data-view=survey] #network{display:none}.experiment{max-width:1100px;margin:auto;background:#f9fafc;display:grid;gap:10px;padding:16px}.progress-label{font-size:14px}.experiment .sentence{min-height:132px!important;font-size:clamp(21px,2.5vw,29px)!important;padding:20px}.question-slot{display:grid;grid-template-rows:auto minmax(46px,auto) 72px;gap:6px;min-width:0}.question-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.question-meta button{font-size:12px;padding:5px 9px}.question-meta .symbol{font-size:16px}.question-tag{display:inline-block;color:#007aff;background:#e5efff;padding:6px 10px;border-radius:9px;font-size:13px;font-weight:700}.question-slot h2{font-size:clamp(15px,1.9vw,19px);line-height:1.3}.emotion-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.emotion-grid>div{display:flex;align-items:center;justify-content:center;gap:6px;background:#e8eef7;border-radius:8px;min-height:33px;font-size:13px;font-weight:600}.emotion-grid img{width:23px;height:23px;object-fit:contain}.experiment .scale button{min-height:142px!important;padding:10px 6px;align-items:center;justify-content:space-between}.experiment .scale button[aria-checked=true]{padding:9px 5px}.experiment .scale small{display:block}.experiment .navrow{margin-top:0}.experiment .survey-hint{font-size:12px}.experiment #save-status:empty{display:none}.guide-ratings{display:grid;gap:6px}.guide-rating{display:grid;grid-template-columns:40px minmax(170px,1fr) minmax(0,2fr);align-items:center;gap:12px;padding:12px;background:#fff;border:1px solid var(--line);border-radius:12px}.guide-rating .number{min-width:40px}.guide-label{display:grid;gap:4px}.guide-rating p{font-size:13px}.rest-icon{margin:auto;width:68px;height:68px;border-radius:50%;display:grid;place-items:center;background:var(--pale);font-size:32px}
@media(max-height:780px) and (min-width:761px){body[data-protocol=q2][data-view=survey] #shell{margin:5px auto}body[data-protocol=q2][data-view=survey] header{padding:8px 20px}body[data-protocol=q2][data-view=survey] .brand img{width:38px;height:38px}body[data-protocol=q2][data-view=survey] .brand strong{font-size:25px}body[data-protocol=q2][data-view=survey] main{padding:8px 12px}body[data-protocol=q2][data-view=survey] footer{padding:6px}.experiment{padding:12px;gap:7px}.experiment .sentence{min-height:100px!important;padding:14px}.experiment .scale button{min-height:124px!important}.question-slot{grid-template-rows:auto minmax(40px,auto) 64px;gap:4px}.emotion-grid>div{min-height:29px}.emotion-grid img{width:20px;height:20px}.experiment .navrow button{padding:8px 12px}}
@media(max-width:760px){body[data-protocol=q2][data-view=survey] #shell{width:100%;margin:0;min-height:100dvh}body[data-protocol=q2][data-view=survey] header{padding:10px 13px}body[data-protocol=q2][data-view=survey] main{padding:8px}.experiment{padding:9px;gap:8px}.experiment .sentence{min-height:96px!important;padding:14px;font-size:22px!important}.question-slot{grid-template-rows:auto minmax(64px,auto) 62px;gap:4px}.emotion-grid>div{min-height:28px;font-size:12px}.emotion-grid img{width:19px;height:19px}.experiment .scale{gap:4px}.experiment .scale button{padding:7px 3px;min-height:142px!important}.experiment .scale button[aria-checked=true]{padding:6px 2px}.experiment .scale strong{font-size:11px}.experiment .scale small{font-size:10px}.experiment .scale b{font-size:23px}.guide-rating{grid-template-columns:36px 1fr;gap:8px}.guide-rating>div:last-child{grid-column:2}.experiment .navrow button{padding:8px 10px}}
@media(max-width:390px){.experiment .scale{grid-template-columns:1fr}.experiment .scale button{display:grid;grid-template-columns:24px 1fr 1fr 17px;text-align:left;gap:5px;min-height:48px!important}.experiment .scale b{font-size:20px}.experiment .scale .radio{width:16px;height:16px}.experiment .scale strong,.experiment .scale small{font-size:11px}.question-slot{grid-template-rows:auto minmax(55px,auto) 62px}}
body[data-protocol=q2] .participant-badge{display:none}.experiment button.primary:disabled{background:#e7eaf0;color:#929aa7;border-color:#e0e4ea}.question-slot{grid-template-rows:auto minmax(52px,auto) 72px}
@media(max-height:780px) and (min-width:761px){.question-slot{grid-template-rows:auto minmax(48px,auto) 64px}.experiment .sentence{min-height:95px!important}.experiment .scale button{min-height:118px!important}.experiment{gap:6px;padding:10px}body[data-protocol=q2][data-view=survey] footer{padding:5px}}
@media(max-width:760px){.question-slot{grid-template-rows:auto minmax(64px,auto) 62px}}
@media(max-height:680px) and (min-width:761px){.experiment .sentence{min-height:80px!important;padding:10px}.experiment .scale button{min-height:112px!important}.experiment .question-slot{grid-template-rows:auto minmax(48px,auto) 60px}.experiment .emotion-grid>div{min-height:27px}.experiment{gap:5px}.experiment .navrow button{padding:6px 10px}}

/* Beta 2: reclaim the emotion reference row for taller Q1 rating cards.
   Keep Q2 untouched; preserve the overall experiment height and navigation. */
.experiment .question-slot:not(.q2){grid-template-rows:auto minmax(52px,auto)}
.experiment .question-slot:not(.q2) .emotion-slot{display:none}
.experiment .question-slot:not(.q2)+.scale button{min-height:220px!important}
@media(max-height:780px) and (min-width:761px){
 .experiment .question-slot:not(.q2){grid-template-rows:auto minmax(48px,auto)}
 .experiment .question-slot:not(.q2)+.scale button{min-height:199px!important}
}
@media(max-height:680px) and (min-width:761px){
 .experiment .question-slot:not(.q2)+.scale button{min-height:210px!important}
}
@media(max-width:760px){
 .experiment .question-slot:not(.q2){grid-template-rows:auto minmax(64px,auto)}
 .experiment .question-slot:not(.q2)+.scale button{min-height:208px!important}
}
@media(max-width:390px){
 .experiment .question-slot:not(.q2){grid-template-rows:auto minmax(55px,auto)}
 /* On narrow phones cards stack vertically; split the reclaimed space across five rows. */
 .experiment .question-slot:not(.q2)+.scale button{min-height:61px!important}
}
