:root {
  --accent: #f97316;
  --accent2: #fb923c;
  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
  --bg: #0c0e12;
  --surface: #13161c;
  --surface2: #1a1e27;
  --border: rgba(255,255,255,0.07);
  --text: #e2e8f0;
  --muted: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
body { display: flex; flex-direction: column; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 4px; }

.mono { font-family: 'Space Mono', monospace; }

.grid-bg {
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.btn:active { transform: scale(0.95); }
.btn-orange { background: var(--accent); color: #fff; }
.btn-orange:hover { background: #ea6c0a; }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.15); }
.btn-red { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.btn-red:hover { background: rgba(239,68,68,0.2); }
.btn-green { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.btn-green:hover { background: rgba(34,197,94,0.2); }
.btn-blue { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.btn-blue:hover { background: rgba(59,130,246,0.2); }

.input-field {
  width: 100%; padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); background: rgba(10,12,16,0.8); color: var(--text);
  outline: none; font-family: 'DM Sans', sans-serif; transition: border-color 0.15s;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--muted); }

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.word-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; font-size: 13px; font-weight: 600;
  border: 1px solid; cursor: default; letter-spacing: 0.3px;
  font-family: 'Space Mono', monospace; transition: all 0.15s;
}
.chip-valid { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25); color: #4ade80; }
.chip-invalid { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #f87171; }
.chip-pending { background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.25); color: #fb923c; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-valid { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.dot-invalid { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.dot-pending { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.5); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; border-radius: 10px; padding: 12px 16px;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.25s ease; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 220px; max-width: 340px;
}
.toast-ok { background: #0f291a; border: 1px solid rgba(34,197,94,0.35); color: #4ade80; }
.toast-err { background: #1f0f0f; border: 1px solid rgba(239,68,68,0.35); color: #f87171; }
.toast-info { background: #1a1510; border: 1px solid rgba(249,115,22,0.35); color: #fb923c; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 400px; overflow: hidden;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.word-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); transition: background 0.1s;
}
.word-row:hover { background: rgba(255,255,255,0.02); }
.word-row:last-child { border-bottom: none; }

.badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.badge-valid { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-invalid { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-pending { background: rgba(249,115,22,0.15); color: #fb923c; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.15);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-bar { height: 2px; background: var(--accent); animation: loadbar 1.4s ease-in-out infinite; }
@keyframes loadbar {
  0% { width: 0; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0; margin-left: 100%; }
}

#lock-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
}
#main-app { height: 100%; display: flex; flex-direction: column; }

.section-panel { flex: 1; overflow-y: auto; }

.tag-sm {
  padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
}

.diff-add { background: rgba(34,197,94,0.08); border-left: 3px solid rgba(34,197,94,0.5); }
.diff-remove { background: rgba(239,68,68,0.08); border-left: 3px solid rgba(239,68,68,0.5); }

#login-spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto;
}
