:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --bg-1: #16161b;
  --bg-2: #1e1e25;
  --bg-3: #26262e;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.15);
  --line: rgba(255, 255, 255, 0.12);
  --line-solid: #2a2a32;
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.6);
  --faint: rgba(245, 245, 247, 0.38);
  --green: #34c759;
  --green-ink: #05230f;
  --blue: #0a84ff;
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.15);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-1: 12px;
  --r-2: 18px;
  --r-3: 24px;
  --r-4: 30px;
  --shadow-1: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 26px 70px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 4px rgba(52, 199, 89, 0.25);
  --t: 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--green); color: var(--green-ink); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.8rem; font-weight: 600; letter-spacing: -0.03em; margin: 0; line-height: 1.12; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 1rem; }
p { margin: 0 0 1rem; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin: 0 0 0.6rem; }

.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; letter-spacing: -0.02em; font-size: 1.15rem; color: var(--text); }
.brand .mark { width: 25px; height: 25px; color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--glass);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: transform var(--t), background var(--t), filter var(--t);
}
.btn:hover { background: var(--glass-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { filter: none; }
.btn-primary { background: var(--green); color: var(--green-ink); border-color: transparent; font-weight: 640; }
.btn-primary:hover { background: var(--green); filter: brightness(1.06); }
.btn-lg { padding: 0.85rem 1.3rem; font-size: 1rem; border-radius: var(--r-2); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; }
.link { background: none; border: none; color: var(--blue); font: inherit; cursor: pointer; padding: 0.2rem 0; }
.link.danger { color: var(--red); }
.link.ok { color: var(--green); }

label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.9rem; }
input, select, textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  color: var(--text);
  font: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
select {
  appearance: none;
  cursor: pointer;
  padding-right: 2rem;
  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='%239a9aa2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 0.75rem; }
.tag { font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0.08rem 0.4rem; }

.error { background: var(--red-soft); color: #ff9a92; border: 1px solid rgba(255, 69, 58, 0.3); padding: 0.65rem 0.85rem; border-radius: var(--r-1); font-size: 0.88rem; margin: 0 0 1rem; }

.avatar-lg { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; font-size: 1.9rem; text-transform: uppercase; color: #fff; background: radial-gradient(circle at 40% 35%, #6a6a7a, #303038); }

.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: grid; gap: 0.5rem; justify-items: center; z-index: 40; pointer-events: none; }
.toast { background: var(--glass); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4); border: 1px solid var(--line); color: var(--text); padding: 0.5rem 0.95rem; border-radius: 999px; font-size: 0.85rem; box-shadow: var(--shadow-1); animation: toastIn var(--t) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; border: 2px solid var(--bg); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
