/* Braials — Chat
 * A clear messenger layout for adult NT2 lessons. Existing speaker-a/b
 * classes keep each participant on the same side, including consecutive
 * turns. No invented presence, timestamps, or delivery receipts.
 * Loaded after lesson-template.css; also usable as a Thema-studio base.
 */
:root {
  --ink: #182b43;
  --ink-mid: #425670;
  --ink-soft: #52657d;
  --paper: #edf2f8;
  --paper-warm: #e6edf6;
  --white: #ffffff;
  --paper-2: #f7f9fc;
  --border: #d5dfec;
  --line: #d5dfec;
  --ocean: #2855c7;
  --ocean-dark: #1c3f99;
  --ocean-light: #e8efff;
  --gold: #2855c7;
  --gold-dark: #1c3f99;
  --gold-light: #e8efff;
  --forest: #21694f;
  --forest-light: #e8f4ee;
  --ember: #aa3c27;
  --ember-light: #fff0e9;
  --plum: #6845a3;
  --plum-light: #f1ecfb;
  --correct: #21694f;
  --correct-bg: #e8f4ee;
  --incorrect: #b12d3c;
  --incorrect-bg: #fff0f2;
  --radius: 18px;
  --shadow: 0 2px 5px rgba(24, 43, 67, .035);
  --shadow-md: 0 5px 18px rgba(24, 43, 67, .045);
  --shadow-lg: 0 5px 18px rgba(24, 43, 67, .045);
  --font-heading: 'Inter', 'Work Sans', system-ui, sans-serif;
  --font-body: 'Inter', 'Work Sans', system-ui, sans-serif;
  --header-bg: #172e50;
}

html { scrollbar-color: #92a6c2 var(--paper); }
body {
  background: var(--paper);
  background-image: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
}
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -.025em; }
::selection { background: var(--ocean-light); color: var(--ocean-dark); }

