:root {
  color-scheme: light;
  --ink: #102638;
  --muted: #5d6c78;
  --line: #d8e0e6;
  --line-strong: #bdc9d1;
  --paper: #ffffff;
  --canvas: #f3f6f7;
  --navy: #12314a;
  --navy-soft: #eaf0f4;
  --teal: #0d746d;
  --teal-soft: #e4f3f0;
  --gold: #a96f19;
  --gold-soft: #fbf0de;
  --rust: #9a4b36;
  --rust-soft: #f7e9e5;
  --blue: #2f6389;
  --blue-soft: #e8f0f6;
  --green: #397050;
  --green-soft: #e8f2ec;
  --shadow: 0 18px 44px rgba(20, 46, 64, 0.08);
  --shadow-small: 0 8px 22px rgba(20, 46, 64, 0.07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --content: 1180px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 0%, rgba(13, 116, 109, 0.08), transparent 30rem),
    radial-gradient(circle at 96% 12%, rgba(47, 99, 137, 0.07), transparent 26rem),
    var(--canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(13, 116, 109, 0.3);
  outline-offset: 3px;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 26px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font-weight: 780;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 16px rgba(18, 49, 74, 0.18);
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1px;
}

.header-badge,
.eyebrow,
.tag,
.context-chip,
.corpus-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-badge {
  padding: 8px 12px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.page {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
  padding: 12px 0 54px;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(189, 201, 209, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.scenario-panel {
  overflow: hidden;
}

.scenario-top {
  padding: 30px 32px 26px;
  background: linear-gradient(145deg, var(--navy) 0%, #18435e 100%);
  color: #fff;
}

.eyebrow {
  padding: 6px 10px;
  font-size: 0.74rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.scenario-top h1 {
  margin: 18px 0 12px;
  max-width: 650px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.scenario-top p {
  margin: 0;
  max-width: 650px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
}

.scenario-body {
  padding: 28px 32px 32px;
}

.context-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}

.context-chip {
  padding: 7px 10px;
  font-size: 0.76rem;
  color: var(--navy);
  background: var(--navy-soft);
  border: 1px solid #d7e2e9;
}

.scenario-body p {
  margin: 0 0 15px;
  color: #344a5a;
}

.scenario-body p:last-of-type {
  margin-bottom: 0;
}

.scoring-preview {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.scoring-preview h2 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.preview-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.preview-item {
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius-md);
  background: #f7f9fa;
  border: 1px solid var(--line);
}

.preview-item strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 3px;
}

.preview-item span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.response-panel {
  position: sticky;
  top: 20px;
  padding: 28px;
}

.response-panel h2 {
  margin: 0 0 7px;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.response-panel .lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.93rem;
}

.response-box {
  width: 100%;
  min-height: 238px;
  resize: vertical;
  padding: 17px 18px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  line-height: 1.55;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.response-box::placeholder {
  color: #8a979f;
}

.response-box:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 116, 109, 0.08);
}

.form-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 9px 2px 19px;
  color: var(--muted);
  font-size: 0.76rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 10px 22px rgba(13, 116, 109, 0.2);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(13, 116, 109, 0.24);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  min-height: 44px;
  padding: 10px 15px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  background: #f7f9fa;
}

.ghost-button {
  padding: 9px 10px;
  color: var(--muted);
  background: transparent;
}

.privacy-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.error-box {
  margin-top: 15px;
  padding: 12px 14px;
  color: #7a3024;
  background: var(--rust-soft);
  border: 1px solid #e7c2b8;
  border-radius: 11px;
  font-size: 0.84rem;
}

.loading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.feedback-page {
  display: grid;
  gap: 20px;
}

.feedback-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feedback-toolbar h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}

.feedback-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.score-hero {
  padding: 30px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
}

.score-ring {
  --score: 0;
  --score-color: var(--teal);
  width: 166px;
  height: 166px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #e4eaee 0);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(18, 49, 74, 0.04);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

.score-ring-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-number {
  display: block;
  font-size: 2.7rem;
  line-height: 1;
  font-weight: 820;
  letter-spacing: -0.055em;
}

.score-denominator {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.level-1 { --score-color: var(--rust); }
.level-2 { --score-color: var(--gold); }
.level-3 { --score-color: var(--blue); }
.level-4 { --score-color: var(--teal); }
.level-5 { --score-color: var(--green); }

.level-kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.level-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.feedback-headline {
  margin: 13px 0 6px;
  font-size: 1.05rem;
  font-weight: 760;
  color: var(--navy);
}

.feedback-summary {
  margin: 0;
  max-width: 760px;
  color: #405564;
}

.level-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 24px;
}

.level-segment {
  min-width: 0;
  padding: 9px 8px;
  border-radius: 9px;
  color: #72808a;
  background: #edf1f3;
  border: 1px solid #e0e6e9;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.level-segment.active {
  color: #fff;
  background: var(--score-color);
  border-color: transparent;
}

.section-panel {
  padding: 26px 28px 28px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.tap-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-small);
}

.tap-card + .tap-card {
  margin-top: 11px;
}

.tap-card.dimension-card + .tap-card.dimension-card {
  margin-top: 0;
}

.tap-card.option-card {
  border-color: #e2cfad;
  background: #fffdf9;
}

.tap-card.language-card {
  border-color: #cbd9e2;
}

.tap-card-button {
  width: 100%;
  padding: 16px 17px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  cursor: pointer;
}

.tap-card-button:hover {
  background: rgba(18, 49, 74, 0.025);
}

.tap-card-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tap-card-title-row h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.tag {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.tag-used {
  color: var(--teal);
  background: var(--teal-soft);
}

.tag-option {
  color: var(--gold);
  background: var(--gold-soft);
}

.tag-language {
  color: var(--blue);
  background: var(--blue-soft);
}

.tag-score {
  color: var(--navy);
  background: var(--navy-soft);
}

.tap-card-score {
  display: block;
  margin-top: 5px;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 820;
  letter-spacing: -0.04em;
}

.tap-card-score small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

.card-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.4;
}

.chevron {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f1f4f5;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}

.tap-card-button[aria-expanded="true"] .chevron {
  transform: rotate(45deg);
  background: var(--navy-soft);
  color: var(--navy);
}

.tap-card-details {
  padding: 0 17px 17px;
  color: #405564;
  font-size: 0.86rem;
}

.tap-card-details[hidden] {
  display: none;
}

.tap-card-details p {
  margin: 0 0 12px;
}

.tap-card-details p:last-child {
  margin-bottom: 0;
}

.evidence-quote,
.response-quote,
.revision-box,
.language-pair {
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.evidence-quote {
  margin-bottom: 12px;
  padding: 11px 13px;
  color: var(--navy);
  font-weight: 680;
}

.response-quote {
  margin: 0;
  padding: 17px 18px;
  color: #283f50;
  white-space: pre-wrap;
}

.corpus-chip {
  padding: 5px 8px;
  color: #52646f;
  background: #eff3f5;
  border: 1px solid #dfe6ea;
  font-size: 0.67rem;
}

.corpus-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.74rem;
}

.cards-stack {
  display: grid;
  gap: 11px;
}

.cards-stack .tap-card + .tap-card {
  margin-top: 0;
}

.language-pair {
  overflow: hidden;
  margin-bottom: 12px;
}

.language-line {
  padding: 10px 12px;
}

.language-line + .language-line {
  border-top: 1px solid var(--line);
}

.language-line span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.language-line strong {
  font-weight: 690;
  color: var(--navy);
}

.empty-state {
  padding: 17px;
  color: var(--muted);
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
}

.revision-box {
  padding: 18px;
  color: var(--navy);
  font-size: 1rem;
  white-space: pre-wrap;
}

.method-card {
  background: #f8fafb;
}

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.method-grid h3 {
  margin: 0 0 8px;
  font-size: 0.91rem;
}

.method-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 3px 2px 0;
  color: var(--muted);
  font-size: 0.73rem;
}

@media (max-width: 900px) {
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .response-panel {
    position: static;
  }

  .score-hero {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 23px;
  }

  .score-ring {
    width: 140px;
    height: 140px;
  }

  .dimension-grid {
    grid-template-columns: 1fr;
  }

  .tap-card.dimension-card + .tap-card.dimension-card {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .site-header,
  .page {
    width: min(calc(100% - 24px), var(--content));
  }

  .site-header {
    padding-top: 16px;
  }

  .brand-copy span,
  .header-badge {
    display: none;
  }

  .scenario-top,
  .scenario-body,
  .response-panel,
  .section-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .scenario-top {
    padding-top: 24px;
    padding-bottom: 22px;
  }

  .preview-items {
    grid-template-columns: 1fr;
  }

  .response-box {
    min-height: 205px;
  }

  .feedback-toolbar {
    align-items: flex-start;
  }

  .feedback-toolbar .secondary-button {
    white-space: nowrap;
  }

  .score-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    padding: 24px 20px;
  }

  .feedback-summary {
    text-align: left;
  }

  .level-scale {
    width: 100%;
    gap: 4px;
  }

  .level-segment {
    padding: 7px 3px;
    font-size: 0.6rem;
  }

  .section-heading {
    display: block;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .footer-row {
    display: block;
    text-align: center;
  }

  .footer-row span {
    display: block;
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* First Impressions Coach additions */

.brand-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.home-page {
  display: grid;
  gap: 22px;
}

.home-hero {
  overflow: hidden;
  padding: 46px 48px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 255, 255, 0.13), transparent 18rem),
    linear-gradient(145deg, var(--navy) 0%, #174b62 58%, #176c68 100%);
}

.home-hero h1 {
  max-width: 850px;
  margin: 19px 0 14px;
  font-size: clamp(2.45rem, 5vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.home-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.mode-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
}

.mode-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -55px;
  top: -58px;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
}

.mode-written::after {
  background: var(--blue-soft);
}

.mode-roleplay::after {
  background: var(--teal-soft);
}

.mode-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy);
  font-weight: 820;
  box-shadow: 0 9px 18px rgba(18, 49, 74, 0.16);
}

.mode-roleplay .mode-icon {
  background: var(--teal);
}

.mode-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mode-card h2 {
  margin: 6px 0 10px;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.mode-card > p {
  min-height: 76px;
  margin: 0;
  color: #405564;
}

.mode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 21px 0 23px;
}

.mode-meta span,
.privacy-chip,
.turn-counter {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f7f9fa;
  font-size: 0.7rem;
  font-weight: 710;
}

.principle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 26px;
}

