/* ============================================
   WAMAN-AHYAHA DONATION TRACKER — DESIGN SYSTEM
   Official theme matching waman-ahyaha
   ============================================ */

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

/* ============================================================
   DESIGN TOKENS — Waman-Ahyaha Official Brand Colors
   Primary teal: #2A8FA0  Gold accent: #C8A92A
   ============================================================ */
:root {
  /* Brand */
  --primary:          #2A8FA0;
  --primary-dark:     #1D6B79;
  --primary-darker:   #145563;
  --primary-light:    #3AAFC3;
  --primary-bg:       #EBF6F9;

  --gold:             #C8A92A;
  --gold-dark:        #A88A20;
  --gold-light:       #E8CA50;
  --gold-bg:          #FDF8EA;

  /* Hero / Hero-section background (dark teal like waman-ahyaha hero) */
  --hero-bg:          #236472;
  --hero-bg-dark:     #1a4d5a;

  /* Neutrals */
  --white:            #FFFFFF;
  --gray-50:          #F8FAFC;
  --gray-100:         #F1F5F9;
  --gray-200:         #E2E8F0;
  --gray-300:         #CBD5E1;
  --gray-400:         #94A3B8;
  --gray-500:         #64748B;
  --gray-600:         #475569;
  --gray-700:         #334155;
  --gray-800:         #1E293B;
  --gray-900:         #0F172A;

  /* Semantic */
  --success:          #16A34A;
  --success-bg:       #DCFCE7;
  --danger:           #DC2626;
  --danger-bg:        #FEE2E2;
  --warning:          #D97706;
  --warning-bg:       #FEF3C7;
  --info:             #2563EB;
  --info-bg:          #DBEAFE;
  --error:            #DC2626;
  --error-bg:         #FEE2E2;

  /* Surfaces (Light Mode) */
  --bg:               #F4F7F9;
  --surface:          #FFFFFF;
  --surface-2:        #F8FAFC;
  --border:           #E2E8F0;
  --border-strong:    #CBD5E1;

  /* Text */
  --text-heading:     #0F172A;
  --text-body:        #334155;
  --text-muted:       #64748B;
  --text-subtle:      #94A3B8;
  --text-on-primary:  #FFFFFF;
  --text-on-gold:     #7A5A00;

  /* Shadows */
  --shadow-xs:        0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-sm:        0 1px 3px 0 rgba(0,0,0,.10), 0 1px 2px -1px rgba(0,0,0,.10);
  --shadow-md:        0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.10);
  --shadow-lg:        0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -4px rgba(0,0,0,.10);
  --shadow-xl:        0 20px 25px -5px rgba(0,0,0,.10), 0 8px 10px -6px rgba(0,0,0,.10);
  --shadow-primary:   0 4px 14px rgba(42,143,160,.25);
  --shadow-gold:      0 4px 14px rgba(200,169,42,.30);

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* Radii */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 20px;  --r-full: 9999px;

  /* Typography */
  --font:       'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-en:    'Inter', -apple-system, sans-serif;

  /* Transitions */
  --t-fast:  150ms ease;
  --t-base:  250ms ease;
  --t-slow:  400ms cubic-bezier(.4,0,.2,1);

  /* Layout */
  --max-w:        1200px;
  --nav-h:        70px;
  --bottom-nav-h: 68px;

  /* Z-index */
  --z-nav:    200;
  --z-modal:  300;
  --z-toast:  400;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg:         #0F172A;
  --surface:    #1E293B;
  --surface-2:  #243044;
  --border:     #334155;
  --border-strong: #475569;

  --text-heading: #F1F5F9;
  --text-body:    #CBD5E1;
  --text-muted:   #94A3B8;
  --text-subtle:  #64748B;

  --primary-bg:   rgba(42,143,160,.15);
  --gold-bg:      rgba(200,169,42,.12);
  --success-bg:   rgba(22,163,74,.15);
  --danger-bg:    rgba(220,38,38,.15);
  --warning-bg:   rgba(217,119,6,.15);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.75;
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}

