/*! Typing Master Pro - styles. Everything is scoped under .tmp-app so it will not clash with your theme. */
.tmp-app {
  --tmp-bg: #0a2230; --tmp-bar: #0f3347; --tmp-text: #6fa3b5; --tmp-ok: #67e8f9; --tmp-bad: #fda4af;
  --tmp-caret: #fbbf24; --tmp-accent: #06b6d4; --tmp-ink: #eef0ff; --tmp-on-accent: #10121f;
  --tmp-card: color-mix(in srgb, var(--tmp-ink) 7%, var(--tmp-bg));
  --tmp-line: color-mix(in srgb, var(--tmp-ink) 14%, transparent);
  --tmp-mute: color-mix(in srgb, var(--tmp-ink) 62%, transparent);
  --tmp-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --tmp-lh: 2.7rem;
  position: relative; box-sizing: border-box; width: 100%; max-width: 1120px; margin: 24px auto;
  padding: 22px; border-radius: 24px; overflow: hidden;
  background: var(--tmp-bg); color: var(--tmp-ink);
  font: 400 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background .3s ease, color .3s ease;
}
.tmp-app *, .tmp-app *::before, .tmp-app *::after { box-sizing: border-box; }
.tmp-app [hidden] { display: none !important; }
.tmp-app h2, .tmp-app h3, .tmp-app h4, .tmp-app p { margin: 0; padding: 0; color: inherit; text-transform: none; letter-spacing: normal; }
.tmp-app button {
  appearance: none; -webkit-appearance: none; margin: 0; font: inherit; line-height: 1.2; color: inherit; cursor: pointer;
  background: none; border: 0; border-radius: 12px; box-shadow: none; text-shadow: none; text-transform: none; letter-spacing: normal;
}
.tmp-app button:focus-visible, .tmp-app input:focus-visible { outline: 2px solid var(--tmp-accent); outline-offset: 2px; }
.tmp-app button:disabled { cursor: not-allowed; }

/* loading / help message (visible only until the script starts) */
.tmp-app .tmp-fallback { display: grid; gap: 6px; padding: 10px 6px; }
.tmp-app .tmp-fallback span { color: var(--tmp-mute); font-size: .85rem; max-width: 60ch; opacity: 0; animation: tmp-late .01s linear 4s forwards; }
.tmp-app .tmp-fallback code { font-size: .8rem; word-break: break-all; }
.tmp-app .tmp-fallback-ns { color: var(--tmp-bad); }
@keyframes tmp-late { to { opacity: 1; } }

/* header */
.tmp-app .tmp-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.tmp-app .tmp-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-size: 1.1rem; }
.tmp-app .tmp-brand small { color: var(--tmp-mute); font-size: .72rem; }
.tmp-app .tmp-logo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 34px; padding: 7px 6px; border-radius: 10px; background: var(--tmp-accent); }
.tmp-app .tmp-logo i { height: 6px; border-radius: 2px; background: var(--tmp-on-accent); opacity: .85; }
.tmp-app .tmp-logo i:nth-child(2) { opacity: .5; }
.tmp-app .tmp-nav { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--tmp-card); }
.tmp-app .tmp-nav button { padding: 8px 16px; color: var(--tmp-mute); transition: background .2s, color .2s; }
.tmp-app .tmp-nav button.on { background: var(--tmp-accent); color: var(--tmp-on-accent); font-weight: 600; }

/* buttons */
.tmp-app .tmp-btn { padding: 11px 20px; background: var(--tmp-accent); color: var(--tmp-on-accent); font-weight: 600; transition: transform .15s, filter .15s; }
.tmp-app .tmp-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.tmp-app .tmp-btn:disabled { opacity: .35; }
.tmp-app .tmp-ghost { padding: 9px 14px; border: 1px solid var(--tmp-line); color: var(--tmp-ink); transition: background .15s; }
.tmp-app .tmp-ghost:hover { background: var(--tmp-card); }
.tmp-app .tmp-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--tmp-card); }
.tmp-app .tmp-seg button { padding: 7px 14px; color: var(--tmp-mute); font-size: .92rem; transition: background .2s, color .2s; }
.tmp-app .tmp-seg button:hover { color: var(--tmp-ink); }
.tmp-app .tmp-seg button.on { background: var(--tmp-accent); color: var(--tmp-on-accent); font-weight: 600; }

