/* ============================================================
   Classroom — a calm, neurodivergent-first design system
   Soft palettes, generous space, gentle motion, no red alerts.
   ============================================================ */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ---------- theme tokens ---------- */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --pad: clamp(16px, 4vw, 28px);
  --maxw: 720px;
  --tap: 48px;

  /* warm-neutral light (default) */
  --bg: #faf6ef;
  --bg-soft: #f3ede2;
  --surface: #fffdf9;
  --surface-2: #f6f1e8;
  --ink: #2c2a26;
  --ink-soft: #6b6560;
  --ink-faint: #9a938b;
  --line: #e7ded0;
  --line-strong: #d8cdb9;
  --accent: #5b7cc4;
  --accent-ink: #ffffff;
  --accent-soft: #e8eef8;
  --good: #4f9d7a;
  --good-soft: #e4f1ea;
  --warm: #c98a4b;
  --warm-soft: #f6ead9;
  --focus-ring: #5b7cc4;
  --shadow: 0 1px 2px rgba(60,50,35,.05), 0 6px 20px rgba(60,50,35,.06);
  --shadow-lift: 0 2px 4px rgba(60,50,35,.06), 0 12px 34px rgba(60,50,35,.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --bg-soft: #131a29;
    --surface: #182234;
    --surface-2: #1e293c;
    --ink: #e7ecf3;
    --ink-soft: #a4b0c4;
    --ink-faint: #6f7c93;
    --line: #263349;
    --line-strong: #33435f;
    --accent: #7aa0e6;
    --accent-ink: #0f1420;
    --accent-soft: #1c2942;
    --good: #6fc0a0;
    --good-soft: #16332a;
    --warm: #e0a869;
    --warm-soft: #33281a;
    --focus-ring: #7aa0e6;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.30);
    --shadow-lift: 0 2px 6px rgba(0,0,0,.30), 0 16px 40px rgba(0,0,0,.42);
  }
}

/* explicit override wins over the media query in both directions */
:root[data-theme="light"] {
  --bg:#faf6ef; --bg-soft:#f3ede2; --surface:#fffdf9; --surface-2:#f6f1e8;
  --ink:#2c2a26; --ink-soft:#6b6560; --ink-faint:#9a938b; --line:#e7ded0; --line-strong:#d8cdb9;
  --accent:#5b7cc4; --accent-ink:#fff; --accent-soft:#e8eef8; --good:#4f9d7a; --good-soft:#e4f1ea;
  --warm:#c98a4b; --warm-soft:#f6ead9; --focus-ring:#5b7cc4;
  --shadow:0 1px 2px rgba(60,50,35,.05),0 6px 20px rgba(60,50,35,.06);
  --shadow-lift:0 2px 4px rgba(60,50,35,.06),0 12px 34px rgba(60,50,35,.10);
}
:root[data-theme="dark"] {
  --bg:#0f1420; --bg-soft:#131a29; --surface:#182234; --surface-2:#1e293c;
  --ink:#e7ecf3; --ink-soft:#a4b0c4; --ink-faint:#6f7c93; --line:#263349; --line-strong:#33435f;
  --accent:#7aa0e6; --accent-ink:#0f1420; --accent-soft:#1c2942; --good:#6fc0a0; --good-soft:#16332a;
  --warm:#e0a869; --warm-soft:#33281a; --focus-ring:#7aa0e6;
  --shadow:0 1px 2px rgba(0,0,0,.25),0 8px 24px rgba(0,0,0,.30);
  --shadow-lift:0 2px 6px rgba(0,0,0,.30),0 16px 40px rgba(0,0,0,.42);
}

/* ---------- base ---------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  min-height: 100vh;
}
/* larger-type preference */
body.text-large { font-size: 20px; }
body.text-xlarge { font-size: 23px; }

/* dyslexia / easy-read: more spacing helps a lot */
body.reading-help {
  --font: "Verdana", "Trebuchet MS", system-ui, sans-serif;
  letter-spacing: .02em;
  word-spacing: .10em;
  line-height: 1.85;
}
body.reading-help p, body.reading-help li, body.reading-help .instructions { max-width: 62ch; }

:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 8px; }

