:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaee;
  --text: #14161a;
  --muted: #646b76;
  --border: #e2e5ea;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-soft: #e8efff;
  --accent-text: #ffffff;
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --warn: #b45309;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 18px;
  --radius-sm: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e11;
    --surface: #16181c;
    --surface-2: #1e2126;
    --surface-3: #292d33;
    --text: #eceef2;
    --muted: #9aa1ac;
    --border: #2a2e35;
    --accent: #5b8cff;
    --accent-2: #9b6bff;
    --accent-soft: #1c2640;
    --ok: #4ade80;
    --ok-soft: #13301f;
    --warn: #f59e0b;
    --danger: #f87171;
    --danger-soft: #3a1a1a;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e11; --surface: #16181c; --surface-2: #1e2126; --surface-3: #292d33; --text: #eceef2; --muted: #9aa1ac;
  --border: #2a2e35; --accent: #5b8cff; --accent-2: #9b6bff; --accent-soft: #1c2640; --ok: #4ade80; --ok-soft: #13301f;
  --warn: #f59e0b; --danger: #f87171; --danger-soft: #3a1a1a; --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 26px; height: 26px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo img { width: 32px; height: 32px; border-radius: 9px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 550; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.icon-only { padding: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 550;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.ok .dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width .2s; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-weight: 550; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
