:root {
  --bg: #f8f6ef;
  --surface: #fffdf8;
  --surface-soft: #f1f5ef;
  --ink: #233a35;
  --muted: #697870;
  --line: #dce5dc;
  --sage: #7f9b8e;
  --sage-soft: #e7eee8;
  --teal: #4f7f78;
  --teal-dark: #2f5f58;
  --sand: #e8dcc8;
  --sand-soft: #f5eee2;
  --lavender: #d8d2e8;
  --blue-soft: #d6e1e6;
  --correct: #31775d;
  --correct-soft: #e5f2ea;
  --wrong: #ad5650;
  --wrong-soft: #f6e7e3;
  --shadow: 0 18px 46px rgba(44, 71, 63, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfaf6 0%, #f2f6f1 56%, #f7f0e6 100%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: center;
  padding: 16px 0 44px;
}

.hero-copy {
  max-width: 760px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--teal-dark);
  font-weight: 800;
}

.lotus-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.logo-disc {
  fill: var(--surface);
  stroke: rgba(79, 127, 120, 0.25);
  stroke-width: 2;
}

.logo-sun,
.logo-wave {
  fill: none;
  stroke: var(--sand);
  stroke-linecap: round;
  stroke-width: 3;
}

.logo-wave {
  stroke: var(--blue-soft);
}

.logo-petal {
  fill: rgba(127, 155, 142, 0.22);
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.logo-petal-center {
  fill: rgba(216, 210, 232, 0.42);
}

.eyebrow,
.topic-number {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  max-width: 680px;
  font-size: 4.25rem;
  line-height: 1.03;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 12px;
  font-size: 2.25rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.28rem;
  line-height: 1.22;
  letter-spacing: 0;
}

h4 {
  margin-bottom: 14px;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.intro {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.breath-panel {
  position: relative;
  min-height: 280px;
  border-left: 1px solid rgba(79, 127, 120, 0.16);
}

.breath-circle {
  position: absolute;
  top: 22px;
  left: 64px;
  width: 152px;
  height: 152px;
  border: 1px solid rgba(127, 155, 142, 0.36);
  border-radius: 50%;
}

.stone {
  position: absolute;
  left: 94px;
  display: block;
  border: 1px solid rgba(79, 127, 120, 0.18);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(44, 71, 63, 0.08);
}

.stone-one {
  top: 156px;
  width: 108px;
  height: 34px;
  background: var(--sand-soft);
}

.stone-two {
  top: 127px;
  left: 108px;
  width: 78px;
  height: 28px;
  background: var(--sage-soft);
}

.stone-three {
  top: 101px;
  left: 122px;
  width: 48px;
  height: 23px;
  background: #fbfaf6;
}

.breath-line {
  position: absolute;
  left: 62px;
  width: 150px;
  height: 1px;
  background: rgba(79, 127, 120, 0.26);
}

.breath-line-one {
  top: 214px;
}

.breath-line-two {
  top: 232px;
  left: 86px;
  width: 102px;
  background: rgba(216, 210, 232, 0.7);
}

.app-content {
  min-height: 420px;
}

.topics-section {
  display: grid;
  gap: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 10px;
  border-top: 1px solid rgba(79, 127, 120, 0.14);
}

.section-heading p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.overview-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 210px;
}

.completion-summary,
.status-pill,
.topic-meta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--teal-dark);
  border: 1px solid rgba(79, 127, 120, 0.2);
  border-radius: 8px;
  background: var(--sage-soft);
  font-size: 0.86rem;
  font-weight: 720;
}

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

.topic-card.is-completed .status-pill {
  color: var(--teal-dark);
  background: var(--sage-soft);
}

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

.topic-card {
  display: flex;
  min-width: 0;
  min-height: 350px;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 14px 34px rgba(44, 71, 63, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 127, 120, 0.38);
  box-shadow: var(--shadow);
}

.topic-card-top,
.topic-actions,
.quiz-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-card-top {
  align-items: center;
  justify-content: space-between;
}

.topic-copy {
  display: grid;
  gap: 10px;
}

.topic-title {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.topic-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.topic-footer {
  display: grid;
  gap: 18px;
}

.empty-result {
  padding-top: 16px;
  border-top: 1px solid rgba(79, 127, 120, 0.13);
}

.empty-result span {
  color: var(--teal-dark);
  font-weight: 760;
}

.empty-result p {
  margin: 4px 0 0;
  color: var(--muted);
}

.saved-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(79, 127, 120, 0.13);
}

.saved-score span {
  display: block;
  color: var(--teal-dark);
  font-size: 2rem;
  font-weight: 840;
  line-height: 1;
}