.principle-panel strong {
  color: var(--navy);
}

.principle-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.privacy-chip {
  flex: 0 0 auto;
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #c6e3dc;
}

.page-toolbar {
  margin-bottom: 8px;
}

.back-button {
  padding-left: 0;
}

.teacher-post {
  margin: 22px 0;
  padding: 16px 17px;
  border: 1px solid #d6e1e8;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: #f6f9fb;
}

.teacher-post > span {
  display: block;
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 790;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.teacher-post p {
  margin: 0;
  color: #304a5c;
  font-size: 0.82rem;
  line-height: 1.55;
}

.guide-details {
  margin-top: 21px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfc;
}

.guide-details summary {
  padding: 13px 15px;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
}

.guide-intro {
  padding: 0 15px;
  font-size: 0.78rem;
}

.strategy-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 2px 15px 15px;
}

.strategy-guide-item {
  padding: 10px;
  border: 1px solid #e1e7ea;
  border-radius: 10px;
  background: #fff;
}

.strategy-guide-item strong,
.strategy-guide-item span {
  display: block;
}

.strategy-guide-item strong {
  color: var(--navy);
  font-size: 0.76rem;
}

.strategy-guide-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.inline-button {
  width: fit-content;
  min-width: 180px;
}

.roleplay-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  overflow: hidden;
}

