/* Shared form controls: keep native semantics, keyboard support and specialist inputs. */
:where(main,dialog) :where(input:not([type]),input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],input[type=tel],input[type=url],input[type=date],input[type=datetime-local],input[type=time],select,textarea){
 box-sizing:border-box;max-width:100%;min-width:0;min-height:48px;padding:12px 14px;border:1px solid var(--border,#bdcce0);border-radius:10px;background:var(--surface,#fff);color:var(--text-primary,#122b49);font:inherit;line-height:1.5;transition:border-color .15s,box-shadow .15s;
}
:where(main,dialog) textarea{min-height:130px;resize:vertical}
:where(main,dialog) :where(input,textarea)::placeholder{color:var(--text-secondary,#64748b);opacity:1}
:where(main,dialog) :where(input,select,textarea):focus-visible{outline:3px solid var(--primary,#095ddf);outline-offset:2px;border-color:var(--primary,#095ddf)}
:where(main,dialog) :where(input,select,textarea):disabled{opacity:.65;cursor:not-allowed;background:var(--surface-soft,#f4f7fc)}
:where(main,dialog) :where(input,select,textarea)[aria-invalid=true]{border-color:var(--danger,#b42340)}
:where(main,dialog) :where(input[type=checkbox],input[type=radio]){width:20px;height:20px;min-height:20px;padding:0;flex-shrink:0;accent-color:var(--primary,#095ddf);vertical-align:middle}
:where(main,dialog) input[type=file]{max-width:100%;padding:10px;border:1px dashed var(--border,#bdcce0);border-radius:10px;background:var(--surface-soft,#f4f7fc);font:inherit;color:var(--text-primary,#122b49)}
:where(main,dialog) input[type=file]::file-selector-button{padding:10px 14px;margin-right:12px;border:0;border-radius:7px;background:var(--surface-blue,#eaf2ff);color:var(--primary,#095ddf);font:inherit;cursor:pointer}
.ds-auth-form :where(input:not([type=checkbox]),select,textarea),.ds-academic-form textarea{width:100%;display:block}
.ds-auth-form select{margin-bottom:20px}
.ds-sample-shell{width:100%;max-width:1100px;padding-block:52px}
.ds-sample-shell>h1{font-size:clamp(2rem,4.2vw,3.3rem);line-height:1.15;margin-bottom:16px}
.ds-sample-shell>p{max-width:760px;color:var(--text-secondary);line-height:1.7}
.ds-sample-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin:32px 0 20px}
.ds-sample-choices>form{display:flex;flex-direction:column;gap:16px;padding:28px;background:var(--surface,#fff);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow-1)}
.ds-sample-choices h2{font-size:1.5rem;line-height:1.3;margin:0}
.ds-sample-choices p{font-size:.95rem;color:var(--text-secondary);line-height:1.65;margin:0}
.ds-sample-choices label{display:grid;gap:9px;font-weight:600;margin-top:auto}
.ds-sample-choices select{width:100%;font-weight:400}
.ds-sample-choices .ds-button{width:100%;margin-top:4px;min-height:50px}
.ds-sample-player{padding:28px;margin-top:32px;background:var(--surface,#fff);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow-1)}
.ds-sample-top{align-items:flex-start;padding-bottom:24px;border-bottom:1px solid var(--border);margin-bottom:28px}
.ds-sample-top h2{font-size:clamp(1.3rem,2.5vw,1.8rem);line-height:1.4;margin:0}
.ds-sample-top time{font-size:1.35rem;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.ds-sample-player fieldset{border:0;padding:0;margin:0;min-width:0}
.ds-sample-player legend{float:none;width:auto;font-size:1rem;font-weight:700;margin:0 0 16px;color:var(--text-secondary)}
.ds-sample-player fieldset>p{font-size:1.1rem;line-height:1.7}
.ds-sample-options label{line-height:1.6;min-height:56px;transition:background .15s,border-color .15s}
.ds-sample-options label:hover{background:var(--surface-soft,#f4f7fc)}
.ds-sample-options input[type=radio]{margin:0}
.ds-sample-options label:has(input:focus-visible){outline:3px solid var(--primary);outline-offset:2px}
.ds-sample-navigation button{font:inherit;font-weight:600}
.ds-sample-navigation button.is-answered:not([aria-current=true]){border-color:var(--primary);background:var(--surface-blue,#eaf2ff)}
.ds-sample-player .ds-button:disabled{opacity:.5;cursor:not-allowed;transform:none}
.ds-sample-result{border:1px solid var(--border);border-left:4px solid var(--success);border-radius:12px;overflow-wrap:anywhere}
.ds-sample-result[data-correct=false]{border-left-color:var(--danger);border-top-color:var(--border);border-bottom-color:var(--border);border-right-color:var(--border)}
.ds-sample-result h3{font-size:1.15rem}
@media(max-width:650px){.ds-sample-choices{grid-template-columns:minmax(0,1fr);gap:16px}.ds-sample-choices>form,.ds-sample-player{padding:20px}.ds-sample-shell{padding-block:32px}.ds-sample-player>.ds-actions{display:flex;flex-wrap:wrap;gap:12px}.ds-sample-player>.ds-actions .ds-button{flex:1}.ds-sample-options label{padding:12px;gap:10px}}
@media(prefers-reduced-motion:reduce){:where(main,dialog) :where(input,select,textarea),.ds-sample-options label{transition:none}}

/* Answer status is distinct from correctness, which is shown only after marking. */
:where([data-question-nav],[data-sample-nav]) button[data-answered]{width:auto;min-width:52px;min-height:44px;padding:8px 10px;font-weight:700;border-radius:8px}
:where([data-question-nav],[data-sample-nav]) button[data-answered=true]{background:var(--surface-blue,#eaf2ff);color:var(--primary,#095ddf);border:2px solid var(--primary,#095ddf)}
:where([data-question-nav],[data-sample-nav]) button[data-answered=false]{background:var(--surface,#fff);color:var(--text-secondary,#586779);border:1px dashed var(--text-secondary,#586779)}
:where([data-question-nav],[data-sample-nav]) button[data-answered][aria-current=true]{outline:3px solid var(--primary,#095ddf);outline-offset:3px}
.ds-answer-legend{font-size:.85rem;line-height:1.8;color:var(--text-secondary,#586779);margin:16px 0 24px}
