@charset "UTF-8";
/* ============================================================
   Curio — "understanding is light"
   Twilight indigo that warms toward gold as understanding grows.
   Deliberately avoids the cream/terracotta & black/acid-green
   AI-default looks. Signature: Curio's aura, lit by the score.
   ============================================================ */

:root {
  /* — palette — */
  --ink:      #141230;  /* twilight base            */
  --ink-2:    #1c1942;  /* raised surface           */
  --ink-3:    #262056;  /* inputs / higher surface  */
  --haze:     #3a3470;  /* hairline borders         */
  --cloud:    #ece9ff;  /* primary text             */
  --cloud-dim:#a7a2d0;  /* muted text               */
  --gold:     #ffc24b;  /* insight / light / score  */
  --teal:     #3dd6d0;  /* clarity / Curio          */
  --rose:     #ff6b8b;  /* misconception            */

  /* — type — */
  --display: "Fraunces", Georgia, serif;
  --body:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "Space Mono", ui-monospace, monospace;

  /* — geometry — */
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --pad:  clamp(18px, 4vw, 34px);
  --maxw: 1180px;

  /* Curio's aura, driven live from the understanding score (0..1). */
  --aura-intensity: 0.18;
  --aura-hue: 186;       /* teal at rest → warms to ~46 (gold) */
  --aura-sat: 70%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--cloud);
  background:
    radial-gradient(1100px 640px at 50% -8%, #241f52 0%, rgba(36,31,82,0) 60%),
    radial-gradient(900px 700px at 88% 12%, rgba(61,214,208,0.10) 0%, rgba(61,214,208,0) 55%),
    var(--ink);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 13px 22px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #201533;
  background: linear-gradient(180deg, #ffd067, var(--gold));
  box-shadow: 0 10px 26px -10px rgba(255,194,75,.7);
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px rgba(255,194,75,.85); transform: translateY(-1px); }
.btn-ghost {
  color: var(--cloud);
  background: rgba(255,255,255,.04);
  border-color: var(--haze);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: var(--cloud-dim); }
.btn-small { padding: 8px 12px; font-size: .82rem; border-radius: var(--r-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}
.mini-label {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cloud-dim);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  background: linear-gradient(180deg, rgba(20,18,48,.9), rgba(20,18,48,.55));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(58,52,112,.5);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--cloud); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8df3ff, var(--teal) 55%, #2b9ad1);
  box-shadow: 0 0 16px 2px rgba(61,214,208,.7);
}
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: .01em; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--cloud-dim); background: transparent; border: 1px solid transparent;
  cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.icon-btn:hover { color: var(--cloud); background: rgba(255,255,255,.05); border-color: var(--haze); }

.screen { display: block; }
.screen[hidden] { display: none; }

/* ============================================================
   Curio the character
   ============================================================ */
.curio { position: relative; display: inline-grid; place-items: center; }
.curio-aura {
  position: absolute; inset: -38%;
  border-radius: 50%;
  background: radial-gradient(circle,
    hsla(var(--aura-hue), var(--aura-sat), 62%, calc(var(--aura-intensity) * 1.1)) 0%,
    hsla(var(--aura-hue), var(--aura-sat), 60%, calc(var(--aura-intensity) * .45)) 42%,
    transparent 70%);
  filter: blur(6px);
  z-index: 0;
  transition: background 1.1s ease;
  animation: aura-breathe 5.5s ease-in-out infinite;
}
.curio-face { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; }

