:root {
  color-scheme: light;
  --canvas: #f3f5f1;
  --surface: #ffffff;
  --surface-warm: #fbfaf6;
  --ink: #14211f;
  --navy: #14213d;
  --muted: #66736f;
  --line: #d8dfda;
  --line-strong: #bfcac4;
  --teal: #0f766e;
  --teal-dark: #0a5b55;
  --teal-soft: #e3f3ef;
  --blue: #315f9b;
  --blue-soft: #e8f0fa;
  --amber: #a76513;
  --amber-soft: #fff2d8;
  --rose: #a84050;
  --rose-soft: #fbeaec;
  --violet: #76529a;
  --violet-soft: #f0e8f7;
  --shadow: 0 18px 48px rgba(26, 43, 38, 0.09);
  --shadow-soft: 0 8px 24px rgba(26, 43, 38, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.08), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.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;
}

.practice-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(184, 197, 190, 0.78);
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: blur(16px);
}

.practice-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.practice-brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.17);
}

.practice-brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.practice-brand strong,
.practice-brand small {
  display: block;
}

.practice-brand strong {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.15;
}

.practice-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.practice-global-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.practice-global-nav a {
  min-width: 96px;
  padding: 9px 14px;
  border-radius: 8px;
  color: #53605c;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.practice-global-nav a:hover,
.practice-global-nav a:focus-visible {
  color: var(--teal);
  outline: none;
  transform: translateY(-1px);
}

.practice-global-nav a.is-active {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.practice-main {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.practice-hero {
  display: flex;
  min-height: 0;
  align-items: center;
  padding: 0 2px;
  color: var(--navy);
}

.practice-eyebrow {
  margin: 0 0 10px;
  color: #75d3c6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.practice-hero h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.session-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(34px, 4.6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(320px, 0.95fr) minmax(270px, 0.62fr);
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.setup-card,
.progress-panel,
.question-panel,
.tutor-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.setup-card {
  min-height: 510px;
  padding: 23px;
  border-radius: 18px;
}

.setup-card--start {
  position: sticky;
  top: 94px;
  min-height: auto;
  background: var(--surface-warm);
}

.setup-card__heading {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.setup-card__heading > div {
  min-width: 0;
}

.setup-card h2,
.progress-panel h2,
.tutor-panel h2 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.25;
}

.setup-step {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.selection-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
}

.setup-hint,
.empty-copy,
.start-note,
.tutor-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.setup-hint {
  margin: -7px 0 14px;
}

.filter-search {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
  color: var(--muted);
}

.filter-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.filter-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.source-groups {
  display: grid;
  max-height: 425px;
  gap: 18px;
  margin-top: 17px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b8c6bf transparent;
  scrollbar-width: thin;
}

.source-group {
  display: grid;
  gap: 8px;
}

.source-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #77837f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-group__title::after {
  height: 1px;
  flex: 1;
  background: #e7ece8;
  content: "";
}

.source-option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.source-option:hover {
  border-color: #8bb9b2;
  transform: translateY(-1px);
}

.source-option.is-selected {
  border-color: var(--teal);
  background: #f1faf7;
  box-shadow: inset 3px 0 0 var(--teal);
}

.source-option.is-locked {
  background: #f5f5f2;
  cursor: not-allowed;
  opacity: 0.72;
}

.source-option input,
.topic-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1.5px solid #98a6a1;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 13px;
  font-weight: 900;
}

.source-option.is-selected .check-box,
.topic-option.is-selected .check-box {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.source-radio {
  border-radius: 50%;
}

.source-option.is-selected .source-radio {
  background: #ffffff;
  box-shadow: inset 0 0 0 5px var(--teal);
}

.source-option__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.source-option__copy strong,
.source-option__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-option__copy strong {
  color: var(--navy);
  font-size: 14px;
  white-space: nowrap;
}

.source-option__copy small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.source-option__meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.source-option__meta strong {
  color: var(--ink);
  font-size: 12px;
}

.coverage-pill {
  padding: 3px 6px;
  border-radius: 999px;
  background: #eef2ef;
}

.coverage-pill.is-complete {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.coverage-pill.is-unscored {
  background: var(--violet-soft);
  color: var(--violet);
}

.topic-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.text-button,
.back-link {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
}

.text-button {
  padding: 0 4px;
  font-size: 12px;
}

.text-button:hover,
.text-button:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  color: var(--navy);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-options {
  display: flex;
  max-height: 402px;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b8c6bf transparent;
  scrollbar-width: thin;
}

.topic-option {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  min-height: 37px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
  color: #46524e;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.topic-option .check-box {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 5px;
  font-size: 11px;
}

.topic-option.is-selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 800;
}

.topic-option__count {
  color: #7d8985;
  font-size: 10px;
}

.availability-card {
  display: flex;
  min-height: 128px;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 18px;
  padding: 25px 18px;
  border: 1px solid #cfe4dd;
  border-radius: 16px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.availability-card span {
  align-self: flex-start;
  margin-top: 8px;
  color: #51726b;
  font-size: 12px;
  font-weight: 800;
}

.availability-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  line-height: 1;
}

.availability-card small {
  font-size: 13px;
  font-weight: 800;
}

.quantity-field {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.quantity-field input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  outline: 0;
}

.quantity-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.quantity-field input.is-invalid {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(168, 64, 80, 0.09);
}

.quantity-message {
  min-height: 42px;
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.quantity-message.is-error {
  color: var(--rose);
  font-weight: 750;
}

.start-practice-button,
.primary-button,
.secondary-button,
.answer-action,
.submit-response,
.assessment-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 850;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.start-practice-button {
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  padding: 0 18px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.start-practice-button:hover:not(:disabled),
.primary-button:hover:not(:disabled),
.submit-response:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
}

.start-practice-button:disabled {
  border-color: #ccd3cf;
  background: #dfe4e1;
  color: #88928e;
}

.start-note {
  margin: 12px 2px 0;
  text-align: center;
}

.practice-loading,
.empty-copy {
  display: grid;
  min-height: 108px;
  place-items: center;
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
}

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

.practice-error {
  padding: 16px;
  border: 1px solid #efc3ca;
  border-radius: 12px;
  background: var(--rose-soft);
  color: #8b3141;
  font-size: 13px;
  line-height: 1.6;
}

/* Session */

.session-view {
  width: 100%;
}

.session-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 4px 23px;
}

.session-heading .practice-eyebrow {
  margin-top: 17px;
  color: var(--teal);
}

.session-heading h1 {
  color: var(--navy);
  font-size: clamp(32px, 4vw, 48px);
}

.back-link {
  padding: 0;
  font-size: 13px;
}

.session-position {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.progress-panel {
  padding: 19px 22px 17px;
  border-radius: 17px;
}

.progress-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.progress-panel h2 {
  margin: 0 0 7px;
  font-size: 16px;
}

.status-legend,
.progress-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d2d9d5;
}

.status-dot.is-answered,
.question-progress__item.is-answered {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-dot.is-correct,
.question-progress__item.is-correct {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.status-dot.is-incorrect,
.question-progress__item.is-incorrect {
  background: var(--rose-soft);
  color: var(--rose);
}

.status-dot.is-revealed,
.question-progress__item.is-revealed {
  background: var(--violet-soft);
  color: var(--violet);
}

.status-dot.is-answered,
.status-dot.is-correct,
.status-dot.is-incorrect,
.status-dot.is-revealed {
  box-shadow: inset 0 0 0 2px currentColor;
}

.progress-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #f1f4f2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.progress-summary strong {
  color: var(--navy);
  font-size: 13px;
}

.progress-track {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece9;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.25s ease;
}

.question-progress {
  display: flex;
  gap: 7px;
  margin-top: 13px;
  padding: 1px 0 3px;
  overflow-x: auto;
  scrollbar-color: #b8c6bf transparent;
  scrollbar-width: thin;
}

.question-progress__item {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8f6;
  color: #7a8581;
  font-size: 11px;
  font-weight: 850;
}

.question-progress__item.is-current {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(20, 33, 61, 0.12);
  transform: translateY(-1px);
}

.practice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.question-panel,
.tutor-panel {
  border-radius: 18px;
}

.question-panel {
  min-width: 0;
  min-height: 650px;
  padding: clamp(20px, 3vw, 34px);
}

.question-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e6ebe8;
}

.question-card__source {
  display: grid;
  gap: 5px;
}

.question-card__source span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.question-card__source strong {
  color: var(--navy);
  font-size: 15px;
}

.question-topic {
  max-width: 42%;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #80500f;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.question-prompt {
  margin-top: 25px;
  color: #202d2a;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.85;
}

.question-prompt p {
  margin: 0 0 16px;
}

.question-prompt ul,
.question-prompt ol {
  padding-left: 1.45em;
}

.question-formula,
.answer-formula {
  margin: 17px 0;
  overflow-x: auto;
  text-align: center;
}

.question-callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--teal);
  border-radius: 0 10px 10px 0;
  background: #f0f7f5;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 14px;
}

.question-image-list,
.answer-image-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.question-image,
.answer-image {
  margin: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.question-image img,
.answer-image img,
.option-card img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.question-image figcaption,
.answer-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 11px;
  text-align: center;
}

.response-area {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.response-area__title {
  margin: 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.response-contract-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.response-contract-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.response-part {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid #dce6e2;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfa 100%);
}

.response-part__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.response-part__kind {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.response-part__prompt,
.response-guidance {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 14px;
  line-height: 1.65;
}

.response-guidance {
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 12px;
}

.ordering-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ordering-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.ordering-rank,
.assignment-index,
.truth-index {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #edf4f1;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
}

.ordering-copy,
.assignment-item,
.truth-statement {
  min-width: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 15px;
  line-height: 1.55;
}

.ordering-controls {
  display: flex;
  gap: 5px;
}

.ordering-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
}

.ordering-button:hover:not(:disabled),
.ordering-button:focus-visible {
  border-color: var(--teal);
  outline: none;
  background: var(--teal-soft);
}

.assignment-grid,
.truth-matrix {
  display: grid;
  gap: 8px;
}

.assignment-row,
.truth-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 0.55fr);
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.assignment-select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.assignment-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.truth-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.truth-choices {
  display: flex;
  gap: 7px;
}

.truth-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfa;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.truth-choice:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.truth-choice input {
  accent-color: var(--teal);
}

.option-list {
  display: grid;
  gap: 9px;
}

.option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.option-card:hover:not(:disabled),
.option-card:focus-visible {
  border-color: #76aaa2;
  outline: none;
  transform: translateY(-1px);
}

.option-card.is-selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--teal);
}

