/* Biomexa AI Pharmacist — shared by every product's QR landing page.
   Colours follow the Biomexa packaging (navy + green) so the scan feels like part of the box. */
:root {
  --navy: #16336b;
  --navy-2: #1f4494;
  --green: #1c9a55;
  --green-2: #27b566;
  --green-soft: #e8f6ee;
  --blue-soft: #eaf0fb;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #13213d;
  --muted: #5b6b86;
  --line: #e2e8f2;
  --warn: #b45309;
  --warn-soft: #fff6e6;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(19, 33, 61, 0.05), 0 8px 24px rgba(19, 33, 61, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 84px; /* room for the mobile action bar */
}
a { color: var(--navy-2); }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .logo img { height: 34px; width: auto; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.topbar nav a:hover { color: var(--navy); }
.topbar nav .nav-cta {
  color: #fff; background: var(--navy); padding: 8px 14px; border-radius: 999px; font-weight: 600;
}
.topbar nav .nav-cta:hover { color: #fff; background: var(--navy-2); }
@media (max-width: 720px) { .topbar nav .hide-sm { display: none; } }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { margin-top: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card h2 { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.card h2 .ico {
  width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center;
  font-size: 1rem; flex-shrink: 0;
}
.ico.navy { background: var(--blue-soft); color: var(--navy-2); }
.ico.green { background: var(--green-soft); color: var(--green); }
.ico.amber { background: var(--warn-soft); color: var(--warn); }
.card .lead { color: var(--muted); font-size: 0.93rem; margin: 6px 0 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.grid-2 > * { min-width: 0; } /* lets the scrolling tab row scroll instead of widening the page */
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

/* ---------- Hero ---------- */
.hero {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #2458b8 100%);
  color: #fff; border-radius: 24px; overflow: hidden; position: relative;
  box-shadow: 0 12px 32px rgba(22, 51, 107, 0.25);
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(39, 181, 102, 0.35), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 22px; position: relative; z-index: 1; }
@media (min-width: 820px) { .hero-inner { grid-template-columns: 1.1fr 1fr; align-items: center; padding: 36px; gap: 32px; } }
.verified {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(39, 181, 102, 0.18);
  border: 1px solid rgba(39, 181, 102, 0.55); color: #c9f5da; font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.hero h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 6px; }
.hero .composition { color: #cfdcf5; font-size: 1rem; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero .chip { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; }
.hero .greeting { margin-top: 16px; color: #e3ebfb; font-size: 0.97rem; }
.pack { background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.pack img { border-radius: 10px; width: 100%; height: auto; }

/* The four promises printed on the pack */
.promise-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
@media (min-width: 820px) { .promise-grid { grid-template-columns: repeat(4, 1fr); } }
.promise {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.promise:hover { transform: translateY(-2px); border-color: #b9c8e6; }
.promise .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.promise strong { display: block; font-size: 0.9rem; line-height: 1.2; }
.promise span { font-size: 0.75rem; color: var(--muted); }

/* Key facts */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 820px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.fact .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.fact .v { font-weight: 650; font-size: 0.93rem; margin-top: 4px; line-height: 1.35; }
.fact.alert { background: var(--danger-soft); border-color: #f5c7c9; }
.fact.alert .k { color: var(--danger); }

/* ---------- AI guide ---------- */
.guide-head { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: linear-gradient(135deg, var(--green), var(--navy-2)); display: grid; place-items: center;
  color: #fff; font-size: 1.6rem;
}
.avatar::before, .avatar::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--green-2);
  opacity: 0; transform: scale(0.9);
}
.avatar.speaking::before { animation: ring 1.6s ease-out infinite; }
.avatar.speaking::after { animation: ring 1.6s ease-out 0.8s infinite; }
@keyframes ring { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 9px 14px; border-radius: 999px; font-size: 0.87rem; font-weight: 600; cursor: pointer;
  display: inline-flex; gap: 7px; align-items: center;
}
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.guide-text {
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  margin-top: 10px; font-size: 0.95rem; color: #24324f; min-height: 120px;
}
.guide-text .sent.now { background: #fff1b8; border-radius: 4px; box-shadow: 0 0 0 2px #fff1b8; }
.guide-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer;
  font-weight: 650; font-size: 0.95rem; border-radius: 12px; padding: 12px 18px; text-decoration: none;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-2); }
.btn-wa { background: #25d366; color: #073b1c; }
.btn-wa:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #b9c8e6; }
.btn-block { width: 100%; }

/* ---------- Chat ---------- */
.chat-box { display: flex; flex-direction: column; height: 400px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.ai { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.typing { color: var(--muted); font-style: italic; }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button {
  flex-shrink: 0; background: var(--blue-soft); color: var(--navy-2); border: none; border-radius: 999px;
  padding: 7px 12px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.chat-input { display: flex; gap: 8px; padding: 10px; background: var(--card); border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }
.chat-input .btn { padding: 0 16px; }

/* ---------- Forms ---------- */
label.fl { display: block; font-size: 0.83rem; font-weight: 600; color: #34425e; margin-bottom: 6px; }
input, select {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming into fields */
  color: var(--text); background: #fff; border: 1px solid #cfd8e6; border-radius: 12px; padding: 11px 13px;
  outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(31, 68, 148, 0.15); }
.field { margin-bottom: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phone { display: flex; }
.phone .cc {
  display: grid; place-items: center; padding: 0 12px; background: var(--bg); border: 1px solid #cfd8e6;
  border-right: none; border-radius: 12px 0 0 12px; font-weight: 600; color: var(--muted); font-size: 0.95rem;
}
.phone input { border-radius: 0 12px 12px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; cursor: pointer; }
.check input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.check .t { font-weight: 600; font-size: 0.92rem; }
.check .s { font-size: 0.8rem; color: var(--muted); }
.check .time-in { margin-top: 8px; max-width: 160px; padding: 8px 10px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.form-msg { font-size: 0.88rem; margin-top: 12px; border-radius: 12px; padding: 0; }
.form-msg.ok { background: var(--green-soft); color: #11663a; padding: 12px; }
.form-msg.err { background: var(--danger-soft); color: var(--danger); padding: 12px; }

.benefits { list-style: none; display: grid; gap: 8px; margin: 4px 0 18px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.benefits li i { color: var(--green); margin-top: 4px; }

/* ---------- Tips ---------- */
.tip-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .tip-cols { grid-template-columns: 1fr 1fr; } }
.tip-list { border-radius: 14px; padding: 14px 16px; }
.tip-list.do { background: var(--green-soft); }
.tip-list.avoid { background: var(--danger-soft); }
.tip-list h3 { font-size: 0.92rem; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.tip-list.do h3 { color: #11663a; }
.tip-list.avoid h3 { color: var(--danger); }
.tip-list ul { list-style: none; display: grid; gap: 7px; }
.tip-list li { font-size: 0.9rem; padding-left: 18px; position: relative; }
.tip-list li::before { content: '•'; position: absolute; left: 4px; font-weight: 800; }
.urgent { margin-top: 14px; background: var(--warn-soft); border: 1px solid #f3d9a8; border-radius: 14px; padding: 14px 16px; font-size: 0.9rem; }
.urgent strong { color: var(--warn); }

/* ---------- Progress ---------- */
.readings { margin-top: 18px; }
.readings h3 { font-size: 0.9rem; color: var(--muted); margin-bottom: 8px; }
.reading { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 0.9rem; }
.reading .val { font-weight: 700; }
.pill { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pill.ok { background: var(--green-soft); color: #11663a; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- Help links ---------- */
.help-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .help-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .help-grid { grid-template-columns: repeat(4, 1fr); } }
.help {
  display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: var(--text); background: var(--card); transition: border-color .15s ease, transform .15s ease;
}
.help:hover { border-color: #b9c8e6; transform: translateY(-2px); }
.help .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.help strong { display: block; font-size: 0.92rem; }
.help span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer { margin-top: 28px; padding: 24px 16px 12px; text-align: center; color: var(--muted); font-size: 0.8rem; }
footer .links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
footer .links a { color: var(--muted); text-decoration: none; font-weight: 500; }
footer .links a:hover { color: var(--navy); }
footer .disclaimer { max-width: 640px; margin: 0 auto; }

/* ---------- Mobile action bar ---------- */
.actionbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.actionbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 0.7rem; font-weight: 600; padding: 6px 0; border-radius: 10px; }
.actionbar a i { font-size: 1.1rem; color: var(--navy-2); }
.actionbar a.primary i { color: var(--green); }
@media (min-width: 900px) { .chat-box { height: 460px; } }
@media (min-width: 900px) { .actionbar { display: none; } body { padding-bottom: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 0.88rem; z-index: 80;
  transition: all .25s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (min-width: 900px) { .tabs { flex-wrap: wrap; overflow: visible; } }

/* ======================= Product detail pages ======================= */
.hero .desc { margin-top: 14px; color: #e3ebfb; font-size: 0.97rem; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn { padding: 12px 16px; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #eef3fc; }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }

.scan-banner {
  display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, var(--green-soft), #f1f7ff); border: 1px solid #cfe9da;
}
.scan-banner .qr { width: 56px; height: 56px; border-radius: 14px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0; }
.scan-banner strong { font-size: 1.02rem; display: block; }
.scan-banner span { font-size: 0.87rem; color: var(--muted); }
.scan-banner .go { margin-left: auto; color: var(--green); font-size: 1.2rem; flex-shrink: 0; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 820px) { .info-grid { grid-template-columns: repeat(4, 1fr); } }
.info { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.info .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.info .v { font-weight: 700; margin-top: 4px; font-size: 1rem; }
.info .s { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.timeline { list-style: none; margin-top: 14px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.timeline .dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 1.15rem; position: relative; z-index: 1; border: 3px solid var(--card); }
.timeline .dot.dose { background: var(--green); color: #fff; }
.timeline .dot.rest { background: var(--blue-soft); color: var(--navy-2); }
.timeline .dot.no { background: var(--danger-soft); color: var(--danger); }
.timeline .when { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline h3 { font-size: 0.98rem; margin: 1px 0 3px; }
.timeline p { font-size: 0.9rem; color: #3a4863; }

.inter-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 820px) { .inter-list { grid-template-columns: 1fr 1fr; } }
.inter { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.inter .tag { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; display: inline-block; margin-bottom: 4px; }
.inter.avoid { background: var(--danger-soft); border-color: #f5c7c9; } .inter.avoid .tag { background: var(--danger); color: #fff; }
.inter.caution { background: var(--warn-soft); border-color: #f3d9a8; } .inter.caution .tag { background: var(--warn); color: #fff; }
.inter.good { background: var(--green-soft); border-color: #cfe9da; } .inter.good .tag { background: var(--green); color: #fff; }
.inter .ico { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.7); display: grid; place-items: center; flex-shrink: 0; }
.inter.avoid .ico { color: var(--danger); } .inter.caution .ico { color: var(--warn); } .inter.good .ico { color: var(--green); }
.inter h3 { font-size: 0.95rem; }
.inter p { font-size: 0.88rem; color: #3a4863; margin-top: 2px; }

textarea { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1px solid #cfd8e6; border-radius: 12px; padding: 11px 13px; outline: none; resize: vertical; }
textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(31, 68, 148, 0.15); }
.qty { display: flex; align-items: center; gap: 0; width: fit-content; border: 1px solid #cfd8e6; border-radius: 12px; overflow: hidden; }
.qty button { width: 44px; height: 44px; border: none; background: var(--bg); font-size: 1.2rem; cursor: pointer; color: var(--navy); }
.qty input { width: 64px; border: none; border-radius: 0; text-align: center; padding: 10px 4px; box-shadow: none !important; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-note { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); border-radius: 12px; padding: 12px; font-size: 0.85rem; color: #2c3d63; margin-bottom: 16px; }
.order-note i { color: var(--navy-2); margin-top: 3px; }

/* ======================= v2: friendlier AI Pharmacist ======================= */
/* Visual polish */
body { background:
  radial-gradient(1200px 500px at 100% -10%, rgba(39, 181, 102, 0.08), transparent 60%),
  radial-gradient(900px 500px at -10% 10%, rgba(31, 68, 148, 0.08), transparent 60%), var(--bg); }
.card { transition: box-shadow .2s ease, border-color .2s ease; }
.card:hover { box-shadow: 0 1px 2px rgba(19, 33, 61, 0.05), 0 14px 34px rgba(19, 33, 61, 0.1); }
.hero { background:
  radial-gradient(500px 300px at 85% 110%, rgba(39, 181, 102, 0.35), transparent 70%),
  linear-gradient(135deg, #0f2754 0%, var(--navy) 35%, var(--navy-2) 75%, #2458b8 100%); }
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.pack { transform: rotate(-2deg); transition: transform .3s ease; }
.pack:hover { transform: rotate(0) scale(1.01); }
.promise .ico, .help .ico { transition: transform .2s ease; }
.promise:hover .ico, .help:hover .ico { transform: scale(1.08) rotate(-4deg); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Text size toggle */
.size-btn {
  border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; cursor: pointer;
  height: 36px; min-width: 44px; padding: 0 10px; font-weight: 800; font-size: 0.8rem; line-height: 1;
}
.size-btn span { font-size: 1.1rem; margin-left: 1px; }
.size-btn[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
html.big-text { font-size: 118%; }
html.big-text .msg, html.big-text .guide-text { font-size: 1.05rem; }

/* Hero quick-ask */
.hero-ask {
  margin-top: 18px; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 16px;
  padding: 6px 6px 6px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); max-width: 520px;
}
.hero-ask > i { color: var(--green); }
.hero-ask input { border: none; box-shadow: none !important; padding: 10px 6px; min-width: 0; background: transparent; }
.hero-ask button {
  width: 44px; height: 44px; border-radius: 12px; border: none; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1rem;
}
.hero-ask .mic { background: var(--blue-soft); color: var(--navy-2); }
.hero-ask .go { background: var(--green); color: #fff; }
.hero-ask .go:hover { background: var(--green-2); }

/* Guide: progress + speed */
.guide-progress { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.guide-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--navy-2)); transition: width .4s ease; }
.guide-text { max-height: 260px; overflow-y: auto; scroll-behavior: smooth; }
.guide-text .sent { transition: background .2s ease; }
.guide-actions { align-items: center; }
.speed { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.speed button { border: none; background: transparent; padding: 8px 11px; border-radius: 9px; font-size: 0.83rem; font-weight: 650; color: var(--muted); cursor: pointer; }
.speed button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(19, 33, 61, 0.12); }
.guide-meta { font-size: 0.8rem; color: var(--muted); margin-left: auto; }

/* Chat */
.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bot-lg {
  width: 48px; height: 48px; border-radius: 50%; position: relative; flex-shrink: 0; color: #fff; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--green), var(--navy-2)); display: grid; place-items: center;
}
.bot-lg .online { position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.chat-head .status { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
}
.icon-btn:hover { color: var(--navy); border-color: #b9c8e6; }
.chat-box { background: linear-gradient(180deg, #f6f9fd, var(--bg)); }
.msg-row { display: flex; gap: 8px; align-items: flex-end; animation: pop .25s ease; }
.msg-row.user { justify-content: flex-end; }
.msg-row .bot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 0.75rem;
  color: #fff; background: linear-gradient(135deg, var(--green), var(--navy-2));
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg { white-space: normal; max-width: 82%; }
.msg.user { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 6px; }
.msg ul { padding-left: 18px; margin: 4px 0; }
.msg li { margin: 2px 0; }
.msg strong { color: var(--navy); }
.msg.user strong { color: #fff; }
.msg-tools { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.msg-tools button {
  border: none; background: none; color: var(--navy-2); font-size: 0.78rem; font-weight: 650; cursor: pointer;
  padding: 2px 0; display: inline-flex; gap: 6px; align-items: center;
}
.dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa9c2; animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.msg.typing { font-style: normal; }
.suggest { flex-wrap: nowrap; }
.suggest button:hover { background: #dbe6fa; }
.chat-input .mic { padding: 0 14px; color: var(--navy-2); }
.mic.listening { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192, 38, 45, .45); } 100% { box-shadow: 0 0 0 12px rgba(192, 38, 45, 0); } }

/* Trend chart */
.trend { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: #fff; }
.trend-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; margin-bottom: 6px; }
.trend-head span { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.trend .key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.trend .key.l1 { background: var(--navy-2); } .trend .key.l2 { background: var(--green); } .trend .key.band { background: var(--green-soft); border: 1px solid #bfe3cd; }
.trend svg { width: 100%; height: 110px; display: block; overflow: visible; }
.trend rect.band { fill: var(--green-soft); }
.trend path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend path.l1 { stroke: var(--navy-2); } .trend path.l2 { stroke: var(--green); }
.trend circle { stroke: #fff; stroke-width: 1.5; } .trend circle.l1 { fill: var(--navy-2); } .trend circle.l2 { fill: var(--green); }

/* Mobile action bar: make the main action stand out */
.actionbar a.primary { color: #11663a; background: var(--green-soft); }
.actionbar a:active { background: var(--bg); }
@media (max-width: 420px) { .topbar .logo img { height: 28px; } .guide-meta { width: 100%; margin-left: 0; } }

/* ======================= Drug adherence: revolving orbit ======================= */
/* Same motion as the IVF Care page (benefits circling a glowing core on a tilted ring),
   in Biomexa navy + green. Positions are set by ai-pharmacist.js. */
.adh { overflow: hidden; padding: 26px; }
.adh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: center; }
@media (min-width: 900px) { .adh-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 28px; } }
.adh-orbit { position: relative; height: 440px; perspective: 900px; }
.adh-core {
  position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; z-index: 5;
  display: grid; place-content: center; text-align: center; padding: 10px;
  background: radial-gradient(circle at 35% 30%, #4fd18b 0%, #1c9a55 38%, #16336b 82%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset, 0 0 46px rgba(28, 154, 85, .35), 0 0 110px rgba(31, 68, 148, .25);
  animation: adhCore 4s ease-in-out infinite;
}
.adh-core b { color: #fff; font-size: 1.12rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.adh-core span { color: #d6f7e4; font-size: .72rem; font-weight: 700; margin-top: 4px; }
@keyframes adhCore { 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset, 0 0 66px rgba(28, 154, 85, .5), 0 0 150px rgba(31, 68, 148, .35); } }
.adh-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%) rotateX(72deg); pointer-events: none; }
.adh-ring-a { width: 420px; height: 420px; border: 1px solid rgba(31, 68, 148, .35); box-shadow: 0 0 18px rgba(31, 68, 148, .12); }
.adh-ring-b { width: 290px; height: 290px; border: 1px dashed rgba(28, 154, 85, .5); animation: adhSpin 30s linear infinite; }
@keyframes adhSpin { to { transform: translate(-50%, -50%) rotateX(72deg) rotateZ(360deg); } }
.adh-node {
  position: absolute; left: 50%; top: 50%; width: 172px; padding: 10px 11px; border-radius: 15px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center;
  background: rgba(255, 255, 255, .94); border: 1px solid #d6e0f3; box-shadow: 0 14px 30px rgba(19, 33, 61, .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); will-change: transform, opacity;
}
.adh-node i { grid-row: span 2; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 1.05rem; }
.adh-node b { font-size: .84rem; line-height: 1.2; color: var(--text); }
.adh-node small { font-size: .7rem; line-height: 1.3; color: var(--muted); }
.adh-node.front { border-color: var(--green); box-shadow: 0 0 0 1px rgba(28, 154, 85, .2) inset, 0 16px 34px rgba(28, 154, 85, .22); }
.adh-kicker { display: inline-flex; gap: 8px; align-items: center; font-size: .78rem; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 5px 11px; border-radius: 999px; }
.adh-copy h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 12px 0 8px; display: block; }
.adh-copy > p { color: var(--muted); font-size: .94rem; }
.adh-steps { list-style: none; counter-reset: s; display: grid; gap: 10px; margin: 16px 0 18px; }
.adh-steps li { counter-increment: s; position: relative; padding: 3px 0 0 40px; font-size: .9rem; min-height: 28px; line-height: 1.45; }
.adh-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--green), var(--navy-2));
}
.adh-steps b { color: var(--navy); margin-right: 4px; }
@media (max-width: 600px) {
  .adh { padding: 16px; }
  .adh-orbit { height: 330px; }
  .adh-ring-a { width: 210px; height: 210px; }
  .adh-ring-b { width: 150px; height: 150px; }
  .adh-core { width: 108px; height: 108px; margin: -54px 0 0 -54px; }
  .adh-core b { font-size: .86rem; }
  .adh-core span { font-size: .6rem; }
  .adh-node { width: 118px; padding: 7px 8px; column-gap: 6px; border-radius: 12px; }
  .adh-node i { width: 28px; height: 28px; font-size: .85rem; border-radius: 9px; }
  .adh-node b { font-size: .72rem; }
  .adh-node small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .adh-core, .adh-ring-b { animation: none !important; } }
