/* Portal module styles: calendar, patients, records, waitlist, messages.
   The base shell (buttons, cards, forms, toast) stays inline in index.html,
   along with the depth tokens these rules lean on: --rim is the 1px of light on
   a top edge, --lift and --lift2 are the two shadow elevations, --ease is the
   shared curve. Raised surfaces stack rim over lift; recessed ones (input
   tracks, segmented controls, scroll wells) invert it with an inset shadow.
   Every shadow offset is vertical only, which is the reason this whole file is
   still flex/grid and still mirrors correctly in RTL without a second
   stylesheet. */

.spacer{flex:1}
.btn.tiny{padding:5px 10px;font-size:12.5px;border-radius:8px}
.inline{display:inline-block}

/* ---------- page furniture ---------- */
.pagehead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0 6px}
.pagehead h1{font-size:clamp(22px,3vw,30px)}
.pagehead .acts{display:flex;gap:8px;flex-wrap:wrap}

/* A recessed track with one raised thumb: the whole point of a segmented
   control is that the selected segment looks like it is sitting on top. */
.seg{display:inline-flex;background:rgba(2,6,23,.55);border:1px solid var(--line);border-radius:12px;padding:3px;gap:2px;
  box-shadow:inset 0 2px 5px rgba(2,6,23,.7)}
.seg button{border:none;background:transparent;color:var(--dim);font-family:inherit;font-weight:700;font-size:13.5px;
  padding:7px 15px;border-radius:9px;cursor:pointer;transition:background .18s var(--ease),color .18s,box-shadow .18s}
.seg button:hover{color:#fff}
.seg button.on{background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.06));color:#fff;
  box-shadow:var(--rim),0 3px 10px -4px rgba(2,6,23,1)}
.wlfilter{margin:14px 0}

.navbtns{display:flex;gap:4px}
.callabel{font-size:16px;color:#fff}
input.jump{width:auto;min-width:150px;padding:8px 11px;font-size:14px}

.calbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0}

/* ---------- stats strip ---------- */
.statstrip{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin:14px 0}
.statstrip>div{background:linear-gradient(165deg,rgba(255,255,255,.08),rgba(255,255,255,.03));border:1px solid var(--line);
  border-radius:13px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;
  box-shadow:var(--rim),var(--lift);transition:transform .22s var(--ease),box-shadow .22s}
.statstrip>div:hover{transform:translateY(-2px);box-shadow:var(--rim),var(--lift2)}
.statstrip b,.statstrip .sv{font-size:21px;font-weight:800;color:#fff;line-height:1.2}
.statstrip span,.statstrip .sl{color:var(--dim);font-size:12.5px}
.statstrip b.good{color:var(--green)}
.statstrip b.bad{color:var(--danger)}
/* auto-fit lands on three columns at phone widths, which strands the fourth
   stat alone on a second row. Four stats read as an even 2x2 block instead. */
@media(max-width:560px){.statstrip{grid-template-columns:repeat(2,1fr)}}

/* ---------- bulk bar ---------- */
/* `top` clears the sticky topbar dock (12px offset plus its own height), or the
   bulk bar slides underneath it and the selection count becomes unreadable
   exactly when someone is mid-selection. The topbar drops out of sticky under
   820px, so the offset goes back to 0 there. */
.bulkbar{position:sticky;top:80px;z-index:6;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  background:linear-gradient(180deg,rgba(13,148,136,.28),rgba(13,148,136,.13));border:1px solid rgba(13,148,136,.45);
  border-radius:13px;padding:10px 14px;margin:12px 0;
  backdrop-filter:blur(14px) saturate(150%);-webkit-backdrop-filter:blur(14px) saturate(150%);
  box-shadow:var(--rim),var(--lift)}
@media(max-width:820px){.bulkbar{top:0}}

/* ---------- day view ---------- */
.daycard{padding:16px}
.dayhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px solid var(--line);margin-bottom:10px}
.dayhead b{font-size:16px;color:#fff}

.slot{display:flex;gap:12px;align-items:flex-start;padding:11px 12px;border:1px solid var(--line);
  border-radius:12px;margin-bottom:8px;background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(2,6,23,.4));flex-wrap:wrap;
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1);transition:transform .18s var(--ease),box-shadow .18s,border-color .18s}
.slot:hover{transform:translateY(-1px);box-shadow:var(--rim),var(--lift)}
/* A free slot is a hole in the day, so it reads as recessed: no rim, no lift,
   and the fill runs the other way. */
