/* Ethos Prime on a phone (Avin, 8-Oct-2026: "keep tracking progress on the go").
   Loaded after the page's own styles. Everything that changes the layout sits inside the
   phone media query, so the desktop layout is untouched. Shell pieces (#macct, .mtab,
   #mdrawer) are added by mobile.js and stay hidden on a wide screen. */
#macct,.mtab,#mdrawer,.mclose{display:none}
/* Critical cases: the three group boxes (was an inline style, which a phone rule cannot override) */
.dbcards.cgcards.cg3{grid-template-columns:1.6fr 1fr 1.3fr!important}

@media (max-width:760px){
  html{-webkit-text-size-adjust:100%}
  body{overflow-x:hidden}
  .wrap{padding:0 14px}

  /* ---------- header: logo, Prime mark, Report (icon), Train me (icon), menu ---------- */
  .topbar .wrap{gap:10px;min-height:54px}
  .topbar img{height:24px}
  .primemark{padding-left:10px}
  .primemark b{font-size:15px;white-space:nowrap}
  .primemark small{display:none}
  .topbar .who{flex:none}
  .who{gap:6px}
  .who .adminbadge,.who .labname{display:none}
  .topbar .rptbtn,#macct{min-height:40px;min-width:40px;padding:0 10px;border-radius:10px;font-size:16px}
  #rpt .rpl,#trainme .tml{display:none}
  #rpt{position:relative}
  .topbar #out{display:none!important}           /* Sign out lives in the menu on a phone */
  #macct{display:inline-flex;align-items:center;justify-content:center;gap:0}
  #macct svg{width:20px;height:20px}

  /* ---------- module menu: bottom tab bar + "More" drawer instead of the long top menu ---------- */
  body.mnav .primenav{display:none}
  body.mnav main.wrap{padding-bottom:86px}
  body.mnav .foot{padding-bottom:84px}
  body.mnav .toast{bottom:84px}
  .mtab{display:grid;position:fixed;left:0;right:0;bottom:0;z-index:45;background:#fff;border-top:1px solid var(--line);
    box-shadow:0 -4px 16px rgba(16,40,60,.06);grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);padding-bottom:env(safe-area-inset-bottom)}
  .mtab a,.mtab button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:58px;
    padding:6px 2px 5px;border:0;background:none;font:inherit;font-size:11px;font-weight:700;color:var(--muted);text-decoration:none;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-tap-highlight-color:transparent}
  .mtab svg{width:22px;height:22px;flex:none}
  .mtab [aria-current=page]{color:var(--brand-deep)}
  .mtab [aria-current=page]::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 3px 3px;background:var(--brand-deep)}
  .mtab .abadge{position:absolute;top:5px;left:calc(50% + 6px);min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:#D64535;color:#fff;
    font-size:10.5px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}

  #mdrawer{display:block;position:fixed;inset:0;z-index:70;background:rgba(12,30,45,.5)}
  #mdrawer[hidden]{display:none}
  #mdrawer .pn{position:absolute;top:0;right:0;bottom:0;width:min(330px,88vw);background:#fff;display:flex;flex-direction:column;
    box-shadow:-10px 0 40px rgba(0,0,0,.2);padding-bottom:env(safe-area-inset-bottom)}
  #mdrawer .hd{display:flex;align-items:center;gap:10px;padding:14px 14px 12px 18px;border-bottom:1px solid var(--line)}
  #mdrawer .hd b{font-size:16px;color:var(--brand-ink)}
  #mdrawer .hd .x{margin-left:auto;width:40px;height:40px;border:0;border-radius:10px;background:#EEF2F5;font-size:20px;color:var(--ink)}
  #mdrawer .ls{flex:1;overflow:auto;padding:8px 10px}
  #mdrawer .ls a{display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 10px;border-radius:10px;text-decoration:none;color:var(--ink);font-weight:700;font-size:15px}
  #mdrawer .ls a svg{width:22px;height:22px;color:var(--muted);flex:none}
  #mdrawer .ls a .k{margin-left:auto;font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;padding:2px 7px;border-radius:999px;background:var(--brand-soft);color:var(--brand-deep)}
  #mdrawer .ls a[aria-current=page]{background:var(--brand-soft);color:var(--brand-deep)}
  #mdrawer .ls a[aria-current=page] svg{color:var(--brand-deep)}
  #mdrawer .ls a .abadge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#D64535;color:#fff;font-size:11px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
  #mdrawer .ac{border-top:1px solid var(--line);padding:12px 18px 16px}
  #mdrawer .ac .id{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 0 12px}
  #mdrawer .ac .id b{display:block;color:var(--ink);font-size:14px}
  #mdrawer .ac .so{width:100%;min-height:44px;border-radius:10px;border:1px solid #EBC2BE;background:#fff;color:var(--coral);font-weight:700}

  /* ---------- page furniture ---------- */
  main.wrap{padding-top:14px}
  .labbar .wrap{min-height:40px;gap:8px}
  .labbar .v{font-size:14px}
  .section-h{margin:14px 0 8px}
  .btn{min-height:40px}

  /* tab strips become one row of scrollable pills */
  .rg-tabs,.stabs,.tabsx{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;gap:6px;-webkit-overflow-scrolling:touch}
  .rg-tabs::-webkit-scrollbar,.stabs::-webkit-scrollbar,.tabsx::-webkit-scrollbar{display:none}
  .rg-tabs a,.stabs a,.stabs button,.tabsx button{white-space:nowrap;flex:none;min-height:40px;display:inline-flex;align-items:center}

  /* wide tables scroll inside their own box, first column stays put (mobile.js adds .mx / .msticky) */
  .mx{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  html body table.msticky tr>:first-child{position:sticky;left:0;z-index:1;background:var(--card,#fff);box-shadow:1px 0 0 var(--line)}
  html body table.msticky thead tr>:first-child{z-index:3;background:#F7F9FB}
  html body table.msticky tr>:first-child{white-space:normal;width:132px;min-width:112px;line-height:1.25}
  html body table.msticky td:first-child small{display:block}

  /* dialogs fill the screen, close button within thumb reach */
  .overlay{padding:0!important;align-items:stretch!important}
  .overlay .modal{max-width:none!important;width:100%!important;max-height:none!important;height:100%;border-radius:0!important}
  .overlay .modal.confirm{height:auto;margin-top:auto;border-radius:18px 18px 0 0!important;max-height:92vh!important}
  .overlay .modal header{position:sticky;top:0;z-index:2;background:#fff;padding:14px 16px 12px}
  .overlay .modal .x{width:40px;height:40px;flex:none}
  .overlay .modal .body{padding:16px}
}

/* ---------- per page. Module styles (cadence.js, support.js, ...) are added to the page after this
   file, so these rules start with "html body" to win over them. ---------- */
@media (max-width:760px){
  /* My day: the filter row sticks under the header, insurer + View as side by side */
  html body .cad .fbar{top:58px;gap:6px;padding:6px 0;margin:0 0 10px}
  html body .cad .fbar .fl{display:none}
  html body .cad .fbar select{flex:1 1 40%;min-width:0;max-width:none;min-height:40px;font-size:14px}
  html body .cad .top h1{font-size:20px}
  html body .cad .tw{max-height:none}

  /* Support > My desk */
  html body .sup table.ptt td{height:40px}
  html body .sup .ptt td.cell{min-width:44px}
  html body .sup .att .tx{white-space:normal;overflow:visible;line-height:1.4}
  html body .sup .att a.it,html body .sup .att div.it{padding:10px 12px;align-items:flex-start}
  html body .sup .att .dot{margin-top:6px}
  html body .sup .att.cbl div.it{flex-wrap:wrap;align-items:flex-start;row-gap:6px}
  html body .sup .att.cbl .tx{flex:1 1 calc(100% - 24px)}
  html body .sup .cbl .tx a{display:inline-block;padding:4px 0;color:var(--brand-deep)}
  html body .sup .cbl .tx a b{font-size:15.5px}
  html body .sup .cbl .tx a::before{content:"\260E  ";font-weight:400}
  html body .sup .att.cbl .btn-cb{flex:1 0 calc(100% - 20px);margin:0 0 0 19px;min-height:40px;font-size:14px}

  /* Sales: the status pop-up and the side panel fill the screen, close button stays in reach */
  html body .sal-pop{padding:0;place-items:stretch}
  html body .sal-pop .box{max-width:none;width:100%;max-height:none;height:100%;border-radius:0;padding:14px 16px 28px}
  html body .sal-pop .box .mclose{display:block;position:sticky;top:0;float:right;z-index:3;margin:-4px -4px 6px 10px;width:40px;height:40px;border:0;border-radius:10px;background:#EEF2F5;font-size:22px;color:var(--ink)}
  html body .sal-pop .row .btn{flex:1 1 auto}
  html body .sal-dr .pn{width:100%;padding:12px 16px 40px}
  html body .sal-dr .pn>.x{position:sticky;top:0;z-index:3;width:40px;height:40px;border-radius:10px;background:#EEF2F5;color:var(--ink)}

  /* Operations: queue rows stack (name, last message, reason + waiting) instead of clipping the name */
  html body .qrow{grid-template-columns:minmax(0,1fr)!important;gap:4px 10px}
  html body .qrow>*{grid-column:auto!important}
  html body .qrow .c2{display:block!important}
  html body .qrow .right{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;text-align:left;flex-wrap:wrap;gap:6px}
  html body .qhead{display:none}
  html body .dbcards.cgcards.cg3{grid-template-columns:minmax(0,1fr)!important}

  /* module tab strips: one scrollable row */
  html body .hrx .tabs,html body .coll .tabs,html body .iu .tabs,html body .sup .tabs,html body .sal .stabs,html body .fin .ftabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
  html body .hrx .tabs a,html body .coll .tabs a,html body .iu .tabs a,html body .sup .tabs a,html body .sal .stabs a,html body .fin .ftabs a{white-space:nowrap;flex:none;min-height:40px;display:inline-flex;align-items:center}

  /* number tiles (Open work, Daily control, Lab network, Grievances...): two per row, compact */
  html body .tabs.ops{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px;margin:0 0 14px}
  html body .tabs.ops .tab{padding:12px 12px 10px;gap:6px;min-height:0}
  html body .tabs.ops .tab .n{font-size:24px}
  html body .tabs.ops .tab .ic{width:34px;height:34px}

  /* Collections section headings */
  html body .coll .kick{flex-wrap:wrap;gap:2px 8px}
  html body .coll .kick::after{display:none}

  /* Case registration: file rows stack (insurer, file, counts) instead of overlapping */
  html body .rg-item{flex-wrap:wrap;gap:6px 10px}
  html body .rg-item .rg-ins{min-width:0;flex:1 1 auto;order:1}
  html body .rg-item .rg-go{order:2}
  html body .rg-item .rg-main{flex:1 1 100%;order:3}
  html body .rg-item .rg-cts{order:4;flex:1 1 auto;justify-content:flex-start}
  html body .rg-item .rg-dis{order:5;min-height:36px;padding:0 4px}

  /* IT development tables: the last (text) column needs room or rows grow very tall */
  html body .rg-t td:last-child{min-width:220px}

  /* Report an issue search (22-Oct-2026): 16px stops iOS zooming on focus; keep box + buttons on one line */
  html body .isx .issrch{flex-wrap:nowrap}
  html body .isx .issrch input{font-size:16px;min-height:42px}
  html body .isx .issrch .btn{min-height:42px;padding:0 12px;flex:none}
}