.option-card.is-correct-answer {
  border-color: var(--teal);
  background: #e4f5ef;
}

.option-card.is-wrong-answer {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.option-card__label {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #bcc7c2;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.option-card__content {
  min-width: 0;
  padding-top: 2px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 16px;
  line-height: 1.6;
}

.option-card__content img {
  margin-top: 10px;
}

.free-response-input {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  line-height: 1.65;
  outline: 0;
}

.free-response-input:focus,
.numeric-response-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.numeric-response-input {
  width: min(260px, 100%);
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  outline: 0;
}

.response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 2px;
}

.submit-response,
.answer-action {
  min-width: 128px;
  padding: 0 15px;
}

.submit-response {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.submit-response:disabled {
  border-color: #d2d9d5;
  background: #e4e8e5;
  color: #8a9490;
}

.answer-action {
  border: 1px solid #c8b3dc;
  background: #faf7fd;
  color: #674487;
}

.answer-action:hover:not(:disabled) {
  background: var(--violet-soft);
}

.save-status {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.answer-panel {
  margin-top: 22px;
  padding: 19px;
  border: 1px solid #cab7dc;
  border-radius: 14px;
  background: #faf7fd;
}

.answer-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.answer-panel__heading h3 {
  margin: 0;
  color: #5f3d7c;
  font-size: 16px;
}

.answer-panel__heading span {
  color: #806599;
  font-size: 10px;
  font-weight: 800;
}

.answer-content {
  color: #332a3a;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 15px;
  line-height: 1.75;
}

.answer-content p {
  margin: 8px 0;
}

.answer-content ol,
.answer-content ul {
  margin: 10px 0;
  padding-left: 1.4em;
}

.self-assessment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dfd2e9;
}

.self-assessment > span {
  margin-right: 4px;
  color: #604e6e;
  font-size: 12px;
  font-weight: 800;
}

.assessment-button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.assessment-button.is-correct {
  border-color: #8cc7b8;
  color: var(--teal-dark);
}

.assessment-button.is-incorrect {
  border-color: #e2aeb7;
  color: var(--rose);
}

.assessment-button.is-active {
  box-shadow: inset 0 0 0 2px currentColor;
  font-weight: 900;
}

.question-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e6ebe8;
}

