/* Module pages: /modules/patient-records, appointments, e-prescriptions, lab-radiology,
   billing-insurance, pharmacy-inventory, dental, analytics (Pages/Modules/Index.cshtml + one partial each).
   Product mock-ups are lang="en" dir="ltr" on both languages, so their insides use physical left/right;
   everything around them uses logical properties so /ar mirrors. */

[lang="ar"] { font-family: var(--font-ar); }
[lang="en"] { font-family: var(--font); }

/* ================= Template ================= */

/* ---------- Hero ---------- */
.m-hero { position: relative; padding: 40px 0 80px; overflow: hidden; }
.m-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, #D5DBE3 1px, transparent 0); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 75% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 60% at 75% 30%, #000 20%, transparent 75%);
}
html[dir="rtl"] .m-dots {
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 25% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 60% at 25% 30%, #000 20%, transparent 75%);
}
.m-glow {
  position: absolute; width: 640px; height: 640px; inset-inline-end: -140px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 20, 44, .12), rgba(224, 20, 44, 0) 65%);
}
.m-hero .wrap { position: relative; display: flex; flex-direction: column; gap: 32px; }
.m-crumb { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--slate-3); }
.m-crumb a { color: var(--slate-3); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.m-crumb a:hover { color: var(--red-hover); }
.m-crumb [aria-current] { color: var(--ink); }
.m-hero-row { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.m-hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.m-label { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; color: var(--navy); }
.m-label .ic { width: 40px; height: 40px; }
.m-hero-copy .h1 { font-size: 60px; margin: 0; animation-delay: .06s; }
.m-hero-copy .lead { font-size: 19px; animation-delay: .12s; }
.m-btns { display: flex; flex-wrap: wrap; gap: 12px; animation-delay: .18s; }
.m-plan { font-size: 14px; color: var(--slate-2); animation-delay: .24s; }
.m-plan a { font-weight: 700; }
@media (max-width: 900px) { .m-hero-copy .h1 { font-size: 42px; } }

.m-hero-art { flex: 1 1 460px; min-width: 0; position: relative; animation-delay: .15s; }
.m-backing { position: absolute; inset-block: 30px -20px; inset-inline: 30px -20px; border-radius: 26px; background: var(--navy); }
.m-shot { position: relative; padding: 24px; box-shadow: 0 40px 70px -40px rgba(26, 36, 51, .8); display: flex; flex-direction: column; gap: 16px; text-align: left; color: var(--ink); }
.m-shot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.m-shot-head b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.m-shot-head .m-shot-sub { display: block; font-size: 13px; color: var(--slate-2); }
.m-shot .tag, .m-panel .tag, .m-wide .tag { letter-spacing: .07em; }

/* ---------- Sub-nav (scroll-spy in module.js) ---------- */
.subnav {
  position: sticky; top: 62px; z-index: 50;
  background: rgba(246, 247, 249, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.subnav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sn-list { display: flex; overflow-x: auto; margin-inline-start: -14px; scrollbar-width: none; }
.sn-list::-webkit-scrollbar { display: none; }
.sn {
  position: relative; display: inline-flex; align-items: center; min-height: 52px; padding: 0 14px;
  color: var(--slate); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; transition: color .2s;
}
.sn:hover { color: var(--ink); }
.sn::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: -1px; height: 3px; border-radius: 3px;
  background: var(--red); transform: scaleX(0); transition: transform .3s ease;
}
.sn.on { color: var(--ink); }
.sn.on::after { transform: scaleX(1); }
.btn-s { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; box-shadow: none; }
.subnav .btn-s { min-height: 40px; }
.m-sec { scroll-margin-top: 120px; }

/* ---------- Shared layout bits ---------- */
.m-col { display: flex; flex-direction: column; gap: 40px; }
.m-col > .rv .eyebrow, .m-copy .eyebrow { margin-bottom: 14px; }
.m-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.m-grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .m-grid3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- What it fixes ---------- */
.m-fix { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.m-fix > div { display: flex; flex-direction: column; gap: 6px; }
.m-fix .badge { align-self: flex-start; }
.m-before { font-size: 16px; line-height: 1.55; color: var(--slate); text-decoration: line-through; text-decoration-color: rgba(224, 20, 44, .5); }
.m-fix b { font-size: 18px; line-height: 1.4; letter-spacing: -0.01em; }
html[lang="ar"] .m-fix b { letter-spacing: 0; }
.m-fix-arr { color: #C2C9D3; }

/* ---------- How it works: steps cycle until one is picked ---------- */
.hw {
  padding: 26px; display: flex; flex-direction: column; gap: 14px; text-align: start;
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color .4s, box-shadow .4s, transform .4s;
}
.hw:hover { border-color: #C9D1DC; }
.hw.on { border-color: var(--red); box-shadow: 0 30px 50px -36px rgba(224, 20, 44, .6); transform: translateY(-6px); }
.hw-h { display: flex; align-items: center; gap: 12px; }
.hw-h b { font-size: 19px; letter-spacing: -0.01em; }
.num {
  width: 40px; height: 40px; border-radius: 12px; background: var(--red-tint); color: var(--red);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0;
  transition: background .4s, color .4s;
}
.hw.on .num { background: var(--red); color: #fff; }
.hw-d { font-size: 15px; line-height: 1.6; color: var(--slate); }
.hw-chips { background: var(--ground); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.hw-chips .badge { font-size: 13px; padding: 6px 12px; }

/* ---------- Works with ---------- */
.m-rel { padding: 96px 0 64px; background: var(--mist); }
.rel { display: flex; flex-direction: column; gap: 10px; padding: 22px; text-decoration: none; color: var(--ink); transition: transform .3s, box-shadow .3s, border-color .3s; }
.rel:hover { transform: translateY(-6px); box-shadow: 0 26px 44px -28px rgba(26, 36, 51, .55); border-color: #C9D1DC; color: var(--ink); }
.rel:hover .ic { background: var(--red); color: #fff; }
.rel b { font-size: 17px; }
.rel > span:last-child { font-size: 14px; line-height: 1.55; color: var(--slate); }

/* ---------- FAQ ---------- */
.m-faqs { padding: 96px 0 104px; }
.m-faqs .wrap { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.m-faqs-head { flex: 1 1 300px; min-width: 0; }
.m-faqs-head .lead { font-size: 16px; }
.m-faqs-head .lead a { font-weight: 700; }
.m-faqs-list { flex: 2 1 520px; min-width: 0; }
.m-faq-ph { padding-inline: 14px; border-radius: 12px; margin-bottom: 8px; }
/* Unconfirmed sentence on a real answer (Development only) */
.m-ph { display: inline; padding: 1px 6px; border-radius: 6px; font-size: .92em; color: var(--slate-3); }

/* ---------- Call to action ---------- */
.m-cta { padding: 0 24px 96px; }
.m-cta-box {
  position: relative; overflow: hidden; max-width: 1152px; margin: 0 auto; border-radius: 30px; padding: 64px 32px;
  text-align: center; color: #fff; background: var(--navy-deep); display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.m-cta-box > * { position: relative; }
.m-cta-glow {
  position: absolute !important; width: 700px; height: 700px; left: 50%; top: -380px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(224, 20, 44, .35), rgba(224, 20, 44, 0) 62%);
}
.m-cta-ecg { position: absolute !important; left: 0; right: 0; bottom: 14px; width: 100%; height: 80px; }
.m-cta-box .h2 { color: #fff; max-width: 720px; margin: 0; }
.m-cta-box .lead { color: var(--on-dark); text-align: center; }
.m-cta-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 40px; }
@media (max-width: 480px) { .m-cta { padding: 0 16px 72px; } .m-cta-box { padding: 48px 20px; } }

/* ================= Demo sections (shared) ================= */
.m-dark { position: relative; overflow: clip; padding: 104px 0; color: #fff; }
.m-dark .wrap { position: relative; }
.m-dark-glow {
  position: absolute; width: 760px; height: 760px; inset-inline-end: -260px; top: -300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 20, 44, .22), rgba(224, 20, 44, 0) 62%);
}
.m-dark-glow.start { inset-inline-end: auto; inset-inline-start: -260px; }
.m-split { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.m-rev { flex-wrap: wrap-reverse; align-items: center; }
.m-copy { flex: 1 1 340px; min-width: 0; }
.m-copy-top { max-width: 680px; }
.m-col > .m-copy { flex: none; } /* the 340px basis is a width in rows; in this column it would become a min height */
.m-wide { flex: 1.3 1 480px; min-width: 0; }
.m-sec:not(.m-dark) .m-split > .m-copy { transition-delay: .12s; }
@media (max-width: 900px) { .m-dark { padding: 80px 0; } }

/* Translucent panel on dark sections */
.m-panel {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); border-radius: 24px; padding: 26px;
  display: flex; flex-direction: column; gap: 18px; text-align: left;
}
.m-panel.rv { transition-delay: .12s; }
.m-panel .tag { color: #8C99AC; }
.m-panel-in { display: flex; flex-direction: column; gap: 20px; }
.m-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.m-panel-head b, .m-panel-t { display: block; font-size: 20px; font-weight: 800; margin-top: 2px; letter-spacing: -0.01em; }
.m-panel-sub { font-size: 13px; color: var(--on-dark); }
.card .m-panel-sub, .ph-stock .m-panel-sub { color: var(--slate-3); font-size: 12px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.m-fs legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 10px; }
.m-dark .m-fs legend { color: var(--on-dark); }
.m-note { margin: 0; font-size: 12px; color: #8C99AC; }
.card .m-note { color: var(--slate-3); }
.m-reset {
  background: none; border: 0; color: #DCE3EC; font: inherit; font-weight: 700; cursor: pointer;
  min-height: 44px; padding: 0 4px; text-decoration: underline; font-size: 14px;
}
.m-reset.red { color: var(--red-hover); text-decoration: none; }
.m-ticks { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; font-weight: 600; color: #DCE3EC; }
.m-ticks li { display: flex; gap: 12px; align-items: center; }
.m-ticks li > span { width: 28px; height: 28px; border-radius: 8px; background: rgba(224, 20, 44, .2); color: var(--red-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[lang="ar"] { font-family: var(--font-ar); }
.dchip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #DCE3EC;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s;
}
.dchip:hover { border-color: #fff; color: #fff; }
.dchip.on { background: var(--red); border-color: var(--red); color: #fff; }
.dchip.lite.on { background: #fff; border-color: #fff; color: var(--ink); }
.dchip-n { opacity: .7; }
.dchip:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.dchip:disabled:hover { border-color: rgba(255, 255, 255, .25); color: #DCE3EC; }
.btn-p:disabled { background: #5A6474; box-shadow: none; cursor: not-allowed; transform: none; }

/* Motion helpers */
.fade { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.fade.on { opacity: 1; transform: none; }
.slide { opacity: 0; transform: translateX(-14px); transition: opacity .45s ease, transform .45s ease; }
.slide.on { opacity: 1; transform: none; }
.drop { opacity: 0; transform: translateY(-16px) scale(.96); transition: opacity .45s ease, transform .5s cubic-bezier(.2, .7, .2, 1.3); }
.drop.on { opacity: 1; transform: none; }
.coll { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s ease, opacity .3s ease; }
.coll.on { grid-template-rows: 1fr; opacity: 1; }
.coll > div { overflow: hidden; }
.tl, .row { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .45s ease, opacity .35s ease; }
.tl.hide, .row.hide { grid-template-rows: 0fr; opacity: 0; }
.tl > div, .row > div { overflow: hidden; }
.pop { animation: pop .5s cubic-bezier(.2, .7, .2, 1.4) both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.bubble { animation: bub .5s cubic-bezier(.2, .7, .2, 1.3) both; }
@keyframes bub { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.res, .prow { animation: res .45s cubic-bezier(.2, .7, .2, 1.2) both; }
@keyframes res { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.caret { display: inline-block; width: 2px; height: 18px; background: var(--red); margin-left: 2px; vertical-align: middle; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.flash { animation: flash .9s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(224, 20, 44, .6); } 100% { box-shadow: 0 0 0 14px rgba(224, 20, 44, 0); } }

/* Phone mock-up (WhatsApp / SMS) */
.ap-phone { flex: 0 0 280px; max-width: 100%; margin: 0 auto; background: var(--ink); border-radius: 40px; padding: 12px; box-shadow: 0 40px 70px -40px rgba(26, 36, 51, .9); }
.ap-screen { background: #EAE3D9; border-radius: 30px; height: 470px; overflow: hidden; display: flex; flex-direction: column; text-align: left; transition: background .3s; }
.ap-chat-head { background: var(--ok); color: #fff; padding: 18px 16px 14px; display: flex; align-items: center; gap: 10px; transition: background .3s; }
.ap-chat-head img { width: 34px; height: 34px; background: #fff; border-radius: 50%; padding: 3px; }
.ap-chat-head > span { display: flex; flex-direction: column; }
.ap-chat-head b { font-size: 14px; }
.ap-chat-head > span > span { font-size: 11px; opacity: .8; }
.ap-chat { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; }
.ap-in {
  align-self: flex-start; max-width: 88%; background: #fff; color: var(--ink); border-radius: 4px 16px 16px 16px;
  padding: 10px 12px; font-size: 13px; line-height: 1.55; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); white-space: pre-line; text-align: start;
}
.ap-phone.sms .ap-screen { background: #F2F3F5; }
.ap-phone.sms .ap-chat-head { background: var(--navy); }

/* Shared demo: bar chart columns that grow once revealed (.in comes from the scroll reveal) */
.m-bar { display: block; width: 100%; max-width: 64px; height: 0; background: var(--navy); border-radius: 8px 8px 0 0; transition: height 1.1s cubic-bezier(.2, .7, .2, 1), background .3s; }
.m-bar.red { background: var(--red); }
.in .m-bar { height: var(--h); }
.aging { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.in .aging { width: var(--w); }
.bi-rep-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bi-rep-h b { font-size: 17px; }
.bi-rep-h > span { font-size: 13px; color: var(--slate-3); }
.bi-bar-l { display: flex; gap: 14px; padding: 8px 4px 0; }
.bi-bar-l span { flex: 1; min-width: 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--slate-2); }

/* ================= Patient records ================= */
.pr-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid #EEF1F4; }
.pr-ini { width: 52px; height: 52px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.pr-who { flex: 1; min-width: 0; }
.pr-who b { display: block; font-size: 18px; }
.pr-who > span { font-size: 13px; color: var(--slate-3); }
.nw { white-space: nowrap; }
.m-shot .pr-items { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; position: relative; }
.pr-rail { position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px; background: #EEF1F4; }
.pr-item { display: flex; gap: 14px; align-items: center; padding: 8px 0; position: relative; }
.pr-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pr-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-txt b { font-size: 14px; }
.pr-txt span { font-size: 12px; color: var(--slate-3); }

.pr-tl { display: flex; flex-direction: column; }
.pr-tl-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.pr-tl-date { width: 58px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #8C99AC; padding-top: 8px; }
.pr-tl-ic { width: 34px; height: 34px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pr-tl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pr-tl-txt b { font-size: 15px; }
.pr-tl-txt span { font-size: 13px; color: var(--on-dark); }

.pr-consent { flex: 1.2 1 480px; min-width: 0; display: flex; flex-wrap: wrap; gap: 16px; text-align: left; }
.pr-form { flex: 1.2 1 300px; min-width: 0; padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 40px 70px -48px rgba(26, 36, 51, .7); }
.pr-form-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-form-t { font-size: 20px; letter-spacing: -0.02em; }
.pr-form p { font-size: 14px; line-height: 1.6; color: var(--slate); }
.pr-form p[lang="ar"] { line-height: 1.7; }
.pr-sig { border: 1.5px dashed #C9D1DC; border-radius: 14px; height: 110px; position: relative; background: #FAFBFC; }
.pr-sig svg { position: absolute; inset: 8px 10px 30px; width: calc(100% - 20px); height: calc(100% - 38px); }
.pr-sig span { position: absolute; left: 14px; bottom: 10px; font-size: 13px; color: #8A95A6; }
.sig { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s ease; }
.sig.on { stroke-dashoffset: 0; }
.pr-audit { flex: 1 1 220px; min-width: 0; padding: 22px; background: var(--navy); border-color: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 12px; }
.pr-audit .tag { color: var(--on-dark); }
.pr-audit-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.pr-audit-row > span:last-child { display: flex; flex-direction: column; }
.pr-audit-row b { font-size: 14px; }
.pr-audit-row > span:last-child span { color: var(--on-dark); }
.pr-audit-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }

/* ================= Appointments ================= */
.ap-day { padding: 22px; gap: 14px; }
.ap-day .m-shot-head b { font-size: 20px; margin-top: 0; }
.ap-grid { display: grid; grid-template-columns: 52px repeat(3, minmax(0, 1fr)); grid-template-rows: 32px repeat(6, 46px); gap: 6px; }
.ap-doc { font-size: 12px; font-weight: 800; color: var(--navy); display: flex; align-items: center; justify-content: center; background: var(--ground); border-radius: 8px; text-align: center; }
.ap-time { grid-column: 1; font-size: 12px; color: var(--slate-3); font-weight: 600; display: flex; align-items: center; }
.ap-cell { border: 1px dashed #E5E9EE; border-radius: 8px; }
.ap-block { border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; justify-content: center; line-height: 1.25; overflow: hidden; border-left: 3px solid; min-width: 0; }
.ap-block span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-block span:last-child { font-weight: 600; opacity: .8; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-block.conf { background: #E2EAF7; color: #1F4687; border-color: #3A6EA5; }
.ap-block.online { background: var(--red-tint); color: var(--red-dark); border-color: var(--red); }
.ap-block.walk { background: #FDEBCF; color: #7A4700; border-color: #C08A2B; }

.ap-form { display: flex; flex-direction: column; gap: 20px; }
.ap-form .m-panel-head img { width: 34px; height: 34px; }
.ap-docs { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-docb {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .18);
  background: transparent; color: #fff; cursor: pointer; text-align: left; min-height: 56px; transition: all .2s; flex: 1 1 180px;
}
.ap-docb:hover { border-color: #fff; }
.ap-docb.on { border-color: var(--red); background: rgba(224, 20, 44, .15); }
.ap-docb > span:last-child { display: flex; flex-direction: column; }
.ap-docb b { font-size: 14px; }
.ap-docb > span:last-child span { font-size: 12px; color: var(--on-dark); }
.ap-ini { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--red); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.ap-day-b { flex-direction: column; gap: 2px; min-height: 52px; min-width: 64px; padding: 6px 14px; border-radius: 14px; }
.ap-day-b span { font-size: 12px; opacity: .8; }
.ap-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.ap-slots .dchip { border-radius: 14px; }
.ap-go { width: 100%; }
.ap-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 20px 0; }
.ap-tick { width: 84px; height: 84px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; }
.ap-done-t { font-size: 26px; letter-spacing: -0.02em; }
.ap-sum { width: 100%; max-width: 380px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 6px 18px; text-align: left; }
.ap-sum > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed rgba(255, 255, 255, .12); font-size: 14px; }
.ap-sum > div:last-child { border-bottom: 0; }
.ap-sum span { color: var(--on-dark); }
.ap-sum b { text-align: right; }
.ap-sched { font-size: 13px; padding: 7px 12px; white-space: normal; }

.ap-rem { flex: 1.2 1 480px; min-width: 0; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.ap-set { flex: 1 1 240px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; text-align: left; }

/* ================= E-prescriptions ================= */
.rx-hero { min-height: 430px; gap: 0; }
/* Collapsed steps must not add gaps, so spacing lives inside each step */
.rx-hero .rx-search, .rx-hero .coll > div > * { margin-top: 14px; }
.m-pt { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #EEF1F4; }
.m-pt-ini { width: 44px; height: 44px; border-radius: 50%; background: var(--mist); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.m-pt-who { flex: 1; min-width: 0; }
.m-pt-who b { display: block; }
.m-pt-who span { font-size: 13px; color: var(--slate-2); }
.rx-search { border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; transition: border-color .3s; }
.rx-search.alert { border-color: var(--red); }
.rx-q { font-size: 15px; font-weight: 600; white-space: nowrap; }
.rx-cat { margin-left: auto; font-size: 12px; color: var(--slate-3); white-space: nowrap; }
.rx-sugs { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rx-sugs > div { padding: 10px 14px; font-size: 14px; display: flex; justify-content: space-between; background: #fff; border-top: 1px solid #EEF1F4; }
.rx-sugs > div:first-child { border-top: 0; }
.rx-sugs > div.on { background: var(--red-tint); }
.rx-sugs b { font-weight: 600; }
.rx-sugs span { color: var(--slate-3); font-size: 12px; }
.rx-sel { background: var(--ground); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rx-sel > span:first-child { display: flex; flex-direction: column; }
.rx-sel > span:first-child span { font-size: 13px; color: var(--slate-2); }
.rx-alert { background: var(--red-tint); color: var(--red-dark); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; font-size: 14px; font-weight: 600; align-items: flex-start; }
.rx-alert svg { flex-shrink: 0; }
.rx-alert b { display: block; }
.rx-signed { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 4px; }
.rx-signed > span:first-child { font-size: 13px; color: var(--ok); font-weight: 700; display: flex; align-items: center; gap: 6px; }

.rx-results { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 18px; min-height: 120px; }
.res { display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; border: 1px solid; }
.res-ic { width: 32px; height: 32px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.res > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.res b { font-size: 15px; }
.res > span:last-child span { font-size: 14px; color: #DCE3EC; line-height: 1.5; }
.res.allergy, .res.major { background: rgba(224, 20, 44, .16); border-color: rgba(255, 138, 151, .45); }
.res.allergy .res-ic, .res.major .res-ic { background: var(--red); }
.res.moderate { background: rgba(192, 138, 43, .18); border-color: rgba(242, 190, 98, .4); }
.res.moderate .res-ic { background: #C08A2B; }
.res.minor { background: rgba(58, 110, 165, .2); border-color: rgba(125, 180, 240, .4); }
.res.minor .res-ic { background: #3A6EA5; }
.res.none { background: rgba(11, 138, 85, .16); border-color: rgba(123, 224, 174, .4); }
.res.none .res-ic { background: #0B8A55; }

.rx-print { flex: 1.1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.rx-papers { width: 100%; max-width: 480px; }
.rx-paper {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 34px 32px; color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(26, 36, 51, .5), 0 2px 0 #fff, 0 4px 0 #EEF1F4, 0 6px 0 #fff, 0 8px 0 #E5E9EE;
  display: flex; flex-direction: column; gap: 14px; text-align: start;
}
.rx-paper-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--red); }
.rx-paper-top img { height: 24px; width: auto; }
.rx-paper-top > span { text-align: end; }
.rx-paper-top b { display: block; font-size: 15px; }
.rx-paper-top > span > span { font-size: 12px; color: var(--slate-3); }
.rx-paper-t { font-size: 22px; letter-spacing: -0.01em; }
.rx-paper-head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--slate); }
.rx-paper-item { border: 1px solid #E5E9EE; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.rx-paper-item b { font-size: 16px; }
.rx-paper-item span { font-size: 14px; color: var(--slate); line-height: 1.6; }
.rx-paper-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 8px; }
.rx-paper-foot > span:first-child { font-size: 12px; color: var(--slate-3); max-width: 60%; }
.rx-paper-sig { text-align: center; font-size: 12px; color: var(--slate-3); }
.rx-paper-sig > span { display: block; border-top: 1px solid #C9D1DC; padding-top: 4px; }
@media (max-width: 480px) { .rx-paper { padding: 24px 18px; } .rx-paper-head { grid-template-columns: minmax(0, 1fr); } }

/* ================= Lab & radiology ================= */
.lb-table { border: 1px solid #E5E9EE; border-radius: 14px; overflow: hidden; }
.lb-tr { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 8px; padding: 11px 14px; border-top: 1px solid #EEF1F4; font-size: 14px; align-items: center; background: #fff; transition: background .4s; }
.lb-tr > span:first-child { font-weight: 600; }
.lb-th { padding: 10px 14px; background: var(--ground); border-top: 0; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-3); }
.lb-th > span:first-child { font-weight: 800; }
.lb-v { font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-tr.high .lb-v { color: #B30F23; }
.lb-tr.high.on { background: #FFF5F6; }
.lb-tr.on .fade { opacity: 1; transform: none; }
.lb-v .badge { padding: 2px 7px; font-size: 11px; }
.lb-ref { color: var(--slate-3); font-size: 13px; }
.lb-done { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ok); }

.lb-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.test {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .18);
  background: transparent; color: #fff; cursor: pointer; text-align: left; min-height: 52px; transition: all .2s; width: 100%;
}
.test:hover { border-color: #fff; }
.test.on { border-color: var(--red); background: rgba(224, 20, 44, .14); }
.test:disabled { cursor: default; }
.test .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .5); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s; }
.test .box svg { opacity: 0; transition: opacity .2s; }
.test.on .box { background: var(--red); border-color: var(--red); }
.test.on .box svg { opacity: 1; }
.test-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.test-t b { font-size: 14px; }
.test-t span { font-size: 12px; color: var(--on-dark); }
.test-p { font-size: 13px; font-weight: 700; color: #DCE3EC; white-space: nowrap; }
.lb-send { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); flex-wrap: wrap; font-size: 15px; color: var(--on-dark); }
.lb-send b { color: #fff; }
.lb-sent { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 14px; background: rgba(46, 196, 125, .12); color: #fff; font-size: 14px; font-weight: 700; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.lb-sent svg { color: #5BD69A; flex-shrink: 0; }
.lb-sent.on { opacity: 1; transform: none; }
.line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s cubic-bezier(.2, .7, .2, 1) .1s; }
.pt { opacity: 0; transition: opacity .4s ease; }
.in .stack > .on .line { stroke-dashoffset: 0; }
.in .stack > .on .pt { opacity: 1; }

/* ================= Billing & insurance ================= */
.bi-hero { position: relative; }
.bi-hero .m-shot { padding: 28px; gap: 0; }
.bi-no { font-size: 24px !important; }
.bi-hero .m-shot-head img { width: 40px; height: 40px; }
.bi-lines { margin-top: 14px; }
.li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px dashed #E5E9EE; font-size: 14px; opacity: 0; transform: translateX(-14px); transition: opacity .45s ease, transform .45s ease; }
.li.on { opacity: 1; transform: none; }
.li > span { display: flex; flex-direction: column; }
.li > span span { font-size: 12px; color: var(--slate-3); }
.li > b { white-space: nowrap; }
.bi-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 2px solid var(--ink); margin-top: 4px; }
.bi-total b:first-child { font-size: 16px; }
.bi-total b:last-child { font-size: 26px; letter-spacing: -0.02em; }
.bi-split { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.splitbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--mist); }
.splitbar span { transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.bi-ins { background: var(--navy); }
.bi-pat { background: var(--red); }
.bi-split .bi-ins, .bi-split .bi-pat { width: 0; }
.bi-split.on .bi-ins { width: 80%; }
.bi-split.on .bi-pat { width: 20%; }
.bi-keys { display: flex; justify-content: space-between; font-size: 14px; flex-wrap: wrap; gap: 8px; }
.bi-keys > span { display: flex; align-items: center; gap: 8px; }
.bi-key { width: 10px; height: 10px; border-radius: 3px; }
.bi-key.ins { background: var(--navy); }
.bi-key.pat { background: var(--red); }
.bi-claim {
  position: absolute; z-index: 2; right: -10px; top: -22px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 20px 40px -20px rgba(26, 36, 51, .6); color: var(--ink);
}
.bi-claim > span:last-child { display: flex; flex-direction: column; }
.bi-claim b { font-size: 14px; }
.bi-claim > span:last-child span { font-size: 12px; color: var(--slate-2); }
.bi-claim-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
@media (max-width: 480px) { .bi-claim { right: 8px; top: -30px; } }

.bi-rec { text-align: right; }
.bi-rec > span { font-size: 13px; color: #8C99AC; }
.bi-rec b { display: block; font-size: 26px; font-weight: 800; color: #7BE0AE; letter-spacing: -0.02em; margin: 0; }
.bi-queue { display: flex; flex-direction: column; gap: 10px; }
.rq { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: background .5s, border-color .5s; }
.rq[data-st="ok"] { background: rgba(11, 138, 85, .14); border-color: rgba(93, 212, 150, .35); }
.rq[data-st="no"] { background: rgba(224, 20, 44, .1); border-color: rgba(255, 179, 188, .3); }
.rq-t { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rq-t > span:first-child { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq-t b { font-size: 15px; }
.rq-t > span:first-child span { font-size: 13px; color: var(--on-dark); }
.rq-sub { font-size: 13px; color: #8C99AC; }
.rq-amt { font-size: 16px; white-space: nowrap; }
.rq-st { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.rq-st button {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: transparent;
  color: #DCE3EC; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s;
}
.rq-st button:hover { border-color: #fff; color: #fff; }
.rq-st button.on { background: #fff; border-color: #fff; color: var(--navy); }
.rq-st button.on[data-st="ok"] { background: #5BD69A; border-color: #5BD69A; color: #0B3B26; }
.rq-st button.on[data-st="no"] { background: #FF8A99; border-color: #FF8A99; color: #4A0711; }
.disp { background: var(--red); color: #fff; border: 0; border-radius: 10px; min-height: 44px; padding: 0 16px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .2s, transform .2s; }
.disp:hover { background: var(--red-hover); transform: translateY(-2px); }
.bi-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.bi-pay { padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 40px 70px -48px rgba(26, 36, 51, .7); text-align: left; }
.bi-pay .m-panel-head { align-items: baseline; }
.bi-amt { font-size: 22px !important; }
.bi-cov { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy); }
.bi-cov > span { display: flex; justify-content: space-between; }
.bi-cov input { width: 100%; min-height: 44px; }
.bi-bar { height: 18px; }
.bi-pays { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bi-pays > div { border-radius: 14px; padding: 14px 16px; }
.bi-pays span { font-size: 13px; font-weight: 600; color: var(--slate-2); }
.bi-pays b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.bi-pays b span { font-size: inherit; font-weight: inherit; color: inherit; }
.bi-pays .ins { background: var(--ground); }
.bi-pays .ins b { color: var(--navy); }
.bi-pays .pat { background: var(--red-tint); }
.bi-pays .pat span, .bi-pays .pat b { color: var(--red-dark); }
.bi-receipt { border-top: 1px dashed #E5E9EE; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.bi-receipt > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--slate); }
.bi-receipt b { color: var(--ink); }
@media (max-width: 480px) { .bi-pays b { font-size: 19px; } .bi-pay { padding: 22px 18px; } }

.bi-reps { display: flex; flex-wrap: wrap; gap: 18px; }
.bi-rep { flex: 1 1 340px; min-width: 0; padding: 26px; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.bi-rep-wide { flex: 1.3 1 460px; gap: 0; }
.bi-bars { display: flex; align-items: flex-end; gap: 14px; height: 240px; margin-top: 22px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.bi-bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bi-bars > div > span:first-child { font-size: 12px; font-weight: 700; color: var(--navy); }
.bi-age { display: flex; flex-direction: column; gap: 6px; }
.bi-age > div:first-child { display: flex; justify-content: space-between; font-size: 14px; gap: 8px; }
.bi-age > div:first-child span { color: var(--slate); font-weight: 600; }
.bi-age-bar { height: 10px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.bi-follow { margin-top: auto; background: var(--red-tint); color: var(--red-dark); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
@media (max-width: 480px) { .bi-bars, .bi-bar-l { gap: 8px; } .bi-rep { padding: 20px 16px; } }

/* ================= Pharmacy & inventory ================= */
.lvl { transition: width .8s cubic-bezier(.2, .7, .2, 1), background .4s; }
.ph-hero { display: flex; flex-direction: column; gap: 14px; }
.ph-q { font-weight: 800; color: var(--ink); }
.ph-billed { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ok); }
.ph-billed svg { flex-shrink: 0; }

.ph-demo { display: flex; flex-wrap: wrap; gap: 18px; text-align: left; transition-delay: .12s; }
.ph-queue { flex: 1 1 400px; min-width: 0; padding: 24px; gap: 12px; }
.ph-queue .m-panel-head b, .ph-stock .m-panel-head b { font-size: 19px; }
.rxq { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: background .5s, border-color .5s; }
.rxq.done { background: rgba(11, 138, 85, .12); border-color: rgba(123, 224, 174, .3); }
.rxq-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rxq-t > span:first-child { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rxq-t b { font-size: 15px; }
.rxq-t > span:first-child span { font-size: 13px; color: var(--on-dark); }
.rxq-t > span:nth-child(2) { font-size: 14px; color: #DCE3EC; }
.rxq-picked { font-size: 12px; color: #7BE0AE; }
.ph-stock { flex: 1 1 400px; min-width: 0; background: #fff; color: var(--ink); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.ph-stock .tag { color: var(--slate-3); }
.ph-item { border: 1px solid #E5E9EE; border-radius: 16px; padding: 14px 16px; }
.ph-item-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-item-h > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ph-item-h > span:first-child b { font-size: 15px; }
.ph-item-h > span:first-child span { font-size: 12px; color: var(--slate-3); }
.ph-item-h > span:last-child { display: flex; gap: 8px; align-items: baseline; }
.ph-item-h > span:last-child b { font-size: 20px; }
.ph-item-h > span:last-child span { font-size: 12px; color: var(--slate-3); }
.ph-inv { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; }
.ph-inv b { font-size: 18px; color: var(--ink); }
@media (max-width: 480px) { .ph-queue, .ph-stock { padding: 18px 16px; } }

.ph-table { border: 1px solid #E5E9EE; border-radius: 14px; overflow: hidden; }
.ph-tr { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; padding: 12px 14px; border-top: 1px solid #EEF1F4; font-size: 14px; align-items: center; }
.ph-th { padding: 10px 14px; border-top: 0; background: var(--ground); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-3); }
.ph-tr > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.ph-tr > span:first-child b { font-weight: 700; }
.ph-tr > span:first-child span { font-size: 12px; color: var(--slate-3); }
.ph-tr > span:last-child { color: var(--slate); }
.ph-th > span:last-child { color: inherit; }

/* Aafia Stock: separate app, sold separately */
.ph-addon { padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 40px 70px -48px rgba(26, 36, 51, .7); text-align: start; }
.ph-addon .m-panel-head b { font-size: 22px; }
.ph-addon .tag { color: var(--slate-3); }
.ph-addon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; color: var(--ink); }
.ph-addon-list li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.ph-addon-list li > span { width: 26px; height: 26px; border-radius: 8px; background: var(--mist); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ph-addon-cta { align-self: flex-start; }
@media (max-width: 480px) { .ph-addon { padding: 20px 16px; } .ph-tr { font-size: 13px; padding: 10px; gap: 6px; } }

/* ================= Dental ================= */
.teeth { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.tooth { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font-family: inherit; min-width: 0; color: inherit; }
button.tooth { cursor: pointer; min-height: 44px; }
.tooth .t {
  width: 100%; max-width: 38px; aspect-ratio: 3 / 4; border: 2px solid #C9D1DC; background: #fff; color: #8A95A6;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
  transition: background .35s ease, border-color .35s ease, color .35s ease, transform .35s cubic-bezier(.2, .7, .2, 1.4);
}
.tooth.up .t { border-radius: 40% 40% 22% 22%; }
.tooth.dn .t { border-radius: 22% 22% 40% 40%; }
.tooth .n { font-size: 10px; font-weight: 700; color: #8A95A6; }
button.tooth:hover .t { transform: scale(1.12); }
.tooth.pop .t { transform: scale(1.15); }
.sw { width: 16px; height: 16px; border-radius: 5px; border: 2px solid; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 800; flex-shrink: 0; }
.tooth.tx-F .t, .sw.tx-F { background: #E2EAF7; border-color: #3A6EA5; color: #1F4687; }
.tooth.tx-RC .t, .sw.tx-RC { background: var(--red); border-color: #B30F23; color: #fff; }
.tooth.tx-C .t, .sw.tx-C { background: #FDEBCF; border-color: #C08A2B; color: #7A4700; }
.tooth.tx-X .t, .sw.tx-X { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 560px) { .teeth { gap: 2px; } .tooth .t { font-size: 8px; border-width: 1.5px; } .tooth .n { font-size: 8px; } }

.dn-hero .teeth + .teeth { margin-top: -6px; }
.dn-legend { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid #EEF1F4; flex-wrap: wrap; }
.dn-legend > span { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--slate); }
.dn-legend > span > span { display: inline-flex; align-items: center; gap: 6px; }
.dn-legend > b { font-size: 18px; }

.dn-demo { display: flex; flex-wrap: wrap; gap: 18px; text-align: left; transition-delay: .12s; }
.dn-board { flex: 1.6 1 560px; min-width: 0; padding: 24px; }
.dn-board .tag { margin-right: 6px; }
.tool { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #DCE3EC; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s; }
.tool:hover { border-color: #fff; color: #fff; }
.tool.on { background: #fff; color: var(--ink); border-color: #fff; }
.dn-mouth { background: #fff; border-radius: 18px; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.dn-q { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-3); }
.dn-mid { height: 1px; background: #E5E9EE; margin: 4px 0; }
.dn-plan { flex: 1 1 300px; min-width: 0; background: #fff; color: var(--ink); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.dn-plan .tag { color: var(--slate-3); }
.dn-plan .m-panel-head b { font-size: 19px; }
.dn-rows { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #E5E9EE; font-size: 14px; }
.prow > span:nth-child(2) { flex: 1; }
.dn-empty { font-size: 14px; color: var(--slate-3); padding: 9px 0; }
.dn-est { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 2px solid var(--ink); }
.dn-est b:last-child { font-size: 24px; letter-spacing: -0.02em; }
@media (max-width: 480px) { .dn-board, .dn-plan { padding: 18px 14px; } .dn-mouth { padding: 14px 8px; } }

.dn-phases { flex: 1.3 1 520px; min-width: 0; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; text-align: left; }
.dn-phase-card { flex: 1.2 1 300px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 40px 70px -48px rgba(26, 36, 51, .7); }
.dn-phase { display: flex; gap: 14px; align-items: flex-start; }
.dn-pn { width: 34px; height: 34px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.dn-pn.p1 { background: var(--red); }
.dn-pn.p2 { background: #3A6EA5; }
.dn-pn.p3 { background: #C08A2B; }
.dn-phase > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dn-phase > span:nth-child(2) b { font-size: 15px; }
.dn-phase > span:nth-child(2) span { font-size: 14px; color: var(--slate); }
.dn-phase > b { font-size: 14px; white-space: nowrap; }
.dn-visits { display: flex; justify-content: space-between; align-items: center; background: var(--ground); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.dn-out { display: flex; flex-wrap: wrap; gap: 6px; }
.dn-out .chip-s { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--mist); color: var(--navy); font-size: 12px; font-weight: 700; }
/* ================= Analytics ================= */
.an-hero .draw { animation: draw 1.8s .5s cubic-bezier(.2, .7, .2, 1) forwards; }
.areain { opacity: 0; animation: areain 1s 1.4s ease forwards; }
@keyframes areain { to { opacity: 1; } }
.an-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.an-kpis > div { background: var(--ground); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.an-kpis span { display: block; font-size: 12px; color: var(--slate-2); font-weight: 600; }
.an-kpis b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.an-trend { background: var(--ground); border-radius: 14px; padding: 14px 14px 8px; }
.an-trend-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--slate-2); margin-bottom: 6px; }
.an-trend svg { width: 100%; height: 110px; display: block; }
.an-days { display: flex; justify-content: space-between; font-size: 11px; color: var(--slate-3); font-weight: 600; }

.an-dash { padding: 24px; gap: 22px; transition-delay: .12s; }
.an-ctrls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.an-seg { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); padding: 4px; gap: 4px; flex-wrap: wrap; }
.an-seg .segb { color: #DCE3EC; font-size: 13px; }
.an-seg .segb:hover { color: #fff; }
.an-seg .segb.on, .an-seg .segb[aria-pressed="true"] { background: #fff; color: var(--ink); }
.an-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.an-cards > div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 16px 18px; }
.an-cards span { display: block; font-size: 12px; color: #8C99AC; }
.an-cards > div > span:first-child { font-size: 13px; color: var(--on-dark); font-weight: 600; }
.an-cards b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; }
.an-chart { background: #fff; color: var(--ink); border-radius: 18px; padding: 20px; }
.an-chart .bi-rep-h b { font-size: 16px; }
.an-bars { display: flex; align-items: flex-end; gap: 12px; height: 220px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.an-bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.an-bars > div > span:first-child { font-size: 12px; font-weight: 700; color: var(--navy); }
.an-bars .m-bar { max-width: 72px; transition: height .8s cubic-bezier(.2, .7, .2, 1), background .3s; }
.an-chart .bi-bar-l { gap: 12px; padding: 8px 0 0; }
@media (max-width: 480px) { .an-dash { padding: 18px 14px; } .an-cards b { font-size: 24px; } .an-bars, .an-chart .bi-bar-l { gap: 6px; } .an-chart { padding: 16px 12px; } }

.an-lib { padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 40px 70px -48px rgba(26, 36, 51, .7); text-align: left; }
.an-search { position: relative; display: block; }
.an-search svg { position: absolute; left: 14px; top: 16px; }
.an-search .inp { padding-left: 42px; min-height: 48px; font-size: 15px; }
.an-list { border: 1px solid #E5E9EE; border-radius: 14px; overflow: hidden; }
.rep { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid #EEF1F4; transition: background .2s; }
.an-list > .row:first-child .rep { border-top: 0; }
.rep:hover { background: #FAFBFC; }
.rep-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rep-ic.alert { background: var(--red-tint); color: var(--red); }
.rep-ic.info { background: #E2EAF7; color: #1F4687; }
.rep-ic.ok { background: var(--ok-bg); color: var(--ok); }
.rep-ic.warn { background: #FDEBCF; color: #7A4700; }
.rep-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rep-t b { font-size: 15px; }
.rep-t span { font-size: 13px; color: var(--slate-2); }
.an-none { margin: 0; padding: 16px; font-size: 14px; color: var(--slate-2); }
@media (max-width: 480px) { .an-lib { padding: 18px 14px; } .rep { padding: 12px; gap: 10px; } .rep .badge { display: none; } }

/* ================= Print / reduced motion ================= */
@media print {
  .fade, .slide, .drop, .li { opacity: 1 !important; transform: none !important; }
  .subnav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fade, .slide, .drop, .li, .pt { opacity: 1 !important; transform: none !important; }
  .line, .sig.on, .draw { stroke-dashoffset: 0 !important; }
  .areain { opacity: 1; }
  .m-bar { height: var(--h); }
  .aging { width: var(--w); }
  .bi-split .bi-ins { width: 80%; }
  .bi-split .bi-pat { width: 20%; }
}

/* ================= Refinements after the full review ================= */
/* Counter badges ("8 booked"): normal word spacing instead of the flex gap */
.badge.txt { display: inline-block; }

/* Desktop: keep the section heading in view beside a tall demo */
@media (min-width: 901px) {
  .m-dark .m-split > .m-copy { position: sticky; top: 150px; }
}

@media (max-width: 600px) {
  .m-backing { inset-block: 18px -12px; inset-inline: 18px -6px; border-radius: 22px; }
  .m-shot { padding: 18px; }
  .ap-day { padding: 16px; }
  .rx-hero { min-height: 0; }
  .pr-who b { font-size: 16px; }
  .bi-hero { margin-top: 26px; }
  .bi-hero .m-shot { padding: 20px 18px; }
  .bi-rec { text-align: left; }
}

@media (max-width: 480px) {
  /* Shorter cards and panels */
  .m-fix { padding: 20px; gap: 12px; }
  .hw { padding: 20px; }
  .m-panel { padding: 18px 16px; }
  .chip, .dchip { padding: 0 12px; font-size: 13px; }
  .btn-s { min-height: 44px; }
  .pr-tl-date { width: 44px; }
  .pr-form, .pr-audit { padding: 20px 18px; }

  /* "Works with": icon beside the text */
  .rel { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 16px; align-items: start; }
  .rel .ic { grid-row: span 2; }

  /* Appointments: five days on one row, a shorter phone */
  .ap-days-row { flex-wrap: nowrap; gap: 6px; }
  .ap-day-b { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
  .ap-screen { height: 400px; }

  /* Lab: results table and charts */
  .lb-tr { grid-template-columns: 1.25fr 1.15fr .9fr; padding: 10px 12px; font-size: 13px; }
  .lb-v { white-space: nowrap; }

  /* Dental: each arch on two rows of eight, so teeth are big enough to tap */
  .dn-mouth .teeth { grid-template-columns: repeat(8, minmax(0, 1fr)); row-gap: 10px; gap: 6px; }
  .dn-mouth .tooth .t { font-size: 11px; max-width: 34px; }
  .dn-mouth .tooth .n { font-size: 10px; }
  .dn-q { display: none; }

  /* Analytics: two KPI cards per row, full-width switches */
  .an-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .an-cards > div { padding: 14px; }
  .an-seg { display: flex; width: 100%; flex-wrap: nowrap; }
  .an-seg .segb { flex: 1 1 auto; padding: 0 8px; }
}
