:root {
  color-scheme: light;
  --paper: #fbf8f0;
  --panel: #ffffff;
  --ink: #17231f;
  --muted: #66736f;
  --line: #ded3c2;
  --soft-line: #eee7dc;
  --green: #0b4a3f;
  --green-dark: #07352e;
  --sage: #e9f1ea;
  --gold: #a8742c;
  --gold-soft: #f6ecd9;
  --danger: #a83a32;
  --success: #1c704b;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.lyt-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 24px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.module-hero,
.area-panel,
.section-summary,
.unit-panel,
.start-panel,
.question-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 42px rgba(40, 30, 16, 0.08);
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(249, 242, 229, 0.9)),
    var(--panel);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.08;
}

h2 {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.12;
}

p {
  line-height: 1.58;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hero-stats article {
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--paper);
  padding: 16px 18px;
}

.hero-stats strong {
  display: block;
  color: var(--green);
  font-size: 30px;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.area-panel {
  margin-top: 18px;
  padding: 22px;
}

.area-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

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

.area-tab {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  color: var(--ink);
  text-align: left;
}

.area-tab.active {
  border-color: rgba(11, 74, 63, 0.45);
  background: var(--sage);
}

.area-tab svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.area-tab strong,
.unit-title strong {
  display: block;
  font-weight: 800;
}

.area-tab span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.exam-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.section-summary {
  align-self: start;
  padding: 24px;
  position: sticky;
  top: 16px;
}

.section-summary p {
  color: var(--muted);
}

.section-summary dl {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.section-summary div {
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
}

.section-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-summary dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.unit-panel {
  overflow: hidden;
}

.unit-tools {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.search-field span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-field input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
}

#unitNotice {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.unit-list {
  display: grid;
}

.unit-row,
.unit-head,
.unit-foot {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 120px 150px;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
}

.unit-head {
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-row {
  border-top: 1px solid var(--soft-line);
}

.unit-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.unit-badge {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--sage);
  color: var(--green);
  font-weight: 800;
}

.unit-title em {
  display: inline-block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

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

.status-pill {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  background: var(--sage);
  padding: 6px 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.locked {
  background: var(--gold-soft);
  color: var(--gold);
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 8px;
  font-weight: 800;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
}

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

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

.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 8px 0;
}

.unit-foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.quiz-screen {
  margin-top: 18px;
}

.start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: center;
  padding: 24px;
}

.start-card,
.mode-picker {
  display: grid;
  gap: 12px;
}

.mode-picker {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.mode-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 800;
}

.mode-picker label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-panel,
.results-panel {
  padding: 20px;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.timer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 14px;
  color: var(--green);
  font-size: 20px;
  font-weight: 800;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.question-text {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 800;
  line-height: 1.28;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.choice-button.selected {
  border-color: var(--green);
  background: var(--sage);
}

.choice-button.correct {
  border-color: var(--success);
  background: #edf8f1;
}

.choice-button.incorrect {
  border-color: var(--danger);
  background: #fff0ee;
}

.choice-letter {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-weight: 800;
}

.feedback {
  margin-top: 12px;
  border-radius: 8px;
  padding: 12px;
  font-weight: 800;
}

.feedback.correct {
  background: #edf8f1;
  color: var(--success);
}

.feedback.incorrect {
  background: #fff0ee;
  color: var(--danger);
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.result-summary {
  border-radius: 10px;
  padding: 18px;
}

.result-summary.pass {
  background: #edf8f1;
  color: var(--success);
}

.result-summary.fail {
  background: #fff0ee;
  color: var(--danger);
}

.missed-list {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

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

.error-text {
  color: var(--danger);
}

@media (max-width: 900px) {
  .lyt-shell {
    padding: 14px;
  }

  .module-hero,
  .exam-layout,
  .start-panel {
    grid-template-columns: 1fr;
  }

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

  .section-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .module-hero,
  .area-panel,
  .section-summary,
  .question-panel,
  .results-panel {
    padding: 16px;
  }

  .area-tabs,
  .unit-tools {
    grid-template-columns: 1fr;
  }

  .unit-head {
    display: none;
  }

  .unit-row,
  .unit-foot {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-header,
  .quiz-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
