/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0d0d0f;
  --bg-2:        #141416;
  --bg-3:        #1a1a1e;
  --bg-4:        #222228;
  --border:      #2a2a32;
  --border-2:    #333340;
  --text:        #e8e8f0;
  --text-2:      #9898a8;
  --text-3:      #5a5a6a;
  --accent:      #6c63ff;
  --accent-2:    #8a83ff;
  --accent-glow: #6c63ff40;
  --green:       #00c896;
  --orange:      #ff7b39;
  --red:         #ff4757;
  --yellow:      #f7c948;
  --track-h:     56px;
  --label-w:     180px;
  --ruler-h:     32px;
  --panel-w:     260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root {
  height: 100%; overflow: hidden;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 13px; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: 12px; cursor: pointer; border: none; outline: none; border-radius: 6px; transition: all 0.15s; }
input, select, textarea { font-family: inherit; font-size: 12px; background: var(--bg-4); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; outline: none; width: 100%; transition: border-color 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: var(--bg-3); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-weight: 500; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-4); color: var(--text); border-color: var(--border-2); }
.btn-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-4); color: var(--text-2); border-radius: 6px; font-size: 13px; }
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
.modal { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 24px; width: 480px; max-height: 80vh; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px #000a; animation: slideUp 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 8px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lang-option { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; font-size: 12px; transition: all 0.12s; background: var(--bg-3); color: var(--text-2); }
.lang-option:hover { border-color: var(--accent); color: var(--text); }
.lang-option.selected { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }
.progress-bar { height: 3px; background: var(--bg-4); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width 0.3s ease; }