.saved-score p,
.saved-details p,
.saved-details time {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.saved-details p {
  color: var(--ink);
  font-weight: 720;
}

.panel,
.quiz-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  padding: 28px;
}

.quiz-panel,
.result-panel {
  padding: 30px;
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.progress-label {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 680;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  margin-bottom: 28px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--sage), var(--sand));
  transition: width 180ms ease;
}

.question-block {
  max-width: 860px;
  margin-bottom: 24px;
}

.question-text {
  margin-bottom: 0;
  font-size: 1.42rem;
  font-weight: 740;
  line-height: 1.35;
}

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

.answer-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 58px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.answer-option:hover:not(:disabled),
.answer-option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 127, 120, 0.48);
  outline: none;
}

.answer-option.is-selected {
  border-color: var(--teal);
  background: var(--sage-soft);
}

.answer-option.is-correct {
  border-color: rgba(49, 119, 93, 0.78);
  background: var(--correct-soft);
}

.answer-option.is-wrong {
  border-color: rgba(173, 86, 80, 0.78);
  background: var(--wrong-soft);
}

.answer-dot {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: #fff;
}

.answer-option.is-selected .answer-dot,
.answer-option.is-correct .answer-dot {
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--teal);
}

.answer-option.is-correct .answer-dot {
  border-color: var(--correct);
  background: var(--correct);
}

.answer-option.is-wrong .answer-dot {
  border-color: var(--wrong);
  background: var(--wrong);
  box-shadow: inset 0 0 0 4px #fff;
}

.feedback {
  min-height: 0;
}

.feedback-box {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.feedback-box p {
  margin-bottom: 0;
}

.feedback-correct {
  border-color: rgba(49, 119, 93, 0.32);
  background: var(--correct-soft);
}

.feedback-wrong {
  border-color: rgba(173, 86, 80, 0.32);
  background: var(--wrong-soft);
}

.quiz-actions,
.result-actions {
  margin-top: 24px;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 760;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  color: #fff;
  border: 1px solid var(--teal-dark);
  background: var(--teal-dark);
  box-shadow: 0 12px 28px rgba(47, 95, 88, 0.2);
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 15px 34px rgba(47, 95, 88, 0.27);
  outline: none;
}

.primary-button:disabled {
  opacity: 0.5;
}

.secondary-button,
.ghost-button {
  color: var(--teal-dark);
  border: 1px solid rgba(79, 127, 120, 0.28);
  background: var(--surface);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  background: var(--sage-soft);
  border-color: rgba(79, 127, 120, 0.46);
  outline: none;
}

.text-button {
  min-height: 36px;
  padding: 7px 10px;
  color: var(--muted);
  border: 0;
  background: transparent;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--teal-dark);
  background: rgba(127, 155, 142, 0.12);
  outline: none;
}

.result-header {
  max-width: 780px;
  margin-bottom: 24px;
}

.result-header p:last-child {
  color: var(--muted);
}

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

.score-box {
  padding: 18px;
  border-top: 3px solid var(--sage);
  border-radius: 8px;
  background: var(--surface-soft);
}

.score-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 2rem;
  font-weight: 820;
  line-height: 1;
}

.score-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 680;
}

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

.review-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  background: var(--surface);
}

.review-correct {
  border-left-color: var(--correct);
}

.review-wrong {
  border-left-color: var(--wrong);
}

.review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 740;
}

.review-correct .review-heading strong {
  color: var(--correct);
}

.review-wrong .review-heading strong {
  color: var(--wrong);
}

.review-item p {
  margin-bottom: 7px;
}

.review-item p:last-child {
  margin-bottom: 0;
}

.review-item p span {
  color: var(--muted);
  font-weight: 740;
}

.review-explanation {
  padding-top: 8px;
  color: var(--muted);
}

code {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--surface-soft);
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 34px;
  }

  .breath-panel {
    display: none;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 32px, 1160px);
    padding: 26px 0 40px;
  }

  .brand-lockup {
    margin-bottom: 22px;
  }

  .lotus-logo {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .intro,
  .section-heading p:last-child {
    font-size: 1rem;
  }

  .section-heading,
  .quiz-topline,
  .review-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-tools {
    justify-content: flex-start;
    min-width: 0;
  }

  .topic-grid,
  .score-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topic-card {
    min-height: 0;
    padding: 18px;
  }

  .topic-card-top {
    justify-content: flex-start;
  }

  .status-pill,
  .completion-summary {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .saved-result {
    grid-template-columns: 1fr;
  }

  .quiz-panel,
  .result-panel,
  .panel {
    padding: 20px;
  }

  .question-text {
    font-size: 1.18rem;
  }

  .topic-actions,
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