.primary-button,
.secondary-button {
  min-width: 118px;
  padding: 0 15px;
}

.primary-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
}

.tutor-panel {
  position: sticky;
  top: 90px;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  height: min(730px, calc(100vh - 112px));
  min-height: 590px;
  overflow: hidden;
}

.tutor-panel__heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 17px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
  color: #fff;
}

.tutor-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #75d3c6;
  color: var(--navy);
  font-size: 12px;
  font-weight: 950;
}

.tutor-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
}

.tutor-panel__heading p {
  margin: 3px 0 0;
  overflow: hidden;
  color: #bfcfca;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-pill {
  padding: 4px 7px;
  border: 1px solid rgba(117, 211, 198, 0.35);
  border-radius: 999px;
  color: #9ce4d9;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.tutor-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 17px;
  overflow-y: auto;
  background: #f7f8f6;
  overscroll-behavior: contain;
  scrollbar-color: #b8c6bf transparent;
  scrollbar-width: thin;
}

.chat-message {
  display: grid;
  max-width: 92%;
  gap: 5px;
}

.chat-message.is-user {
  align-self: end;
  justify-items: end;
}

.chat-message.is-assistant {
  align-self: start;
}

.chat-message__label {
  color: #84908c;
  font-size: 9px;
  font-weight: 800;
}

