* { box-sizing: border-box; }
html { touch-action: manipulation; }
body {
  font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, #1e3a8a 0%, #0f172a 45%, #0b1220 100%);
  background-attachment: fixed;
  margin: 0; padding: 0; padding-bottom: calc(100px + env(safe-area-inset-bottom));
  color: #e5e7eb;
  min-height: 100vh;
}
header {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 16px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 10;
}
header img { height: 30px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
#greeting { text-align: center; padding: 14px 16px 4px; font-size: 14px; color: #93c5fd; font-weight: 500; }
.screen { display: none; padding: 16px; max-width: 480px; margin: 0 auto; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.card h3 { margin-top: 0; font-size: 14px; color: #93c5fd; letter-spacing: 0.3px; text-transform: uppercase; font-weight: 700; }

/* --- Health Articles: header, cover-banner cards, in-app reader --- */
.articles-header {
  background: linear-gradient(135deg, rgba(59,130,246,0.22), rgba(139,92,246,0.14));
  border: 1px solid rgba(147,197,253,0.25);
  border-radius: 22px; padding: 22px 20px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.articles-header::before {
  content: ''; position: absolute; top: -40px; right: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,0.35), transparent 70%);
}
.articles-header h3 { margin: 0 0 6px; font-size: 20px; color: #f1f5f9; text-transform: none; letter-spacing: 0; font-weight: 800; position: relative; }
.articles-header p { margin: 0; font-size: 13px; color: #bfdbfe; position: relative; }

.art-card {
  border-radius: 20px; overflow: hidden; margin-bottom: 14px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}
.art-card:active { transform: scale(0.98); }
.art-cover {
  height: 88px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; position: relative; overflow: hidden;
}
.art-cover-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.art-cover-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.38) 100%);
  pointer-events: none;
}
.art-cover-fallback { font-size: 34px; }
.art-cover .art-tag {
  position: absolute; top: 10px; left: 12px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  background: rgba(0,0,0,0.28); color: #fff; padding: 4px 10px; border-radius: 100px;
  backdrop-filter: blur(6px);
}
.art-card-alt { background: rgba(96,165,250,0.10); border-color: rgba(96,165,250,0.28); }
.art-cover-alt .art-tag { left: auto; right: 12px; }
.art-body { padding: 14px 16px 16px; }
.art-body h4 { margin: 0 0 6px; font-size: 15.5px; color: #f1f5f9; font-weight: 700; line-height: 1.35; }
.art-excerpt { margin: 0; font-size: 12.5px; color: #94a3b8; line-height: 1.5; }
.art-readmore { margin-top: 8px; font-size: 12px; font-weight: 700; color: #60a5fa; }

.art-cover[data-tag="Hypertension"] { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.art-cover[data-tag="Diet"] { background: linear-gradient(135deg, #22c55e, #15803d); }
.art-cover[data-tag="Medication"] { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.art-cover[data-tag="Activity"] { background: linear-gradient(135deg, #f97316, #c2410c); }
.art-cover[data-tag="Sleep"] { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.art-cover[data-tag="Diabetes"] { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.art-cover[data-tag="Wellness"] { background: linear-gradient(135deg, #eab308, #a16207); }
.art-cover[data-tag="Caregiving"] { background: linear-gradient(135deg, #6366f1, #4338ca); }

#article-reader-overlay {
  position: fixed; inset: 0; z-index: 2000; display: none;
  background: #0b1220; overflow-y: auto;
}
#article-reader-overlay .art-reader-cover {
  height: 150px; display: flex; align-items: flex-end; padding: 16px;
}
.art-reader-back {
  position: fixed; top: 14px; left: 14px; z-index: 2001;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  color: #fff; border: none; border-radius: 100px;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer;
}
.art-reader-tag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase;
  background: rgba(0,0,0,0.3); color: #fff; padding: 4px 10px; border-radius: 100px; display: inline-block;
}
.art-reader-body { padding: 20px; max-width: 480px; margin: 0 auto; word-wrap: break-word; overflow-wrap: break-word; word-break: break-word; }
.art-reader-body h2 { margin: 10px 0 16px; font-size: 21px; color: #f1f5f9; line-height: 1.3; }
.art-reader-body h3 { margin: 22px 0 10px; font-size: 16px; color: #93c5fd; line-height: 1.3; font-weight: 700; }
.art-reader-body p { font-size: 15px; line-height: 1.7; color: #cbd5e1; margin: 0 0 12px; }
.art-reader-body ul, .art-reader-body ol { padding-left: 20px; margin: 0 0 14px; }
.art-reader-body li { font-size: 15px; line-height: 1.6; color: #cbd5e1; margin-bottom: 6px; }
.art-reader-body a { color: #60a5fa; }
.art-reader-footnote { font-size: 11.5px; color: #64748b; margin-top: 24px; text-align: center; }
input, select {
  width: 100%; padding: 13px; margin: 6px 0;
  border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; font-size: 16px;
  background: rgba(255,255,255,0.06); color: #f1f5f9;
}
input::placeholder { color: #94a3b8; }
button {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; margin-top: 8px;
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
  transition: transform 0.15s ease;
}
button:active { transform: scale(0.97); }
button.secondary { background: rgba(255,255,255,0.10); color: #e5e7eb; box-shadow: none; }
button.whatsapp { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 6px 16px rgba(5,150,105,0.35); }
button.ghost { background: rgba(59,130,246,0.15); color: #93c5fd; box-shadow: none; }
button.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 6px 16px rgba(220,38,38,0.4); }
button.sos {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 6px 20px rgba(239,68,68,0.5);
  font-size: 16px;
}
button.call { background: rgba(255,255,255,0.10); color: #fca5a5; box-shadow: none; margin-top: 8px; }
#result { margin-top: 14px; padding: 14px; border-radius: 12px; font-weight: 700; text-align: center; display: none; color: #0f172a; }
.streak { display: flex; align-items: center; justify-content: center; gap: 16px; }
.streak-ring, .score-ring {
  position: relative; width: 74px; height: 74px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.streak-ring { background: conic-gradient(#3b82f6 0deg, #60a5fa 220deg, rgba(255,255,255,0.12) 220deg); }
.streak-ring::before, .score-ring::before {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #131c31;
}
.streak-ring b, .score-ring b { position: relative; font-size: 22px; color: #fff; }
.streak-label { font-size: 14px; color: #cbd5e1; }
.score-card { display: flex; align-items: center; gap: 16px; }
.score-ring { width: 84px; height: 84px; }
.score-text { flex: 1; }
.score-text .label { font-size: 16px; font-weight: 700; color: #fff; }
.score-text .sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.alert-banner {
  background: rgba(248,113,113,0.15); color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.35);
  padding: 13px 16px; border-radius: 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600;
}
.alert-banner.caution {
  background: rgba(251,191,36,0.15); color: #fbbf24;
  border-color: rgba(251,191,36,0.35);
}
.top-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; font-size: 13px; font-weight: 600; line-height: 1.45;
  text-align: center;
  background: linear-gradient(135deg, rgba(251,191,36,0.16), rgba(251,191,36,0.08));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fde68a;
  border-bottom: 1px solid rgba(251,191,36,0.3);
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}
.top-banner .tb-icon { flex-shrink: 0; font-size: 15px; }
.tip-card { background: rgba(52,211,153,0.10); border-color: rgba(52,211,153,0.25); }
.tip-card h3 { color: #6ee7b7 !important; }
.tip-card p { margin: 4px 0 0; color: #a7f3d0; font-size: 14px; }
.med-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.med-row button { width: auto; padding: 9px 16px; margin: 0; font-size: 13px; }
.taken { background: linear-gradient(135deg, #34d399, #059669) !important; }
.history-row { padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; color: #0f172a; }
/* Medication History cards (glassmorphism, matches .card design language) */
.med-history-scroll {
  max-height: 360px; overflow-y: auto; padding-right: 4px; margin-right: -4px;
  scrollbar-width: thin; scrollbar-color: rgba(147,197,253,0.35) transparent;
}
.med-history-scroll::-webkit-scrollbar { width: 6px; }
.med-history-scroll::-webkit-scrollbar-track { background: transparent; }
.med-history-scroll::-webkit-scrollbar-thumb { background: rgba(147,197,253,0.35); border-radius: 10px; }
.med-history-card {
  background: linear-gradient(135deg, rgba(51,65,85,0.95), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,253,0.28);
  border-left: 4px solid #6ee7b7;
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.med-history-card:last-child { margin-bottom: 2px; }
.med-history-name { font-size: 17px; font-weight: 800; color: #ffffff; margin-bottom: 8px; }
.med-history-details { display: flex; flex-direction: column; gap: 5px; }
.med-history-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.med-history-icon { flex-shrink: 0; }
.med-history-label { color: #b8c2d6; font-weight: 600; }
.med-history-value { color: #f1f5f9; margin-left: auto; text-align: right; }
.med-history-badge {
  margin-left: auto; background: rgba(52,211,153,0.22); color: #86efac;
  border: 1px solid rgba(52,211,153,0.45); border-radius: 999px;
  padding: 2px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
}
.summary-grid { display: flex; justify-content: space-between; text-align: center; margin-top: 10px; }
.summary-grid div { flex: 1; }
.summary-grid b { display: block; font-size: 19px; color: #60a5fa; }
.summary-grid span { font-size: 11px; color: #94a3b8; }
.water-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.water-row button { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 20px; margin: 0; }
.water-count { font-size: 26px; font-weight: 700; color: #7dd3fc; min-width: 70px; text-align: center; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.badge { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; text-align: center; opacity: 0.35; }
.badge.unlocked { opacity: 1; background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.4); }
.badge .emoji { font-size: 24px; display: block; margin-bottom: 4px; }
.badge .name { font-size: 11px; color: #cbd5e1; font-weight: 600; }
nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  display: flex; border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 6px; padding-bottom: calc(4px + env(safe-area-inset-bottom));
  z-index: 100;
}
nav button {
  flex: 1; background: none; color: #64748b; box-shadow: none;
  border-radius: 0; margin: 0; padding: 6px 0 8px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  border-top: 3px solid transparent;
}
nav button:active { transform: none; }
nav button .icon { display: block; font-size: 21px; margin-bottom: 2px; filter: grayscale(1) opacity(0.6); }
nav button.active { color: #60a5fa; border-top: 3px solid #3b82f6; }
nav button.active .icon { filter: none; }
#more-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40;
}
#more-sheet {
  position: fixed; left: 0; right: 0; bottom: 84px; z-index: 41;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
#more-sheet button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; box-shadow: none; color: #cbd5e1;
  border-radius: 10px; padding: 12px 10px; margin: 2px 0;
  font-size: 14px; font-weight: 600; text-align: left; border-top: none;
}
#more-sheet button .icon { font-size: 18px; margin-bottom: 0; filter: none; display: inline; }
#more-sheet button.active { background: rgba(96,165,250,0.12); color: #60a5fa; }
.empty { color: #64748b; text-align: center; padding: 24px 0; font-size: 14px; }
#onboarding-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 30% 20%, #1e40af 0%, #0b1220 70%);
  color: white; z-index: 999; display: none; align-items: center; justify-content: center; padding: 24px;
}
#onboarding-overlay .box { max-width: 380px; width: 100%; }
#onboarding-overlay h2 { margin-bottom: 4px; font-size: 24px; }
#onboarding-overlay p { color: #93c5fd; font-size: 14px; margin-top: 0; }
#onboarding-overlay input, #onboarding-overlay select { background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.15); }
#onboarding-overlay button { background: white; color: #1e3a8a; box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
#auth-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 30% 20%, #1e40af 0%, #0b1220 70%);
  color: white; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px;
}
#auth-overlay .box { max-width: 380px; width: 100%; }
#auth-overlay h2 { margin-bottom: 4px; font-size: 24px; }
#auth-overlay p { color: #93c5fd; font-size: 14px; margin-top: 0; }
#auth-overlay input { background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.15); }
#auth-overlay .error { color: #fca5a5; font-size: 13px; margin-top: 6px; min-height: 16px; }

.ai-msg { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.ai-msg.user { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: #1e293b; color: #e2e8f0; border-bottom-left-radius: 4px; }
.ai-msg.typing { opacity: 0.6; font-style: italic; }
#auth-overlay .switch { background: none; color: #93c5fd; font-weight: 500; box-shadow: none; margin-top: 10px; padding: 8px; }
.fa-card { padding: 0; overflow: hidden; }
.fa-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; cursor: pointer; font-weight: 700; font-size: 14px; color: #f1f5f9;
}
.fa-arrow { color: #60a5fa; transition: transform 0.2s ease; font-size: 12px; }
.fa-arrow.open { transform: rotate(180deg); }
.fa-body { padding: 0 20px 18px; }
.fa-body p { font-size: 13px; color: #cbd5e1; line-height: 1.5; margin: 6px 0; }
.fa-body b { color: #93c5fd; }
.radar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.radar-item { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px; text-align: center; }
.radar-item .dot { font-size: 20px; display: block; margin-bottom: 4px; }
.radar-item .label { font-size: 11px; color: #cbd5e1; font-weight: 600; }
.radar-item .status { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.quick-row { display: flex; gap: 8px; }
.quick-btn { flex: 1; width: auto; padding: 10px 4px; font-size: 12px; background: rgba(255,255,255,0.08); color: #cbd5e1; margin-top: 0; box-shadow: none; }
.quick-btn.selected { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.top-row { display: flex; align-items: center; gap: 14px; }
.top-row .score-card { padding: 0; box-shadow: none; background: none; border: none; }
.checkin-toggle { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.radar-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.radar-grid .radar-item { flex: 1 1 28%; padding: 8px 4px; }
#caregiver-overlay {
  position: fixed; inset: 0; z-index: 998; display: none;
  overflow-y: auto; padding: 24px 18px 60px;
  background: radial-gradient(120% 90% at 50% -10%, #16233d 0%, #0f172a 45%, #060a13 100%);
}
.cgv-wrap { max-width: 480px; margin: 0 auto; }
.cgv-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; margin-bottom: 22px; color: #f4f6fb; }
.cgv-brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #38bdf8, #1d4ed8); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.cgv-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: #fb923c; background: rgba(251,146,60,0.14); border: 1px solid rgba(251,146,60,0.3); padding: 4px 10px; border-radius: 100px; margin-left: auto; }
.cgv-h3 { margin: 0 0 14px; font-size: 12.5px; letter-spacing: 0.4px; text-transform: uppercase; color: #93a0b8; }
.cgv-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 14px; color: #f4f6fb; }
.cgv-row:last-child { border-bottom: none; }
.cgv-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.cgv-badge-taken { background: rgba(52,211,153,0.18); color: #86efac; border: 1px solid rgba(52,211,153,0.35); }
.cgv-badge-missed { background: rgba(248,113,113,0.16); color: #fca5a5; border: 1px solid rgba(248,113,113,0.32); }
.cgv-bp-num { font-size: 30px; font-weight: 800; color: #f4f6fb; }
.cgv-bp-level { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 100px; display: inline-block; margin-top: 8px; color: #0f172a; }
.cgv-bp-meta { color: #93a0b8; font-size: 12.5px; margin-top: 8px; }
.cgv-stat-grid { display: flex; gap: 12px; }
.cgv-stat { flex: 1; text-align: center; }
.cgv-stat b { display: block; font-size: 21px; color: #38bdf8; }
.cgv-stat span { font-size: 11px; color: #93a0b8; }
.cgv-last-sync { text-align: center; color: #5c6b87; font-size: 11.5px; margin-top: 10px; }
 /* Medical Passport printing — hidden on screen, shown only when printing.
   Everything else on the page is hidden during print so only the passport
   content ends up on the page/PDF. */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  .print-only, .print-only * { visibility: visible; }
  .print-only {
    display: block; position: absolute; top: 0; left: 0; width: 100%;
    padding: 24px; color: #000; font-size: 14px; line-height: 1.6;
    white-space: normal;
  }
}
/* --- Marketplace: header, category chips, product grid, product reader,
   cart/checkout sheet. Emerald/gold accent so it reads as its own "shop"
   section, distinct from the app's default blue. --- */
.mkt-header {
  background: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(234,179,8,0.14));
  border: 1px solid rgba(110,231,183,0.25);
  border-radius: 22px; padding: 20px 20px 18px; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.mkt-header::before {
  content: ''; position: absolute; top: -40px; right: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,211,153,0.35), transparent 70%);
}
.mkt-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; }
.mkt-header h3 { margin: 0 0 6px; font-size: 20px; color: #f1f5f9; text-transform: none; letter-spacing: 0; font-weight: 800; }
.mkt-header p { margin: 0; font-size: 12.5px; color: #bbf7d0; max-width: 240px; }
.mkt-cart-btn {
  width: 46px; height: 46px; flex-shrink: 0; padding: 0; margin: 0;
  border-radius: 14px; font-size: 20px; position: relative;
  background: rgba(255,255,255,0.14); box-shadow: none;
}
.mkt-cart-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  border-radius: 100px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
  align-items: center; justify-content: center; padding: 0 5px; border: 2px solid #0f172a;
}
.mkt-chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.mkt-chip-row::-webkit-scrollbar { display: none; }
.mkt-chip {
  flex-shrink: 0; width: auto; margin: 0; padding: 9px 14px;
  background: rgba(255,255,255,0.06); color: #cbd5e1; box-shadow: none;
  border-radius: 100px; font-size: 12.5px; font-weight: 600;
}
.mkt-chip.active { background: linear-gradient(135deg, #34d399, #059669); color: #04140c; }
.mkt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 24px; }
.mkt-card {
  border-radius: 20px; overflow: hidden;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 10px 26px rgba(0,0,0,0.28);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.mkt-card:active { transform: scale(0.98); }
.mkt-cover {
  aspect-ratio: 1 / 1; width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mkt-cover-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; position: relative; z-index: 1; }
.mkt-cover-fallback { font-size: 34px; position: absolute; }
.mkt-cart-emoji .mkt-cover-fallback { font-size: 20px; }
.mkt-cover[data-category="mobility"] { background: linear-gradient(135deg, #6366f1, #4338ca); }
.mkt-cover[data-category="safety"] { background: linear-gradient(135deg, #f59e0b, #b45309); }
.mkt-cover[data-category="firstaid"] { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mkt-cover[data-category="support"] { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.mkt-cover[data-category="medaids"] { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.mkt-reader-cover, .mkt-cart-emoji { position: relative; }
.mkt-body { padding: 12px; }
.mkt-cat-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; color: #6ee7b7; margin-bottom: 4px; }
.mkt-body h4 { margin: 0 0 6px; font-size: 13.5px; color: #f1f5f9; font-weight: 700; line-height: 1.3; cursor: pointer; }
.mkt-price { font-size: 14.5px; font-weight: 800; color: #34d399; margin-bottom: 8px; }
.mkt-add-btn { padding: 9px; font-size: 12px; margin: 0; background: rgba(52,211,153,0.15); color: #6ee7b7; box-shadow: none; }

/* Product detail reader — reuses #article-reader-overlay's fixed-panel
   layout/back-button styling, with its own cover + a quantity stepper. */
#product-reader-overlay {
  position: fixed; inset: 0; z-index: 500; display: none;
  background: #0b1220; overflow-y: auto;
}
.mkt-reader-cover {
  aspect-ratio: 4 / 3; width: 100%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.mkt-reader-cover[data-category="mobility"] { background: linear-gradient(135deg, #6366f1, #4338ca); }
.mkt-reader-cover[data-category="safety"] { background: linear-gradient(135deg, #f59e0b, #b45309); }
.mkt-reader-cover[data-category="firstaid"] { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mkt-reader-cover[data-category="support"] { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.mkt-reader-cover[data-category="medaids"] { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.mkt-stepper-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; font-size: 13px; color: #cbd5e1; }
.mkt-stepper { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,0.06); border-radius: 100px; padding: 4px 6px; }
.mkt-stepper button { width: 32px; height: 32px; border-radius: 50%; padding: 0; margin: 0; font-size: 16px; }
.mkt-stepper b { font-size: 15px; min-width: 16px; text-align: center; }
.mkt-stepper-sm button { width: 26px; height: 26px; font-size: 14px; }
.mkt-stepper-sm b { font-size: 13px; }

/* Cart / checkout / confirmation — one bottom sheet, three swappable steps */
.mkt-sheet-backdrop {
  position: fixed; inset: 0; z-index: 600; display: none;
  background: rgba(0,0,0,0.55);
}
.mkt-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh;
  background: #101a2e; border-radius: 22px 22px 0 0; overflow-y: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(0,0,0,0.4);
}
.mkt-sheet-handle { width: 40px; height: 4px; border-radius: 100px; background: rgba(255,255,255,0.18); margin: 6px auto 14px; }
.mkt-sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mkt-sheet-header h3 { margin: 0; font-size: 16px; color: #f1f5f9; font-weight: 800; }
.mkt-sheet-close { width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 50%; background: rgba(255,255,255,0.08); color: #cbd5e1; font-size: 14px; box-shadow: none; }
.mkt-cart-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.mkt-cart-emoji { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.mkt-cart-img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.mkt-cart-info { flex: 1; min-width: 0; }
.mkt-cart-name { font-size: 13.5px; color: #f1f5f9; font-weight: 700; }
.mkt-cart-unit { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.mkt-cart-remove { width: 28px; height: 28px; padding: 0; margin: 0; border-radius: 50%; background: rgba(248,113,113,0.14); color: #fca5a5; font-size: 12px; box-shadow: none; flex-shrink: 0; }
.mkt-cart-total-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 4px; font-size: 15px; color: #f1f5f9; }
.mkt-cart-total-row b { color: #34d399; font-size: 18px; }
.mkt-back-link { width: auto; background: none; box-shadow: none; color: #93c5fd; font-size: 13px; font-weight: 600; padding: 4px 0 10px; margin: 0; text-align: left; }
.mkt-checkout-summary { font-size: 13.5px; color: #cbd5e1; margin-bottom: 12px; }
.mkt-checkout-summary b { color: #34d399; }
.mkt-paystack-note { font-size: 12px; color: #fcd34d; background: rgba(234,179,8,0.1); border: 1px solid rgba(234,179,8,0.25); border-radius: 12px; padding: 10px 12px; margin: 10px 0 4px; line-height: 1.5; }
.mkt-success-check { font-size: 46px; text-align: center; margin: 6px 0 10px; }
.mkt-success-ref { text-align: center; font-size: 13px; font-weight: 800; letter-spacing: 0.4px; color: #6ee7b7; margin-bottom: 8px; }
/* --- AdSense units (Articles & Marketplace only) -----------------------
   Styled to match the surrounding art-card/mkt-card look so ads sit
   quietly in the feed instead of jumping out, with a small "Ad" label
   kept for transparency. Never placed near a tappable button. --- */
.sx-ad-card {
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px; padding: 10px 10px 4px; margin-bottom: 14px;
  position: relative; overflow: hidden; min-height: 100px;
}
.sx-ad-label {
  position: absolute; top: 8px; right: 10px; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase; color: #64748b;
  background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 100px; z-index: 1;
}
.mkt-grid .sx-ad-card { grid-column: 1 / -1; }
.sx-ad-inline { margin: 18px 0 0; }
