@font-face { font-family: "Urb"; src: url("/assets/fonts/urb-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Urb"; src: url("/assets/fonts/urb-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Urb"; src: url("/assets/fonts/urb-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Urb"; src: url("/assets/fonts/urb-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "BVP"; src: url("/assets/fonts/bvp-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BVP"; src: url("/assets/fonts/bvp-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "BVP"; src: url("/assets/fonts/bvp-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "BVP"; src: url("/assets/fonts/bvp-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --tint: #f0f4f5;
  --tint-2: #e5ecee;
  --ink: #0c1130;
  --ink-2: #3b4262;
  --muted: #606683;
  --line: #e3e8ec;
  --line-2: #cfd6de;
  --brand: #263486;
  --brand-hover: #1d2869;
  --brand-ink: #ffffff;
  --brand-soft: #edf0fb;
  --brand-soft-2: #d9dff6;
  --brand-deep: #161f5c;
  --brand-text: #263486;
  --accent: #2f7be6;
  --accent-text: #1d5bb5;
  --ok: #13795b;
  --ok-soft: #e5f4ee;
  --warn: #9a5b00;
  --warn-soft: #fff3df;
  --danger: #bf3328;
  --danger-soft: #fdeceb;
  --code-bg: #0f1531;
  --code-ink: #e3e7f6;
  --code-line: #232b52;
  --shadow-sm: 0 1px 2px rgba(17, 21, 48, 0.05);
  --shadow: 0 1px 2px rgba(17, 21, 48, 0.03), 0 18px 40px -24px rgba(17, 21, 48, 0.18);
  --shadow-lg: 0 24px 64px -24px rgba(17, 21, 48, 0.32);
  --ring: 0 0 0 3px rgba(47, 123, 230, 0.32);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "BVP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Urb", "BVP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d1b;
    --surface: #111528;
    --surface-2: #161b31;
    --tint: #171c33;
    --tint-2: #1e2440;
    --ink: #eceef9;
    --ink-2: #c4c8de;
    --muted: #8e94b2;
    --line: #232944;
    --line-2: #2f3657;
    --brand: #8191ff;
    --brand-hover: #9aa7ff;
    --brand-ink: #0a0d1b;
    --brand-soft: #1a2046;
    --brand-soft-2: #242c5e;
    --brand-deep: #0e1440;
    --brand-text: #a9b4ff;
    --accent: #6fa8ff;
    --accent-text: #8cbaff;
    --ok: #46c993;
    --ok-soft: #10291f;
    --warn: #f0b155;
    --warn-soft: #2c2110;
    --danger: #ff7b70;
    --danger-soft: #2f1416;
    --code-bg: #080b17;
    --code-ink: #dfe4f7;
    --code-line: #1c2242;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, 0.7);
    --ring: 0 0 0 3px rgba(111, 168, 255, 0.4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--brand-soft); color: var(--ink); padding: 0.08em 0.36em; border-radius: 5px; white-space: break-spaces; overflow-wrap: anywhere; }
::selection { background: var(--brand-soft-2); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* logo */
.logo { display: block; height: 30px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}

/* buttons */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-family: var(--display); font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em; white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.08s var(--ease), opacity 0.15s;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:disabled { opacity: 1; background: var(--tint-2); color: var(--muted); box-shadow: none; }
/* Headings break evenly and paragraphs avoid a single word on the last line. */
h1, h2, h3 { text-wrap: balance; }
p, li, .lead, dd { text-wrap: pretty; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 20px -10px rgba(38, 52, 134, 0.6); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.95); }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-family: var(--display); font-size: 13px; font-weight: 600; white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--brand-soft-2); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* dialogs */
dialog.modal {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 13, 30, 0.46); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop 0.2s var(--ease); }
dialog.modal[open]::backdrop { animation: fade 0.2s var(--ease); }
.modal-body { padding: 28px 28px 8px; }
.modal-body h2 { font-family: var(--display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.modal-body p { color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 28px 28px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in 0.25s var(--ease); }
.toast.out { animation: toast-out 0.2s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.danger { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.name { font-family: var(--font); }
.display { font-family: var(--display); }