.roleplay-brief-copy {
  padding: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.12), transparent 18rem),
    linear-gradient(145deg, var(--navy) 0%, #174b62 62%, #176c68 100%);
}

.dark-eyebrow {
  color: #fff;
}

.roleplay-brief-copy h1 {
  max-width: 680px;
  margin: 19px 0 13px;
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 1.03;
  letter-spacing: -0.052em;
}

.roleplay-brief-copy > p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.8);
}

.roleplay-brief-copy .context-chip {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.brief-callout {
  display: grid;
  gap: 3px;
  margin: 27px 0 24px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.brief-callout span {
  color: rgba(255, 255, 255, 0.77);
  font-size: 0.82rem;
}

.roleplay-brief-guide {
  padding: 38px 32px;
  background: #fff;
}

.roleplay-brief-guide h2 {
  margin: 0;
  font-size: 1.25rem;
}

.roleplay-brief-guide > p {
  margin: 4px 0 22px;
  color: var(--muted);
  font-size: 0.82rem;
}

.brief-step {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.brief-step > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.72rem;
  font-weight: 790;
}

.brief-step strong {
  font-size: 0.83rem;
}

.brief-step p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-toolbar {
  margin-bottom: 13px;
}

.chat-toolbar h1 {
  margin-top: 3px;
}

.turn-counter {
  flex: 0 0 auto;
  color: var(--navy);
  background: #fff;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: 20px;
  align-items: start;
}

.chat-panel {
  overflow: hidden;
}

.chat-panel-head {
  min-height: 64px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-panel-head > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
}

.chat-panel-head small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.7rem;
}

.chat-panel-head > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.online-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.chat-window {
  min-height: 430px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
    radial-gradient(circle at 10% 10%, var(--teal-soft), transparent 24rem),
    #f5f8f9;
}

.chat-empty {
  min-height: 350px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.chat-empty strong {
  color: var(--navy);
  font-size: 1.15rem;
}

.chat-empty span {
  max-width: 360px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-row {
  display: flex;
  margin: 0 0 17px;
}

.student-row {
  justify-content: flex-end;
}

.classmate-row {
  justify-content: flex-start;
}

.message-wrap {
  max-width: min(78%, 620px);
}

.message-label {
  display: block;
  margin: 0 6px 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 740;
}

.student-row .message-label {
  text-align: right;
}

.message-bubble {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  color: #2d4556;
  background: #fff;
  box-shadow: 0 5px 14px rgba(20, 46, 64, 0.05);
  white-space: pre-wrap;
}

.student-row .message-bubble {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  border-radius: 16px 16px 5px 16px;
}

.compact-bubble {
  padding: 10px 13px;
  font-size: 0.82rem;
}

.typing-bubble {
  min-width: 66px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #87949c;
  animation: typing 1.1s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) { animation-delay: 130ms; }
.typing-bubble span:nth-child(3) { animation-delay: 260ms; }

@keyframes typing {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-3px); opacity: 1; }
}

.chat-form {
  padding: 15px 17px 17px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-input {
  width: 100%;
  resize: none;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fbfcfc;
}

.chat-input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 116, 109, 0.08);
}