.slot.free{border-style:dashed;opacity:.85;background:rgba(2,6,23,.5);box-shadow:inset 0 2px 6px rgba(2,6,23,.6)}
.slot.free:hover{opacity:1;border-color:var(--teal);transform:none;box-shadow:inset 0 2px 6px rgba(2,6,23,.5)}
.slot.taken.pending{border-color:rgba(251,191,36,.35)}
.slot.taken.confirmed{border-color:rgba(34,211,238,.3)}
.slot.taken.cancelled,.slot.taken.rejected,.slot.taken.no_show{opacity:.55}
.slot .tm{min-width:58px;font-weight:800;color:var(--teal2);font-size:15px;padding-top:2px}
.slot .bd{flex:1;min-width:170px}
.slot .bd .nm{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-weight:700;color:#fff}
.slot .ac{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.tick{display:inline-flex;margin:0}
.tick input{width:16px;height:16px;accent-color:var(--teal2)}

.excnote{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13.5px;border-radius:10px;padding:8px 12px;margin-bottom:8px}
.excnote.closed{background:rgba(248,113,113,.09);color:var(--danger);border:1px solid rgba(248,113,113,.22)}
.excnote.open{background:rgba(52,211,153,.09);color:var(--green);border:1px solid rgba(52,211,153,.22)}
.excrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:9px 0;border-bottom:1px solid var(--line)}
.excrow:last-child{border-bottom:none}

/* ---------- week view ---------- */
.weekgrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
@media(max-width:820px){.weekgrid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:520px){.weekgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.wcol{background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.025));border:1px solid var(--line);
  border-radius:13px;overflow:hidden;min-height:120px;box-shadow:var(--rim),var(--lift)}
.wcol.today{border-color:var(--teal);box-shadow:var(--rim),var(--lift),0 0 0 1px rgba(13,148,136,.5)}
.wcol.closed{opacity:.6}
.wh{display:flex;flex-direction:column;gap:1px;padding:8px 6px;text-align:center;cursor:pointer;
  background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,.05));border-bottom:1px solid var(--line);
  box-shadow:var(--rim);transition:background .15s}
.wh:hover{background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.08))}
.wh b{font-size:13px;color:#fff}
.wh span{font-size:11.5px;color:var(--faint)}
.wclosed{text-align:center;font-size:12px;color:var(--danger);padding:6px 0}
/* The scroll well is recessed, so what scrolls inside it reads as sitting in a
   column rather than floating over the page. */
.wbody{padding:6px;display:flex;flex-direction:column;gap:4px;max-height:420px;overflow:auto;
  background:rgba(2,6,23,.28);box-shadow:inset 0 3px 6px -3px rgba(2,6,23,.9)}
.wslot{display:flex;flex-direction:column;gap:1px;text-align:start;border:1px solid var(--line);border-radius:8px;
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(2,6,23,.45));color:var(--text);font-family:inherit;cursor:pointer;padding:5px 7px;
  box-shadow:var(--rim),0 2px 6px -4px rgba(2,6,23,1);transition:transform .15s var(--ease),box-shadow .15s}
.wslot:hover{transform:translateY(-1px);box-shadow:var(--rim),var(--lift)}
.wslot span{font-size:11.5px;color:var(--teal2);font-weight:700}
.wslot i{font-style:normal;font-size:12px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wslot.free{border-style:dashed;opacity:.6;background:rgba(2,6,23,.5);box-shadow:inset 0 2px 4px rgba(2,6,23,.6)}
.wslot.free:hover{opacity:1;transform:none;box-shadow:inset 0 2px 4px rgba(2,6,23,.5)}
.wslot.pending{background:rgba(251,191,36,.12);border-color:rgba(251,191,36,.3)}
.wslot.confirmed{background:rgba(34,211,238,.1);border-color:rgba(34,211,238,.25)}
.wslot.completed{background:rgba(52,211,153,.1);border-color:rgba(52,211,153,.25)}
.wslot.cancelled,.wslot.rejected,.wslot.no_show{opacity:.45}
.wslot.off{border-style:dotted}

/* ---------- month view ---------- */
.mhead{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:6px}
.mhead span{text-align:center;font-size:12px;color:var(--faint);font-weight:700}
.mgrid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
/* The heat classes override `background`, so the depth has to live in the
   shadow rather than the fill or a busy month would go flat. */
.mcell{position:relative;aspect-ratio:1/.82;border:1px solid var(--line);border-radius:11px;
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(2,6,23,.45));
  color:var(--text);font-family:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1);transition:transform .16s var(--ease),box-shadow .16s}