body[dir="ltr"] { direction: ltr; font-family: var(--font-en); }

h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-heading);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: var(--sp-4); color: var(--text-body); }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ============================================================
   UTILITIES
   ============================================================ */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-5); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start { display: flex; align-items: center; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-xs { font-size: .75rem; } .text-sm { font-size: .875rem; } .text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-gold { color: var(--gold); }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; } .font-black { font-weight: 900; }
.w-full { width: 100%; }
.rounded { border-radius: var(--r-md); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px 24px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: .2px;
}

.btn:active { transform: scale(.97); }

/* Ripple */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(42,143,160,.35);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold);
  color: var(--text-on-gold);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold-dark);
  border-color: var(--gold);
}
.btn-outline-gold:hover { background: var(--gold); color: var(--text-on-gold); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text-body); }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }

.btn-sm { padding: 7px 16px; font-size: .8125rem; }
.btn-xs { padding: 4px 10px; font-size: .75rem; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 32px; font-size: 1.0625rem; }
.btn-xl { padding: 17px 40px; font-size: 1.125rem; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: var(--r-full); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: relative;
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* Stat cards — Waman-Ahyaha style with top border accent */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.stat-card.accent-gold::before { background: var(--gold); }
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat-card.accent-gold .stat-value { color: var(--gold-dark); }
.stat-card .stat-label {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
  font-weight: 600;
  letter-spacing: .3px;
}
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-3);
  background: var(--primary-bg);
}
.stat-card.accent-gold .stat-icon { background: var(--gold-bg); }

/* ============================================================
   SVG ICONS (inline icon component)
   ============================================================ */
.icon {
  display: inline-flex;
  flex-shrink: 0;
}
.icon svg { width: 1em; height: 1em; }
.icon-sm svg { width: 1rem; height: 1rem; }
.icon-md svg { width: 1.25rem; height: 1.25rem; }
.icon-lg svg { width: 1.5rem; height: 1.5rem; }
.icon-xl svg { width: 2rem; height: 2rem; }
.icon-primary svg { color: var(--primary); stroke: var(--primary); }
.icon-gold svg { color: var(--gold); stroke: var(--gold); }
.icon-muted svg { color: var(--text-muted); stroke: var(--text-muted); }
.icon-white svg { color: #fff; stroke: #fff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .9375rem;
  color: var(--text-heading);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42,143,160,.15);
}
.form-input::placeholder { color: var(--text-subtle); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 38px;
}
body[dir="ltr"] .form-select {
  background-position: right 12px center;
  padding-left: 14px;
  padding-right: 38px;
}
textarea.form-input { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: var(--sp-1); }
.form-error { font-size: .8125rem; color: var(--danger); margin-top: var(--sp-1); }

