/* ============================================================
   CashCount — Design System
   main.css
   ============================================================ */

/* Google Fonts are loaded asynchronously via link preconnect/stylesheet tags in HTML headers */

/* ── Design Tokens (Light Mode) ──────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           #F7F8FA;
  --surface:      #FFFFFF;
  --surface-2:    #F3F4F6;
  --surface-3:    #EAECF0;

  /* Borders */
  --border:       #E5E7EB;
  --border-strong:#D1D5DB;

  /* Text */
  --text-1:       #111827;
  --text-2:       #374151;
  --text-3:       #667085;
  --text-4:       #9CA3AF;

  /* Accent — trustworthy blue */
  --accent:        #2563EB;
  --accent-hover:  #1D4ED8;
  --accent-active: #1E40AF;
  --accent-50:     #EFF6FF;
  --accent-100:    #DBEAFE;
  --accent-200:    #BFDBFE;

  /* Semantic */
  --success:       #16A34A;
  --success-50:    #F0FDF4;
  --success-200:   #BBF7D0;
  --error:         #DC2626;
  --error-50:      #FEF2F2;
  --warning:       #D97706;
  --warning-50:    #FFFBEB;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(16,24,40,.05);
  --shadow-sm:  0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06);
  --shadow-md:  0 4px 8px -2px rgba(16,24,40,.1), 0 2px 4px -2px rgba(16,24,40,.06);
  --shadow-lg:  0 12px 16px -4px rgba(16,24,40,.08), 0 4px 6px -2px rgba(16,24,40,.03);
  --shadow-xl:  0 20px 24px -4px rgba(16,24,40,.08), 0 8px 8px -4px rgba(16,24,40,.03);

  /* Radius */
  --radius-xs:  6px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 24px;

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

  /* Layout */
  --header-height:  64px;
  --container-max:  1200px;
  --container-pad:  clamp(16px, 4vw, 32px);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, monospace;
  --font-numeric: 'Inter', system-ui, sans-serif;

  /* Transitions */
  --ease-default: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --dur-fast:     120ms;
  --dur-normal:   200ms;
  --dur-slow:     350ms;

  /* Z-indices */
  --z-sticky:    100;
  --z-overlay:   200;
  --z-sheet:     300;
  --z-modal:     400;
  --z-toast:     500;
}

