:root {
  color-scheme: light;
  --background: #f5f7fb;
  --foreground: #172033;
  --muted: #607086;
  --panel: #ffffff;
  --primary: #2f6fdd;
  --primary-foreground: #ffffff;
  --secondary: #eaf3ff;
  --border: #d9e5f0;
  --soft: #f3f7fb;
  --accent: #0f8a79;
  --accent-soft: #e3f7f3;
  --warm: #fff4e7;
  --warm-strong: #c25a1d;
  --warning-bg: #fff6e8;
  --warning-text: #a34d13;
  --shadow: 0 18px 42px rgb(31 45 72 / 10%);
  --soft-shadow: 0 8px 22px rgb(31 45 72 / 6%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgb(225 239 255 / 78%) 0, transparent 34%),
    linear-gradient(135deg, rgb(248 251 255 / 96%) 0%, rgb(240 247 251 / 92%) 52%, rgb(236 248 244 / 90%) 100%),
    var(--background);
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  position: relative;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 50;
  width: max-content;
  max-width: min(260px, 80vw);
  border: 1px solid rgb(203 213 225 / 86%);
  border-radius: 8px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 16px 36px rgb(31 45 72 / 16%);
  color: var(--foreground);
  content: attr(data-tooltip);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  padding: 9px 11px;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  white-space: normal;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.course-sidebar [data-tooltip]::after {
  left: 0;
  transform: translate(0, 4px);
}

.course-sidebar [data-tooltip]:hover::after,
.course-sidebar [data-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}

.teacher-sidebar [data-tooltip]::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.teacher-sidebar [data-tooltip]:hover::after,
.teacher-sidebar [data-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.learning-app {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgb(255 255 255 / 92%);
  padding: 14px 18px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.top-actions,
.section-heading,
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-actions,
.section-heading {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.3rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.35;
}

.status-pill {
  border-radius: 999px;
  background: var(--secondary);
  color: var(--primary);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.muted {
  background: var(--soft);
  color: var(--muted);
}

.status-pill.ready {
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button {
  background: linear-gradient(135deg, #3675e8 0%, #2f6fdd 100%);
  color: var(--primary-foreground);
  box-shadow: 0 8px 18px rgb(47 111 221 / 22%);
}

.secondary-button {
  background: var(--secondary);
  color: var(--primary);
  box-shadow: none;
}

.wide-button {
  width: 100%;
}

.session-hero,
.course-sidebar,
.study-panel,
.teacher-sidebar section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.session-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 96%) 0%, rgb(239 247 255 / 94%) 58%, rgb(230 248 244 / 92%) 100%);
  color: var(--muted);
  line-height: 1.7;
}

.session-hero h2 {
  max-width: 760px;
  font-size: 1.6rem;
  color: var(--foreground);
  line-height: 1.24;
}

.session-hero p {
  max-width: 780px;
  margin: 6px 0 0;
}

.hero-copy {
  min-width: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hero-companion {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px 12px;
  border: 1px solid rgb(255 255 255 / 78%);
  border-radius: 8px;
  background: rgb(255 255 255 / 76%);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.companion-avatar {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  grid-row: span 2;
}

.hero-companion strong {
  font-size: 1.08rem;
  color: var(--foreground);
}

.hero-companion p {
  margin: 0;
}

.session-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.session-steps span {
  border-radius: 8px;
  background: rgb(243 247 251 / 92%);
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.session-steps .active {
  background: var(--accent-soft);
  color: var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(560px, 1fr) 340px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.course-sidebar,
.teacher-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.course-sidebar {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar-card,
.teacher-card,
.study-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.task-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
  text-align: left;
}

.task-item strong {
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.8rem;
}

.task-item.active {
  border-color: #b7d0f3;
  background: var(--secondary);
}

.task-item.active strong {
  background: #ffffff;
  color: var(--primary);
}

.progress-strip {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 12px;
}

.progress-strip span {
  font-size: 0.78rem;
  font-weight: 800;
}

.progress-strip strong {
  color: var(--foreground);
}

.review-needed {
  border-color: #ead6bd;
  background: var(--warm);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--soft);
  padding: 5px;
}

.segmented button {
  background: transparent;
  color: var(--muted);
}

.segmented .active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--soft-shadow);
}

.upload-zone {
  display: grid;
  gap: 4px;
  border: 1px dashed #9fbce2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  margin-bottom: 12px;
  padding: 16px;
}

.upload-zone strong {
  color: var(--foreground);
}

.upload-zone span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.paste-course {
  margin-top: 12px;
}

.lesson-item {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: var(--foreground);
  padding: 12px;
  text-align: left;
}

.lesson-item.active {
  border-color: var(--primary);
  background: var(--secondary);
}

.lesson-item small,
.summary,
.hint,
.status-text,
.goal-list,
label {
  color: var(--muted);
}

.hint {
  border-radius: 999px;
  background: var(--soft);
  padding: 7px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.goal-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  margin-top: 2px;
}

.study-panel {
  min-height: calc(100vh - 122px);
  padding: 20px;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lesson-meta span {
  border-radius: 999px;
  background: #f5f9fc;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 800;
}

.screen-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.screen-hud > div {
  min-width: 0;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 92%) 0%, rgb(238 247 255 / 92%) 100%);
  padding: 10px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
}

.screen-hud span,
.screen-hud strong {
  display: block;
}

.screen-hud span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.screen-hud strong {
  margin-top: 3px;
  color: var(--foreground);
}

.energy-meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.energy-meter span {
  grid-column: 1 / -1;
}

.energy-track {
  align-self: center;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9f7;
}

.energy-track i {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
  box-shadow: 0 0 14px rgb(15 138 121 / 38%);
}

.study-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.study-mode-tabs button {
  min-height: 38px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.86rem;
}

.study-mode-tabs .active {
  border-color: var(--primary);
  background: var(--secondary);
  color: var(--primary);
}

.word-grid,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.content-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  margin-top: 14px;
  overflow: visible;
  border: 1px solid rgb(121 161 219 / 32%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(12 24 48 / 7%) 0%, rgb(47 111 221 / 5%) 42%, rgb(15 138 121 / 6%) 100%);
  padding: 10px;
}

.document-frame {
  position: relative;
  overflow: visible;
  border: 1px solid rgb(91 129 190 / 38%);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgb(116 185 255 / 18%) 0, transparent 34%),
    radial-gradient(circle at 92% 20%, rgb(16 185 129 / 12%) 0, transparent 28%),
    linear-gradient(180deg, rgb(255 255 255 / 98%) 0%, rgb(242 247 255 / 96%) 100%);
  padding: 16px;
  box-shadow:
    0 0 0 6px rgb(23 32 51 / 3%),
    inset 0 1px 0 rgb(255 255 255 / 90%),
    inset 0 -18px 42px rgb(47 111 221 / 4%),
    0 24px 52px rgb(31 45 72 / 14%);
}

.document-frame::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(47 111 221 / 4%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(47 111 221 / 4%) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  opacity: 0.42;
}

.document-frame::after {
  position: absolute;
  right: 18px;
  bottom: 12px;
  left: 18px;
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0%, rgb(47 111 221 / 18%) 22%, rgb(15 138 121 / 24%) 50%, rgb(47 111 221 / 18%) 78%, transparent 100%);
  content: "";
  pointer-events: none;
}