.mcell:hover{transform:translateY(-2px);box-shadow:var(--rim),var(--lift)}
.mcell b{font-size:15px;color:#fff}
.mcell i{font-style:normal;font-size:11.5px;color:var(--dim)}
.mcell.blank{border:none;background:transparent;cursor:default;box-shadow:none}
.mcell.blank:hover{transform:none}
.mcell.today{border-color:var(--teal);box-shadow:var(--rim),0 0 0 1px var(--teal) inset,0 6px 18px -8px rgba(13,148,136,.9)}
.mcell.closed{background:linear-gradient(180deg,rgba(248,113,113,.16),rgba(248,113,113,.06));border-color:rgba(248,113,113,.22)}
.mcell.nowork{opacity:.4}
.mcell.h1{background:linear-gradient(180deg,rgba(13,148,136,.12),rgba(13,148,136,.04))}
.mcell.h2{background:linear-gradient(180deg,rgba(13,148,136,.22),rgba(13,148,136,.1))}
.mcell.h3{background:linear-gradient(180deg,rgba(13,148,136,.36),rgba(13,148,136,.2))}
.mcell.h4{background:linear-gradient(180deg,rgba(13,148,136,.54),rgba(13,148,136,.32))}
/* not .dot — the brand logo already owns that class */
.pdot{width:7px;height:7px;border-radius:50%;background:var(--amber);position:absolute;top:6px;inset-inline-end:6px}
.pdot.inline{position:static;display:inline-block}

/* ---------- modal ---------- */
.modal-back{position:fixed;inset:0;z-index:80;background:rgba(2,6,23,.75);backdrop-filter:blur(8px) saturate(120%);-webkit-backdrop-filter:blur(8px) saturate(120%);
  display:flex;align-items:flex-start;justify-content:center;padding:5vh 16px;overflow:auto;
  animation:modalfade .18s var(--ease)}
/* The tallest thing on the page, so it gets the heaviest shadow and the only
   scale-in. It rises from slightly below and behind, which is the direction the
   trigger it came from is in. */
.modal{width:100%;max-width:480px;background:linear-gradient(180deg,#111c31,#0a1120);border:1px solid rgba(255,255,255,.14);
  border-radius:var(--r);overflow:hidden;
  box-shadow:var(--rim),0 32px 80px -16px rgba(2,6,23,1),0 0 0 1px rgba(2,6,23,.6);
  animation:modalrise .24s var(--ease)}
@keyframes modalfade{from{opacity:0}to{opacity:1}}
@keyframes modalrise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
.modal.wide{max-width:720px}
.modal-head{display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line)}
.modal-head h3{flex:1;font-size:17px}
.modal-head .x{background:transparent;border:none;color:var(--dim);font-size:17px;cursor:pointer;padding:4px 6px;font-family:inherit}
.modal-head .x:hover{color:#fff}
.modal-body{padding:18px 20px;max-height:66vh;overflow:auto}
.modal-foot{display:flex;gap:8px;justify-content:flex-end;padding:14px 20px;border-top:1px solid var(--line);background:rgba(2,6,23,.4)}
.check{display:flex;align-items:center;gap:8px;color:var(--text);font-size:14px;cursor:pointer;margin:4px 0}
.check input{width:16px;height:16px;accent-color:var(--teal2)}

/* ---------- chips ---------- */
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:12.5px;font-weight:600;
  background:linear-gradient(180deg,rgba(13,148,136,.26),rgba(13,148,136,.12));color:var(--teal2);border:1px solid rgba(13,148,136,.3);
  box-shadow:var(--rim)}
.chip.soft{background:var(--panel2);color:var(--dim);border-color:var(--line)}
.chip.warn{background:rgba(251,191,36,.13);color:var(--amber);border-color:rgba(251,191,36,.28)}
.chip.write{border-color:rgba(251,191,36,.45)}
.chip i{opacity:.75}

/* ---------- patient list ---------- */
.searchrow{display:flex;gap:8px;align-items:center}
.plist{display:flex;flex-direction:column;gap:8px}
.pcard{display:flex;align-items:center;gap:12px;width:100%;text-align:start;padding:13px 15px;border:1px solid var(--line);
  border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.025));color:var(--text);
  text-decoration:none;font-family:inherit;cursor:pointer;
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1);transition:transform .18s var(--ease),box-shadow .18s,border-color .18s}
.pcard:hover{transform:translateY(-2px);border-color:rgba(20,184,166,.55);box-shadow:var(--rim),var(--lift)}
.plist.compact .pcard{padding:10px 12px}
/* The avatar is a solid object on a glass card, so it keeps a real drop shadow
   where the flat surfaces only get a rim. */
