/* TypingTutor.Online standalone typing tests v17.3.0 */
html { scroll-behavior: smooth; }
body { min-width: 0; background: var(--background, #f5f8fc); color: var(--text, #0f172a); }
.test-site-header { position: sticky; top: 0; z-index: 100; background: var(--surface, #fff); border-bottom: 1px solid var(--border-soft, #dbe4f0); }
.test-header-inner { width: min(1480px, calc(100% - 32px)); min-height: 82px; margin: auto; display: flex; align-items: center; gap: 24px; }
.test-logo { display: inline-flex; flex: 0 0 auto; }
.test-logo-stack { position: relative; display: block; width: clamp(190px, 20vw, 260px); }
.test-logo img { width: 100%; height: auto; display: block; }
.test-logo-dark { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
html[data-theme="dark"] .test-logo-light { opacity: 0; }
html[data-theme="dark"] .test-logo-dark { opacity: 1; }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .test-logo-light { opacity: 0; } html[data-theme="system"] .test-logo-dark { opacity: 1; } }
.test-nav { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.test-nav a, #themeButton { min-height: 43px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; color: var(--text, #0f172a); background: transparent; font-weight: 750; text-decoration: none; cursor: pointer; }
.test-nav a:hover, .test-nav a[aria-current="page"] { color: #fff; background: var(--primary, #2563eb); }
#themeButton { color: #fff; background: var(--primary, #2563eb); }
.test-page-shell { width: min(1420px, calc(100% - 32px)); margin: 24px auto 56px; }
.test-breadcrumbs { margin-bottom: 14px; color: var(--text-light, #64748b); font-size: 13px; }
.test-breadcrumbs a { color: var(--primary, #2563eb); text-decoration: none; }
.test-hero { padding: clamp(24px, 4vw, 42px); background: var(--surface, #fff); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 24px; box-shadow: var(--shadow-sm, 0 10px 30px rgba(15,23,42,.07)); }
.test-eyebrow { color: var(--primary, #2563eb); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.test-hero h1 { margin: 7px 0 10px; font-size: clamp(30px, 4vw, 50px); line-height: 1.08; }
.test-hero p { max-width: 920px; margin: 0; color: var(--text-light, #64748b); font-size: 16px; line-height: 1.75; }
.test-hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.test-hero-facts span { padding: 9px 12px; background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 10px; font-size: 12px; font-weight: 750; }
.typing-test-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; margin-top: 18px; align-items: start; }
.typing-test-card, .test-side-card, .test-content-card, .test-history-card, .tests-directory { background: var(--surface, #fff); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 20px; box-shadow: var(--shadow-sm, 0 10px 30px rgba(15,23,42,.06)); }
.typing-test-card { overflow: hidden; }
.test-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border-soft, #dbe4f0); }
.test-card-heading h2 { margin: 0; font-size: 20px; }
.test-card-heading p { margin: 4px 0 0; color: var(--text-light, #64748b); font-size: 12px; }
.test-status-pill { padding: 8px 11px; color: var(--primary, #2563eb); background: rgba(37,99,235,.09); border-radius: 999px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.test-setup, .test-results { padding: 28px; text-align: center; }
.test-setup h2, .test-results h2 { margin: 0 0 8px; font-size: 28px; }
.test-setup p, .test-results p { margin: 0 auto; max-width: 700px; color: var(--text-light, #64748b); line-height: 1.65; }
.test-custom-duration { width: min(420px, 100%); margin: 22px auto 0; text-align: left; }
.test-custom-duration label { display: block; margin-bottom: 7px; font-weight: 750; }
.test-custom-duration select { width: 100%; min-height: 46px; padding: 9px 12px; color: var(--text, #0f172a); background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 11px; }
.test-primary-button, .test-secondary-button, .test-danger-button { min-height: 46px; padding: 11px 20px; border-radius: 11px; font: inherit; font-weight: 800; cursor: pointer; }
.test-primary-button { color: #fff; background: var(--primary, #2563eb); border: 1px solid var(--primary, #2563eb); }
.test-secondary-button { color: var(--text, #0f172a); background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); }
.test-danger-button { color: #ef4444; background: transparent; border: 1px solid #ef4444; }
.test-setup .test-primary-button { margin-top: 22px; min-width: 210px; }
.test-live-stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; padding: 14px; border-bottom: 1px solid var(--border-soft, #dbe4f0); }
.test-live-stat { min-width: 0; padding: 12px 8px; background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 12px; text-align: center; }
.test-live-stat span { display: block; margin-bottom: 5px; color: var(--text-light, #64748b); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.test-live-stat strong { color: var(--primary, #2563eb); font-size: clamp(18px, 2vw, 25px); }
.test-text-wrap { padding: 18px; }
#lessonText.test-text { height: clamp(260px, 31vw, 430px); overflow: auto; padding: 22px; outline: 0; color: var(--text, #0f172a); background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 16px; font-family: "JetBrains Mono", monospace; font-size: clamp(25px, 2.5vw, 38px); font-weight: 550; line-height: 1.7; letter-spacing: .015em; word-break: normal; }
.test-character { display: inline; }
.test-character.is-future { color: var(--text, #1e293b); }
.test-character.is-correct { color: #22a35a; }
.test-character.is-wrong { color: #fff; background: #e11d48; border-radius: 3px; }
.test-character.is-current { color: #fff; background: var(--primary, #2563eb); border-radius: .15em; box-shadow: 0 0 0 .08em rgba(37,99,235,.24); }
.test-progress-track { height: 7px; margin-top: 14px; overflow: hidden; background: rgba(148,163,184,.22); border-radius: 999px; }
.test-progress-fill { width: 0; height: 100%; background: linear-gradient(90deg,#2563eb,#22c55e); transition: width .1s linear; }
.test-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.test-status-message { margin: 12px 0 0; color: var(--text-light, #64748b); font-size: 12px; text-align: center; }
.test-keyboard-card { margin: 0 18px 20px; padding: 14px; background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 18px; overflow: hidden; }
#testKeyboardContainer { width: 100%; max-width: none; margin: 0; padding: 10px; box-shadow: none; background: transparent; }
#testKeyboardContainer .key { min-width: 0; height: clamp(42px, 4.5vw, 62px); }
.test-side-card { padding: 18px; }
.test-side-card + .test-side-card { margin-top: 12px; }
.test-side-card h2 { margin: 0 0 8px; font-size: 16px; }
.test-side-card strong { display: block; color: var(--primary, #2563eb); font-size: 23px; }
.test-side-card p { margin: 6px 0 0; color: var(--text-light, #64748b); font-size: 12px; line-height: 1.55; }
.test-result-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 22px 0; }
.test-result-grid div { padding: 15px; background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 13px; }
.test-result-grid span { display: block; margin-bottom: 6px; color: var(--text-light, #64748b); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.test-result-grid strong { color: var(--primary, #2563eb); font-size: 25px; }
.test-history-card, .test-content-card { margin-top: 18px; padding: clamp(20px, 3vw, 32px); }
.test-history-card h2, .test-content-card h2 { margin: 0 0 12px; }
.test-history-scroll { overflow-x: auto; }
.test-history-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.test-history-table th, .test-history-table td { padding: 12px; border-bottom: 1px solid var(--border-soft, #dbe4f0); text-align: left; font-size: 12px; }
.test-history-table th { color: var(--text-light, #64748b); text-transform: uppercase; font-size: 10px; }
.test-content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.test-content-grid article { padding: 18px; background: var(--surface-alt, #f8fafc); border-radius: 14px; }
.test-content-grid h3 { margin: 0 0 8px; font-size: 17px; }
.test-content-grid p, .test-content-grid li { color: var(--text-light, #64748b); line-height: 1.7; }
.test-content-grid ul { margin: 0; padding-left: 20px; }
.tests-directory { margin-top: 18px; padding: 24px; }
.tests-directory h2 { margin: 0 0 14px; }
.tests-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.test-link-card { display: block; padding: 17px; color: var(--text, #0f172a); background: var(--surface-alt, #f8fafc); border: 1px solid var(--border-soft, #dbe4f0); border-radius: 13px; text-decoration: none; }
.test-link-card:hover { border-color: var(--primary, #2563eb); transform: translateY(-1px); }
.test-link-card strong { display: block; margin-bottom: 5px; }
.test-link-card span { color: var(--text-light, #64748b); font-size: 11px; }
.test-footer { padding: 28px 16px; color: var(--text-light, #64748b); text-align: center; font-size: 12px; }
.mobile-typing-input { position: fixed; left: -9999px; opacity: 0; }
.mobile-keyboard-button { display: none; }
html[data-theme="dark"] body { background: #07101f; }
html[data-theme="dark"] .test-site-header, html[data-theme="dark"] .test-hero, html[data-theme="dark"] .typing-test-card, html[data-theme="dark"] .test-side-card, html[data-theme="dark"] .test-content-card, html[data-theme="dark"] .test-history-card, html[data-theme="dark"] .tests-directory { background: #101b2e; border-color: #40516a; }
html[data-theme="dark"] .test-live-stat, html[data-theme="dark"] #lessonText.test-text, html[data-theme="dark"] .test-keyboard-card, html[data-theme="dark"] .test-result-grid div, html[data-theme="dark"] .test-content-grid article, html[data-theme="dark"] .test-link-card, html[data-theme="dark"] .test-hero-facts span { background: #16243a; border-color: #40516a; }
html[data-theme="dark"] .test-character.is-future { color: #e2e8f0; }
html[data-theme="dark"] .test-character.is-correct { color: #72829a; }
html[data-theme="dark"] .test-secondary-button { color: #e2e8f0; background: #16243a; border-color: #40516a; }
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] body { background: #07101f; }
    html[data-theme="system"] .test-site-header,
    html[data-theme="system"] .test-hero,
    html[data-theme="system"] .typing-test-card,
    html[data-theme="system"] .test-side-card,
    html[data-theme="system"] .test-content-card,
    html[data-theme="system"] .test-history-card,
    html[data-theme="system"] .tests-directory { background: #101b2e; border-color: #40516a; }
    html[data-theme="system"] .test-live-stat,
    html[data-theme="system"] #lessonText.test-text,
    html[data-theme="system"] .test-keyboard-card,
    html[data-theme="system"] .test-result-grid div,
    html[data-theme="system"] .test-content-grid article,
    html[data-theme="system"] .test-link-card,
    html[data-theme="system"] .test-hero-facts span { background: #16243a; border-color: #40516a; }
    html[data-theme="system"] .test-character.is-future { color: #e2e8f0; }
    html[data-theme="system"] .test-character.is-correct { color: #72829a; }
    html[data-theme="system"] .test-secondary-button { color: #e2e8f0; background: #16243a; border-color: #40516a; }
}
@media (max-width: 980px) { .typing-test-layout { grid-template-columns: 1fr; } .test-side-area { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; } .test-side-card + .test-side-card { margin-top: 0; } .test-live-stats { grid-template-columns: repeat(3,minmax(0,1fr)); } .tests-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .test-header-inner { min-height: auto; padding: 12px 0; flex-wrap: wrap; } .test-nav { order: 3; width: 100%; overflow-x: auto; } .test-nav a { white-space: nowrap; } .test-live-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .test-result-grid, .test-content-grid { grid-template-columns: 1fr 1fr; } .test-keyboard-card { display: none; } .mobile-keyboard-button { display: inline-flex; } }
@media (max-width: 520px) { .test-page-shell, .test-header-inner { width: min(100% - 20px, 1420px); } .test-logo img { width: 190px; } .test-hero { border-radius: 18px; } .test-card-heading { align-items: flex-start; flex-direction: column; } .test-live-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .test-result-grid, .test-content-grid, .tests-grid, .test-side-area { grid-template-columns: 1fr; } #lessonText.test-text { height: 330px; padding: 15px; font-size: 25px; } .test-setup, .test-results { padding: 22px 15px; } }


/* ==========================================================
   TEST-FIRST RESPONSIVE VIEWPORT v17.4.7
   The interactive test now comes before long SEO copy. The
   dimensions below keep the test text, controls, and keyboard
   much closer together on desktops, laptops, and tablets.
========================================================== */

.test-page-shell {
    width: min(1500px, calc(100% - 24px));
    margin-top: 12px;
}

.test-breadcrumbs {
    margin-bottom: 8px;
}

.typing-test-layout {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
    gap: 12px;
    margin-top: 0;
}

.test-card-heading {
    min-height: 58px;
    padding: 11px 16px;
}

.test-card-heading h1 {
    margin: 0;
    font-size: clamp(20px, 1.75vw, 27px);
    line-height: 1.15;
}

.test-card-heading p {
    margin-top: 3px;
    line-height: 1.35;
}

.test-status-pill {
    padding: 7px 10px;
}

.test-live-stats {
    gap: 6px;
    padding: 9px 10px;
}

.test-live-stat {
    padding: 8px 6px;
    border-radius: 10px;
}

.test-live-stat span {
    margin-bottom: 3px;
}

.test-live-stat strong {
    font-size: clamp(17px, 1.6vw, 22px);
}

.test-text-wrap {
    padding: 10px 12px 8px;
}

#lessonText.test-text {
    height: clamp(210px, 29vh, 320px);
    padding: clamp(14px, 1.5vw, 20px);
    font-size: clamp(23px, 2.05vw, 32px);
    line-height: 1.58;
}

.test-progress-track {
    height: 5px;
    margin-top: 9px;
}

.test-controls {
    gap: 8px;
    margin-top: 9px;
}

.test-primary-button,
.test-secondary-button,
.test-danger-button {
    min-height: 40px;
    padding: 8px 16px;
}

.test-status-message {
    min-height: 16px;
    margin-top: 7px;
}

.test-keyboard-card {
    margin: 0 12px 12px;
    padding: 7px;
    border-radius: 14px;
}

#testKeyboardContainer {
    padding: 2px;
}

#testKeyboardContainer .keyboard-row {
    gap: clamp(3px, .42vw, 7px);
}

#testKeyboardContainer .key {
    min-width: 0 !important;
    height: clamp(36px, 5.1vh, 52px) !important;
    padding-bottom: 6px;
    border-radius: 8px;
}

#testKeyboardContainer .key-primary {
    font-size: clamp(10px, .95vw, 15px);
}

#testKeyboardContainer .key-secondary {
    top: 5px;
    left: 5px;
    font-size: clamp(7px, .68vw, 10px);
}

.test-side-card {
    padding: 14px;
}

.test-side-card + .test-side-card {
    margin-top: 9px;
}

.test-side-card h2 {
    font-size: 15px;
}

.test-side-card strong {
    font-size: 20px;
}

/* SEO/GEO introduction remains indexable but no longer pushes the tool down. */
.test-seo-intro {
    margin-top: 18px;
    padding: clamp(18px, 2.4vw, 28px);
}

.test-seo-intro h2 {
    margin: 5px 0 8px;
    font-size: clamp(23px, 2.5vw, 34px);
    line-height: 1.15;
}

.test-seo-intro p {
    font-size: 14px;
    line-height: 1.65;
}

.test-seo-intro .test-hero-facts {
    margin-top: 14px;
}

/* Compact laptop mode: designed for browser content areas around 700–850px tall. */
@media (min-width: 981px) and (max-height: 900px) {
    .test-page-shell {
        margin-top: 8px;
    }

    .test-breadcrumbs {
        margin-bottom: 5px;
        font-size: 11px;
    }

    .test-card-heading {
        min-height: 50px;
        padding: 8px 13px;
    }

    .test-card-heading h1 {
        font-size: clamp(19px, 1.55vw, 24px);
    }

    .test-card-heading p {
        display: none;
    }

    .test-status-pill {
        padding: 6px 9px;
        font-size: 10px;
    }

    .test-live-stats {
        padding: 7px 8px;
    }

    .test-live-stat {
        padding: 6px 4px;
    }

    .test-live-stat strong {
        font-size: clamp(16px, 1.4vw, 20px);
    }

    .test-text-wrap {
        padding: 8px 10px 6px;
    }

    #lessonText.test-text {
        height: clamp(180px, 25vh, 235px);
        padding: 12px 15px;
        font-size: clamp(21px, 1.8vw, 28px);
        line-height: 1.48;
    }

    .test-controls {
        margin-top: 7px;
    }

    .test-primary-button,
    .test-secondary-button,
    .test-danger-button {
        min-height: 36px;
        padding: 6px 14px;
    }

    .test-status-message {
        margin: 4px 0 0;
        min-height: 12px;
    }

    .test-keyboard-card {
        margin: 0 10px 9px;
        padding: 5px;
    }

    #testKeyboardContainer .key {
        height: clamp(32px, 4.35vh, 42px) !important;
        padding-bottom: 4px;
    }

    #testKeyboardContainer .key-primary {
        font-size: clamp(9px, .8vw, 13px);
    }

    #testKeyboardContainer .key-secondary {
        top: 4px;
        left: 4px;
        font-size: clamp(6px, .58vw, 9px);
    }
}

@media (max-width: 980px) {
    .typing-test-layout {
        grid-template-columns: 1fr;
    }

    .test-side-area {
        order: 2;
    }

    #lessonText.test-text {
        height: clamp(220px, 34vh, 320px);
    }

    #testKeyboardContainer .key {
        height: clamp(38px, 5.5vw, 50px) !important;
    }
}

@media (max-width: 760px) {
    .test-page-shell {
        width: min(100% - 16px, 1500px);
        margin-top: 8px;
    }

    .test-breadcrumbs {
        font-size: 11px;
    }

    .test-card-heading {
        min-height: auto;
        padding: 10px 12px;
    }

    .test-card-heading h1 {
        font-size: clamp(19px, 5.2vw, 25px);
    }

    .test-card-heading p,
    .test-status-pill {
        display: none;
    }

    .test-live-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #lessonText.test-text {
        height: clamp(250px, 43vh, 360px);
        font-size: clamp(22px, 5.8vw, 28px);
    }

    .test-seo-intro {
        margin-top: 14px;
    }
}

@media (max-width: 520px) {
    .test-live-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #lessonText.test-text {
        height: clamp(260px, 45vh, 350px);
    }

    .test-controls > button {
        flex: 1 1 125px;
    }
}


/* ==========================================================
   CUSTOM KEYS + CUSTOM TEXT TEST SETUP v17.4.8
========================================================== */
.test-custom-input {
    width: min(720px, 100%);
    margin: 20px auto 0;
    text-align: left;
}
.test-custom-input label {
    display: block;
    margin-bottom: 8px;
    color: var(--text, #0f172a);
    font-weight: 800;
}
.test-custom-input input,
.test-custom-input textarea {
    width: 100%;
    padding: 13px 15px;
    color: var(--text, #0f172a);
    background: var(--surface-alt, #f8fafc);
    border: 1px solid var(--border-soft, #dbe4f0);
    border-radius: 12px;
    outline: none;
    font: 600 16px/1.55 Inter, system-ui, sans-serif;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.test-custom-input textarea {
    min-height: 168px;
    resize: vertical;
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
}
.test-custom-input input:focus,
.test-custom-input textarea:focus {
    border-color: #2878ff;
    box-shadow: 0 0 0 4px rgba(40,120,255,.14);
}
.test-custom-input small,
.test-custom-text-meta {
    display: block;
    margin-top: 8px;
    color: var(--text-light, #64748b);
    font-size: 13px;
    line-height: 1.5;
}
.test-custom-text-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}
.test-custom-text-meta span { white-space: nowrap; font-weight: 700; }
.test-custom-input-error {
    width: min(720px, 100%);
    margin: 12px auto 0 !important;
    padding: 10px 13px;
    color: #b42318 !important;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: 10px;
    font-weight: 700;
    text-align: left;
}
html[data-theme="dark"] .test-custom-input input,
html[data-theme="dark"] .test-custom-input textarea {
    color: #eef4ff;
    background: #111c30;
    border-color: #334763;
}
html[data-theme="dark"] .test-custom-input-error {
    color: #fecaca !important;
    background: rgba(127,29,29,.35);
    border-color: rgba(248,113,113,.45);
}
@media (max-width: 620px) {
    .test-custom-text-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
    .test-custom-input textarea { min-height: 190px; }
}


a.test-primary-button { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; line-height:1; }


/* ==========================================================
   TEST CERTIFICATE RESULT STATUS v17.5.0
========================================================== */
.test-certificate-note {
    margin: 4px auto 2px !important;
    padding: 10px 14px;
    max-width: 760px !important;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: 12px;
    color: #1e40af !important;
    background: #eff6ff;
    font-size: 13px;
    font-weight: 800;
}
html[data-theme="dark"] .test-certificate-note {
    color: #bfdbfe !important;
    background: rgba(30, 64, 175, .24);
    border-color: rgba(96, 165, 250, .34);
}
@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .test-certificate-note {
        color: #bfdbfe !important;
        background: rgba(30, 64, 175, .24);
        border-color: rgba(96, 165, 250, .34);
    }
}