.document-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  padding-bottom: 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

.document-toolbar strong {
  color: var(--foreground);
  font-size: 0.84rem;
}

.reading-surface {
  position: relative;
  z-index: 1;
  overflow: visible;
  min-height: 430px;
  border: 1px solid rgb(217 229 240 / 74%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 72%) 0%, rgb(250 253 255 / 82%) 100%);
  margin-top: 14px;
  padding: 20px;
  box-shadow: inset 0 0 30px rgb(47 111 221 / 4%);
}

.media-preview {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 260px;
  border: 1px dashed #a7bfdc;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 76%) 0%, rgb(244 249 255 / 86%) 100%);
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.media-preview strong {
  color: var(--foreground);
}

.media-preview span {
  line-height: 1.6;
  font-size: 0.88rem;
}

.word-chip {
  display: inline-grid;
  align-content: center;
  gap: 2px;
  min-height: 44px;
  border: 1px solid #cfe0f3;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--foreground);
  font-weight: 750;
  box-shadow:
    0 7px 18px rgb(35 54 84 / 7%),
    inset 0 1px 0 rgb(255 255 255 / 90%);
}

.word-label,
.word-phonetic {
  display: block;
}

.word-phonetic {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

.word-chip.unknown .word-phonetic {
  color: #b45a1b;
}

.word-chip:hover {
  border-color: #b7d0f3;
  background: #f8fbff;
}

.word-chip.unknown {
  border-color: var(--warning-text);
  background: var(--warning-bg);
  color: var(--warning-text);
  box-shadow:
    0 0 0 3px rgb(194 90 29 / 8%),
    0 10px 22px rgb(194 90 29 / 12%);
}

.word-coach-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgb(15 138 121 / 24%);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 96%) 0%, rgb(235 250 246 / 94%) 100%);
  padding: 14px;
  box-shadow:
    0 18px 38px rgb(15 138 121 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 82%);
}