/* dashboard */
.tmp-app .tmp-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: 20px; background: var(--tmp-card); border: 1px solid var(--tmp-line); }
.tmp-app .tmp-hero h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.2; margin-bottom: 6px; }
.tmp-app .tmp-hero p { color: var(--tmp-mute); max-width: 52ch; }
.tmp-app .tmp-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.tmp-app .tmp-card { padding: 16px 18px; border-radius: 16px; background: var(--tmp-card); }
.tmp-app .tmp-card span { display: block; color: var(--tmp-mute); font-size: .85rem; }
.tmp-app .tmp-card b { display: block; font-size: 1.8rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tmp-app .tmp-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tmp-app .tmp-level { padding: 18px; border-radius: 18px; background: var(--tmp-card); }
.tmp-app .tmp-level-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.tmp-app .tmp-level h3 { font-size: 1.15rem; }
.tmp-app .tmp-level-head p { color: var(--tmp-mute); font-size: .85rem; }
.tmp-app .tmp-pill { flex: none; padding: 3px 10px; border-radius: 99px; font-size: .75rem; border: 1px solid var(--tmp-line); color: var(--tmp-mute); white-space: nowrap; }
.tmp-app .tmp-prog { height: 6px; border-radius: 99px; background: var(--tmp-line); overflow: hidden; }
.tmp-app .tmp-prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--tmp-accent); transition: width .4s ease; }
.tmp-app .tmp-lesson-list { display: grid; gap: 6px; margin-top: 14px; }
.tmp-app .tmp-lrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; text-align: left; background: color-mix(in srgb, var(--tmp-ink) 5%, transparent); transition: background .15s; }
.tmp-app .tmp-lrow:hover:not(:disabled) { background: color-mix(in srgb, var(--tmp-accent) 22%, transparent); }
.tmp-app .tmp-lrow.lock { opacity: .45; }
.tmp-app .tmp-num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 8px; font-size: .78rem; background: var(--tmp-line); }
.tmp-app .tmp-lrow.done .tmp-num { background: var(--tmp-ok); color: var(--tmp-bg); }
.tmp-app .tmp-lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.tmp-app .tmp-lm { flex: none; color: var(--tmp-mute); font-size: .78rem; }
.tmp-app .tmp-recent { margin-top: 14px; padding: 18px; border-radius: 18px; background: var(--tmp-card); }
.tmp-app .tmp-recent h3 { font-size: 1.05rem; margin-bottom: 8px; }
.tmp-app .tmp-hrow { display: grid; grid-template-columns: 1fr 90px 60px 90px; gap: 10px; padding: 9px 0; border-top: 1px solid var(--tmp-line); font-size: .92rem; }
.tmp-app .tmp-hrow .tmp-ok { color: var(--tmp-ok); } .tmp-app .tmp-hrow .tmp-no { color: var(--tmp-bad); }
.tmp-app .tmp-empty { color: var(--tmp-mute); font-size: .9rem; }

