/* Service Desk refresh (Oct 11 2026) — approved mock-ups, "apply all".
   Loaded last. Font sizes of the ticket view are NOT changed here; only
   layout/wrapping, plus the new filter card and phone ticket tabs. */

/* ======================= Ticket list: filter card ======================= */
#workView #metricGrid{display:none!important}
#workView .service-desk-summary-band{display:block!important;width:100%!important;max-width:none!important;margin:0 0 14px!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
body.service-desk-desk-view #workView>.service-desk-summary-band{display:none!important}
#workView #assessmentQuickFilters{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;gap:0!important;background:none!important;border:0!important;box-shadow:none!important}

.sd-filter-card{background:#fff;border:1px solid #e2e7eb;border-radius:10px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;overflow:hidden}
.sd-filter-card button{font-family:inherit}

.sd-tabs-row{display:flex;align-items:stretch;justify-content:space-between;flex-wrap:wrap;gap:0 12px;padding:0 8px;border-bottom:1px solid #edf1f4}
.sd-tabs{display:flex;align-items:stretch;min-width:0;overflow-x:auto;scrollbar-width:none}
.sd-tabs::-webkit-scrollbar{display:none}
.sd-tab{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;height:44px;margin:0;padding:0 13px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;font-size:13px;font-weight:600;color:#5b6876;cursor:pointer;white-space:nowrap}
.sd-tab b{font-weight:700;color:#24384c}
.sd-tab:hover{color:#1f5f93;background:#f8fbfd}
.sd-tab.is-active{border-bottom-color:#1872d2;color:#1f5f93}
.sd-tab.is-active b{color:#1872d2}
.sd-tab:focus-visible,.sd-op:focus-visible,.sd-chip:focus-visible,.sd-ai-toggle:focus-visible{outline:2px solid #1872d2;outline-offset:-2px}
.sd-tab-divider{flex:0 0 1px;margin:12px 6px;background:#e2e7eb}

.sd-ops{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px 0}
.sd-op{display:inline-flex;align-items:center;gap:6px;height:30px;margin:0;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;font-size:12px;font-weight:600;color:#56636f;cursor:pointer;white-space:nowrap}
.sd-op b{font-weight:700;color:#1f2d3d}
.sd-op:hover{background:#f4f7fa}
.sd-op.is-active{background:#eaf2fc;border-color:#9cc2ea;color:#174f85}
.sd-op:disabled{opacity:.55;cursor:default}
.sd-op.is-warn{color:#8a5a00}
.sd-op-alert{color:#b3261e;font-weight:600}
/* "· 3 overdue" / "· 3 need action": their own click target, filtering to just those. */
.sd-op-cluster{display:inline-flex;align-items:center;gap:0;flex:0 0 auto}
.sd-sub-link{display:inline-flex;align-items:center;height:28px;margin:0 0 0 -4px;padding:0 8px;border:1px solid transparent;border-radius:999px;background:transparent;font-family:inherit;font-size:12px;font-weight:600;color:#b3261e;cursor:pointer;white-space:nowrap;text-decoration:underline;text-decoration-color:rgba(179,38,30,.35);text-underline-offset:3px}
.sd-sub-link:hover{background:#fdeeee;text-decoration-color:#b3261e}
.sd-sub-link.is-active{background:#fdeeee;border-color:#f3cfcc;text-decoration:none}
.sd-sub-link:focus-visible{outline:2px solid #b3261e;outline-offset:-2px}
.sd-ai-row .sd-sub-link{margin-left:-6px}
.sd-dot{display:inline-block;flex:0 0 7px;width:7px;height:7px;border-radius:50%;background:#9aa6b2}
.sd-op.is-online .sd-dot{background:#2f9e5b}
/* Who's online: stands out as a green button (Oct 20 2026). */
.sd-op.is-online{border-color:#bfe3cc;background:#eaf7ef;color:#1d6b3c}
.sd-op.is-online:hover{background:#dcf1e4;border-color:#9fd4b3}
.sd-op.is-online .sd-dot{width:8px;height:8px;flex-basis:8px;box-shadow:0 0 0 3px rgba(47,158,91,.2)}

.sd-ai-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:10px 14px}
.sd-ai-label{display:inline-flex;align-items:center;gap:6px;margin-right:4px;font-size:11.5px;font-weight:600;color:#4b5d70;white-space:nowrap}
.sd-ai-label>svg{color:#1872d2;flex:0 0 auto}
.sd-ai-toggle{display:inline-grid;place-items:center;width:24px;height:24px;margin:0 0 0 2px;padding:0;border:1px solid #dbe3ea;border-radius:6px;background:#fff;color:#56636f;font-size:14px;line-height:1;cursor:pointer}
.sd-ai-toggle span{display:inline-block;transition:transform .15s ease}
.sd-ai-toggle.is-collapsed span{transform:rotate(180deg)}
.service-desk-summary-band.is-ai-collapsed .sd-ai-row>:not(.sd-ai-label){display:none!important}
.service-desk-summary-band.is-ai-collapsed .sd-ai-row{padding-top:7px;padding-bottom:7px}

.sd-chip{display:inline-flex;align-items:center;gap:6px;height:30px;margin:0;padding:0 11px;border:1px solid #dbe3ea;border-radius:999px;background:#fff;font-size:12px;font-weight:600;color:#3d4f61;cursor:pointer;white-space:nowrap}
.sd-chip b{font-weight:700;color:#1f2d3d}
.sd-chip:hover{border-color:#b9cde0}
.sd-chip.is-active{background:#eaf2fc;border-color:#9cc2ea;color:#174f85}
.sd-chip.is-active b{color:#174f85}
.sd-chip.is-sub{height:26px;padding:0 9px;font-size:11.5px}
.sd-chip.tone-high .sd-dot{background:#2f9e5b}
.sd-chip.tone-medium .sd-dot{background:#d08a00}
.sd-chip.tone-low .sd-dot{background:#9aa6b2}
.sd-chip-note{font-weight:600;color:#a32a22}
.sd-chip-group{display:inline-flex;align-items:center;gap:4px}
.sd-chip-cluster{display:inline-flex;align-items:center;gap:5px;flex-wrap:nowrap}
.sd-chip-divider{flex:0 0 1px;width:1px;height:22px;margin:0 3px;background:#e2e7eb}
.sd-ai-group{flex:0 0 auto;font-size:12px;font-weight:600;color:#4b5d70;white-space:nowrap;margin-right:2px}
/* Nov 3 2026: tag filter groups (Campaign tags, newest first / Manual tags). */
.tag-filter-group-label{padding:8px 3px 4px;color:#637388;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.tag-filter-group-label:first-child{padding-top:2px}
/* Nov 3 2026: Whose move gets its own titled second line. */
.sd-ai-break{flex:0 0 100%;height:0;margin:2px 0;border-top:1px solid #edf1f4}
.sd-ai-subtitle{display:inline-flex;align-items:center;min-width:88px;margin-right:4px;font-size:11.5px;font-weight:600;color:#4b5d70;white-space:nowrap}
@media (max-width:700px){.sd-ai-break{display:none}.sd-ai-subtitle{flex:0 0 auto;font-size:12.5px}}

/* Oct 16 2026: two separate cards. Ticket facts (New / Replies / AI replied /
   Open / Closed + operations) on top; AI assessment in its own card below,
   with the gray page background showing between them. */
.sd-filter-card{background:transparent;border:0;border-radius:0;overflow:visible;display:flex;flex-direction:column;gap:10px}
.sd-tabs-row,.sd-ai-row{background:#fff;border:1px solid #e2e7eb;border-radius:10px}
.sd-tabs-row{border-bottom:1px solid #e2e7eb}
@media (max-width:700px){
  .sd-filter-card{border-radius:0;gap:8px}
  .sd-tabs-row,.sd-ai-row{border-radius:12px}
}

/* Phones: each row scrolls sideways instead of stacking into a tall block. */
@media (max-width:700px){
  #workView .service-desk-summary-band{margin:0 0 10px!important}
  .sd-filter-card{border-radius:12px}
  .sd-tabs-row{flex-direction:column;flex-wrap:nowrap;gap:0;padding:0}
  .sd-tabs{padding:0 6px}
  .sd-tab{height:46px;padding:0 12px;font-size:14px}
  .sd-tab-divider{margin:13px 4px}
  .sd-ops{margin-left:0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:4px;padding:6px 10px;border-top:1px solid #edf1f4}
  .sd-ops::-webkit-scrollbar,.sd-ai-row::-webkit-scrollbar{display:none}
  .sd-op{flex:0 0 auto;height:36px;font-size:13px;border-color:#e6ebef;background:#fafbfd}
  .sd-ai-row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:10px 12px}
  .sd-ai-label{flex:0 0 auto;font-size:12.5px}
  .sd-chip{flex:0 0 auto;height:36px;font-size:13px}
  .sd-chip.is-sub{height:32px;font-size:12.5px}
  .sd-chip-group,.sd-chip-divider,.sd-chip-cluster{flex:0 0 auto}
  .sd-sub-link{flex:0 0 auto;height:36px;font-size:13px}
  .sd-ai-toggle{width:30px;height:30px}
}

/* ============== Ticket list: expand chevron sits beside Select ============== */
.service-desk-table th.preview-toggle-header{padding-left:2px!important;padding-right:2px!important}
@media (min-width:851px){
  .service-desk-table td.service-desk-preview-toggle-cell{padding-left:2px!important;padding-right:2px!important;text-align:center!important}
}

/* ============== Tablet header: avatar stays on the title line ============== */
@media (min-width:701px) and (max-width:850px){
  body:not(.full-case-mode) .topbar{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:12px!important}
  body:not(.full-case-mode) .topbar .topbar-heading{flex:1 1 auto;min-width:0}
  body:not(.full-case-mode) .topbar .topbar-account{margin-left:auto!important}
}

/* ============================ Open ticket (desktop) ============================ */
/* The duplicate "Auto · Email to …" line: the To row already shows the address. */
.inline-delivery-status.is-redundant{display:none!important}

.history-fold-toggle{display:none}
@media (min-width:980px){
  /* Footer: two groups. When there isn't room, Save draft / Preview / Send drop
     to a second line on the right instead of running into Send as. */
  body.full-case-mode.desk-embedded .inline-footer-row{flex-wrap:wrap!important;row-gap:8px!important}
  body.full-case-mode.desk-embedded .inline-footer-row .inline-reply-actions{margin-left:auto!important}

  /* Fold the history column away for more reply room. */
  body.full-case-mode.desk-embedded .history-fold-toggle{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 10px;border:1px solid #d3dce5;border-radius:7px;background:#fff;font-family:inherit;font-size:12px;font-weight:600;color:#2e4256;cursor:pointer;white-space:nowrap}
  body.full-case-mode.desk-embedded .history-fold-toggle:hover{border-color:#b9cde0}
  body.full-case-mode.desk-embedded.history-folded .history-fold-toggle{background:#eaf2fc;border-color:#9cc2ea;color:#174f85}
  body.full-case-mode.desk-embedded.history-folded .history-conversation{grid-template-columns:0 minmax(0,1fr)!important}
  body.full-case-mode.desk-embedded.history-folded .history-conversation>#messageThread{display:none!important}

  /* Player card: Change / Remove only reserve room on the label line, so the
     first phone number keeps the full width and never breaks in two. */
  body.full-case-mode.desk-embedded .record-context [data-record-section="player"] .linked-player-identity-list>.info-item:first-child{padding-right:0!important}
  body.full-case-mode.desk-embedded .record-context [data-record-section="player"] .linked-player-identity-list>.info-item:first-child>label{display:block;padding-right:118px;box-sizing:border-box}
  body.full-case-mode.desk-embedded .record-context .linked-player-identity-list .copyable-value[data-copy-label="Phone number"]{white-space:nowrap}
}

/* ====================== Phone ticket: Conversation / Reply / Player ====================== */
.at-ticket-tabs{display:none}
@media (max-width:700px){
  body.at-phone-shell .at-ticket-tabs:not([hidden]){display:flex;flex:0 0 auto;gap:4px;margin:8px 10px 6px;padding:4px;border-radius:10px;background:#eef2f5;position:relative;z-index:96}
  body.at-phone-shell .at-ticket-tabs button{flex:1 1 0;min-height:40px;margin:0;padding:0 6px;border:0;border-radius:8px;background:transparent;font-family:inherit;font-size:14px;font-weight:600;color:#56636f;cursor:pointer}
  body.at-phone-shell .at-ticket-tabs button.is-active{background:#fff;color:#1f5f93;box-shadow:0 1px 3px rgba(20,38,63,.12)}
  body.at-phone-shell.at-ticket-tabs-on .record-context{top:var(--at-ttabs-bottom,116px)!important}
  body.at-phone-shell.at-ticket-tabs-on #mobileRecordDetailsToggle{display:none!important}
}