/* One question and one primary action, shared across phone and desktop. */
#player.practicing {
  max-width: 780px;
}
#player.practicing .lesson-layout {
  display: block;
  padding: 14px 28px 28px;
}
#player.practicing .lesson-sidebar,
#player.practicing #lesson-goal,
#player.practicing #lesson-phase,
#player.practicing #player-topic,
#player.practicing .lesson-next {
  display: none;
}
#player.practicing.practice-finished .lesson-next {
  display: block;
  margin-top: 22px;
}
#player.practicing .lesson-heading {
  padding: 0 28px 12px;
}
#player.practicing .lesson-heading h2 {
  font-size: 21px;
  margin: 0;
  line-height: 1.5;
}
.practice-top {
  margin: 0 0 8px;
}
.practice-top button {
  min-height: 44px;
}
.workbook {
  color: #213f38;
  text-align: right;
  scroll-margin-top: 12px;
}
.workbook [hidden] {
  display: none !important;
}
.workbook-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #617067;
  font-size: 13px;
  padding-bottom: 16px;
}
.workbook-summary span {
  white-space: nowrap;
}
.workbook-summary progress {
  flex: 1;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 20px;
  accent-color: #477d69;
  background: #e0e7dc;
}
.workbook-summary progress::-webkit-progress-bar {
  background: #e0e7dc;
  border-radius: 20px;
}
.workbook-summary progress::-webkit-progress-value {
  background: #477d69;
  border-radius: 20px;
}
.practice-save {
  font-size: 13px;
  color: #85602b;
  line-height: 1.6;
}
.workbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.workbook-toolbar strong {
  font-size: 15px;
  white-space: nowrap;
}
.workbook-toolbar select {
  font: inherit;
  font-size: 13px;
  color: #4e675a;
  background: transparent;
  border: 1px solid #d6dfd3;
  border-radius: 8px;
  min-height: 44px;
  padding: 8px;
  max-width: 55%;
}
.workbook-guide {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.7;
}
.workbook-guide summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  box-sizing: border-box;
  color: #697354;
  font-size: 14px;
}
.workbook-guide[open] {
  background: #f6edc8;
  padding: 0 14px 14px;
  border-radius: 12px;
}
.workbook-guide ul {
  padding-inline-start: 22px;
}
.workbook-guide li {
  margin: 6px 0;
}
.worked-example {
  background: #fffaf0;
  border-radius: 8px;
  padding: 12px;
}
.worked-example b {
  font-size: 12px;
  color: #756130;
}
.worked-example p {
  margin: 5px 0 0;
  unicode-bidi: plaintext;
}
.exercise-card {
  border: 1px solid #dce3d6;
  border-radius: 16px;
  padding: 24px;
  background: #fffefa;
  min-width: 0;
}
.exercise-card.correct {
  border-color: #98b7a3;
}
.exercise-card.incorrect {
  border-color: #d5b477;
}
.exercise-card.assisted {
  border-color: #c8c9b3;
}
.exercise-card h3 {
  font-size: 20px;
  line-height: 1.65;
  margin: 0 0 16px;
  color: #233f36;
}
.exercise-card h3:focus {
  outline: none;
}
.exercise-expression {
  font-size: 25px;
  line-height: 1.6;
  font-weight: 650;
  text-align: center;
  margin: 12px 0 18px;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}
