/* AT Central phone shell + phone layout pass — Oct 2026.
   Loaded last. Everything here is scoped to phones (≤700px) and to
   body.at-phone-shell, which mobile-shell.js sets only on phones. */

/* ---------- Ticket screen: no browser pull-to-reload (Nov 4 2026) ----------
   Set by mobile-shell.js only while a ticket or the Reply composer is open on a phone. */
@media (max-width:700px){
  html.at-ticket-no-pull,html.at-ticket-no-pull body{overscroll-behavior-y:none!important}
}

/* ---------- Shell: bottom tab bar ---------- */
.at-mobile-tabbar{display:none}
@media (max-width:700px){
  body.at-phone-shell .at-mobile-tabbar{
    position:fixed;left:0;right:0;bottom:0;z-index:900;
    display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);
    padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));
    background:rgba(255,255,255,.97);
    border-top:1px solid var(--ui-line,#dfe4e9);
    box-shadow:0 -4px 18px rgba(20,34,49,.06);
    -webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px);
  }
  body.at-phone-shell .at-mobile-tabbar button{
    position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    min-height:50px;padding:4px 2px;border:0;border-radius:12px;background:transparent;
    color:#6f7b87;font:600 11px/1.1 Inter,system-ui,sans-serif;letter-spacing:0;
    -webkit-tap-highlight-color:transparent;
  }
  body.at-phone-shell .at-mobile-tabbar button[hidden]{display:none}
  /* Six tabs (Phone added Nov 1 2026). The phone-wide "every button is 16px" rule was
     overriding the tab labels, so they wrapped and ran into each other. Labels stay on one
     line at tab-bar size; the bar has one row whatever the count. */
  body.at-phone-shell .at-mobile-tabbar{gap:2px;padding-left:4px;padding-right:4px}
  body.at-phone-shell .at-mobile-tabbar button{min-width:0;font-size:11px!important;line-height:1.1!important;font-weight:600!important}
  body.at-phone-shell .at-mobile-tabbar button span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px!important;line-height:1.15!important;letter-spacing:-.01em}
  body.at-phone-shell .at-mobile-tabbar button svg{flex:0 0 auto}
  body.at-phone-shell .at-mobile-tabbar button b{font-size:10.5px!important;line-height:18px!important}
  @media (max-width:370px){body.at-phone-shell .at-mobile-tabbar button span{font-size:10.5px!important;letter-spacing:-.02em}}
  /* Pull-to-refresh indicator. */
  .at-ptr{position:fixed;top:calc(env(safe-area-inset-top,0px) + 6px);left:50%;z-index:2000;width:40px;height:40px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;background:#fff;color:#8a96a3;box-shadow:0 4px 14px rgba(20,34,49,.18);
    opacity:0;transform:translate(-50%,-44px);transition:transform .2s ease,opacity .2s ease;pointer-events:none}
  .at-ptr.is-ready{color:#1872D2}
  .at-ptr.is-loading svg{animation:at-ptr-spin .7s linear infinite}
  @keyframes at-ptr-spin{to{transform:rotate(360deg)}}
  body.at-phone-shell .at-mobile-tabbar button.is-active{color:#1872D2;background:#eef4fb}
  body.at-phone-shell .at-mobile-tabbar button b{
    position:absolute;top:3px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;
    border-radius:9px;background:#c94d4d;color:#fff;font:700 10.5px/18px Inter,system-ui,sans-serif;text-align:center;
  }
  body.at-phone-shell .at-mobile-tabbar button b[hidden]{display:none}
  /* Keep content clear of the tab bar. */
  body.at-phone-shell:not(.full-case-mode) .main-content{padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))!important}
  /* The tab bar steps aside whenever a ticket, composer or sheet owns the screen. */
  body.at-phone-shell.full-case-mode .at-mobile-tabbar,
  body.at-phone-shell.mobile-compose-open .at-mobile-tabbar,
  body.at-phone-shell.mobile-conversation-open .at-mobile-tabbar{display:none}
  /* Old two-button "Service Desk | CRM" switcher is replaced by the tab bar. */
  body.at-phone-shell #mobileEnterpriseTabs{display:none!important}
  /* Safe area at the top when launched from the home screen. */
  @media (display-mode:standalone){
    body.at-phone-shell .topbar{padding-top:env(safe-area-inset-top,0px)!important}
  }
}