.chat-message__bubble {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  color: #2c3835;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.chat-message__bubble p {
  margin: 0 0 7px;
}

.chat-message__bubble p:last-child {
  margin-bottom: 0;
}

.chat-message__bubble strong {
  color: var(--ink);
  font-weight: 850;
}

.chat-message__list {
  display: grid;
  gap: 6px;
  margin: 0 0 9px;
  padding-left: 18px;
}

.chat-message__list:last-child {
  margin-bottom: 0;
}

.chat-message.is-user .chat-message__bubble {
  border-color: var(--teal);
  border-radius: 13px 13px 4px 13px;
  background: var(--teal);
  color: #fff;
}

.chat-message.is-pending .chat-message__bubble {
  color: var(--muted);
  font-style: italic;
}

.chat-message.is-error .chat-message__bubble {
  border-color: #e1adb6;
  background: var(--rose-soft);
  color: var(--rose);
}

.chat-mode-options {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.chat-mode-button,
.next-step-button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #a8cbc4;
  border-radius: 9px;
  background: #f2faf8;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
  text-align: left;
}

.chat-mode-button:hover:not(:disabled),
.next-step-button:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.chat-mode-button small {
  display: block;
  margin-top: 2px;
  color: #60726d;
  font-size: 9px;
  font-weight: 600;
}

.next-step-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  text-align: center;
}

.tutor-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.tutor-composer textarea {
  min-height: 48px;
  max-height: 130px;
  resize: none;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  outline: 0;
}

