/* Phone Chats switcher (wizard-ux#1957, on for everyone; was switch wizard/chats-switcher): the title's ▾ (core/chats-sent.js csTitle, csFeedTitle) and the sheet that
 * rises from the bar (app-chatsswitch.js). Colours come from the skin's --wz-* tokens, so a live skin
 * change repaints them; the sheet panel is opaque. Targets are at least 44 px. */
html:root .ch-tbar-t .ch-tbar-pick {
  flex: 0 1 auto; min-width: 0; max-width: 100%; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 -8px; padding: 0 6px 0 8px; border: 0; border-radius: 12px;
  background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
html:root .ch-tbar-t .ch-tbar-pick:active { background: color-mix(in srgb, var(--wz-text, var(--ink)) 9%, transparent); }
html:root .ch-tbar-t .ch-tbar-pick:focus-visible { outline: 2px solid var(--wz-accent, var(--violet-2)); outline-offset: 0; }
html:root .ch-tbar-pick .ch-tbar-chev { flex: none; width: 18px; height: 18px; margin-left: -2px; fill: none; stroke: var(--wz-text-secondary, var(--ink-2)); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html:root .ch-tbar-pick .ch-tbar-emo { flex: none; font-size: 1.125rem; line-height: 1; }
html:root .ch-tbar-pick .ch-chan-sig { flex: none; display: inline-grid; width: 22px; height: 22px; }
html:root .ch-tbar-pick .ch-chan-sig > * { width: 100%; height: 100%; }
html:root .ch-list > .ch-top.ch-tbar-feed:not(#_) { display: flex; }

/* The sheet: the other agents, then the tags, in a grid of four, Inbox · Sent · Archived fixed at the bottom. Past two
 * rows the grid scrolls, and the top of the next row shows and fades out at its lower edge until it is scrolled to the
 * end (wizard-ux#2170: a hidden scrollbar and rows ending flush with the edge hid the agents). */
html:root .cs-scrim { position: absolute; inset: 0; z-index: 48; background: color-mix(in srgb, black 34%, transparent); opacity: 0; transition: opacity 180ms; }
html:root .cs-scrim.open { opacity: 1; }
html:root :is(.cs-scrim, .cs-sheet)[hidden] { display: none !important; }
html:root .cs-sheet {
  --cs-ink: var(--wz-text, var(--ink)); --cs-ink-2: var(--wz-text-secondary, var(--ink-2)); --cs-line: var(--wz-border, var(--line-2));
  --cs-accent: var(--wz-accent, var(--violet-2)); --cs-hover: color-mix(in srgb, var(--cs-ink) 9%, transparent);
  position: absolute; z-index: 49; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px));
  bottom: var(--cs-above, calc(var(--dock-h, 84px) + var(--safe-b, 0px))); box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 8px;
  border-radius: 22px; border: 1px solid var(--cs-line); color: var(--cs-ink); font-family: var(--wz-font-ui, var(--font, system-ui, sans-serif));
  background-color: var(--bg); background-image: linear-gradient(var(--wz-panel, var(--wz-base, var(--bg))), var(--wz-panel, var(--wz-base, var(--bg))));
  box-shadow: 0 18px 44px -12px color-mix(in srgb, black 55%, transparent); transform-origin: 30% 100%; transform: translateY(16px) scale(.97); opacity: 0; transition: transform 200ms var(--ease, ease), opacity 150ms;
}
html:root .cs-sheet.open { transform: none; opacity: 1; }
html:root .cs-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 74px; gap: 4px; overflow-y: auto; overflow-x: hidden;
  /* two whole rows, the gap and 30 px of the third (the padding and the line included, whatever the box sizing) */
  box-sizing: border-box; max-height: calc(74px * 2 + 4px * 2 + 30px + 6px + 1px);
  overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y; padding-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, var(--cs-line) 70%, transparent);
}
/* More below (app-chatsswitch.js csCue): the peeking row fades out; the line under the grid stays. */
html:root .cs-sheet:not(.cs-pop) .cs-grid.cs-more {
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 34px), transparent calc(100% - 1px), black calc(100% - 1px));
  mask-image: linear-gradient(to bottom, black calc(100% - 34px), transparent calc(100% - 1px), black calc(100% - 1px));
}
html:root .cs-tile {
  position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; margin: 0;
  border: 1px solid transparent; border-radius: 14px; background: none; color: var(--cs-ink); -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
}
html:root .cs-ic { display: grid; place-items: center; width: 30px; height: 30px; font-size: 1.375rem; line-height: 1; }
html:root .cs-ic > * { width: 26px; height: 26px; }
html:root .cs-nm { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--cs-ink-2); font: 500 0.75rem / 1.2 var(--wz-font-ui, var(--font, system-ui, sans-serif)); }
html:root .cs-dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--wz-panel, var(--bg)); }
html:root .cs-base { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html:root .cs-big {
  position: relative; min-width: 0; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; margin: 0;
  border: 1.5px solid transparent; border-radius: 16px; background: var(--wz-surface, color-mix(in srgb, var(--cs-ink) 7%, transparent)); color: var(--cs-ink);
  font: 600 0.875rem / 1.2 var(--wz-font-ui, var(--font, system-ui, sans-serif)); -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none;
}
html:root .cs-big svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html:root .cs-n {
  position: absolute; top: 7px; right: 10px; min-width: 20px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; display: grid; place-items: center;
  color: color-mix(in srgb, black 88%, var(--amber)); background: var(--amber); font: 700 0.6875rem / 1 var(--wz-font-ui, var(--font, system-ui, sans-serif)); font-variant-numeric: tabular-nums;
}
/* The view showing is outlined; the one under a sliding finger (or pressed) is lit. */
html:root :is(.cs-tile, .cs-big).cur { border-color: var(--cs-accent); }
html:root :is(.cs-tile, .cs-big):is(.hot, :active) { background: color-mix(in srgb, var(--cs-accent) 22%, transparent); }
html:root :is(.cs-tile, .cs-big):focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 0; }
html:root .cs-tile.hot .cs-nm { color: var(--cs-ink); }

/* Desktop (wizard-ux#2097): the same sheet as a popover under the title (app-chatsswitch.js chatsswitchDesk), placed
 * by its inline left/top/width; Inbox · Sent · Archived on top, then the tags and agents. */
html:root .cs-sheet.cs-pop {
  position: fixed; z-index: 2147483000; right: auto; bottom: auto; max-height: calc(100vh - 16px); overflow: auto;
  border-radius: 16px; transform-origin: 20% 0; transform: translateY(-6px) scale(.98);
}
html:root .cs-sheet.cs-pop.open { transform: none; }
html:root .cs-pop .cs-grid { padding: 6px 0 0; border-bottom: 0; border-top: 1px solid color-mix(in srgb, var(--cs-line) 70%, transparent); max-height: calc(74px * 2 + 4px); }
html:root .cs-pop :is(.cs-tile, .cs-big):hover { background: var(--cs-hover); cursor: pointer; }
html:root .cs-pop .cs-big { height: 56px; }
