/* Тест на швидкість друку — стилі інструмента (кольори лише зі змінних site.css) */
.typ-top{flex-wrap:wrap;justify-content:flex-start}
.typ-top .tool-top-r{margin-left:auto}

/* Показники над текстом — щоб час і швидкість було видно під час друку */
.typ-stats{display:grid;grid-template-columns:repeat(4,1fr)}
.typ-stats div{min-width:0}
.typ-stats dd{font-size:26px;line-height:1.2;font-weight:700;letter-spacing:-.01em}
.typ-main dd{color:var(--acc)}

/* Текст і прозоре поле введення поверх нього */
.typ-box{position:relative;margin-top:12px;padding:22px 24px 18px;border-radius:18px;background:var(--soft);cursor:text;overflow:hidden;transition:box-shadow .15s}
.typ-box.is-focus{box-shadow:inset 0 0 0 2px var(--acc)}
.typ-progress{position:absolute;left:0;right:0;top:0;height:4px;background:var(--line)}
.typ-progress i{display:block;height:100%;background:linear-gradient(90deg,var(--acc),var(--acc2));transform-origin:left center}
.typ-text{position:relative;height:5.25em;overflow:hidden;font-size:22px;line-height:1.75;color:var(--mut);color:color-mix(in srgb,var(--mut) 55%,#fff);white-space:pre-wrap;overflow-wrap:break-word;user-select:none;-webkit-user-select:none;scroll-behavior:smooth}
.typ-text .ok{color:var(--ink)}
.typ-text .bad{color:var(--bad);background:#FEE2E2;border-radius:3px}
.typ-text .cur{box-shadow:-2px 0 0 var(--acc)}
.typ-box.is-focus .typ-text .cur{animation:typ-caret 1s steps(1) infinite}
@keyframes typ-caret{50%{box-shadow:-2px 0 0 transparent}}
.typ-input{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;resize:none;opacity:0;pointer-events:none;font-size:16px;color:transparent;background:transparent;caret-color:transparent}
.typ-hint{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
.typ-hint-pill{display:inline-flex;align-items:center;gap:8px;max-width:calc(100% - 24px);padding:10px 16px;border-radius:999px;line-height:1.35;background:var(--ink);color:#fff;font-size:14px;font-weight:600;box-shadow:0 12px 30px -10px rgba(15,18,34,.45)}
.typ-box.is-focus .typ-hint,.typ[data-state=done] .typ-hint{display:none}
.typ[data-state=done] .typ-box{cursor:default}

/* Рядок під текстом: рекорд і «Інший текст» */
.typ-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.typ-best{font-size:14px;color:var(--mut);min-width:0}
.typ-new{height:40px;padding:0 16px;font-size:14px;flex:none}

/* Результат */
.typ-result{margin-top:12px;padding:18px;border-radius:18px;border:1px solid var(--line);background:linear-gradient(135deg,var(--acc-l),#fff)}
.typ-result[hidden]{display:none}
.typ-res-main{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px}
.typ-res-num{font-size:52px;font-weight:700;line-height:1;letter-spacing:-.03em;color:var(--acc);font-variant-numeric:tabular-nums}
.typ-res-unit{font-weight:600;color:var(--mut)}
.typ-res-best{align-self:center}
.typ-result .actions{margin-top:14px;flex-wrap:wrap}
.typ-result .actions .btn{height:46px;padding:0 18px}
.typ-result .actions .btn.primary{flex:none}
.typ-result .actions .btn[hidden]{display:none}
.typ-toast{margin-top:10px;font-size:13px;font-weight:600;color:var(--acc)}
.typ-toast[hidden]{display:none}
.typ .diag{margin-top:12px}

/* Стани */
.typ[data-state=run] .status i{background:var(--acc);box-shadow:0 0 0 4px var(--acc-l)}
.typ[data-state=layout] .status i{background:var(--warn)}
.typ[data-state=layout] .diag{background:#FFF7E6}
.typ[data-state=layout] .diag-ic{color:var(--warn)}

@media (max-width:760px){
  .typ-top .tool-top-r{margin-left:0}
  .typ-stats{gap:6px}
  .typ-stats div{padding:8px 10px}
  .typ-stats dd{font-size:20px}
  .typ-box{padding:18px 14px 12px;border-radius:16px}
  .typ-text{font-size:18px}
  .typ-hint-pill{font-size:13px;padding:9px 14px;border-radius:14px}
  .typ-bar{flex-wrap:wrap}
  .typ-new{width:100%}
  .typ-res-num{font-size:44px}
  .typ-result .actions .btn,.typ-result .actions .btn.primary{flex:none;width:100%}
}
@media (prefers-reduced-motion:reduce){
  .typ-text{scroll-behavior:auto}
}