/* Toggle switch */
.toggle { position: relative; width: 50px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: var(--t-base);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px; right: 3px;
  transition: var(--t-base);
  box-shadow: var(--shadow-sm);
}
body[dir="ltr"] .toggle-slider::before { right: auto; left: 3px; }
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(-24px); }
body[dir="ltr"] .toggle input:checked + .toggle-slider::before { transform: translateX(24px); }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-gold    { background: var(--gold-bg);    color: var(--gold-dark); }
.badge-success { background: var(--success-bg); color: #15803D; }
.badge-danger  { background: var(--danger-bg);  color: #B91C1C; }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-gray    { background: var(--gray-100);   color: var(--gray-600); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-full);
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.progress-bar.gold { background: var(--gold); }

/* ============================================================
   TOP NAVIGATION — exactly like waman-ahyaha
   ============================================================ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  z-index: var(--z-nav);
  box-shadow: var(--shadow-xs);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}

.nav-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.1rem;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.nav-brand-title {
  font-size: .9375rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
}

.nav-brand-subtitle {
  font-size: .6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ============================================================
   BOTTOM NAVIGATION — mobile only
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: var(--z-nav);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,.07);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: var(--sp-2) var(--sp-1);
  color: var(--text-subtle);
  font-size: .6875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  position: relative;
  transition: color var(--t-fast);
}

.nav-item .nav-icon {
  color: var(--text-subtle);
  transition: all var(--t-fast);
}

.nav-item.active {
  color: var(--primary);
}
.nav-item.active .nav-icon { color: var(--primary); transform: scale(1.1); }

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding-top: calc(var(--nav-h) + var(--sp-6));
  padding-bottom: calc(var(--bottom-nav-h) + var(--sp-8));
  min-height: 100vh;
}

/* ============================================================
   PAGE VIEWS
   ============================================================ */
.view { display: none; }
.view.active {
  display: block;
  animation: pageIn .3s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   HERO SECTION — dark teal
   ============================================================ */
.hero {
  background: linear-gradient(145deg, var(--hero-bg) 0%, var(--hero-bg-dark) 100%);
  color: white;
  text-align: center;
  padding: var(--sp-20) var(--sp-5) var(--sp-16);
  margin: calc(-1 * var(--sp-6)) 0 var(--sp-8); /* full-bleed: its parent has no side padding */
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  background: rgba(200,169,42,.06);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { color: white; font-size: 2rem; margin-bottom: var(--sp-3); }
.hero p { color: rgba(255,255,255,.85); font-size: 1.0625rem; max-width: 560px; margin: 0 auto var(--sp-8); }

.hero-actions { max-width: 440px; margin: 0 auto; display: grid; gap: 12px; }
.hero-actions-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-actions .btn-xl { padding-inline: 12px; min-width: 0; }
.hero-cta-campaign {
  width: 100%; white-space: normal; padding-inline: 16px; font-size: .9375rem;
  background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.3);
}
.hero-cta-campaign:hover { background: rgba(255,255,255,.2); color: white; }
.nc-hero-icon { color: var(--gold); display: flex; justify-content: center; margin-bottom: 12px; }
.nc-hero-icon svg { width: 40px; height: 40px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-8);
  padding-top: var(--sp-8);
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stat-value { display: block; font-size: 2rem; font-weight: 900; color: var(--gold-light); }
.hero-stat-label { font-size: .875rem; color: rgba(255,255,255,.75); margin-top: 2px; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.section-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-heading);
  position: relative;
  padding-right: var(--sp-4);
}
.section-title::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 70%;
  border-radius: 2px;
  background: var(--primary);
}
body[dir="ltr"] .section-title { padding-right: 0; padding-left: var(--sp-4); }
body[dir="ltr"] .section-title::before { right: auto; left: 0; }

/* ============================================================
   DONATION GRID / TABLE
   ============================================================ */
.donation-grid-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.donation-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  min-width: 600px;
}
.donation-grid thead { background: var(--primary); color: white; }
.donation-grid th {
  padding: 12px 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-size: .8125rem;
  letter-spacing: .3px;
}
.donation-grid th:first-child {
  text-align: start;
  position: sticky;
  right: 0;
  background: var(--primary-dark);
  z-index: 2;
}
body[dir="ltr"] .donation-grid th:first-child { right: auto; left: 0; }

.donation-grid td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  transition: background var(--t-fast);
}
.donation-grid td:first-child {
  text-align: start;
  font-weight: 600;
  position: sticky;
  right: 0;
  background: var(--surface);
  z-index: 1;
  white-space: nowrap;
  border-left: 1px solid var(--border);
}

@media (max-width: 480px) {
  .donation-grid { font-size: .72rem; min-width: 0; }
  .donation-grid th { padding: 7px 6px; font-size: .67rem; letter-spacing: 0; }
  .donation-grid td { padding: 7px 6px; }
  .donation-grid td:first-child { max-width: 95px; white-space: normal; }
}
body[dir="ltr"] .donation-grid td:first-child { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); }