/* Compact conversation header; its outlined bubble is a UI symbol. */
.header {
  width: calc(100% - 2.4rem);
  max-width: 800px;
  margin: 1.8rem auto 0;
  padding: 1.6rem 1.8rem 1.8rem;
  text-align: left;
  background: var(--header-bg);
  border: 1px solid var(--header-bg);
  border-radius: 24px 24px 24px 7px;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.header::before {
  top: 1.8rem;
  right: 1.8rem;
  width: 2rem;
  height: 1.5rem;
  border: 2px solid #a9c5fa;
  border-radius: .65rem .65rem .65rem .12rem;
  background: transparent;
}
.header-inner { padding-right: 2.5rem; }
.header-tag {
  color: #dce8ff;
  border: 1px solid #536c91;
  background: transparent;
  border-radius: 7px;
  padding: .2rem .65rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .015em;
  text-transform: none;
  margin-bottom: .75rem;
}
.header h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.04em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.header p { color: #dce5f5; opacity: 1; font-size: 1rem; margin-top: .7rem; }
.container { max-width: 840px; padding: 1.5rem 1.2rem 4rem; }
.progress-wrap { border: 1px solid var(--border); box-shadow: none; }
.progress-fill { background: var(--ocean); }
.sec, .section { margin: 1.75rem 0 .9rem; padding: 0; text-align: left; background: transparent; border: 0; box-shadow: none; }
.sec-tag {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ocean-dark);
  padding: 0;
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .07em;
  box-shadow: none;
}
.sec h2, .section h2 { font-size: 1.45rem; margin-top: .2rem; }
.sec-sub { color: var(--ink-mid); font-size: 1rem; }

/* Exercises stay easy to scan, with one consistent numbered label. */
.card {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.15rem;
  animation: none;
  transition: none;
}
.card:nth-child(n), .blok:nth-child(n) > .card { border-left-color: var(--border); }
.card:hover { transform: none; box-shadow: var(--shadow-md); }
.card-head { gap: .8rem; align-items: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.card:nth-child(n) .card-num, .blok:nth-child(n) > .card .card-num {
  background: var(--ocean-light);
  color: var(--ocean-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 2.1rem;
  height: 2.1rem;
  box-shadow: none;
  font-size: .875rem;
  font-weight: 700;
}
.card-title { font-size: 1.0625rem; line-height: 1.5; letter-spacing: -.015em; }
.card-instr { font-size: .9375rem; color: var(--ink-mid); margin: .25rem 0 0; }
.info {
  border: 1px solid var(--border);
  border-left: 3px solid var(--ocean);
  border-radius: 4px var(--radius) var(--radius) 4px;
  box-shadow: none;
  font-size: 1rem;
}
.info h3 { font-size: 1.0625rem; }
.info.ocean { background: var(--ocean-light); border-color: var(--border); border-left-color: var(--ocean); }
.info.forest { background: var(--forest-light); border-left-color: var(--forest); }
.info.warning { background: var(--ember-light); border-left-color: var(--ember); }
.scenario-box { background: var(--paper-2); border-radius: 12px; font-size: 1rem; }

/* Dialogue: speaker identity, never turn number, controls position. */
.dialogue {
  gap: .85rem;
  margin: 0;
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.dialogue-bubble {
  position: relative;
  width: fit-content;
  min-width: 0;
  max-width: 85%;
  padding: .85rem 1.05rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}
.dialogue-bubble.speaker-a {
  align-self: flex-start;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
}
.dialogue-bubble.speaker-b {
  align-self: flex-end;
  background: var(--ocean);
  color: #fff;
  border: 1px solid var(--ocean);
  border-radius: 18px 18px 4px 18px;
}
.dialogue-bubble strong {
  display: block;
  margin: 0 0 .2rem;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ocean-dark);
}
.dialogue-bubble.speaker-b strong { color: #e0ebff; }
.dialogue-bubble.speaker-b ::selection { color: var(--ink); background: #fff; }
.dialogue-bubble.speaker-a + .dialogue-bubble.speaker-a,
.dialogue-bubble.speaker-b + .dialogue-bubble.speaker-b { margin-top: -.4rem; }

/* Inputs and feedback remain distinct inside both message colours. */
input.inline, input.narrow, input.wide, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  max-width: 100%;
  color: var(--ink);
  background: var(--white);
  border-color: #7b8fae;
  border-radius: 7px;
}
.dialogue-bubble input { max-width: 100%; min-height: 2.2rem; color: var(--ink); background: var(--white); border: 1px solid #7b8fae; }
input[type="text"].inline { width: 9.5rem; }
input[type="text"].narrow { width: 7.5rem; }
input[type="text"].wide { width: 17.5rem; }
.dialogue-bubble.speaker-b input { border-color: #fff; }
.dialogue-bubble input::placeholder { color: var(--ink-soft); opacity: 1; }
.dialogue-bubble.speaker-b .eng { color: #e0ebff; }
.dialogue-bubble input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dialogue-bubble.speaker-b input:focus-visible { outline-color: #fff; }
input.input-ok, .dialogue-bubble input.input-ok { background: var(--correct-bg); color: var(--correct); border-color: var(--correct); }
input.input-no, .dialogue-bubble input.input-no { background: var(--incorrect-bg); color: var(--incorrect); border-color: var(--incorrect); }
.btn, .btn-show { min-height: 2.75rem; border-radius: 10px; font-size: .9375rem; font-weight: 600; }
.btn { background: var(--ocean); color: #fff; box-shadow: none; padding: .6rem 1.1rem; }
.btn:hover { background: var(--ocean-dark); transform: none; box-shadow: none; }
.btn:active { transform: none; }
.btn-show { border: 1px solid var(--border); color: var(--ocean-dark); background: var(--white); }
.btn-show:hover { border-color: var(--ocean); color: var(--ocean-dark); background: var(--ocean-light); }
:is(button, a, input, textarea, select):focus-visible,
input[type="text"]:focus-visible { outline: 3px solid var(--ocean); outline-offset: 3px; }
.mc-radio label, .mco { padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--white); font-size: 1rem; }
.mc-radio label:hover, .mco:hover { border-color: var(--ocean); background: var(--ocean-light); }
.mc-radio label:has(input:checked), .mco.sel { background: var(--ocean-light); border-color: var(--ocean); }
.mc-radio input[type="radio"] { accent-color: var(--ocean); }
.mc-radio label.ok, .mc-radio label.ok:has(input:checked), .mco.ok { border-color: var(--correct); background: var(--correct-bg); color: var(--correct); }
.mc-radio label.no, .mc-radio label.no:has(input:checked), .mco.no { border-color: var(--incorrect); background: var(--incorrect-bg); color: var(--incorrect); }
.fb { border-radius: 10px; font-size: .9375rem; }
.fb.ok { color: var(--correct); border-color: var(--correct); background: var(--correct-bg); animation: none; }
.fb.no { color: var(--incorrect); border-color: var(--incorrect); background: var(--incorrect-bg); animation: none; }
.model-answer { background: var(--ocean-light); color: var(--ink); border-left-color: var(--ocean); font-size: 1rem; }
.row { font-size: 1rem; border-bottom-color: var(--border); }
.eng { color: var(--ink-soft); font-size: .875rem; }

/* Vocabulary, speaking cards and games reuse the same palette. */
.vocab-list { gap: .6rem; }
.vocab-item:nth-child(n) { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: none; }
.vocab-item:nth-child(n):hover { background: var(--paper-2); transform: none; box-shadow: none; }
.vocab-item:nth-child(n) .dutch { color: var(--ocean-dark); font-size: 1rem; }
.vocab-item .english { color: var(--ink-mid); font-size: .9375rem; }
.vocab-play-btn { background: var(--ocean); }
.vocab-play-btn:hover { transform: none; background: var(--ocean-dark); }
.pov-situatie, .tb-tekst, .hint-item, .galg-item { background: var(--paper-2); border-color: var(--border); border-radius: 12px; }
button.pov-optie, button.mem-kaart, button.cat-chip, button.zin-chip, button.galg-letter { min-height: 2.75rem; border-color: var(--border); border-radius: 10px; font-size: 1rem; }

@media (max-width: 600px) {
  .header { width: calc(100% - 1.4rem); margin-top: .7rem; padding: 1.3rem; border-radius: 18px 18px 18px 5px; }
  .header::before { top: 1.35rem; right: 1.3rem; width: 1.5rem; height: 1.2rem; }
  .header-inner { padding-right: 1.8rem; }
  .header p { font-size: .9375rem; }
  .container { padding: 1rem .7rem 2.5rem; }
  .card { padding: 1rem; border-radius: 14px; }
  .dialogue { padding: .75rem; gap: .75rem; border-radius: 10px; }
  .dialogue-bubble { max-width: 94%; padding: .75rem .85rem; }
  .card-head { gap: .6rem; }
  .vocab-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body, .header, .card, .dialogue, .dialogue-bubble.speaker-a, .dialogue-bubble.speaker-b { background: #fff !important; color: #000 !important; box-shadow: none; }
  .header { width: 100%; margin: 0; border: 1px solid #777; }
  .header h1, .header p, .header-tag, .dialogue-bubble strong, .dialogue-bubble.speaker-b strong { color: #000; }
  .dialogue-bubble.speaker-b .eng { color: #000; }
  .header::before { display: none; }
  .dialogue-bubble.speaker-a, .dialogue-bubble.speaker-b { border: 1px solid #777; break-inside: avoid; }
  .card { break-inside: auto; }
  .card-head { break-after: avoid; }
}