.av{width:42px;height:42px;flex:none;border-radius:12px;display:grid;place-items:center;font-weight:800;color:#fff;
  background:linear-gradient(135deg,var(--teal2),var(--teal) 55%,#0b7a70);overflow:hidden;
  box-shadow:var(--rim),0 4px 12px -4px rgba(13,148,136,.7)}
.av img{width:100%;height:100%;object-fit:cover}
.av.big{width:64px;height:64px;border-radius:16px;font-size:26px}
.pmeta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.pmeta .nm{font-weight:700;color:#fff}
.go{color:var(--faint);font-size:22px}

/* ---------- chart ---------- */
.chartHead{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap;margin-top:6px}
.chartHead h2{font-size:21px}
.tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:8px}
.tabs button{border:1px solid transparent;background:transparent;color:var(--dim);font-family:inherit;font-weight:700;
  font-size:14px;padding:8px 14px;border-radius:10px;cursor:pointer;transition:background .15s,color .15s,box-shadow .18s}
.tabs button:hover{color:#fff;background:rgba(255,255,255,.05)}
.tabs button.on{background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.05));color:#fff;border-color:var(--line);
  box-shadow:var(--rim),0 3px 10px -5px rgba(2,6,23,1)}

.secgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px}
.sec{padding:16px}
.sec h3{font-size:15.5px;margin-bottom:10px}
.sec.locked{opacity:.6;border-style:dashed}
.kv{display:flex;gap:10px;align-items:flex-start;margin-bottom:8px;flex-wrap:wrap}
.kv b{min-width:80px;font-size:13px;color:var(--dim);font-weight:600}
.kv span{display:flex;gap:5px;flex-wrap:wrap}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:7px 0;border-bottom:1px solid var(--line);font-size:14px}
.row:last-child{border-bottom:none}
.row b{color:#fff;font-size:13.5px}
.analytes{display:flex;gap:5px;flex-wrap:wrap;padding-bottom:8px}
.an{font-size:11.5px;padding:2px 8px;border-radius:7px;background:rgba(2,6,23,.55);border:1px solid var(--line);color:var(--dim)}
.an.bad{background:rgba(248,113,113,.12);border-color:rgba(248,113,113,.3);color:var(--danger)}
.vitals{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px}
.vt{display:flex;flex-direction:column;gap:1px;padding:9px 11px;border:1px solid var(--line);border-radius:11px;
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(2,6,23,.45));box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1)}
.vt b{font-size:17px;color:#fff}
.vt.high,.vt.low,.vt.abnormal{border-color:rgba(251,191,36,.35)}
.vt.critical{border-color:rgba(248,113,113,.45)}

/* ---------- timeline ---------- */
.tl{display:flex;flex-direction:column}
.tlrow{display:flex;gap:12px;align-items:flex-start;padding:11px 0;border-bottom:1px solid var(--line)}
.tlrow:last-child{border-bottom:none}
.tlrow .ic{width:30px;height:30px;flex:none;border-radius:9px;display:grid;place-items:center;font-size:15px;
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.05));box-shadow:var(--rim),0 3px 8px -4px rgba(2,6,23,1)}
.tlrow>div{flex:1;min-width:0}
.tlrow .at{flex:none;color:var(--faint)}
.warnt{color:var(--amber)}