.coach-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgb(47 111 221 / 18%);
}

.coach-dialogue {
  display: grid;
  gap: 7px;
}

.coach-dialogue span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
}

.coach-dialogue strong {
  color: var(--foreground);
  font-size: 1rem;
}

.coach-pronunciation {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.coach-dialogue p {
  margin: 0;
  color: #24324a;
  line-height: 1.75;
  white-space: pre-wrap;
}

.coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.focus-chip {
  border-radius: 999px;
  background: var(--secondary);
  padding: 10px 14px;
  color: var(--primary);
  font-weight: 700;
}

.sentence-help {
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  margin-top: 16px;
  padding: 16px;
  box-shadow: var(--soft-shadow);
}

.inline-ai-response {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid #cfe8e2;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4fbf9 100%);
  padding: 12px;
}

.inline-ai-response.active {
  border-color: var(--accent);
  box-shadow: 0 14px 32px rgba(22, 163, 127, 0.14);
}

.inline-ai-response strong {
  color: var(--accent);
  font-size: 0.88rem;
}

.inline-ai-response p {
  margin: 0;
  color: var(--foreground);
  line-height: 1.7;
  white-space: pre-wrap;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--foreground);
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--foreground);
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

.chat-window {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.teacher-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.teacher-card:first-child {
  border-color: #cfe8e2;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4fbf9 100%);
}

.chat-message {
  width: fit-content;
  max-width: 88%;
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
  margin-top: 0;
}

.chat-message.student {
  justify-self: end;
  background: var(--secondary);
  border: 1px solid #c8dcff;
}

.chat-message.teacher {
  justify-self: start;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbfa 100%);
  border: 1px solid #d5eee8;
}

.chat-message span {
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 800;
}

.chat-message p {
  margin: 8px 0 0;
  line-height: 1.8;
  white-space: pre-wrap;
}

.friend-chat {
  margin: 12px 0;
}

.persona-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.squad-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.persona-button,
.squad-button,
.correction-button {
  min-height: 36px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.86rem;
}

.persona-button.active,
.squad-button.active,
.correction-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.persona-button[data-persona="quest_coach"] {
  border-color: rgb(55 103 255 / 22%);
}

.persona-button[data-persona="quest_coach"].active {
  border-color: var(--primary);
  background: var(--secondary);
  color: var(--primary);
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  min-height: 34px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.84rem;
}

.voice-transcript {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid #d5eee8;
  border-radius: 8px;
  background: #f5fbfa;
  padding: 12px;
}

.voice-transcript strong {
  color: var(--accent);
  font-size: 0.88rem;
}

.voice-transcript p {
  margin: 0;
  color: var(--foreground);
  line-height: 1.7;
}

.encouragement-card {
  border-color: #ead6bd;
  background:
    linear-gradient(180deg, #ffffff 0%, #fff8ef 100%);
}

.encouragement-card strong {
  display: block;
  color: var(--foreground);
}

.encouragement-card p {
  color: var(--muted);
  line-height: 1.7;
}

.plan-box {
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #f3f8fb 100%);
  margin: 12px 0;
  padding: 14px;
}

.plan-box strong {
  display: block;
  color: var(--foreground);
}

.plan-box p {
  color: var(--muted);
  line-height: 1.7;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.signal-board div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.signal-board span,
.signal-board strong {
  display: block;
}

.signal-board span {
  color: var(--muted);
  font-size: 0.78rem;
}

.signal-board strong {
  margin-top: 4px;
  color: var(--foreground);
  font-size: 0.9rem;
}

.memory-grid div {
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.memory-grid strong,
.memory-grid span {
  display: block;
}

.memory-grid strong {
  font-size: 1.1rem;
}

.memory-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.survey-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0;
}

.pause-notice {
  margin-top: 16px;
  border-radius: 8px;
  background: var(--warning-bg);
  padding: 14px;
  color: var(--warning-text);
  font-weight: 700;
}

.hidden {
  display: none;
}

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

.review-queue,
.activity-log {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.empty-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.review-item,
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.activity-item {
  align-items: flex-start;
  display: grid;
}

.activity-item span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--primary);
  padding: 0 10px;
  font-size: 0.8rem;
}

.session-report {
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8fb 100%);
  margin: 12px 0;
  padding: 14px;
}

.session-report strong {
  display: block;
}

.session-report p {
  color: var(--muted);
  line-height: 1.7;
}

