:root {
  --red: #e31837;
  --red-dark: #b8122c;
  --blue: #005daa;
  --blue-dark: #004a88;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #fafafa;
  --card: #ffffff;
  --soft: #fff1f2;
  --soft-blue: #eff6ff;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(24, 24, 27, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #fafafa;
    --ink-2: #d4d4d8;
    --muted: #a1a1aa;
    --line: #3f3f46;
    --bg: #111113;
    --card: #1c1c1f;
    --soft: #2a1418;
    --soft-blue: #14202e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --ink: #fafafa;
  --ink-2: #d4d4d8;
  --muted: #a1a1aa;
  --line: #3f3f46;
  --bg: #111113;
  --card: #1c1c1f;
  --soft: #2a1418;
  --soft-blue: #14202e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--blue); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }

.wordmark { font-weight: 900; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark b { color: inherit; font-weight: 900; }
.wordmark em { color: var(--red); font-style: normal; }
.wordmark .tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.wordmark small { font-weight: 600; color: var(--muted); font-size: 0.7em; margin-left: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--red); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease; min-height: 44px;
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn.blue { background: var(--blue); }
.btn.blue:hover { background: var(--blue-dark); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--line); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input, input[type="text"], input[type="email"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  min-height: 44px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(0, 93, 170, 0.35); outline-offset: 1px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft-blue); color: var(--blue); }
.pill.red { background: var(--soft); color: var(--red); }
.pill.green { background: #dcfce7; color: #166534; }
.pill.gray { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.amber { background: #fef3c7; color: #92400e; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2); }

.alert { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.alert.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.alert.info { border-color: #bfdbfe; background: var(--soft-blue); color: var(--blue-dark); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alert.error { background: #2a1418; color: #fecaca; border-color: #7f1d1d; }
  :root:not([data-theme="light"]) .alert.ok { background: #0f2a1a; color: #bbf7d0; border-color: #166534; }
  :root:not([data-theme="light"]) .alert.info { color: #bfdbfe; border-color: #1e3a8a; }
  :root:not([data-theme="light"]) .pill.green { background: #0f2a1a; color: #bbf7d0; }
  :root:not([data-theme="light"]) .pill.amber { background: #2d2006; color: #fde68a; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