/* ---------- clinical notes ---------- */
.note{padding:16px;margin-bottom:10px}
.note.signed{border-color:rgba(52,211,153,.3)}
.notehead{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.chief{font-weight:700;color:#fff;margin-bottom:8px}
.soap{margin-bottom:8px}
.soap b{display:block;font-size:12px;color:var(--dim);font-weight:600;margin-bottom:2px}
.soap p{font-size:14.5px;white-space:pre-wrap}
.amend{margin-top:10px;padding-top:8px;border-top:1px dashed var(--line)}
.doc{gap:10px}

/* ---------- waitlist ---------- */
.wllist{display:flex;flex-direction:column;gap:8px}
.wlrow{display:flex;gap:12px;align-items:flex-start;padding:13px 15px;border:1px solid var(--line);
  border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.025));flex-wrap:wrap;
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1);transition:box-shadow .2s,border-color .2s}
.wlrow:hover{box-shadow:var(--rim),var(--lift)}
/* A live offer is holding a real slot on a timer, so it glows rather than just
   changing colour: it has to be the thing the eye lands on first. */
.wlrow.lit{border-color:rgba(34,211,238,.4);background:linear-gradient(180deg,rgba(34,211,238,.14),rgba(34,211,238,.04));
  box-shadow:var(--rim),0 8px 26px -12px rgba(34,211,238,.9)}
.wpos{width:30px;height:30px;flex:none;border-radius:9px;display:grid;place-items:center;
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.05));
  font-weight:800;font-size:13px;color:var(--dim);box-shadow:var(--rim),0 3px 8px -4px rgba(2,6,23,1)}
.wmain{flex:1;min-width:200px;display:flex;flex-direction:column;gap:3px}
.wname{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-weight:700;color:#fff}
.wmeta{font-size:13px;color:var(--dim)}
.wreason{font-size:14px}
.wprefs{font-size:12.5px;color:var(--faint)}
.woffer{font-size:13px;color:var(--cyan);margin-top:3px}
.wside{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.prio{display:flex;align-items:center;gap:5px}
.prio .pv{min-width:26px;text-align:center;font-weight:800;color:#fff;font-size:14px}
.mini{width:24px;height:22px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--dim);
  cursor:pointer;font-size:10px;line-height:1;font-family:inherit}
.mini:hover{color:#fff;border-color:var(--teal)}
.wacts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}

/* ---------- messages ---------- */
.msgwrap{display:grid;grid-template-columns:290px 1fr;gap:12px;margin-top:14px;
  height:calc(100vh - 260px);min-height:420px}
.convlist{background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));border:1px solid var(--line);
  border-radius:var(--r);overflow:auto;padding:8px;box-shadow:var(--rim),var(--lift)}
.conv{display:flex;gap:10px;align-items:center;width:100%;text-align:start;padding:10px;border:1px solid transparent;
  border-radius:12px;background:transparent;color:var(--text);font-family:inherit;cursor:pointer;transition:background .15s,box-shadow .18s}
.conv:hover{background:rgba(255,255,255,.06)}
.conv.on{background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.05));border-color:var(--teal);
  box-shadow:var(--rim),0 4px 12px -6px rgba(2,6,23,1)}
.conv .av{width:36px;height:36px;border-radius:11px;font-size:14px}
.cmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.cname{display:flex;align-items:center;gap:6px;font-weight:700;color:#fff;font-size:14.5px}
.clast{font-size:12.5px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.cwhen{font-size:11px;color:var(--faint);flex:none}
.badge{min-width:18px;height:18px;padding:0 5px;border-radius:99px;color:#fff;
  background:linear-gradient(180deg,var(--teal2),var(--teal));
  font-size:11px;font-weight:800;display:inline-grid;place-items:center;
  box-shadow:0 3px 10px -3px rgba(13,148,136,.9),inset 0 1px 0 rgba(255,255,255,.35)}

.thread{display:flex;flex-direction:column;background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));
  border:1px solid var(--line);border-radius:var(--r);overflow:hidden;box-shadow:var(--rim),var(--lift)}
.threadempty{display:grid;place-items:center;height:100%}
/* This card is a placeholder inside the thread panel, not a surface of its own,
   so it gives up the fill, the shadow and the bevel hairline the base sets. */
.threadempty .card{border:none;background:transparent;box-shadow:none}
.threadempty .card::before{display:none}
.threadhead{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(2,6,23,.35));box-shadow:var(--rim)}
.threadhead .th{flex:1;display:flex;flex-direction:column;gap:1px;min-width:0}
.threadhead .acts{display:flex;gap:6px}
.threadhead .back{background:transparent;border:none;color:var(--dim);font-size:19px;cursor:pointer;font-family:inherit}
.threadbody{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:8px;
  background:rgba(2,6,23,.25);box-shadow:inset 0 4px 8px -4px rgba(2,6,23,.9)}