/* practice */
.tmp-app .tmp-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.tmp-app .tmp-lessons { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 14px; scrollbar-width: thin; }
.tmp-app .tmp-chip { flex: none; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--tmp-line); font-size: .85rem; color: var(--tmp-mute); transition: background .15s, color .15s; }
.tmp-app .tmp-chip:hover:not(:disabled) { color: var(--tmp-ink); background: var(--tmp-card); }
.tmp-app .tmp-chip.on { background: var(--tmp-ink); color: var(--tmp-bg); border-color: transparent; font-weight: 600; }
.tmp-app .tmp-chip.done::after { content: " \2713"; color: var(--tmp-ok); }
.tmp-app .tmp-chip.on.done::after { color: inherit; }
.tmp-app .tmp-chip.lock { opacity: .45; }
.tmp-app .tmp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; align-items: start; }
.tmp-app .tmp-timerrow { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.tmp-app .tmp-time { min-width: 64px; font: 700 1.6rem/1 var(--tmp-mono); font-variant-numeric: tabular-nums; }
.tmp-app .tmp-time.low { color: var(--tmp-bad); }
.tmp-app .tmp-timerrow .tmp-prog { flex: 1; }
.tmp-app .tmp-goal { color: var(--tmp-mute); font-size: .82rem; white-space: nowrap; }
.tmp-app .tmp-bar { position: relative; height: calc(var(--tmp-lh) * 3 + 36px); padding: 18px 24px; overflow: hidden; border-radius: 18px; background: var(--tmp-bar); cursor: text; scroll-behavior: smooth; box-shadow: inset 0 0 0 1px var(--tmp-line); }
.tmp-app .tmp-words { position: relative; font: 500 1.5rem/var(--tmp-lh) var(--tmp-mono); color: var(--tmp-text); word-break: keep-all; user-select: none; -webkit-user-select: none; }
.tmp-app .tmp-words .w { display: inline-block; margin-right: .62em; }
.tmp-app .tmp-words .w .ok { color: var(--tmp-ok); }
.tmp-app .tmp-words .w .bad { color: var(--tmp-bad); background: color-mix(in srgb, var(--tmp-bad) 18%, transparent); border-radius: 3px; }
.tmp-app .tmp-words .w .x { color: var(--tmp-bad); opacity: .75; }
.tmp-app .tmp-words .w.err { box-shadow: inset 0 -2px 0 var(--tmp-bad); }
.tmp-app .tmp-caret { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 2px; background: var(--tmp-caret); width: 3px; height: var(--ch, 1.6rem); transition: transform .1s ease-out, width .1s; }
.tmp-app .tmp-caret.idle { animation: tmp-blink 1.1s steps(1) infinite; }
.tmp-app[data-caret="block"] .tmp-caret { width: var(--cw, 12px); opacity: .45; }
.tmp-app[data-caret="underline"] .tmp-caret { width: var(--cw, 12px); height: 3px; margin-top: calc(var(--ch, 1.6rem) - 2px); }
@keyframes tmp-blink { 50% { opacity: 0; } }
.tmp-app .tmp-input {
  display: block; width: 100%; margin: 12px 0 0; padding: 16px 20px; font: 500 1.3rem var(--tmp-mono); color: var(--tmp-ink);
  background: var(--tmp-card); border: 2px solid var(--tmp-line); border-radius: 16px; box-shadow: none; outline: 0; transition: border-color .2s;
}
.tmp-app .tmp-input:focus { border-color: var(--tmp-accent); }
.tmp-app .tmp-input::placeholder { color: var(--tmp-mute); font: 400 .95rem system-ui, sans-serif; }
.tmp-app .tmp-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tmp-app .tmp-hint { margin-left: auto; color: var(--tmp-mute); font-size: .82rem; }
.tmp-app .tmp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tmp-app .tmp-stat { padding: 12px 14px; border-radius: 14px; background: var(--tmp-card); }
.tmp-app .tmp-stat span { display: block; color: var(--tmp-mute); font-size: .74rem; }
.tmp-app .tmp-stat b { display: block; font: 700 1.35rem/1.3 var(--tmp-mono); font-variant-numeric: tabular-nums; }
.tmp-app .tmp-stat.tmp-big { grid-column: 1 / -1; background: var(--tmp-accent); color: var(--tmp-on-accent); }
.tmp-app .tmp-stat.tmp-big span { color: inherit; opacity: .75; }
.tmp-app .tmp-stat.tmp-big b { font-size: 2.6rem; line-height: 1.1; }

/* customize drawer */
.tmp-app .tmp-drawer { position: absolute; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, .35); animation: tmp-fade .2s ease; }
.tmp-app .tmp-drawer-in { width: min(340px, 100%); height: 100%; overflow-y: auto; padding: 20px; background: var(--tmp-bg); border-left: 1px solid var(--tmp-line); animation: tmp-slide .25s ease; }
.tmp-app .tmp-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 1.1rem; }
.tmp-app .tmp-label { margin: 18px 0 8px; color: var(--tmp-mute); font-size: .85rem; }
.tmp-app .tmp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tmp-app .tmp-preset { position: relative; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 8px 10px; border: 2px solid var(--tmp-line); }
.tmp-app .tmp-preset.on { border-color: var(--tmp-accent); }
.tmp-app .tmp-preset i { width: 12px; height: 12px; border-radius: 50%; }
.tmp-app .tmp-preset em { margin-left: auto; font-style: normal; font-size: .8rem; font-weight: 600; }
.tmp-app .tmp-colorrow { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: .92rem; cursor: pointer; }
.tmp-app .tmp-colorrow input { width: 46px; height: 30px; padding: 0; border: 2px solid var(--tmp-line); border-radius: 8px; background: none; cursor: pointer; }
.tmp-app .tmp-reset { margin-top: 20px; width: 100%; }

