/* Neighdoor.dev — mobile-first, clean, friendly. */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;
  --good: #047857;
  --good-soft: #ecfdf5;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(24, 24, 27, 0.08);
  --shadow-lg: 0 24px 60px rgba(24, 24, 27, 0.16);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0c;
    --surface: #17171a;
    --surface-2: #232326;
    --text: #fafafa;
    --muted: #a1a1aa;
    --border: #2e2e33;
    --accent: #818cf8;
    --accent-soft: #1e1b4b;
    --accent-text: #c7d2fe;
    --good: #34d399;
    --good-soft: #052e22;
    --danger: #fb7185;
    --danger-soft: #3f0d1d;
    --amber: #fbbf24;
    --amber-soft: #33260a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
p { margin: 0 0 12px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.brand-tld { color: var(--muted); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.credit-pill {
  background: var(--accent-soft); color: var(--accent-text);
  font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; border: 1px solid transparent;
}
.credit-pill:hover { border-color: var(--accent); }

/* Layout */
.app { max-width: 960px; margin: 0 auto; padding: 20px 16px 110px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--muted); max-width: 60ch; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 16px; }

/* Cards & grids */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  overflow: hidden;
}
.card-banner { height: 120px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 52px; margin: -18px -18px 14px; }
.grad-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.grad-violet { background: linear-gradient(135deg, #8b5cf6, #d946ef); }
.grad-emerald { background: linear-gradient(135deg, #10b981, #14b8a6); }
.grad-amber { background: linear-gradient(135deg, #f59e0b, #f97316); }
.grad-rose { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.grad-sky { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.grad-teal { background: linear-gradient(135deg, #14b8a6, #22c55e); }
.grad-orange { background: linear-gradient(135deg, #f97316, #eab308); }
.grad-cyan { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.grad-pink { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.card h3 { font-size: 19px; }
.tagline { color: var(--muted); font-size: 14px; }
.price { font-weight: 800; font-size: 17px; }
.price small { color: var(--muted); font-weight: 600; font-size: 13px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.badge-boost { background: var(--amber-soft); color: var(--amber); }
.badge-pro { background: var(--accent-soft); color: var(--accent-text); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff; border-radius: 22px; padding: 28px 22px; margin-bottom: 20px;
}
.hero h1 { font-size: 30px; }
.hero p { color: rgba(255, 255, 255, 0.85); }
.hero .btn { background: #fff; color: #3730a3; border-color: #fff; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
@media (min-width: 640px) { .hero { padding: 36px 32px; } .hero h1 { font-size: 36px; } }

/* Swipe deck */
.deck-wrap { max-width: 460px; margin: 0 auto; }
.deck { position: relative; height: 520px; margin-bottom: 18px; touch-action: pan-y; }
.deck-card {
  position: absolute; inset: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
  will-change: transform; user-select: none; -webkit-user-select: none;
}
.deck-card .card-banner { height: 220px; margin: 0; border-radius: 0; font-size: 84px; flex: none; }
.deck-body { padding: 18px 20px; overflow: auto; }
.deck-body h2 { font-size: 24px; }
.deck-card.dragging { transition: none !important; box-shadow: var(--shadow-lg); }
.deck-stamp {
  position: absolute; top: 18px; z-index: 3; font-weight: 900; font-size: 22px;
  letter-spacing: 0.06em; padding: 6px 14px; border-radius: 10px; border: 3px solid;
  opacity: 0; pointer-events: none;
}
.stamp-help { left: 16px; color: var(--good); border-color: var(--good); transform: rotate(-10deg); }
.stamp-skip { right: 16px; color: var(--danger); border-color: var(--danger); transform: rotate(10deg); }
.deck-controls { display: flex; justify-content: center; align-items: center; gap: 16px; }
.round-btn {
  width: 64px; height: 64px; border-radius: 50%; font-size: 26px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
}
.round-btn:active { transform: scale(0.93); }
.round-btn.help { width: 78px; height: 78px; font-size: 32px; background: var(--accent); color: #fff; border-color: var(--accent); }
.deck-empty { text-align: center; padding: 60px 20px; }
.progress-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.progress-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.progress-dots i.on { background: var(--accent); }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 10px; }
.tabbar a.active { color: var(--accent); }
.tabbar a:hover { text-decoration: none; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps span { flex: 1; height: 6px; border-radius: 99px; background: var(--border); }
.steps span.on { background: var(--accent); }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.notice { background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }

/* Sheet (modal) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); color: var(--text); width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow: auto; box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: 20px; } .sheet { border-radius: 24px; } }
.sheet h2 { font-size: 22px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 700; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; word-break: break-all; }

/* Toasts */
.toasts { position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  max-width: 520px; text-align: center; animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dashboard / ledger */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 12px; text-align: center; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.ledger-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .amt { font-weight: 800; white-space: nowrap; }
.amt.pos { color: var(--good); }
.amt.neg { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* Pricing */
.price-card { text-align: center; }
.price-card b { font-size: 30px; letter-spacing: -0.02em; }
.pack-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .pack-grid { grid-template-columns: repeat(3, 1fr); } }