.exercise-expression[dir="rtl"] {
  font-size: 18px;
  text-align: right;
}
.exercise-input input[type="text"] {
  box-sizing: border-box;
  border: 1.5px solid #b4c3b6;
  background: #fff;
  border-radius: 9px;
  padding: 12px;
  font: inherit;
  font-size: 20px;
  color: #193d33;
  min-width: 0;
  max-width: 100%;
  min-height: 50px;
}
.exercise-input input::placeholder {
  font-size: 16px;
  color: #788275;
}
.exercise-input input:focus {
  outline: 3px solid #c7dcce;
  border-color: #366e55;
}
.written-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}
.written-answer input {
  width: 100%;
  flex: 1;
}
.written-answer > span {
  font-size: 14px;
}
.answer-sign {
  font: inherit;
  font-size: 22px;
  width: 44px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid #cbd6c6;
  border-radius: 9px;
  color: #315b49;
  background: #f5f7ef;
  cursor: pointer;
}
.fraction-answer {
  display: grid;
  grid-template-columns: 105px 44px;
  align-items: center;
  gap: 0 12px;
  margin: 16px auto;
  width: max-content;
  max-width: 100%;
}
.fraction-answer input {
  width: 105px;
  text-align: center;
  grid-column: 1;
}
.fraction-answer input:first-child {
  grid-row: 1;
  border-bottom: 3px solid #264a3e;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.fraction-answer input:nth-child(2) {
  grid-row: 2;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.fraction-answer .answer-sign {
  grid-column: 2;
  grid-row: 1 / 3;
}
.input-help {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #6e7c6e;
  margin-bottom: 12px;
}
.workbook-options {
  border: 0;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
.workbook-option {
  cursor: pointer;
  flex: 1 1 140px;
  position: relative;
  display: flex;
}
.workbook-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.workbook-option span {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 48px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd6c6;
  background: #fff;
  border-radius: 10px;
  font-size: 17px;
  text-align: center;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.workbook-option input:checked + span {
  background: #e6f0e8;
  color: #193f30;
  border: 2px solid #42765a;
  padding: 10px 13px;
}
.workbook-option input:focus-visible + span {
  outline: 3px solid #c9a24e;
  outline-offset: 2px;
}
.exercise-check {
  display: block;
  width: 100%;
  background: #234f43;
  border: 1px solid #234f43;
  color: #fff;
  padding: 13px 18px;
  border-radius: 11px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
  margin-top: 18px;
}
.exercise-check:hover:not(:disabled) {
  background: #173e33;
}
.exercise-check:disabled {
  background: #e7ebdf;
  border-color: #e7ebdf;
  color: #778171;
  cursor: default;
}
.exercise-help {
  margin-top: 12px;
  color: #65745f;
  font-size: 15px;
  line-height: 1.7;
}
.exercise-help summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  box-sizing: border-box;
}
.exercise-help p {
  margin: 0 0 8px;
}
.exercise-feedback {
  font-size: 16px;
  line-height: 1.7;
  margin-top: 16px;
}
.exercise-feedback:empty {
  display: none;
}
.exercise-feedback p {
  margin: 6px 0;
  unicode-bidi: plaintext;
}
.exercise-feedback strong {
  color: #285e43;
}
.incorrect .exercise-feedback strong {
  color: #8a6027;
}
.exercise-feedback > span {
  display: block;
  font-size: 12px;
  color: #75725f;
}
.answer-explanation {
  font-size: 14px;
  color: #5b705f;
}
.answer-explanation summary {
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
  box-sizing: border-box;
}
.question-navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}
.workbook .quiet-button {
  min-height: 44px;
  padding: 9px 6px;
  font-size: 14px;
}
.workbook button:disabled {
  cursor: default;
}
.question-navigation button:disabled {
  opacity: 0.35;
}
.reading-passage {
  white-space: pre-line;
  background: #f0f3e8;
  border-inline-start: 3px solid #bdc99e;
  padding: 15px;
  margin: 0 0 20px;
  color: #2d493d;
  line-height: 1.8;
  font-size: 18px;
  text-align: left;
  border-radius: 0 10px 10px 0;
}
.reading-passage[dir="rtl"] {
  text-align: right;
  border-radius: 10px 0 0 10px;
}
.sentence-built {
  min-height: 54px;
  border: 1px dashed #9bae98;
  background: #f5f7ee;
  padding: 12px;
  font-size: 19px;
  line-height: 1.7;
  text-align: left;
  border-radius: 10px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.word-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.word-tiles button {
  padding: 10px 13px;
  border: 1px solid #b6c7b5;
  background: #fff;
  border-radius: 8px;
  font: inherit;
  font-size: 17px;
  min-height: 44px;
  cursor: pointer;
  color: #2b4e3e;
}
.word-tiles button:disabled {
  opacity: 0.3;
}
.undo-word {
  margin-top: 8px;
}
.workbook-results {
  padding: 18px 0;
}
.workbook-results h3 {
  font-size: 24px;
  margin: 0 0 10px;
}
.workbook-results p {
  line-height: 1.7;
}
.reflection {
  background: #f0f0e5;
  padding: 16px;
  border-radius: 12px;
  margin-top: 24px;
  line-height: 1.7;
}
.reflection summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  align-content: center;
}
.reflection textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #bdc9b7;
  border-radius: 10px;
  font: inherit;
  font-size: 17px;
  resize: vertical;
  background: #fffef8;
  color: #294635;
}
.reflection small {
  color: #6f7868;
}
.practice-reset {
  color: #73806c;
  margin-top: 18px;
  font-size: 14px;
}
.practice-reset summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.workbook button:focus-visible,
.workbook summary:focus-visible,
.workbook select:focus-visible {
  outline: 3px solid #c9a24e;
  outline-offset: 3px;
}
.exercise-graph {
  margin: 12px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #dce8e2;
  border-radius: 12px;
}
.exercise-graph svg {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: auto;
}
.exercise-graph figcaption {
  text-align: center;
  font-size: 13px;
}
@media (max-width: 700px) {
  #player.practicing {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #player.practicing .player-top {
    padding: max(8px, env(safe-area-inset-top)) 16px 6px;
  }
  #player.practicing .lesson-heading {
    padding: 0 18px 12px;
  }
  #player.practicing .lesson-heading h2 {
    font-size: 18px;
  }
  #player.practicing .lesson-layout {
    padding: 8px 16px 20px;
  }
  .practice-top {
    margin-bottom: 2px;
  }
  .workbook-summary {
    padding-bottom: 10px;
  }
  .exercise-card {
    padding: 18px 16px;
  }
  .exercise-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .exercise-expression {
    font-size: 22px;
  }
  .workbook-option {
    flex-basis: 100%;
  }
  .workbook-guide {
    margin-bottom: 6px;
  }
}

/* Teaching diagrams scale as a whole on narrow screens. */
.practice-visual { margin: 12px auto 18px; width: 100%; max-width: 460px; direction: ltr; }
.practice-visual svg { display: block; width: 100%; height: auto; overflow: visible; }