/* stroked features share a dark twilight ink */
.curio-face .eye { fill: #f4f2ff; }
.curio-face .pupil { fill: #1b1636; transition: transform .3s ease; }
.curio-face .glint { fill: #fff; }
.curio-face .mouth,
.curio-face .curio-eyes-happy path,
.curio-face .curio-brows path {
  fill: none; stroke: #17123a; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round;
}
.curio-face .curio-spark line { stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; }
.curio-face .curio-spark circle { fill: var(--gold); }
.curio-face .curio-think-dots circle { fill: var(--cloud-dim); }
.curio-body { filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); }

/* mood machinery — hide everything optional, reveal per mood */
.curio-eyes-happy,
.curio-brows,
.curio-think-dots,
.mouth { display: none; }

.curio.mood-confused .m-confused,
.curio.mood-thinking .m-thinking,
.curio.mood-curious  .m-curious,
.curio.mood-delighted .m-delighted { display: block; }

.curio.mood-confused .curio-brows,
.curio.mood-thinking .curio-brows { display: block; }
.curio.mood-confused .brow-l { transform: rotate(9deg); transform-origin: 45px 47px; }
.curio.mood-confused .brow-r { transform: rotate(-9deg); transform-origin: 74px 46px; }

.curio.mood-thinking .curio-think-dots { display: block; }
.curio.mood-thinking .curio-think-dots circle { animation: think 1.4s ease-in-out infinite; }
.curio.mood-thinking .curio-think-dots circle:nth-child(2) { animation-delay: .2s; }
.curio.mood-thinking .curio-think-dots circle:nth-child(3) { animation-delay: .4s; }

.curio.mood-delighted .curio-eyes { display: none; }
.curio.mood-delighted .curio-eyes-happy { display: block; }
.curio.mood-delighted .curio-spark circle { animation: spark-pop 1.2s ease-in-out infinite; }
.curio.mood-delighted .curio-face { animation: joy-bob 1.4s ease-in-out infinite; }

@keyframes aura-breathe {
  0%, 100% { transform: scale(1);    opacity: .85; }
  50%      { transform: scale(1.07); opacity: 1; }
}
@keyframes think {
  0%, 100% { opacity: .25; transform: translateY(1px); }
  50%      { opacity: 1;   transform: translateY(-1px); }
}
@keyframes spark-pop {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.5); }
}
@keyframes joy-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ============================================================
   HOME
   ============================================================ */
.hero {
  max-width: 820px; margin: 0 auto;
  padding: clamp(36px, 7vw, 76px) var(--pad) 20px;
  text-align: center;
}
.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 6.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}
.hero-title .accent {
  color: var(--teal);
  font-style: italic;
  text-shadow: 0 0 30px rgba(61,214,208,.45);
}
.hero-sub {
  max-width: 600px; margin: 0 auto;
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  color: var(--cloud-dim);
}
.hero-curio { width: clamp(120px, 26vw, 176px); height: clamp(120px, 26vw, 176px); margin: 30px auto 8px; }

/* starter form */
.starter { max-width: 620px; margin: 22px auto 0; }
.starter-label {
  display: block; text-align: left;
  font-size: .9rem; color: var(--cloud-dim); margin: 0 0 8px 4px;
}
.starter-row { display: flex; gap: 10px; }
#topic-input {
  flex: 1; min-width: 0;
  font-family: var(--body); font-size: 1.05rem; color: var(--cloud);
  background: var(--ink-3);
  border: 1px solid var(--haze);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: border-color .2s, box-shadow .2s;
}
#topic-input::placeholder { color: #6f6a9c; }
#topic-input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61,214,208,.18);
}
.notes-toggle {
  display: inline-block; margin: 12px 0 0;
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: .76rem; letter-spacing: .04em;
  color: var(--cloud-dim);
}
.notes-toggle:hover { color: var(--teal); }
.notes-input {
  width: 100%; margin-top: 10px; resize: vertical; min-height: 96px;
  font-family: var(--body); font-size: .96rem; color: var(--cloud);
  background: var(--ink-3); border: 1px solid var(--haze);
  border-radius: var(--r-md); padding: 12px 14px;
}
.notes-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(61,214,208,.18); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  font-family: var(--body); font-size: .84rem; color: var(--cloud-dim);
  background: rgba(255,255,255,.04); border: 1px solid var(--haze);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--ink); background: var(--teal); border-color: var(--teal); }

/* how it works */
.how { max-width: var(--maxw); margin: 40px auto 0; padding: 40px var(--pad) 70px; border-top: 1px solid rgba(58,52,112,.4); }
.how-steps {
  list-style: none; counter-reset: step; margin: 0 0 30px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}
.how-steps li { counter-increment: step; }
.how-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: .8rem; color: var(--gold);
  letter-spacing: .1em;
}
.how-k { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 600; margin: 4px 0 6px; }
.how-steps p { margin: 0; color: var(--cloud-dim); font-size: .96rem; }
.science {
  max-width: 720px; margin: 0 auto; text-align: center;
  color: var(--cloud-dim); font-size: .98rem;
  padding: 22px 26px; border: 1px solid var(--haze); border-radius: var(--r-lg);
  background: rgba(255,255,255,.025);
}
.science strong { color: var(--cloud); }

/* ============================================================
   SESSION
   ============================================================ */
.session-grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad);
  display: grid; grid-template-columns: 1fr 340px; gap: 22px;
  align-items: start;
}
.dialogue {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 150px);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--haze); border-radius: var(--r-lg);
  overflow: hidden;
}
.dialogue-head { padding: 20px 24px 14px; border-bottom: 1px solid rgba(58,52,112,.5); }
.dialogue-eyebrow { font-family: var(--mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cloud-dim); margin: 0 0 4px; }
.dialogue-topic { font-family: var(--display); font-weight: 600; font-size: 1.5rem; margin: 0; line-height: 1.2; }

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

