/* ---- css/fonts.css ---- */
/* Self-hosted variable fonts — no third-party font request. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/sora-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/sora-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* ---- vendor/bootstrap.purged.css ---- */
@charset "UTF-8";/*!
 * Bootstrap  v5.3.3 (https://getbootstrap.com/)
 * Copyright 2011-2024 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13,110,253;--bs-secondary-rgb:108,117,125;--bs-success-rgb:25,135,84;--bs-info-rgb:13,202,240;--bs-warning-rgb:255,193,7;--bs-danger-rgb:220,53,69;--bs-light-rgb:248,249,250;--bs-dark-rgb:33,37,41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255,255,255;--bs-black-rgb:0,0,0;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33,37,41;--bs-body-bg:#fff;--bs-body-bg-rgb:255,255,255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0,0,0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33,37,41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233,236,239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33,37,41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248,249,250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13,110,253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10,88,202;--bs-code-color:#d63384;--bs-highlight-color:#212529;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}.h1,.h2,.h3,h1,h2,h3{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color)}.h1,h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){.h1,h1{font-size:2.5rem}}.h2,h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.h2,h2{font-size:2rem}}.h3,h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){.h3,h3{font-size:1.75rem}}p{margin-top:0;margin-bottom:1rem}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}b,strong{font-weight:bolder}.small,small{font-size:.875em}a{color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1));text-decoration:underline}a:hover{--bs-link-color-rgb:var(--bs-link-hover-color-rgb)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd{font-family:var(--bs-font-monospace);font-size:1em}code{font-size:.875em;color:var(--bs-code-color);word-wrap:break-word}a>code{color:inherit}kbd{padding:.1875rem .375rem;font-size:.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:.25rem}kbd kbd{padding:0;font-size:1em}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none!important}[type=button],[type=reset],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}::file-selector-button{font:inherit;-webkit-appearance:button}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}.container{--bs-gutter-x:1.5rem;--bs-gutter-y:0;width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}@media (min-width:1400px){.container{max-width:1320px}}:root{--bs-breakpoint-xs:0;--bs-breakpoint-sm:576px;--bs-breakpoint-md:768px;--bs-breakpoint-lg:992px;--bs-breakpoint-xl:1200px;--bs-breakpoint-xxl:1400px}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-.5 * var(--bs-gutter-x));margin-left:calc(-.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}.table{--bs-table-color-type:initial;--bs-table-bg-type:initial;--bs-table-color-state:initial;--bs-table-bg-state:initial;--bs-table-color:var(--bs-emphasis-color);--bs-table-bg:var(--bs-body-bg);--bs-table-border-color:var(--bs-border-color);--bs-table-accent-bg:transparent;--bs-table-striped-color:var(--bs-emphasis-color);--bs-table-striped-bg:rgba(var(--bs-emphasis-color-rgb), 0.05);--bs-table-active-color:var(--bs-emphasis-color);--bs-table-active-bg:rgba(var(--bs-emphasis-color-rgb), 0.1);--bs-table-hover-color:var(--bs-emphasis-color);--bs-table-hover-bg:rgba(var(--bs-emphasis-color-rgb), 0.075);width:100%;margin-bottom:1rem;vertical-align:top;border-color:var(--bs-table-border-color)}.table>:not(caption)>*>*{padding:.5rem .5rem;color:var(--bs-table-color-state,var(--bs-table-color-type,var(--bs-table-color)));background-color:var(--bs-table-bg);border-bottom-width:var(--bs-border-width);box-shadow:inset 0 0 0 9999px var(--bs-table-bg-state,var(--bs-table-bg-type,var(--bs-table-accent-bg)))}.btn{--bs-btn-padding-x:0.75rem;--bs-btn-padding-y:0.375rem;--bs-btn-font-family: ;--bs-btn-font-size:1rem;--bs-btn-font-weight:400;--bs-btn-line-height:1.5;--bs-btn-color:var(--bs-body-color);--bs-btn-bg:transparent;--bs-btn-border-width:var(--bs-border-width);--bs-btn-border-color:transparent;--bs-btn-border-radius:var(--bs-border-radius);--bs-btn-hover-border-color:transparent;--bs-btn-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.15),0 1px 1px rgba(0, 0, 0, 0.075);--bs-btn-disabled-opacity:0.65;--bs-btn-focus-box-shadow:0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);display:inline-block;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x);font-family:var(--bs-btn-font-family);font-size:var(--bs-btn-font-size);font-weight:var(--bs-btn-font-weight);line-height:var(--bs-btn-line-height);color:var(--bs-btn-color);text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color);border-radius:var(--bs-btn-border-radius);background-color:var(--bs-btn-bg);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color)}.btn:focus-visible{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn.active,.btn.show,.btn:first-child:active,:not(.btn-check)+.btn:active{color:var(--bs-btn-active-color);background-color:var(--bs-btn-active-bg);border-color:var(--bs-btn-active-border-color)}.btn.active:focus-visible,.btn.show:focus-visible,.btn:first-child:active:focus-visible,:not(.btn-check)+.btn:active:focus-visible{box-shadow:var(--bs-btn-focus-box-shadow)}.btn:disabled{color:var(--bs-btn-disabled-color);pointer-events:none;background-color:var(--bs-btn-disabled-bg);border-color:var(--bs-btn-disabled-border-color);opacity:var(--bs-btn-disabled-opacity)}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.nav{--bs-nav-link-padding-x:1rem;--bs-nav-link-padding-y:0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color:var(--bs-link-color);--bs-nav-link-hover-color:var(--bs-link-hover-color);--bs-nav-link-disabled-color:var(--bs-secondary-color);display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.card{--bs-card-spacer-y:1rem;--bs-card-spacer-x:1rem;--bs-card-title-spacer-y:0.5rem;--bs-card-title-color: ;--bs-card-subtitle-color: ;--bs-card-border-width:var(--bs-border-width);--bs-card-border-color:var(--bs-border-color-translucent);--bs-card-border-radius:var(--bs-border-radius);--bs-card-box-shadow: ;--bs-card-inner-border-radius:calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-card-cap-padding-y:0.5rem;--bs-card-cap-padding-x:1rem;--bs-card-cap-bg:rgba(var(--bs-body-color-rgb), 0.03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg:var(--bs-body-bg);--bs-card-img-overlay-padding:1rem;--bs-card-group-margin:0.75rem;position:relative;display:flex;flex-direction:column;min-width:0;height:var(--bs-card-height);color:var(--bs-body-color);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{--bs-progress-height:1rem;--bs-progress-font-size:0.75rem;--bs-progress-bg:var(--bs-secondary-bg);--bs-progress-border-radius:var(--bs-border-radius);--bs-progress-box-shadow:var(--bs-box-shadow-inset);--bs-progress-bar-color:#fff;--bs-progress-bar-bg:#0d6efd;--bs-progress-bar-transition:width 0.6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.toast{--bs-toast-zindex:1090;--bs-toast-padding-x:0.75rem;--bs-toast-padding-y:0.5rem;--bs-toast-spacing:1.5rem;--bs-toast-max-width:350px;--bs-toast-font-size:0.875rem;--bs-toast-color: ;--bs-toast-bg:rgba(var(--bs-body-bg-rgb), 0.85);--bs-toast-border-width:var(--bs-border-width);--bs-toast-border-color:var(--bs-border-color-translucent);--bs-toast-border-radius:var(--bs-border-radius);--bs-toast-box-shadow:var(--bs-box-shadow);--bs-toast-header-color:var(--bs-secondary-color);--bs-toast-header-bg:rgba(var(--bs-body-bg-rgb), 0.85);--bs-toast-header-border-color:var(--bs-border-color-translucent);width:var(--bs-toast-max-width);max-width:100%;font-size:var(--bs-toast-font-size);color:var(--bs-toast-color);pointer-events:auto;background-color:var(--bs-toast-bg);background-clip:padding-box;border:var(--bs-toast-border-width) solid var(--bs-toast-border-color);box-shadow:var(--bs-toast-box-shadow);border-radius:var(--bs-toast-border-radius)}.toast:not(.show){display:none}.modal{--bs-modal-zindex:1055;--bs-modal-width:500px;--bs-modal-padding:1rem;--bs-modal-margin:0.5rem;--bs-modal-color: ;--bs-modal-bg:var(--bs-body-bg);--bs-modal-border-color:var(--bs-border-color-translucent);--bs-modal-border-width:var(--bs-border-width);--bs-modal-border-radius:var(--bs-border-radius-lg);--bs-modal-box-shadow:var(--bs-box-shadow-sm);--bs-modal-inner-border-radius:calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));--bs-modal-header-padding-x:1rem;--bs-modal-header-padding-y:1rem;--bs-modal-header-padding:1rem 1rem;--bs-modal-header-border-color:var(--bs-border-color);--bs-modal-header-border-width:var(--bs-border-width);--bs-modal-title-line-height:1.5;--bs-modal-footer-gap:0.5rem;--bs-modal-footer-bg: ;--bs-modal-footer-border-color:var(--bs-border-color);--bs-modal-footer-border-width:var(--bs-border-width);position:fixed;top:0;left:0;z-index:var(--bs-modal-zindex);display:none;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;outline:0}.modal-dialog{position:relative;width:auto;margin:var(--bs-modal-margin);pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - var(--bs-modal-margin) * 2)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - var(--bs-modal-margin) * 2)}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;color:var(--bs-modal-color);pointer-events:auto;background-color:var(--bs-modal-bg);background-clip:padding-box;border:var(--bs-modal-border-width) solid var(--bs-modal-border-color);border-radius:var(--bs-modal-border-radius);outline:0}.modal-backdrop{--bs-backdrop-zindex:1050;--bs-backdrop-bg:#000;--bs-backdrop-opacity:0.5;position:fixed;top:0;left:0;z-index:var(--bs-backdrop-zindex);width:100vw;height:100vh;background-color:var(--bs-backdrop-bg)}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:var(--bs-backdrop-opacity)}.modal-body{position:relative;flex:1 1 auto;padding:var(--bs-modal-padding)}@media (min-width:576px){.modal{--bs-modal-margin:1.75rem;--bs-modal-box-shadow:var(--bs-box-shadow)}.modal-dialog{max-width:var(--bs-modal-width);margin-right:auto;margin-left:auto}}@media (min-width:992px){.modal-lg,.modal-xl{--bs-modal-width:800px}}@media (min-width:1200px){.modal-xl{--bs-modal-width:1140px}}@keyframes spinner-border{to{transform:rotate(360deg)}}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}.placeholder.btn::before{display:inline-block;content:""}@keyframes placeholder-glow{50%{opacity:.2}}@keyframes placeholder-wave{100%{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.visually-hidden{width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.visually-hidden:not(caption){position:absolute!important}.d-none{display:none!important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}@media (min-width:768px){.d-md-inline-flex{display:inline-flex!important}}

/* ---- css/style.css ---- */
/* =========================================================
   Typing Test — design tokens
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #080b11;
  --bg-deep: #05070b;
  --panel: rgba(15, 20, 28, 0.76);
  --panel-solid: #111722;
  --panel-inset: rgba(255, 255, 255, 0.035);
  --panel-hover: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f2f6f1;
  --text-soft: #c5cdc7;
  --muted: #78827d;
  --muted-strong: #929d96;
  --accent: #b6f36b;
  --accent-bright: #cbff8a;
  --accent-deep: #8bcf3d;
  --accent-soft: rgba(182, 243, 107, 0.11);
  --accent-glow: rgba(182, 243, 107, 0.25);
  --error: #ff7b7b;
  --error-soft: rgba(255, 123, 123, 0.12);
  --warning: #f6c96d;
  --shadow-panel: 0 24px 80px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-ui: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2eb;
  --bg-deep: #e7e7dd;
  --panel: rgba(255, 255, 252, 0.8);
  --panel-solid: #fbfbf7;
  --panel-inset: rgba(12, 25, 18, 0.035);
  --panel-hover: rgba(12, 25, 18, 0.06);
  --border: rgba(14, 26, 19, 0.1);
  --border-strong: rgba(14, 26, 19, 0.18);
  --text: #111b15;
  --text-soft: #34423a;
  --muted: #667169;
  --muted-strong: #4e5a52;
  --accent: #4e8f0b;
  --accent-bright: #3d7700;
  --accent-deep: #2f6200;
  --accent-soft: rgba(78, 143, 11, 0.1);
  --accent-glow: rgba(78, 143, 11, 0.18);
  --error: #d33f3f;
  --error-soft: rgba(211, 63, 63, 0.1);
  --warning: #a56c00;
  --shadow-panel: 0 24px 70px rgba(35, 45, 38, 0.12);
  --shadow-soft: 0 10px 30px rgba(35, 45, 38, 0.07);
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(182, 243, 107, 0.055), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

::selection {
  background: var(--accent);
  color: #071007;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

kbd {
  display: inline-flex;
  min-width: 23px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel-inset);
  color: var(--muted-strong);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
}

.container {
  width: 100%;
  max-width: 1120px;
  padding-inline: 24px;
}

/* =========================================================
   Ambient background
   ========================================================= */
