* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7faf8;
  color: #17211b;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.app.narrow {
  max-width: 820px;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 700;
}

.byline {
  margin-bottom: 4px;
  color: #40534a;
  font-size: 13px;
}

.bylineInline {
  color: #40534a;
  font-size: 12px;
}

h2 {
  margin-bottom: 10px;
  font-size: 15px;
}

.progress {
  margin-bottom: 0;
  color: #40534a;
  font-size: 14px;
}

.controls {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.buttonLink {
  min-height: 38px;
  border: 1px solid #9bb5a6;
  background: #fbfefd;
  color: #17211b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-decoration: none;
}

.primaryLink {
  border-color: #4b8f67;
  background: #dff1e5;
  font-weight: 700;
}

.mobileNavHint {
  display: none;
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.landingHero {
  width: min(760px, 100%);
  border: 1px solid #c7d9cf;
  background: #fff;
  padding: 24px;
}

.landingEyebrow {
  margin-bottom: 6px;
  color: #40534a;
  font-size: 13px;
  font-weight: 700;
}

.landingHero h1 {
  font-size: 30px;
}

.landingActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sectionNav {
  position: sticky;
  top: 14px;
}

.sectionNav {
  border: 1px solid #c7d9cf;
  background: #eef7f1;
  padding: 12px;
}

.sectionNav {
}

.batchNav {
  display: grid;
  gap: 6px;
}

.batchNav button {
  min-height: 32px;
  padding: 5px 8px;
  text-align: left;
  font-size: 13px;
}

.batchNav button.active {
  border-color: #4b8f67;
  background: #dff1e5;
  font-weight: 700;
}

.acronymNav {
  border-top: 1px solid #c7d9cf;
  margin-top: 12px;
  padding-top: 12px;
}

.helpfulAcronymsButton {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  text-align: left;
  font-size: 13px;
}

.acronymList {
  margin: 0;
}

.acronymList dt {
  margin-top: 7px;
  font-weight: 700;
}

.acronymList dt:first-child {
  margin-top: 0;
}

.acronymList dd {
  margin: 1px 0 0;
}

.fullAcronymList {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
}

.fullAcronymList dt {
  margin-top: 0;
}

.embeddedReminder {
  border-left: 3px solid #4b8f67;
  margin: 16px 0;
  padding-left: 10px;
}

.embeddedReminder p {
  margin-bottom: 10px;
}

.insightNote {
  border-left: 3px solid #4b8f67;
  margin-bottom: 12px;
  padding-left: 9px;
  color: #263e31;
  font-size: 13px;
}

.panel {
  border: 1px solid #c7d9cf;
  background: #fff;
  padding: 16px;
}

.panel.correct {
  border-color: #4b8f67;
  background: #e7f7eb;
  box-shadow: 0 0 0 3px #bfe5ca;
}

.sectionLabel {
  margin-bottom: 10px;
  color: #40534a;
  font-size: 13px;
  font-weight: 700;
}

.question {
  min-height: 160px;
  margin-bottom: 14px;
  font-size: 20px;
  white-space: pre-wrap;
}

.choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.unknownChoice {
  grid-column: 2 / 4;
}

button {
  min-height: 38px;
  border: 1px solid #9bb5a6;
  background: #fbfefd;
  color: #17211b;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

button.selected {
  outline: 2px solid #6d8f7c;
  outline-offset: 2px;
}

.feedback {
  min-height: 54px;
  margin-bottom: 10px;
  font-size: 15px;
  white-space: pre-wrap;
}

.feedback strong {
  display: block;
  margin-bottom: 6px;
}

.insight {
  border-left: 3px solid #4b8f67;
  margin-top: 10px;
  padding-left: 10px;
}

.insightTitle {
  display: block;
  margin-bottom: 4px;
  color: #263e31;
  font-weight: 700;
}

.actionRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.next {
  min-width: 96px;
}

.secondary {
  min-width: 142px;
}

.hidden {
  display: none;
}

.missed-list {
  margin: 18px 0 0;
  padding-left: 20px;
}

.missed-list li {
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.summaryActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.tocPanel {
  margin-top: 14px;
}

.tocTableWrap {
  overflow-x: auto;
}

.tocTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tocTable th,
.tocTable td {
  border: 1px solid #c7d9cf;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.tocTable th {
  background: #eef7f1;
}

.tocTable td:nth-child(2),
.tocTable th:nth-child(2) {
  width: 130px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .top {
    display: block;
  }

  .controls {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .mobileNavHint {
    display: block;
    margin-top: 12px;
    color: #40534a;
    font-size: 13px;
    font-weight: 700;
  }

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

  .content {
    display: contents;
  }

  #quizPanel,
  #summaryPanel {
    order: 1;
  }

  .sectionNav {
    order: 2;
  }

  #tocPanel {
    order: 3;
  }

  .sectionNav {
    position: static;
  }

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

@media (max-width: 640px) {
  .app {
    padding: 10px;
  }

  h1 {
    font-size: 21px;
  }

  .panel,
  .sectionNav {
    padding: 12px;
  }

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

  .unknownChoice {
    grid-column: 1 / -1;
  }

  .question {
    min-height: auto;
    font-size: 18px;
  }

  .landingHero {
    padding: 18px;
  }

  .landingHero h1 {
    font-size: 24px;
  }

  .landingActions .buttonLink {
    width: 100%;
  }

  .fullAcronymList {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fullAcronymList dd {
    margin-bottom: 10px;
  }
}

@media (max-width: 640px), (display-mode: fullscreen) {
  body.phoneMode .top {
    margin-bottom: 10px;
  }

  body.phoneMode .sectionLabel {
    font-size: 12px;
  }

  body.phoneMode #quizPanel {
    min-height: calc(100vh - 92px);
  }
}