.donation-grid tbody tr:hover td { background: var(--gray-50); }
.donation-grid tbody tr:last-child td { border-bottom: none; }

/* Cell states */
.cell-paid {
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
}
.cell-unpaid {
  color: var(--gray-300);
  font-size: 1rem;
}
.cell-action {
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast);
  border-radius: var(--r-sm);
}
.cell-action:hover { background: var(--primary-bg) !important; }

/* Paid indicator — checkmark circle */
.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
}
.check-icon.paid { background: var(--success-bg); color: var(--success); }
.check-icon.unpaid { background: var(--gray-100); color: var(--gray-300); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .875rem;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.125rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-filled { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================================
   ANNOUNCEMENT CARD
   ============================================================ */
.announcement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  transition: box-shadow var(--t-base);
  border-right: 4px solid var(--primary);
}
body[dir="ltr"] .announcement-card { border-right: 1px solid var(--border); border-left: 4px solid var(--primary); }
.announcement-card.type-reminder { border-right-color: var(--gold); }
.announcement-card.type-availability { border-right-color: var(--success); }
body[dir="ltr"] .announcement-card.type-reminder { border-left-color: var(--gold); border-right-color: var(--border); }
body[dir="ltr"] .announcement-card.type-availability { border-left-color: var(--success); border-right-color: var(--border); }
.announcement-card:hover { box-shadow: var(--shadow-md); }

.ann-header { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ann-meta { font-size: .75rem; color: var(--text-subtle); margin-top: 2px; }
.ann-title { font-weight: 700; font-size: .9375rem; margin-bottom: var(--sp-2); color: var(--text-heading); }
.ann-body { font-size: .9375rem; color: var(--text-body); line-height: 1.8; }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-3);
  transition: all var(--t-base);
  cursor: default;
}
.leaderboard-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.leaderboard-item.rank-1 { border-color: #DAA520; background: linear-gradient(135deg, rgba(218,165,32,.06) 0%, var(--surface) 100%); }
.leaderboard-item.rank-2 { border-color: #A8A9AD; background: linear-gradient(135deg, rgba(168,169,173,.06) 0%, var(--surface) 100%); }
.leaderboard-item.rank-3 { border-color: #CD7F32; background: linear-gradient(135deg, rgba(205,127,50,.06) 0%, var(--surface) 100%); }

.lb-rank {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.125rem;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  background: var(--gray-100);
  flex-shrink: 0;
}
.rank-1 .lb-rank { background: rgba(218,165,32,.15); color: #B8860B; }
.rank-2 .lb-rank { background: rgba(168,169,173,.15); color: #707070; }
.rank-3 .lb-rank { background: rgba(205,127,50,.15); color: #8B4513; }

.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; color: var(--text-heading); }
.lb-detail { font-size: .8125rem; color: var(--text-muted); margin-top: 2px; }
.lb-score { text-align: center; }
.lb-score-value { font-size: 1.5rem; font-weight: 900; color: var(--primary); display: block; }
.lb-score-label { font-size: .6875rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ============================================================
   MODAL — bottom sheet (mobile), centered (desktop)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0; visibility: hidden;
  transition: all var(--t-base);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--sp-8) var(--sp-6);
  transform: translateY(20px);
  transition: transform var(--t-slow);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  margin: 0 auto var(--sp-6);
}
.modal-header {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.modal-title { font-size: 1.25rem; font-weight: 800; color: var(--text-heading); }
.modal-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: var(--sp-1); }

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--r-xl); max-height: 85vh; transform: translateY(24px) scale(.97); }
  .modal-overlay.active .modal { transform: translateY(0) scale(1); }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + var(--sp-4));
  left: 50%; transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: min(90vw, 380px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  border-right: 4px solid var(--primary);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: all;
}
body[dir="ltr"] .toast { border-right: none; border-left: 4px solid var(--primary); }
.toast-success { border-color: var(--success); }
.toast-error   { border-color: var(--danger);  }
.toast-warning { border-color: var(--warning); }
.toast-text { font-size: .9375rem; font-weight: 600; color: var(--text-heading); }

@keyframes toastIn  { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  padding: var(--sp-8) var(--sp-5);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-8);
  box-shadow: var(--shadow-lg);
}
.auth-card-top {
  text-align: center;
  margin-bottom: var(--sp-8);
}
.auth-card-logo {
  width: 64px; height: 64px;
  border-radius: var(--r-lg);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.5rem;
  margin: 0 auto var(--sp-4);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-subtle);
  font-size: .875rem;
  margin: var(--sp-5) 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  padding: 3px;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
}
.tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-align: center;
}
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