.report-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.report-metrics span {
  border-radius: 999px;
  background: #ffffff;
  color: var(--foreground);
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

body.game-mode {
  --background: #f0f6ff;
  --foreground: #101827;
  --muted: #56657a;
  --panel: #fbfdff;
  --primary: #3767ff;
  --secondary: #e8efff;
  --accent: #0aa787;
  --accent-soft: #dcfaf2;
  --border: #c9d8ee;
  background:
    radial-gradient(circle at 18% 0%, rgb(58 104 255 / 18%) 0, transparent 30%),
    radial-gradient(circle at 88% 20%, rgb(10 167 135 / 16%) 0, transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #edf4ff 48%, #f4fbf7 100%);
}

.game-mode .top-bar,
.game-mode .session-hero,
.game-mode .sidebar-card,
.game-mode .teacher-card,
.game-mode .study-panel {
  border-color: rgb(80 125 255 / 22%);
  box-shadow:
    0 18px 38px rgb(31 45 72 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 76%);
}

.game-mode .top-bar {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 94%) 0%, rgb(239 246 255 / 92%) 100%);
}

.game-mode h1::after {
  display: inline-block;
  margin-left: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  content: "Quest";
  font-size: 0.78rem;
  padding: 4px 8px;
  vertical-align: middle;
}

.game-mode .session-hero {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 96%) 0%, rgb(232 241 255 / 94%) 60%, rgb(226 250 243 / 94%) 100%);
}

.game-mode .task-card:first-child .eyebrow::after {
  content: " · LEVEL PATH";
}

.game-mode .task-item {
  border-color: rgb(55 103 255 / 22%);
}

.game-mode .task-item::before {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--primary);
  content: "L" counter(level);
  font-size: 0.78rem;
  font-weight: 900;
}

.game-mode .task-list {
  counter-reset: level;
}

.game-mode .task-item {
  counter-increment: level;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.game-mode .progress-strip {
  background:
    linear-gradient(135deg, rgb(220 250 242 / 94%) 0%, rgb(232 239 255 / 94%) 100%);
}

.game-mode .study-panel {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 98%) 0%, rgb(246 250 255 / 96%) 100%);
}

.game-mode .document-frame {
  border-color: rgb(55 103 255 / 30%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 97%) 0%, rgb(242 248 255 / 97%) 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 80%),
    0 22px 48px rgb(55 103 255 / 14%);
}

.game-mode .document-toolbar span::before {
  color: var(--accent);
  content: "MISSION · ";
}

.game-mode .screen-hud > div {
  border-color: rgb(55 103 255 / 24%);
  background:
    linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
}

.game-mode .energy-track i {
  background:
    linear-gradient(90deg, #0aa787 0%, #3767ff 58%, #8b5cf6 100%);
}

.game-mode .word-chip {
  border-color: rgb(55 103 255 / 18%);
}

.game-mode .word-chip.unknown {
  border-color: #b97822;
  background: #fff4de;
}

.game-mode .teacher-card:first-child {
  border-color: rgb(10 167 135 / 26%);
}

.game-mode .persona-button[data-persona="quest_coach"].active {
  box-shadow: 0 8px 18px rgb(55 103 255 / 16%);
}

.game-mode .squad-button.active,
.game-mode .correction-button.active {
  border-color: var(--primary);
  background: var(--secondary);
  color: var(--primary);
}

.game-mode .voice-transcript {
  border-color: rgb(10 167 135 / 24%);
  background:
    linear-gradient(180deg, #ffffff 0%, #effbf8 100%);
}

@media (max-width: 1160px) {
  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .teacher-sidebar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
    max-height: none;
    overflow: visible;
  }

  .course-sidebar {
    top: 86px;
  }

  .content-stage {
    grid-template-columns: 1fr;
  }

  .media-preview {
    min-height: 150px;
  }

  .screen-hud {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .session-hero,
  .workspace,
  .teacher-sidebar {
    grid-template-columns: 1fr;
  }

  .top-bar,
  .top-actions,
  .section-heading,
  .action-row {
    align-items: stretch;
  }

  .top-bar {
    position: static;
  }

  .course-sidebar,
  .teacher-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .session-hero h2 {
    font-size: 1.7rem;
  }

  .hero-companion {
    grid-template-columns: 1fr;
  }

  .companion-avatar,
  .session-steps {
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .learning-app {
    padding: 10px;
  }

  .study-panel {
    min-height: auto;
  }

  .reading-surface {
    min-height: 320px;
  }

  .screen-hud {
    grid-template-columns: 1fr;
  }

  .teacher-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }

  button:hover {
    transform: none;
  }
}