.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.8;
  animation: drift 18s ease-in-out infinite alternate;
}

.ambient-orb--one {
  top: -26vw;
  left: 50%;
  width: 60vw;
  height: 50vw;
  min-width: 600px;
  min-height: 500px;
  background: radial-gradient(circle, rgba(182, 243, 107, 0.09), transparent 68%);
  transform: translateX(-50%);
}

.ambient-orb--two {
  right: -28vw;
  bottom: -24vw;
  width: 55vw;
  height: 55vw;
  min-width: 520px;
  min-height: 520px;
  background: radial-gradient(circle, rgba(89, 154, 255, 0.07), transparent 70%);
  animation-delay: -7s;
}

[data-theme="light"] .ambient-orb--one {
  background: radial-gradient(circle, rgba(78, 143, 11, 0.11), transparent 68%);
}

[data-theme="light"] .ambient-orb--two {
  background: radial-gradient(circle, rgba(47, 115, 170, 0.07), transparent 70%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse 75% 58% at 50% 16%, black 0%, transparent 78%);
}

[data-theme="light"] .ambient-grid {
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(20, 35, 25, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 35, 25, 0.07) 1px, transparent 1px);
}

@keyframes drift {
  from { transform: translate3d(-50%, 0, 0) scale(1); }
  to { transform: translate3d(-47%, 3%, 0) scale(1.06); }
}

