:root {
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --wrap: 1080px;
  --t: cubic-bezier(.22, 1, .36, 1);
  --primary: #8b5cf6;
  --primary-2: #6366f1;
  --accent: #22d3ee;
  --gold: #fbbf24;
  --green: #34d399;
  --danger: #f87171;
  --shadow: 0 22px 70px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06060b;
  --bg-soft: #0b0b14;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-solid: #12121c;
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #f4f4fa;
  --muted: #9696ad;
  --muted-2: #6c6c85;
  --shadow-card: 0 16px 50px rgba(0, 0, 0, .38);
  --glow: rgba(139, 92, 246, .35);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4fa;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, .78);
  --surface-2: rgba(20, 20, 40, .045);
  --surface-solid: #ffffff;
  --border: rgba(20, 20, 45, .08);
  --border-strong: rgba(20, 20, 45, .16);
  --text: #12121c;
  --muted: #66667e;
  --muted-2: #8b8ba3;
  --shadow-card: 0 16px 44px rgba(30, 30, 70, .1);
  --glow: rgba(139, 92, 246, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--t), color .35s var(--t);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { max-width: 100%; display: block; }
::selection { background: rgba(139, 92, 246, .35); }

.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.grad {
  background: linear-gradient(100deg, #a78bfa 0%, #22d3ee 55%, #fbbf24 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* orbs */
.orb {
  position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0;
  opacity: .55; transition: opacity .4s;
}
.orb-a { width: 460px; height: 460px; background: #6d28d9; top: -160px; left: -120px; }
.orb-b { width: 380px; height: 380px; background: #0891b2; top: 30%; right: -160px; opacity: .35; }
.orb-c { width: 420px; height: 420px; background: #4c1d95; bottom: -200px; left: 30%; opacity: .3; }
html[data-theme="light"] .orb { opacity: .18; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 14px; padding: 12px 18px; font-weight: 700; font-size: 14.5px;
  letter-spacing: .01em; border: 1px solid transparent; white-space: nowrap;
  transition: transform .18s var(--t), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1 55%, #4f46e5);
  box-shadow: 0 10px 30px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(99, 102, 241, .5); }
.btn-ghost {
  background: var(--surface); border-color: var(--border); color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft { background: rgba(139, 92, 246, .14); color: #c4b5fd; border-color: rgba(139, 92, 246, .28); }
html[data-theme="light"] .btn-soft { color: #6d28d9; }
.btn-danger { background: rgba(248, 113, 113, .14); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
html[data-theme="light"] .btn-danger { color: #dc2626; }
.btn-lg { padding: 15px 24px; font-size: 15.5px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-spinner {
  width: 18px; height: 18px; border-radius: 50%; display: none;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  transition: .2s var(--t);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }

/* inputs */
.input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 15px; padding: 0 6px 0 15px; height: 54px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap:focus-within {
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .12);
  background: var(--surface-2);
}
.input-ico { color: var(--muted); width: 19px; height: 19px; }
.input-wrap input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
}
.input-wrap input::placeholder { color: var(--muted-2); font-weight: 500; }
.paste-btn {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 8px 10px; border-radius: 10px; transition: .2s;
}
.paste-btn:hover { color: var(--text); background: var(--surface-2); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px);
  background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 13px 18px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-card); z-index: 999; opacity: 0; pointer-events: none;
  transition: .3s var(--t); max-width: min(92vw, 460px); text-align: center;
  backdrop-filter: blur(20px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(248, 113, 113, .45); color: #fca5a5; }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--t), transform .7s var(--t); }
.reveal.in { opacity: 1; transform: none; }

/* skeletons */
.skeleton {
  position: relative; overflow: hidden; background: var(--surface-2); border-radius: 14px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
