.tp-module {
  --tp-ink: #132c53;
  --tp-paper: #fffdf5;
  color: var(--tp-ink);
}
.tp-module * {
  box-sizing: border-box;
}
.tp-module h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 8px 0 22px;
}
.tp-module h2 {
  font-size: 1.45rem;
}
.tp-module p {
  line-height: 1.6;
}
.tp-module button {
  font: inherit;
  font-weight: 800;
  min-height: 48px;
  border: 2px solid var(--tp-ink);
  border-radius: 13px;
  color: var(--tp-ink);
  background: #ffe443;
  box-shadow: 3px 3px 0 var(--tp-ink);
  padding: 12px 18px;
  cursor: pointer;
}
.tp-module button:hover:not(:disabled) {
  transform: translateY(-2px);
}
.tp-module button:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.tp-module :is(button, summary, [tabindex]):focus-visible {
  outline: 4px solid #2378c6;
  outline-offset: 4px;
}
.tp-module button.tp-secondary {
  background: var(--tp-paper);
}
.tp-hero {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 32px;
  border: 3px solid var(--tp-ink);
  box-shadow: 7px 7px 0 var(--tp-ink);
  border-radius: 24px;
  background: #bca9ff;
  padding: 30px;
  margin: 10px 7px 30px 0;
  align-items: center;
}
.tp-hero p {
  max-width: 630px;
}
.tp-eyebrow {
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.tp-hero-art {
  transform: rotate(-7deg);
  background: #fffdf5;
  border: 3px solid var(--tp-ink);
  border-radius: 18px;
  box-shadow: 7px 8px 0 #132c53;
  padding: 20px 14px;
  text-align: center;
}
.tp-hero-art span {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.tp-hero-art b {
  font-size: 4rem;
  line-height: 1.3;
  display: block;
}
.tp-caption {
  font-size: 0.92rem;
  color: #40506a;
}
.tp-placement,
.tp-definitions {
  border: 2px solid #c7c5d5;
  border-radius: 16px;
  padding: 18px;
  background: #fffdf5;
  margin: 22px 0;
}
.tp-module summary {
  font-weight: 800;
  cursor: pointer;
  min-height: 28px;
}
.tp-lessons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 26px 7px 26px 0;
}
.tp-module .tp-lesson-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 205px;
  background: #fffdf5;
  padding: 20px;
  position: relative;
}
.tp-lesson-card:nth-child(3n + 2) {
  background: #e0f6f8;
}
.tp-lesson-card:nth-child(3n + 3) {
  background: #ffe4d3;
}
.tp-lesson-card.is-complete {
  background: #dcf5db;
}
.tp-lesson-card strong {
  font-size: 1.2rem;
  line-height: 1.25;
}
.tp-lesson-card > span:not(.tp-lesson-num) {
  font-weight: 500;
}
.tp-lesson-card small {
  margin-top: auto;
  font-size: 0.9rem;
}
.tp-lesson-num {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 35px;
  background: #ffe443;
  border: 2px solid var(--tp-ink);
  border-radius: 10px;
  font-size: 1rem;
}
.tp-top,
.tp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.tp-actions {
  justify-content: flex-start;
}
.tp-top > span {
  font-weight: 700;
  font-size: 0.95rem;
}
.tp-intro,
.tp-paused,
.tp-done {
  padding: clamp(18px, 4vw, 34px);
  border: 3px solid var(--tp-ink);
  background: #fffdf5;
  border-radius: 22px;
  box-shadow: 6px 6px 0 #132c53;
  margin: 10px 7px 28px 0;
}
.tp-intro > p:first-child {
  font-size: 1.15rem;
  max-width: 760px;
}
.tp-hands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: #f0ecff;
  border-radius: 16px;
  padding: 24px 14px;
  margin: 22px 0;
}
.tp-hands > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.tp-hands > div > span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-weight: 900;
}
.tp-hands small {
  font-size: 0.82rem;
}
.tp-home-keys {
  display: flex;
  gap: 5px;
}
.tp-home-keys b {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 2px solid var(--tp-ink);
  border-radius: 9px;
  font-size: 1.2rem;
}
.tp-hand-gap {
  font-size: 2rem;
}
.tp-example-label {
  margin-bottom: 5px;
  font-weight: 800;
}
.tp-result-text {
  background: #f0ecff;
  border-radius: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  padding: 18px;
}
.tp-arena {
  background: #fffdf5;
  border: 3px solid var(--tp-ink);
  border-radius: 20px;
  padding: clamp(12px, 3vw, 28px);
  margin: 20px 0;
  box-shadow: 5px 5px 0 #132c53;
}
.tp-arena:focus {
  outline: 3px solid #2378c6;
  outline-offset: 4px;
}
.tp-target {
  font-family: ui-monospace, Consolas, monospace;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.9;
  overflow-wrap: anywhere;
  background: #f1eff8;
  border-radius: 13px;
  padding: 16px;
  white-space: pre-wrap;
  min-height: 100px;
}
.tp-target > span {
  display: inline-block;
  min-width: 0.67em;
  text-align: center;
}
.tp-typed {
  color: #246b40;
  background: #d3f3d7;
}
.tp-cursor {
  outline: 3px solid #132c53;
  background: #ffe443;
  border-radius: 3px;
  position: relative;
}
.tp-space-mark {
  opacity: 0.35;
  font-size: 0.82em;
}
.tp-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 78px;
  padding: 16px 0;
}
.tp-next > strong {
  font-size: 1.25rem;
}
.tp-finger {
  padding: 6px 10px;
  border: 1px solid var(--tp-ink);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}
