/* ThinkLM Student app — design tokens + scenes, ported from the claude_design mockup
   (ThinkLM Student.dc.html). The mockup's x-dc/React prototype is the visual spec, not shippable
   code; this is the production stylesheet. Calm, low-stimulation, no gamification chrome. */

@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&family=Caveat:wght@500;600;700&display=swap");

:root {
  --paper: #F4F7FA;
  --surface: #ffffff;
  --ink: #192230;
  --ink2: #566373;
  --ink3: #93a0ae;
  --line: #e5eaf1;
  --line2: #d2dae3;
  --fill: #edf2f7;
  --accent: #3568b0;
  --accent-press: #2b568f;
  --accent-soft: #e7f0f9;
  --accent-ink: #214b7e;
  --warm: #be6e48;
  --warm-soft: #f4ece5;
  --good: #3e8c7b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: #cdd6e1; border-radius: 6px; border: 2px solid #fff; }

@keyframes tdot { 0%,60%,100% { opacity:.25; transform:translateY(0); } 30% { opacity:1; transform:translateY(-2px); } }
@keyframes softpulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }

.mono { font-family: "IBM Plex Mono", monospace; }

/* ── the work room ───────────────────────────────────────────────────────── */
.room { min-height: 100%; display: flex; justify-content: center; background: var(--paper); }
.room-col {
  width: 100%; max-width: 760px; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}

.room-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 11px;
  padding: 13px 22px; border-bottom: 1px solid var(--line);
}
.glyph { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); position: relative; flex: 0 0 auto; }
.glyph::after { content: ""; position: absolute; inset: 7px; border: 1.5px solid var(--surface); border-radius: 2px; }
.room-title { font-weight: 700; font-size: 14px; }
.chip-anon {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fill); border-radius: 20px; padding: 4px 10px;
  font: 600 10px "IBM Plex Mono"; letter-spacing: .04em; color: var(--ink2);
}
.chip-anon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); animation: softpulse 2.4s infinite; }

.problem-card {
  flex: 0 0 auto; padding: 15px 22px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.problem-label { font: 600 9.5px "IBM Plex Mono"; letter-spacing: .1em; color: var(--ink3); margin-bottom: 7px; }
.problem-text { font-family: "Source Serif 4", Georgia, serif; font-size: 19px; line-height: 1.5; color: var(--ink); }

.transcript { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; }

/* ── chat bubbles ────────────────────────────────────────────────────────── */
.bubble { margin-bottom: 14px; max-width: 88%; }
.bubble.student {
  align-self: flex-end; background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid #d7e6f5; border-radius: 16px 16px 4px 16px;
  padding: 11px 15px; font-size: 15px; line-height: 1.55; max-width: 80%;
}
.bubble.coach {
  align-self: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 9px 17px 7px;
  font-family: "Caveat", "Hanken Grotesk", cursive; font-size: 20.5px; line-height: 1.32;
  box-shadow: 0 1px 2px rgba(20,40,80,.05);
}
/* the refusal is a coach bubble — same calm voice, never a cold dead-end */
.bubble.coach[data-scene="refusal"] { border-color: var(--line2); }

/* the one sub-step opened under the seal */
.bubble.coach[data-scene="sealed_step"] {
  align-self: center; max-width: 420px; width: 100%; padding: 0; font-family: inherit;
  border: 1px solid var(--accent); border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(53,104,176,.1);
}
.sealed-step-banner {
  background: var(--accent-soft); padding: 9px 14px;
  font: 600 9px "IBM Plex Mono"; letter-spacing: .09em; color: var(--accent-ink);
  display: flex; align-items: center; gap: 7px;
}
.sealed-step-banner .sq { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.sealed-step-body { padding: 16px; background: var(--surface); }
.sealed-step-work {
  font-family: "Caveat", "Hanken Grotesk", cursive; font-weight: 700; font-size: 30px;
  color: var(--ink); line-height: 1.15;
}

/* safety + offline scenes, rendered as prominent in-thread blocks */
.scene-block { align-self: stretch; max-width: 100%; margin: 4px 0 16px; }
.safety-card {
  background: var(--surface); border: 1px solid #e8dccf; border-radius: 18px; padding: 24px;
  box-shadow: 0 4px 18px rgba(120,80,50,.08);
}
.safety-card .pause-dot {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--warm);
  margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
}
.safety-card .pause-dot span { width: 4px; height: 4px; border-radius: 50%; background: var(--warm); }
.safety-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; text-align: center; }
.safety-text { font-size: 14.5px; color: var(--ink2); line-height: 1.65; text-align: center; }
.safety-resources {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); padding: 16px;
}
.safety-resources .label { font: 600 9.5px "IBM Plex Mono"; letter-spacing: .08em; color: var(--ink3); margin-bottom: 11px; }
.safety-resources .res { display: flex; align-items: center; gap: 11px; }
.safety-resources .res .badge {
  width: 36px; height: 36px; border-radius: 9px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font: 600 12px "IBM Plex Mono"; flex: 0 0 auto;
}
.res-title { font-size: 14px; font-weight: 600; }
.res-sub { font-size: 12.5px; color: var(--ink2); }
.safety-foot { margin-top: 14px; font: 500 11.5px "IBM Plex Mono"; color: var(--ink3); line-height: 1.6; text-align: center; }

