:root{--navy-900: #0b1220;--navy-850: #0e1626;--navy-800: #121c30;--navy-700: #1a2740;--navy-600: #243353;--line: #2a3a5c;--text: #e8edf6;--text-dim: #93a1bd;--text-faint: #5e6e90;--accent: #d90429;--accent-soft: #ef233c;--ok: #3ddc97;--warn: #f4b942;--char-a: #5aa9e6;--char-b: #f4a259;--char-c: #b388eb;--el-action: #93a1bd;--el-paren: #c0a3ff;--el-scene: #3ddc97;--el-transition: #f4b942;--mono: "Courier Prime", "Courier New", ui-monospace, monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--navy-900);color:var(--text);font-family:var(--sans);font-size:14px;-webkit-font-smoothing:antialiased;-webkit-user-select:none;user-select:none}button{font-family:inherit;font-size:13px;color:var(--text);background:var(--navy-700);border:1px solid var(--line);border-radius:7px;padding:7px 13px;cursor:pointer;transition:background .12s,border-color .12s}button:hover{background:var(--navy-600)}button:disabled{opacity:.45;cursor:not-allowed}button.primary{background:var(--accent);border-color:var(--accent-soft);font-weight:600}button.primary:hover{background:var(--accent-soft)}button.armed{background:var(--accent);border-color:var(--accent-soft);box-shadow:0 0 0 3px #d9042940}input,select{font-family:inherit;font-size:13px;color:var(--text);background:var(--navy-850);border:1px solid var(--line);border-radius:6px;padding:7px 9px}input:focus,select:focus{outline:none;border-color:var(--accent)}.app{display:flex;flex-direction:column;height:100%}.header{display:flex;align-items:center;gap:12px;padding:28px 16px 10px;background:var(--navy-850);border-bottom:1px solid var(--line);-webkit-app-region:drag}.header>*{-webkit-app-region:no-drag}.brand{font-weight:700;letter-spacing:.5px}.brand .dot{color:var(--accent)}.spacer{flex:1}.header-load-bar{width:120px;flex-shrink:0}.header-model-select{width:96px;flex-shrink:0}.body{flex:1;display:grid;grid-template-columns:1fr 320px;min-height:0}.preview-wrap{min-height:0;overflow:auto;padding:32px 48px;background:var(--navy-900)}.preview{font-family:var(--mono);font-size:15px;line-height:1.55;white-space:pre-wrap;color:var(--text);max-width:640px;margin:0 auto}.preview .empty{color:var(--text-faint);font-style:italic}.sidebar{border-left:1px solid var(--line);background:var(--navy-850);display:flex;flex-direction:column;min-height:0}.sidebar h3{margin:0;padding:14px 16px 8px;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--text-faint)}.legend{padding:4px 12px 12px;display:flex;flex-direction:column;gap:6px}.key-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;background:var(--navy-800);border:1px solid transparent}.key-row.active{border-color:var(--accent);box-shadow:0 0 0 3px #d9042940;animation:pulse .9s ease-in-out infinite}.key-row.unassigned{opacity:.4}@keyframes pulse{0%,to{box-shadow:0 0 0 3px #d904291f}50%{box-shadow:0 0 0 5px #d9042959}}.keycap{width:26px;height:26px;display:grid;place-items:center;border-radius:6px;background:var(--navy-600);border:1px solid var(--line);font-family:var(--mono);font-weight:700;font-size:13px}.key-label{flex:1;font-weight:600}.key-kind{font-size:11px;color:var(--text-dim)}.swatch{width:9px;height:9px;border-radius:50%}.status{margin-top:auto;padding:12px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--text-dim);display:flex;flex-direction:column;gap:8px}.status .row{display:flex;align-items:center;gap:8px}.dot-ind{width:8px;height:8px;border-radius:50%;background:var(--text-faint)}.dot-ind.ready{background:var(--ok)}.dot-ind.loading{background:var(--warn);animation:blink 1s infinite}.dot-ind.error{background:var(--accent)}@keyframes blink{50%{opacity:.3}}.load-bar{height:4px;border-radius:2px;background:var(--navy-700);overflow:hidden}.load-bar-fill{height:100%;background:linear-gradient(90deg,var(--warn),var(--accent-soft));transition:width .2s ease-out}.meter{height:6px;border-radius:3px;background:var(--navy-700);overflow:hidden}.meter>span{display:block;height:100%;background:linear-gradient(90deg,var(--ok),var(--warn),var(--accent));width:0%;transition:width .06s linear}.sim{padding:10px 16px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px}.sim .keys{display:flex;flex-wrap:wrap;gap:5px}.sim .keys button{padding:5px 9px;font-family:var(--mono)}.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%);background:var(--navy-700);border:1px solid var(--accent);color:var(--text);padding:10px 16px;border-radius:9px;box-shadow:0 8px 30px #0006;z-index:50}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#04081099;display:grid;place-items:center;z-index:40}.modal{width:640px;max-height:86vh;overflow:auto;background:var(--navy-850);border:1px solid var(--line);border-radius:14px;padding:20px 22px}.modal h2{margin:0 0 14px;font-size:18px}.field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}.field label{font-size:12px;color:var(--text-dim)}.field .with-button{display:flex;gap:8px}.field .with-button input{flex:1}.keymap-grid{display:flex;flex-direction:column;gap:7px}.keymap-row{display:grid;grid-template-columns:34px 130px 1fr 28px;gap:8px;align-items:center}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.hint{font-size:12px;color:var(--text-faint);margin:2px 0 12px}.empty-state{display:grid;place-items:center;height:100%;text-align:center;color:var(--text-dim);gap:14px}