/* gentle motion, and none if the user asked for none */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { transform: scale(.96); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) 120px; }
.wrap-wide { max-width: 940px; }
.stack > * + * { margin-top: 16px; }
.rise { animation: rise .28s ease both; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 940px; margin: 0 auto; padding: 12px var(--pad);
  display: flex; align-items: center; gap: 12px;
}
.brand { display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-.01em; }
.brand .dot { width:12px; height:12px; border-radius:50%; background:var(--accent); }
.brand small { font-weight: 500; color: var(--ink-faint); }
.topbar .spacer { flex: 1; }

.iconbtn {
  width: var(--tap); height: var(--tap); border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-soft);
  transition: background .15s ease;
}
.iconbtn:hover { background: var(--surface-2); }

.who {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.avatar.lg { width: 88px; height: 88px; font-size: 34px; }
.who .name { font-weight: 600; font-size: 15px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap); padding: 0 22px; border-radius: 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); font-weight: 600;
  box-shadow: var(--shadow); transition: transform .12s ease, background .15s ease, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.04); background: var(--accent); }
.btn.good { background: var(--good); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.btn.big { min-height: 60px; font-size: 1.12rem; padding: 0 30px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .spin { width:18px; height:18px; border-radius:50%; border:2.5px solid currentColor; border-right-color:transparent; animation:spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- cards & chips ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft);
}
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chip.class-chip { color: var(--ink); background: color-mix(in srgb, var(--cc, var(--accent)) 16%, var(--surface)); }
.meta { color: var(--ink-soft); font-size: .9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .74rem; font-weight: 700; color: var(--ink-faint); }

/* urgency accents — calm, never alarming red */
.due { font-weight: 600; }
.due.overdue { color: var(--warm); }
.due.today   { color: var(--accent); }
.due.soon    { color: var(--ink); }
.due.later, .due.anytime { color: var(--ink-soft); }

/* ---------- profile picker ---------- */
.picker { min-height: 100vh; display: grid; place-items: center; padding: var(--pad); }
.picker-inner { width: 100%; max-width: 480px; text-align: center; animation: rise .4s ease both; }
.picker h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: -.02em; margin-bottom: 6px; }
.picker .sub { color: var(--ink-soft); margin-bottom: 30px; }
.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 380px) { .profiles { grid-template-columns: 1fr; } }
.profile-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 18px; display: grid; justify-items: center; gap: 14px; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s;
}
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.profile-card .name { font-size: 1.25rem; font-weight: 700; }
.profile-card .role { font-size: .82rem; color: var(--ink-faint); text-transform: capitalize; }
.lock { font-size: .78rem; color: var(--ink-faint); }

.pinpad { max-width: 320px; margin: 0 auto; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 22px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.bad i { border-color: var(--warm); animation: shake .3s; }
@keyframes shake { 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keys button {
  min-height: 62px; border-radius: 16px; font-size: 1.4rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.keys button:active { transform: translateY(1px); background: var(--surface-2); }

/* ---------- TODAY (student heart) ---------- */
.today-head { padding: 26px 0 8px; }
.today-head .date { color: var(--ink-soft); font-size: .95rem; }
.today-head h1 { font-size: clamp(1.5rem, 6vw, 2rem); letter-spacing: -.02em; margin-top: 2px; }

.progress-line { display: flex; align-items: center; gap: 12px; margin: 14px 0 26px; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 999px; transition: width .5s ease; }
.progress-line .count { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; }

/* the single most important next task */
.focus-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 22px; padding: clamp(22px, 5vw, 32px); box-shadow: var(--shadow-lift);
  animation: rise .32s ease both;
}
.focus-card::before {
  content:""; position:absolute; inset:0 auto 0 0; width:6px;
  background: var(--cc, var(--accent));
}
.focus-card .eyebrow { margin-bottom: 14px; }
.focus-card h2 { font-size: clamp(1.35rem, 5vw, 1.85rem); line-height: 1.25; letter-spacing: -.02em; }
.focus-card .facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.focus-card .btn { }

.next-label { margin: 34px 0 4px; }

/* a calm task row */
.task {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .15s;
}
.task:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.task .stripe { width: 6px; align-self: stretch; border-radius: 999px; background: var(--cc, var(--accent)); flex: none; }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 600; }
.task .sub { font-size: .86rem; color: var(--ink-soft); margin-top: 3px; display:flex; flex-wrap:wrap; gap:4px 10px; }
.task .go { color: var(--ink-faint); font-size: 1.4rem; flex: none; }
.task.in_progress .title::after { content: " · in progress"; color: var(--accent); font-weight:500; font-size:.82rem; }

/* done items — quiet, satisfying, no pressure */
.done-wrap { margin-top: 40px; }
.done-wrap summary { cursor: pointer; color: var(--ink-soft); font-weight: 600; list-style: none; padding: 8px 0; }
.done-wrap summary::-webkit-details-marker { display: none; }
.done-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 12px; color: var(--ink-soft);
}
.done-row .tick { width: 26px; height: 26px; border-radius: 50%; background: var(--good-soft); color: var(--good);
  display: grid; place-items: center; flex: none; font-size: 15px; }