.offline-card {
  background: var(--surface); border: 1px solid var(--line2); border-left: 3px solid var(--accent);
  border-radius: 16px; padding: 22px; box-shadow: 0 4px 16px rgba(20,40,80,.05);
}
.offline-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.offline-text { font-size: 14.5px; color: var(--ink2); line-height: 1.65; }
.offline-foot { margin-top: 16px; font: 500 10.5px "IBM Plex Mono"; color: var(--ink3); letter-spacing: .03em; }

/* ── composer ────────────────────────────────────────────────────────────── */
.composer { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 13px 22px 16px; background: var(--surface); }
.composer-row { display: flex; gap: 9px; align-items: center; }
.composer-input {
  flex: 1; border: 1px solid var(--line2); border-radius: 12px; padding: 13px 15px;
  font-family: inherit; font-size: 14.5px; color: var(--ink); background: var(--paper);
}
.composer-send {
  width: 44px; height: 44px; border: none; border-radius: 12px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 17px; flex: 0 0 auto;
}
.composer-aux { display: flex; align-items: center; gap: 16px; margin-top: 11px; font-size: 12.5px; }
.aux-link {
  appearance: none; border: none; background: none; padding: 0; cursor: pointer;
  color: var(--ink2); font-weight: 600; font-size: 12.5px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.aux-link.accent { color: var(--accent); }
.aux-ask { display: block; text-align: center; margin-top: 10px; }
.aux-ask button {
  appearance: none; border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--ink3); text-decoration: underline; text-underline-offset: 2px;
}

/* ── full-screen scenes (join / waiting / finish) ────────────────────────── */
.center-scene { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.center-scene.warm { background: var(--warm-soft); }
.scene-narrow { width: 100%; max-width: 400px; text-align: center; }
.brand-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; }
.brand-row .glyph { width: 28px; height: 28px; }
.brand-name { font-weight: 700; font-size: 20px; }
.scene-h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.scene-sub { font-size: 14.5px; color: var(--ink2); margin-bottom: 24px; line-height: 1.6; }
.code-input {
  width: 100%; text-align: center; font: 700 30px "IBM Plex Mono"; letter-spacing: .12em;
  border: 1.5px solid var(--line2); border-radius: 13px; padding: 18px 12px;
  background: var(--surface); color: var(--ink); text-transform: uppercase;
}
.btn-primary {
  display: flex; align-items: center; justify-content: center; width: 100%; padding: 16px;
  border: none; border-radius: 13px; background: var(--accent); color: #fff; font-weight: 700;
  font-size: 16px; cursor: pointer; font-family: inherit;
}
.privacy-note {
  margin-top: 20px; display: flex; align-items: flex-start; gap: 9px; text-align: left;
  padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  font: 500 12px "IBM Plex Mono"; color: var(--ink2); line-height: 1.6;
}
.join-error { margin-top: 14px; color: var(--warm); font-size: 13.5px; font-weight: 600; }

.finish-check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--good); margin: 0 auto 20px; position: relative;
}
.finish-check::after {
  content: ""; position: absolute; width: 13px; height: 20px; border-bottom: 3px solid #fff;
  border-right: 3px solid #fff; left: 50%; top: 46%; transform: translate(-50%,-50%) rotate(45deg);
}
