/* ==========================================================================
   VEHA OPD — Patient mobile prototype
   Phone-framed app shell + native-feeling mobile UI
   ========================================================================== */

body.mstage {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 8% -10%, #E2F1F2 0%, transparent 55%),
    radial-gradient(760px 460px at 96% 4%, #FBE7EF 0%, transparent 52%),
    linear-gradient(180deg, #F7FAFB, #EDF3F6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 20px 40px; gap: 42px;
}

/* ---------- Side rail (desktop context) ---------- */
.mrail { width: 310px; flex: none; padding-top: 26px; }
.mrail .back { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin-bottom: 22px; }
.mrail .back:hover { color: var(--teal); }
.mrail h1 { font-size: 27px; letter-spacing: -.035em; line-height: 1.15; margin-top: 16px; }
.mrail p.lead { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; margin-top: 12px; }
.mrail .feat { display: flex; gap: 10px; margin-top: 16px; }
.mrail .feat .fi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.mrail .feat b { font-size: 12.5px; display: block; }
.mrail .feat span { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; display: block; margin-top: 2px; }
.mrail .note { margin-top: 24px; padding: 13px; border-radius: 12px; background: rgba(255,255,255,.72); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------- Phone frame ---------- */
.phone {
  width: 396px; flex: none; height: 812px; border-radius: 46px; padding: 11px;
  background: linear-gradient(160deg, #1E2A31, #0C1418);
  box-shadow: 0 40px 80px rgba(9,26,33,.28), 0 8px 24px rgba(9,26,33,.16), inset 0 0 0 1.5px rgba(255,255,255,.1);
  position: sticky; top: 26px;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 36px; background: var(--bg);
  overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 128px; height: 26px; background: #0C1418; border-radius: 0 0 16px 16px; z-index: 60;
}
.statusbar {
  height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; font-size: 11.5px; font-weight: 700; color: var(--ink); z-index: 55;
  background: transparent;
}
.statusbar .sb-r { display: flex; align-items: center; gap: 5px; }

.mbody { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.mbody::-webkit-scrollbar { width: 0; }

/* ---------- App bar ---------- */
.mtop { padding: 4px 18px 12px; }
.mtop-row { display: flex; align-items: center; gap: 11px; }
.mtitle { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.msub { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }

.mback {
  width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink-2);
}
.mbell { position: relative; width: 36px; height: 36px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.mbell .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); border: 1.5px solid #fff; }

/* ---------- Profile switcher ---------- */
.pswitch {
  display: flex; gap: 8px; padding: 4px 18px 12px; overflow-x: auto;
}
.pswitch::-webkit-scrollbar { height: 0; }
.pchip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 30px;
  background: #fff; border: 1.5px solid var(--line); cursor: pointer; flex: none; transition: all .16s;
}
.pchip .av { width: 27px; height: 27px; border-radius: 50%; font-size: 10.5px; }
.pchip b { font-size: 12.5px; font-weight: 700; }
.pchip span { font-size: 10px; color: var(--ink-3); font-weight: 700; display: block; }
.pchip.on { border-color: var(--teal); background: var(--teal-ll); box-shadow: 0 2px 8px rgba(14,124,134,.14); }

/* ---------- Cards ---------- */
.mcard {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  margin: 0 18px 12px; box-shadow: 0 2px 10px rgba(14,27,38,.04);
  overflow: hidden;
}
.mcard-pad { padding: 15px; }
.mcard-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px 0; }
.mcard-hd h3 { font-size: 14px; letter-spacing: -.02em; }
.msec-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 9px; }
.msec-hd h3 { font-size: 14.5px; letter-spacing: -.02em; }
.msec-hd a, .msec-hd button { font-size: 11.5px; font-weight: 800; color: var(--teal); background: none; border: none; cursor: pointer; }

/* Hero greeting */
.mhero {
  margin: 0 18px 14px; padding: 17px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #0E7C86 0%, #0A5A62 55%, #073F45 100%);
  box-shadow: 0 10px 26px rgba(10,90,98,.26);
}
/* Rose accent must be saturated: pink at low alpha over teal blends to grey. */
.mhero::after {
  content: ''; position: absolute; right: -74px; top: -86px; width: 196px; height: 196px; border-radius: 50%;
  background: radial-gradient(circle at 62% 40%, rgba(226,88,146,.78) 0%, rgba(206,79,132,.34) 38%, rgba(206,79,132,.08) 58%, rgba(206,79,132,0) 72%);
}
.mhero::before { content: ''; position: absolute; right: 30px; bottom: -62px; width: 108px; height: 108px; border-radius: 50%; background: rgba(255,255,255,.07); }
.mhero .gr { font-size: 11.5px; font-weight: 700; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.mhero .nm { font-size: 21px; font-weight: 800; letter-spacing: -.03em; margin-top: 3px; }
.mhero .ct { font-size: 12.5px; opacity: .92; margin-top: 8px; font-weight: 600; position: relative; z-index: 2; }
.mhero .prog { margin-top: 13px; position: relative; z-index: 2; }
.mhero .prog .tk { height: 6px; border-radius: 5px; background: rgba(255,255,255,.22); overflow: hidden; }
.mhero .prog .fl { height: 100%; border-radius: 5px; background: #fff; }
.mhero .prog .lb { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700; margin-top: 6px; opacity: .88; }

/* Next appointment */
.apptcard { margin: 0 18px 12px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 10px rgba(14,27,38,.04); }
.apptcard .ac-top { padding: 13px 15px; background: var(--teal-ll); border-bottom: 1px solid #D5E9EA; display: flex; align-items: center; justify-content: space-between; }
.apptcard .ac-top .lb { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-d); }
.apptcard .ac-bd { padding: 15px; }
.apptcard .drow { display: flex; gap: 12px; align-items: center; }
.apptcard .dnm { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.apptcard .dsp { font-size: 11.5px; font-weight: 700; color: var(--teal-d); }
.apptcard .meta { display: flex; flex-direction: column; gap: 7px; margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.apptcard .meta .r { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.apptcard .meta .r svg { color: var(--ink-3); }

/* Quick actions */
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 2px 18px 14px; }
.qtile {
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 12px 6px;
  text-align: center; cursor: pointer; transition: all .16s;
}
.qtile:active { transform: scale(.96); }
.qtile .qi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin: 0 auto 7px; }
.qtile b { font-size: 10.5px; font-weight: 700; display: block; line-height: 1.25; color: var(--ink-2); }

/* Journey card (mobile) */
.mjourney { padding: 15px; }
.mjstep { display: flex; gap: 12px; position: relative; padding-bottom: 15px; }
.mjstep:last-child { padding-bottom: 0; }
.mjstep .ln { position: absolute; left: 12px; top: 24px; bottom: 0; width: 2px; background: var(--line-2); }
.mjstep:last-child .ln { display: none; }
.mjstep .nd { width: 25px; height: 25px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); border: 2px solid var(--line-strong); z-index: 1; }
.mjstep.done .nd { background: var(--green); border-color: var(--green); color: #fff; }
.mjstep.current .nd { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14,124,134,.14); }
.mjstep.upcoming .nd { border-style: dashed; background: #fff; }
.mjstep.milestone .nd { background: var(--rose); border-color: var(--rose); color: #fff; }
.mjstep .tt { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.mjstep .dt { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.mjstep .nt { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; background: var(--surface-3); border-radius: 9px; padding: 8px 10px; line-height: 1.5; }
.mjstep.upcoming .tt { color: var(--ink-3); }

/* Segmented tabs */
.mseg { display: flex; gap: 3px; margin: 0 18px 12px; padding: 3px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; }
.mseg button { flex: 1; height: 32px; border: none; background: transparent; border-radius: 9px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-3); cursor: pointer; transition: all .15s; }
.mseg button.on { background: #fff; color: var(--teal-d); box-shadow: 0 1px 4px rgba(14,27,38,.1); }

/* List rows */
.mrow {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.mrow:last-child { border-bottom: none; }
.mrow:active { background: var(--surface-3); }
.mrow .tt { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.mrow .st2 { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }

/* Doctor pick card */
.mdoc { display: flex; gap: 12px; padding: 13px; border: 1.5px solid var(--line); border-radius: 15px; margin-bottom: 10px; cursor: pointer; background: #fff; transition: all .15s; }
.mdoc.on { border-color: var(--teal); background: var(--teal-ll); }
.mdoc .ph { width: 50px; height: 50px; border-radius: 15px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--teal-l); color: var(--teal-d); position: relative; }
.mdoc .nm { font-size: 13.5px; font-weight: 800; letter-spacing: -.015em; }
.mdoc .sp { font-size: 11.5px; font-weight: 700; color: var(--teal-d); margin-top: 1px; }
.mdoc .mt { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 3px; }
.mdoc .na { font-size: 11px; font-weight: 700; color: var(--green); margin-top: 5px; display: flex; align-items: center; gap: 4px; }

/* Slot pills */
.mslots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mslot { height: 40px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; transition: all .14s; }
.mslot:active { transform: scale(.96); }
.mslot.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.mslot:disabled { opacity: .34; cursor: not-allowed; text-decoration: line-through; }

.mdates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mdates::-webkit-scrollbar { height: 0; }
.mdate { flex: none; width: 58px; padding: 9px 0; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; text-align: center; cursor: pointer; transition: all .14s; }
.mdate.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.mdate.on .dd, .mdate.on .dm { color: #fff; }
.mdate .dw { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--ink-3); letter-spacing: .04em; }
.mdate.on .dw { color: rgba(255,255,255,.85); }
.mdate .dd { font-size: 16px; font-weight: 800; letter-spacing: -.03em; margin-top: 1px; }
.mdate .dm { font-size: 9.5px; font-weight: 700; color: var(--ink-3); }
.mdate:disabled { opacity: .35; }

/* Bottom nav */
.mnav {
  flex: none; height: 62px; border-top: 1px solid var(--line); background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px); display: flex; align-items: stretch; padding-bottom: 4px;
}
.mnav button {
  flex: 1; border: none; background: none; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; color: var(--ink-4); font-family: inherit; position: relative;
}
.mnav button b { font-size: 9.5px; font-weight: 700; }
.mnav button.on { color: var(--teal); }
.mnav button.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--teal); }
.mnav button .bdg { position: absolute; top: 8px; right: 50%; transform: translateX(15px); min-width: 15px; height: 15px; border-radius: 8px; background: var(--rose); color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }

/* CTA */
.mcta { padding: 12px 18px 18px; }
.mbtn {
  width: 100%; height: 48px; border-radius: 15px; border: none; background: var(--teal); color: #fff;
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 8px; transition: all .15s;
  box-shadow: 0 6px 16px rgba(14,124,134,.26);
}
.mbtn:active { transform: scale(.98); }
.mbtn:disabled { background: var(--line-strong); box-shadow: none; cursor: not-allowed; }
.mbtn-2 { background: #fff; color: var(--ink); border: 1.5px solid var(--line-strong); box-shadow: none; }
.mbtn-rose { background: var(--rose); box-shadow: 0 6px 16px rgba(206,79,132,.26); }
.mbtn-sm { height: 38px; font-size: 13px; border-radius: 12px; }
.mbtn-ghost { background: transparent; color: var(--ink-2); box-shadow: none; }

/* Sheet (bottom modal) */
.msheet-ovl { position: absolute; inset: 0; background: rgba(9,26,33,.42); z-index: 70; display: flex; align-items: flex-end; animation: mfade .18s ease; }
@keyframes mfade { from { opacity: 0 } }
.msheet { width: 100%; max-height: 86%; background: #fff; border-radius: 24px 24px 0 0; overflow: hidden; display: flex; flex-direction: column; animation: mup .26s cubic-bezier(.2,.9,.3,1.05); }
@keyframes mup { from { transform: translateY(60px) } }
.msheet-hd { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.msheet-hd h3 { font-size: 15.5px; letter-spacing: -.025em; }
.msheet-hd .sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.msheet-hd .x { margin-left: auto; width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--surface-3); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; flex: none; }
.msheet-bd { padding: 16px 18px; overflow-y: auto; flex: 1; }
.msheet-bd::-webkit-scrollbar { width: 0; }
.grab { width: 38px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }

/* Toast inside phone */
.mtoast {
  position: absolute; left: 18px; right: 18px; bottom: 76px; z-index: 90;
  background: #0C2E34; color: #fff; padding: 12px 15px; border-radius: 14px;
  font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 30px rgba(9,26,33,.3); animation: mup .22s ease;
}

/* Success screen */
.msuccess { text-align: center; padding: 26px 18px; }
.msuccess .ring { width: 78px; height: 78px; border-radius: 50%; background: var(--green-l); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; animation: pop2 .4s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop2 { from { transform: scale(.4); opacity: 0 } }
.msuccess h2 { font-size: 20px; letter-spacing: -.03em; }
.msuccess p { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.ticket { margin: 18px 0 0; border: 1.5px dashed var(--line-strong); border-radius: 16px; padding: 15px; background: var(--surface-2); text-align: left; }
.ticket .tk-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.ticket .tk-row span { color: var(--ink-3); font-weight: 600; }
.ticket .tk-row b { font-weight: 700; text-align: right; }
.ticket .num-box { text-align: center; padding: 11px; margin-top: 11px; border-top: 1.5px dashed var(--line-strong); }
.ticket .num-box .eyebrow { font-size: 9.5px; }
.ticket .num-box b { font-size: 18px; letter-spacing: -.02em; display: block; margin-top: 3px; }

/* Records / journey chips */
.mtag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 20px; font-size: 10px; font-weight: 800; }

/* Phase 2 marker */
.soon { opacity: .58; position: relative; }
.p2 { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: 20px; background: var(--violet-l); color: var(--violet); font-size: 9px; font-weight: 800; letter-spacing: .03em; }

/* Growth chart */
.gchart { height: 110px; position: relative; margin-top: 10px; }
.gchart svg { width: 100%; height: 100%; overflow: visible; }

@media (max-width: 1080px) {
  body.mstage { flex-direction: column; align-items: center; gap: 24px; padding-top: 22px; }
  .mrail { width: 100%; max-width: 420px; padding-top: 0; text-align: center; }
  .mrail .feat { text-align: left; }
  .phone { position: static; }
}
@media (max-width: 460px) {
  body.mstage { padding: 0; }
  .phone { width: 100%; height: 100vh; border-radius: 0; padding: 0; box-shadow: none; }
  .phone-screen { border-radius: 0; }
  .notch { display: none; }
  .mrail { display: none; }
}