.ambient-orb--two {
  animation-name: drift-two;
}

@keyframes drift-two {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4%, -4%, 0) scale(1.08); }
}

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  position: relative;
  z-index: 20;
  padding: 16px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(182, 243, 107, 0.24);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 18px rgba(182, 243, 107, 0.05);
  transition: transform 0.3s var(--ease-out), background 0.3s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-5deg) scale(1.04);
  background: rgba(182, 243, 107, 0.16);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-size: 20px;
}

.brand-name span {
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.topbar-hint {
  align-items: center;
  gap: 7px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.icon-btn {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-inset);
  color: var(--muted-strong);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s var(--ease-out);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0) scale(0.97);
}

.icon-btn:focus-visible,
.mode-btn:focus-visible,
.option-btn:focus-visible,
.btn-primary-custom:focus-visible,
.btn-ghost-custom:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn.is-on {
  border-color: rgba(182, 243, 107, 0.25);
  background: var(--accent-soft);
  color: var(--accent);
}

/* =========================================================
   Hero
   ========================================================= */
.app-main {
  flex: 1;
}

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 0 22px;
  text-align: center;
  animation: rise-in 0.3s var(--ease-out) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent-glow);
  animation: dot-pulse 2.8s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(42px, 4.4vw, 62px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.065em;
}

.hero-highlight {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.hero-highlight::after {
  position: absolute;
  right: 4%;
  bottom: 3px;
  left: 4%;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
  opacity: 0.55;
}

.hero-copy {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.6;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Test panel
   ========================================================= */
.test-panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: rise-in 0.75s 0.08s var(--ease-out) both;
}

.test-panel::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 55% 0% at 50% 0%, var(--accent-soft), transparent 70%);
  content: "";
  pointer-events: none;
}

.panel-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-inset);
}