.msg { max-width: 82%; padding: 13px 16px; border-radius: 16px; font-size: 1rem; animation: msg-in .34s ease both; }
.msg-you {
  align-self: flex-end; color: #22183a;
  background: linear-gradient(180deg, #ffd067, var(--gold));
  border-bottom-right-radius: 5px;
}
.msg-curio {
  align-self: flex-start;
  background: var(--ink-2); border: 1px solid var(--haze);
  border-bottom-left-radius: 5px;
}
.msg-curio .who { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.msg-curio .who::before { content: ""; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8df3ff, var(--teal)); box-shadow: 0 0 8px rgba(61,214,208,.6); }
.msg-curio .who span { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.msg .flag {
  display: block; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed rgba(255,107,139,.4);
  font-size: .82rem; color: var(--rose);
}
.msg .flag::before { content: "\2691\00A0"; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 18px; background: var(--ink-2); border: 1px solid var(--haze); border-radius: 16px; border-bottom-left-radius: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); opacity: .4; animation: think 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

.composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid rgba(58,52,112,.5); background: rgba(20,18,48,.4); }
#composer-input {
  flex: 1; resize: none; max-height: 180px;
  font-family: var(--body); font-size: 1rem; color: var(--cloud); line-height: 1.5;
  background: var(--ink-3); border: 1px solid var(--haze);
  border-radius: var(--r-md); padding: 12px 14px;
}
#composer-input::placeholder { color: #6f6a9c; }
#composer-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(61,214,208,.18); }
.send { padding: 0; width: 50px; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- instrument panel ---------- */
.panel {
  position: sticky; top: 92px;
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px 22px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--haze); border-radius: var(--r-lg);
}
.panel-curio { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.panel-curio > div { width: 92px; height: 92px; }
.panel-curio-status { margin: 0; text-align: center; font-size: .9rem; color: var(--cloud-dim); min-height: 2.6em; }

/* gauge ring — width drives size; ring is a square via aspect-ratio, and the
   centered number overlays only that square so the label below never collides. */
.gauge { position: relative; width: 168px; margin: 0 auto; }
.gauge-ring { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 9; }
.gauge-fill {
  fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;   /* JS lowers this toward 0 as score rises */
  filter: drop-shadow(0 0 8px rgba(255,194,75,.6));
  transition: stroke-dashoffset 1s cubic-bezier(.22,.61,.36,1), stroke .8s ease;
}
.gauge-center { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 1 / 1; display: grid; place-content: center; text-align: center; }
.gauge-num { font-family: var(--mono); font-weight: 700; font-size: 2.6rem; color: var(--cloud); line-height: 1; }
.gauge-unit { font-family: var(--mono); font-size: .8rem; color: var(--cloud-dim); }
.gauge-label { text-align: center; margin: 8px 0 0; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cloud-dim); }

/* confusion */
.confusion-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.confusion-word { font-family: var(--mono); font-size: .82rem; color: var(--rose); transition: color .5s; }
.confusion-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.confusion-fill {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--rose));
  border-radius: 999px;
  transition: width 1s cubic-bezier(.22,.61,.36,1);
}

/* gaps */
.gaps { display: flex; flex-direction: column; gap: 8px; }
.gaps-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gaps-list li {
  position: relative; padding-left: 20px; font-size: .9rem; color: var(--cloud);
  animation: msg-in .3s ease both;
}
.gaps-list li::before {
  content: ""; position: absolute; left: 2px; top: .5em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 7px rgba(255,194,75,.7);
}
.gaps-empty { font-size: .86rem; color: var(--cloud-dim); font-style: italic; margin: 4px 0 0; }
.grade-btn { margin-top: 4px; }

/* ============================================================
   OVERLAYS — report & settings
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 20px;
  background: rgba(10,8,26,.72); backdrop-filter: blur(6px);
  animation: fade .25s ease both;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: relative; width: 100%; max-width: 560px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--haze); border-radius: var(--r-lg);
  padding: 32px; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6);
  animation: sheet-in .3s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; color: var(--cloud-dim);
  background: transparent; border: none; cursor: pointer;
}
.sheet-close:hover { color: var(--cloud); background: rgba(255,255,255,.06); }

/* report */
.report-sheet { max-width: 620px; display: flex; flex-direction: column; max-height: 88vh; }
.report-scroll { overflow-y: auto; padding-right: 4px; }
.report-top { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.report-mastery {
  flex-shrink: 0; width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 40% 35%, rgba(255,194,75,.28), rgba(255,194,75,.05));
  border: 2px solid var(--gold);
  font-family: var(--mono); font-weight: 700;
}
.report-mastery > span:first-child { font-size: 1.9rem; color: var(--gold); line-height: 1; }
.report-mastery-unit { font-size: .9rem; color: var(--cloud-dim); }
.report-headline { font-family: var(--display); font-weight: 600; font-size: 1.4rem; margin: 0; line-height: 1.25; }

