:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #60717c;
  --line: #d6e0e4;
  --panel: #ffffff;
  --soft: #eef7f4;
  --accent: #146b5f;
  --accent-2: #b8513e;
  --focus: #d8a31d;
  --board: #fbfcf8;
  --nav: #16242b;
  --nav-soft: #20323b;
  --blue: #285f9e;
  --gold-soft: #fff6dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: #edf2f4;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 336px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  color: #eaf2f4;
  background: var(--nav);
  border-right: 1px solid #0f1a20;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.brand h1,
.problem-strip h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.side-rail .brand p,
.side-rail .eyebrow {
  color: #9fb2bb;
}

.coach-status-card {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #30444e;
  border-radius: 8px;
  background: var(--nav-soft);
}

.coach-status-card strong {
  display: block;
  font-size: 14px;
}

.coach-status-card p {
  margin: 3px 0 0;
  color: #a9bcc4;
  font-size: 12px;
  line-height: 1.35;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: #5ee3bd;
  box-shadow: 0 0 0 4px rgba(94, 227, 189, 0.13);
}

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

.mode-button,
.secondary-button,
.primary-button,
.icon-button,
.link-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.mode-button {
  text-align: left;
  padding: 0 12px;
  color: #dbe8eb;
  border-color: #30444e;
  background: #1b2b33;
}

.mode-button.active,
.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.path-track {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #30444e;
  border-radius: 8px;
  background: #142128;
}

.path-track ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.path-track li {
  position: relative;
  padding-left: 18px;
  color: #b9c9cf;
  font-size: 13px;
  line-height: 1.25;
}

.path-track li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #647b86;
}

.path-track li.current {
  color: #fff;
  font-weight: 700;
}

.path-track li.current::before {
  background: #5ee3bd;
}

.link-button {
  min-height: 30px;
  padding: 0 8px;
  color: var(--accent);
  border-color: transparent;
  background: transparent;
}

.settings-field {
  display: grid;
  gap: 6px;
  margin-top: auto;
  color: #9fb2bb;
  font-size: 12px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9fb2bb;
  font-size: 12px;
}

.settings-field input,
.input-bar input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

.settings-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.coach-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.problem-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}

.problem-strip h2 {
  font-size: 22px;
}

.session-state {
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: center;
  color: var(--accent);
  background: var(--soft);
  border: 1px solid #b7d5cb;
  font-size: 13px;
}

.lesson-loop {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.lesson-loop span {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid #c8d9df;
  border-radius: 999px;
  color: #31515c;
  background: #f4faf8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.transcript-card,
.whiteboard-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.transcript-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.tutor-presence {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.tutor-presence strong {
  display: block;
  font-size: 14px;
}

.tutor-presence p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.tutor-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.42;
}

.message.assistant {
  align-self: flex-start;
  background: var(--soft);
}

.message.student {
  align-self: flex-end;
  color: #fff;
  background: #385c87;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: visible;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.quick-replies button {
  white-space: nowrap;
  padding: 0 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.whiteboard-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  place-items: stretch;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.board-header strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.board-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tool-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #c8d9df;
  border-radius: 8px;
  color: #31515c;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tool-button.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.board-stage {
  position: relative;
  display: grid;
  min-height: 0;
}

canvas {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 208px);
  aspect-ratio: 3 / 2;
  border: 1px solid #d8d0bb;
  border-radius: 8px;
  background: var(--board);
}

#scratchpad {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  touch-action: none;
}

#scratchpad.scratchpad-enabled {
  pointer-events: auto;
  cursor: crosshair;
}

.input-bar {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 84px 64px 72px;
  gap: 8px;
  padding: 12px 14px;
  background: #f8fbf9;
  border-top: 1px solid var(--line);
}

.icon-button.mic {
  border-color: var(--accent-2);
  color: var(--accent-2);
  font-weight: 700;
}

.icon-button.listening {
  background: var(--accent-2);
  color: #fff;
}

.task-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100vh;
  padding: 14px;
  border-left: 1px solid var(--line);
  overflow: auto;
}

.task-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.task-disclosure {
  display: grid;
  gap: 10px;
}

.task-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.task-disclosure summary::-webkit-details-marker {
  display: none;
}

.task-disclosure summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  font-size: 16px;
  line-height: 1;
}

.task-disclosure[open] summary::after {
  content: "-";
}

.task-disclosure > :not(summary) {
  margin-top: 10px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.task-actions,
.feedback-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-actions {
  grid-template-columns: 1fr;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 88px;
  border: 1px dashed #9cb5ae;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbf9;
}

.upload-zone input {
  max-width: 220px;
  margin-top: 8px;
}

.practice-card {
  border-color: #b7d5cb;
  background: #f8fbf9;
}

.course-card {
  border-top: 1px solid var(--line);
}

.course-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-map {
  display: grid;
  gap: 8px;
}

.course-item {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.course-item.current {
  border-color: var(--accent);
  background: #f3faf7;
}

.course-item.completed {
  border-color: #b7d5cb;
}

.course-title-row,
.course-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-title-row {
  justify-content: space-between;
}

.course-title-row strong {
  font-size: 13px;
}

.course-badge {
  color: var(--muted);
  font-size: 11px;
}

.course-actions button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.practice-status {
  color: var(--muted);
  font-size: 13px;
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.active-problem-source {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  padding: 5px 9px;
}

.practice-problem {
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font: 700 26px Consolas, "Segoe UI", monospace;
  text-align: center;
}

.practice-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}

.practice-answer-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.problem-picker {
  display: grid;
  gap: 8px;
}

.problem-chip {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.problem-chip span {
  line-height: 1.35;
}

.problem-chip small {
  color: var(--muted);
}

.muted-chip {
  color: var(--muted);
  background: #f8fbf9;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .coach-panel,
  .workspace {
    overflow: visible;
  }

  .side-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mode-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mode-button {
    text-align: center;
  }

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

  .task-panel {
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .lesson-loop {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .side-rail {
    padding: 12px;
    gap: 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .mode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .problem-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    padding: 8px;
  }

  .input-bar {
    grid-template-columns: 56px minmax(0, 1fr) 72px;
  }

  #stop-button,
  #replay-button {
    grid-row: 2;
  }
}
  background: var(--panel);
  border-color: var(--line);
