:root {
  --ink: #202124;
  --muted: #6f7377;
  --line: #dde1e3;
  --panel: #ffffff;
  --soft: #f6f8f4;
  --brand: #8cc63f;
  --brand-strong: #5f9829;
  --accent: #808285;
  --gold: #b8d96b;
  --ok: #5f9829;
  --locked: #9aa6b2;
  --shadow: 0 18px 48px rgba(31, 45, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--soft);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

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

.secondary {
  color: var(--brand-strong);
  background: #e6f2f1;
}

.secondary:hover {
  color: #fff;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #a7d85c 58%, #6f7377);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: 1.1rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
}

h3 {
  font-size: 1.28rem;
}

.learner-card,
.progress-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdfe;
}

.learner-name {
  margin: 0 0 4px;
  font-weight: 800;
}

.learner-email {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf0;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  transition: width 180ms ease;
}

.chapter-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
}

.chapter-button {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.chapter-button:hover,
.chapter-button.active {
  color: var(--ink);
  border-color: var(--line);
  background: #f2f7f7;
}

.chapter-button.locked {
  color: var(--locked);
}

.chapter-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #edf2f6;
  font-size: 0.82rem;
}

.chapter-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.main-panel {
  min-width: 0;
  padding: 32px;
}

.profile-screen,
.lesson-screen {
  max-width: 980px;
  margin: 0 auto;
}

.profile-screen {
  display: grid;
  min-height: calc(100vh - 64px);
  place-items: center;
}

.profile-inner {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  background: #fff;
  box-shadow: var(--shadow);
}

.intro {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.profile-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(11, 111, 106, 0.18);
  border-color: var(--brand);
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.header-actions,
.lesson-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  align-items: center;
  justify-content: flex-end;
}

.header-learner {
  min-width: 220px;
  max-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.25;
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.06);
}

.header-learner-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.header-learner strong,
.header-learner span:last-child {
  display: block;
  overflow-wrap: anywhere;
}

.header-learner span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.lesson-content {
  padding: 28px;
}

.lesson-content h3 {
  margin: 28px 0 10px;
  font-size: 1.06rem;
}

.lesson-content p {
  margin: 0 0 14px;
  color: #263442;
  font-size: 1rem;
  line-height: 1.65;
}

.lesson-content ul {
  margin: 0 0 18px 22px;
  padding: 0;
  color: #263442;
  line-height: 1.55;
}

.lesson-content li {
  margin: 7px 0;
}

.lesson-actions {
  justify-content: flex-end;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--line);
}

.quiz-card {
  padding: 28px;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.score-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--brand-strong);
  background: #e6f2f1;
  font-weight: 900;
}

.quiz-form {
  display: grid;
  gap: 18px;
}

.question-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfe;
}

.question-block.correct-answer {
  border-color: rgba(95, 152, 41, 0.42);
  background: #f5fbef;
}

.question-block.wrong-answer {
  border-color: rgba(128, 130, 133, 0.55);
  background: #fafafa;
}

.question-title {
  margin: 0 0 12px;
  font-weight: 900;
  line-height: 1.4;
}

.option-label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin: 10px 0;
  color: #263442;
  font-weight: 600;
  line-height: 1.45;
}

.option-label input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.option-label.right-answer {
  color: var(--brand-strong);
  font-weight: 900;
}

.option-label.selected-answer:not(.right-answer) {
  color: #5e6265;
  text-decoration: line-through;
}

.correction-note,
.source-label {
  margin: 12px 0 0;
  color: var(--brand-strong);
  font-weight: 900;
  line-height: 1.45;
}

.source-label {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.quiz-result {
  min-height: 34px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.quiz-result.pass {
  color: var(--ok);
}

.quiz-result.retry {
  color: var(--brand-strong);
}

.completion-card {
  border: 1px solid rgba(95, 152, 41, 0.35);
  border-radius: 8px;
  padding: 22px;
  background: #f5fbef;
  color: var(--ink);
}

.completion-card h3 {
  margin-bottom: 4px;
  font-size: 1.55rem;
}

.completion-email {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.completion-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.completion-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.completion-card dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.hidden {
  display: none;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chapter-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: 260px;
  }

  .main-panel {
    padding: 22px;
  }
}

@media (max-width: 620px) {
  .lesson-header,
  .quiz-head {
    display: grid;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-learner {
    max-width: none;
    width: 100%;
  }

  .profile-inner,
  .lesson-content,
  .quiz-card {
    padding: 20px;
  }

  .lesson-actions {
    justify-content: stretch;
    padding: 16px 20px 20px;
  }

  .lesson-actions button,
  .header-actions button {
    flex: 1 1 160px;
  }

  .completion-card dl {
    grid-template-columns: 1fr;
  }
}