/* ── Dark Mode ────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0F1117;
    --surface:      #1A1D27;
    --surface-2:    #22252F;
    --surface-3:    #2D3142;

    --border:       #2D3142;
    --border-strong:#3D4155;

    --text-1:       #F9FAFB;
    --text-2:       #E5E7EB;
    --text-3:       #9CA3AF;
    --text-4:       #6B7280;

    --accent:        #3B82F6;
    --accent-hover:  #2563EB;
    --accent-active: #1D4ED8;
    --accent-50:     rgba(59,130,246,.1);
    --accent-100:    rgba(59,130,246,.18);
    --accent-200:    rgba(59,130,246,.28);

    --success:       #22C55E;
    --success-50:    rgba(34,197,94,.1);
    --error:         #F87171;
    --error-50:      rgba(248,113,113,.1);

    --shadow-xs:  0 1px 2px rgba(0,0,0,.3);
    --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.24);
    --shadow-md:  0 4px 8px -2px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.24);
    --shadow-lg:  0 12px 16px -4px rgba(0,0,0,.5), 0 4px 6px -2px rgba(0,0,0,.2);
    --shadow-xl:  0 20px 24px -4px rgba(0,0,0,.5), 0 8px 8px -4px rgba(0,0,0,.2);
  }
}

[data-theme="dark"] {
  --bg:           #0F1117;
  --surface:      #1A1D27;
  --surface-2:    #22252F;
  --surface-3:    #2D3142;
  --border:       #2D3142;
  --border-strong:#3D4155;
  --text-1:       #F9FAFB;
  --text-2:       #E5E7EB;
  --text-3:       #9CA3AF;
  --text-4:       #6B7280;
  --accent:        #3B82F6;
  --accent-hover:  #2563EB;
  --accent-active: #1D4ED8;
  --accent-50:     rgba(59,130,246,.1);
  --accent-100:    rgba(59,130,246,.18);
  --accent-200:    rgba(59,130,246,.28);
  --success:       #22C55E;
  --success-50:    rgba(34,197,94,.1);
  --error:         #F87171;
  --error-50:      rgba(248,113,113,.1);
  --shadow-xs:  0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.24);
  --shadow-md:  0 4px 8px -2px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.24);
  --shadow-lg:  0 12px 16px -4px rgba(0,0,0,.5), 0 4px 6px -2px rgba(0,0,0,.2);
  --shadow-xl:  0 20px 24px -4px rgba(0,0,0,.5), 0 8px 8px -4px rgba(0,0,0,.2);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Focus States ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

:focus:not(:focus-visible) { outline: none; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

p { color: var(--text-2); line-height: 1.7; }

.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted { color: var(--text-3); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

main { flex: 1; }

.page-hero {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.page-section {
  padding-block: var(--space-10);
}

.page-section + .page-section {
  border-top: 1px solid var(--border);
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-normal) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-4);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-1);
}

.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.logo-text span {
  color: var(--accent);
}

.logo-short {
  display: none;
}

@media (max-width: 640px) {
  .logo-full { display: none; }
  .logo-short { display: inline; }
}

/* Desktop Nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
}

@media (min-width: 768px) {
  .desktop-nav { display: flex; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast), background-color var(--dur-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-50);
}

/* Header right actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Currency badge in header */
.header-currency-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
  white-space: nowrap;
}

.header-currency-btn:hover {
  background: var(--accent-50);
  border-color: var(--accent-200);
  color: var(--accent);
}

.header-currency-flag {
  font-size: 1rem;
  line-height: 1;
}

.header-currency-code {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-currency-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

/* Icon buttons */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-3);
  background: transparent;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast), background var(--dur-fast);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

@media (max-width: 480px) {
  .header-inner {
    gap: var(--space-2);
  }
  .header-actions {
    gap: var(--space-1);
  }
  .header-currency-btn {
    padding: 4px 8px;
    font-size: 0.8125rem;
    gap: 4px;
  }
  .header-currency-chevron {
    width: 12px;
    height: 12px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

/* Theme toggle */
.theme-toggle { display: flex; align-items: center; }
.theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

/* ── Mobile Navigation ────────────────────────────────────── */
.mobile-menu-btn {
  display: flex;
}

@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
  backdrop-filter: blur(2px);
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  z-index: var(--z-sheet);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-default);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.mobile-nav-body {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px var(--space-4);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-md);
  transition: color var(--dur-fast), background var(--dur-fast);
  min-height: 52px;
}

.mobile-nav-link:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

.mobile-nav-link.active {
  color: var(--accent);
  background: var(--accent-50);
  font-weight: 600;
}

.mobile-nav-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-3);
  stroke-width: 1.75;
  flex-shrink: 0;
}

.mobile-nav-link.active svg { color: var(--accent); }

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin-block: var(--space-2);
}

.mobile-nav-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--border);
}

.mobile-nav-footer-text {
  font-size: 0.8125rem;
  color: var(--text-4);
  text-align: center;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-3);
  margin-bottom: var(--space-4);
}

.breadcrumb-link {
  color: var(--text-3);
  transition: color var(--dur-fast);
}

.breadcrumb-link:hover { color: var(--accent); }

.breadcrumb-sep {
  width: 14px;
  height: 14px;
  color: var(--text-4);
}

.breadcrumb-current {
  color: var(--text-2);
  font-weight: 500;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-12);
}

