/* App layer (3 Nov 2026): Notifications panel, "get the app" sheet, edge swipe, pinned email bar, phone fixes. Loaded last. */
.cx-bottom{grid-auto-flow:column;grid-auto-columns:1fr;grid-template-columns:none!important}
.cx-bottom button{all:unset;display:grid;justify-items:center;gap:3px;font-size:11px;font-weight:700;color:var(--muted);padding:4px 0;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cx-bottom button[aria-expanded="true"]{color:var(--hot)}
.cx-bottom button b{position:absolute;top:0;left:calc(50% + 6px);font-size:10px;background:var(--hot);color:#fff;border-radius:9px;padding:0 5px}
.cx-bottom [hidden]{display:none!important}
.cx-bell{position:relative}
.cx-bell b{position:absolute;top:2px;right:0;min-width:16px;height:16px;line-height:16px;text-align:center;font-size:10px;font-weight:800;background:var(--hot);color:#fff;border-radius:9px;padding:0 4px;box-sizing:border-box}
.cx-bell b[hidden]{display:none}

/* Notifications: a dropdown under the bell on a computer, a full screen list on the phone. */
.cx-alerts{position:fixed;z-index:70;top:62px;right:16px;width:380px;max-height:min(70vh,640px);display:flex;flex-direction:column;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.25);overflow:hidden}
.cx-alerts[hidden]{display:none}
.cx-alerts header{display:flex;align-items:center;gap:6px;padding:10px 10px 6px 12px;flex:none}
.cx-alerts h2{flex:1;margin:0;font-size:17px}
.cx-alerts header button{all:unset;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;cursor:pointer}
.cx-alerts header button:hover{background:var(--hover)}
.cx-alerts svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cx-al-x{display:none!important}
.cx-al-tabs{display:flex;gap:6px;padding:0 12px 8px;flex:none}
.cx-al-tabs:empty{display:none}
.cx-al-tabs button{all:unset;cursor:pointer;padding:5px 12px;border-radius:16px;border:1px solid var(--line);font-size:13px;font-weight:600}
.cx-al-tabs button.on{background:var(--text);color:var(--bg);border-color:var(--text)}
.cx-al-list{overflow:auto;overscroll-behavior:contain;padding:0 0 10px;flex:1;min-height:0}
.cx-al-list h3{margin:8px 14px 4px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.cx-al-row{display:flex;gap:12px;align-items:flex-start;padding:10px 14px;color:inherit;text-decoration:none;border-top:1px solid var(--line)}
.cx-al-row:hover{background:var(--hover)}
.cx-al-row i{flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-style:normal;background:var(--chip,var(--hover));font-size:15px}
.cx-al-row span{flex:1;min-width:0;display:grid;gap:2px;line-height:1.3}
.cx-al-row b{font-size:14px;overflow-wrap:anywhere}
.cx-al-row small{color:var(--muted);font-size:12.5px;overflow-wrap:anywhere}
.cx-al-row em{font-style:normal;font-weight:800;font-size:12px;background:var(--hot);color:#fff;border-radius:10px;padding:1px 7px;align-self:center}
.cx-al-row.new b::after{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--hot);margin-left:7px;vertical-align:middle}
.cx-al-row.read{opacity:.6}
.cx-al-empty{margin:18px 14px;color:var(--muted)}

/* Get the app */
.cx-sheet-wrap{position:fixed;inset:0;z-index:90;background:rgba(5,10,25,.45);display:grid;place-items:center;padding:16px}
.cx-sheet{position:relative;width:min(460px,100%);max-height:calc(100dvh - 32px);overflow:auto;background:var(--panel);color:var(--text);border-radius:20px;padding:20px;box-shadow:0 24px 60px rgba(0,0,0,.35);box-sizing:border-box}
.cx-sheet-x{all:unset;position:absolute;top:10px;right:10px;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;cursor:pointer}
.cx-sheet-x:hover{background:var(--hover)}
.cx-sheet svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cx-sheet svg.cx-inl{width:17px;height:17px;vertical-align:-3px}
.cx-sheet-h{display:flex;gap:14px;align-items:center;margin:0 34px 14px 0}
.cx-sheet-h img{width:56px;height:56px;border-radius:14px;box-shadow:0 1px 5px rgba(0,0,0,.2);flex:none}
.cx-sheet-h b{display:block;font-size:17px}
.cx-sheet-h small{color:var(--muted);font-size:13px}
.cx-sheet h4{margin:12px 0 4px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.cx-steps{margin:6px 0 0;padding-left:22px;display:grid;gap:7px;font-size:14px}
.cx-note{font-size:14px;margin:6px 0 0}
.cx-install{all:unset;box-sizing:border-box;display:block;width:100%;text-align:center;cursor:pointer;background:var(--hot);color:var(--on-hot,#fff);font-weight:700;padding:12px;border-radius:12px;margin-top:6px}
.cx-qr{display:flex;gap:14px;align-items:center;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.cx-qr-img{flex:none;width:132px;height:132px;background:#fff;border-radius:10px;padding:4px;box-sizing:border-box}
.cx-qr-img svg{width:100%;height:100%;stroke:none}
.cx-qr p{margin:0;font-size:13.5px;color:var(--muted)}.cx-qr p b{display:block;color:var(--text);font-size:15px;margin-bottom:3px}
.cx-later{all:unset;display:block;margin:14px auto 0;color:var(--muted);font-size:13px;cursor:pointer;padding:6px 10px}
@media (max-width:850px){.cx-sheet-wrap{place-items:end center;padding:0}.cx-sheet{width:100%;border-radius:20px 20px 0 0;padding-bottom:max(20px,env(safe-area-inset-bottom))}}

/* Edge swipe hint */
.cx-swipe{position:fixed;left:0;z-index:95;width:40px;height:40px;margin-left:-6px;border-radius:50%;display:grid;place-items:center;background:var(--panel);color:var(--text);box-shadow:0 4px 16px rgba(0,0,0,.3);pointer-events:none;transform:translateY(-50%)}
.cx-swipe svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.cx-swipe.go{background:var(--hot);color:#fff}

@media (max-width:850px){
  /* Notifications fill the screen between the top bar and the bottom bar; Back (or swipe) returns to the page. */
  .cx-alerts{inset:0;top:var(--cx-head,57px);right:0;width:auto;max-height:none;border:0;border-radius:0;box-shadow:none;padding-bottom:calc(66px + env(safe-area-inset-bottom));z-index:43;background:var(--bg)}
  .cx-al-x{display:grid!important}
  .cx-alerts header{padding:10px 8px 8px;border-bottom:1px solid var(--line)}
  .cx-al-tabs{padding:10px 12px 8px}
  .cx-al-row{padding:12px 14px}
  body.cx-alerts-open{overflow:hidden}
  .cx-bell.cx-hide-s{display:none}

  /* Wide tables reflow instead of scrolling sideways inside their box */
  .tablewrap:not(.phone-cards) table{min-width:0!important;width:100%}
  .tablewrap:not(.phone-cards) td{white-space:normal;overflow-wrap:anywhere}
  .tablewrap:not(.phone-cards) th{white-space:nowrap}
  /* The floating calendar + tasks buttons sit side by side and the page leaves room for them (same as ABFI r12) */
  .cx-rail{flex-direction:row;padding:4px;gap:2px}
  .cx-rail hr{display:none}
  body.cx-has-rail .main{padding-bottom:calc(150px + env(safe-area-inset-bottom,0px))}

  /* Email: the bar with Back, archive and delete stays pinned while a message scrolls. */
  .gm[data-open="1"] .gm-listpane{position:sticky;top:var(--cx-head,56px);z-index:8;background:var(--bg)}
  .gm[data-open="1"] .gm-tools{position:static;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;border-bottom:1px solid var(--line)}
  .gm[data-open="1"] .gm-tools::-webkit-scrollbar{display:none}
  .gm[data-open="1"] .gm-tools > *{flex:none}

  input,select,textarea{font-size:16px}  /* iPhone zooms the page into any smaller box and never zooms back */
}
/* Inside the home-screen app: no rubber-band under the fixed bars, room for the iPhone notch. */
.cx-app body{overscroll-behavior-y:none}
/* crm-phone.css pads the body for the notch and the top bar pads again: one gap only (the bars carry their own). */
@media (display-mode: standalone){body:has(> .cx-top),body:has(.cx-top){padding-top:0;padding-bottom:0}}
@media (prefers-reduced-motion:reduce){.cx-swipe{transition:none}}
