.keyboard-stage { position: relative; margin: 14px auto 0; max-width: 700px; padding-bottom: 140px; }
.keys { margin: 0; position: relative; }
.keyboard-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 5px; }
.keyboard-row kbd { flex: 0 1 44px; width: auto; min-width: 0; height: 38px; margin: 0; line-height: 36px; font-size: 15px; border: 1px solid #c2cec5; border-bottom-width: 3px; position: relative; }
.keyboard-row .home-key::after { content: ''; position: absolute; bottom: 4px; left: 35%; width: 30%; border-bottom: 2px solid #527565; }
.keyboard-row .shift-key { flex-basis: 68px; font-size: 11px; }
.keyboard-row .space-key { flex-basis: 270px; }
#hands { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.coach-options { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
#finger-hint { min-height: 2em; margin: 4px 0 14px; color: #235640; font-weight: 600; text-align: center; }
.coach-options input { accent-color: #215744; }
@media (max-width: 520px) {
  main { padding: 12px; } article { padding: 12px; }
  .keyboard-row { gap: 2px; margin-bottom: 4px; }
  .keyboard-row kbd { height: 30px; line-height: 28px; font-size: 11px; }
  .keyboard-row .shift-key { font-size: 8px; flex-basis: 50px; }
  .keyboard-stage { padding-bottom: 84px; }
  #lesson { max-width: 100%; }
}
.keyboard-row .shift-key { white-space: nowrap; }
@media (max-width: 520px) {
  .keyboard-row .shift-key { font-size: 7px; flex-shrink: 0; flex-basis: 37px; }
}

.typing-area { position: relative; border-radius: 12px; margin: 22px 0 6px; }
.typing-area .passage { margin: 0; min-height: 86px; }
.typing-area #entry {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: text; font-size: 18px; border: 0;
}
.typing-area:focus-within { outline: 3px solid #298568; outline-offset: 3px; }
.typing-help { margin: 8px 0 20px; font-size: 14px; color: #526c60; }
.during-focus { display: none; }
.typing-area:focus-within + .typing-help .before-focus { display: none; }
.typing-area:focus-within + .typing-help .during-focus { display: inline; }
.typing-area:has(#entry:disabled) + .typing-help { visibility: hidden; }

.live-stats { display: block; margin: 18px 0 10px; padding: 12px 16px; border-radius: 12px; background: #f1f5f0; color: #214e3d; font-size: clamp(16px, 3vw, 22px); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-stats + .typing-area { margin-top: 12px; }
