:root {
  --ink: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.58);
  --paper: #f2f0eb;
  --surface: #ffffff;
  --line: #d8d1c5;
  --gold: #cba258;
  --green: #006241;
  --green-accent: #00754a;
  --green-house: #1e3932;
  --green-uplift: #2b5148;
  --green-light: #d4e9e2;
  --ceramic: #edebe9;
  --red: #c82014;
  --blue: #2f5f87;
  --shadow: 0 0 0.5px rgba(0, 0, 0, 0.14), 0 1px 1px rgba(0, 0, 0, 0.24);
  --shadow-nav: 0 1px 3px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.07);
  --shadow-float: 0 0 6px rgba(0, 0, 0, 0.24), 0 8px 12px rgba(0, 0, 0, 0.14);
  --radius-card: 12px;
  --radius-control: 50px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(16, 35, 31, 0.12);
  background: rgba(247, 245, 239, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  font-weight: 800;
}

.brand-mark.logo-mark {
  overflow: hidden;
  background: #0a1020;
}

.brand-mark.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-mark.school-logo-mark {
  overflow: hidden;
  border: 1px solid rgba(16, 35, 31, 0.14);
  background: #fff;
}

.brand-mark.school-logo-mark img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}

.brand-mark.school-mark {
  color: #fff;
  background: linear-gradient(135deg, #0d1726, #3563f4);
  font-size: 13px;
  letter-spacing: 0;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.account-pill {
  max-width: min(240px, 28vw);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.76);
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.panel-title {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.panel-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.panel-body {
  padding: 18px 20px 20px;
}

.hero-line {
  margin: 0 0 18px;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full,
.form-grid > .full {
  grid-column: 1 / -1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 35, 31, 0.04);
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.active {
  color: #fff;
  background: var(--green-house);
  box-shadow: var(--shadow);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.auth-code-row label {
  display: grid;
  gap: 7px;
}

.mode-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.mode-field legend {
  margin-bottom: 7px;
  padding: 0;
}

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

.segment-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option span {
  display: grid;
  min-height: 94px;
  gap: 5px;
  align-content: start;
  border: 1px solid #cbc5b4;
  border-radius: 8px;
  padding: 13px;
  background: #fffdfa;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.segment-option strong {
  font-size: 14px;
}

.segment-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.segment-option input:checked + span {
  border-color: var(--green);
  background: #edf7f1;
  box-shadow: 0 0 0 3px rgba(29, 107, 83, 0.1);
}

.segment-option input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.label {
  color: #2e423c;
  font-size: 13px;
  font-weight: 750;
}

.input,
.select,
.textarea,
.file-input {
  width: 100%;
  border: 1px solid #cbc5b4;
  border-radius: 7px;
  background: #fffdfa;
  color: var(--ink);
  outline: 0;
}

.input,
.select {
  min-height: 42px;
  padding: 10px 12px;
}

.textarea {
  min-height: 118px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.5;
}

.file-input {
  padding: 10px;
}

.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(30, 57, 50, 0.22);
  border-radius: 12px;
  background: #fffdfa;
  color: var(--ink);
  cursor: pointer;
}

.file-picker .file-input {
  position: absolute;
  inset: -1px;
  z-index: 2;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: inherit;
  opacity: 0.001;
  cursor: pointer;
  font-size: 100px;
}

.file-picker-button,
.file-picker-summary {
  pointer-events: none;
}

.file-picker-button {
  flex: 0 0 auto;
  border: 1px solid rgba(30, 57, 50, 0.22);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--green-light);
  color: var(--green-house);
  font-weight: 850;
}

.file-picker-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input:focus,
.select:focus,
.textarea:focus,
.file-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 107, 83, 0.12);
}

.file-picker:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 107, 83, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.append-materials-form {
  margin-top: 10px;
}

.english-version-block {
  background: color-mix(in srgb, var(--paper) 85%, var(--green) 15%);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.english-version-block h4 {
  margin: 0 0 8px;
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 10px 14px;
  font-weight: 760;
  line-height: 1.1;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    opacity 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  color: #fff;
  background: var(--ink);
}

.btn.secondary {
  color: var(--ink);
  background: #e9e3d4;
}

.btn.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.btn.danger {
  color: #fff;
  background: var(--red);
}

.btn.compact {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 13px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-list {
  display: grid;
  gap: 10px;
}

.generation-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.generation-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.generation-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-item {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.dot.ok {
  background: var(--green);
}

.dot.warn {
  background: var(--red);
}

.study-list {
  display: grid;
  gap: 12px;
}

.today-task-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.today-task-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdfa, #f7fbf8);
}

.today-task-kind {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #0d4034;
  background: #d9ece4;
  font-size: 12px;
  font-weight: 820;
}

.today-task-card h3 {
  margin: 0;
  font-size: 15px;
}

.today-task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.study-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.study-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.next-action-line {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-left: 3px solid var(--green);
  border-radius: 7px;
  color: #24453d;
  background: #eef7f2;
  font-size: 13px;
  font-weight: 720;
}

.mistake-course {
  background: #fff;
}

.mistake-course-header,
.mistake-category-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.mistake-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 13px;
}

.mistake-category h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.mistake-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mistake-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mistake-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.mistake-item p {
  margin: 5px 0 0;
  line-height: 1.45;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #263d38;
  background: #ece6d7;
  font-size: 12px;
  font-weight: 720;
}

.pill.high {
  color: #7f2f2f;
  background: #f3dada;
}

.pill.medium {
  color: #725016;
  background: #f4e5ba;
}

.source-evidence {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 25px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #254039;
  background: #eef2ed;
  font-size: 12px;
  font-weight: 760;
}

.source-evidence.high {
  color: #0a3a2e;
  background: #d9ecdf;
}

.source-evidence.medium {
  color: #654916;
  background: #f0e4bf;
}

.source-evidence.low {
  color: #695f52;
  background: #eeeae2;
}

.pill.low {
  color: #225544;
  background: #dceee6;
}

.estimate-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--muted);
  background: #fffdfa;
  font-size: 13px;
  font-weight: 760;
}