.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
}

.chat-actions > span {
  color: var(--muted);
  font-size: 0.68rem;
}

.send-button {
  width: auto;
  min-width: 94px;
  min-height: 42px;
  padding: 9px 16px;
}

.completion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-top: 1px solid #c7e0d5;
  background: var(--green-soft);
}

.completion-banner > div {
  display: grid;
  gap: 2px;
}

.completion-banner span {
  color: #526b5c;
  font-size: 0.76rem;
}

.roleplay-side {
  position: sticky;
  top: 20px;
  padding: 23px;
}

.roleplay-side h2 {
  margin: 0;
  font-size: 1.15rem;
}

.roleplay-side > p {
  margin: 5px 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

.roleplay-option-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.roleplay-option-list > div {
  padding: 11px 12px;
  background: #f9fbfb;
}

.roleplay-option-list > div + div {
  border-top: 1px solid var(--line);
}

.roleplay-option-list strong,
.roleplay-option-list span {
  display: block;
}

.roleplay-option-list strong {
  color: var(--navy);
  font-size: 0.75rem;
}

.roleplay-option-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.side-note {
  margin-top: 17px;
  padding: 12px;
  color: #52646f;
  background: var(--navy-soft);
  border-radius: 11px;
  font-size: 0.72rem;
}

.finish-button {
  width: 100%;
  margin-top: 15px;
}

.assessing-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.dark-spinner {
  border-color: rgba(18, 49, 74, 0.18);
  border-top-color: var(--teal);
}

.chat-error {
  margin: 0 17px 17px;
}

.transcript-review {
  max-height: 520px;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f5f8f9;
}

@media (max-width: 950px) {
  .mode-grid,
  .roleplay-brief,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .mode-card > p {
    min-height: 0;
  }

  .roleplay-side {
    position: static;
  }
}

@media (max-width: 620px) {
  .home-hero {
    padding: 30px 22px;
  }

  .home-hero h1,
  .roleplay-brief-copy h1 {
    font-size: 2.35rem;
  }

  .mode-card,
  .roleplay-brief-guide {
    padding: 23px 20px;
  }

  .principle-panel,
  .completion-banner {
    display: grid;
  }

  .privacy-chip {
    width: fit-content;
  }

  .strategy-guide-grid {
    grid-template-columns: 1fr;
  }

  .roleplay-brief-copy {
    padding: 30px 22px;
  }

  .toolbar-actions {
    display: grid;
    justify-items: end;
  }

  .chat-window {
    min-height: 360px;
    max-height: 52vh;
    padding: 18px 13px;
  }

  .message-wrap {
    max-width: 88%;
  }

  .chat-actions {
    align-items: flex-end;
  }

  .chat-actions > span {
    max-width: 175px;
  }

  .completion-banner .inline-button {
    width: 100%;
  }
}
