:root {
  color-scheme: light;
  font: 16px/1.45 "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --bg:#f2f7f5; --panel:#fff; --ink:#173239; --muted:#4e676d; --line:#c6d9da;
  --accent:#12695f; --accent-text:white; --wash:#e4f1ed; --danger:#983e37; --focus:#007d9e;
}
* {box-sizing:border-box}
body {margin:0;color:var(--ink);background:var(--bg)}
body.participant {color-scheme:dark;--bg:#0d1e22;--panel:#192c30;--ink:#f1f8f8;--muted:#afd1d0;--line:#355156;--accent:#85dacc;--accent-text:#0b3836;--wash:#243c41;--danger:#ffc2b7;--focus:#a5ece2}
[hidden]{display:none!important}
#header {display:flex;align-items:center;gap:2.4rem;min-height:4.6rem;padding:.7rem clamp(1rem,3.2vw,3rem);background:#112c32;color:#f5fbfb;flex-wrap:wrap}
.brand {font-size:1.38rem;letter-spacing:-.035em;white-space:nowrap;font-weight:750}
#header nav,#header .actions {display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
#header .right {margin-inline-start:auto}
#header button {color:#bed4d5;background:transparent;border-color:transparent;box-shadow:none}
#header button[aria-current=page]{color:white;border-bottom:3px solid #86dfd0;border-radius:0}
#header button:hover {color:white;background:#1b3a40}
#header .current-progress {margin-left:auto;color:#bbebe1;font-weight:700}
#app {max-width:1700px;margin:0 auto;padding:clamp(1rem,2.7vw,2.6rem)}
#footer {margin:0 clamp(1rem,3.2vw,3rem) 1rem;color:var(--muted);font-size:.9rem}
#footer:not(:empty){border-top:1px solid var(--line);padding-top:1rem}
#footer:empty{display:none}
#notice:not([hidden]){background:#dbf5e9;color:#155641;padding:.6rem clamp(1rem,3.2vw,3rem);font-weight:600}
#notice.error {background:#ffe7df;color:#7f281d}
h1,h2,h3,p,figure{margin:0}
h1{font-size:clamp(1.55rem,2.4vw,2.2rem);letter-spacing:-.04em;line-height:1.2}
h2{font-size:1.28rem;line-height:1.3;letter-spacing:-.02em}
h3{font-size:1.03rem}
.heading,.line,.actions,.title-row{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}
.heading,.line{justify-content:space-between}.heading {margin-bottom:1.3rem}
.actions.end{justify-content:flex-end}.actions.start{align-items:flex-start}
.muted,small,.kicker{color:var(--muted)}small{font-size:.83rem}.kicker{font-weight:700;font-size:.93rem}
.card {background:var(--panel);border:1px solid var(--line);border-radius:.75rem;padding:clamp(1rem,1.6vw,1.7rem);display:flex;flex-direction:column;gap:1rem;min-width:0;margin-bottom:1.1rem}
.card:empty{display:none}.grid{display:grid;grid-template-columns:minmax(16rem, .9fr) minmax(18rem,1.1fr);gap:1.2rem;align-items:start}
.card.compact, .authbox {max-width:38rem}.authbox{margin:clamp(2rem,10vh,8rem) auto}
form,.fields,.stack{display:flex;flex-direction:column;gap:1rem}
label.field {display:flex;flex:1;flex-direction:column;gap:.35rem;min-width:0;font-weight:650;color:var(--muted);font-size:.9rem}
label.check {display:inline-flex;align-items:center;gap:.5rem;min-height:2.75rem}
input,select,textarea,button,.button {font:inherit}
input:not([type=checkbox]),select,textarea {border:1px solid var(--line);border-radius:.38rem;color:var(--ink);background:var(--panel);padding:.65rem .75rem;min-width:0;min-height:44px}
textarea {resize:vertical;min-height:5rem}
input[type=checkbox]{width:1.1rem;height:1.1rem;accent-color:var(--accent)}
fieldset {border:1px solid var(--line);border-radius:.5rem;padding:.75rem;min-width:0}
legend{font-weight:650}.checks{display:flex;flex-wrap:wrap;gap:.25rem 1.2rem}
button,.button {display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-height:44px;border:1px solid var(--line);border-radius:.4rem;padding:.5rem 1.05rem;background:var(--panel);color:var(--ink);font-weight:650;cursor:pointer;text-decoration:none;line-height:1.2}
button:hover,.button:hover{background:var(--wash)}
button.primary,.button.primary {background:var(--accent);border-color:var(--accent);color:var(--accent-text)}
button.primary:hover,.button.primary:hover{filter:brightness(.94)}
button.danger{color:var(--danger);border-color:var(--danger)}
button:disabled{opacity:.55;cursor:wait}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.confirmation{margin-top:.25rem;padding:1rem;border:1px solid var(--line);border-inline-start:4px solid var(--accent);background:var(--wash);display:grid;gap:.8rem}
.table-wrap {overflow:auto;max-width:100%;max-height:65vh}
table {border-collapse:separate;border-spacing:0;width:100%;text-align:left}
td,th {padding:.7rem .8rem;border-bottom:1px solid var(--line);vertical-align:middle}
th {background:var(--panel);font-size:.89rem;color:var(--muted);position:sticky;top:0;z-index:1}
.matrix th:first-child,.matrix td:first-child{position:sticky;left:0;background:var(--panel);z-index:2}
.matrix th:first-child{z-index:3}.matrix td,.matrix th{white-space:nowrap}
.matrix th button{padding:.3rem;font-size:.86rem}.matrix .cell,.pill{padding:.23rem .65rem;border-radius:.28rem;font-weight:700;display:inline-block}
.cell.yes,.pill{background:#d9f2e9;color:#0e5d4d}.cell.no{background:#e5edf9;color:#214d88}
.table-wrap small{display:block} .empty{padding:1.1rem 0;color:var(--muted)}
progress{width:100%;height:.7rem;accent-color:var(--accent)}
.drop{padding:1.1rem;border:1px dashed var(--line);background:var(--wash);border-radius:.6rem;display:grid;gap:.7rem}
.drop.active-drop{outline:3px solid var(--accent)}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:.5rem}
.thumb{padding:.2rem;background:#10191a;border-color:var(--line);width:100%;min-height:48px}
.thumb img{display:block;width:100%;height:72px;object-fit:contain}
.thumb-small{max-width:70px;max-height:42px;vertical-align:middle;object-fit:contain;background:#112326}
.preview{display:block;max-width:100%;max-height:76vh;object-fit:contain;margin:auto;background:#10191a}
dialog{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:.65rem;max-width:min(92vw,1100px);max-height:93vh;padding:1rem}
dialog::backdrop{background:#092328b8}.readonly{width:100%;min-height:5rem}.control-short{max-width:9rem}
details>summary{cursor:pointer;font-weight:650;padding:.55rem 0}.col-head{display:grid;gap:.3rem}
.participant #header{padding:.5rem 2vw;min-height:3.7rem;gap:1.5rem;background:#142b2e}
.participant #app{padding:.65rem 2vw 1rem}
.study-strip{display:grid;gap:.12rem;padding:.1rem 0 .42rem;margin-bottom:.9rem;border-bottom:1px solid var(--line)}
.study{display:grid;grid-template-columns:minmax(0,1.32fr) minmax(21rem,1fr);gap:1.35rem;align-items:stretch}
.study .card{margin:0;padding:1.1rem;border-radius:.5rem;gap:.7rem}
.study .image-card{background:#0a171a;min-height:0}
.frame{display:flex;align-items:center;justify-content:center;min-height:8rem;flex:1;background:#030507;overflow:hidden}
.frame img{max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}
.image-card .line{gap:.35rem}.image-card .image-id{font-size:.84rem;color:var(--muted)}
.assessment-question{overflow-wrap:anywhere;font-weight:700;font-size:clamp(1.15rem,1.6vw,1.65rem);line-height:1.2}
.criterion{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.28}
.study form {margin-top:auto;border-top:1px solid var(--line);padding-top:.8rem;gap:.65rem}
.study input{background:#0e2327}
.participant button:not(.primary){background:#223b40;color:var(--ink)}
.participant button[aria-pressed=true]{background:#315b58;border-color:#8bdbce}
.pairs button{min-width:6rem}.confidence-row{display:flex;flex-wrap:wrap;gap:.45rem}
.confidence-row input{width:5.4rem}.confidence-row button{padding:.4rem;min-width:2.75rem;flex:1}
.field-error{color:#ffcebd;font-size:.93rem}
.p-full {max-height:78vh;overflow:auto;background:#050809;outline-offset:-2px}
.p-full img {max-width:none;max-height:none;display:block}
@media(min-width:821px){
  .participant:has(.study){display:flex;flex-direction:column;min-height:100dvh}
  .participant:has(.study) #app{display:flex;flex-direction:column;flex:1;width:100%}
  .study{flex:1}
  .study .frame{position:relative}
  .study .frame img{position:absolute;inset:0}
}
@media(max-width:820px){.grid,.study{grid-template-columns:1fr}.study .image-card,.participant:has(#notice:not([hidden])) .study .image-card{height:clamp(260px,46vh,500px)}#header{gap:.5rem 1.25rem}.heading .actions{width:100%}.card{padding:1rem}.right{margin-left:auto}}
@media(max-height:730px) and (min-width:821px){.study .card{padding:.8rem 1rem;gap:.4rem}.study form{gap:.45rem;padding-top:.55rem}.study-strip{margin-bottom:.65rem}.participant #app{padding-top:.4rem}.participant #header{min-height:3.3rem}}
