/* ─── ClearOnHealth — Main Styles ─────────────────────────── */
/* Fonts self-hosted — see /assets/fonts/fonts.css loaded in <head> */

:root {
  --green-50:  #f0faf5;
  --green-100: #d6f3e5;
  --green-200: #a8e5c8;
  --green-500: #2aab6b;
  --green-600: #1e8f57;
  --green-700: #156b40;
  --green-900: #0b3d23;

  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  --coral-50:  #fff4f0;
  --coral-100: #ffe4d9;
  --coral-500: #f05c2f;

  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-400: #fbbf24;
  --amber-600: #d97706;

  --red-50:  #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --font-sans:    'DM Sans', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);
}

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

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--green-700);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0;
  letter-spacing: -.3px;
  line-height: 1;
}
/* "Clear" in green, "On" slightly lighter, "Health" bold green */
.site-logo .logo-clear   { color: var(--green-700); font-weight: 700; }
.site-logo .logo-on      { color: var(--green-500); font-weight: 400; font-style: italic; margin: 0 1px; }
.site-logo .logo-health  { color: var(--green-700); font-weight: 700; }
.site-logo .logo-tagline {
  color: var(--gray-400);
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: 0;
  align-self: center;
  font-style: normal;
}

/* ── Hero / Search area ─────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-600) 60%, #1a7a4a 100%);
  padding: 52px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 620px; margin: 0 auto; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 42px);
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.15;
}
.hero p {
  color: rgba(255,255,255,.8);
  font-size: 16px;
  margin-bottom: 28px;
  font-weight: 300;
}
.search-box {
  display: flex;
  gap: 10px;
  max-width: 540px;
  margin: 0 auto 20px;
  align-items: stretch;
}
.search-box > div { flex: 1; } /* wrapper div */
.search-box input {
  flex: 1;
  padding: 14px 48px 14px 18px;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  backdrop-filter: blur(4px);
  transition: border-color .2s, background .2s;
}
.search-box input::placeholder { color: rgba(255,255,255,.6); }
.search-box input:focus { border-color: rgba(255,255,255,.7); background: rgba(255,255,255,.22); }
.search-box button {
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  border: none;
  background: #fff;
  color: var(--green-700);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow-md);
}
.search-box button:hover { opacity: .92; transform: translateY(-1px); }
.search-box button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.pill {
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.9);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font-sans);
}
.pill:hover { background: rgba(255,255,255,.28); }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ── Article result ──────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
}
.result-title { font-family: var(--font-display); font-size: 26px; color: var(--gray-900); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 99px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  text-decoration: none;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-800); }
.btn-bookmarked { background: var(--amber-50); border-color: var(--amber-400); color: var(--amber-600); }
.btn-primary { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ── Sections ────────────────────────────────────────────── */
.sections { display: flex; flex-direction: column; gap: 16px; }
.section-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.section-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ic-causes      { background: var(--coral-50); }
.ic-medical     { background: var(--blue-50); }
.ic-alt         { background: var(--green-50); }
.ic-foods-good  { background: #f0fdf4; }
.ic-foods-bad   { background: #fff7ed; }
.ic-supps       { background: #faf5ff; }
.section-head-text h3 { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.section-head-text p  { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

/* ── Accordion ───────────────────────────────────────────── */
.acc-list { padding: 4px 0; }
.acc-item { border-bottom: 1px solid var(--gray-100); }
.acc-item:last-child { border-bottom: none; }
.acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  color: var(--gray-700);
  transition: background .12s;
}
.acc-btn:hover { background: var(--gray-50); }
.acc-btn:focus-visible { outline: 2px solid var(--green-500); outline-offset: -2px; }
.btn:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.pill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.star:focus-visible { outline: 2px solid var(--amber-400); outline-offset: 2px; border-radius: 2px; }
.acc-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.nc  { background: var(--coral-100); color: var(--coral-500); }
.nm  { background: var(--blue-100);  color: var(--blue-600); }
.na  { background: var(--green-100); color: var(--green-600); }
.nfg { background: #dcfce7; color: #15803d; }
.nfb { background: #ffedd5; color: #c2410c; }
.nsp { background: #f3e8ff; color: #7e22ce; }
.acc-label { flex: 1; font-size: 14px; font-weight: 500; }
.acc-chevron { color: var(--gray-300); font-size: 11px; flex-shrink: 0; transition: transform .2s; }
.acc-chevron.open { transform: rotate(180deg); }
.acc-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s ease;
}
.acc-body.open { max-height: 600px; }
.acc-body-inner {
  padding: 4px 20px 16px 56px;
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.75;
}

/* ── Rating ──────────────────────────────────────────────── */
.rating-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.rating-card h4 { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 12px; }
.stars { display: flex; gap: 6px; margin-bottom: 14px; }
.star { font-size: 28px; cursor: pointer; color: var(--gray-200); transition: color .1s, transform .1s; line-height: 1; }
.star:hover, .star.active { color: var(--amber-400); transform: scale(1.15); }
.flag-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flag-label { font-size: 13px; color: var(--gray-500); }
.flag-btn {
  padding: 10px 16px; border-radius: 99px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--gray-200); background: #fff; color: var(--gray-500);
  font-family: var(--font-sans); transition: all .15s;
}
.flag-btn:hover, .flag-btn.active { background: var(--red-50); border-color: var(--red-500); color: var(--red-600); }
.rating-thanks { font-size: 13px; color: var(--green-600); margin-top: 10px; display: none; font-weight: 500; }

/* ── Share modal ─────────────────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
@keyframes popIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--gray-800); }
.share-option {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background .12s;
}
.share-option:hover { background: var(--gray-50); }
.share-option-icon { font-size: 22px; width: 32px; text-align: center; }
.share-option-name { font-size: 14px; font-weight: 500; color: var(--gray-700); }
.share-option-sub  { font-size: 12px; color: var(--gray-400); }
.modal-close { width: 100%; padding: 10px; margin-top: 4px; border-radius: var(--radius-md); border: 1px solid var(--gray-200); background: none; font-family: var(--font-sans); font-size: 14px; color: var(--gray-500); cursor: pointer; }
.modal-close:hover { background: var(--gray-50); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--gray-900); color: #fff;
  padding: 10px 22px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 999; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Bookmarks page ──────────────────────────────────────── */
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bk-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bk-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bk-card-topic { font-weight: 600; font-size: 15px; color: var(--gray-800); }
.bk-card-date  { font-size: 12px; color: var(--gray-400); }
.bk-remove { align-self: flex-end; background: none; border: none; cursor: pointer; color: var(--gray-300); font-size: 18px; line-height: 1; }
.bk-remove:hover { color: var(--red-500); }

/* ── Empty / Loading states ──────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--gray-400); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.7; }
.skeleton { background: var(--gray-200); border-radius: 4px; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── Nav tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 28px; }
.tab-btn {
  padding: 10px 20px; font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; background: none; color: var(--gray-500);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: var(--font-sans); transition: color .15s;
}
.tab-btn.active { color: var(--green-600); border-bottom-color: var(--green-600); }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 99px; font-weight: 500;
}
.badge-ai     { background: var(--amber-50);  color: var(--amber-600); }
.badge-manual { background: var(--blue-50);   color: var(--blue-600); }
.badge-cached { background: var(--green-50);  color: var(--green-600); }
.badge-draft  { background: var(--gray-100);  color: var(--gray-500); }
.badge-pub    { background: var(--green-100); color: var(--green-700); }

/* ── Related topics pills ────────────────────────────────── */
.related-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.related-pill {
  padding: 8px 16px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid var(--gray-200);
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  touch-action: manipulation;
}
.related-pill:hover { border-color: var(--green-500); color: var(--green-600); }
.related-pill:active { background: var(--green-50); }

@media (max-width: 640px) {
  .related-topics {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep scrolling */
    scrollbar-width: none;
  }
  .related-topics::-webkit-scrollbar { display: none; }
  .related-pill { flex-shrink: 0; padding: 10px 16px; font-size: 13px; }
}

/* ── When to see a doctor — warning section ─────────────── */
.warning-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 2px solid var(--red-500);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(239,68,68,.12);
  margin-bottom: 16px;
}
.warning-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--red-50);
  border-bottom: 1px solid var(--red-100);
}
.warning-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #fee2e2;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.warning-head-text h3 { font-size: 15px; font-weight: 700; color: var(--red-600); }
.warning-head-text p  { font-size: 12px; color: #b91c1c; margin-top: 1px; }
.warning-acc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  color: var(--gray-700);
  transition: background .12s;
  border-bottom: 1px solid var(--red-100);
}
.warning-acc-btn:last-of-type { border-bottom: none; }
.warning-acc-btn:hover { background: var(--red-50); }
.wnum {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--red-100);
  color: var(--red-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.warning-label { flex: 1; font-size: 14px; font-weight: 500; color: var(--red-700); }
.warning-chevron { color: var(--red-300); font-size: 11px; flex-shrink: 0; transition: transform .2s; }
.warning-chevron.open { transform: rotate(180deg); }
.warning-body { overflow: hidden; max-height: 0; transition: max-height .28s ease; }
.warning-body.open { max-height: 400px; }
.warning-body-inner {
  padding: 4px 20px 14px 56px;
  font-size: 14px;
  color: #b91c1c;
  line-height: 1.75;
  background: var(--red-50);
}
/* Dark mode */
@media (prefers-color-scheme: dark) {
  .warning-card { background: #1a0a0a; border-color: #7f1d1d; }
  .warning-head { background: #1f0f0f; border-bottom-color: #7f1d1d; }
  .warning-head-text h3 { color: #fca5a5; }
  .warning-head-text p  { color: #f87171; }
  .warning-icon { background: #2d1010; }
  .warning-acc-btn { color: #fca5a5; border-bottom-color: #7f1d1d; }
  .warning-acc-btn:hover { background: #1f0f0f; }
  .wnum { background: #2d1010; color: #fca5a5; }
  .warning-label { color: #fca5a5; }
  .warning-body-inner { background: #1a0a0a; color: #fca5a5; }
}
/* Mobile */
@media (max-width: 640px) {
  .warning-head { padding: 12px 16px; }
  .warning-acc-btn { padding: 13px 16px; min-height: 52px; }
  .warning-body-inner { padding: 4px 16px 12px 48px; font-size: 13px; }
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: #fff;
}
.disclaimer-note {
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--amber-600);
  margin-top: 24px;
  line-height: 1.6;
}

/* ── Dark mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50:  #0f1117;
    --gray-100: #1a1d24;
    --gray-200: #252830;
    --gray-300: #363a45;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    --green-50:  #0a1f14;
    --green-100: #0d2e1c;
    --green-200: #155230;
    --blue-50:   #0a1628;
    --blue-100:  #0e2044;
    --coral-50:  #2a1109;
    --amber-50:  #271a05;
    --amber-100: #3d2a08;
  }
  body { background: var(--gray-50); }
  .site-header, .section-card, .rating-card, .modal,
  .bk-card, .share-option { background: var(--gray-100); }
  .hero { background: linear-gradient(135deg, #0d2e1c 0%, #0a2218 60%, #071a12 100%); }
  .hero-content h1 { color: #e8f5ee; }
  .search-box input {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #f3f4f6;
  }
  .search-box input:focus { border-color: rgba(255,255,255,.4); }
  .disclaimer-note { background: #271a05; border-color: #3d2a08; color: #fbbf24; }
  .acc-btn:hover { background: var(--gray-200); }
  .flag-btn { background: var(--gray-100); border-color: var(--gray-300); color: var(--gray-500); }
  .bottom-nav {
    background: rgba(26, 29, 36, .96);
    border-top-color: var(--gray-300);
  }
  .bottom-nav-btn { color: var(--gray-500); }
  .bottom-nav-btn.active { color: #4ade80; }
  .btn { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-600); }
  .btn:hover { background: var(--gray-300); }
  .btn-primary { background: var(--green-600); color: #fff; }
  .skeleton { background: var(--gray-200); }
}

/* ── Full mobile responsive ──────────────────────────────── */
@media (max-width: 640px) {

  /* ── Header ── */
  .site-header { padding: 0 16px; }
  .site-logo { font-size: 18px; }
  .site-logo .logo-tagline { display: none; }
  /* Shrink header nav buttons on mobile */
  .header-inner nav .btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  /* ── Hero ── */
  .hero { padding: 32px 16px 44px; }
  .hero h1 { font-size: 26px; line-height: 1.2; }
  .hero p { font-size: 14px; margin-bottom: 20px; }
  .search-box { flex-direction: column; gap: 8px; max-width: 100%; }
  .search-box input {
    width: 100%;
    font-size: 16px; /* prevents iOS zoom */
    padding: 14px 48px 14px 16px; /* room for clear button */
  }
  .search-box button { width: 100%; padding: 14px; font-size: 15px; }
  .pills { gap: 8px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .pill { padding: 10px 16px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }

  /* ── Content ── */
  .main-content { padding: 16px 16px 100px; } /* 100px bottom pad for bottom nav */
  .result-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .result-title { font-size: 22px; }
  .result-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-actions .btn { justify-content: center; padding: 12px; }

  /* ── Sections ── */
  .sections { gap: 12px; }
  .section-card { border-radius: 14px; }
  .section-head { padding: 14px 16px; gap: 10px; }
  .section-icon { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; flex-shrink: 0; }
  .section-head-text h3 { font-size: 13.5px; line-height: 1.35; }
  .section-head-text p { font-size: 11px; }

  /* ── Accordion ── */
  .acc-btn { padding: 14px 16px; gap: 10px; min-height: 52px; }
  .acc-label { font-size: 13.5px; line-height: 1.4; }
  .acc-num { width: 22px; height: 22px; font-size: 11px; flex-shrink: 0; }
  .acc-chevron { font-size: 10px; }
  .acc-body-inner { padding: 2px 16px 14px 48px; font-size: 13px; line-height: 1.7; }

  /* ── Rating card ── */
  .rating-card { padding: 16px; margin-top: 12px; border-radius: 14px; }
  .rating-card h4 { font-size: 13px; }
  .stars { gap: 10px; margin-bottom: 16px; }
  .star { font-size: 36px; padding: 2px; }
  .flag-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .flag-label { font-size: 12px; }
  .flag-row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .flag-btn { font-size: 12px; padding: 10px 14px; }

  /* ── Bookmarks ── */
  .bk-grid { grid-template-columns: 1fr; gap: 8px; }
  .bk-card { padding: 14px; }

  /* ── Share modal — slides up from bottom as a sheet on mobile ── */
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 8px 20px 36px; /* 36px for iPhone home indicator */
    animation: slideUp .25s ease;
  }
  /* Sheet drag handle */
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 99px;
    margin: 8px auto 16px;
  }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  /* ── Disclaimer ── */
  .disclaimer-note { font-size: 12px; padding: 12px; margin-top: 16px; border-radius: 12px; }
}

/* ── Bottom navigation bar (mobile only) ─────────────────── */
.bottom-nav {
  display: none;
}
@media (max-width: 640px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--gray-200);
    z-index: 100;
    padding: 8px 0 env(safe-area-inset-bottom, 8px); /* iPhone home bar */
  }
  .bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--gray-400);
    text-decoration: none;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-btn.active { color: var(--green-600); }
  .bottom-nav-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
  .bottom-nav-badge {
    position: absolute;
    top: 4px; right: calc(50% - 18px);
    background: var(--amber-400);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }
  /* Hide the top nav buttons on mobile — replaced by bottom nav */
  .header-inner nav { display: none; }
  /* Extra safe-area padding at bottom of content */
  .main-content { padding-bottom: max(100px, calc(68px + env(safe-area-inset-bottom))); }
}

/* ── Touch interaction improvements ──────────────────────── */
@media (hover: none) {
  /* Remove hover states on touch devices — they stick after tap */
  .btn:hover, .pill:hover, .acc-btn:hover,
  .bk-card:hover, .share-option:hover { background: initial; }
  /* Restore specific hover backgrounds */
  .btn:hover { background: #fff; }
  .pill:hover { background: rgba(255,255,255,.18); }

  /* Add tap highlight instead */
  .btn:active { background: var(--gray-100); transform: scale(.97); }
  .btn-primary:active { background: var(--green-700); transform: scale(.97); }
  .pill:active { background: rgba(255,255,255,.38); }
  .acc-btn:active { background: var(--gray-100); }
  .share-option:active { background: var(--gray-100); }
  .bk-card:active { background: var(--gray-100); }
  .flag-btn:active { background: var(--red-50); color: var(--red-600); }

  /* Disable text selection on interactive elements */
  .btn, .pill, .acc-btn, .flag-btn, .star { -webkit-user-select: none; user-select: none; }
  /* Remove 300ms tap delay on older iOS */
  a, button, .pill, .acc-btn { touch-action: manipulation; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 22px; }
  .section-head-text p { display: none; }
  .result-title { font-size: 20px; }
  .acc-btn { padding: 13px 14px; }
}

/* ── Print stylesheet ────────────────────────────────────── */
@media print {
  .site-header, .hero, .result-actions, .rating-card,
  .modal-bg, .toast, .site-footer, .disclaimer-note { display: none !important; }
  .main-content { padding: 0; max-width: 100%; }
  .section-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .acc-body { max-height: none !important; }
  .acc-chevron { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
  .result-title { font-size: 18pt; }
  .section-head-text h3 { font-size: 13pt; }
  .acc-body-inner { font-size: 11pt; color: #333; }
  a { color: #000; text-decoration: none; }
}
