/* v49 responsive – ONLY under body.mobile (<768px) and body.tablet (768–1100px). Desktop is unchanged. */
#v49Tabs,#v49Fab,#v49SchTop,#v49Extra{display:none}

/* ---------- PHONE ---------- */
body.mobile{--v49-tabs:62px;-webkit-text-size-adjust:100%}
body.mobile .v21{display:block;height:auto;min-height:var(--v49vh,100vh);padding-bottom:calc(var(--v49-tabs) + env(safe-area-inset-bottom))}
body.mobile .v21-main{min-height:0}
body.mobile .v21-content{overflow:hidden}
/* sidebar → "More" drawer */
body.mobile .v21-side{position:fixed;inset:0 0 calc(var(--v49-tabs) + env(safe-area-inset-bottom)) 0;width:auto;max-width:none;z-index:1050;transform:translateX(-102%);transition:transform .2s ease;overflow:auto;box-shadow:4px 0 24px #0005}
body.mobile.v49-more .v21-side{transform:none}
body.mobile .v21.side-collapsed .nav-label,body.mobile .v21.side-collapsed .nav-group,body.mobile .v21.side-collapsed .v21-account{display:revert}
body.mobile .v21-side .nav-item{min-height:48px;font-size:1rem;padding:.6rem 1.1rem;justify-content:flex-start}
body.mobile #v49Extra{display:block;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:.4rem;margin-bottom:.3rem}
body.mobile #v21Burger{display:none}
/* top bar */
body.mobile .v21-top{height:auto;min-height:52px;padding:.35rem .6rem;gap:.4rem;position:sticky;top:0;z-index:900}
body.mobile .v21-search{max-width:none;flex:1;min-width:0}
body.mobile .v21-search input{width:100%}
body.mobile #v21NewBtn{display:none}
body.mobile #v21Help{display:none}
body.mobile .v21-menu{position:fixed!important;left:8px!important;right:8px!important;top:56px!important;max-width:none!important;width:auto!important;max-height:75vh;overflow:auto}
/* bottom tabs */
body.mobile #v49Tabs{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:1060;background:#fff;border-top:1px solid #e2e8f0;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -2px 10px #0001}
body.mobile #v49Tabs button{flex:1;min-height:var(--v49-tabs);border:0;background:none;color:#64748b;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:600 12px/1.1 inherit;position:relative;padding:4px 0}
body.mobile #v49Tabs button.on{color:#0b84c6}
body.mobile #v49Tabs .v49-cnt{position:absolute;top:4px;left:calc(50% + 4px);background:#ef4444;color:#fff;border-radius:999px;font-size:11px;font-weight:800;padding:1px 6px;min-width:20px;border:2px solid #fff}
body.mobile .v46-fab{display:none!important}
/* round + button */
body.mobile #v49Fab{display:flex;position:fixed;right:16px;bottom:calc(var(--v49-tabs) + 16px + env(safe-area-inset-bottom));width:62px;height:62px;border-radius:50%;border:0;background:#0b9bc6;color:#fff;align-items:center;justify-content:center;box-shadow:0 6px 18px #0005;z-index:1040}
/* scheduler – Tradify style */
body.mobile .sch{display:flex;flex-direction:column;height:calc(var(--v49vh,100dvh) - 52px - var(--v49-tabs) - env(safe-area-inset-bottom));min-height:0}
body.mobile #v49SchTop{display:block;background:#fff;flex:none;z-index:800;border-bottom:1px solid #e2e8f0}
body.mobile .v49-seg-row{display:flex;align-items:center;justify-content:center;padding:.5rem .6rem .3rem;position:relative}
body.mobile .v49-seg{display:inline-flex;border:1.5px solid #334155;border-radius:8px;overflow:hidden}
body.mobile .v49-seg button{min-width:88px;min-height:40px;border:0;border-left:1.5px solid #334155;background:#fff;color:#1e293b;font-size:15px}
body.mobile .v49-seg button:first-child{border-left:0}
body.mobile .v49-seg button.on{background:#4b5563;color:#fff}
body.mobile .v49-dots{position:absolute;right:.4rem;top:.45rem;min-width:44px;min-height:44px;border:0;background:none;font-size:18px;letter-spacing:1px;color:#475569}
body.mobile .v49-date{display:flex;align-items:center;justify-content:space-between;padding:.1rem .3rem .35rem}
body.mobile .v49-date h2{margin:0;font-size:1.15rem;font-weight:500;color:#0b84c6;text-align:center;flex:1}
body.mobile .v49-arrow{min-width:48px;min-height:48px;border:0;background:none;color:#1e293b;display:flex;align-items:center;justify-content:center}
body.mobile .sch-bar{display:none;flex-wrap:wrap;gap:.4rem;padding:.5rem}
body.mobile .sch.v49-bar-open .sch-bar{display:flex}
body.mobile .sch-bar #schNew,body.mobile .sch-bar .sch-arrows,body.mobile .sch-bar .sch-range,body.mobile .sch-bar #schNewWin,body.mobile .sch-bar #schUnsched{display:none}
body.mobile .sch-bar-right{margin-left:0;flex-wrap:wrap;gap:.4rem}
body.mobile .sch-main{flex:1;min-height:0;display:flex;overflow:hidden}
body.mobile .sch-board{flex:1;min-width:0;min-height:0}
body.mobile .sch-side:not(.hidden){position:fixed;inset:110px 0 var(--v49-tabs) 0;width:auto;max-width:none;z-index:850;background:#fff;overflow:auto}
body.mobile .sch-now{height:2px}
body.mobile .sch-now::before,body.mobile .sch-now::after{content:"";position:absolute;top:-5px;width:12px;height:12px;border-radius:50%;background:#dc2626}
body.mobile .sch-now::before{left:-6px}body.mobile .sch-now::after{right:-6px}
body.mobile .sch-ev{font-size:13px;line-height:1.3;padding:4px 6px;border-radius:4px}
body.mobile .sch-ev .bk-badge{font-size:11px;padding:1px 8px}
body.mobile .sch-legend{display:none}
/* modals & forms – full screen, one column, sticky footer */
body.mobile .v21-modal{align-items:stretch}
body.mobile .v21-modal-panel,body.mobile .v21-modal-panel.wide{width:100vw;max-width:100vw;height:100%;max-height:none;border-radius:0}
body.mobile .v21-modal-body{padding:.8rem}
body.mobile .v21-modal-foot{position:sticky;bottom:0;padding:.6rem .8rem calc(.6rem + env(safe-area-inset-bottom));border-radius:0;z-index:2}
body.mobile .v21-modal-foot .btn{flex:1;min-height:48px}
body.mobile .appt-grid,body.mobile .appt-when,body.mobile .appt-when>div,body.mobile .pf.grid2,body.mobile .v21-modal-panel.wide .pf.grid2{grid-template-columns:1fr!important}
body.mobile .jt-panel{width:100vw!important;max-width:100vw!important;height:100%!important;max-height:none!important;left:0!important;right:0!important;top:0!important;border-radius:0!important;transform:none!important}
body.mobile .jt-head{position:sticky;top:0;z-index:5;flex-wrap:wrap;gap:.4rem}
body.mobile input:not([type=checkbox]):not([type=radio]),body.mobile select,body.mobile textarea{font-size:16px!important;min-height:44px}
body.mobile .btn,body.mobile button.nav-item{min-height:44px}
body.mobile .btn.icon{min-width:44px}
/* list windows – back arrow, stacked cards */
body.mobile .inline-notice{display:none}
body.mobile[data-shell="list"] .rl-wrap,body.mobile[data-shell="list"] main{padding-left:.6rem!important;padding-right:.6rem!important;padding-bottom:1rem}
body.mobile .rl-head{flex-wrap:wrap;gap:.5rem;padding:.5rem 0}
body.mobile .rl-head h1{font-size:1.2rem;flex:1}
body.mobile .v49-back{order:-1;min-width:48px;min-height:48px;border:0!important;background:none!important;display:flex;align-items:center;justify-content:center;padding:0!important}
body.mobile .rl-actions{width:100%;display:flex;flex-wrap:wrap;gap:.4rem}
body.mobile .rl-tablewrap{border:0;background:none;overflow:visible}
body.mobile table.v49-cards,body.mobile table.v49-cards tbody,body.mobile table.v49-cards tr,body.mobile table.v49-cards td{display:block;width:auto}
body.mobile table.v49-cards thead{display:none}
body.mobile table.v49-cards tr{background:#fff;border:1px solid #e2e8f0;border-radius:12px;margin:0 0 .6rem;padding:.55rem .8rem;box-shadow:0 1px 3px #0001;min-height:44px}
body.mobile table.v49-cards td{border:0;padding:.18rem 0;display:flex;gap:.6rem;font-size:15px;min-height:0}
body.mobile table.v49-cards td:empty{display:none}
body.mobile table.v49-cards td[data-label]::before{content:attr(data-label);flex:0 0 40%;color:#64748b;font-size:12px;text-transform:uppercase;letter-spacing:.04em;padding-top:2px}
body.mobile table.v49-cards td:first-child{font-weight:700;font-size:16px}
body.mobile table.v49-cards td:first-child::before{display:none}

/* ---------- TABLET ---------- */
body.tablet .v21-modal-panel.wide{width:96vw}
body.tablet .appt-grid{grid-template-columns:1fr 1fr}
body.tablet .pf.grid2,body.tablet .v21-modal-panel.wide .pf.grid2{grid-template-columns:1fr 1fr}
body.tablet input:not([type=checkbox]):not([type=radio]),body.tablet select,body.tablet textarea{font-size:16px}
body.tablet .btn,body.tablet .nav-item{min-height:40px}
body.tablet .v21-search{max-width:300px}
body.tablet .sch-bar{flex-wrap:wrap}
body.tablet #schNewWin{display:none}
body.mobile:not([data-shell="list"]) #syncPill{bottom:calc(var(--v49-tabs) + 8px + env(safe-area-inset-bottom))!important;left:8px!important}
body.mobile:not([data-shell="list"]) .v45-bar{bottom:calc(var(--v49-tabs) + 8px)!important}
body.mobile .rl-head img,body.mobile .rl-head .rl-logo{display:none}
body.mobile .v21-modal-body [class*="grid"],body.mobile .v21-modal-body .row2{grid-template-columns:1fr!important}
body.mobile .jt-panel select,body.mobile .jt-panel input,body.mobile .jt-panel textarea{max-width:100%;box-sizing:border-box}
body.mobile .jt-panel *{min-width:0}
body.tablet .appt-when{grid-template-columns:1fr}
body.mobile:has(.jt-modal:not(.hidden)) #v49Fab,body.mobile:has(.v21-modal) #v49Fab,body.mobile.v49-more #v49Fab{display:none}
.v49-next{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:.7rem .8rem;margin:.6rem 0;box-shadow:0 1px 3px #0001}
.v49-next-h{display:flex;justify-content:space-between;align-items:center}.v49-next h3{margin:0 0 .4rem;font-size:1.05rem}
.v49-next-card{display:block;width:100%;text-align:left;background:#f1f5f9;border:0;border-radius:10px;padding:.7rem;font-size:15px;line-height:1.4;min-height:44px}
.v49-next-btns{display:flex;gap:.5rem;margin-top:.55rem}.v49-next-btns>*{flex:1;min-height:48px;display:flex;align-items:center;justify-content:center;font-size:15px}
/* v49b readable sizes on phone */
body.mobile .sch-hour{font-size:13px;color:#475569}
body.mobile .sch-gutter-head{font-size:11px}
body.mobile .sch-dayhead{font-size:14px;padding:.5rem .3rem}
body.mobile .sch-dayhead .dow{font-size:12px}
body.mobile .sch-dayhead .dnum{font-size:16px}
body.mobile .sch-ev{font-size:14px}
body.mobile .v21-top .btn,body.mobile .v21-top .avatar{min-width:44px;min-height:44px}
body.mobile #v49Tabs .v49-tl{font-size:13px}
body.mobile #v49Tabs svg{width:26px;height:26px}
/* v49c touch move mode */
@media (pointer:coarse){.sch-ev[data-drag]{touch-action:pan-x pan-y;-webkit-touch-callout:none}}
.sch-ev.v49c-armed{z-index:20!important;box-shadow:0 10px 26px rgba(15,23,42,.45)!important;transform:scale(1.04);outline:2px solid #0b9bc6;animation:v49cWiggle .28s ease-in-out 3}
.sch-ev.v49c-armed.dragging{animation:none}
@keyframes v49cWiggle{0%,100%{transform:scale(1.04) rotate(0)}25%{transform:scale(1.04) rotate(-1.6deg)}75%{transform:scale(1.04) rotate(1.6deg)}}
.v49c-confirm{position:fixed;inset:0;z-index:2000;background:rgba(15,23,42,.45);display:flex;align-items:flex-end;justify-content:center}
.v49c-box{background:#fff;width:min(460px,100%);border-radius:16px 16px 0 0;padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));box-shadow:0 -6px 24px #0003}
.v49c-box p{font-size:17px;font-weight:600;margin:.2rem 0 1rem;color:#0f172a}
.v49c-btns{display:flex;gap:.6rem}.v49c-btns .btn{flex:1;min-height:48px;font-size:16px}
/* v49d compact phone diary header (Tradify-like): one 44px top row + 40px date row */
#v49SearchBtn,.v49-search-close{display:none}
body.mobile .v21-top{min-height:44px;height:44px;padding:0 .3rem;gap:.25rem;flex-wrap:nowrap}
body.mobile .v21-top .v21-search{display:none}
body.mobile #v49SearchBtn{display:flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border:0;background:none;color:#334155;flex:none}
body.mobile.v49-search .v21-top .v21-search{display:flex;position:fixed;inset:0;z-index:1500;background:#fff;padding:.5rem;flex-direction:row;flex-wrap:wrap;align-content:flex-start;gap:.4rem;max-width:none}
body.mobile.v49-search .v21-search input{flex:1;min-height:44px;font-size:16px!important}
body.mobile.v49-search .v49-search-close{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:0;background:none}
body.mobile.v49-search .v21-search-res{position:static!important;flex-basis:100%;max-height:none!important;box-shadow:none!important;border:0!important}
body.mobile .v21-top .v49-seg{flex:1;min-width:0;max-width:230px;margin:0 auto;border-width:1px;border-radius:7px}
body.mobile .v21-top .v49-seg button{min-width:0;flex:1;min-height:34px;font-size:14px;padding:0 4px;border-left-width:1px}
body.mobile .v21-top .v49-dots{position:static;min-width:36px;min-height:40px;padding:0;font-size:15px}
body.mobile .v21-top-right{gap:0;margin-left:0}
body.mobile .v21-top #v21Bell{min-width:40px;min-height:40px;padding:0}
body.mobile .v21-top .avatar{min-width:34px!important;min-height:34px!important;width:34px;height:34px;font-size:13px}
body.mobile .v49-seg-row{display:none}
body.mobile .v49-date{padding:0 .1rem;min-height:40px}
body.mobile .v49-date h2{font-size:1.02rem}
body.mobile .v49-arrow{min-width:44px;min-height:40px}
body.mobile .v49-arrow svg{width:26px;height:26px}
body.mobile .sch{height:calc(var(--v49vh,100dvh) - 44px - var(--v49-tabs) - env(safe-area-inset-bottom))}
body.mobile .sch.v49-day .sch-head{display:none}
body.mobile .sch-ev{font-size:13px;line-height:1.25;padding:2px 5px}
body.mobile .sch-ev .bk-badge{font-size:10px;padding:0 6px}
body.mobile .sch-hour{font-size:12px}
body.mobile #syncPill{font-size:10px!important;padding:1px 7px!important;bottom:calc(var(--v49-tabs) + 4px + env(safe-area-inset-bottom))!important;left:4px!important;opacity:.92}
body.mobile #syncPill:not(.wait):not(.off){display:none}
body.mobile.v49-search #v49Fab{display:none}
body.mobile .v21-side .nav-item.nav-sub{padding-left:2.4rem}
/* v52 PAT */
.v52-btn{background:#0f2a48!important;color:#fff!important;border-color:#0f2a48!important}
.jt-head .v52-btn{background:#fff!important;color:#0f2a48!important;border:1px solid #fff!important;font-weight:700}
.v52-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;margin:10px 0}.v52-paste{flex:1 1 320px}.v52-paste summary{list-style:none;display:inline-block}.v52-paste textarea{width:100%;margin:6px 0;font-family:monospace}
.v52-grid-wrap{overflow:auto;max-height:52vh;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:8px}.v52-grid{border-collapse:collapse;width:100%;font-size:13px}.v52-grid th{position:sticky;top:0;background:#0f2a48;color:#fff;padding:4px 6px;white-space:nowrap;font-weight:600}.v52-grid td{padding:2px;border-bottom:1px solid #eef2f7}.v52-grid input,.v52-grid select{width:100%;min-width:76px;padding:4px 6px;border:1px solid #d6dde6;border-radius:5px;font:inherit}
.v52-done{background:#ecfdf5;border:1px solid #86efac;border-radius:8px;padding:10px;margin-top:8px}
.v52-modal .grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px}.v52-modal .grid2 label{display:flex;flex-direction:column;gap:3px;font-size:13px}.v52-modal .grid2 .full{grid-column:1/-1}
body.mobile .v52-modal .grid2{grid-template-columns:1fr}
body.mobile .v52-grid-wrap{max-height:none;overflow:visible;border:0}
body.mobile .v52-grid thead{display:none}
body.mobile .v52-grid,body.mobile .v52-grid tbody{display:block}
body.mobile .v52-grid tr{display:grid;grid-template-columns:1fr 1fr;gap:6px 8px;border:1px solid #d6dde6;border-radius:12px;padding:10px;margin-bottom:10px;background:#fff;position:relative}
body.mobile .v52-grid td{display:flex;flex-direction:column;border:0;font-size:12px;color:#475569}
body.mobile .v52-grid td::before{content:attr(data-label);font-weight:600;margin-bottom:2px}
body.mobile .v52-grid td:nth-child(2),body.mobile .v52-grid td:nth-child(11){grid-column:1/-1}
body.mobile .v52-grid td:last-child{position:absolute;top:6px;right:6px}
body.mobile .v52-grid input,body.mobile .v52-grid select{font-size:16px;min-height:42px}
body.mobile #patAdd{width:100%;min-height:48px}
.v52-jtp{background:#e0f2fe!important;color:#075985!important}.v52-jtp.unset{background:#f1f5f9!important;color:#64748b!important}
.ev-jt{font-size:11px;font-weight:600;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v52-jtf{display:inline-flex;align-items:center;gap:6px;font-size:13px;margin:6px 8px 6px 0}.v52-jtf select{padding:4px 6px}
.req{color:#b91c1c}
body.mobile .v52-jtf{display:flex;width:100%}body.mobile .v52-jtf select{flex:1;min-height:40px;font-size:16px}