.quota-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.sidebar {
  position: sticky;
  top: 84px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.chapter-card-list {
  display: grid;
  gap: 12px;
}

.chapter-group {
  display: grid;
  gap: 10px;
}

.chapter-header {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f4eb;
  color: var(--ink);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.chapter-header strong,
.chapter-header small {
  display: block;
}

.chapter-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.chapter-toggle {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 850;
}

.content-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.knowledge-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px;
  animation: card-enter 220ms ease-out both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.knowledge-card.inactive {
  opacity: 0.62;
}

.knowledge-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.knowledge-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.knowledge-card-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.knowledge-card-summary h3 {
  margin: 0;
}

.knowledge-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mastery-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f4eb;
}

.mastery-btn {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 5px 9px;
  color: #425650;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
}

.mastery-btn.active.understood {
  color: #0b2f25;
  background: #cfe6dc;
}

.mastery-btn.active.unclear {
  color: #642b2b;
  background: #f2d6d4;
}

.card-preview {
  margin-bottom: 0 !important;
  color: var(--muted) !important;
}

.knowledge-card p {
  margin: 0 0 11px;
  color: #263d38;
  line-height: 1.55;
}

.card-editor {
  display: grid;
  gap: 10px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #263d38;
  font-weight: 720;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.compact-toggle {
  font-size: 13px;
}

.consent-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
}

.consent-line {
  display: flex;
  align-items: start;
  gap: 9px;
  color: #263d38;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.consent-line input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.entry-consent-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 12px;
  margin-bottom: 14px;
}

.entry-consent-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #263d38;
  font-weight: 760;
  line-height: 1.45;
}

.entry-consent-line input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.legal-link {
  border: 0;
  background: transparent;
  color: #0b2f25;
  padding: 0;
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 47, 37, 0.32);
}