/* ============================================================
   MONTH PILLS
   ============================================================ */
.month-pills {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  -webkit-overflow-scrolling: touch;
}
.month-pills::-webkit-scrollbar { display: none; }
.month-pill {
  padding: 7px 16px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.month-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.month-pill:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   COLLECTOR AVAILABILITY CARD
   ============================================================ */
.avail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.avail-header { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.avail-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.avail-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 5px 12px;
  background: var(--primary-bg);
  border-radius: var(--r-full);
  font-size: .8125rem;
  color: var(--primary-dark);
  font-weight: 600;
}
.avail-actions { display: flex; gap: var(--sp-3); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--sp-20) var(--sp-8);
}
.empty-icon {
  width: 72px; height: 72px;
  border-radius: var(--r-lg);
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-5);
}
.empty-title { font-size: 1.125rem; font-weight: 700; margin-bottom: var(--sp-2); }
.empty-desc { color: var(--text-muted); font-size: .9375rem; margin-bottom: var(--sp-6); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

/* ============================================================
   WHATSAPP / TELEGRAM SEND BUTTONS
   ============================================================ */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--t-base);
  text-decoration: none;
}
.wa-btn-whatsapp {
  background: #25D366;
  color: white;
}
.wa-btn-whatsapp:hover { background: #1DA851; color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,211,102,.3); }

.wa-btn-telegram {
  background: #229ED9;
  color: white;
}
.wa-btn-telegram:hover { background: #1a86ba; color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,158,217,.3); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-up { animation: pageIn .5s ease backwards; }
.delay-1 { animation-delay: .1s; } .delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; } .delay-4 { animation-delay: .4s; }

/* Animated count */
@keyframes countUp { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
.count-anim { animation: countUp .5s ease backwards; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 639px) {
  :root { --nav-h: 60px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  .hero { padding: var(--sp-12) var(--sp-4) var(--sp-10); }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { gap: var(--sp-6); }
  .auth-card { padding: var(--sp-8) var(--sp-5); }
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .main-content { padding-bottom: var(--sp-16); }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: var(--sp-20) var(--sp-8) var(--sp-16); }
  .hero h1 { font-size: 2.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--sp-8); }
}

/* ── About page ────────────────────────────────────────── */
.about-hero {
  margin-bottom: 20px; text-align: center; padding: 28px 20px; border: none; color: white;
  background: linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-dark) 100%);
}
.about-hero h3 { color: white; margin-bottom: 6px; }
.about-hero-icon { color: var(--gold-light); display: inline-flex; transform: scale(1.6); margin-bottom: 14px; }
.about-verse { color: var(--gold-light); font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.about-lead { color: rgba(255,255,255,.85); font-size: .9rem; line-height: 1.9; margin: 0; }
.about-step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; padding: 16px; }
.about-step p { color: var(--text-body); line-height: 1.8; margin: 2px 0 0; }
.about-step-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-md);
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.about-step-title { font-weight: 800; color: var(--text-heading); }