.mode-btn {
  min-width: 64px;
  padding: 8px 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.is-active {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.option-list {
  display: flex;
  align-items: center;
  gap: 5px;
}

.option-btn {
  min-width: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.option-btn:hover {
  color: var(--text);
  background: var(--panel-inset);
}

.option-btn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.restart-btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.restart-btn.is-spinning svg {
  animation: spin 0.55s var(--ease-out);
}

@keyframes spin {
  to { transform: rotate(-360deg); }
}

/* Metrics */
.metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
  padding: 17px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-inset);
}

.metric {
  min-width: 0;
  padding: 0 22px;
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 35px;
}

.metric strong {
  color: var(--text);
  font-size: 29px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.metric:nth-child(2) strong {
  color: var(--accent);
}

.metric-best strong {
  color: var(--muted-strong);
  font-size: 24px;
}

.metric-unit {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Progress */
.progress-track {
  position: relative;
  z-index: 1;
  height: 3px;
  margin: 14px 6px 0;
  overflow: hidden;
  border-radius: 99px;
  background: var(--panel-inset);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.15s linear;
}

/* =========================================================
   Typing stage
   ========================================================= */
.typing-stage {
  position: relative;
  z-index: 1;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: text;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.typing-stage:focus-within {
  border-color: rgba(182, 243, 107, 0.16);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: inset 0 0 40px rgba(182, 243, 107, 0.025);
}

[data-theme="light"] .typing-stage:focus-within {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 40px rgba(78, 143, 11, 0.035);
}

.typing-viewport {
  height: 196px;
  padding: 22px 26px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
}

.typing-track {
  position: relative;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: -0.02em;
  transition: transform 0.24s var(--ease-out);
  will-change: transform;
}

.word {
  display: inline-block;
  margin-right: 0.62ch;
  border-radius: 3px;
  white-space: nowrap;
  vertical-align: top;
}

.letter {
  position: relative;
  color: var(--muted);
  transition: color 0.09s ease, opacity 0.09s ease;
}

.letter.correct {
  color: var(--text-soft);
}

.letter.incorrect {
  color: var(--error);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.letter.extra {
  color: var(--error);
  opacity: 0.8;
}

.word.skipped .letter:not(.correct):not(.incorrect) {
  color: var(--error);
  opacity: 0.34;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.word.current .letter:not(.correct):not(.incorrect) {
  color: var(--muted-strong);
}

.word.complete .letter.correct {
  color: var(--text-soft);
}

.caret {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: block;
  width: 2.5px;
  height: 1.18em;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  opacity: 0;
  transform: translate(0, 0);
  transition: transform 0.07s linear, height 0.1s ease;
  animation: caret-blink 1.1s step-end infinite;
  pointer-events: none;
}

.caret.is-visible {
  opacity: 1;
}

.caret.is-typing {
  animation: none;
}

@keyframes caret-blink {
  0%, 48% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Focus overlay */
.focus-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: inherit;
  background: rgba(8, 11, 17, 0.58);
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.24s ease, visibility 0.24s ease;
  pointer-events: none;
}

[data-theme="light"] .focus-overlay {
  background: rgba(248, 249, 243, 0.62);
}

.focus-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--panel-solid);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 500;
}

.focus-pill svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.typing-input {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  cursor: text;
  font-size: 16px;
  opacity: 0;
}

/* Footer */
.panel-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 31px;
  padding: 8px 7px 1px;
  color: var(--muted);
  font-size: 10px;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.status-dot.is-ready {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.status-dot.is-typing {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.status-dot.is-paused {
  background: var(--warning);
}

.status-dot.is-done {
  background: var(--accent);
}

.error-count {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.error-count.has-errors {
  color: var(--error);
}

.keyboard-hints {
  display: flex;
  align-items: center;
  gap: 9px;
}

.keyboard-hints span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hint-divider {
  width: 1px;
  height: 10px;
  background: var(--border-strong);
}

/* =========================================================
   Lower cards
   ========================================================= */
.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 14px;
  margin-top: 14px;
  animation: rise-in 0.75s 0.16s var(--ease-out) both;
}

.insight-card {
  position: relative;
  min-height: 174px;
  padding: 21px 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.insight-label {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.soft-badge {
  display: inline-flex;
  min-width: 28px;
  height: 23px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-inset);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.best-score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 17px;
}

.best-score strong {
  color: var(--accent);
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.best-score span {
  color: var(--muted);
  font-size: 10px;
}

.best-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.best-meter {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--panel-inset);
}

.best-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  transition: width 0.7s var(--ease-out);
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.history-empty {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  color: var(--muted);
}

.history-empty-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-inset);
  color: var(--muted);
}

.history-empty-icon svg {
  width: 16px;
  height: 16px;
}

.history-empty p {
  margin: 0;
  font-size: 10.5px;
}

.history-item {
  display: grid;
  grid-template-columns: 31px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  background: transparent;
  transition: background 0.2s ease;
  animation: history-in 0.35s var(--ease-out) both;
}

.history-item:hover {
  background: var(--panel-inset);
}

@keyframes history-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.history-rank {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-inset);
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 600;
}

.history-item:first-child .history-rank {
  border-color: rgba(182, 243, 107, 0.2);
  background: var(--accent-soft);
  color: var(--accent);
}

.history-mode {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.history-acc {
  color: var(--muted);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.history-wpm {
  min-width: 53px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.history-wpm span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Tip */
.tip-card {
  display: flex;
  flex-direction: column;
}

.tip-spark {
  color: var(--accent);
  font-size: 13px;
}

.tip-quote {
  margin: 22px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.025em;
}

.tip-source {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top: 44px;
  padding: 0 0 32px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.footer-inner p {
  margin: 0;
}

.footer-meta {
  letter-spacing: 0.03em;
}

.footer-meta span {
  padding: 0 4px;
  color: var(--border-strong);
}

/* =========================================================
   Results modal
   ========================================================= */
.modal-backdrop.show {
  opacity: 0.68;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.result-modal {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--panel-solid);
  color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
}

.result-modal .modal-body {
  position: relative;
  padding: 34px 36px 30px;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-inset);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.result-heading {
  text-align: center;
}

.result-heading .eyebrow {
  margin-bottom: 10px;
}

.result-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.055em;
}

.result-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.new-best-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 13px;
  padding: 6px 11px;
  border: 1px solid rgba(182, 243, 107, 0.22);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: badge-pop 0.55s var(--ease-out) both;
}

@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 25px;
}

.result-stat {
  padding: 15px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-inset);
}

.result-stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-stat strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.result-stat strong span {
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.result-stat--primary {
  border-color: rgba(182, 243, 107, 0.19);
  background: var(--accent-soft);
}

.result-stat--primary strong {
  color: var(--accent);
  font-size: 31px;
}

.chart-wrap {
  margin-top: 10px;
  padding: 15px 16px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-inset);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chart-head span:last-child {
  color: var(--muted-strong);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

#resultChart {
  display: block;
  width: 100%;
  height: 132px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
}

.btn-primary-custom,
.btn-ghost-custom {
  display: inline-flex;
  height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 19px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-primary-custom {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #0a1305;
  box-shadow: 0 8px 24px rgba(182, 243, 107, 0.14);
}

.btn-primary-custom:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(182, 243, 107, 0.2);
}

.btn-primary-custom:active,
.btn-ghost-custom:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary-custom svg {
  width: 15px;
  height: 15px;
}

.btn-ghost-custom {
  border: 1px solid var(--border);
  background: var(--panel-inset);
  color: var(--muted-strong);
}

.btn-ghost-custom:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  color: var(--text);
}

/* Toast */
.toast-message {
  position: fixed;
  z-index: 1080;
  bottom: 24px;
  left: 50%;
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

.toast-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991.98px) {
  .hero {
    padding-top: 20px;
  }

  .lower-grid {
    grid-template-columns: 1fr 1.3fr;
  }

  .tip-card {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .tip-quote {
    max-width: 600px;
    margin-top: 15px;
  }

  .tip-source {
    padding-top: 12px;
  }
}

@media (max-width: 767.98px) {
  .container {
    padding-inline: 17px;
  }

  .topbar {
    padding: 12px 0;
  }

  .hero {
    padding: 18px 0;
  }

  .hero h1 {
    font-size: clamp(38px, 9.5vw, 50px);
  }

  .hero-copy {
    max-width: 440px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.55;
  }

  .test-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .panel-toolbar {
    flex-wrap: wrap;
    gap: 9px;
  }

  .mode-switch {
    flex: 0 0 auto;
  }

  .mode-btn {
    min-width: 58px;
    padding: 7px 12px;
  }

  .option-list {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 2px;
  }

  .option-btn {
    flex: 1;
    max-width: 76px;
  }

  .restart-btn {
    margin-left: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 6px 0;
    margin-top: 13px;
  }

  .metric {
    padding: 11px 16px;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .metric strong {
    font-size: 25px;
  }

  .metric-best strong {
    font-size: 21px;
  }

  .typing-viewport {
    height: 166px;
    padding: 18px 18px;
  }

  .typing-track {
    font-size: 22px;
    line-height: 1.75;
  }

  .focus-pill {
    font-size: 11px;
  }

  .panel-footer {
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .error-count {
    margin-left: auto;
  }

  .keyboard-hints {
    display: none;
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }

  .insight-card {
    min-height: 0;
    padding: 18px 19px;
  }

  .best-card {
    min-height: 154px;
  }

  .history-card {
    min-height: 154px;
  }

  .tip-card {
    grid-column: auto;
  }

  .site-footer {
    margin-top: 32px;
    padding-bottom: 24px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .result-modal .modal-body {
    padding: 28px 20px 24px;
  }

  .result-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-top: 20px;
  }

  .result-stat--primary strong {
    font-size: 27px;
  }

  #resultChart {
    height: 112px;
  }

  .modal-dialog {
    margin: 12px;
  }
}

@media (max-width: 430px) {
  .brand-name {
    font-size: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .typing-track {
    font-size: 20px;
  }

  .typing-viewport {
    height: 150px;
  }

  .metric {
    padding: 10px 13px;
  }

  .result-actions {
    flex-direction: column-reverse;
  }

  .btn-primary-custom,
  .btn-ghost-custom {
    width: 100%;
  }
}

/* =========================================================
   Motion preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* =========================================================
   Typing Test 2.0 — extended features
   ========================================================= */
:root {
  --typing-size: 27px;
  --typing-size-mobile: 22px;
}

[data-typing-size="small"] {
  --typing-size: 23px;
  --typing-size-mobile: 19px;
}

[data-typing-size="large"] {
  --typing-size: 31px;
  --typing-size-mobile: 25px;
}

.typing-track {
  font-size: var(--typing-size);
}

@media (max-width: 767.98px) {
  .typing-track {
    font-size: var(--typing-size-mobile);
  }
}

/* Mode switch with five modes */
.mode-switch {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-switch::-webkit-scrollbar {
  display: none;
}

.mode-btn {
  min-width: 58px;
  white-space: nowrap;
}

/* Daily badge */
.daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(182, 243, 107, 0.22);
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.daily-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Panel metadata and links */
.test-meta {
  min-width: 0;
  max-width: 32%;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.insight-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.insight-link:hover {
  color: var(--accent);
}

/* Option note for custom mode */
.option-note {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

/* =========================================================
   Start / countdown overlay
   ========================================================= */
.focus-overlay.is-startable {
  z-index: 6;
  cursor: pointer;
  pointer-events: auto;
}

.focus-overlay.is-startable .focus-pill {
  border-color: rgba(182, 243, 107, 0.25);
  box-shadow: 0 0 0 5px rgba(182, 243, 107, 0.035), var(--shadow-soft);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease;
}

.focus-overlay.is-startable:hover .focus-pill {
  transform: translateY(-1px);
  border-color: rgba(182, 243, 107, 0.42);
}

.focus-overlay.is-counting {
  z-index: 6;
  pointer-events: none;
}

.focus-overlay.is-counting .focus-pill {
  display: none;
}

.countdown-number {
  display: none;
  color: var(--accent);
  font-size: clamp(72px, 10vw, 110px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.07em;
  text-shadow: 0 0 40px var(--accent-glow);
  animation: count-pop 0.75s var(--ease-out);
}

.focus-overlay.is-counting .countdown-number {
  display: block;
}

@keyframes count-pop {
  from { opacity: 0; transform: scale(0.72); }
  60% { opacity: 1; }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================
   Caret variants
   ========================================================= */
[data-caret-style="block"] .caret {
  border-radius: 2px;
  box-shadow: none;
}

[data-caret-style="block"] .caret.is-visible {
  animation: caret-blink-block 1.1s step-end infinite;
}

[data-caret-style="block"] .caret.is-typing {
  opacity: 0.32;
  animation: none;
}

@keyframes caret-blink-block {
  0%, 48% { opacity: 0.32; }
  50%, 100% { opacity: 0.08; }
}

[data-caret-style="underline"] .caret {
  border-radius: 99px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* =========================================================
   Strict / blind / error feedback
   ========================================================= */
.typing-stage.is-error {
  animation: stage-shake 0.3s var(--ease-out);
}

@keyframes stage-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

body.blind-mode .letter.incorrect,
body.blind-mode .letter.extra {
  color: var(--muted-strong);
  text-decoration: none;
}

body.blind-mode .word.skipped .letter:not(.correct):not(.incorrect) {
  color: var(--muted);
  opacity: 0.5;
  text-decoration: none;
}

body.blind-mode .error-count {
  visibility: hidden;
}

body.blind-mode .typing-stage.is-error {
  animation: none;
}

/* =========================================================
   Focus mode
   ========================================================= */
body.focus-mode .hero,
body.focus-mode .lower-grid,
body.focus-mode .site-footer {
  display: none;
}

body.focus-mode .app-main {
  display: flex;
  min-height: calc(100vh - 88px);
  flex-direction: column;
  justify-content: center;
  padding-top: 18px;
  padding-bottom: 24px;
}

body.focus-mode .test-panel {
  width: 100%;
}

body.focus-mode .topbar-hint {
  display: none !important;
}

.focus-exit {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--panel-solid);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease-out);
}

.focus-exit svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.focus-exit:hover {
  background: var(--panel-hover);
  transform: translateY(-1px);
}

body.focus-mode .focus-exit {
  display: inline-flex;
}

/* =========================================================
   Streak / daily card
   ========================================================= */
.streak-card {
  display: flex;
  flex-direction: column;
}

.streak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.streak-score {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.streak-score strong {
  color: var(--accent);
  font-size: 35px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.streak-score span {
  color: var(--muted);
  font-size: 9.5px;
}

.streak-card > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.daily-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-inset);
}

.daily-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.daily-title {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
}

.daily-copy small {
  color: var(--muted);
  font-size: 8.5px;
}

.mini-btn {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #0a1305;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease-out);
}

.mini-btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.streak-card .tip-quote {
  margin: auto 0 0;
  padding-top: 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: 0;
}

/* =========================================================
   Shared modal chrome
   ========================================================= */
.settings-modal,
.progress-modal,
.custom-modal {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 60% 36% at 50% 0%, var(--accent-soft), transparent 72%),
    var(--panel-solid);
  color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
}

.settings-modal .modal-body,
.progress-modal .modal-body,
.custom-modal .modal-body {
  position: relative;
  padding: 32px 34px 30px;
}

.modal-heading {
  padding-right: 40px;
}

.modal-heading h2,
.progress-heading h2,
.custom-modal h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 3.5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.055em;
}

.modal-heading > p:not(.eyebrow),
.progress-heading > p,
.custom-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* =========================================================
   Settings
   ========================================================= */
.settings-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.settings-section {
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-inset);
}

.settings-section h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-subhead {
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.setting-row,
.setting-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child,
.setting-switch:last-child {
  border-bottom: 0;
}

.setting-switch {
  cursor: pointer;
}

.setting-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.setting-copy strong {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.setting-copy small {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.setting-select {
  min-width: 112px;
  padding: 7px 27px 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  appearance: none;
  background-color: var(--panel-solid);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%2378827d' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px;
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 9.5px;
  cursor: pointer;
}

.setting-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.setting-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--panel-hover);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--muted-strong);
  content: "";
  transition: transform 0.2s var(--ease-out), background 0.2s ease;
}

.setting-switch input:checked + .switch-track {
  border-color: rgba(182, 243, 107, 0.28);
  background: var(--accent-soft);
}

.setting-switch input:checked + .switch-track::after {
  background: var(--accent);
  transform: translateX(15px);
}

.setting-switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shortcuts-section {
  grid-column: 1 / -1;
}

.shortcut-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.shortcut-list li {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 9.5px;
}

.shortcut-list li span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shortcut-list kbd {
  height: 19px;
  min-width: 19px;
  font-size: 8.5px;
}

.shortcut-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

/* =========================================================
   Progress modal
   ========================================================= */
.progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 40px;
}

.progress-heading > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ghost-small {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-inset);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ghost-small:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  color: var(--text);
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.progress-summary > div {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-inset);
}

.progress-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.progress-summary strong {
  color: var(--text);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.progress-tabs {
  display: flex;
  width: fit-content;
  gap: 3px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-inset);
}

.progress-tab {
  padding: 7px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.progress-tab:hover {
  color: var(--text);
}

.progress-tab.is-active {
  background: var(--panel-hover);
  color: var(--text);
}

.progress-panel {
  margin-top: 14px;
}

.full-history {
  display: flex;
  max-height: 330px;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding-right: 4px;
}

.full-history-row {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr 0.65fr 0.65fr 0.65fr;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--panel-inset);
  color: var(--muted-strong);
  font-size: 9.5px;
}

.full-history-row:hover {
  border-color: var(--border);
  background: var(--panel-hover);
}

.full-history-mode {
  color: var(--text-soft);
  font-weight: 500;
}

.full-history-date {
  color: var(--muted);
  font-size: 8.5px;
}

.full-history-stat {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.full-history-stat strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
}

.full-history-empty {
  padding: 30px 16px;
  border: 1px dashed var(--border);
  border-radius: 11px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.achievement {
  display: flex;
  min-height: 86px;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-inset);
  opacity: 0.52;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.achievement.is-unlocked {
  border-color: rgba(182, 243, 107, 0.2);
  background: var(--accent-soft);
  opacity: 1;
}

.achievement-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-inset);
  color: var(--muted);
  font-size: 12px;
}

.achievement.is-unlocked .achievement-icon {
  border-color: rgba(182, 243, 107, 0.24);
  background: var(--accent-soft);
  color: var(--accent);
}

.achievement-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.achievement-copy strong {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
}

.achievement-copy small {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

/* Keyboard heatmap */
.heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.heatmap-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--error-soft);
}

.heatmap-legend i:nth-of-type(2) {
  background: rgba(246, 201, 109, 0.3);
}

.heatmap-legend i:nth-of-type(3) {
  background: var(--accent-soft);
}

.keyboard-heatmap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  overflow-x: auto;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-inset);
}

.heatmap-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.heatmap-key {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-inset);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: transform 0.15s ease;
}

.heatmap-key:hover {
  transform: translateY(-1px);
}

.heatmap-key--space {
  width: 190px;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.heatmap-key.is-empty {
  color: var(--muted);
  opacity: 0.55;
}

.weak-keys-wrap {
  margin-top: 18px;
}

.weak-keys-wrap h3 {
  margin: 0 0 9px;
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.weak-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weak-key {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-inset);
  color: var(--text-soft);
  font-size: 9.5px;
}

.weak-key strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.weak-key span {
  color: var(--muted);
  font-size: 8.5px;
}

.weak-keys-empty {
  color: var(--muted);
  font-size: 10px;
}

/* =========================================================
   Custom text modal
   ========================================================= */
#customTextArea {
  width: 100%;
  min-height: 168px;
  margin-top: 18px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--panel-inset);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#customTextArea:focus {
  border-color: rgba(182, 243, 107, 0.3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#customTextArea::placeholder {
  color: var(--muted);
}

#customTimeInput {
  width: 100%;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  background: var(--panel-inset);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#customTimeInput:focus {
  border-color: rgba(182, 243, 107, 0.3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.custom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8.5px;
}

.custom-error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 9.5px;
}