.legal-modal {
  width: min(860px, 100%);
  max-height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.legal-modal-head h2 {
  margin: 0;
  font-size: 24px;
}

.legal-modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.legal-scroll {
  overflow: auto;
  padding: 16px;
}

.legal-section {
  border-bottom: 1px solid #e7dfce;
  padding: 0 0 13px;
  margin-bottom: 13px;
}

.legal-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.legal-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.legal-section p {
  margin: 0 0 8px;
  color: #263d38;
  line-height: 1.58;
}

.question-shell {
  display: grid;
  gap: 16px;
}

.question-stem {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

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

.option-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  line-height: 1.45;
}

.option-btn.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(50, 95, 156, 0.12);
}

.option-btn.correct {
  border-color: var(--green);
  background: #e8f3ee;
}

.option-btn.wrong {
  border-color: var(--red);
  background: #f8e8e8;
}

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

.short-answer-box {
  min-height: 120px;
}

.fill-answer-input {
  font-weight: 720;
}

.reference-points {
  margin: 8px 0 0 18px;
  padding: 0;
}

.feedback {
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  background: #fff8e6;
  padding: 13px 14px;
  line-height: 1.55;
}

.feedback.ok {
  border-left-color: var(--green);
  background: #e8f3ee;
}

.feedback.bad {
  border-left-color: var(--red);
  background: #f8e8e8;
}

.solution-steps {
  display: grid;
  gap: 8px;
  margin: 10px 0 0 18px;
  padding: 0;
}

.solution-steps li {
  padding-left: 4px;
}

.solution-steps strong {
  display: block;
  color: #10231f;
  font-size: 13px;
}

.solution-steps span {
  display: block;
  color: #263d38;
}

.source-evidence-block {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #fbfcfb;
  color: #263d38;
}

.source-evidence-block.medium {
  border-left-color: var(--gold);
}

.source-evidence-block.low {
  border-left-color: #a59b8a;
}

.source-evidence-block strong,
.source-evidence-block small {
  color: var(--muted);
  font-size: 12px;
}

.attempt-insight {
  display: grid;
  gap: 12px;
}

.attempt-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attempt-insight-head span {
  color: var(--green);
  font-weight: 850;
}

.compact-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.score {
  font-size: 44px;
  font-weight: 850;
  letter-spacing: 0;
}

.empty {
  border: 1px dashed #c6beaa;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fffdfa;
}

.admin-notice {
  border: 1px solid rgba(0, 117, 74, 0.22);
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  color: var(--green-house);
  background: var(--green-light);
  font-size: 13px;
  font-weight: 760;
}

.controlled-preview-meta {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(30, 57, 50, 0.14);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fffdfa;
}

.controlled-preview-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.controlled-preview-text {
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(30, 57, 50, 0.16);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
  color: var(--ink);
  background: #fffdfa;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px dashed #c6beaa;
  border-radius: 8px;
  padding: 18px;
  background: #fffdfa;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.empty-state p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-required-panel {
  max-width: 760px;
  margin: 40px auto 0;
}

.study-tools-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.study-tools-grid.has-cheat {
  align-items: stretch;
}

.study-tools-grid.single {
  grid-template-columns: 1fr;
}

.study-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 14px;
  align-self: start;
  min-width: 0;
  height: fit-content;
  overflow-wrap: anywhere;
}

.study-tools-grid.has-cheat .study-tool {
  display: flex;
  min-height: 0;
  max-height: clamp(460px, 52vh, 560px);
  flex-direction: column;
  align-self: stretch;
  height: auto;
}

.study-tool-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.study-tool h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece6d8;
  margin: 10px 0 12px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 700ms ease;
}

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

.metric-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric-item span {
  color: var(--muted);
  font-size: 12px;
}

.metric-item strong {
  font-size: 22px;
}

.mind-map-panel .panel-body {
  display: grid;
  gap: 12px;
}

.mind-map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mind-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.mind-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mind-map-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #7f8f87;
}

.mind-map-dot.high {
  background: #c29336;
}

.mind-map-dot.weak {
  background: #b91c1c;
}

.mind-map-dot.done {
  background: #4d9b75;
}

.mind-map-dot.normal {
  background: var(--green);
}