@media (min-width: 640px) {
  .footer-main {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand .logo { margin-bottom: var(--space-4); }

.footer-brand-tagline {
  font-size: 0.9375rem;
  color: var(--text-3);
  line-height: 1.6;
  max-width: 280px;
}

.footer-privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-4);
  padding: 6px 12px;
  font-size: 0.8125rem;
  color: var(--success);
  background: var(--success-50);
  border-radius: 100px;
  font-weight: 500;
}

.footer-privacy-note svg {
  width: 14px;
  height: 14px;
}

.footer-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-link {
  font-size: 0.9375rem;
  color: var(--text-3);
  transition: color var(--dur-fast);
}

.footer-link:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: var(--space-5);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-4);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-4);
}

.footer-bottom-link {
  font-size: 0.875rem;
  color: var(--text-4);
  transition: color var(--dur-fast);
}

.footer-bottom-link:hover { color: var(--text-2); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

/* Currency card — used in directory + popular grid */
.currency-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-1);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
  cursor: pointer;
}

.currency-card:hover {
  border-color: var(--accent-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.currency-card-flag {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.currency-card-info {
  flex: 1;
  min-width: 0;
}

.currency-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency-card-meta {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 2px;
}

.currency-card-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-4);
  flex-shrink: 0;
}

/* Popular currencies grid */
.currencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

/* ── Bottom Sheet ─────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
  backdrop-filter: blur(2px);
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: var(--z-sheet);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-default);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  /* Safe area for home-bar devices */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-sheet.open {
  transform: translateY(0);
}

/* On desktop, transform bottom sheet to a centered modal */
@media (min-width: 768px) {
  .bottom-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -40%) scale(0.98);
    width: min(560px, 90vw);
    border-radius: var(--radius-2xl);
    max-height: 85vh;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
  }

  .bottom-sheet.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 100px;
  margin: var(--space-3) auto;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .sheet-handle { display: none; }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-5) var(--space-4);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-1);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-5);
}

.sheet-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  background: var(--text-1);
  color: var(--surface);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--dur-slow) var(--ease-default) both;
  white-space: nowrap;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.hiding {
  animation: toastOut var(--dur-normal) var(--ease-in) both;
}

/* ── Search Input ─────────────────────────────────────────── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-4);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 12px 12px 42px;
  font-size: 0.9375rem;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
}

.search-input::placeholder { color: var(--text-4); }

.search-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-100);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform 60ms;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}

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

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-100);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-3);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--error-50);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-icon {
  padding: 10px;
  min-width: 44px;
}

/* ── Section Titles ───────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: var(--space-4);
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-6);
  text-align: center;
  gap: var(--space-3);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--text-4);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.empty-state-desc {
  font-size: 0.9375rem;
  color: var(--text-3);
  max-width: 280px;
}

/* ── Static Page Layouts ──────────────────────────────────── */
.static-page-header {
  padding-block: var(--space-10);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}

.static-page-header h1 {
  margin-bottom: var(--space-3);
}

.static-page-header p {
  font-size: 1.125rem;
  color: var(--text-3);
  max-width: 60ch;
}

.static-content {
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--space-8);
}

.static-content h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.static-content h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.static-content p {
  margin-bottom: var(--space-4);
}

.static-content ul, .static-content ol {
  list-style: disc;
  padding-left: var(--space-5);
  color: var(--text-2);
  margin-bottom: var(--space-4);
}

.static-content li { margin-bottom: var(--space-2); }

.static-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-200);
}

.static-content a:hover {
  text-decoration-color: var(--accent);
}

/* ── How It Works Steps ───────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-block: var(--space-8);
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent-50);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
}

.step-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-1);
}

.step-desc {
  font-size: 0.9375rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(4px) scale(0.95); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Scroll Bar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── Selection ────────────────────────────────────────────── */
::selection { background: var(--accent-100); color: var(--accent-active); }

/* ── Helpers ──────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.no-scroll { overflow: hidden; }

/* ── Offline indicator ────────────────────────────────────── */
.offline-banner {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--warning-50);
  color: var(--warning);
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(217,119,6,.2);
}

.offline-banner.visible { display: flex; }