.custom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* =========================================================
   Extended result modal
   ========================================================= */
.result-stats--six {
  grid-template-columns: repeat(3, 1fr);
}

.result-weak {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-inset);
  font-size: 9.5px;
}

.result-weak-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#resultWeakKeys {
  color: var(--text-soft);
}

.btn-ghost-custom svg {
  width: 14px;
  height: 14px;
}

/* =========================================================
   Responsive extensions
   ========================================================= */
@media (max-width: 991.98px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .shortcuts-section {
    grid-column: auto;
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767.98px) {
  .mode-btn {
    min-width: 52px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .daily-badge {
    padding: 5px 8px;
    font-size: 8px;
  }

  .test-meta {
    display: none;
  }

  .streak-score strong {
    font-size: 30px;
  }

  .settings-modal .modal-body,
  .progress-modal .modal-body,
  .custom-modal .modal-body {
    padding: 26px 18px 22px;
  }

  .settings-grid {
    margin-top: 18px;
  }

  .setting-row,
  .setting-switch {
    gap: 10px;
  }

  .setting-select {
    min-width: 100px;
  }

  .shortcut-list {
    grid-template-columns: 1fr;
  }

  .progress-heading {
    padding-right: 34px;
    flex-direction: column;
    gap: 12px;
  }

  .progress-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .progress-tabs {
    width: 100%;
  }

  .progress-tab {
    flex: 1;
  }

  .full-history-row {
    grid-template-columns: 1fr 0.7fr 0.7fr;
  }

  .full-history-row .full-history-stat:nth-last-child(-n + 2) {
    display: none;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .heatmap-key {
    width: 31px;
    height: 31px;
    font-size: 9px;
  }

  .heatmap-key--space {
    width: 150px;
  }

  .result-stats--six {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-weak {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .result-actions {
    flex-wrap: wrap;
  }

  .result-actions .btn-primary-custom,
  .result-actions .btn-ghost-custom {
    flex: 1 1 0;
    min-width: 110px;
  }

  .custom-actions {
    flex-direction: column-reverse;
  }

  .custom-actions .btn-primary-custom,
  .custom-actions .btn-ghost-custom {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .mode-btn {
    min-width: 49px;
    padding: 7px 8px;
    font-size: 10.5px;
  }

  .option-list {
    gap: 3px;
  }

  .option-btn {
    padding: 7px 7px;
    font-size: 10px;
  }

  .result-actions {
    flex-direction: column-reverse;
  }

  .result-actions .btn-primary-custom,
  .result-actions .btn-ghost-custom {
    width: 100%;
  }

  .focus-exit {
    right: 14px;
    bottom: 14px;
  }
}

/* Readability of the active word */
.word.current .letter:not(.correct):not(.incorrect) {
  color: var(--text-soft);
}

/* Keyboard focus on the countdown start overlay */
.focus-overlay.is-startable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -6px;
  border-radius: var(--radius-md);
}

/* Keep all five modes visible on very narrow phones */
@media (max-width: 360px) {
  .mode-switch {
    flex: 1 1 100%;
    width: 100%;
  }

  .mode-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 3px;
    font-size: 9.5px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 17px;
  }
}

/* =========================================================
   Visual polish — flow, spotlight, mode slider, celebrations
   ========================================================= */

/* Live flow background */
.ambient-flow {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 92vw;
  height: 76vh;
  min-width: 720px;
  min-height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 66%);
  filter: blur(22px);
  opacity: calc(0.06 + var(--flow, 0) * 0.3);
  transform: translateX(-50%) scale(calc(0.92 + var(--flow, 0) * 0.16));
  transition: opacity 1s ease, transform 1.4s ease;
  will-change: opacity, transform;
  pointer-events: none;
}

[data-theme="light"] .ambient-flow {
  opacity: calc(0.04 + var(--flow, 0) * 0.14);
}

/* Current-word spotlight */
.word {
  position: relative;
  border-radius: 5px;
  transition: background 0.24s ease;
}

.word.current {
  background: linear-gradient(180deg, transparent 58%, var(--accent-soft) 58%);
}

.word.current::after {
  position: absolute;
  right: 2%;
  bottom: 0.14em;
  left: 2%;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
  opacity: 0.68;
  pointer-events: none;
}

.word.current .letter:not(.correct):not(.incorrect) {
  color: var(--text-soft);
  text-shadow: 0 0 18px var(--accent-glow);
}

/* Sliding mode switch */
.mode-switch {
  position: relative;
  isolation: isolate;
}

.mode-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 0;
  width: 0;
  height: calc(100% - 8px);
  border-radius: 8px;
  background: var(--panel-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateX(0);
  transition:
    width 0.28s var(--ease-out),
    transform 0.28s var(--ease-out),
    opacity 0.2s ease;
  pointer-events: none;
}

.mode-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-btn.is-active {
  background: transparent;
  box-shadow: none;
}

.mode-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.7;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.mode-btn.is-active .mode-icon {
  color: var(--accent);
  opacity: 1;
}

/* New personal best celebration */
.result-modal {
  position: relative;
}

.celebration-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.result-modal .modal-body {
  z-index: 1;
}

.new-best-badge {
  position: relative;
  overflow: hidden;
}

.new-best-badge::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.38) 45%, transparent 72%);
  content: "";
  transform: translateX(-130%);
  animation: badge-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="light"] .new-best-badge::after {
  background: linear-gradient(110deg, transparent 18%, rgba(78, 143, 11, 0.18) 45%, transparent 72%);
}

