/* Minimal, mostly white. One accent colour, one red for the probe and errors. */
:root {
  --text: #202124; --muted: #5f6368; --line: #dadce0; --soft: #f1f3f4;
  --accent: #185abc; --accent-hover: #174ea6; --accent-soft: #e8f0fe; --red: #d93025; --radius: 6px;
}
html, body { margin: 0; background: #fff; color: var(--text); }
body { font-family: Arial, "Liberation Sans", Helvetica, sans-serif; font-size: 17px; line-height: 1.6; }
.jspsych-display-element { background: #fff; }
.jspsych-content-wrapper { align-items: flex-start; }
.jspsych-content { max-width: 680px; width: 100%; text-align: left; margin: 0 auto; padding: 72px 24px 96px; box-sizing: border-box; }
h1 { font-size: 30px; font-weight: 400; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 20px; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.draft-note { color: var(--muted); font-size: 14px; }
.actions { margin-top: 32px; display: flex; gap: 12px; align-items: center; }
button { font: inherit; }
.primary, .jspsych-btn { background: var(--accent); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 24px; font-size: 15px; cursor: pointer; }
.primary:hover, .jspsych-btn:hover { background: var(--accent-hover); }
.opt:focus-visible, .primary:focus-visible, .secondary:focus-visible, .jspsych-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary:disabled { background: var(--line); color: #fff; cursor: default; }
.secondary { background: #fff; color: var(--accent); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 24px; font-size: 15px; cursor: pointer; }
.secondary:hover { background: var(--soft); }
.jspsych-btn { margin: 0; }
#jspsych-html-button-response-btngroup { display: flex; gap: 12px; margin-top: 32px; justify-content: flex-start; max-width: 680px; margin-left: auto; margin-right: auto; }

/* Probe dot */
#probe-dot { position: fixed; top: 28px; right: 32px; width: 24px; height: 24px; border-radius: 50%; background: var(--line); display: none; z-index: 10; }
#probe-dot.on { display: block; }
#probe-dot.red { background: var(--red); }

/* Reasoning item */
.item-top { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 14px; margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.timer { color: var(--muted); min-width: 3em; text-align: right; }
.stimulus { font-size: 17px; }
.question { font-weight: 400; margin-top: 20px; }
.options { margin: 8px 0 0; }
.opt { display: flex; gap: 14px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 8px 0; cursor: pointer; line-height: 1.5; color: var(--text); }
.opt:hover { background: var(--soft); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.selected .letter { color: var(--accent); }
.letter { color: var(--muted); min-width: 1.3em; font-variant-numeric: tabular-nums; }
.ai-panel { border-left: 3px solid var(--line); padding: 4px 0 4px 18px; margin: 28px 0 8px; }
.ai-head { font-size: 13px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.ai-warning { color: var(--text); font-weight: 400; font-size: 14px; margin-bottom: 6px; }
.ai-answer { font-weight: 400; }
.confidence { margin-top: 28px; }
.slider-row { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; margin-top: 8px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--accent); }
.slider-value { color: var(--muted); font-size: 14px; text-align: center; margin-top: 4px; }

/* Forms */
.qform .intro { color: var(--muted); }
.field { margin: 32px 0; border: 0; padding: 0; }
.field legend, .field > label { display: block; margin-bottom: 10px; padding: 0; font-weight: 400; }
.field.missing { border-left: 3px solid var(--text); padding-left: 14px; }
.field.missing legend, .field.missing > label { color: var(--text); }
.req { color: var(--muted); }
.choice { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0; cursor: pointer; }
.choice input { margin-top: 6px; accent-color: var(--accent); }
.likert { display: flex; align-items: center; gap: 14px; }
.likert .anchor { color: var(--muted); font-size: 13px; max-width: 9em; }
.likert-cells { display: flex; gap: 6px; flex: 1; justify-content: space-between; }
.likert-cell { display: flex; flex-direction: column; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.likert-cell input { accent-color: var(--accent); margin: 0 0 4px; }
input[type=number], input[type=text], input[type=email] { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 360px; box-sizing: border-box; }
input[type=number] { max-width: 120px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.error { color: var(--text); }
.code-form { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.code-form input { max-width: 180px; font-size: 20px; letter-spacing: 0.12em; text-transform: uppercase; }
.consent-checks { margin-top: 28px; }
.return-code { font-size: 32px; letter-spacing: 0.12em; margin: 24px 0; font-weight: 600; }
.debrief { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Pages rendered outside jsPsych (device block, load failure) */
.static-page { max-width: 680px; margin: 0 auto; padding: 72px 24px 96px; box-sizing: border-box; }

/* Footer */
.site-footer { max-width: 680px; margin: 0 auto; padding: 20px 24px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: left; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--text); border-bottom-color: var(--text); }

/* Camera calibration overlay */
body.calibrating #probe-dot { display: none; }
.calib { position: fixed; inset: 0; background: #fff; z-index: 20; }
.calib-text { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: var(--muted); padding: 0 24px; }
#calib-stage { position: absolute; inset: 0; }
.calib-dot { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--accent); border: 0; cursor: pointer; padding: 0; box-shadow: 0 0 0 6px var(--accent-soft); }
.calib-dot.validate { background: var(--text); box-shadow: 0 0 0 6px var(--soft); cursor: default; }

/* WebGazer's preview: keep it small and out of the column */
#webgazerVideoContainer { position: fixed !important; top: 16px !important; left: 16px !important; z-index: 15; }
#webgazerGazeDot { display: none !important; }

/* Page frame: content grows, footer sits at the bottom of the viewport or below the content */
html, body { height: auto; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
#jspsych-target { flex: 1 0 auto; }
.jspsych-display-element { height: auto; min-height: 0; }
.site-footer { width: 100%; box-sizing: border-box; }