/* ── Telegram bot settings ─────────────────────────────── */
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); margin-bottom: 12px;
}
.tg-status {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 14px;
  border: 1px solid transparent; line-height: 1.6;
}
.tg-status .icon { flex-shrink: 0; margin-top: 3px; }
.tg-status a { font-weight: 700; }
.tg-status-ok   { background: var(--success-bg); border-color: var(--success); color: var(--text-body); }
.tg-status-ok .icon { color: var(--success); }
.tg-status-info { background: var(--primary-bg); border-color: var(--primary); color: var(--text-body); }
.tg-status-info .icon { color: var(--primary); }
.tg-status-warn { background: var(--warning-bg); border-color: var(--warning); color: var(--text-body); }
.tg-status-warn .icon { color: var(--warning); }
.tg-howto {
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 10px 14px; margin-bottom: 14px; font-size: .875rem;
}
.tg-howto summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.tg-howto ol { margin: 10px 18px 2px; padding: 0; line-height: 1.9; color: var(--text-body); }
.tg-howto code { background: var(--gray-50); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: .8rem; }

/* ============================================================
   POLISH PASS — readability, dark mode, touch, feedback
   ============================================================ */

/* Tokens the app already used but never defined; dark-mode greys and badges */
:root {
  --warning-dark: #B45309;
  --error-dark:   #B91C1C;
  --danger-dark:  #B91C1C;
  --success-dark: #15803D;
  color-scheme: light;
}
[data-theme="dark"] {
  color-scheme: dark;
  --gray-50:  #1B2536;
  --gray-100: #243044;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748B;
  --gold-dark:    #E8CA50;
  --warning-dark: #FBBF24;
  --error-dark:   #F87171;
  --danger-dark:  #F87171;
  --success-dark: #4ADE80;
  --info-bg:  rgba(37,99,235,.15);
  --error-bg: rgba(220,38,38,.15);
}
[data-theme="dark"] .badge-primary { color: var(--primary-light); }
[data-theme="dark"] .badge-success { color: #4ADE80; }
[data-theme="dark"] .badge-danger  { color: #F87171; }
[data-theme="dark"] .badge-warning { color: #FBBF24; }
[data-theme="dark"] .badge-gray    { color: var(--text-muted); }

/* Notch / home-indicator safe areas (installed app on iPhone) */
.top-nav {
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  padding-left: max(var(--sp-5), env(safe-area-inset-left));
  padding-right: max(var(--sp-5), env(safe-area-inset-right));
}
.main-content {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--sp-6));
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + var(--sp-8));
}
.bottom-nav { height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
.toast-container { top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--sp-4)); }
.modal {
  max-height: 92dvh;
  padding-bottom: calc(var(--sp-8) + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
@media (min-width: 640px) { .modal { max-height: 85dvh; } }

/* A closing modal must not catch taps (it stays in the DOM while fading out) */
.modal-overlay:not(.active) { pointer-events: none; }
body.modal-open { overflow: hidden; }

/* Busy / disabled buttons */
.btn:disabled, .btn[aria-busy="true"] {
  opacity: .6; cursor: not-allowed; pointer-events: none;
  transform: none !important; box-shadow: none !important;
}
.btn-spinner {
  width: 16px; height: 16px; flex-shrink: 0; display: inline-block;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* Touch screens: no "stuck" hover states after a tap */
html { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .btn::after { display: none; }
  .btn-primary:hover { background: var(--primary); border-color: var(--primary); box-shadow: var(--shadow-primary); transform: none; }
  .btn-gold:hover { background: var(--gold); border-color: var(--gold); transform: none; }
  .btn-outline:hover { background: transparent; color: var(--primary); }
  .btn-outline-gold:hover { background: transparent; color: var(--gold-dark); }
  .btn-ghost:hover { background: transparent; color: var(--text-muted); }
  .card-hover:hover { box-shadow: none; transform: none; }
}

/* Keyboard focus that is actually visible */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-input:focus-visible { outline: none; }

/* iPhone zooms into any field under 16px */
@media (max-width: 767px) {
  .form-input, .form-select, textarea.form-input { font-size: 16px; }
}

/* Stat tiles: big totals shrink instead of being cut off */
.stat-card .stat-value { font-size: clamp(1.35rem, 6.5vw, 2rem); overflow-wrap: anywhere; }
.stat-card .stat-value .unit { font-size: .55em; font-weight: 700; margin-inline-start: 2px; }

/* Round 40px icon buttons (edit / delete / settings) */
.icon-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--gray-100); color: var(--text-body); }
.icon-btn.primary { color: var(--primary); }
.icon-btn.danger  { color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }

/* Donations grid readability */
.donation-grid th .mh-month { display: block; font-weight: 800; font-size: .8125rem; }
.donation-grid th .mh-year  { display: block; font-size: .65rem; font-weight: 600; opacity: .75; }
.donation-grid th.is-current { background: var(--primary-dark); }
.donation-grid td.is-current { box-shadow: inset 0 0 0 999px rgba(42,143,160,.07); }
.donation-grid tbody tr:nth-child(even) td { background: var(--surface-2); }
.donation-grid tr.row-self td { background: var(--gold-bg) !important; }
.donation-grid .col-flash { animation: colFlash 1.2s ease; }
@keyframes colFlash { 0%, 60% { box-shadow: inset 0 0 0 999px rgba(200,169,42,.25); } }
.check-icon.unpaid { color: var(--gray-400); }
.donor-cell-name { font-weight: 700; color: var(--text-heading); line-height: 1.4; }
.donor-cell-amount { white-space: nowrap; }
.self-badge {
  display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 999px;
  background: var(--gold); color: var(--text-on-gold); font-size: .65rem; font-weight: 800; vertical-align: middle;
}
.pay-link {
  margin-top: 6px; min-height: 28px; padding: 2px 10px; font-size: .72rem;
  color: var(--primary); border: 1px solid var(--primary-bg); gap: 4px;
}
.month-pill { cursor: pointer; }
@media (max-width: 480px) {
  .donation-grid td:first-child { min-width: 118px; max-width: 150px; white-space: normal; }
}

/* Loading skeletons (first screen while the session loads) */
.skeleton { position: relative; overflow: hidden; background: var(--gray-100); border-radius: var(--r-md); }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 1.3s infinite;
}
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.sk-hero  { height: 120px; margin-bottom: 16px; border-radius: var(--r-lg); }
.sk-stat  { height: 96px; border-radius: var(--r-lg); }
.sk-line  { height: 14px; margin-bottom: 10px; }
.sk-card  { height: 72px; margin-bottom: 12px; border-radius: var(--r-lg); }

/* Toasts: types, action button, tap to dismiss */
.toast { cursor: pointer; animation: toastIn .3s ease, toastOut .3s ease calc(var(--toast-life, 3200ms) - 300ms) forwards; }
.toast-info { border-color: var(--primary); }
.toast-action {
  margin-inline-start: auto; flex-shrink: 0; background: none; border: none; cursor: pointer;
  font: inherit; font-weight: 800; color: var(--primary); padding: 6px 10px; border-radius: var(--r-sm);
}
.toast-action:hover { background: var(--primary-bg); }

/* Offline / pending-sync pill in the top bar */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--warning-bg); color: var(--warning-dark);
}
.sync-pill.offline { background: var(--danger-bg); color: var(--danger-dark); }
.sync-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-spinning svg { animation: spin .8s linear infinite; }

/* Tablets / laptops: keep the navigation bar (it used to vanish at 768px) */
@media (min-width: 768px) {
  .bottom-nav {
    display: flex; left: 50%; right: auto; width: min(640px, 100%);
    transform: translateX(-50%);
    border: 1px solid var(--border); border-bottom: none;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