@keyframes badge-shimmer {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

/* Weekly sparkline + practice calendar */
.history-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.weekly-card,
.calendar-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-inset);
}

.weekly-head {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.weekly-head span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.weekly-head strong {
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.weekly-spark {
  display: block;
  width: 100%;
  min-height: 64px;
  flex: 1 1 86px;
  margin-top: 8px;
  overflow: visible;
}

.spark-area {
  fill: var(--accent-soft);
  opacity: 0.55;
}

.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.spark-dot {
  stroke: var(--accent-bright);
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.weekly-labels {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.weekly-labels span {
  flex: 1;
  text-align: center;
}

.weekly-labels span:first-child {
  text-align: left;
}

.weekly-labels span:last-child {
  text-align: right;
}

.streak-calendar {
  display: grid;
  width: 100%;
  max-width: 220px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 11px auto 0;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--panel-hover);
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.calendar-day.is-practiced {
  background: var(--accent);
  opacity: 0.72;
}

.calendar-day.is-today {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 1px var(--accent-bright);
  opacity: 1;
}

.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--muted);
  font-size: 8px;
}

.calendar-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--panel-hover);
}

.calendar-swatch.is-mid {
  background: var(--accent-soft);
}

.calendar-swatch.is-full {
  background: var(--accent);
  opacity: 0.72;
}

