:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d6470;
  --border: #d9dbe0;
  --accent: #1f5c99;
  --accent-text: #ffffff;
  --warn-bg: #fff4d6;
  --warn-border: #d9a520;
  --alert-bg: #fde8e6;
  --alert-border: #c0392b;
  --info-bg: #e8f1fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e8e9eb;
    --muted: #a3a9b3;
    --border: #353a41;
    --accent: #6ea8e6;
    --accent-text: #0e1114;
    --warn-bg: #3a300f;
    --warn-border: #b38a1d;
    --alert-bg: #3d1a17;
    --alert-border: #d9574a;
    --info-bg: #182a3d;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
header { font-size: 0.95rem; color: var(--muted); margin-bottom: 1.5rem; }
header a { color: var(--text); font-weight: 600; text-decoration: none; }
h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.25rem; }
a { color: var(--accent); }

label { display: block; font-weight: 600; margin: 1rem 0 0.4rem; }
textarea, select, input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  margin: 0.75rem 0.5rem 0 0;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
button:disabled { opacity: 0.6; cursor: default; }

/* Keyboard focus: one clear ring on every control and on a heading that takes focus after a step
   change; nothing on mouse focus. The offset keeps the ring visible on the accent-coloured button. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* The pages have no animation, and nothing added later may move for people who have asked it not to. */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.banner { border-left: 4px solid var(--accent); background: var(--info-bg); padding: 0.75rem 1rem; margin: 0 0 1rem; border-radius: 4px; }
.banner.warn { border-color: var(--warn-border); background: var(--warn-bg); }
.banner.alert { border-color: var(--alert-border); background: var(--alert-bg); }
.banner.alert h2 { margin-top: 0; }
.banner p { margin: 0; }
.banner.wellbeing button { margin-top: 0.5rem; }

.progress, .hint, .cite, .status, .definition { color: var(--muted); font-size: 0.92rem; }
.choices button { min-width: 6rem; }
h1.question { font-size: 1.35rem; }
.fact { padding: 0.25rem 0 0.75rem; border-bottom: 1px solid var(--border); }
.fact label { font-weight: 500; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.reason { margin: 0.25rem 0; }
.forms { margin: 0 0 0.4rem; padding-left: 1.2rem; font-weight: 600; }
.tag { display: inline-block; margin-left: 0.5rem; font-size: 0.8rem; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 0.5rem; }
.notices { color: var(--muted); font-size: 0.92rem; margin-top: 1.5rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 0 0.5rem; align-items: center; }
.share-row input { flex: 1 1 16rem; }
.report { margin-top: 1.5rem; }
.report summary { cursor: pointer; color: var(--accent); }
.actions { margin-top: 1.5rem; }

.home p.lead { font-size: 1.15rem; }

@media print {
  .no-print, button, .banner.wellbeing { display: none !important; }
  body { background: #fff; color: #000; }
}
footer { margin-top: 3rem; font-size: 0.92rem; }

/* Project coach */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.conversation { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; }
.msg { white-space: pre-wrap; padding: 0.6rem 0.85rem; border-radius: 10px; max-width: 90%; border: 1px solid var(--border); }
.msg.student { align-self: flex-end; background: var(--info-bg); }
.msg.coach { align-self: flex-start; background: var(--surface); }
.msg.pending { color: var(--muted); }
.composer textarea { margin-top: 0.25rem; }
.status.error { color: var(--alert-border); }
.summary { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.summary .field h3 { margin-top: 0.75rem; }
.summary .field ul { margin: 0.25rem 0; padding-left: 1.2rem; }
.summary .field.open { color: var(--muted); }
@media print {
  .coach .intro, .coach .conversation { display: none !important; }
}