/* result modal */
.tmp-app .tmp-modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 14px; background: rgba(0, 0, 0, .55); animation: tmp-fade .2s ease; }
.tmp-app .tmp-modal-in { width: min(640px, 100%); padding: 24px; border-radius: 22px; background: var(--tmp-bg); border: 1px solid var(--tmp-line); animation: tmp-pop .28s cubic-bezier(.2, .9, .3, 1.2); }
.tmp-app .tmp-res-top { display: flex; align-items: center; gap: 20px; padding-bottom: 18px; }
.tmp-app .tmp-res-top h3 { font-size: 1.5rem; }
.tmp-app .tmp-res-top p { margin-top: 4px; color: var(--tmp-mute); }
.tmp-app .tmp-ring { position: relative; flex: none; width: 112px; height: 112px; display: grid; place-content: center; text-align: center; }
.tmp-app .tmp-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tmp-app .tmp-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.tmp-app .tmp-ring .bg { stroke: var(--tmp-line); }
.tmp-app .tmp-ring .fg { stroke: var(--tmp-ok); }
.tmp-app .tmp-res-top.fail .tmp-ring .fg { stroke: var(--tmp-bad); }
.tmp-app .tmp-ring b { font-size: 2rem; line-height: 1; }
.tmp-app .tmp-ring span { font-size: .75rem; color: var(--tmp-mute); }
.tmp-app .tmp-stars { color: #fbbf24; font-size: 1.3rem; letter-spacing: 2px; }
.tmp-app .tmp-stars s { text-decoration: none; opacity: .25; }
.tmp-app .tmp-res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tmp-app .tmp-res-grid div { padding: 10px 12px; border-radius: 12px; background: var(--tmp-card); }
.tmp-app .tmp-res-grid span { display: block; color: var(--tmp-mute); font-size: .74rem; }
.tmp-app .tmp-res-grid b { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.tmp-app .tmp-modal h4 { margin: 18px 0 8px; font-size: .95rem; }
.tmp-app .tmp-chart { width: 100%; height: 90px; border-radius: 12px; background: var(--tmp-card); }
.tmp-app .tmp-chart .fill { fill: color-mix(in srgb, var(--tmp-accent) 25%, transparent); stroke: none; }
.tmp-app .tmp-chart .line { fill: none; stroke: var(--tmp-accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tmp-app .tmp-missed { display: flex; flex-wrap: wrap; gap: 8px; }
.tmp-app .tmp-missed span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: var(--tmp-card); font-size: .85rem; color: var(--tmp-mute); }
.tmp-app .tmp-missed b { font-family: var(--tmp-mono); color: var(--tmp-bad); font-size: 1rem; }
.tmp-app .tmp-res-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.tmp-app .tmp-lockmsg { flex-basis: 100%; color: var(--tmp-mute); font-size: .85rem; }

@keyframes tmp-fade { from { opacity: 0; } }
@keyframes tmp-slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes tmp-pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }

@media (max-width: 900px) {
  .tmp-app .tmp-cards { grid-template-columns: repeat(2, 1fr); }
  .tmp-app .tmp-levels { grid-template-columns: 1fr; }
  .tmp-app .tmp-grid { grid-template-columns: 1fr; }
  .tmp-app .tmp-stats { grid-template-columns: repeat(4, 1fr); }
  .tmp-app .tmp-stat.tmp-big { grid-column: auto; }
}
@media (max-width: 560px) {
  .tmp-app { padding: 14px; border-radius: 18px; --tmp-lh: 2.3rem; }
  .tmp-app .tmp-words { font-size: 1.2rem; }
  .tmp-app .tmp-stats { grid-template-columns: repeat(2, 1fr); }
  .tmp-app .tmp-res-grid { grid-template-columns: repeat(2, 1fr); }
  .tmp-app .tmp-res-top { flex-direction: column; text-align: center; }
  .tmp-app .tmp-hrow { grid-template-columns: 1fr 70px 50px; } .tmp-app .tmp-hrow span:last-child { display: none; }
  .tmp-app .tmp-goal, .tmp-app .tmp-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tmp-app *, .tmp-app *::before, .tmp-app *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