@media (max-width: 991.98px) {
  .mode-icon {
    display: none;
  }

  .mode-btn {
    gap: 0;
  }
}

@media (max-width: 767.98px) {
  .history-insights {
    grid-template-columns: 1fr;
  }

  .weekly-spark {
    flex-basis: 86px;
  }
}

/* =========================================================
   SEO content, FAQ and accessibility helpers
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1100;
  top: -100px;
  left: 16px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--panel-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.noscript {
  margin-top: 12px;
}

.noscript p {
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-inset);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.seo-content,
.faq {
  margin-top: 14px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.seo-content h2,
.faq h2 {
  max-width: 24ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.seo-content > p:not(.eyebrow),
.faq > p:not(.eyebrow) {
  max-width: 78ch;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.72;
}

.seo-content > .seo-lede {
  color: var(--text-soft);
  font-size: 14px;
}

.seo-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 22px;
}

.seo-card {
  min-width: 0;
  padding: 16px 16px 17px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-inset);
}

.seo-card h3,
.seo-steps-wrap h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.seo-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.seo-steps-wrap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.seo-steps {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: seo-step;
}

.seo-steps li {
  position: relative;
  padding-left: 29px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  counter-increment: seo-step;
}

.seo-steps li::before {
  position: absolute;
  top: 0.1em;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  content: counter(seo-step);
  font-size: 9px;
  font-weight: 700;
}

.seo-steps kbd,
.faq kbd {
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--panel-inset);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
}

.faq-list {
  margin-top: 17px;
}

.faq details {
  border-top: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  flex: 0 0 auto;
  color: var(--accent);
  content: "+";
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq summary:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.faq details p {
  max-width: 78ch;
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer-copy {
  min-width: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
}

.footer-nav a {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--accent);
}

@media (max-width: 991.98px) {
  .seo-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .seo-content,
  .faq {
    padding: 22px 19px;
  }

  .seo-features {
    grid-template-columns: 1fr;
  }

  .seo-content h2,
  .faq h2 {
    max-width: none;
  }

  .footer-inner {
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .footer-nav {
    gap: 10px;
  }
}

/* Keep the glass look on desktop, but avoid expensive live blur work on
   phones and tablets where the same soft gradients are enough. */