.mind-map-scroll {
  overflow: auto;
  border: 1px solid rgba(30, 57, 50, 0.10);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(13, 51, 42, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 51, 42, 0.035) 1px, transparent 1px),
    #fbfcfb;
  background-size: 32px 32px;
}

.mind-map-canvas {
  min-width: 920px;
  padding: 12px;
}

.mind-map-svg {
  display: block;
  width: 100%;
  min-height: 440px;
}

.mind-map-svg .clickable:hover rect,
.mind-map-svg .clickable:focus rect {
  stroke-width: 3;
  filter: drop-shadow(0 12px 18px rgba(0, 117, 74, 0.16));
}

.mind-map-svg .clickable:focus {
  outline: none;
}

.chapter-mastery-list {
  display: grid;
  gap: 10px;
}

.study-map-overview {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(220px, 1.3fr) minmax(180px, 0.9fr);
  gap: 10px;
  margin-bottom: 12px;
}

.study-map-root,
.study-map-route,
.study-map-stats {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(0, 117, 74, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbf7 0%, #fffdfa 100%);
}

.study-map-root span,
.study-map-route span {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.study-map-root strong,
.study-map-route strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.study-map-route p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.study-map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.study-map-stats span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.study-map-stats strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.chapter-mastery-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(130px, 0.28fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.chapter-mastery-row.study-map-node.fix {
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #fffafa 0%, #fffdfa 100%);
}

.chapter-mastery-row.study-map-node.review {
  border-color: rgba(194, 147, 54, 0.32);
  background: linear-gradient(180deg, #fffaf0 0%, #fffdfa 100%);
}

.study-map-node-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.study-map-node-main {
  min-width: 0;
}

.study-map-node-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.chapter-mastery-row strong {
  display: block;
  margin: 0;
}

.chapter-mastery-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.study-map-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f3ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.study-map-state.fix {
  background: #fff0f0;
  color: #b91c1c;
}

.study-map-state.review {
  background: #fff3d6;
  color: #8a5b00;
}

.study-map-next-line {
  margin-top: 5px !important;
  color: var(--ink) !important;
}

.study-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn.danger-lite {
  border-color: rgba(185, 28, 28, 0.24);
  color: #9f1d1d;
}

.chapter-mastery-score {
  display: grid;
  gap: 7px;
  text-align: right;
}

.chapter-mastery-score span {
  color: var(--green);
  font-weight: 850;
}

.chapter-mastery-score small {
  color: var(--muted);
  font-size: 12px;
}

.attention-pulse {
  animation: attentionPulse 1.1s ease;
}

@keyframes attentionPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 117, 74, 0.32);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(0, 117, 74, 0);
  }
}

.progress-track.compact {
  height: 8px;
  margin: 0;
}

.exam-eve-tool {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 117, 74, 0.22);
  border-radius: 8px;
  background: var(--green-light);
}

.exam-eve-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.exam-eve-head h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.exam-eve-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.exam-eve-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.exam-eve-step {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.72);
}

.exam-eve-step strong {
  color: var(--green);
  font-size: 20px;
}

.exam-eve-step span {
  color: var(--muted);
  font-size: 12px;
}

.mistake-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.error-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-coverage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.source-file-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.74);
}

.source-file-card.needs-attention {
  border-color: rgba(198, 53, 43, 0.34);
  background: rgba(255, 242, 239, 0.72);
}

.source-file-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.source-file-card span,
.source-file-card small,
.source-file-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-file-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(13, 51, 42, 0.06);
  color: var(--green);
  font-weight: 800;
}

.referral-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.referral-row h3 {
  margin: 0 0 6px;
}

.referral-code {
  display: grid;
  gap: 3px;
  min-width: 190px;
  text-align: right;
}

.referral-code span,
.referral-code small {
  color: var(--muted);
}

.referral-code strong {
  font-size: 22px;
  letter-spacing: 0;
}

.compact-checkbox {
  margin-top: 8px;
}

.course-code-toggle {
  margin-top: -6px;
}

