/* Base, selection, and listening screen styles. */
:root {
  color-scheme: light;
  --ink: #183c38;
  --accent: #236b59;
  --muted: #627671;
  --paper: #f7f6ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.6 system-ui,
    sans-serif;
}
header,
footer {
  max-width: 1040px;
  margin: auto;
  padding: 26px 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}
header {
  border-bottom: 1px solid #dce3dc;
}
.brand {
  font-size: 26px;
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  font-size: 14px;
  margin-left: 12px;
  font-weight: 400;
}
main {
  max-width: 800px;
  padding: 0 28px;
  margin: 32px auto 40px;
}
h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: -1.4px;
  font-weight: 650;
  margin: 18px 0 22px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}
.intro {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 36px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
}
legend {
  font-weight: 650;
  margin-bottom: 12px;
}
.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.levels label {
  position: relative;
  cursor: pointer;
}
.levels input {
  position: absolute;
  top: 18px;
  left: 14px;
  accent-color: var(--accent);
}
.levels span {
  display: block;
  padding: 15px 26px 15px 38px;
  background: white;
  border: 1px solid #d9dfd7;
  border-radius: 12px;
}
.levels input:checked + span {
  border-color: var(--accent);
  background: #eaf2e8;
  box-shadow: 0 0 0 1px var(--accent);
}
.levels .level-shortcut {
  position: absolute;
  top: 4px;
  right: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}
strong,
small {
  display: block;
}
small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.lesson {
  display: flex;
  align-items: center;
  gap: 22px;
  background: #fff;
  border: 1px solid #d9dfd7;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.begin-hint {
  margin-bottom: 28px;
}
.lesson-row {
  margin-bottom: 12px;
}
.lesson-group-items {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}
.lesson-group-title {
  flex-shrink: 0;
  align-self: center;
}
.lesson-group-items .lesson {
  flex: 1 0 190px;
  margin: 0;
  padding: 18px;
  gap: 12px;
}
button {
  font: inherit;
  font-weight: 650;
  border: 0;
  border-radius: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #bc8b38;
  outline-offset: 4px;
}
.secondary {
  background: transparent;
  color: var(--muted);
  margin-left: 12px;
}
.note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 22px;
}
footer {
  font-size: 13px;
  border-top: 1px solid #dce3dc;
}
audio {
  max-width: 100%;
}
#choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
#choices button {
  background: white;
  border: 1px solid #d9dfd7;
  color: var(--ink);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: 20px 32px;
  text-align: center;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#feedback {
  min-height: 30px;
  font-weight: 650;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}
#error {
  color: #9f3434;
}
progress {
  width: 100%;
  height: 7px;
  accent-color: var(--accent);
}
.score {
  font-size: 72px;
  margin: 24px 0;
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.quiz-progress progress {
  flex: 1;
  min-width: 0;
}
#progress {
  white-space: nowrap;
  font-size: 16px;
  color: var(--muted);
}
.quiz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.quiz-toolbar #feedback {
  flex: 1;
  min-width: 0;
}
.control-with-hint {
  flex-shrink: 0;
  text-align: center;
}
.control-with-hint small {
  max-width: 150px;
}
#replay {
  flex-shrink: 0;
  font-size: 18px;
}
#error:empty {
  display: none;
}
#feedback.audio-status {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}
#choices[data-layout='short'] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#choices[data-layout='short'] button {
  aspect-ratio: 1;
  min-height: 0;
  padding: 12px;
  font-size: clamp(24px, 5vw, 42px);
}
#choices button:disabled {
  opacity: 1;
  cursor: default;
}
#choices button:disabled:hover {
  filter: none;
}
#choices button.correct {
  background: #e1f3e7;
  border: 2px solid #23834b;
  color: #175c34;
}
#choices button.incorrect {
  background: #fbe7e5;
  border: 2px solid #bb4039;
  color: #942d28;
}
.answer-mark {
  position: absolute;
  right: 8px;
  top: 4px;
  font-size: 22px;
  font-weight: 800;
}
#choices img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  height: 160px;
  border-radius: 6px;
}
#choice-text {
  min-width: 0;
  height: 64px;
  margin: 0;
  padding: 12px 0;
  text-align: center;
  font-size: 24px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  overflow: auto;
}
.choice-shortcut {
  position: absolute;
  left: 8px;
  bottom: 4px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  color: var(--muted);
}
#choices button[aria-disabled='true'] {
  cursor: default;
}
.quiz-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.quiz-actions .secondary {
  margin: 0;
  padding-left: 0;
}
label.lesson {
  cursor: pointer;
  margin-bottom: 12px;
}
label.lesson input {
  flex-shrink: 0;
  accent-color: var(--accent);
}
label.lesson:has(input:checked) {
  border-color: var(--accent);
  background: #eaf2e8;
}
label.lesson > span:last-child > span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.study-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.study-actions .secondary {
  margin: 0;
}
.study-table-wrap {
  overflow-x: auto;
}
#study-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}
#study-table th,
#study-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #d9dfd7;
}
#study-table td[lang='ka'] {
  font-size: 20px;
}
#study-table .study-basic {
  background: #e1f3e7;
  color: #175c34;
}
#study-table .study-picture {
  width: 100px;
  padding: 6px;
  background: white;
  border: 1px solid #d9dfd7;
  opacity: 1;
  color: var(--ink);
}
#study-table .study-picture img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 6px;
}
#study-table .study-picture:hover {
  filter: none;
}
@media (max-width: 600px) {
  header > span,
  footer > span {
    display: none;
  }
  .levels {
    grid-template-columns: 1fr;
  }
  main {
    margin: 24px auto 32px;
    padding: 0 16px;
  }
  .secondary {
    margin: 12px 0;
  }
  .lesson {
    padding: 18px;
  }
  header,
  footer {
    padding: 16px;
  }
  #choices {
    gap: 8px;
  }
  #choices button {
    padding: 18px 22px;
    font-size: 20px;
  }
  #choices[data-layout='short'] button {
    padding: 8px;
  }
  .answer-mark {
    font-size: 16px;
    right: 4px;
    top: 0;
  }
  .quiz-toolbar {
    min-height: 80px;
  }
  #study-table th,
  #study-table td {
    padding: 8px;
  }
  #study-table .study-picture {
    width: 64px;
  }
  #study-table td[lang='ka'] {
    font-size: 17px;
  }
}