.done-row .title { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.done-row .grade { margin-left: auto; font-weight: 700; color: var(--good); }

/* all-clear empty state */
.allclear { text-align: center; padding: 46px 20px; animation: rise .4s ease both; }
.allclear .big { font-size: 3rem; }
.allclear h2 { margin-top: 10px; font-size: 1.4rem; }
.allclear p { color: var(--ink-soft); margin-top: 6px; }

/* ---------- focus mode (assignment) ---------- */
.backlink { display:inline-flex; align-items:center; gap:8px; color:var(--ink-soft); font-weight:600; margin: 20px 0 14px; }
.focus-view h1 { font-size: clamp(1.5rem, 6vw, 2rem); letter-spacing: -.02em; line-height: 1.2; margin: 8px 0 12px; }
.focus-view .facts { display:flex; flex-wrap:wrap; gap:10px; margin-bottom: 24px; }
.section-label { font-weight: 700; margin: 30px 0 12px; font-size: 1.05rem; }
.instructions { white-space: pre-wrap; color: var(--ink); }

.steps { list-style: none; display: grid; gap: 10px; }
.step {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: background .15s;
}
.step .box {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line-strong); flex: none;
  display: grid; place-items: center; color: transparent; font-size: 16px; transition: all .15s;
}
.step.checked { background: var(--good-soft); border-color: transparent; }
.step.checked .box { background: var(--good); border-color: var(--good); color: #fff; }
.step.checked .step-text { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.step-text { padding-top: 2px; }
.steps-progress { font-size: .85rem; color: var(--ink-soft); margin-top: 12px; }

/* turn-in panel */
.turnin { margin-top: 30px; }
label.field { display: block; font-weight: 600; margin-bottom: 8px; }
textarea, input[type="text"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], select {
  width: 100%; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.saved-hint { font-size: .8rem; color: var(--ink-faint); margin-top: 6px; height: 1em; }

/* graded feedback */
.graded {
  background: var(--good-soft); border: 1px solid transparent; border-radius: var(--radius);
  padding: var(--pad); margin-top: 24px;
}
.graded .g-grade { font-size: 2rem; font-weight: 800; color: var(--good); }
.graded .fb { margin-top: 8px; white-space: pre-wrap; }

/* submitted confirmation */
.turned-in { text-align:center; padding: 30px 20px; }
.turned-in .big { font-size: 2.6rem; }

/* ---------- teacher ---------- */
.tabs { display: flex; gap: 8px; margin: 18px 0 26px; flex-wrap: wrap; }
.tab {
  padding: 10px 18px; border-radius: 999px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); background: var(--surface);
}
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.class-row {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.class-row.arch { opacity: .6; }
.class-row .dotc { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.class-row .grow { flex: 1; min-width: 0; }
.class-row .cname { font-weight: 700; }
.class-row .csub { font-size: .84rem; color: var(--ink-soft); }

.grade-item { margin-bottom: 14px; }
.grade-item .head { display:flex; align-items:center; gap:10px; }
.grade-item .notes { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; white-space: pre-wrap; }
.grade-item .grade-row { display:flex; gap:10px; margin-top:12px; flex-wrap:wrap; align-items:flex-end; }
.grade-item .grade-row .g { width: 120px; }
.grade-item .grade-row .f { flex: 1; min-width: 200px; }

.form-grid { display: grid; gap: 18px; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form-grid .two { grid-template-columns: 1fr; } }
.seg { display: flex; gap: 8px; }
.seg button { flex:1; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; color: var(--ink-soft); }
.seg button.on { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }

.swatches { display:flex; gap:10px; flex-wrap:wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.swatches button.on { border-color: var(--ink); }

/* ---------- settings sheet ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: grid; place-items: end center; }
.sheet {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 26px var(--pad) calc(26px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lift);
  animation: rise .25s ease both;
}
.sheet h3 { margin-bottom: 4px; }
.opt-row { display:flex; align-items:center; justify-content: space-between; gap:12px; padding: 14px 0; border-top: 1px solid var(--line); }
.opt-row:first-of-type { border-top: none; }
.opt-row .lbl { font-weight: 600; }
.opt-row .desc { font-size: .82rem; color: var(--ink-soft); }
.switch { display:flex; gap:6px; }
.switch button { padding:8px 14px; border-radius: 10px; border:1px solid var(--line-strong); background:var(--surface); font-weight:600; color:var(--ink-soft); }
.switch button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ---------- toast ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: 20px; display: grid; justify-items: center; z-index: 60; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow-lift); animation: rise .2s ease both; pointer-events: auto;
  display:flex; align-items:center; gap:10px;
}
.toast .undo { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ---------- learning help (ND tutor) ---------- */
.hint-wrap { margin-top: 26px; }
.hint-open { color: var(--accent); }
.hint-panel {
  margin-top: 12px; padding: var(--pad);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--radius);
  animation: rise .22s ease both;
}
.hint-panel .hint-q { min-height: 70px; background: var(--surface); }
.hint-chunks { display: grid; gap: 12px; margin-top: 16px; }
.hint-chunk {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; line-height: 1.65; box-shadow: var(--shadow);
  animation: rise .3s ease both;
}
.hint-chunk:last-child {
  background: var(--good-soft); border-color: transparent; font-weight: 500;
}

/* ---------- import curriculum ---------- */
textarea.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .85rem; line-height: 1.5; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip.warn { background: var(--warm-soft); color: var(--warm); }
.import-report { margin-top: 22px; }
.import-err {
  font-size: .86rem; color: var(--ink-soft);
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px;
}

/* ---------- messages (Kaia ⇄ Dad) ---------- */
/* gentle unread indicator — a soft dot, never a red anxiety badge */
.navlink { position: relative; }
.msg-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-left: 6px; vertical-align: middle;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.msg-dot.big { width: 11px; height: 11px; margin-left: 0; flex: none; align-self: center; }
.tab .msg-dot { margin-left: 8px; }

/* composer — soft type chips */
.type-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.type-chip {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; color: var(--ink-soft); transition: background .15s, border-color .15s;
}
.type-chip.on { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.ask-scope {
  font-weight: 600; color: var(--ink); background: var(--surface-2);
  border-radius: 12px; padding: 11px 15px; margin-bottom: 16px;
}
.ask-scope.soft { color: var(--ink-soft); font-weight: 500; }
.ask-kind-label { font-size: .85rem; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }
textarea.ask-body { min-height: 120px; }

/* the "Ask Dad about this" affordance */
.ask-dad-wrap { margin-top: 24px; }
.ask-dad-btn { color: var(--accent); }

/* thread list rows */
.thread-row { align-items: center; }
.thread-row .reply-flag { color: var(--good); font-weight: 600; font-size: .8rem; margin-left: 8px; }
.kind-tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-faint); }

/* conversation view */
.thread-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 22px; }
.msg-thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.msg-bubble { max-width: 82%; padding: 12px 16px; border-radius: 18px; box-shadow: var(--shadow); animation: rise .24s ease both; }
.msg-row.theirs .msg-bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-row.mine .msg-bubble { background: var(--accent-soft); border: 1px solid transparent; border-bottom-right-radius: 6px; }
.msg-who { font-size: .74rem; font-weight: 700; color: var(--ink-faint); margin-bottom: 3px; }
.msg-text { white-space: pre-wrap; line-height: 1.55; }
.msg-time { font-size: .72rem; color: var(--ink-faint); margin-top: 5px; }
.reply-wrap { margin-top: 8px; }
textarea.reply-box { min-height: 90px; }

/* teacher message card — a calm accent border when unread (no red) */
.grade-item.unread { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-soft); padding: 40px 16px; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }
.center { display: grid; place-items: center; min-height: 60vh; }
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }
.fab {
  position: fixed; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 25;
  min-height: 56px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; box-shadow: var(--shadow-lift); display:inline-flex; align-items:center; gap:8px;
}