.daysep{text-align:center;font-size:11.5px;color:var(--faint);margin:6px 0}
.bub{max-width:76%;align-self:flex-start;background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.05));
  border:1px solid var(--line);border-radius:14px;padding:9px 13px;
  box-shadow:var(--rim),0 3px 10px -6px rgba(2,6,23,1)}
.bub.mine{align-self:flex-end;background:linear-gradient(180deg,rgba(13,148,136,.3),rgba(13,148,136,.14));border-color:rgba(13,148,136,.4);
  box-shadow:var(--rim),0 4px 14px -8px rgba(13,148,136,.9)}
.bub .bt{font-size:14.5px;line-height:1.55;word-break:break-word}
.bub .bm{font-size:10.5px;color:var(--faint);margin-top:3px;text-align:end}
.composer{display:flex;gap:8px;align-items:flex-end;padding:12px 14px;border-top:1px solid var(--line);
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(2,6,23,.4));box-shadow:var(--rim)}
.composer textarea{min-height:44px;max-height:140px;resize:none;padding:11px 13px}
.only-narrow{display:none}

@media(max-width:820px){
  .msgwrap{grid-template-columns:1fr;height:auto}
  .msgwrap .thread{display:none}
  .msgwrap.open .convlist{display:none}
  .msgwrap.open .thread{display:flex;height:calc(100vh - 230px);min-height:380px}
  .only-narrow{display:inline-block}
}

/* ---------- pharmacy shop ---------- */
.shopbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0}
.shopcat{width:auto;min-width:150px;padding:8px 11px;font-size:14px}
.shopq{flex:1;min-width:180px;padding:9px 13px;font-size:14px}

/* auto-fill rather than auto-fit: with two products left after a filter, auto-fit
   stretches them across the whole row and a 600px-wide pill box looks absurd. */
.shopgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(226px,1fr));gap:12px;margin-top:14px}

.prod{position:relative;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:16px;overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.025));
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1);transition:transform .2s var(--ease),box-shadow .2s,border-color .2s}
.prod:hover{transform:translateY(-3px);border-color:rgba(20,184,166,.5);box-shadow:var(--rim),var(--lift2)}
.prod.sel{border-color:var(--teal);box-shadow:var(--rim),var(--lift),0 0 0 1px rgba(13,148,136,.5)}
/* Out of stock is a state of the product, not of the card, so it dims the goods
   and leaves the controls at full contrast. */
.prod.oos .pimg img,.prod.oos .pprice{opacity:.45}

.ptick{position:absolute;top:8px;inset-inline-start:8px;z-index:2;display:grid;place-items:center;
  width:26px;height:26px;border-radius:8px;background:rgba(2,6,23,.72);border:1px solid var(--line);
  cursor:pointer;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:var(--rim)}
.ptick input{width:15px;height:15px;accent-color:var(--teal2);cursor:pointer}

/* A fixed ratio, because pharmacy photos arrive as everything from a square
   pack shot to a phone panorama and a ragged grid reads as broken. */
.pimg{position:relative;aspect-ratio:4/3;background:rgba(2,6,23,.45);display:grid;place-items:center;cursor:pointer;
  box-shadow:inset 0 -1px 0 var(--line)}
