@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #474747;
  background: #fbfbef;
  font-size: 16px;
  line-height: 1.6;
  --accent: #2f7311;
  --border: #dcd8c9;
  --muted: #65655c;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #24590d; }
a, button, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.site-header {
  padding: 0 max(32px, calc((100% - 1136px) / 2));
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #285719;
}
.wordmark { font-family: "Nunito", Arial, sans-serif; font-weight: 750; font-size: 20px; letter-spacing: -.5px; color: #fbfbef; text-decoration: none; white-space: nowrap; }
.wordmark span { font-weight: 400; color: #dce6d4; }
.site-header nav a { color: #fbfbef; }
.site-header a:hover { color: #fff; }
.site-header a:focus-visible { outline-color: #fbfbef; }
nav { display: flex; gap: 24px; font-size: 14px; }
nav a { text-decoration: none; }
.practice-nav { min-height: 48px; padding: 0 max(32px, calc((100% - 1136px) / 2)); align-items: stretch; flex-wrap: wrap; gap: 0 24px; background: #285719; border-bottom: 1px solid #285719; }
.practice-nav a { display: flex; align-items: center; padding: 12px 0; color: #fbfbef; border-bottom: 2px solid transparent; }
.practice-nav a:hover { color: #fff; border-bottom-color: #b7c9a7; }
.practice-nav a[aria-current="page"] { border-bottom-color: #fff; color: #fff; }
.practice-nav a:focus-visible { outline-color: #fbfbef; outline-offset: -4px; }
main { max-width: 800px; margin: 48px auto 64px; padding: 0 24px; min-height: 55vh; }
main:focus { outline: none; }
h1, h2, p { margin: 0 0 16px; }
h1 { font-family: "Nunito", Arial, sans-serif; font-size: 30px; line-height: 1.3; letter-spacing: -.7px; font-weight: 680; }
h2 { font-size: 18px; line-height: 1.4; font-weight: 650; }
.intro { color: var(--muted); font-size: 18px; max-width: 600px; }
.muted { color: var(--muted); font-size: 14px; }
.paper-details { border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin: 32px 0 24px; background: #fff; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 144px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
dl div:first-child { border-top: 0; }
dt { font-weight: 650; }
dd { margin: 0; color: var(--muted); }
.button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.button:hover { background: #24590d; border-color: #24590d; color: #fff; }
.button.secondary { color: var(--accent); background: #fff; }
.button.secondary:hover { background: #f5f5dc; }
.welcome-actions { margin: 24px 0 32px; }
.welcome-actions > a + p { margin-top: 12px; }
.welcome-actions > form + a { display: inline-block; margin-top: 16px; }
.source-note { border-top: 1px solid var(--border); padding-top: 24px; color: var(--muted); font-size: 14px; }
.source-note p:last-child { margin-bottom: 0; }
.restart { margin-top: 24px; font-size: 14px; }
summary { cursor: pointer; }
.restart p { margin-top: 12px; }
.question-progress { margin-bottom: 24px; }
.question-progress > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.question-progress span { color: var(--muted); }
progress { display: block; width: 100%; height: 4px; margin-top: 12px; border: 0; background: #e5e2d2; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #e5e2d2; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.section-name { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--accent); }
.topic-name { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; width: 100%; }
.question-title { font-size: 24px; line-height: 1.45; letter-spacing: -.35px; margin-bottom: 24px; }
.practice-label { margin-bottom: 16px; font-weight: 600; }
.area-form { margin: 24px 0 32px; }
.area-form > label { display: block; margin-bottom: 8px; font-weight: 600; }
.area-form select { display: block; width: 100%; height: 48px; min-height: 48px; padding: 8px 32px 8px 12px; border: 1px solid #aaa58f; border-radius: 8px; background: #fff; color: inherit; font: inherit; text-overflow: ellipsis; margin-bottom: 12px; }
.weakest-actions { margin: 24px 0 32px; }
.weakest-actions > p { margin: 12px 0 0; }
.weakest-table { width: 100%; border-collapse: collapse; margin-top: 24px; table-layout: fixed; }
.weakest-table caption { text-align: left; font-weight: 600; margin-bottom: 12px; }
.weakest-table th, .weakest-table td { text-align: left; vertical-align: top; padding: 12px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.weakest-table th:first-child { width: 66%; }
.weakest-table tbody th { font-weight: 400; }
.weakest-table thead { font-size: 14px; color: var(--muted); }
.answer-count { display: block; font-size: 14px; color: var(--muted); }
.focused-score { font-size: 24px; }
.choices { display: grid; gap: 12px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 16px; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.choice:hover { border-color: #aaa58f; background: #fff; }
.choice:has(input:checked) { border-color: var(--accent); background: #eff5e9; }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.choice:has(input:disabled) { cursor: default; }
.choice input { margin: 0; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
.choice-letter { color: var(--muted); font-weight: 650; }
.choice-text { flex: 1; }
.choice-result { font-size: 12px; font-weight: 650; }
.choice.correct-choice, .choice.correct-choice:has(input:checked) { border-color: #2f7311; background: #f0f5e9; color: #285719; }
.choice.wrong-choice, .choice.wrong-choice:has(input:checked) { border-color: #c0392b; background: #fcf1ed; color: #9b3025; }
.question-actions { display: flex; align-items: center; gap: 16px; margin: 24px 0 0; }
.feedback { padding: 20px 24px; border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; margin-top: 24px; }
.feedback-correct { border-left-color: #2f7311; }
.feedback-correct h2 { color: #2f7311; }
.feedback-review { border-left-color: #285719; }
.feedback-review h2 { color: #285719; }
.feedback-wrong { border-left-color: #c0392b; }
.feedback-wrong h2 { color: #9b3025; }
.feedback h2 { margin-bottom: 12px; }
.reference { display: block; font-size: 14px; overflow-wrap: anywhere; }
.form-error { color: #9b3025; }
.results-table { width: 100%; border-collapse: collapse; margin: 24px 0 16px; font-size: 15px; }
.results-table caption { text-align: left; font-weight: 650; font-size: 18px; margin-bottom: 12px; }
.results-table th, .results-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.results-table thead { color: var(--muted); }
.results-table tbody th { font-weight: 500; }
.review { margin-top: 40px; }
.review-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.review-item summary { font-weight: 550; }
.review-item p:first-of-type { margin-top: 16px; }
.site-footer { max-width: 1200px; margin: 0 auto; padding: 24px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.site-footer p { margin-bottom: 4px; }
.area-form textarea { width: 100%; display: block; padding: 12px; border: 1px solid #aaa58f; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-size: 16px; resize: vertical; }
.area-form textarea.morse-code { font-family: monospace; }
.morse-code { font-family: monospace; font-size: 18px; letter-spacing: 1px; overflow-wrap: anywhere; }
.morse-message { border: 1px solid var(--border); padding: 16px; font-size: 18px; overflow-wrap: anywhere; }
.morse-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.morse-controls[hidden] { display: none; }
.morse-controls .button { padding: 10px 8px; }
.morse-table { table-layout: fixed; }
.morse-table td, .morse-table th { overflow-wrap: anywhere; }
.morse-table th:first-child { width: 36%; }
.morse-table th:last-child { width: 28%; }
.morse-table .button { padding: 8px 12px; }
.morse-history { padding-left: 24px; }
.morse-history a { display: inline-flex; align-items: center; min-height: 44px; }
audio { width: 100%; max-width: 480px; margin: 8px 0 12px; }
.exam-status { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.timed-answer legend { font-size: 20px; margin-bottom: 16px; }
.timed-answer .choice:last-child { display: flex; }
.timed-answer + .source-note { margin-top: 24px; }
.question-index { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 24px 0; }
.question-index a { display: flex; align-items: center; min-height: 48px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; font-size: 14px; }
.feedback p { overflow-wrap: anywhere; }
.account-form { max-width: 480px; }
.account-form > input:not([type="hidden"]), .recovery-code { display: block; width: 100%; height: 48px; padding: 8px 12px; margin-bottom: 16px; border: 1px solid #aaa58f; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-size: 16px; }
.account-form .checkbox-label { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 400; }
.checkbox-label input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.account-email { overflow-wrap: anywhere; font-weight: 600; }
.account-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.account-links { flex-wrap: wrap; }
.recovery-code { margin: 12px 0 24px; height: auto; max-width: 480px; font-family: monospace; resize: none; }
.notice { padding: 12px 16px; background: #eff5e9; border: 1px solid var(--border); border-radius: 8px; }
.saved-history { list-style: none; padding: 0; margin: 24px 0; }
.saved-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.saved-history strong { overflow-wrap: anywhere; }
.saved-history p { margin: 4px 0 0; }
.history-pages { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.history-pages a { display: flex; align-items: center; min-height: 44px; }
.skip-link { position: absolute; top: -100px; left: 16px; background: #fff; padding: 8px 16px; z-index: 1; }
.skip-link:focus { top: 8px; }
.reference-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 24px 0; }
.reference-filters label { display: block; margin-bottom: 8px; font-weight: 600; }
.reference-filters input, .reference-filters select { display: block; width: 100%; min-width: 0; height: 48px; padding: 8px 12px; border: 1px solid #aaa58f; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-size: 16px; }
.reference-filters select { padding-right: 32px; text-overflow: ellipsis; }
.reference-filter-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; }
.reference-filter-actions a { display: flex; align-items: center; min-height: 44px; }
.reference-index { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; margin: 24px 0 32px; }
.reference-index summary { min-height: 32px; font-weight: 600; }
.reference-index nav { display: block; margin-top: 8px; }
.reference-index a { display: block; padding: 8px 0; min-height: 44px; text-decoration: underline; }
.reference-chapter { margin-top: 32px; }
.reference-chapter h2 { padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.reference-entry { padding: 16px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.reference-entry h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.4; }
.reference-entry h3 a { color: inherit; text-decoration: none; }
.reference-entry h3 a:hover { text-decoration: underline; }
.reference-entry p { margin-bottom: 12px; }
.reference-background { font-size: 14px; color: var(--muted); }
.reference-equations { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin-bottom: 16px; }
.reference-equations p { font-size: 18px; margin: 8px 0; }
.reference-samples { font-size: 14px; margin: 8px 0 0; }
.reference-top { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-size: 14px; }
.reference-entry h3, .reference-chapter h2 { scroll-margin-top: 16px; }
@media (max-width: 600px) {
  .reference-filters { grid-template-columns: minmax(0, 1fr); }
  .reference-filter-actions { flex-wrap: wrap; gap: 8px 24px; }
  .reference-index summary { min-height: 44px; }
  .reference-equations { padding-left: 12px; }
  .site-header { padding: 8px 16px; gap: 12px; min-height: 64px; }
  .site-header nav { gap: 12px; }
  .site-header nav a { display: flex; align-items: center; min-height: 44px; white-space: nowrap; }
  nav { gap: 16px; font-size: 13px; }
  .practice-nav { padding: 0 16px; gap: 8px; font-size: 14px; }
  .practice-nav a { min-height: 56px; padding: 8px 0; justify-content: center; text-align: center; line-height: 1.35; }
  .weakest-table th:first-child { width: auto; }
  .weakest-table thead th:not(:first-child) { width: 72px; }
  .weakest-table thead th { white-space: nowrap; }
  .weakest-table th, .weakest-table td { padding: 12px 4px; }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }
  .wordmark span { margin-left: 4px; }
  main { margin: 24px auto 32px; padding: 0 16px; }
  h1 { font-family: "Nunito", Arial, sans-serif; font-size: 26px; }
  .intro { font-size: 16px; }
  .paper-details { padding: 16px; margin-top: 24px; }
  dl div { grid-template-columns: 1fr; gap: 4px; }
  .button { min-height: 48px; width: 100%; font-size: 16px; }
  .area-form select { height: 48px; min-height: 48px; font-size: 16px; }
  .question-title { font-size: 21px; }
  .choice { display: grid; grid-template-columns: 20px 16px minmax(0, 1fr); padding: 12px; gap: 8px 12px; min-height: 56px; }
  .choice input { width: 20px; height: 20px; }
  .choice-text { min-width: 0; }
  .choice-result { grid-column: 3; }
  .question-actions { align-items: stretch; flex-direction: column; gap: 12px; }
  .question-actions > a:not(.button) { display: flex; align-items: center; min-height: 44px; }
  .feedback { padding: 16px; }
  .reference { min-height: 44px; padding: 8px 0; }
  summary { min-height: 44px; padding: 8px 0; }
  .restart { font-size: 16px; }
  .results-table th, .results-table td { padding: 12px 4px; }
  .site-footer { padding: 24px 16px; font-size: 13px; }
  .morse-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exam-status { font-size: 14px; gap: 8px; }
  .morse-table .button { font-size: 14px; }
}
@media (max-width: 760px) {
  .practice-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 12px; }
  .practice-nav a { grid-column: span 2; justify-content: center; text-align: center; min-height: 56px; }
  .practice-nav a:nth-last-child(-n+2) { grid-column: span 3; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none; }
}
