* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FDF9F1;
  --teal: #2A7F7A;
  --teal-dark: #1F5F5B;
  --orange: #E08A3C;
  --orange-dark: #C9742B;
  --ink: #1F3A3D;
  --muted: #5C6663;
  --line: #E8E0D0;
  --card: #FFFFFF;
  --good: #2A7F7A;
  --soft-good: #EAF5F3;
  --soft-warn: #FBEFE3;
  --red-soft: #C26B4A;
}

/* Страница зафиксирована по горизонтали: прокручивается только body и только по вертикали.
   touch-action: pan-y - браузер вообще не начинает горизонтальный жест на странице. */
html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.55;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  overflow-wrap: break-word;
  touch-action: pan-y;
}

#app { max-width: 680px; margin: 0 auto; padding: 20px 16px 60px; }

h1 { font-size: 30px; line-height: 1.25; margin-bottom: 12px; }
h2 { font-size: 24px; line-height: 1.3; margin-bottom: 10px; }
p { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 17px; }
.small { font-size: 16px; }

.btn {
  display: inline-block; width: 100%;
  padding: 16px 24px;
  font-size: 20px; font-weight: 700;
  border: none; border-radius: 14px;
  cursor: pointer; text-align: center;
  transition: transform .08s ease, opacity .15s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--teal); color: #fff; }
.btn-secondary:hover { background: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.btn-ghost:hover { background: var(--soft-good); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn + .btn { margin-top: 12px; }

.card {
  background: var(--card); border-radius: 18px;
  padding: 22px 20px; margin-bottom: 16px;
  box-shadow: 0 3px 12px rgba(31,58,61,.07);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 10px;
}
.back-link {
  color: var(--teal); font-weight: 600; cursor: pointer;
  background: none; border: none; font-size: 18px; font-family: inherit;
  padding: 8px 10px 8px 0;
}

/* Общий прогресс */
.progressbar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; flex: 1; }
.progressbar > div { height: 100%; background: var(--teal); border-radius: 6px; transition: width .4s ease; }
.progress-label { font-size: 16px; color: var(--muted); white-space: nowrap; }

/* Карта пути */
.map-step {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--card); border-radius: 16px;
  padding: 16px; margin-bottom: 10px;
  cursor: pointer; border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(31,58,61,.06);
  -webkit-tap-highlight-color: transparent;
}
.map-step:hover { border-color: var(--teal); }
.map-step.done { background: var(--soft-good); }
.map-step.locked { opacity: .55; cursor: default; }
.map-step.locked:hover { border-color: transparent; }
.step-icon {
  width: 46px; height: 46px; min-width: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--bg); border: 2px solid var(--line);
}
.map-step.done .step-icon { background: var(--teal); border-color: var(--teal); }
.step-info { flex: 1; }
.step-title { font-weight: 700; font-size: 18px; line-height: 1.3; }
.step-meta { font-size: 15px; color: var(--muted); margin-top: 2px; }
.milestone {
  text-align: center; font-size: 16px; color: var(--teal);
  font-weight: 600; margin: 14px 0; padding: 0 10px;
}

/* Урок */
.lesson h3 {
  font-size: 22px; line-height: 1.3; color: var(--teal-dark);
  margin: 26px 0 10px;
}
.lesson h3:first-child { margin-top: 0; }
.lesson p { margin-bottom: 14px; }
.lesson ul, .lesson ol { margin: 0 0 14px 22px; }
.lesson li { margin-bottom: 8px; }
.lesson table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  font-size: 16px;
  display: block; overflow-x: auto;
  touch-action: pan-x pan-y; /* внутри таблицы листать вбок можно */
}
.lesson th, .lesson td {
  border: 1px solid var(--line); padding: 8px 9px; text-align: left;
  vertical-align: top;
}
.lesson th { background: var(--soft-good); font-weight: 700; }
.lesson img { max-width: 100%; height: auto; }
.lesson .takeaway {
  background: var(--soft-good); border-radius: 14px;
  padding: 16px 18px; margin-top: 20px;
}
.lesson .takeaway p { margin-bottom: 8px; font-weight: 700; color: var(--teal-dark); }
.lesson .takeaway ul { margin-bottom: 0; }