.tp-next > span:last-child:not(.tp-finger) {
  font-size: 0.85rem;
}
.tp-keyboard {
  max-width: 880px;
  margin: auto;
  user-select: none;
}
.tp-key-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 6px;
}
.tp-module .tp-key {
  position: relative;
  flex: 1;
  max-width: 59px;
  min-width: 0;
  min-height: 48px;
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 3px 0 #c4c8d2;
  font-size: 1.06rem;
  opacity: 1;
  cursor: pointer;
}
.tp-module .tp-key:disabled {
  cursor: default;
  color: #132c53;
}
.tp-number-row {
  justify-content: flex-start;
  padding: 0 7px;
}
.tp-number-row .tp-key {
  width: 48px;
  flex: none;
}
.tp-number-row > span {
  align-self: center;
  margin-left: 16px;
  font-size: 0.8rem;
  color: #40506a;
}
.tp-shift {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 55px;
  border: 2px solid #b4bac8;
  border-radius: 8px;
  font-size: 0.7rem;
  padding: 4px;
  background: #f7f7fa;
}
.tp-module .tp-key.tp-expected,
.tp-shift.tp-expected {
  outline: 3px solid #132c53;
  outline-offset: 1px;
  box-shadow: 0 4px 0 #132c53;
  z-index: 1;
  background: #ffe443;
}
.tp-space-row .tp-key {
  max-width: 340px;
  width: 70%;
  flex: none;
}
.tp-bump {
  position: absolute;
  width: 13px;
  height: 3px;
  background: #132c53;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
}
.tp-feedback {
  font-size: 0.95rem;
  min-height: 48px;
  margin-bottom: 4px;
}
.tp-live-stats {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
  border-top: 1px solid #d8dbe2;
  padding-top: 14px;
  font-size: 0.9rem;
}
.tp-live-stats strong {
  margin-left: 6px;
}
.tp-instruction {
  font-size: 1.08rem;
  max-width: 850px;
}
.tp-f0 {
  background: #f8c5d4 !important;
}
.tp-f1 {
  background: #ffd2ae !important;
}
.tp-f2 {
  background: #fff0a6 !important;
}
.tp-f3 {
  background: #c5ebc8 !important;
}
.tp-f4 {
  background: #b9e4f2 !important;
}
.tp-f5 {
  background: #ccd5fa !important;
}
.tp-f6 {
  background: #e0caf5 !important;
}
.tp-f7 {
  background: #f5cbed !important;
}
.tp-f8 {
  background: #e5e5ef !important;
}
.tp-module .tp-expected {
  background: #ffe443 !important;
}
.tp-done {
  text-align: center;
}
.tp-done-star {
  font-size: 4rem;
  color: #e09a00;
  text-shadow: 2px 2px 0 #132c53;
}
.tp-done .tp-actions {
  justify-content: center;
}
.tp-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.tp-result-grid > div {
  padding: 18px 12px;
  border: 2px solid #d9d3ea;
  border-radius: 13px;
  background: #f7f4ff;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tp-result-grid strong {
  font-size: 1.35rem;
  line-height: 1.25;
}
.tp-result-grid span {
  font-size: 0.84rem;
}
.tp-definitions {
  text-align: left;
}
.tp-table-wrap {
  overflow: auto;
}
.tp-report {
  margin: 28px 0;
}
.tp-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tp-report th,
.tp-report td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #d4d9e1;
}
.tp-report th {
  background: #f0ecff;
}
@media (max-width: 760px) {
  .tp-lessons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tp-hero {
    grid-template-columns: 1fr;
  }
  .tp-hero-art {
    display: none;
  }
  .tp-hands {
    gap: 14px;
  }
  .tp-hand-gap {
    display: none;
  }
  .tp-home-keys b {
    width: 35px;
    height: 40px;
  }
  .tp-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tp-key-row {
    gap: 3px;
  }
  .tp-module .tp-key {
    min-height: 40px;
    font-size: 0.95rem;
  }
  .tp-shift {
    min-width: 32px;
    font-size: 0.55rem;
  }
  .tp-next {
    gap: 8px;
  }
  .tp-arena {
    padding: 12px;
  }
  .tp-number-row > span {
    font-size: 0.66rem;
    margin-left: 8px;
  }
  .tp-number-row .tp-key {
    width: 32px;
  }
}
@media (max-width: 430px) {
  .tp-lessons {
    grid-template-columns: 1fr;
  }
  .tp-module .tp-lesson-card {
    min-height: 150px;
  }
  .tp-hero {
    padding: 22px;
  }
  .tp-hands {
    flex-wrap: wrap;
  }
  .tp-hands small {
    font-size: 0.72rem;
  }
  .tp-home-keys {
    gap: 3px;
  }
  .tp-home-keys b {
    width: 29px;
    height: 34px;
  }
  .tp-key-row {
    gap: 2px;
  }
  .tp-module .tp-key {
    font-size: 0.73rem;
    min-height: 36px;
    border-width: 1px;
    border-radius: 5px;
  }
  .tp-shift {
    min-width: 25px;
    font-size: 0.47rem;
    border-width: 1px;
  }
  .tp-finger {
    font-size: 0.74rem;
  }
  .tp-next > strong {
    font-size: 1.1rem;
  }
  .tp-actions button {
    width: 100%;
  }
  .tp-result-grid {
    gap: 8px;
  }
  .tp-result-grid > div {
    padding: 13px 8px;
  }
  .tp-result-grid strong {
    font-size: 1.1rem;
  }
}
@media print {
  .tp-report details {
    display: block;
  }
  .tp-report .tp-table-wrap {
    overflow: visible;
  }
  .tp-report th,
  .tp-report td {
    padding: 7px;
  }
  .tp-module button {
    display: none;
  }
}