.plan-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.study-tools-grid.has-cheat .plan-list {
  flex: 1;
  min-height: 220px;
  max-height: none;
  padding-right: 2px;
}

.plan-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.plan-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.plan-row p,
.cheat-preview p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.cheat-preview {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.cheat-sheet-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.study-tools-grid.has-cheat .cheat-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.cheat-preview div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.cheat-preview strong {
  display: block;
  font-size: 13px;
}

.profile-grid {
  display: grid;
  gap: 10px;
}

.profile-onboarding-panel {
  max-width: 820px;
  margin: 34px auto 0;
}

.profile-grid-onboarding {
  gap: 14px;
}

.profile-summary {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.profile-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.profile-summary strong {
  font-size: 14px;
  line-height: 1.35;
}

.profile-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.card-assistant {
  margin-top: 10px;
}

.card-assistant h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.assistant-thread {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.assistant-turn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px 12px;
}

.assistant-turn.user {
  border-color: rgba(29, 107, 83, 0.32);
  background: #edf7f1;
}

.assistant-turn.failed {
  border-color: rgba(184, 76, 76, 0.35);
}

.assistant-turn strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.assistant-turn p {
  margin: 0;
  line-height: 1.55;
}

.assistant-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-summary.locked {
  background: #f7f2e8;
}

.choice-picker {
  position: relative;
}

.choice-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cbc5b4;
  border-radius: 7px;
  background: #fffdfa;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.choice-trigger:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 107, 83, 0.12);
  outline: 0;
}

.choice-placeholder,
.choice-arrow {
  color: var(--muted);
}

.choice-panel {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: 0 16px 34px rgba(18, 33, 28, 0.12);
  padding: 8px;
  z-index: 5;
}

.choice-search {
  margin-bottom: 8px;
}

.choice-options {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.choice-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.choice-option:hover,
.choice-option.selected {
  border-color: var(--green);
  background: #edf7f1;
}

.encouragement {
  margin: 16px 0 0;
  border-left: 4px solid #d8b45d;
  padding: 10px 0 10px 14px;
  color: #31453f;
}

.encouragement p {
  margin: 0;
  line-height: 1.55;
  font-weight: 720;
}

.encouragement cite {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.contact-panel {
  margin-top: 14px;
  box-shadow: none;
}

.contact-panel .panel-header {
  padding: 9px 12px 0;
}

.contact-panel .panel-body {
  padding: 8px 12px 12px;
}

.contact-panel .panel-title {
  font-size: 15px;
}

.contact-panel .panel-copy {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(190px, 0.45fr);
  gap: 8px;
}

.contact-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  padding: 8px;
}

.contact-card h3 {
  margin: 0;
  font-size: 13px;
}

.contact-card .muted,
.contact-card .hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.contact-card .field {
  gap: 4px;
}

.contact-card .label {
  font-size: 11px;
}

.contact-card .input {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 12px;
}

.feedback-inline {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
}

.feedback-textarea {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 12px;
}

.feedback-status {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 720;
}

.contact-email-line {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.contact-email-line strong {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.contact-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pricing-page {
  display: grid;
  gap: 24px;
}

.pricing-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 0 4px;
}

.pricing-heading h2 {
  max-width: 760px;
  margin: 6px 0 10px;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: 0;
}

.pricing-heading > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.pricing-eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.pricing-current {
  min-width: 190px;
  border-left: 3px solid var(--green);
  padding: 8px 0 8px 14px;
}

.pricing-current span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pricing-current strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.pricing-notice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pricing-notice strong {
  color: var(--ink);
  white-space: nowrap;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(16, 35, 31, 0.06);
  grid-column: span 2;
}

.pricing-card:nth-child(4),
.pricing-card:nth-child(5) {
  grid-column: span 3;
}

.pricing-card.recommended {
  border: 2px solid var(--ink);
  padding: 19px;
}

.pricing-card.current {
  background: #f8fbf9;
}

.pricing-card-top {
  display: grid;
  gap: 16px;
}

.pricing-card-title-row {
  display: flex;
  min-height: 30px;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.pricing-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.pricing-card-top > div:first-child > p {
  min-height: 44px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.pricing-badge {
  border-radius: 999px;
  padding: 5px 8px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pricing-price {
  display: flex;
  min-height: 58px;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.pricing-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.pricing-price strong {
  font-size: 46px;
  font-weight: 820;
  line-height: 1;
}

.pricing-price small {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pricing-billing-grid {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(16, 35, 31, 0.1);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(248, 251, 249, 0.8);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.pricing-meta {
  display: flex;
  min-height: 38px;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pricing-button {
  width: 100%;
  text-align: center;
  text-decoration: none;
}

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

.pricing-button:disabled {
  opacity: 1;
}

.pricing-button.primary:disabled {
  color: #fff;
  background: #66736f;
}

.pricing-button.secondary:disabled {
  color: var(--ink);
  background: #e3ede8;
}

.pricing-payment-note {
  min-height: 34px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pricing-feature-list {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.pricing-feature {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.pricing-feature span {
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.pricing-feature p {
  margin: 0;
  color: #31453f;
  font-size: 13px;
  line-height: 1.5;
}

.pricing-add-ons {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.pricing-add-ons-heading {
  max-width: 760px;
}

.pricing-add-ons-heading h3 {
  margin: 6px 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.pricing-add-ons-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pricing-add-on-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pricing-add-on-card {
  grid-column: auto;
}

.pricing-footer-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding: 24px 0 8px;
}

.pricing-footer-band h3 {
  margin: 0;
  font-size: 22px;
}

.pricing-footer-band > div:first-child p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pricing-common-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

@media (max-width: 920px) {
  .dashboard-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .study-tools-grid.has-cheat {
    align-items: start;
  }

  .study-tools-grid.has-cheat .study-tool {
    max-height: none;
    align-self: start;
    height: fit-content;
  }

  .study-tools-grid.has-cheat .plan-list,
  .study-tools-grid.has-cheat .cheat-preview {
    flex: initial;
    max-height: 320px;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(160px, 0.65fr);
  }

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

  .pricing-add-on-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .pricing-card,
  .pricing-card:nth-child(4),
  .pricing-card:nth-child(5) {
    grid-column: auto;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .account-pill {
    max-width: 100%;
    flex-basis: 100%;
  }

  .top-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }

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

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .segmented-choice {
    grid-template-columns: 1fr;
  }

  .empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .study-tools-grid {
    grid-template-columns: 1fr;
  }

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

  .source-coverage-summary,
  .source-file-grid {
    grid-template-columns: 1fr;
  }

  .mind-map-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .mind-map-scroll {
    margin-inline: -4px;
  }

  .mind-map-canvas {
    min-width: 860px;
    padding: 8px;
  }

  .study-map-overview,
  .chapter-mastery-row,
  .mistake-filter-grid {
    grid-template-columns: 1fr;
  }

  .study-map-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .study-map-node-index {
    place-self: start;
  }

  .chapter-mastery-score {
    text-align: left;
  }

  .exam-eve-head {
    flex-direction: column;
  }

  .exam-eve-grid {
    grid-template-columns: 1fr;
  }

  .today-task-list,
  .compact-metrics {
    grid-template-columns: 1fr;
  }

  .referral-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .referral-code {
    text-align: left;
  }

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

  .feedback-inline {
    grid-template-columns: 1fr;
  }

  .knowledge-card-head {
    grid-template-columns: 1fr;
  }

  .knowledge-card-actions {
    justify-content: space-between;
    white-space: normal;
  }

  .panel-header {
    flex-direction: column;
  }

  .pricing-heading {
    align-items: start;
    flex-direction: column;
    gap: 18px;
    padding-top: 10px;
  }

  .pricing-heading h2 {
    font-size: 36px;
  }

  .pricing-current {
    width: 100%;
  }

  .pricing-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .pricing-grid,
  .pricing-add-on-grid,
  .pricing-footer-band,
  .pricing-common-list {
    grid-template-columns: 1fr;
  }

  .pricing-card-top > div:first-child > p,
  .pricing-meta {
    min-height: 0;
  }

  .hero-line {
    font-size: 31px;
  }

  .question-stem {
    font-size: 19px;
  }

  .self-check-row {
    grid-template-columns: 1fr;
  }
}

/* Warm flagship UI refresh, adapted from DESIGN.md. */
body {
  background: var(--paper);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  letter-spacing: 0;
}

.app-shell {
  background: var(--paper);
}

.topbar {
  min-height: 78px;
  border-bottom: 0;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-nav);
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--green-house);
  box-shadow: var(--shadow-float);
}

.brand-mark.logo-mark {
  background: #0a1020;
}

.brand-mark.school-logo-mark {
  background: #fff;
}

.brand-mark.school-mark {
  border-radius: 14px;
}

.brand-title {
  color: var(--green-house);
  font-size: 17px;
  font-weight: 850;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.account-pill {
  border-color: rgba(30, 57, 50, 0.18);
  padding: 10px 14px;
  color: var(--green-house);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.container {
  padding-top: 32px;
}

.panel,
.knowledge-card,
.study-card,
.study-tool,
.contact-card,
.pricing-card,
.metric-item,
.profile-summary,
.card-assistant,
.choice-panel,
.legal-modal,
.empty-state,
.consent-box,
.entry-consent-card,
.generation-progress,
.status-item {
  border-color: rgba(30, 57, 50, 0.16);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 22px 24px 0;
}

.panel-body {
  padding: 20px 24px 24px;
}

.panel-title,
.question-stem,
.knowledge-card h3,
.study-card h3,
.study-tool h3,
.contact-card h3,
.pricing-card h3,
.pricing-footer-band h3,
.pricing-add-ons-heading h3 {
  color: var(--green-house);
  font-weight: 850;
}

.panel-copy,
.hint,
.muted,
.knowledge-card p,
.contact-card .muted,
.pricing-card-top > div:first-child > p,
.pricing-meta,
.pricing-payment-note,
.pricing-add-ons-heading p:last-child {
  color: var(--muted);
}

.hero-line {
  color: var(--green-house);
  font-size: 44px;
  font-weight: 850;
  letter-spacing: 0;
}

.pricing-heading h2 {
  color: var(--green-house);
  font-size: 52px;
  font-weight: 850;
  letter-spacing: 0;
}

.label,
.mode-field legend,
.pricing-eyebrow {
  color: var(--green);
  font-weight: 850;
}

.input,
.select,
.textarea,
.file-input,
.choice-trigger,
.choice-search {
  border-color: rgba(30, 57, 50, 0.22);
  border-radius: 12px;
  color: var(--ink);
  background: #fffdfa;
}

.input:focus,
.select:focus,
.textarea:focus,
.file-input:focus,
.choice-trigger:focus,
.choice-search:focus {
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3px rgba(0, 117, 74, 0.14);
  outline: none;
}

.btn {
  min-height: 44px;
  border-radius: var(--radius-control);
  padding: 11px 18px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn.primary,
.pricing-button.primary {
  color: #fff;
  background: var(--green-accent);
  box-shadow: 0 8px 18px rgba(0, 98, 65, 0.14);
}

.btn.primary:hover,
.pricing-button.primary:hover {
  background: var(--green);
}

.btn.secondary {
  color: var(--green-house);
  background: var(--green-light);
}

.btn.ghost {
  border-color: rgba(30, 57, 50, 0.22);
  color: var(--green-house);
  background: rgba(255, 255, 255, 0.72);
}

.btn.danger {
  color: #fff;
  background: var(--red);
}

.btn.compact {
  min-height: 36px;
  padding: 8px 13px;
}

.btn:disabled,
.pricing-button:disabled {
  box-shadow: none;
}

.segment-option span,
.option-btn,
.mastery-btn,
.plan-row,
.referral-code,
.assistant-turn,
.feedback,
.score,
.pill,
.estimate-pill,
.choice-option {
  border-color: rgba(30, 57, 50, 0.16);
  border-radius: 12px;
  background: #fffdfa;
}

.segment-option input:checked + span,
.option-btn.selected,
.choice-option:hover,
.choice-option.selected {
  border-color: var(--green-accent);
  background: var(--green-light);
  box-shadow: inset 0 0 0 1px rgba(0, 117, 74, 0.1);
}

.option-btn.correct,
.feedback.ok,
.mastery-btn.active.understood,
.pill.high {
  border-color: rgba(0, 117, 74, 0.3);
  background: var(--green-light);
}

.option-btn.wrong,
.feedback.bad,
.assistant-turn.failed,
.mastery-btn.active.unclear {
  border-color: rgba(200, 32, 20, 0.28);
  background: rgba(200, 32, 20, 0.08);
}

.generation-progress {
  background: var(--green-light);
}

.progress-track {
  background: rgba(30, 57, 50, 0.12);
}

.progress-track span {
  background: var(--green-accent);
}

.status-item {
  background: #fffdfa;
}

.dot {
  background: var(--gold);
}

.dot.ok,
.pricing-feature span {
  color: var(--green-accent);
  background: var(--green-accent);
}

.pricing-feature span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.dot.warn {
  background: var(--red);
}

.workspace {
  gap: 20px;
}

.sidebar {
  top: 104px;
}

.knowledge-card,
.study-card,
.study-tool,
.contact-card,
.pricing-card {
  overflow: hidden;
}

.knowledge-card:hover,
.pricing-card:hover,
.contact-card:hover {
  border-color: rgba(0, 117, 74, 0.26);
}

.knowledge-card.inactive {
  background: var(--ceramic);
}

.card-preview,
.cheat-preview,
.contact-empty,
.profile-summary.locked {
  border-radius: 12px;
  background: var(--ceramic);
}

.pricing-page {
  gap: 28px;
}

.pricing-heading {
  padding-top: 12px;
}

.pricing-current {
  border-left-color: var(--green-accent);
  border-radius: 12px;
  padding: 14px 18px;
  background: #fffdfa;
  box-shadow: var(--shadow);
}

.pricing-notice {
  border: 1px solid rgba(30, 57, 50, 0.16);
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--green-light);
}

.pricing-card {
  border-radius: var(--radius-card);
  padding: 24px;
}

.pricing-card.recommended {
  border-color: var(--green-accent);
  padding: 23px;
  box-shadow: 0 0 0 1px rgba(0, 117, 74, 0.18), var(--shadow);
}

.pricing-card.current {
  background: var(--green-light);
}

.pricing-badge {
  color: var(--green-house);
  background: var(--gold);
}

.pricing-price strong {
  color: var(--green-house);
  font-weight: 850;
}

.pricing-feature-list {
  border-top-color: rgba(30, 57, 50, 0.16);
}

.pricing-feature p {
  color: var(--green-house);
}

.pricing-add-ons {
  border-top-color: rgba(30, 57, 50, 0.16);
}

.pricing-footer-band {
  border: 0;
  border-radius: var(--radius-card);
  padding: 28px;
  color: #fff;
  background: var(--green-house);
  box-shadow: var(--shadow);
}

.pricing-footer-band h3,
.pricing-footer-band .pricing-feature p,
.pricing-footer-band .pricing-feature span {
  color: #fff;
}

.pricing-footer-band > div:first-child p {
  color: rgba(255, 255, 255, 0.72);
}

.pricing-footer-band .pricing-feature span {
  background: var(--green-accent);
}

.legal-overlay {
  background: rgba(30, 57, 50, 0.46);
}

.legal-modal-head {
  border-bottom-color: rgba(30, 57, 50, 0.16);
}

@media (max-width: 920px) {
  .topbar {
    padding: 14px 20px;
  }

  .hero-line {
    font-size: 38px;
  }

  .pricing-heading h2 {
    font-size: 42px;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 0;
    padding: 14px 16px;
  }

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

  .panel-header,
  .panel-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-line,
  .pricing-heading h2 {
    font-size: 34px;
  }

  .pricing-card,
  .pricing-footer-band {
    padding: 20px;
  }
}