.tutor-composer textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.tutor-composer button {
  align-self: stretch;
  padding: 0 13px;
  border: 1px solid var(--teal);
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.tutor-composer button:disabled {
  border-color: #cbd3cf;
  background: #dfe4e1;
}

.tutor-note {
  margin: 0;
  padding: 0 14px 12px;
  background: #fff;
  font-size: 9px;
  text-align: center;
}

.practice-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(390px, calc(100vw - 32px));
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--navy);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.17s ease, transform 0.17s ease;
}

.practice-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .setup-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-card--start {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr) minmax(240px, 0.9fr);
    gap: 18px;
    align-items: end;
  }

  .setup-card--start .setup-card__heading {
    align-self: start;
  }

  .setup-card--start .availability-card {
    grid-row: span 2;
    margin: 0;
  }

  .setup-card--start .start-note {
    grid-column: 2 / -1;
  }

  .practice-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  }
}

@media (max-width: 920px) {
  .practice-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-block: 12px;
  }

  .practice-global-nav {
    width: 100%;
  }

  .practice-global-nav a {
    min-width: 0;
    flex: 1;
  }

  .practice-main {
    width: min(100% - 28px, 760px);
    padding-top: 22px;
  }

  .practice-hero {
    padding-inline: 2px;
  }

  .setup-layout {
    grid-template-columns: 1fr;
  }

  .setup-card--start {
    grid-column: auto;
    grid-template-columns: 1fr 1fr;
  }

  .setup-card--start .setup-card__heading {
    grid-column: 1 / -1;
  }

  .setup-card--start .availability-card {
    grid-row: span 2;
  }

  .setup-card--start .start-note {
    grid-column: 1 / -1;
  }

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

  .tutor-panel {
    position: static;
    height: min(680px, 78vh);
  }
}

@media (max-width: 620px) {
  .practice-header {
    position: static;
    padding-inline: 14px;
  }

  .practice-brand small {
    display: none;
  }

  .practice-global-nav {
    gap: 3px;
    padding: 4px;
  }

  .practice-global-nav a {
    padding-inline: 7px;
    font-size: 12px;
  }

  .practice-main {
    width: calc(100% - 20px);
    padding: 10px 0 35px;
  }

  .practice-hero {
    min-height: 0;
    padding: 0 2px;
  }

  .practice-hero h1 {
    font-size: 22px;
  }

  .setup-card {
    min-height: 0;
    padding: 18px;
    border-radius: 15px;
  }

  .source-groups,
  .topic-options {
    max-height: none;
  }

  .source-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .source-option__meta {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    max-width: 100%;
    white-space: normal;
  }

  .source-option__meta .coverage-pill {
    line-height: 1.35;
  }

  .setup-card--start {
    display: block;
  }

  .setup-card--start .availability-card {
    margin-bottom: 16px;
  }

  .session-heading,
  .progress-panel__top,
  .question-card__top {
    align-items: stretch;
    flex-direction: column;
  }

  .session-heading {
    padding: 14px 4px 18px;
  }

  .session-position {
    align-self: flex-start;
  }

  .progress-panel {
    padding: 16px;
  }

  .progress-summary {
    margin-top: 5px;
  }

  .question-panel {
    min-height: 0;
    padding: 18px;
    border-radius: 15px;
  }

  .question-topic {
    max-width: 100%;
    align-self: flex-start;
    text-align: left;
  }

  .question-prompt {
    font-size: 17px;
  }

  .response-part {
    padding: 13px;
  }

  .assignment-row,
  .truth-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assignment-select,
  .truth-choices {
    grid-column: 2;
  }

  .truth-choices {
    justify-content: flex-start;
  }

  .ordering-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ordering-controls {
    grid-column: 2;
  }

  .response-actions,
  .question-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .response-actions .save-status {
    grid-column: 1 / -1;
  }

  .submit-response,
  .answer-action,
  .primary-button,
  .secondary-button {
    width: 100%;
    min-width: 0;
  }

  .tutor-panel {
    min-height: 560px;
    border-radius: 15px;
  }
}

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