.report-section { margin-top: 22px; }
.report-section h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  margin: 0 0 12px; color: var(--cloud-dim);
}
.report-section h3 .dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-teal { background: var(--teal); box-shadow: 0 0 8px rgba(61,214,208,.7); }
.dot-gold { background: var(--gold); box-shadow: 0 0 8px rgba(255,194,75,.7); }
.dot-rose { background: var(--rose); box-shadow: 0 0 8px rgba(255,107,139,.7); }
.report-item { padding: 12px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.03); border: 1px solid var(--haze); margin-bottom: 8px; }
.report-item .concept { font-weight: 600; margin-bottom: 3px; }
.report-item .concept.you-said { color: var(--rose); }
.report-item .detail { font-size: .92rem; color: var(--cloud-dim); }
.report-item .detail.actually { color: var(--cloud); }
.report-item .detail.actually::before { content: "\2192\00A0"; color: var(--teal); }
.next-steps { list-style: none; margin: 0; padding: 0; }
.next-steps li { position: relative; padding-left: 24px; margin-bottom: 10px; color: var(--cloud); }
.next-steps li::before { content: "\2192"; position: absolute; left: 4px; color: var(--gold); font-family: var(--mono); }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(58,52,112,.5); }

/* settings */
.settings-title { font-family: var(--display); font-weight: 600; font-size: 1.5rem; margin: 0 0 10px; }
.settings-help { color: var(--cloud-dim); font-size: .94rem; margin: 0 0 22px; }
.field-label { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cloud-dim); margin: 16px 0 7px; }
.key-row { display: flex; gap: 8px; }
#key-input, .model-select {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--cloud);
  background: var(--ink-3); border: 1px solid var(--haze); border-radius: var(--r-md);
  padding: 12px 14px;
}
#key-input:focus, .model-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(61,214,208,.18); }
.model-select { cursor: pointer; }
.model-row { display: flex; gap: 8px; align-items: stretch; }
.model-row .model-select { flex: 1; width: auto; }
.model-row .btn-small { white-space: nowrap; }
.model-hint { font-size: .8rem; color: var(--cloud-dim); margin: 8px 2px 0; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.settings-status { font-size: .88rem; color: var(--cloud-dim); }
.settings-status.ok { color: var(--teal); }
.settings-status.err { color: var(--rose); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 80; max-width: 90vw;
  padding: 13px 20px; border-radius: var(--r-md);
  background: var(--ink-3); border: 1px solid var(--haze); color: var(--cloud);
  font-size: .92rem; box-shadow: 0 20px 40px -14px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .3s, transform .3s;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--rose); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .session-grid { grid-template-columns: 1fr; gap: 16px; }
  .dialogue { min-height: 62vh; order: 2; }
  /* Compact instrument band above the chat — a fixed grid so labels never collide. */
  .panel {
    position: static; order: 1;
    display: grid;
    grid-template-columns: 136px 1fr;
    grid-template-areas:
      "gauge status"
      "gauge confusion"
      "gaps  gaps"
      "grade grade";
    align-items: center;
    gap: 14px 22px;
  }
  .panel-curio { grid-area: status; flex-direction: row; justify-content: flex-start; gap: 12px; }
  .panel-curio > div { width: 52px; height: 52px; }
  .panel-curio-status { min-height: 0; text-align: left; flex: 1; }
  .gauge { grid-area: gauge; width: 128px; margin: 0; }
  .gauge-num { font-size: 2rem; }
  .confusion { grid-area: confusion; align-self: center; }
  .gaps { grid-area: gaps; }
  .grade-btn { grid-area: grade; width: 100%; }
}
@media (max-width: 560px) {
  .starter-row { flex-direction: column; }
  .starter-row .btn { width: 100%; }
  .how-steps { grid-template-columns: 1fr; gap: 18px; }
  .msg { max-width: 90%; }
  .sheet { padding: 26px 20px; }
  .report-top { flex-direction: column; text-align: center; }
}

/* accessibility */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .gauge-fill, .confusion-fill { transition: none; }
}
