/* Phone layout pass (Nov 1 2026, Mark: "nothing scrolling right to left; what is wide on
   a desktop becomes vertical on mobile"). Scoped to phones and loaded last. */
@media (max-width:700px){
  /* ---------- Service Desk header: no sideways strips ---------- */
  body.at-phone-shell .sd-tabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;overflow:visible!important;width:auto!important;padding:8px!important}
  body.at-phone-shell .sd-tabs .sd-tab-divider{display:none!important}
  body.at-phone-shell .sd-tabs .sd-tab{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;min-width:0!important;min-height:54px!important;margin:0!important;padding:6px 4px!important;border:1px solid #e3e9ef!important;border-radius:10px!important;background:#fff!important;white-space:nowrap!important;font-size:13px!important;line-height:1.15!important}
  body.at-phone-shell .sd-tabs .sd-tab b{order:-1;font-size:19px!important;line-height:1.1!important}
  body.at-phone-shell .sd-tabs .sd-tab[aria-pressed="true"]{border-color:#1872D2!important;background:#eef4fb!important;color:#1872D2!important}

  body.at-phone-shell .sd-ops,
  body.at-phone-shell .sd-ai-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important;gap:6px!important;width:auto!important;white-space:normal!important}
  body.at-phone-shell .sd-ops > *,
  body.at-phone-shell .sd-ai-row > *{min-width:0!important;margin:0!important}
  body.at-phone-shell .sd-ops .sd-op,
  body.at-phone-shell .sd-ai-row .sd-chip{display:flex!important;align-items:center!important;gap:6px!important;width:100%!important;min-height:42px!important;padding:6px 10px!important;font-size:14px!important;line-height:1.2!important;white-space:normal!important;text-align:left!important;box-sizing:border-box!important}
  body.at-phone-shell .sd-ops .sd-op b,
  body.at-phone-shell .sd-ai-row .sd-chip b{font-size:15px!important}
  body.at-phone-shell .sd-ops #onlineNowSummaryCard{grid-column:1/-1!important}
  body.at-phone-shell .sd-ops .sd-op-cluster{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:0!important;border:1px solid #e3e9ef!important;border-radius:10px!important;background:#fff!important;overflow:hidden!important}
  body.at-phone-shell .sd-ops .sd-op-cluster .sd-op{border:0!important;border-radius:0!important;min-height:30px!important;padding-bottom:0!important;background:transparent!important}
  body.at-phone-shell .sd-ops .sd-op-cluster .sd-sub-link{padding:0 10px 6px!important;font-size:13px!important;text-align:left!important}
  body.at-phone-shell .sd-ai-row .sd-ai-label,
  body.at-phone-shell .sd-ai-row .sd-ai-group,
  body.at-phone-shell .sd-ai-row .sd-ai-subtitle{grid-column:1/-1!important;margin-top:2px!important}
  body.at-phone-shell .sd-ai-row .sd-chip-divider{display:none!important}
  body.at-phone-shell .sd-chip-cluster,
  body.at-phone-shell .sd-chip-group{display:contents!important}
  body.at-phone-shell .sd-ai-row .sd-chip.is-sub{min-height:38px!important;font-size:13px!important}

  /* ---------- Ticket cards: one card, not a box inside a box ---------- */
  body.at-phone-shell .service-desk-table tbody tr[data-id]::before{background:transparent!important;padding:0 0 6px!important;font-size:15.5px!important;line-height:1.35!important}
  body.at-phone-shell .service-desk-table tbody tr[data-id]::after{font-size:14.5px!important;line-height:1.4!important;color:#4a5a6b!important}
  body.at-phone-shell #mobileResultSearch{min-width:0!important;text-overflow:ellipsis}

  /* ---------- Home ---------- */
  /* The phone-wide 16px rule made the small detail lines (times, "Checked 2d ago")
     bigger than the titles above them. */
  body.at-phone-shell #homeView small{font-size:13.5px!important;line-height:1.35!important}

  /* ---------- Scheduled Messages ---------- */
  /* The four counts were four full-width cards stacked down the screen; now one row. */
  body.at-phone-shell .scheduled-message-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}
  body.at-phone-shell .scheduled-message-stats > *{min-width:0!important;padding:8px 6px!important;text-align:center!important}
  body.at-phone-shell .scheduled-message-stats > * *{font-size:12px!important;line-height:1.2!important}
  body.at-phone-shell .scheduled-message-stats > * strong,
  body.at-phone-shell .scheduled-message-stats > * b{font-size:20px!important}
  body.at-phone-shell .scheduled-message-table tbody tr > td{min-height:0!important}
  body.at-phone-shell .scheduled-message-table tbody tr{row-gap:8px!important}
  body.at-phone-shell .scheduled-message-table .scheduled-message-reason{font-size:13.5px!important;line-height:1.35!important}

  /* ---------- Calls calendar (phones open on Day view, see calls.js) ---------- */
  body.at-phone-shell .cw-top{display:grid!important;grid-template-columns:auto 1fr!important;gap:8px!important;align-items:center!important}
  body.at-phone-shell .cw-top .cw-viewas{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;white-space:nowrap!important}
  body.at-phone-shell .cw-top .cw-viewas select{flex:1 1 auto!important;min-width:0!important}
  body.at-phone-shell .cw-top > button{margin:0!important;width:100%!important;justify-content:center!important}
  body.at-phone-shell .cw-bar{display:grid!important;grid-template-columns:auto 44px minmax(0,1fr) 44px!important;grid-template-areas:"today prev range next" "seg seg seg seg" "avail avail off off"!important;gap:8px!important;align-items:center!important}
  body.at-phone-shell .cw-bar #cwToday{grid-area:today!important;margin:0!important}
  body.at-phone-shell .cw-bar #cwPrev{grid-area:prev!important;margin:0!important}
  body.at-phone-shell .cw-bar .cw-range{grid-area:range!important;text-align:center!important;font-size:15px!important;white-space:normal!important;line-height:1.25!important}
  body.at-phone-shell .cw-bar #cwNext{grid-area:next!important;margin:0!important}
  body.at-phone-shell .cw-bar .cw-seg{grid-area:seg!important;display:grid!important;grid-template-columns:repeat(3,1fr)!important;margin:0!important}
  body.at-phone-shell .cw-bar .cw-avail{grid-area:avail!important;margin:0!important}
  body.at-phone-shell .cw-bar #cwTimeOff{grid-area:off!important;margin:0!important;justify-self:end!important}

  /* ---------- Shortcuts / Templates lists ---------- */
  /* The list was squeezed into a 240px box with its own scrollbar. */
  body.at-phone-shell .template-layout .template-list{max-height:min(62dvh,560px)!important;height:auto!important}

  /* ---------- Wide tables become cards (mobile-shell.js tags them .at-stack) ---------- */
  body.at-phone-shell table.at-stack{display:block!important;width:100%!important;min-width:0!important;border:0!important}
  body.at-phone-shell .table-wrap:has(> table.at-stack){overflow:visible!important}
  body.at-phone-shell table.at-stack thead{display:none!important}
  body.at-phone-shell table.at-stack tbody{display:block!important}
  body.at-phone-shell table.at-stack tbody tr{display:block!important;margin:0 0 10px!important;padding:10px 12px!important;border:1px solid #e3e9ef!important;border-radius:12px!important;background:#fff!important}
  body.at-phone-shell table.at-stack tbody td{display:block!important;position:relative!important;width:auto!important;min-width:0!important;max-width:none!important;min-height:22px!important;padding:6px 0 6px 38%!important;border:0!important;border-top:1px solid #f0f3f6!important;text-align:right!important;white-space:normal!important;overflow-wrap:anywhere!important;font-size:14px!important;line-height:1.35!important}
  body.at-phone-shell table.at-stack tbody td > *{max-width:100%!important;font-size:inherit!important}
  body.at-phone-shell table.at-stack tbody td:first-child{border-top:0!important;font-weight:650!important}
  body.at-phone-shell table.at-stack tbody td[data-at-label]::before{content:attr(data-at-label);position:absolute;left:0;top:7px;width:36%;text-align:left;font-size:12.5px;font-weight:700;color:#6f7b87;text-transform:none;overflow-wrap:normal}
  body.at-phone-shell table.at-stack tbody td:not([data-at-label]){padding-left:0!important;text-align:left!important}
  body.at-phone-shell table.at-stack tbody td:empty{display:none!important}

  /* ---------- Nov 16 2026 phone pass: nothing scrolls sideways ---------- */
  /* System Health: Bubble table rows become cards */
  body.at-phone-shell .system-health-bubble-table{overflow:visible!important}
  body.at-phone-shell .system-health-bubble-head{display:none!important}
  body.at-phone-shell .system-health-bubble-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;min-width:0!important;gap:6px 10px!important;margin:0 0 8px!important;padding:10px 12px!important;border:1px solid #e3e9ef!important;border-radius:12px!important;background:#fff!important}
  body.at-phone-shell .system-health-bubble-row > *{min-width:0!important;overflow-wrap:anywhere!important}
  body.at-phone-shell .system-health-bubble-row > *:first-child,
  body.at-phone-shell .system-health-bubble-row > *:last-child{grid-column:1/-1!important}
  body.at-phone-shell .system-health-bubble-row > *:first-child{font-weight:600!important}
  /* Scheduled group message: recipient rows become cards */
  body.at-phone-shell .scheduled-bulk-recipients{overflow:visible!important;background:transparent!important;border:0!important;gap:8px!important}
  body.at-phone-shell .scheduled-bulk-recipient-row{min-width:0!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px 10px!important;border:1px solid #e3e9ef!important;border-radius:12px!important}
  body.at-phone-shell .scheduled-bulk-recipient-row > *{min-width:0!important;overflow-wrap:anywhere!important}
  body.at-phone-shell .scheduled-bulk-recipient-row > *:first-child{grid-column:1/-1!important;font-weight:600!important}
  body.at-phone-shell .scheduled-bulk-recipient-row.scheduled-bulk-recipient-head{display:flex!important;flex-wrap:wrap!important;gap:6px!important;border:0!important;background:transparent!important;padding:0 0 2px!important}
  body.at-phone-shell .scheduled-bulk-recipient-row.scheduled-bulk-recipient-head > *{grid-column:auto!important;font-weight:600!important}
  /* Campaign calendar: a list of days that have sends (plus today), full day names */
  body.at-phone-shell .atcal-grid-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  body.at-phone-shell .atcal-grid{min-width:0!important}
  body.at-phone-shell .atcal-dows{display:none!important}
  body.at-phone-shell .atcal-days{grid-template-columns:1fr!important;gap:8px!important}
  body.at-phone-shell .atcal-day{min-height:0!important;border:1px solid #e3e9ef!important;border-radius:12px!important;background:#fff!important;padding:10px 12px!important}
  body.at-phone-shell .atcal-day.is-outside,
  body.at-phone-shell .atcal-day:not(.is-today):not(:has(.atcal-chip)){display:none!important}
  body.at-phone-shell .atcal-day-head{display:flex!important;align-items:center!important;gap:8px!important;margin-bottom:8px!important}
  body.at-phone-shell .atcal-day-head .atcal-num{font-size:0!important;padding:0!important;border:0!important;background:none!important;width:auto!important;height:auto!important}
  body.at-phone-shell .atcal-day-head::before{content:attr(data-atcal-long);font:600 15px/1.2 Inter,system-ui,sans-serif;color:#0A1F56}
  body.at-phone-shell .atcal-chip{margin-top:6px!important}
  /* Calls month view fits the screen */
  body.at-phone-shell .cm-grid{grid-template-columns:repeat(7,minmax(0,1fr))!important;min-width:0!important}
  body.at-phone-shell .cm-grid .cm-cell{min-width:0!important;padding:3px!important;overflow:hidden!important}
  body.at-phone-shell .cm-grid .cm-call{display:block!important;width:100%!important;font-size:10.5px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:clip!important;padding:2px 3px!important}
  body.at-phone-shell .cm-grid .cm-open,
  body.at-phone-shell .cm-grid .cm-hol{display:none!important}
  /* Campaign Manager: date pair stacks; email editor padding fits a phone */
  body.at-phone-shell .campaign-primary-date-grid{grid-template-columns:1fr!important}
  body.at-phone-shell .campaign-email-sheet-body{padding:18px 14px!important}

  /* ---------- Nov 16 2026 page-by-page phone check ---------- */
  /* Calls: the Calendar/Booked calls switch and the Day/Week/Month switch were stacked on top of each other */
  body.at-phone-shell .cw-bar{grid-template-areas:"today prev range next" "lay lay lay lay" "seg seg seg seg" "avail avail off off"!important}
  body.at-phone-shell .cw-bar .cw-seg.cw-layout{grid-area:lay!important;grid-template-columns:repeat(2,1fr)!important}
  body.at-phone-shell .cw-top{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)!important}
  body.at-phone-shell .cw-top .cw-viewas select{font-size:15px!important;padding-right:24px!important}
  /* Send history: the list was a 900px table; now full-width cards */
  body.at-phone-shell #bulk-historyView .table-wrap{overflow:visible!important}
  body.at-phone-shell #bulk-historyView .bulk-history-table{min-width:0!important;width:100%!important}
  body.at-phone-shell #bulk-historyView .bulk-history-table tr,
  body.at-phone-shell #bulk-historyView .bulk-history-table td{max-width:100%!important;min-width:0!important;overflow-wrap:anywhere!important;white-space:normal!important}
  /* Shortcuts / Templates: one page scroll, no box scrolling inside the page */
  body.at-phone-shell .template-layout .template-list{max-height:none!important;overflow:visible!important}
  /* CRM Players: the search box was hidden by an old rule meant for a title row */
  body.at-phone-shell #ops-playersView .crm-player-toolbar > .crm-player-toolbar-controls{display:flex!important;flex-wrap:wrap!important;gap:8px!important}
  body.at-phone-shell #ops-playersView .crm-player-search{flex:1 1 100%!important;min-width:0!important}
  /* CRM period cards (still five over five): names wrap instead of "Issued This ..." */
  body.at-phone-shell .relationship-activity-period-grid button span{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.15!important}
  /* The phone header now carries the back arrow and title, so the CRM's second back row goes */
  body.at-phone-shell .mobile-workflow-backbar{display:none!important}
  /* Campaign History: test sends stack instead of running off the right edge */
  body.at-phone-shell .uch-test-groups{grid-template-columns:1fr!important}
  body.at-phone-shell .uch-test-row{grid-template-columns:minmax(0,1fr) auto!important}
  body.at-phone-shell .uch-test-row time{grid-column:1/-1!important}
  /* Casino Center: the "Viewing as" casino picker, moved into the page on phones */
  body.at-phone-shell #event-centerView > .ec-top-controls{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important;margin:0 0 10px!important}
  body.at-phone-shell #event-centerView > .ec-top-controls select{flex:1 1 200px!important;min-width:0!important;font-size:15px!important}
  body.at-phone-shell #event-centerView .ec-host-frame{min-height:0!important}

  /* ---------- Ticket screen ---------- */
  /* Player name used only half the header and was cut off. */
  body.at-phone-shell .compact-record-header .compact-record-identity{right:16px!important;width:auto!important;min-width:0!important;max-width:none!important}
  body.at-phone-shell .compact-record-header #drawerName{max-width:100%!important}
  /* Player tab: the sideways chip strip repeated the sections listed right under it. */
  body.at-phone-shell .at-ticket-jump{display:none!important}
  /* Message count / channels on one line, Lacey · Hand to Allie on the next. */
  body.at-phone-shell .conversation-heading .conversation-summary-line{display:flex!important;flex-wrap:wrap!important;align-items:center!important;row-gap:6px!important;column-gap:8px!important;overflow:visible!important;white-space:normal!important}
  body.at-phone-shell .conversation-heading .conversation-summary-line > span{flex:0 1 auto!important;min-width:0!important;max-width:none!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important}
  body.at-phone-shell .conversation-heading .conversation-heading-actions{flex:1 1 100%!important;display:flex!important;justify-content:flex-start!important;margin:0!important}
}