:root {
  --bg: #0b0c0e;
  --surface: #101113;
  --surface-2: #151619;
  --surface-3: #1a1b1f;
  --border: #26282c;
  --border-soft: #1b1d20;
  --text: #f1f2f4;
  --dim: #a1a4a9;
  --faint: #6b6e74;
  --acc: #f1f2f4;
  --danger: #f87171;
  --ok: #34d399;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif;
  --display: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.22, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }

.brand { display: inline-flex; align-items: center; gap: 9px; font: 700 16px/1 var(--display); letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 9px;
  font: 500 14px/1 var(--sans);
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s, opacity 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active:not(:disabled):not([aria-disabled='true']) { transform: scale(0.98); }
.btn--sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover:not(:disabled) { background: #fff; }
.btn--dark { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn--dark:hover:not(:disabled):not([aria-disabled='true']) { background: var(--surface-3); border-color: #34363b; }
.btn--danger { background: rgb(248 113 113 / 0.1); border-color: rgb(248 113 113 / 0.35); color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: rgb(248 113 113 / 0.18); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }

.field { display: grid; gap: 8px; }
.field > span, .field > label { font-size: 13px; font-weight: 500; color: var(--dim); }
.field small { font-size: 12px; color: var(--faint); }
.input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
textarea.input { height: auto; min-height: 110px; padding: 11px 13px; resize: vertical; line-height: 1.5; font-family: var(--mono); font-size: 12.5px; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #34363b; }
.input:focus { outline: 0; border-color: #5a5d64; background: var(--surface-2); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.06); }
.input[aria-invalid='true'] { border-color: rgb(248 113 113 / 0.7); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }

.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); box-shadow: 0 16px 50px rgb(0 0 0 / 0.5); font-size: 13.5px; animation: toastIn 0.35s var(--out); }
.toast--ok { border-color: rgb(52 211 153 / 0.4); }
.toast--error { border-color: rgb(248 113 113 / 0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
