:root{--bg:#0f1216;--panel:#171b20;--fg:#e7ebf0;--muted:#9aa3ad;--brand:#7cc4ff;--accent:#37d67a;--danger:#ff5a5a;--warn:#ffd166}*{box-sizing:border-box}html,body{height:100%}body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,Segoe\ UI,Roboto,Arial}.app-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #222;background:#0d1014;position:sticky;top:0;z-index:5}.brand{font-weight:700;color:var(--brand)}.header-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.header-actions input[type="text"]{background:#0b0e12;border:1px solid #222;color:var(--fg);padding:6px 8px;border-radius:8px}.header-actions button,.header-actions select{background:#1f2530;color:var(--fg);border:1px solid #2a3240;padding:8px 10px;border-radius:10px;cursor:pointer}main.app{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start;padding:14px}@media (max-width:980px){main.app{display:block}}.sidebar{max-height:calc(100vh - 56px - 28px);overflow:auto;background:var(--panel);padding:12px;border-radius:12px;margin-bottom:14px}.content{background:var(--panel);padding:12px;border-radius:12px;min-width:0}.levels h3,.exercises h3,.metas h3,.prefs h3,.custom h3{margin:.2rem 0 .6rem 0;color:var(--muted);font-weight:600}.levels ul{list-style:none;padding:0;margin:0;display:grid;gap:6px}.levels li{background:#12161b;border:1px solid #202731;border-radius:10px;padding:8px 10px;cursor:pointer}.levels li.active{outline:2px solid var(--brand)}.controls{display:flex;gap:8px;align-items:center;margin:6px 0 10px;flex-wrap:wrap}.controls select,.controls button{height:34px;border-radius:8px;background:#12161b;color:var(--fg);border:1px solid #2a3240;padding:0 8px}.status-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}.status-bar .stats{display:flex;gap:12px;flex-wrap:wrap;color:var(--muted)}.goal{color:var(--warn)}.typing-area .prompt{font-size:22px;line-height:1.8;background:#0b0e12;border:1px solid #2a3240;padding:10px;border-radius:10px;white-space:pre-wrap;margin-bottom:8px}.typing-area .typing{width:100%;font-size:18px;background:#0b0e12;border:1px solid #2a3240;color:var(--fg);padding:10px;border-radius:10px}.keyboard-wrap{margin-top:8px}.kb-row{display:flex;flex-wrap:nowrap;gap:6px;margin-bottom:6px;overflow-x:auto}.key{flex:0 0 auto;min-width:40px;padding:10px 8px;text-align:center;background:#12161b;border:1px solid #2a3240;border-radius:8px}.progress{height:8px;background:#0b0e12;border:1px solid #2a3240;border-radius:999px;margin-top:10px;overflow:hidden}#progressFill{height:100%;width:0;background:linear-gradient(90deg,var(--brand),var(--accent))}.font-controls{margin-top:8px;color:var(--muted)}.typing.error-flash{outline:2px solid var(--danger);box-shadow:0 0 0 3px rgba(255,90,90,.25)}.key.active{background:#1e2a3a!important;border-color:#3b82f6!important;box-shadow:0 0 0 2px rgba(59,130,246,.35)}.key.next{outline:2px solid var(--accent);box-shadow:0 0 0 3px rgba(55,214,122,.25)}.key.alt{outline:2px dashed var(--warn)}.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.5);z-index:10}.modal[aria-hidden="false"]{display:flex}.modal-content{background:#10141a;border:1px solid #2a3240;border-radius:12px;max-width:820px;width:92%;padding:10px}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:6px 8px}.modal-body{padding:6px 8px}.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}.sum-preview{margin-top:10px;padding:8px;border:1px dashed #2a3240;border-radius:8px;max-height:160px;overflow:auto;background:#0b0e12}.sum-preview .ok{color:#37d67a}.sum-preview .bad{color:#ff5a5a;text-decoration:underline wavy}#dbg{font:12px/1.3 monospace;background:#0a0f14;border:1px solid #233;border-radius:8px;padding:6px;opacity:.95;max-height:200px;overflow:auto;margin-top:10px}.post-test{display:grid;gap:6px;grid-template-columns:1fr auto}.post-test input,.post-test textarea{background:#0b0e12;border:1px solid #2a3240;color:var(--fg);border-radius:8px;padding:8px}.post-test button{background:#1f2530;color:var(--fg);border:1px solid #2a3240;padding:8px 10px;border-radius:10px;cursor:pointer}.code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:12px;background:#0b0e12;border:1px solid #2a3240;border-radius:8px;padding:8px;white-space:pre-wrap}#editorArea,#customArea{color:#fff!important;background-color:#0b0e12!important;border:1px solid #2a3240!important;border-radius:8px}.start-btn{background:#28a745!important;color:#000!important;font-weight:bold;border:1px solid #1e7e34;padding:10px 14px;border-radius:10px;cursor:pointer;margin:6px 0 8px 0}.start-btn.hidden{display:none}#errorBox{position:fixed;top:20px;right:20px;background-color:#ff4d4f;color:#fff;padding:14px 18px;border-radius:8px;font-size:16px;box-shadow:0 4px 8px rgba(0,0,0,.2);z-index:9999;max-width:300px;display:none}#errorBox button{background-color:#c00;color:#fff;border:none;padding:6px 10px;border-radius:6px;cursor:pointer;font-weight:bold;margin-top:8px}.sep{border:0;border-top:1px solid #2a3240;margin:12px 0}.controls-nav{justify-content:center}#exerciseSelect{color:red!important;font-weight:bold}#exerciseName{color:red!important}.lvl-red{color:red!important;font-weight:700}.btn-close-red{background:#c00;color:#fff;border:1px solid #900;padding:8px 12px;border-radius:8px;font-weight:700;cursor:pointer}