/* ============================================================
   RaktaSetu — design system
   Oxblood + warm paper + a drop of red. Editorial, humane,
   built for emergencies that can't wait.
   ============================================================ */

:root {
  --paper: #f7f1ea;
  --paper-2: #fdfaf6;
  --ink: #2a151c;
  --ink-2: #6b5660;
  --ink-3: #a18e96;
  --line: #e9ddd2;
  --line-2: #f1e7dd;

  --oxblood: #7c1226;
  --oxblood-2: #a51e34;
  --crimson: #d63a3a;
  --rose: #fbe9e6;
  --rose-2: #f6dcd8;

  --leaf: #1f7a4d;
  --leaf-soft: #e3f1e9;
  --amber: #a8690f;
  --amber-soft: #f9edd8;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(42, 21, 28, 0.05), 0 4px 14px rgba(42, 21, 28, 0.06);
  --shadow-2: 0 2px 4px rgba(42, 21, 28, 0.06), 0 14px 34px rgba(42, 21, 28, 0.12);
  --font-disp: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------- base ---------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(214, 58, 58, 0.10), transparent 60%),
    radial-gradient(900px 520px at 95% -4%, rgba(124, 18, 38, 0.08), transparent 55%),
    radial-gradient(760px 600px at 50% 118%, rgba(168, 105, 15, 0.06), transparent 60%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: radial-gradient(rgba(42, 21, 28, 0.055) 0.8px, transparent 1.4px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
}

.wrap { width: min(1100px, 100% - 48px); margin-inline: auto; }

h1, h2, h3, h4 { font-family: var(--font-disp); margin: 0; color: var(--ink); }

a { color: var(--oxblood-2); }

::selection { background: var(--rose-2); color: var(--oxblood); }

:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 250, 246, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.brand-mark { width: 34px; height: 34px; filter: drop-shadow(0 3px 5px rgba(124, 18, 38, 0.28)); }

.brand-word { font-family: var(--font-disp); font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }
.brand-word b { font-weight: 700; color: var(--oxblood); }

.brand-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-left: 1px solid var(--line);
  padding-left: 10px;
  margin-top: 3px;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(42, 21, 28, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav button {
  font: 600 13px var(--font-ui);
  color: var(--ink-2);
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav button:hover { color: var(--oxblood); }

.nav button.active {
  background: var(--ink);
  color: #fdfaf6;
  box-shadow: 0 2px 6px rgba(42, 21, 28, 0.24);
}

.user-chip {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--rose);
  border: 1px solid var(--rose-2);
  padding: 5px 11px;
  border-radius: 999px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-pill {
  font: 700 13.5px var(--font-ui);
  color: #fdfaf6;
  background: linear-gradient(180deg, var(--oxblood-2), var(--oxblood));
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(124, 18, 38, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-pill:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(124, 18, 38, 0.34); }
.auth-pill:active { transform: translateY(0); }

.auth-pill.ghost {
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
  border: 1px solid var(--line);
}
.auth-pill.ghost:hover { color: var(--oxblood); border-color: var(--oxblood-2); box-shadow: none; }

/* ---------------- layout shell ---------------- */

#app { flex: 1; padding: 34px 0 70px; position: relative; z-index: 1; }

.sec-title { font-size: 27px; font-weight: 600; letter-spacing: -0.01em; }
.sec-sub { color: var(--ink-2); margin: 4px 0 22px; }

/* ---------------- boot screen ---------------- */

.boot-screen {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 70px 0;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 13.5px;
}

.boot-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--crimson);
  animation: spin 0.8s linear infinite;
}

.boot-line {
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--line) 30%, var(--crimson) 50%, var(--line) 70%);
  background-size: 200% 100%;
  animation: skim 1.2s ease-in-out infinite;
}

/* ---------------- hero ---------------- */

.hero {
  text-align: center;
  padding: 26px 0 10px;
  animation: rise 0.5s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--crimson);
  opacity: 0.5;
  animation: pulse 1.8s ease-out infinite;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 20px auto 0;
  max-width: 820px;
  font-variation-settings: "opsz" 90;
}

.hero h1 .accent {
  font-style: italic;
  font-variation-settings: "opsz" 90, "SOFT" 60;
  color: var(--oxblood);
}

.hero .lede {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--ink-2);
  font-size: 16.5px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------------- buttons ---------------- */

