/* Clinic Touch — phone-only shell. Desktop (>600px) is untouched: every rule here
   lives inside the mobile media query or is scoped to .mshell, which only the
   mobile renderer creates. */
@media(max-width:600px){
:root{--m-pad:14px;--m-bar:74px;--m-radius:16px;--m-line:#e6eaf2;--m-ink:#28334d;--m-soft:#f2f3fb}
body{background:#f5f6fa}

.mshell{min-height:100vh;padding-bottom:calc(var(--m-bar) + 18px + env(safe-area-inset-bottom))}

/* ---------- top bar ---------- */
.mtop{position:sticky;top:0;z-index:12;background:#fff;border-bottom:1px solid var(--m-line);
 padding:calc(10px + env(safe-area-inset-top)) var(--m-pad) 10px;display:flex;align-items:center;gap:12px}
.mtop .mavatar{width:44px;height:44px;border-radius:50%;background:var(--green);color:#fff;
 display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;flex-shrink:0;border:0}
.mtop-text{flex:1;min-width:0}
.mtop-text small{display:block;color:var(--muted);font-size:13px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtop-text strong{display:block;font-size:17px;font-weight:750;letter-spacing:-.3px;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtop .micon{width:42px;height:42px;min-height:42px;padding:0;border:0;background:transparent;
 border-radius:12px;font-size:20px;color:var(--green);display:flex;align-items:center;justify-content:center;position:relative}
.mtop .micon .mdot{position:absolute;top:6px;right:6px;min-width:17px;height:17px;border-radius:9px;
 background:#c0392b;color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 4px}

.mcontent{padding:var(--m-pad)}
.mcontent>.heading{margin-bottom:14px}
.msection{margin:0 0 10px;font-size:17px;font-weight:750;letter-spacing:-.3px}

/* ---------- home ---------- */
.mquick{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:20px}
.mquick button{min-height:62px;display:flex;align-items:center;gap:10px;justify-content:flex-start;
 text-align:left;background:#fff;border:1px solid var(--m-line);border-radius:var(--m-radius);
 padding:12px;font-size:14.5px;font-weight:650;color:var(--green);line-height:1.25}
.mquick button .mq-ico{width:34px;height:34px;border-radius:11px;background:var(--m-soft);
 display:flex;align-items:center;justify-content:center;font-size:17px;flex-shrink:0}

.mstats{background:#fff;border:1px solid var(--m-line);border-radius:var(--m-radius);
 padding:14px;margin-bottom:20px}
.mstats-head{display:flex;align-items:baseline;gap:8px;margin-bottom:12px}
.mstats-head strong{font-size:15px;font-weight:750}
.mstats-head small{margin-left:auto;color:var(--muted);font-size:13px}
.mstats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1px;background:var(--m-line);
 border-radius:12px;overflow:hidden}
.mstats-grid div{background:#fff;padding:12px 10px}
.mstats-grid.odd div:last-child{grid-column:span 2}
.mstats-grid small{display:block;color:var(--muted);font-size:12.5px;line-height:1.3}
.mstats-grid strong{display:block;font-size:23px;font-weight:750;color:var(--green);margin-top:4px;letter-spacing:-.5px}

.mnext{background:#fff;border:1px solid var(--m-line);border-radius:var(--m-radius);padding:14px;margin-bottom:20px}
.mnext .mnext-when{display:inline-block;background:var(--lime);color:#1d3b5c;font-size:12.5px;
 font-weight:700;border-radius:8px;padding:4px 9px;margin-bottom:9px}
.mnext h3{margin:0 0 3px;font-size:17px;font-weight:750}
.mnext p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.45}
.mnext .actions{display:flex;gap:8px;margin-top:12px}
.mnext .actions button{flex:1;min-height:42px;padding:8px;font-size:14px}

.mchats{display:flex;align-items:center;gap:12px;width:100%;background:#fff;border:1px solid var(--m-line);
 border-radius:var(--m-radius);padding:14px;text-align:left;margin-bottom:8px;min-height:64px}
.mchats .mq-ico{width:36px;height:36px;border-radius:11px;background:var(--m-soft);
 display:flex;align-items:center;justify-content:center;font-size:17px;flex-shrink:0}
.mchats span{flex:1;min-width:0}
.mchats strong{display:block;font-size:15px;font-weight:700}
.mchats small{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.mchats .mcount{background:#c0392b;color:#fff;border-radius:11px;min-width:22px;height:22px;
 font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 6px}

/* ---------- calendar ---------- */
.mweek-wrap{background:#fff;border:1px solid var(--m-line);border-radius:var(--m-radius);
 padding:12px 8px 6px;margin-bottom:14px;touch-action:pan-y}
.mweek-head{display:flex;align-items:center;gap:6px;padding:0 6px 10px}
.mweek-head .mmonth{flex:1;text-align:left;border:0;background:transparent;font-size:17px;
 font-weight:750;padding:4px 0;min-height:auto;letter-spacing:-.3px}
.mweek-head button.mstep{width:36px;height:36px;min-height:36px;padding:0;border:0;background:var(--m-soft);
 border-radius:10px;color:var(--green);font-size:16px}
.mweek{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.mweek button{border:0;background:transparent;padding:6px 0 10px;min-height:60px;display:flex;
 flex-direction:column;align-items:center;gap:5px;border-radius:12px;position:relative}
.mweek button small{font-size:11.5px;color:var(--muted);font-weight:600}
.mweek button b{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;
 justify-content:center;font-size:15.5px;font-weight:700}
.mweek button.sel b{background:var(--green);color:#fff}
.mweek button.today:not(.sel) b{box-shadow:inset 0 0 0 2px var(--green);color:var(--green)}
.mweek button .mbook{position:absolute;bottom:5px;width:5px;height:5px;border-radius:50%;background:var(--green)}
.mweek button.sel .mbook{background:var(--green)}
.mmonth-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:4px 0 8px}
.mmonth-grid strong{text-align:center;font-size:11.5px;color:var(--muted);padding:4px 0}
.mmonth-grid button{border:0;background:transparent;min-height:42px;padding:0;border-radius:10px;
 font-size:15px;font-weight:600;position:relative}
.mmonth-grid button.sel{background:var(--green);color:#fff}
.mmonth-grid button.today:not(.sel){box-shadow:inset 0 0 0 2px var(--green);color:var(--green)}
.mmonth-grid button .mbook{position:absolute;bottom:5px;left:50%;margin-left:-2.5px;width:5px;height:5px;
 border-radius:50%;background:var(--green)}
.mmonth-grid button.sel .mbook{background:#fff}

.magenda-head{font-size:14px;font-weight:750;color:var(--green);background:var(--m-soft);
 border-radius:10px;padding:8px 12px;margin:0 0 8px}
.magenda-group{margin-bottom:16px}
.mappt{display:block;width:100%;text-align:left;background:#fff;border:1px solid var(--m-line);
 border-radius:14px;padding:12px;margin-bottom:8px;min-height:auto}
.mappt-row{display:flex;align-items:baseline;gap:8px}
.mappt-time{font-size:15px;font-weight:750;color:var(--green);flex-shrink:0}
.mappt-name{font-size:15px;font-weight:700;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mappt p{margin:4px 0 0;color:var(--muted);font-size:13.5px;line-height:1.4}
.mtag{display:inline-block;font-size:11.5px;font-weight:700;border-radius:7px;padding:3px 8px;margin-top:8px}
.mtag.booked{background:var(--lime);color:#1d3b5c}
.mtag.arrived{background:#e3f4e8;color:#1f6b3a}
.mtag.followup{background:#f2f3fb;color:#413b8f}
.mtag.blocked{background:#fdecea;color:#a13232}
.mempty{border:1px dashed #c6d3e8;background:#f7fbff;border-radius:14px;padding:16px;
 text-align:center;color:#5a7290;font-size:14px;margin-bottom:8px}

.mfab{position:fixed;right:16px;bottom:calc(var(--m-bar) + 20px + env(safe-area-inset-bottom));
 width:56px;height:56px;min-height:56px;padding:0;border-radius:50%;border:0;background:var(--green);
 color:#fff;font-size:28px;line-height:1;z-index:11;box-shadow:0 6px 18px rgba(55,50,128,.35)}

/* ---------- bottom bar ---------- */
.mtabbar{position:fixed;left:0;right:0;bottom:0;z-index:14;background:#fff;border-top:1px solid var(--m-line);
 height:calc(var(--m-bar) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);
 display:grid;grid-template-columns:repeat(5,1fr);align-items:stretch}
.mtabbar button{border:0;background:transparent;border-radius:0;min-height:auto;padding:8px 2px 6px;
 display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
 font-size:11px;font-weight:650;color:#8892a6}
.mtabbar button .ico{font-size:20px;height:22px;line-height:22px}
.mtabbar button.active{color:var(--green)}
.mtabbar button.active .ico{background:var(--m-soft);border-radius:12px;width:46px}
.mtabbar .mcentre{position:relative}
.mtabbar .mcentre .mcentre-btn{position:absolute;top:-22px;left:50%;margin-left:-28px;width:56px;height:56px;
 min-height:56px;border-radius:50%;background:var(--green);color:#fff;border:4px solid #fff;
 display:flex;align-items:center;justify-content:center;font-size:21px;font-weight:700;padding:0;
 box-shadow:0 6px 16px rgba(55,50,128,.3)}
.mtabbar .mcentre span.mcentre-label{position:absolute;bottom:8px;left:0;right:0;text-align:center;
 font-size:11px;font-weight:650;color:#8892a6}

/* ---------- drawer ---------- */
.mscrim{position:fixed;inset:0;background:rgba(20,24,40,.45);z-index:20;border:0;width:100%;border-radius:0}
.mdrawer{position:fixed;top:0;bottom:0;left:0;width:84%;max-width:330px;background:#fff;z-index:21;
 display:flex;flex-direction:column;overflow-y:auto;box-shadow:2px 0 24px rgba(20,24,40,.2)}
.mdrawer-head{background:var(--m-soft);padding:calc(20px + env(safe-area-inset-top)) 18px 18px;
 display:flex;align-items:center;gap:13px}
.mdrawer-head .mavatar{width:56px;height:56px;border-radius:50%;background:var(--green);color:#fff;
 display:flex;align-items:center;justify-content:center;font-weight:700;font-size:19px;flex-shrink:0}
.mdrawer-head>span{flex:1;min-width:0}
.mdrawer-head strong{display:block;font-size:17px;font-weight:750}
.mdrawer-head small{display:block;color:var(--green);font-size:13px;font-weight:650;margin-top:2px}
.mdrawer-head span.mclinic{display:block;color:var(--muted);font-size:12.5px;margin-top:2px;
 overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mdrawer-group{padding:12px 0 4px}
.mdrawer-group>small{display:block;padding:6px 18px;color:var(--muted);font-size:12px;
 font-weight:700;letter-spacing:.6px;text-transform:uppercase}
.mdrawer-group button{width:100%;border:0;background:transparent;border-radius:0;display:flex;
 align-items:center;gap:13px;padding:13px 18px;text-align:left;font-size:15.5px;font-weight:650;min-height:52px}
.mdrawer-group button .mq-ico{width:34px;height:34px;border-radius:11px;background:var(--m-soft);
 display:flex;align-items:center;justify-content:center;font-size:16px;color:var(--green);flex-shrink:0}
.mdrawer-group button.active{color:var(--green);background:#f7f7fd}
.mdrawer-group button.mlogout{color:#a13232}
.mdrawer-group button.mlogout .mq-ico{background:#fdecea;color:#a13232}
.mdrawer hr{border:0;border-top:1px solid var(--m-line);margin:4px 0}

/* The push prompt (push.js sets inline styles) sits above the tab bar, not over the header. */
body.mob-shell #push-bell{top:auto !important;bottom:calc(var(--m-bar) + 50px + env(safe-area-inset-bottom)) !important;z-index:13 !important}

/* ---------- bottom-sheet dialogs ---------- */
dialog#modal{margin:0 0 0 auto;top:auto;bottom:0;left:0;right:0;width:100%;max-width:100%;max-height:88vh;
 border:0;border-radius:20px 20px 0 0;padding:0;overflow:hidden;display:block}
dialog#modal:not([open]){display:none}
dialog#modal::backdrop{background:rgba(20,24,40,.45)}
dialog#modal .modal-head{position:sticky;top:0;background:#fff;padding:16px 16px 12px;
 border-bottom:1px solid var(--m-line);display:flex;align-items:center;gap:10px}
dialog#modal .modal-head h2{margin:0;font-size:17px;font-weight:750;flex:1}
dialog#modal .modal-head button{min-height:38px;width:38px;padding:0;font-size:20px}
dialog#modal .modal-body{padding:16px 16px calc(20px + env(safe-area-inset-bottom));
 overflow-y:auto;max-height:calc(88vh - 62px)}
dialog#modal .modal-body input,dialog#modal .modal-body select,dialog#modal .modal-body textarea{font-size:16px}
.msheet-actions{display:grid;gap:9px}
.msheet-actions button{min-height:50px;justify-content:flex-start;text-align:left;font-size:15px}
.msheet-call{display:flex;align-items:center;justify-content:flex-start;min-height:50px;padding:10px 16px;
 border:1px solid var(--m-line);border-radius:10px;background:#fff;color:var(--m-ink);
 font-weight:600;font-size:15px;text-decoration:none}
.msheet-note{margin:0 0 14px;color:var(--muted);font-size:13.5px;line-height:1.5}
}

@media (max-width:600px){.or-tiles{gap:6px}.or-tile{padding:8px}.or-tile strong{font-size:14px}#ortho-today .fields{grid-template-columns:1fr}.chips [data-ortho-filter]{min-height:38px;padding:6px 10px;font-size:13px}}
@media (max-width:600px){.tc-field select{font-size:16px;min-height:44px}.tc-warn{color:#b42318!important;font-weight:600}}

/* ---------- blocked time (phone) ---------- */
.mblocks{padding:4px 16px 0}
.mblocks-head{display:flex;align-items:center;gap:10px;justify-content:space-between}
.mblocks-head h2{margin:0;font-size:15px;font-weight:750}
.mblock-add{min-height:36px;padding:0 12px;border-radius:999px;border:1px solid #d7d9e6;
  background:#fff;font-size:14px;font-weight:650;white-space:nowrap}
.mblock{display:flex;align-items:center;gap:10px;justify-content:space-between;
  margin-top:8px;padding:10px 12px;border-radius:12px;background:#f3f1fb;border:1px solid #e2def3}
.mblock-text strong{display:block;font-size:14px}
.mblock-text p{margin:2px 0 0;font-size:13px;color:#5b5f74}
.mblock-actions{display:flex;gap:6px;flex-shrink:0}
.mblock-actions button{min-height:34px;padding:0 10px;border-radius:9px;border:1px solid #d7d9e6;
  background:#fff;font-size:13px}
.mblock-actions button.danger{color:#a3242b;border-color:#e6c8ca}