.pimg img{width:100%;height:100%;object-fit:cover;display:block}
.pimg .ph{font-size:34px;opacity:.35}
.poff,.poos{position:absolute;top:8px;inset-inline-end:8px;padding:3px 9px;border-radius:999px;
  font-size:12px;font-weight:800;color:#fff;box-shadow:var(--rim),0 4px 12px -5px rgba(2,6,23,1)}
/* Forced LTR: in an RTL paragraph the bidi algorithm moves the minus sign to the
   trailing edge and "-20%" is drawn as "20%-". */
.poff{background:linear-gradient(180deg,#f87171,#dc2626);direction:ltr}
.poos{top:auto;bottom:8px;inset-inline-end:8px;background:rgba(2,6,23,.85);border:1px solid var(--line);color:var(--dim);font-weight:700}

.pbody{flex:1;display:flex;flex-direction:column;gap:5px;padding:11px 13px;cursor:pointer}
.pname{font-weight:700;color:#fff;font-size:15px;line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pmeta2{font-size:12.5px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pprice{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.pprice b{font-size:17px;font-weight:800;color:#fff}
.pprice s{font-size:13px;color:var(--faint)}
.pfoot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:9px 11px;
  border-top:1px solid var(--line);background:rgba(2,6,23,.35);box-shadow:var(--rim)}
.pfoot .tiny{color:var(--faint)}

/* ---------- image strip ---------- */
.imgstrip{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0}
.imgtile{position:relative;width:84px;height:84px;border-radius:12px;overflow:hidden;border:1px solid var(--line);
  background:rgba(2,6,23,.45);box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1)}
.imgtile img{width:100%;height:100%;object-fit:cover;display:block}
.imgtile.cover{border-color:var(--teal);box-shadow:var(--rim),var(--glow)}
.imgtile.add{display:grid;place-items:center;gap:2px;color:var(--dim);font-size:20px;cursor:pointer;
  border-style:dashed;align-content:center}
.imgtile.add:hover{color:#fff;border-color:var(--teal)}
.imgtile.add .tiny{font-size:10.5px}
.imgtile.add input{display:none}
.covertag{position:absolute;bottom:0;inset-inline:0;padding:2px 0;text-align:center;
  font-size:10.5px;font-weight:700;color:#fff;background:linear-gradient(180deg,rgba(13,148,136,.7),rgba(13,148,136,.92))}
/* Both tile buttons sit on top of a photo of unknown brightness, so they carry
   their own dark plate rather than trusting the image underneath. */
.mkcover,.rmimg{position:absolute;top:4px;width:22px;height:22px;border-radius:7px;cursor:pointer;line-height:1;
  border:1px solid var(--line);background:rgba(2,6,23,.78);color:var(--dim);font-family:inherit;font-size:11px;
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
.mkcover{inset-inline-start:4px}
.mkcover:hover{color:var(--amber);border-color:rgba(251,191,36,.5)}
.rmimg{inset-inline-end:4px}
.rmimg:hover{color:var(--danger);border-color:rgba(248,113,113,.5)}

/* ---------- enquiries ---------- */
.enqlist{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.enq{display:flex;gap:12px;align-items:flex-start;padding:13px 15px;border:1px solid var(--line);border-radius:15px;
  background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));
  box-shadow:var(--rim),0 2px 8px -5px rgba(2,6,23,1)}
/* An unanswered enquiry is the only thing on this screen that needs doing, so it
   gets a lit edge. Vertical shadow offset only, so it mirrors in RTL. */
.enq.new{border-color:rgba(20,184,166,.45);box-shadow:var(--rim),var(--lift),inset 0 0 0 1px rgba(13,148,136,.12)}
.enq.closed{opacity:.62}
.ethumb{width:56px;height:56px;flex:none;border-radius:12px;overflow:hidden;background:rgba(2,6,23,.45);
  display:grid;place-items:center;border:1px solid var(--line);box-shadow:var(--rim)}
.ethumb img{width:100%;height:100%;object-fit:cover}
.ethumb .ph{font-size:22px;opacity:.4}
.emain{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.ehead{display:flex;align-items:center;gap:7px;flex-wrap:wrap;color:#fff}
.emeta{font-size:12.5px;color:var(--dim)}
.etext{font-size:14.5px;line-height:1.55;color:var(--text);word-break:break-word}
/* The reply is indented off the border rather than boxed, so the thread reads as
   one exchange instead of two unrelated cards. */
.ereply{margin-top:4px;padding-inline-start:11px;border-inline-start:2px solid var(--teal);
  font-size:14px;color:var(--dim);line-height:1.55}
.ereply .tiny{display:block;color:var(--teal2);font-weight:700;margin-bottom:1px}
.eacts{display:flex;flex-direction:column;gap:6px;align-items:stretch;flex:none}
.quote{margin:8px 0 4px;padding:10px 13px;border-radius:12px;font-size:14px;line-height:1.55;color:var(--dim);
  background:rgba(2,6,23,.4);border:1px solid var(--line);box-shadow:inset 0 2px 6px -3px rgba(2,6,23,.9)}

@media(max-width:560px){
  .enq{flex-wrap:wrap}
  .eacts{flex-direction:row;flex-wrap:wrap;width:100%}
}
