@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F7F8FC;
  --surface: #FFFFFF;
  --surface2: #F0F1F7;
  --border: #E4E5EF;
  --border2: #D0D2E0;
  --text: #0C0D14;
  --text-muted: #6B6D85;
  --text-light: #A0A2B8;
  --accent: #5B4FE8;
  --accent-light: #EAE8FD;
  --accent-mid: #8B82F0;
  --green: #1A9B6C;
  --green-light: #E0F5ED;
  --amber: #C06A0A;
  --amber-light: #FEF3E2;
  --red: #C0302A;
  --red-light: #FDECEA;
  --sage: #3A7D44;
  --sage-light: #E8F5EA;
  --pink: #D4478A;
  --pink-light: #FDEEF6;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 100px;
  --header-bg: rgba(255,255,255,0.93);
  --shadow: 0 4px 24px rgba(91,79,232,.08);
  --shadow-sm: 0 2px 8px rgba(12,13,20,.05);
  --nav-h: 64px;
}

[data-theme="dark"] {
  --bg: #0E0F18;
  --surface: #171826;
  --surface2: #1E2033;
  --border: #2A2D45;
  --border2: #373B58;
  --text: #EEEEF5;
  --text-muted: #8E90AD;
  --text-light: #5A5D7A;
  --accent: #7B70F5;
  --accent-light: #1E1C3A;
  --accent-mid: #9F97F7;
  --green: #2DC98A;
  --green-light: #0D2B1F;
  --amber: #E8881A;
  --amber-light: #2A1C08;
  --red: #E05555;
  --red-light: #2A1111;
  --sage: #50A85A;
  --sage-light: #102214;
  --pink: #E06BAA;
  --pink-light: #2A1020;
  --header-bg: rgba(14,15,24,0.93);
  --shadow: 0 4px 24px rgba(0,0,0,.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.2);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: all .15s;
  border: none;
  background: transparent;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}
.nav-item svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--accent); background: var(--accent-light); }
.nav-item:hover:not(.active) { color: var(--text); background: var(--surface2); }

/* ── Top bar ── */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top-bar-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.top-bar-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Icon btn ── */
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: background .25s, border-color .25s;
}
.card + .card { margin-top: 12px; }

/* ── Section label ── */
.section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-light); margin-bottom: 10px;
}

/* ── Pill ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-pill);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500;
  padding: 9px 20px; border-radius: var(--radius-pill);
  z-index: 999; pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  opacity: 0; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Main wrap ── */
.main { max-width: 640px; margin: 0 auto; padding: 18px 16px; }

/* ── Btn ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border2); background: var(--surface); }
.btn-danger { background: var(--red-light); color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