/* ---------- Shell: "More" sheet ---------- */
.at-more-sheet{position:fixed;inset:0;z-index:1000;background:rgba(20,34,49,0);transition:background .18s ease}
.at-more-sheet[hidden]{display:none}
.at-more-sheet.is-open{background:rgba(20,34,49,.38)}
.at-more-panel{
  position:absolute;left:0;right:0;bottom:0;max-height:86dvh;display:flex;flex-direction:column;
  background:#fff;border-radius:18px 18px 0 0;box-shadow:0 -10px 30px rgba(20,34,49,.18);
  transform:translateY(100%);transition:transform .2s ease;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.at-more-sheet.is-open .at-more-panel{transform:none}
.at-more-grip{width:40px;height:5px;margin:8px auto 2px;border-radius:3px;background:#d6dde4}
.at-more-head{display:flex;align-items:center;justify-content:space-between;padding:6px 16px 10px}
.at-more-head strong{font:700 17px/1.2 Inter,system-ui,sans-serif;color:#202833}
.at-more-close{width:36px;height:36px;border:1px solid #dfe4e9;border-radius:50%;background:#fff;color:#344250;font-size:22px;line-height:1}
.at-more-body{overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:0 12px 16px}
.at-more-group{margin:6px 0 14px}
.at-more-group h3{margin:0 4px 6px;font:600 12px/1.2 Inter,system-ui,sans-serif;color:#6f7b87;letter-spacing:0}
.at-more-list{border:1px solid #e4e9ee;border-radius:14px;overflow:hidden;background:#fff}
.at-more-item{
  display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:10px 14px;border:0;
  border-bottom:1px solid #eef1f4;background:#fff;text-align:left;color:#202833;
  font:500 15px/1.25 Inter,system-ui,sans-serif;-webkit-tap-highlight-color:transparent;
}
.at-more-item:last-child{border-bottom:0}
.at-more-item:active{background:#f4f8fb}
.at-more-item.is-current{background:#eef4fb}
.at-more-item.is-action .at-more-label{color:#1872D2;font-weight:600}
.at-more-icon{flex:0 0 28px;height:28px;display:grid;place-items:center;border-radius:8px;background:#f1f4f7;color:#2f6f9f;font-size:14px}
.at-more-label{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.at-more-label small{font:500 11.5px/1.2 Inter,system-ui,sans-serif;color:#8a949e;margin-top:2px}
.at-more-item b{min-width:22px;padding:2px 7px;border-radius:999px;background:#eef1f4;color:#4c5966;font:600 12px/1.4 Inter,system-ui,sans-serif;text-align:center}
.at-more-item i{font-style:normal;color:#a3adb7;font-size:20px;line-height:1}
.at-more-empty{padding:18px 6px;color:#6f7b87;font-size:14px}
/* All sections as tiles (Nov 16 2026). Brand colors only: navy #0A1F56, logo blue #1872D2, teal #28AAAF. */
.at-more-head .at-more-back{width:36px;height:36px;margin-right:8px;border:1px solid #dfe4e9;border-radius:50%;background:#fff;color:#0A1F56;font-size:24px;line-height:1;flex:0 0 auto}
.at-more-head .at-more-back + strong{flex:1 1 auto;min-width:0}
.at-tile-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 14px}
/* Every tile: same font, same weight, same line height; names wrap to at most two
   evenly balanced lines, sitting on the same bottom line in every tile. */
.at-tile{position:relative;display:flex;align-items:flex-end;height:118px;padding:12px 13px;border:0;border-radius:18px;overflow:hidden;color:#fff;text-align:left;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;
  background:linear-gradient(160deg,var(--c1),var(--c2))}
.at-tile:active{transform:scale(.97)}
.at-tile strong{position:relative;display:block;max-width:100%;font:700 min(16px,4.1vw)/1.15 Inter,system-ui,sans-serif;letter-spacing:-.01em;color:#fff;text-wrap:balance;overflow-wrap:normal;word-break:normal;hyphens:none}
.at-tile-sub{height:96px}
.at-tile-sub strong{font-size:min(15px,3.9vw)}
.at-tile-art{position:absolute;right:-6px;top:-4px;width:80px;height:80px;opacity:.32;pointer-events:none}
.at-tile-sub .at-tile-art{width:62px;height:62px}
.at-tile b{position:absolute;top:10px;left:12px;min-width:22px;padding:2px 8px;border-radius:999px;background:#fff;color:#0A1F56;font:700 12px/1.4 Inter,system-ui,sans-serif;text-align:center}
.at-tile.is-current{box-shadow:0 0 0 3px #fff inset,0 0 0 2px #28AAAF}
.at-tile-note{margin:0 4px 10px;color:#56677a;font-size:13px;line-height:1.4}
/* Section color patterns (Nov 16 2026). Only navy #0A1F56, logo blue #1872D2 and teal #28AAAF,
   each section its own pairing. The section's tiles step through three tones of that pairing,
   and the page bar uses the section's base pairing. */
.t-service-desk{--c1:#1872D2;--c2:#0A1F56}
.t-crm{--c1:#28AAAF;--c2:#1872D2}
.t-campaign-manager{--c1:#1872D2;--c2:#28AAAF}
.t-graphics-center{--c1:#28AAAF;--c2:#0A1F56}
.t-event-center{--c1:#0A1F56;--c2:#28AAAF}
.t-administration{--c1:#0A1F56;--c2:#1872D2}
/* Checkerboard: in two columns, every other tile is one tone lighter */
.at-tile-grid .at-tile-sub:nth-child(4n+2),
.at-tile-grid .at-tile-sub:nth-child(4n+3){background:linear-gradient(rgba(255,255,255,.13),rgba(255,255,255,.13)),linear-gradient(160deg,var(--c1),var(--c2))}
body.at-more-open{overflow:hidden}

/* ---------- Refresh button in the phone header (Nov 16 2026), left of the account circle ---------- */
.at-header-refresh{display:none}
@media (max-width:700px){
  body.at-phone-shell .topbar{padding-right:118px!important}
  body.at-phone-shell .at-header-refresh:not([hidden]){display:grid;place-items:center;position:absolute;top:50%;right:68px;transform:translateY(-50%);width:44px;height:44px;border:1px solid #d7e0e8;border-radius:50%;background:#fff;color:#0A1F56;cursor:pointer;-webkit-tap-highlight-color:transparent}
  body.at-phone-shell .at-header-refresh:active{background:#eef4fb}
}
/* ---------- Phone header on section pages (Nov 16 2026): ‹ opens the section's tiles,
   section name above the page title, both in the section's colors ---------- */
.at-section-page.at-section-service-desk{--c1:#1872D2;--c2:#0A1F56}
.at-section-page.at-section-crm{--c1:#28AAAF;--c2:#1872D2}
.at-section-page.at-section-campaign-manager{--c1:#1872D2;--c2:#28AAAF}
.at-section-page.at-section-graphics-center{--c1:#28AAAF;--c2:#0A1F56}
.at-section-page.at-section-event-center{--c1:#0A1F56;--c2:#28AAAF}
.at-section-page.at-section-administration{--c1:#0A1F56;--c2:#1872D2}
@media (max-width:700px){
  body.at-phone-shell.at-section-page .topbar{grid-template-columns:48px minmax(0,1fr)!important;align-items:center!important;column-gap:10px!important;padding-right:118px!important}
  body.at-phone-shell.at-section-page .topbar .topbar-heading{grid-column:2!important;grid-row:1!important;min-width:0!important}
  body.at-phone-shell.at-section-page #mobileNavToggle{grid-column:1!important;grid-row:1!important}
  body.at-phone-shell.at-section-page #mobileNavToggle{display:grid!important;place-items:center!important;width:48px!important;height:48px!important;border-radius:50%!important}
  body.at-phone-shell.at-section-page #mobileNavToggle{background:linear-gradient(160deg,var(--c1),var(--c2))!important;color:#fff!important;border-color:transparent!important}
  body.at-phone-shell.at-section-page #viewTitle{display:flex!important;flex-direction:column!important;line-height:1.15!important}
  body.at-phone-shell.at-section-page #viewTitle::before{content:attr(data-at-section);font:600 12px/1.2 Inter,system-ui,sans-serif;letter-spacing:0;color:var(--c1);margin-bottom:1px}
  body.at-phone-shell.at-section-page.at-section-event-center #viewTitle::before,
  body.at-phone-shell.at-section-page.at-section-administration #viewTitle::before{color:#1872D2}
}
/* ---------- (old) Section bar ---------- */
.at-section-switch{display:none}
@media (max-width:700px){
  body.at-phone-shell .at-section-switch:not([hidden]){
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    margin:0 0 12px;padding:9px 10px 9px 14px;border-radius:14px;cursor:pointer;
    background:linear-gradient(160deg,var(--c1,#1872D2),var(--c2,#0A1F56));color:#fff;-webkit-tap-highlight-color:transparent;
  }
  body.at-phone-shell .at-section-switch:active{transform:scale(.99)}
  body.at-phone-shell .at-section-back{flex:0 0 auto;display:grid;place-items:center;width:32px;height:32px;margin-left:-6px;border-radius:50%;background:rgba(255,255,255,.18);font:400 26px/1 Inter,system-ui,sans-serif}
  body.at-phone-shell .at-section-where{flex:1 1 auto;display:flex;flex-direction:column;min-width:0}
  body.at-phone-shell .at-section-where small{font:600 11.5px/1.2 Inter,system-ui,sans-serif;opacity:.8}
  body.at-phone-shell .at-section-where strong{font:700 17px/1.2 Inter,system-ui,sans-serif;color:#fff}
  /* Settings' own side menu is replaced by the section bar + Administration tiles on phones */
  body.at-phone-shell #settingsView .settings-nav{display:none!important}
  body.at-phone-shell #settingsView .settings-shell{display:block}
  body.at-phone-shell .at-section-more{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;padding:8px 11px;border-radius:999px;background:rgba(255,255,255,.18);font:600 13px/1 Inter,system-ui,sans-serif}
}

/* ---------- Service Desk on phones ---------- */
@media (max-width:700px){
  /* Ticket cards: show the last message under the name / stage / time. */
  body.at-phone-shell .service-desk-table tbody tr[data-id][data-mobile-preview]:not([data-mobile-preview=""])::after{
    content:attr(data-mobile-preview)!important;display:block!important;margin-top:6px!important;
    max-height:2.9em!important;overflow:hidden!important;color:#5b6875!important;
    font-size:13.5px!important;font-weight:500!important;line-height:1.45!important;white-space:normal!important;
  }

  /* Ticket: bring back a compact status row (message count, channel and the
     AI/human handler switch, which was otherwise unreachable on a phone). */
  body.at-phone-shell .record-work .record-conversation .conversation-heading{
    display:block!important;flex:0 0 auto!important;margin:0!important;padding:6px 12px!important;
    border:0!important;border-bottom:1px solid #e2e8ed!important;background:#fff!important;min-height:0!important;
  }
  body.at-phone-shell .conversation-heading .conversation-summary-line{
    display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;min-width:0!important;
    font-size:12.5px!important;color:#6f7b87!important;
  }
  body.at-phone-shell .conversation-heading .conversation-heading-title,
  body.at-phone-shell .conversation-heading .conversation-heading-context,
  body.at-phone-shell .conversation-heading #conversationBreakdown,
  body.at-phone-shell .conversation-heading #ticketListHeaderExpand,
  body.at-phone-shell .conversation-heading #exitTicketBtn{display:none!important}
  body.at-phone-shell .conversation-heading #conversationCount,
  body.at-phone-shell .conversation-heading #threadChannel{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;font-weight:500!important}
  body.at-phone-shell .conversation-heading .conversation-heading-actions{display:flex!important;margin-left:auto!important;flex:0 0 auto!important;align-items:center!important}
  body.at-phone-shell .conversation-heading #ticketAiHandlerControl{display:flex!important;font-size:12.5px!important}
  body.at-phone-shell .conversation-heading #ticketAiHandlerControl button{min-height:32px!important}

  /* Ticket Detail panel: one consistent full-width sheet under the 64px header,
     with a sticky "jump to" chip row so every section is one tap away. */
  body.at-phone-shell .record-context{top:64px!important;width:100vw!important;max-width:100vw!important;bottom:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important}
  body.at-phone-shell .mobile-record-details-backdrop:not([hidden]){inset:64px 0 0!important}
  body.at-phone-shell .at-ticket-jump{
    position:sticky;top:0;z-index:5;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;
    margin:0 0 8px;padding:8px 10px;background:rgba(255,255,255,.97);border-bottom:1px solid #e9edf1;
  }
  body.at-phone-shell .at-ticket-jump::-webkit-scrollbar{display:none}
  body.at-phone-shell .at-ticket-jump button{
    flex:0 0 auto;min-height:34px;padding:0 12px;border:1px solid #dfe4e9;border-radius:999px;background:#fff;
    color:#344250;font:600 12.5px/1 Inter,system-ui,sans-serif;white-space:nowrap;
  }
  body.at-phone-shell .at-ticket-jump button:active{background:#eef4fb;border-color:#8ab4d5}
  body.at-phone-shell .record-context details > summary{min-height:44px!important;display:flex!important;align-items:center!important}

  /* The "N scheduled" note and SMS warning matter when replying — keep them visible. */
  body.at-phone-shell .inline-footer-row .inline-reply-warning.is-info{display:inline-flex!important}
  body.at-phone-shell.mobile-compose-open .inline-sms-warning{display:block!important}
}

/* ---------- Every other section on phones ---------- */
@media (max-width:700px){
  /* No sideways page scroll anywhere; wide tables scroll inside their own box. */
  body.at-phone-shell .main-content{overflow-x:clip!important;max-width:100vw!important}
  body.at-phone-shell .view{min-width:0!important;max-width:100%!important}
  body.at-phone-shell .table-wrap,
  body.at-phone-shell .campaign-table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;max-width:100%!important}

  /* iOS zooms the page when a field under 16px gets focus. */
  body.at-phone-shell input[type="text"],body.at-phone-shell input[type="search"],body.at-phone-shell input[type="email"],
  body.at-phone-shell input[type="tel"],body.at-phone-shell input[type="number"],body.at-phone-shell input[type="url"],
  body.at-phone-shell input[type="date"],body.at-phone-shell input[type="time"],body.at-phone-shell input[type="datetime-local"],
  body.at-phone-shell input:not([type]),body.at-phone-shell select,body.at-phone-shell textarea,
  body.at-phone-shell [contenteditable="true"]{font-size:16px!important}

  /* Comfortable tap targets for page-level buttons. */
  body.at-phone-shell .view .primary-button,
  body.at-phone-shell .view .secondary-button{min-height:42px}

  /* Modals become bottom-anchored, scrollable sheets that fit the screen. */
  body.at-phone-shell .modal,
  body.at-phone-shell .campaign-modal,
  body.at-phone-shell .teach-modal{max-width:100vw!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto!important}

  /* Settings: section buttons become one swipeable row instead of a tall stack. */
  body.at-phone-shell .settings-nav{display:flex!important;flex-direction:row!important;gap:6px!important;overflow-x:auto!important;scrollbar-width:none!important;padding-bottom:4px!important;grid-template-columns:none!important}
  body.at-phone-shell .settings-nav::-webkit-scrollbar{display:none}
  body.at-phone-shell .settings-nav > *{flex:0 0 auto!important;width:auto!important;white-space:nowrap!important;min-height:38px!important}
  body.at-phone-shell .service-desk-ai-review-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.at-phone-shell .service-desk-ai-review-changes p{grid-template-columns:1fr!important}
  body.at-phone-shell .teach-conflicts{grid-template-columns:1fr!important}

  /* Campaign Manager toolbars and grids that had no phone layout. */
  body.at-phone-shell .campaign-recipient-inspector-toolbar,
  body.at-phone-shell .campaign-history-main-toolbar,
  body.at-phone-shell .campaign-scheduled-row,
  body.at-phone-shell .campaign-more-date-grid,
  body.at-phone-shell .campaign-pilot-row{grid-template-columns:1fr!important}
  body.at-phone-shell .campaign-image-lib-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important}
  body.at-phone-shell .campaign-delay-parts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.at-phone-shell .campaign-draft-loading > div{min-width:0!important;width:calc(100vw - 32px)!important}
  body.at-phone-shell .campaign-expiration-panel.is-standby{opacity:1!important}

  /* Graphics Center. */
  body.at-phone-shell #graphicsView table,
  body.at-phone-shell .gc-table{display:block!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  body.at-phone-shell .gc-tiles,
  body.at-phone-shell .gc-editgrid,
  body.at-phone-shell .gc-cols,
  body.at-phone-shell .gc-grid2{grid-template-columns:1fr!important}
  body.at-phone-shell .gc-kv{grid-template-columns:1fr auto!important}
  body.at-phone-shell .gc-field{min-width:0!important}
  body.at-phone-shell .gc-linkform input{min-width:0!important;flex:1 1 100%!important}
  body.at-phone-shell #graphicsView [style*="nowrap"]{flex-wrap:wrap!important}
  body.at-phone-shell .gc-x{opacity:1!important}

  /* Drafts member table and Tag Management: tighter minimums so less sideways scrolling. */
  body.at-phone-shell .send-draft-member-table{min-width:760px!important}
  body.at-phone-shell .tag-management-table{min-width:560px!important}

  /* Templates: shorter email preview so the editor is reachable. */
  body.at-phone-shell #templatesView iframe{max-height:60dvh!important}
}

/* ---------- Teach the AI on phones ---------- */
@media (max-width:700px){
  /* "Fix this answer" under an AI reply: a real tap target. */
  body.at-phone-shell .ai-teach-flag{display:inline-flex!important;align-items:center;min-height:34px;padding:6px 0!important;font-size:13.5px!important}
  body.at-phone-shell .message.outbound .ai-teach-flag{display:flex!important}
  /* The fix pop-up becomes a full-screen sheet above the ticket. */
  body.at-phone-shell .teach-modal-backdrop{z-index:10200!important;padding:0!important;align-items:stretch!important;background:#fff!important;overflow:hidden!important}
  body.at-phone-shell .teach-modal{width:100%!important;height:100dvh!important;max-height:none!important;border-radius:0!important;box-shadow:none!important;display:flex!important;flex-direction:column!important}
  body.at-phone-shell .teach-modal-head{flex:0 0 auto;padding:calc(10px + env(safe-area-inset-top,0px)) 14px 10px!important}
  body.at-phone-shell .teach-close{width:44px;height:44px;font-size:28px!important}
  body.at-phone-shell .teach-modal-body{flex:1 1 auto;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px 14px calc(18px + env(safe-area-inset-bottom,0px))!important}
  /* Big, thumb-friendly controls. */
  body.at-phone-shell .teach-field textarea{min-height:96px!important;font-size:16px!important}
  body.at-phone-shell .teach-mic{min-height:44px;padding:0 16px}
  body.at-phone-shell .teach-actions{position:sticky;bottom:0;background:#fff;padding-top:10px;margin-top:4px}
  body.at-phone-shell .teach-actions > button{flex:1 1 0;min-height:46px}
  body.at-phone-shell .teach-sender{width:100%;margin-right:0}
  body.at-phone-shell .teach-similar-list{max-height:none!important}
  body.at-phone-shell .teach-similar-row{min-height:48px}
  body.at-phone-shell .teach-similar-head a{margin-left:0}
  /* Teach the AI tab in Administration: lesson history stacks under the form. */
  body.at-phone-shell .teach-tab-grid .panel{padding:14px!important}
  body.at-phone-shell .teach-lesson details > summary{min-height:40px;display:flex;align-items:center}
}

/* ---------- Campaign creation stays on a computer; Templates opens on phones (Nov 16 2026) ---------- */
@media (max-width:700px){
  body.at-phone-shell #mainNav .nav-item[data-view="campaigns"][data-campaign-section="build"],
  body.at-phone-shell #mainNav .nav-item[data-view="campaigns"][data-campaign-section="drafts"],
  body.at-phone-shell #mainNav .nav-item[data-view="campaigns"][data-campaign-section="segments"],
  body.at-phone-shell #campaignsView [data-cm-start-campaign]{display:none!important}
  body.at-phone-shell .at-phone-note{margin:0 0 10px;padding:9px 12px;border:1px solid #dbe6f2;border-radius:10px;background:#f3f8fd;color:#36546f;font-size:13px;font-weight:500;line-height:1.4}
  body.at-phone-shell .at-phone-note[hidden]{display:none!important}
}