.btn {
  --btn-bg: linear-gradient(180deg, var(--oxblood-2), var(--oxblood));
  font: 700 14px var(--font-ui);
  color: #fdfaf6;
  background: var(--btn-bg);
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(124, 18, 38, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124, 18, 38, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.btn:active { transform: translateY(0); }

.btn.sec {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(42, 21, 28, 0.05);
}
.btn.sec:hover { box-shadow: inset 0 0 0 1px var(--oxblood-2), 0 4px 12px rgba(42, 21, 28, 0.08); color: var(--oxblood); }

.btn.ok {
  background: linear-gradient(180deg, #2e9661, var(--leaf));
  box-shadow: 0 3px 8px rgba(31, 122, 77, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn.block { width: 100%; justify-content: center; }

.btn.btn-badge {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

/* ---------------- cards ---------------- */

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
  position: relative;
}

.card.urgent { border-left: 4px solid var(--crimson); }
.card.planned { border-left: 4px solid var(--amber); }

.card h3 { font-size: 18px; font-weight: 600; margin-top: 10px; line-height: 1.35; }
.card h4 { font-size: 15px; }

.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.meta { font-size: 13px; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 13px; }

.confirmed-line { margin-top: 8px; color: var(--leaf); font-size: 12.5px; animation: fadeIn 0.3s ease both; }
.confirmed-line b { font-family: var(--font-disp); font-size: 15px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- chips & badges ---------------- */

.bt-chip {
  font-family: var(--font-disp);
  font-weight: 700;
  font-size: 15px;
  color: var(--oxblood);
  background: var(--rose);
  border: 1px solid var(--rose-2);
  padding: 4px 11px;
  border-radius: 10px;
}

.badge {
  font: 700 11px var(--font-ui);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: capitalize;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge.urgent { background: var(--rose); color: var(--oxblood); }
.badge.planned { background: var(--amber-soft); color: var(--amber); }
.badge.sent { background: var(--rose); color: var(--crimson); }
.badge.confirmed { background: var(--leaf-soft); color: var(--leaf); }
.badge.declined { background: #efe7ee; color: var(--ink-2); }
.badge.fulfilled { background: var(--leaf-soft); color: var(--leaf); }
.badge.cancelled, .badge.expired { background: #efe7ee; color: var(--ink-3); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }

.chip {
  font: 600 12.5px var(--font-ui);
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip:hover { border-color: var(--oxblood-2); color: var(--oxblood); }

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fdfaf6;
}

/* ---------------- phone pill ---------------- */

.tel-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.tel-pill svg { width: 13px; height: 13px; color: var(--oxblood-2); }

/* ---------------- stats ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 38px;
}

.stat {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  border-top: 3px solid var(--oxblood-2);
  animation: rise 0.5s ease both;
}

.stat:nth-child(2) { border-top-color: var(--crimson); animation-delay: 0.05s; }
.stat:nth-child(3) { border-top-color: var(--amber); animation-delay: 0.1s; }
.stat:nth-child(4) { border-top-color: var(--leaf); animation-delay: 0.15s; }

.stat .num { font-family: var(--font-disp); font-size: 34px; font-weight: 700; line-height: 1; font-variation-settings: "opsz" 80; }
.stat .lbl {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat .lbl .live-dot { width: 7px; height: 7px; }

/* ---------------- blood gap matrix ---------------- */

.gap-card { margin-top: 30px; }

.gap-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.gap-head p { color: var(--ink-2); font-size: 14px; margin: 2px 0 0; }

.gap-legend { display: flex; gap: 14px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); flex-wrap: wrap; }
.gap-legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.legend-don { background: var(--oxblood-2); }
.legend-need { background: #e4b7b0; }

.gap-row {
  display: grid;
  grid-template-columns: 68px 1fr 1fr 92px;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px dashed var(--line-2);
  animation: rise 0.45s ease both;
}

.gap-row:first-of-type { border-top: 0; }

.gap-type { font-family: var(--font-disp); font-weight: 700; font-size: 16px; color: var(--oxblood); }

.gap-bar { position: relative; height: 8px; border-radius: 6px; background: rgba(42, 21, 28, 0.06); overflow: hidden; }
.gap-bar .fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 6px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.fill.don { background: linear-gradient(180deg, var(--oxblood-2), var(--oxblood)); }
.fill.need { background: linear-gradient(180deg, #efc3bc, #e49a90); }

.gap-label { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

.gap-state { font: 700 11px var(--font-ui); text-align: center; padding: 5px 8px; border-radius: 999px; }
.gap-state.needy { background: var(--rose); color: var(--oxblood); }
.gap-state.ok { background: var(--leaf-soft); color: var(--leaf); }
.gap-state.full { background: #efe7ee; color: var(--ink-3); }

/* ---------------- steps ---------------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; }

.step {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-1);
  animation: rise 0.5s ease both;
}
.step:nth-child(2) { animation-delay: 0.06s; }
.step:nth-child(3) { animation-delay: 0.12s; }

.step .k {
  font-family: var(--font-disp);
  font-size: 20px;
  font-weight: 700;
  color: var(--crimson);
  background: var(--rose);
  border: 1px solid var(--rose-2);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
}

.step h4 { font-size: 16.5px; margin: 14px 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* ---------------- request feed ---------------- */

.feed-grid { display: grid; gap: 14px; margin-top: 6px; }

.section-gap { margin-top: 40px; }

.signin-card {
  background: linear-gradient(180deg, var(--rose), var(--rose-2));
  border: 1px solid var(--rose-2);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-1);
}

.signin-card svg { width: 40px; height: 40px; flex: 0 0 auto; }

.signin-card h3 { font-size: 17px; margin: 0; }
.signin-card p { margin: 3px 0 0; color: var(--ink-2); font-size: 13.5px; }
.signin-card .btn { margin-left: auto; flex: 0 0 auto; }

/* ---------------- empty states ---------------- */

.empty {
  text-align: center;
  color: var(--ink-2);
  padding: 34px 20px;
  font-weight: 600;
  font-size: 14.5px;
}

.empty-sm { padding: 18px 12px; }

.empty .icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  background: var(--rose);
  border: 1px solid var(--rose-2);
  border-radius: 18px;
  color: var(--oxblood);
}

.empty .icon svg { width: 28px; height: 28px; }

.empty p { margin: 4px 0 0; color: var(--ink-3); font-size: 13.5px; font-weight: 500; }

/* ---------------- forms ---------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  margin-top: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label, .toggle {
  font: 700 12px var(--font-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea,
.chat-input input {
  font: 500 14.5px var(--font-ui);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus, .field select:focus, .field textarea:focus, .chat-input input:focus {
  outline: none;
  border-color: var(--oxblood-2);
  box-shadow: 0 0 0 3px rgba(124, 18, 38, 0.12);
}

.field textarea { resize: vertical; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  user-select: none;
}

.toggle input { position: absolute; opacity: 0; pointer-events: none; }

.toggle .track {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: #e5d9ce;
  position: relative;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.toggle .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(42, 21, 28, 0.3);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle input:checked + .track { background: var(--leaf); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--leaf); outline-offset: 3px; }

.field-hint { font-size: 12px; color: var(--ink-3); }

/* ---------------- facts ---------------- */

.facts { margin-top: 20px; }
.facts h3 { font-size: 19px; }
.facts ul.clean { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.facts li { color: var(--ink-2); font-size: 13.5px; padding-left: 20px; position: relative; }
.facts li::before {
  content: "";
  position: absolute;
  left: 2px; top: 7px;
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--rose-2);
  border: 1px solid var(--rose-2);
}
.facts li strong { color: var(--ink); }

/* ---------------- chat ---------------- */

.chat {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  height: 380px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.bubble {
  max-width: 78%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  position: relative;
  animation: rise 0.25s ease both;
}

.bubble.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}

.bubble.me {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--oxblood-2), var(--oxblood));
  color: #fff;
  border-bottom-right-radius: 5px;
}

.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }

.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; }
.chat-input .btn { border-radius: var(--radius-sm); }

.assistant-chips { margin-top: 12px; }

/* ---------------- auth ---------------- */

.auth-box { max-width: 480px; margin: 10px auto 0; }

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(42, 21, 28, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  font: 700 13px var(--font-ui);
  color: var(--ink-2);
  background: transparent;
  border: 0;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab.active { background: var(--ink); color: #fdfaf6; }

/* ---------------- footer ---------------- */

footer {
  margin-top: auto;
  background: var(--ink);
  color: #cbb9bd;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0;
  font-size: 12.5px;
  flex-wrap: wrap;
}

.foot-brand { color: #fdfaf6; font-weight: 500; }
.foot-brand b { font-family: var(--font-disp); font-size: 14px; letter-spacing: 0.02em; }

/* ---------------- toast ---------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fdfaf6;
  font: 600 13.5px var(--font-ui);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 480px);
}

#toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); flex: 0 0 auto; }
#toast.err::before { background: var(--crimson); }

#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------------- spinner ---------------- */

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  animation: spin 0.7s linear infinite;
}

.btn.sec .spinner, .btn.btn-badge .spinner {
  border-color: rgba(124, 18, 38, 0.25);
  border-top-color: var(--oxblood);
}

/* ---------------- keyframes ---------------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes skim { 0%, 100% { background-position: 160% 0; } 50% { background-position: -60% 0; } }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .gap-row { grid-template-columns: 56px 1fr 1fr 74px; gap: 10px; }
}

@media (max-width: 760px) {
  .topbar { position: relative; }
  .nav {
    order: 3;
    width: 100%;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -6px;
    padding: 5px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 0 0 auto; }
  .brand-tag { display: none; }

  .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
  .user-chip { order: 4; }
  .auth-pill { order: 5; }

  .signin-card { flex-direction: column; text-align: center; gap: 10px; }
  .signin-card .btn { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}