:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f4;
  color: #1f2328;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid #1f2328;
  border-radius: 8px;
  background: #1f2328;
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

button:disabled {
  border-color: #c4c7c5;
  background: #dedfdb;
  color: #747775;
  cursor: default;
}

.app {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 10px 12px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.15;
}

#meta,
.status,
.feedback,
.figure figcaption {
  color: #5f6368;
}

#meta {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 12px;
}

.menuButton {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 40px;
  min-height: 36px;
  padding: 8px;
  border-color: #d0d4d2;
  background: #fff;
}

.menuButton span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #1f2328;
}

.modeMenu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.modeMenu button {
  border-color: #d0d4d2;
  background: #fff;
  color: #1f2328;
}

.modeMenu button.active {
  border-color: #1f2328;
  background: #1f2328;
  color: #fff;
}

.screen,
.done {
  display: grid;
  gap: 10px;
}

.status {
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.learnNav {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: end;
}

.jumpField,
.filterField {
  display: grid;
  gap: 4px;
  color: #5f6368;
  font-size: 13px;
}

.jumpField input,
.filterField select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd4d1;
  border-radius: 8px;
  background: #fff;
  color: #1f2328;
  padding: 8px 10px;
}

#questionText {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.28;
}

.figures {
  display: grid;
  gap: 8px;
}

.figure {
  margin: 0;
}

.figure img {
  display: block;
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
  border: 1px solid #e0e2df;
  background: #fff;
}

.figure figcaption {
  margin-top: 5px;
  font-size: 13px;
}

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

.answer {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  border-color: #d0d4d2;
  background: #fff;
  color: #1f2328;
  text-align: left;
}

.answer:hover:not(:disabled) {
  border-color: #6f7471;
}

.answerKey {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef0ed;
  font-weight: 700;
}

.answer.correct {
  border-color: #1d7f3d;
  background: #edf7ef;
}

.answer.correct .answerKey {
  background: #1d7f3d;
  color: #fff;
}

.answer.wrong {
  border-color: #b42318;
  background: #fff0ee;
}

.answer.wrong .answerKey {
  background: #b42318;
  color: #fff;
}

.feedback {
  min-height: 20px;
  font-weight: 700;
}

.feedback.ok {
  color: #1d7f3d;
}

.feedback.bad {
  color: #b42318;
}

.bottomNav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bottomNav button:only-child {
  grid-column: 1 / -1;
}

.done {
  padding-top: 20px;
}

.done h2 {
  font-size: 22px;
}

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

  button {
    min-height: 42px;
    padding: 9px 11px;
  }

  .modeMenu button {
    min-height: 40px;
  }

  .topbar {
    margin-bottom: 6px;
  }

  h1 {
    font-size: 16px;
  }

  .status,
  .jumpField,
  .filterField,
  .figure figcaption {
    font-size: 12px;
  }

  .screen {
    gap: 8px;
  }

  #questionText {
    font-size: 18px;
  }

  .figure img {
    max-height: 36vh;
  }

  .figure figcaption {
    display: none;
  }

  .answer {
    grid-template-columns: 30px 1fr;
    min-height: 44px;
    padding: 8px 10px;
  }

  .answerKey {
    width: 26px;
    height: 26px;
  }
}

@media (min-width: 700px) {
  .app {
    padding: 24px 16px 48px;
  }

  h1 {
    font-size: 22px;
  }

  #questionText {
    font-size: 23px;
  }

  .status {
    display: flex;
    justify-content: space-between;
  }

  .learnNav {
    grid-template-columns: 120px 180px 80px;
  }
}