@media (max-width: 991.98px) {
  .ambient-orb {
    filter: none;
    animation: none;
  }

  .ambient-flow {
    filter: none;
  }

  .test-panel,
  .insight-card,
  .seo-content,
  .faq {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .focus-overlay,
  .modal-backdrop.show {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 767.98px) {
  .hero,
  .test-panel,
  .lower-grid {
    animation: none;
  }
}


/* ---- css/theme-modern.css ---- */
/* =========================================================
   Typing Test — modern theme
   Loaded after style.css. Changes colour, depth, type treatment
   and surfaces only; layout and behaviour are unchanged.
   ========================================================= */

:root {
  --bg: #07080f;
  --bg-deep: #04050a;
  --panel: rgba(18, 16, 34, 0.72);
  --panel-solid: #12101f;
  --panel-inset: rgba(255, 255, 255, 0.04);
  --panel-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(167, 139, 250, 0.16);
  --border-strong: rgba(167, 139, 250, 0.34);
  --text: #f5f3ff;
  --text-soft: #d4d0ef;
  --muted: #8c88a8;
  --muted-strong: #aaa6c6;
  --accent: #7dd3fc;
  --accent-bright: #bae6fd;
  --accent-deep: #38bdf8;
  --accent-soft: rgba(125, 211, 252, 0.12);
  --accent-glow: rgba(125, 211, 252, 0.35);
  --violet: #a78bfa;
  --shadow-panel: 0 30px 90px rgba(76, 29, 149, 0.38), 0 0 0 1px rgba(167, 139, 250, 0.08);
  --shadow-soft: 0 14px 40px rgba(20, 10, 60, 0.45);
  --gradient-brand: linear-gradient(120deg, #a78bfa 0%, #7dd3fc 55%, #5eead4 100%);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

[data-theme="light"] {
  --bg: #f6f5ff;
  --bg-deep: #ecebfa;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-inset: rgba(76, 29, 149, 0.04);
  --panel-hover: rgba(76, 29, 149, 0.07);
  --border: rgba(76, 29, 149, 0.12);
  --border-strong: rgba(76, 29, 149, 0.24);
  --text: #15102e;
  --text-soft: #362e5c;
  --muted: #6f6a92;
  --muted-strong: #534d78;
  --accent: #6d28d9;
  --accent-bright: #5b21b6;
  --accent-deep: #0284c7;
  --accent-soft: rgba(109, 40, 217, 0.1);
  --accent-glow: rgba(109, 40, 217, 0.22);
  --shadow-panel: 0 28px 80px rgba(76, 29, 149, 0.16);
  --shadow-soft: 0 12px 34px rgba(76, 29, 149, 0.1);
  --gradient-brand: linear-gradient(120deg, #6d28d9 0%, #0284c7 60%, #0d9488 100%);
}

/* Background: soft aurora glow behind the page */
body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(124, 58, 237, 0.32), transparent 62%),
    radial-gradient(900px 560px at 96% 4%, rgba(56, 189, 248, 0.2), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(45, 212, 191, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(124, 58, 237, 0.14), transparent 62%),
    radial-gradient(900px 560px at 96% 4%, rgba(56, 189, 248, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

::selection {
  background: rgba(167, 139, 250, 0.45);
  color: #fff;
}

/* Headline: gradient highlight word */
.hero-highlight {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  letter-spacing: -0.035em;
}

/* Brand wordmark */
.brand-name span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Main test card: glassy, with a gradient edge */
.test-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

[data-theme="light"] .test-panel {
  background: linear-gradient(180deg, #ffffff, #f8f7ff);
}

/* Typing area: a soft glow on focus */
.typing-stage {
  border-radius: var(--radius-lg);
  transition: box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.typing-stage:focus-within {
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.45), 0 0 48px rgba(125, 211, 252, 0.12);
}

/* Focus rings: visible and on-brand */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Scrollbars */
html {
  scrollbar-color: rgba(167, 139, 250, 0.45) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.35);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Keep the on-screen heading readable on small screens */
@media (max-width: 575.98px) {
  .test-panel {
    border-radius: var(--radius-lg);
  }
}