/* Конспект */
.summary-list { list-style: none; }
.summary-list li {
  padding: 12px 0 12px 34px; position: relative;
  border-bottom: 1px solid var(--line); font-size: 18px;
}
.summary-list li:last-child { border-bottom: none; }
.summary-list li::before {
  content: "•"; color: var(--orange); font-size: 26px;
  position: absolute; left: 8px; top: 8px;
}
.scheme-img { width: 100%; max-width: 100%; border-radius: 14px; margin: 12px 0; display: block; }

/* Квиз */
.q-text { font-size: 21px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.q-review-tag {
  display: inline-block; background: var(--soft-warn); color: var(--orange-dark);
  font-size: 15px; font-weight: 700; padding: 4px 12px; border-radius: 10px;
  margin-bottom: 10px;
}
.option {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 15px 16px; margin-bottom: 12px;
  font-size: 18px; line-height: 1.4; cursor: pointer;
  font-family: inherit; color: var(--ink);
  min-height: 56px;
  transition: border-color .12s ease, background .12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.option:hover { border-color: var(--teal); }
.option.selected { border-color: var(--teal); background: var(--soft-good); }
.option.correct { border-color: var(--good); background: var(--soft-good); }
.option.wrong { border-color: var(--red-soft); background: var(--soft-warn); }
.option[disabled] { cursor: default; }

.feedback {
  border-radius: 14px; padding: 16px; margin: 14px 0;
  font-size: 17px; line-height: 1.5;
}
.feedback.good { background: var(--soft-good); border-left: 4px solid var(--teal); }
.feedback.oops { background: var(--soft-warn); border-left: 4px solid var(--orange); }
.feedback b { display: block; margin-bottom: 4px; }

.quiz-note {
  text-align: center; font-size: 15px; color: var(--muted); margin-bottom: 14px;
}

/* Значок */
.badge-big {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--teal); display: flex; align-items: center; justify-content: center;
  font-size: 52px; margin: 16px auto;
  box-shadow: 0 6px 22px rgba(42,127,122,.35);
}
.badge-name { text-align: center; font-size: 22px; font-weight: 800; color: var(--teal-dark); }
.center { text-align: center; }

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0; }
.badge-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--soft-good); border-radius: 12px; padding: 7px 12px;
  font-size: 15px; font-weight: 600; color: var(--teal-dark);
}
.badge-chip.off { background: var(--bg); border: 1px dashed var(--line); color: var(--muted); }

/* Поля ввода */
.input {
  width: 100%; padding: 14px; font-size: 18px; font-family: inherit;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); margin-bottom: 12px;
}
.input:focus { outline: none; border-color: var(--teal); }
textarea.input { min-height: 90px; resize: vertical; }

/* Диплом */
.diploma {
  background: linear-gradient(160deg, #fff 0%, #F3FAF8 100%);
  border: 3px solid var(--teal); border-radius: 22px;
  padding: 30px 22px; text-align: center; margin-bottom: 18px;
}
.diploma .d-name { font-size: 26px; font-weight: 800; color: var(--teal-dark); margin: 8px 0; }
.diploma .d-title { font-size: 20px; color: var(--ink); }

/* Конфетти */
.confetti {
  position: fixed; width: 10px; height: 14px; top: -20px; z-index: 99;
  pointer-events: none; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}

/* Крючок на велкоме */
.hero { text-align: center; padding-top: 24px; }
.hero .from {
  font-size: 17px; color: var(--muted); margin-bottom: 18px;
}
.exam-summary-item { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.exam-summary-item:last-child { border-bottom: none; }

a { color: var(--teal); }

@media (min-width: 600px) {
  h1 { font-size: 34px; }
  #app { padding-top: 36px; }
}
