/* ZaxSocial · css/chat.css — app-specific chat layout and interaction states. Owner: U5.
 * Channel colour, type and bubble primitives live in components.css.
 */
.zs-chat-screen,
.zs-chat-hub,
.zs-chat-library,
.zs-chat-thread {
  min-width: 0;
  min-height: 0;
  color: var(--zs-text);
}
.zs-chat-screen { position: relative; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.zs-chat-screen--list, .zs-chat-screen--starred, .zs-chat-screen--media { min-height: 0; }
.zs-chat-screen__loading { display: flex; flex: 1; }
.zs-chat-hub { display: flex; flex-direction: column; height: 100%; }
.zs-chat-hub__channels { display: flex; gap: 8px; padding: 12px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.zs-chat-hub__channels::-webkit-scrollbar { display: none; }
.zs-chat-hub__channel { flex: none; min-height: 34px; padding: 0 14px; border: 1px solid var(--zs-border); border-radius: 18px; background: var(--zs-surface); color: var(--zs-text-secondary); font: inherit; font-size: 13px; font-weight: 600; }
.zs-chat-hub__channel.is-active { border-color: transparent; background: var(--zs-accent-soft); color: var(--zs-accent-ink); }
.zs-chat-hub__list { display: flex; flex: 1; min-height: 0; }
.zs-chat-list { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.zs-chat-search { flex: none; }
.zs-chat-search input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }
.zs-chat-search input:focus-visible { outline: none; }
.zs-chat-search input::-webkit-search-cancel-button { display: none; }
.zs-chat-search__clear { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: currentColor; }
.zs-chat-chips { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.zs-chat-chips::-webkit-scrollbar { display: none; }
.zs-chat-chip { flex: none; border: 0; cursor: pointer; }
.zs-chat-list__rows { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.zs-chat-list__rows > [role="link"] { cursor: pointer; }
.zs-chat-list__rows > [role="link"]:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--zs-focus-ring); outline-offset: -2px; }
.zs-chat-list__rows > [role="link"]:hover { background-color: var(--zs-overlay-hover); }
.zs-chat-list__status { position: absolute; z-index: 2; bottom: 8px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 14px; background: var(--zs-toast-bg); color: var(--zs-toast-text); font-size: 12px; pointer-events: none; }
.zs-chat-list__status:empty { display: none; }
.zs-chat-list__sentinel { height: 1px; }
.zs-chat-row__muted, .zs-chat-row__pin { flex: none; width: 15px; height: 15px; color: var(--zs-text-tertiary); }
.zs-chat-row__muted { opacity: .7; }
.zs-chat-row__pin { transform: rotate(45deg); }
.zs-chat-thread { display: flex; flex: 1; flex-direction: column; overflow: hidden; background: var(--zs-surface); }
.zs-chat-thread__header { flex: none; }
.zs-chat-thread__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; font-weight: 600; }
.zs-chat-thread__scroll { position: relative; display: block; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.zs-chat-thread__loading { position: absolute; z-index: 1; inset: 8px 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: min(100%, 360px); padding: 12px; pointer-events: none; }
.zs-chat-thread__loading[hidden] { display: none; }
.zs-chat-thread__messages { display: flex; min-height: 100%; flex-direction: column; justify-content: flex-end; padding: 0 0 8px; }
.zs-chat-thread__empty { align-self: center; margin: auto; padding: 24px; color: var(--zs-text-secondary); text-align: center; }
.zs-chat-date { flex: none; }
.zs-chat-msg { position: relative; flex: none; scroll-margin-block: 38vh; }
.zs-chat-has-actions { position: relative; }
.zs-chat-msg__more { position: absolute; z-index: 4; top: 1px; display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid var(--zs-border-subtle); border-radius: 50%; background: var(--zs-glass-bg, var(--zs-surface)); color: var(--zs-text-secondary); box-shadow: var(--zs-shadow-sm); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; transition: opacity .16s ease, transform .16s ease; transform: scale(.94); }
.zs-chat-has-actions.is-in > .zs-chat-msg__more { right: 3px; }
.zs-chat-has-actions.is-out > .zs-chat-msg__more { left: 3px; }
.zs-chat-has-actions:hover > .zs-chat-msg__more, .zs-chat-has-actions:focus-within > .zs-chat-msg__more, .zs-chat-msg__more:focus-visible { opacity: 1; transform: scale(1); }
.zs-chat-msg__more:focus-visible { outline: 2px solid var(--zs-focus-ring); outline-offset: 2px; }
@media (hover: none), (pointer: coarse) { .zs-chat-msg__more { opacity: .76; transform: none; } }
@media (prefers-reduced-motion: reduce) { .zs-chat-msg__more { transition: none; } }
.zs-wa-pinned { display: flex; align-items: center; gap: 9px; margin: 4px 10px 2px; padding: 7px 8px 7px 11px; border: 1px solid var(--zs-wa-divider, var(--zs-border-subtle)); border-radius: 12px; background: var(--zs-wa-info-bg); color: var(--zs-wa-info-text); box-shadow: var(--zs-wa-bubble-shadow); }
.zs-wa-pinned > .zi { flex: none; color: var(--zs-wa-accent); }
.zs-wa-pinned__body { display: grid; flex: 1; min-width: 0; gap: 2px; padding: 0; background: transparent; color: inherit; text-align: left; }
.zs-wa-pinned__body b { overflow: hidden; color: var(--zs-wa-text); font-size: 12.5px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.zs-wa-pinned__body span { overflow: hidden; color: var(--zs-wa-text-2); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.zs-wa-pinned__unpin { display: grid; flex: none; width: 30px; height: 30px; place-items: center; padding: 0; border-radius: 50%; background: transparent; color: var(--zs-wa-text-2); }
.zs-wa-pinned__unpin:hover, .zs-wa-pinned__unpin:focus-visible { background: var(--zs-overlay-hover); color: var(--zs-wa-text); }
.zs-chat-msg.is-highlight .zs-chat-bubble { animation: zs-chat-flash 1.15s ease-out; }
@keyframes zs-chat-flash { 0%, 30% { box-shadow: 0 0 0 4px var(--zs-accent-soft), var(--zs-wa-bubble-shadow, var(--zs-shadow-sm)); } 100% { box-shadow: var(--zs-wa-bubble-shadow, var(--zs-shadow-sm)); } }
.zs-chat-bubble { min-width: 42px; }
.zs-chat-text { white-space: pre-wrap; }
.zs-chat-text a, .zs-chat-link { color: var(--zs-wa-link, var(--zs-accent-text)); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .12em; overflow-wrap: anywhere; }
.zs-chat-text code, .zs-chat-code { padding: 1px 4px; border-radius: 4px; background: var(--zs-fill); font-family: var(--zs-font-mono); font-size: .92em; }
.zs-chat-mono { display: block; max-width: min(70vw, 480px); overflow-x: auto; padding: 8px; border-radius: 6px; background: var(--zs-fill); font-family: var(--zs-font-mono); font-size: 12px; white-space: pre; }
.zs-chat-bq { display: block; padding-left: 9px; border-left: 3px solid var(--zs-accent); color: var(--zs-text-secondary); }
.zs-chat-hl { border-radius: 2px; background: var(--zs-warning-soft); color: inherit; }
.zs-chat-li { display: block; padding-left: 1.1em; }
.zs-chat-meta { white-space: nowrap; }
.zs-chat-edited { margin-right: 3px; font-size: 10px; }
.zs-chat-tick { flex: none; }
.zs-chat-tick.is-blue { color:#53bdeb; }
.zs-chat-ai { display: inline-flex; align-items: center; gap: 4px; }
.zs-chat-sender { display: block; }
.zs-chat-quote { display: block; width: 100%; max-width: 100%; overflow: hidden; border: 0; color: inherit; text-align: left; cursor: pointer; }
.zs-chat-quote__name { display: block; overflow: hidden; color: var(--zs-accent-text); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-quote__text { display: block; overflow: hidden; color: var(--zs-text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 5px; }
.zs-chat-reaction { padding: 2px 6px; border-radius: 11px; background: var(--zs-accent-soft); font-size: 12px; line-height: 17px; }
.zs-chat-retry { display: block; margin: 8px 0 0 auto; color: var(--zs-danger-ink); font-size: 12px; text-decoration: underline; }
.zs-chat-deleted { color: var(--zs-text-tertiary); font-style: italic; }
.zs-chat-media { position: relative; display: flex; max-width: min(76vw, 340px); flex-direction: column; gap: 5px; overflow: hidden; border-radius: 8px; }
.zs-chat-media[role="button"] { cursor: zoom-in; }
.zs-chat-media[role="button"]:focus-visible { outline: 2px solid var(--zs-accent); outline-offset: 2px; }
.zs-chat-media__image, .zs-chat-media__video { display: block; width: auto; max-width: 100%; max-height: 360px; object-fit: cover; border-radius: inherit; }
.zs-chat-media__image { min-width: 88px; min-height: 56px; }
.zs-chat-media__image.is-sticker { width: 160px; height: 160px; min-width: 0; min-height: 0; object-fit: contain; }
.zs-chat-media__duration { position: absolute; right: 7px; bottom: 7px; padding: 2px 6px; border-radius: 8px; background: var(--zs-lit-000000-60); color: var(--zs-lit-ffffff); font-size: 11px; }
.zs-chat-doc { display: flex; min-width: min(62vw, 250px); align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.zs-chat-doc__name { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-doc__size { flex: none; color: var(--zs-text-tertiary); font-size: 11px; }
.zs-chat-voice { position: relative; display: grid; min-width: 220px; max-width: min(70vw, 330px); grid-template-columns: 36px 1fr auto; grid-template-rows: 34px 18px; align-items: center; gap: 3px 8px; padding: 7px; border-radius: 10px; }
.zs-chat-voice__play { display: grid; grid-row: 1 / 3; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--zs-wa-green-strong); color: var(--zs-lit-ffffff); }
.zs-chat-voice__wave { position: relative; display: flex; height: 28px; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.zs-chat-voice__wave i { flex: 1; min-width: 2px; max-width: 4px; height: var(--h, 45%); border-radius: 4px; background: linear-gradient(to right, var(--zs-wa-wave-played) var(--zs-voice-progress, 0%), var(--zs-wa-wave) var(--zs-voice-progress, 0%)); }
.zs-chat-voice__progress { position: absolute; top: 9px; left: 48px; width: calc(100% - 95px); height: 24px; margin: 0; opacity: .01; cursor: pointer; }
.zs-chat-voice__times { display: flex; grid-column: 2; justify-content: space-between; color: var(--zs-text-secondary); font-size: 10px; }
.zs-chat-voice__time, .zs-chat-voice__duration { font-variant-numeric: tabular-nums; }
.zs-chat-voice__speed { grid-column: 3; grid-row: 1 / 3; padding: 5px; border-radius: 9px; color: var(--zs-text-secondary); font-size: 11px; }
.zs-chat-voice audio { display: none; }
.zs-chat-voice__missing { color: var(--zs-text-secondary); font-size: 12px; }
.zs-chat-scrollbutton { position: sticky; z-index: 2; right: 14px; bottom: 12px; align-self: flex-end; display: grid; place-items: center; min-width: 42px; height: 42px; margin: -50px 14px 8px 0; padding: 0 10px; border: 1px solid var(--zs-border); border-radius: 22px; background: var(--zs-surface); color: var(--zs-text); box-shadow: var(--zs-shadow-md); }
.zs-chat-scrollbutton[hidden] { display: none; }
.zs-chat-composer-wrap { z-index: 2; flex: none; padding-bottom: var(--zs-safe-bottom, 0px); background: var(--zs-wa-composer-bar, var(--zs-surface)); }
.zs-chat-replybar { display: flex; align-items: center; gap: 12px; padding: 8px 14px 5px; border-top: 1px solid var(--zs-hairline); }
.zs-chat-replybar__body { display: grid; flex: 1; min-width: 0; gap: 2px; padding-left: 9px; border-left: 3px solid var(--zs-wa-green-strong); }
.zs-chat-replybar__body strong, .zs-chat-replybar__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-replybar__body strong { color: var(--zs-wa-green-strong); font-size: 12px; }
.zs-chat-replybar__body span { color: var(--zs-text-secondary); font-size: 12px; }
.zs-chat-replybar__close { display: grid; place-items: center; width: 32px; height: 32px; color: var(--zs-text-secondary); }
.zs-chat-composer-host { min-width: 0; }
.zs-chat-qr { display: grid; max-height: 260px; overflow: auto; border-top: 1px solid var(--zs-hairline); background: var(--zs-surface); }
.zs-chat-qr__item { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--zs-hairline); text-align: left; }
.zs-chat-qr__item code { flex: none; padding: 3px 6px; border-radius: 5px; background: var(--zs-fill); font-family: var(--zs-font-mono); font-size: 12px; }
.zs-chat-qr__item span { overflow: hidden; color: var(--zs-text-secondary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-composer { gap: 7px; }
.zs-chat-composer__field { min-width: 0; }
.zs-chat-composer__input { min-width: 0; max-height: 120px; overflow-y: auto; font-size: max(16px, 1em); }
.zs-chat-composer__send { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.zs-chat-composer__attach, .zs-chat-composer__emoji, .zs-chat-composer__mic { display: grid; flex: none; place-items: center; width: 40px; height: 40px; }
.zs-chat-composer__mic, .zs-tg-x-mic { position: relative; z-index: 1; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.zs-chat-composer__send:disabled, .zs-chat-composer__attach:disabled { opacity: .48; }
.zs-chat-composer.is-blocked, .zs-chat-composer.is-disconnected { opacity: .72; }
.zs-chat-date { scroll-margin: 50vh; }
.zs-chat-flash { animation: zs-chat-flash 1.1s ease-out; }
.zs-chat-starred-row { display: flex; width: 100%; min-height: 66px; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--zs-hairline); text-align: left; }
.zs-chat-starred-row__body { display: grid; flex: 1; min-width: 0; gap: 3px; }
.zs-chat-starred-row__body strong, .zs-chat-starred-row__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-starred-row__body strong { font-weight: 600; }
.zs-chat-starred-row__body span, .zs-chat-starred-row time { color: var(--zs-text-secondary); font-size: 13px; }
.zs-chat-media-tabs { display: flex; flex: none; gap: 8px; padding: 10px 16px; overflow-x: auto; }
.zs-chat-media-tabs__tab { min-height: 34px; padding: 0 14px; border-radius: 18px; color: var(--zs-text-secondary); white-space: nowrap; }
.zs-chat-media-tabs__tab.is-active { background: var(--zs-accent-soft); color: var(--zs-accent-ink); }
.zs-chat-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 3px; overflow: auto; }
.zs-chat-media-grid__tile { position: relative; display: grid; min-height: 112px; place-items: center; overflow: hidden; background: var(--zs-surface-2); }
.zs-chat-media-grid__image { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.zs-chat-media-grid__doc, .zs-chat-media-grid__text { padding: 10px; color: var(--zs-text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.zs-chat-library { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: auto; }
.zs-chat-library__intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zs-chat-library__intro p { margin: 0; color: var(--zs-text-secondary); font-size: 13px; }
.zs-chat-library__items { display: grid; gap: 8px; }
.zs-chat-library__item { display: flex; min-height: 56px; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--zs-hairline); border-radius: 12px; background: var(--zs-surface); }
.zs-chat-library--labels, .zs-chat-library--quick-replies { max-width: 760px; width: 100%; align-self: center; }
.zs-chat-library__item--reply { min-height: 64px; }
.zs-chat-library__swatch { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--zs-accent); }
.zs-chat-library__name { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-library__count, .zs-chat-library__scope { color: var(--zs-text-secondary); font-size: 12px; }
.zs-chat-library__shortcut { flex: none; padding: 4px 7px; border-radius: 6px; background: var(--zs-fill); font-family: var(--zs-font-mono); font-size: 12px; }
.zs-chat-labeldot--green { background: var(--zs-success); }
.zs-chat-labeldot--blue { background: var(--zs-info); }
.zs-chat-labeldot--orange { background: var(--zs-warning); }
.zs-chat-labeldot--red { background: var(--zs-danger); }
.zs-chat-labeldot--violet { background: var(--zs-accent); }
.zs-chat-attach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.zs-chat-attach__item { display: flex; min-height: 74px; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--zs-hairline); border-radius: 12px; background: var(--zs-surface); color: var(--zs-text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; }
.zs-chat-attach__contacts { max-height: 54vh; overflow: auto; }
.zs-chat-location-confirm { display: grid; justify-items: center; gap: 9px; padding: 16px 8px; color: var(--zs-text-secondary); text-align: center; }
.zs-chat-location-confirm > .zs-icon { color: var(--zs-accent); }
.zs-chat-location-confirm > strong { color: var(--zs-text); font-variant-numeric: tabular-nums; }
.zs-chat-location-confirm > span { max-width: 300px; font-size: 13px; line-height: 19px; }
.zs-chat-attach__icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--zs-accent-soft); color: var(--zs-accent); }
.zs-chat-attach__icon--camera { background: var(--zs-info-soft); color: var(--zs-info); }
.zs-chat-attach__icon--audio { background: var(--zs-success-soft); color: var(--zs-success); }
.zs-chat-attach__icon--file { background: var(--zs-warning-soft); color: var(--zs-warning); }
.zs-chat-attach-sheet .zs-sheet__body { padding: 16px; }
.zs-chat-preview { display: flex; min-height: min(70vh, 620px); flex-direction: column; gap: 12px; }
.zs-chat-preview-sheet .zs-sheet__body { padding: 12px 16px; }
.zs-chat-preview__stage { position: relative; display: grid; flex: 1; min-height: 230px; place-items: center; overflow: hidden; border-radius: 16px; background: var(--zs-lit-101014); }
.zs-chat-preview__image, .zs-chat-preview__video { display: block; max-width: 100%; max-height: min(58vh, 520px); object-fit: contain; }
.zs-chat-preview__file { display: grid; max-width: 82%; justify-items: center; gap: 8px; color: var(--zs-lit-ffffff); text-align: center; }
.zs-chat-preview__file span { color: var(--zs-lit-ffffff-72); font-size: 13px; }
.zs-chat-preview__strip { display: flex; min-height: 58px; gap: 8px; overflow-x: auto; }
.zs-chat-preview__thumb { position: relative; display: grid; flex: none; width: 54px; height: 54px; place-items: center; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: var(--zs-surface-2); color: var(--zs-text-secondary); }
.zs-chat-preview__thumb.is-active { border-color: var(--zs-accent); }
.zs-chat-preview__thumb img { width: 100%; height: 100%; object-fit: cover; }
.zs-chat-preview__caption { min-height: 48px; max-height: 110px; padding: 12px; border: 1px solid var(--zs-border); border-radius: 12px; background: var(--zs-surface); color: var(--zs-text); font: inherit; font-size: max(16px, 1em); resize: vertical; }
.zs-chat-preview__info { color: var(--zs-text-secondary); font-size: 12px; text-align: center; }
.zs-chat-preview__count { margin-left: 8px; }
.zs-chat-viewer { position: fixed; inset: 0; box-sizing: border-box; display: grid; width: 100%; height: var(--zs-vvh, 100dvh); grid-template-columns: 48px minmax(0, 1fr) 48px; grid-template-rows: 48px minmax(0, 1fr) auto 28px; align-items: center; justify-items: center; overflow: hidden; padding: var(--zs-safe-top, 0px) 12px var(--zs-safe-bottom, 0px); background: var(--zs-lit-101014); color: var(--zs-lit-ffffff); }
.zs-chat-viewer__stage { grid-row: 2; grid-column: 1 / -1; display: grid; width: 100%; height: 100%; min-width: 0; min-height: 0; place-items: center; overflow: hidden; touch-action: pan-y; }
.zs-chat-viewer__stage img, .zs-chat-viewer__stage video { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.zs-chat-viewer__nav, .zs-chat-viewer__close { z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 20px; background: var(--zs-lit-ffffff-18); color: var(--zs-lit-ffffff); font-size: 28px; }
.zs-chat-viewer__close { grid-row: 1; grid-column: 1; justify-self: start; }
.zs-chat-viewer__nav:first-of-type { grid-row: 2; grid-column: 1; justify-self: start; }
.zs-chat-viewer__nav:nth-of-type(3) { grid-row: 2; grid-column: 3; justify-self: end; }
.zs-chat-viewer__nav:disabled { opacity: .35; }
.zs-chat-viewer__caption { grid-row: 3; grid-column: 1 / -1; max-width: 88vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.zs-chat-viewer__count { grid-row: 4; grid-column: 1 / -1; color: var(--zs-lit-ffffff-72); font-size: 12px; }
.zs-chat-viewer-sheet .zs-sheet { inset: 0; width: 100%; height: var(--zs-vvh, 100dvh); max-width: none; max-height: none; padding: 0; overflow: hidden; border-radius: 0; background: var(--zs-lit-101014); }
.zs-chat-viewer-sheet .zs-sheet__grabber { display: none; }
.zs-chat-viewer-sheet .zs-sheet__body { display: flex; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
.zs-chat-li__m { display: inline-block; min-width: 1.4em; color: var(--zs-text-secondary); }
.zs-chat-viewer-sheet .zs-sheet__body { padding: 0; }
.zs-chat-recorder { display: grid; min-height: 150px; place-items: center; }
.zs-chat-recorder__panel { display: grid; justify-items: center; gap: 12px; color: var(--zs-text-secondary); text-align: center; }
.zs-chat-recorder__time { color: var(--zs-text); font-size: 28px; font-variant-numeric: tabular-nums; }
.zs-chat-recorder__status { max-width: 340px; font-size: 14px; line-height: 20px; }
.zs-chat-recorder__panel audio { width: min(100%, 360px); }
.zs-chat-recorder__help { color: var(--zs-text-secondary); font-size: 14px; line-height: 21px; }
.zs-chat-recorder-sheet .zs-sheet__actions { display: grid; grid-template-columns: 1fr 1fr; }
.zs-chat-recorder-sheet .zs-sheet__actions .zs-btn:first-child { grid-column: 1 / -1; }
.zs-chat-settings, .zs-chat-info { min-height: 100%; padding: 8px 12px 30px; overflow-y: auto; }
.zs-chat-settings--blocked { display: flex; flex-direction: column; }
.zs-chat-settings__status { min-height: 160px; }
.zs-chat-settings__search { margin: 12px 4px; }
.zs-chat-settings__blocked-list .zs-item { min-height: 58px; }
.zs-chat-settings__blocked-row { margin: 0 2px 6px; padding-inline: 10px; border: 1px solid var(--zs-hairline); border-radius: 14px; }
.zs-chat-settings__blocked-row > .zs-avatar { flex: none; }
.zs-chat-settings__blocked-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.zs-chat-settings__blocked-actions .zs-btn { min-height: 34px; }
.zs-chat-settings__blocked-delete { color: var(--zs-danger-ink); }
.zs-chat-settings__segment { display: grid; gap: 10px; padding: 14px 16px; }
.zs-chat-settings__segment > .zs-item__title { font-size: 14px; font-weight: 600; }
.zs-chat-info { display: flex; flex-direction: column; gap: 14px; }
.zs-chat-profile { display: grid; justify-items: center; gap: 6px; padding: 28px 12px 16px; text-align: center; }
.zs-chat-profile .zs-avatar, .zs-chat-profile__avatar { --size: 112px; width: var(--size); height: var(--size); display: grid; place-items: center; border-radius: 50%; background: var(--zs-av-2); color: var(--zs-lit-ffffff); font-size: 38px; }
.zs-chat-profile h1 { margin: 8px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.zs-chat-profile p { margin: 0; color: var(--zs-text-secondary); font-size: 14px; }
.zs-chat-profile__channel { padding: 3px 9px; border-radius: 12px; background: var(--zs-fill); color: var(--zs-text-secondary); font-size: 12px; }
.zs-chat-info__actions { display: flex; justify-content: center; gap: 8px; }
.zs-chat-info__action { display: grid; min-width: 76px; justify-items: center; gap: 6px; padding: 10px; border-radius: 12px; color: var(--zs-accent-text); font-size: 12px; }
.zs-chat-info__action:hover { background: var(--zs-accent-soft); }
.zs-chat-info__sections { display: grid; gap: 10px; }
.zs-chat-info__sections > .zs-skel-list { min-height: 140px; }
.zs-chat-info__scheduled { padding: 14px 16px; border-radius: var(--zs-r-lg); background: var(--zs-surface); box-shadow: var(--zs-shadow-sm); }
.zs-chat-info__scheduled > h2 { margin: 0 0 8px; font-size: 15px; }
.zs-chat-info__scheduled-empty { margin: 0; color: var(--zs-text-secondary); font-size: 13px; }
.zs-chat-info__scheduled-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--zs-hairline); }
.zs-chat-info__scheduled-row > div { display: grid; gap: 3px; min-width: 0; }
.zs-chat-info__scheduled-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.zs-chat-info__scheduled-row small { color: var(--zs-text-secondary); font-size: 11px; }
.zs-chat-translation { max-width: min(72vw, 520px); }
.zs-chat-translation small { color: var(--zs-text-secondary); }
.zs-chat-translation p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.zs-chat-contacts { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.zs-chat-contact-entry { display: flex; min-width: 0; min-height: 66px; align-items: center; border-bottom: 1px solid var(--zs-hairline); }
.zs-chat-contact-row { display: flex; flex: 1; width: auto; min-width: 0; min-height: 66px; align-items: center; gap: 12px; padding: 8px 12px 8px 16px; text-align: left; }
.zs-chat-contact-remove { flex: none; margin: 0 8px 0 0; }
.zs-chat-contact-row__body { display: grid; flex: 1; min-width: 0; gap: 2px; }
.zs-chat-contact-row__body strong, .zs-chat-contact-row__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-contact-row__body span, .zs-chat-contact-row__badge { color: var(--zs-text-secondary); font-size: 13px; }
.zs-chat-settings__blocked-actions .zs-btn__label, .zs-chat-contact-remove .zs-btn__label { white-space: nowrap; }
.zs-chat-contacts__more { margin: 12px auto; }
.zs-chat-contacts__list { min-height: 0; overflow: auto; }
.zs-chat-forward { display: grid; gap: 10px; }
.zs-chat-forward__hint { margin: 0; color: var(--zs-text-secondary); font-size: 13px; }
.zs-chat-forward__list { max-height: 55vh; overflow: auto; }
.zs-chat-forward__row { display: flex; min-height: 60px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--zs-hairline); }
.zs-chat-forward__name { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.zs-chat-forward__row small { color: var(--zs-text-tertiary); font-size: 11px; }
.zs-chat-forward__send { position: sticky; bottom: 0; }
.zs-chat-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); max-height: min(55vh, 420px); overflow: auto; }
.zs-chat-emoji-grid__item, .zs-chat-reaction-picker__item { display: grid; min-height: 42px; place-items: center; border-radius: 8px; font-size: 23px; }
.zs-chat-emoji-grid__item:hover, .zs-chat-reaction-picker__item:hover { background: var(--zs-overlay-hover); }
.zs-chat-reaction-picker { display: flex; gap: 4px; }
.zs-chat-reaction-picker__item { width: 42px; }
.zs-chat-library__item .zs-iconbtn { flex: none; }
@media (max-width: 480px) {
  .zs-chat-viewer { padding-inline: 4px; }
  .zs-chat-emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .zs-chat-library { padding: 12px; }
}
@media (min-width: 760px) {
  .zs-chat-hub { width: min(100%, 760px); margin-inline: auto; }
  .zs-chat-library { width: min(100%, 760px); align-self: center; }
  .zs-chat-thread { max-width: 900px; margin-inline: auto; }
  .zs-chat-bubble { max-width: min(70%, 620px); }
}
@media (prefers-reduced-motion: reduce) {
  .zs-chat-thread__scroll { scroll-behavior: auto; }
  .zs-chat-msg.is-highlight .zs-chat-bubble { animation: none; outline: 2px solid var(--zs-accent); }
}

/* ======================================================================================================
   Native channel chrome + edge-to-edge frames (owner request 2026-10-14, notes/UI-CHANGES-2026-10-14.md §A–§C).
   js/chat/chrome.js renders .zs-chhead (channel header) inside .zs-chframe; the app area renders the bottom bar
   (.zs-chnav) on phones and the far-left rail (.zs-chrail) on >= 768 px. WhatsApp / Telegram colours come from the
   real-app palettes (--zs-wa-*, --zs-tg-*).
   ====================================================================================================== */
.zs-chframe { --ch-head-bg: var(--zs-wa-header-bg); --ch-head-fg: var(--zs-wa-text); --ch-title: var(--zs-wa-title); --ch-icon: var(--zs-wa-icon);
  --ch-accent: var(--zs-wa-accent); --ch-line: var(--zs-wa-divider); --ch-bg: var(--zs-wa-bg); --ch-hover: color-mix(in srgb, var(--zs-wa-text) 8%, transparent);
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; background: var(--ch-bg); color: var(--ch-head-fg); }
.zs-chframe--tg { --ch-head-bg: var(--zs-tg-appbar); --ch-head-fg: var(--zs-tg-appbar-fg); --ch-title: var(--zs-tg-appbar-fg); --ch-icon: var(--zs-tg-appbar-fg);
  --ch-accent: var(--zs-tg-accent); --ch-line: var(--zs-tg-divider); --ch-bg: var(--zs-tg-bg); --ch-hover: color-mix(in srgb, var(--zs-tg-text) 8%, transparent); color: var(--zs-tg-text); }
html[data-platform="ios"] .zs-chframe { --ch-head-bg: var(--zs-wa-header-ios); --ch-title: var(--zs-wa-text); --ch-icon: var(--zs-wa-text); }
html[data-platform="ios"] .zs-chframe--tg { --ch-head-bg: var(--zs-tg-header-ios); --ch-head-fg: var(--zs-tg-text); --ch-title: var(--zs-tg-header-title); --ch-icon: var(--zs-tg-accent-ios); --ch-accent: var(--zs-tg-accent-ios); }
.zs-chframe__head { position: sticky; top: 0; z-index: 20; flex: none; }
.zs-chframe__body { display: flex; flex: 1; min-height: 0; min-width: 0; flex-direction: column; }
.zs-chframe__body > * { min-width: 0; }
.zs-chframe .zs-wa-page { background: var(--ch-bg); }
.zs-chframe .zs-wa-page__head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* the native header shows the title */

/* Header bar */
.zs-chhead { padding-top: var(--zs-safe-top); background: var(--ch-head-bg); color: var(--ch-head-fg); }
html[data-platform="ios"] .zs-chhead { -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--ch-line); }
.zs-chhead__bar { display: flex; align-items: center; gap: 2px; min-height: 60px; padding: 0 4px 0 6px; }
html[data-platform="ios"] .zs-chhead__bar { min-height: 50px; padding: 0 6px 0 2px; }
.zs-chhead__title { flex: 1; min-width: 0; margin: 0 0 0 10px; color: var(--ch-title); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; outline: none; }
.zs-chhead__titletext { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-chhead__back + .zs-chhead__title { margin-left: 4px; font-size: 20px; font-weight: 500; }
html[data-platform="ios"] .zs-chhead__title { margin: 0; color: var(--zs-wa-text); font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.02em; text-align: center; }
html[data-platform="ios"] .zs-chhead.is-home:not(.zs-chhead--large) .zs-chhead__title { text-align: left; }
html[data-platform="ios"] .zs-chframe--tg .zs-chhead__title { color: var(--ch-title); }
.zs-chhead__spacer { flex: 1; }
.zs-chhead__actions { display: flex; flex: none; align-items: center; gap: 0; }
.zs-chhead__btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ch-icon); transition: background-color 140ms var(--zs-ease-standard); }
.zs-chhead__btn:hover { background: var(--ch-hover); }
.zs-chhead__btn:active { transform: scale(.94); }
.zs-chhead__btn:focus-visible, .zs-chhead__back:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: -2px; }
.zs-chhead__btn .zi { width: 22px; height: 22px; }
html[data-platform="ios"] .zs-chhead__btn { width: 38px; color: var(--ch-accent); }
html[data-platform="ios"] .zs-chframe--wa .zs-chhead__btn { color: var(--zs-wa-text); }
.zs-chhead__badge { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--zs-danger, #E5484D); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--ch-head-bg); }
.zs-chhead__back { display: inline-flex; flex: none; align-items: center; gap: 2px; min-width: 44px; height: 44px; padding: 0 6px 0 4px; border-radius: 22px; color: var(--ch-icon); font-size: 17px; letter-spacing: -.02em; }
.zs-chhead__back .zi { width: 24px; height: 24px; }
html[data-platform="ios"] .zs-chhead__back { padding: 0 8px 0 0; color: var(--ch-accent); }
html[data-platform="ios"] .zs-chframe--wa .zs-chhead__back { color: var(--zs-wa-text); }
html[data-platform="ios"] .zs-chhead__back .zi { width: 30px; height: 30px; --zi-stroke: 2.1; margin-right: -5px; }
.zs-chhead__backlabel { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-chhead__mark { display: grid; place-items: center; width: 24px; height: 24px; margin-left: 2px; border-radius: 0; background: transparent; color: currentColor; box-shadow: none; }
.zs-chhead__mark .zi { width: 15px; height: 15px; }
@media (prefers-reduced-motion: no-preference) { html:not([data-motion="reduce"]) .zs-chhead__back--home .zs-chhead__mark .zi { animation: zs-chrail-home-glow 3.2s ease-in-out infinite; } }
.zs-chhead__large { padding: 0 16px 8px; }
.zs-chhead__large .zs-chhead__title { margin: 0; color: var(--ch-head-fg); font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.025em; text-align: left; }
html[data-platform="ios"] .zs-chframe--tg .zs-chhead__large .zs-chhead__title { color: var(--zs-tg-text); }
html[data-platform="android"] .zs-chframe--wa .zs-chhead.is-home .zs-chhead__title { color: var(--zs-wa-title); font-weight: 600; }

/* Lists: edge to edge, inset dividers that start after the avatar (WhatsApp/Telegram style) */
.zs-chframe--list .zs-chat-screen--list { flex: 1; }
.zs-wa-x-inbox { position: relative; display: flex; flex: 1; min-height: 0; flex-direction: column; }
.zs-wa-x-fab { position: fixed; right: 16px; bottom: calc(var(--zs-chnav-space, 0px) + 16px); }

/* Chat frame (phones): full-bleed header / message list / composer. The message list is the only scroller; the
   composer stays attached to the bottom edge or the top of the on-screen keyboard (UI-CHANGES §C). */
.zs-wa-x-chatscreen, .zs-tg-x-chatscreen { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.zs-chat-frame { display: flex; flex-direction: column; overflow: hidden; }
.zs-chat-frame > .zs-chat-thread__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.zs-chat-frame > header, .zs-chat-frame > .zs-chat-composer-wrap { flex: none; }
@media (max-width: 767px), (max-height: 559px) {
  .zs-chat-frame { box-sizing: border-box; display: flex; width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; }
  .zs-chat-frame:not(.is-chat-host) { position: fixed; z-index: var(--zs-z-chat, 260); inset: 0; width: auto; height: 100vh; height: 100dvh; }
  .zs-chat-frame > .zs-chat-thread__header { position: sticky; top: 0; z-index: 20; flex: 0 0 auto; align-self: stretch; visibility: visible; }
  html.is-kb-open .zs-chat-frame > .zs-chat-thread__header { position: sticky; top: 0; z-index: 20; flex: 0 0 auto; visibility: visible !important; }
  .zs-chat-frame > .zs-wa-bars { flex: 0 0 auto; }
  .zs-chat-frame > .zs-chat-thread__scroll { flex: 1 1 0%; width: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .zs-chat-frame > .zs-chat-composer-wrap { position: sticky; z-index: 5; inset-block-end: 0; align-self: stretch; flex: 0 0 auto; width: 100%; margin-block-start: auto; }
  html.is-channel-thread #zs-app[data-layout="channel"], html.is-wa-chat-open #zs-app[data-layout="channel"] { width: 100%; height: 100dvh; min-height: 0; overflow: hidden; }
  html.is-channel-thread #zs-app[data-layout="channel"] > .zs-view, html.is-wa-chat-open #zs-app[data-layout="channel"] > .zs-view { width: 100%; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  html.is-channel-thread #zs-tabbar, html.is-channel-thread .zs-chnav, html.is-wa-chat-open #zs-tabbar, html.is-wa-chat-open .zs-chnav, html.is-wa-chat-open .zs-wa-nav, html.is-wa-chat-open .zs-wa-tabbar { display: none !important; }
  .zs-screen[data-full] { min-height: 0; }
}
.zs-chat-composer-wrap { padding-bottom: var(--zs-kb-safe-bottom, var(--zs-safe-bottom, 0px)); }
html.is-kb-open .zs-chat-composer-wrap { padding-bottom: 0; }
/* In iOS chat screens, the host reaches the bottom edge directly; don't leave a second safe-area spacer below the composer. */
html.is-chat-locked[data-platform="ios"] .zs-chat-composer-wrap { padding-bottom: 0; }
.zs-chat-composer-wrap .zs-wa-composer { padding-bottom: 6px; }
html[data-platform="ios"] .zs-chat-composer-wrap .zs-wa-composer { padding-bottom: 7px; }
/* The wrapper owns the iOS home-indicator inset. Native WA/TG composer controls must not add it a second time. */
html[data-platform="ios"] .zs-chat-composer-wrap .zs-wa-composer,
html[data-platform="ios"] .zs-chat-composer-wrap .zs-tg-composer { padding-bottom: 0; }
/* Keep a clean seam between the messages and composer: no separator on the wrapper or input bar. */
html[data-platform="ios"] #zs-app .zs-chat-frame > .zs-chat-thread__scroll { border-bottom: 0 !important; box-shadow: none !important; }
html[data-platform="ios"] #zs-app .zs-chat-frame > .zs-chat-composer-wrap,
html[data-platform="ios"] #zs-app .zs-chat-frame .zs-chat-composer-wrap .zs-wa-composer,
html[data-platform="ios"] #zs-app .zs-chat-frame .zs-chat-composer-wrap .zs-tg-composer { border-block-start: 0 !important; box-shadow: none !important; }
/* Match the WhatsApp composer strip to the conversation canvas so its top edge does not read as a separate band. */
html[data-platform="ios"] #zs-app .zs-chat-frame > .zs-chat-composer-wrap,
html[data-platform="ios"] #zs-app .zs-chat-frame .zs-chat-composer-wrap .zs-wa-composer { background: var(--zs-wa-chat-bg) !important; }
html[data-platform="ios"] #zs-app .zs-chat-frame > .zs-chat-composer-wrap::before,
html[data-platform="ios"] #zs-app .zs-chat-frame > .zs-chat-composer-wrap::after { display: none !important; content: none !important; }
.zs-chat-thread .zs-wa-chathead { flex: none; }
.zs-chat-composer__input, .zs-wa-composer__input, .zs-tg-composer__input { box-sizing: border-box; min-height: 40px; max-height: 132px; margin: 0; padding: 10px 4px; border: 0; border-radius: 0; outline: 0; background: transparent; color: inherit;
  font: inherit; font-size: max(16px, 1em); line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; resize: none; -webkit-appearance: none; appearance: none; box-shadow: none; }
.zs-wa-composer__input { color: var(--zs-wa-text); }
.zs-chat-composer__input::placeholder, .zs-wa-composer__input::placeholder { color: var(--zs-wa-text-2); opacity: 1; }
.zs-chat-composer__input:focus, .zs-chat-composer__input:focus-visible { outline: 0; }
.zs-chat-composer__send { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.zs-chat-thread__scroll > .zs-wa-scrolldown { position: sticky; z-index: 3; bottom: 12px; display: grid; margin: -54px 14px 12px auto; }
.zs-chat-thread__scroll > .zs-wa-scrolldown[hidden] { display: none; }
.zs-wa-scrolldown__count:empty { display: none; }
.zs-wa-scrolldown__count { position: absolute; top: -6px; right: -4px; }
.zs-wa-chathead__avatar { flex: none; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.zs-wa-chathead__info { cursor: pointer; }
.zs-wa-chathead__actions { display: flex; align-items: center; }
.zs-wa-chathead__actions .zs-chat-header-actions { display: flex; }
.zs-wa-chathead__actions .zs-chat-header-actions__button, .zs-wa-chathead .zs-wa-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--zs-wa-text); }
.zs-wa-chathead .zs-wa-icon:hover, .zs-wa-chathead__actions .zs-chat-header-actions__button:hover { background: color-mix(in srgb, var(--zs-wa-text) 8%, transparent); }
.zs-wa-bars:empty { display: none; }
.zs-wa-bars { flex: none; }
.zs-wa-window-note { max-width: min(94%, 620px); text-align: left; }
.zs-wa-window-note > span { flex: 1 1 auto; min-width: 0; }
.zs-wa-window-note > a { flex: none; white-space: nowrap; }
.zs-guide__notice-body { flex: 1 1 auto; min-width: 0; }
.zs-guide__notice-body > b { display: block; margin: 0 0 4px; font-weight: 750; }
.zs-guide__notice-steps { display: grid; gap: 3px; margin: 0; padding-inline-start: 19px; }
.zs-guide__notice-steps li { padding-inline-start: 2px; }
.zs-wa-emptychat { display: flex; justify-content: center; margin: 12px auto; padding: 0 16px; }
.zs-wa-emptychat__chip { display: inline-flex; align-items: flex-start; gap: 6px; max-width: 420px; padding: 6px 12px; border-radius: 8px; background: var(--zs-wa-info-bg); color: var(--zs-wa-info-text); font-size: 12.5px; line-height: 17px; text-align: center; box-shadow: var(--zs-wa-bubble-shadow); }
.zs-wa-emptychat__chip .zi { flex: none; margin-top: 1px; }

/* Desktop / tablet (>= 768 x 560): full-window WhatsApp Web / Telegram Web layout to the right of the rail.
   List pane 30–34 % (min 340, max 500), conversation pane the rest, hairline between them, no outer container. */
@media (min-width: 768px) and (min-height: 560px) {
  #zs-app[data-layout="channel"] > .zs-view { height: 100dvh; padding-bottom: 0; overflow: hidden; }
  #zs-app[data-layout="channel"] #zs-view.has-panes, #zs-app[data-layout="channel"] #zs-view:has(> .zs-pane--list) { grid-template-columns: clamp(340px, 32%, 500px) minmax(0, 1fr); align-items: stretch; height: 100dvh; }
  #zs-app[data-layout="channel"] .zs-pane--list { position: relative; top: auto; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; border-right: 1px solid var(--zs-wa-divider); }
  html[data-channel="tg"] #zs-app[data-layout="channel"] .zs-pane--list { border-right-color: var(--zs-tg-divider); }
  #zs-app[data-layout="channel"] .zs-pane--detail { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
  #zs-app[data-layout="channel"] .zs-pane > .zs-screen, #zs-app[data-layout="channel"] .zs-pane > .zs-pane__empty { display: flex; flex: 1; flex-direction: column; height: 100%; min-height: 0; }
  #zs-app[data-layout="channel"] .zs-pane > .zs-screen > *, #zs-app[data-layout="channel"] .zs-pane > .zs-pane__empty > * { flex: 1; min-height: 0; }
  #zs-app[data-layout="channel"] .zs-view > .zs-screen { height: 100dvh; overflow-y: auto; }
  .zs-pane .zs-chframe { height: 100%; min-height: 0; }
  .zs-pane .zs-chframe__body { overflow: hidden; }
  /* Fallback scroll surface for every non-chat detail page. Some settings and profile screens render
     async wrappers or custom cards that do not own a scroll region; keep their content reachable. */
  .zs-pane--detail .zs-chframe__body { overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
  .zs-pane--detail .zs-chframe__body.is-static { overflow: hidden; }
  .zs-pane--detail .zs-chframe__body > .zs-chat-frame { display: flex; flex: 1 1 0%; min-height: 0; overflow: hidden; }
  .zs-pane .zs-chframe__body > .zs-wa-page, .zs-pane .zs-chframe__body > .zs-wa-x-contacts, .zs-pane .zs-chframe__body > .zs-chat-screen--starred, .zs-pane .zs-chframe__body > .zs-chat-screen--media, .zs-pane .zs-chframe__body > .zs-tg-x-page,
  .zs-pane .zs-chframe__body > .zs-chat-info, .zs-pane .zs-chframe__body > .zs-chat-settings { box-sizing: border-box; flex: 1 1 0%; height: 100%; min-height: 0; max-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; }
  .zs-pane .zs-chframe__body > .zs-chat-screen--list, .zs-pane .zs-wa-x-inbox, .zs-pane .zs-tg-x-inbox { flex: 1; min-height: 0; }
  .zs-chhead { padding-top: 0; }
  .zs-chhead__bar, html[data-platform="ios"] .zs-chhead__bar { min-height: 60px; padding: 0 10px 0 16px; }
  .zs-chhead__title, html[data-platform="ios"] .zs-chhead__title { margin: 0; color: var(--ch-head-fg); font-size: 22px; line-height: 28px; font-weight: 700; text-align: left; letter-spacing: -.01em; }
  .zs-chhead__back + .zs-chhead__title, html[data-platform="ios"] .zs-chhead__back + .zs-chhead__title { margin-left: 6px; font-size: 17px; font-weight: 600; }
  .zs-chframe--wa .zs-chhead, html[data-platform="ios"] .zs-chframe--wa .zs-chhead { background: var(--zs-wa-bg); color: var(--zs-wa-text); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .zs-chframe--tg .zs-chhead, html[data-platform="ios"] .zs-chframe--tg .zs-chhead { background: var(--zs-tg-bg); color: var(--zs-tg-text); box-shadow: 0 1px 0 var(--zs-tg-divider); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .zs-chframe--wa .zs-chhead__btn, .zs-chframe--wa .zs-chhead__back { color: var(--zs-wa-icon); }
  .zs-chframe--wa .zs-chhead__title { color: var(--zs-wa-text); }
  .zs-chframe--tg .zs-chhead__btn, .zs-chframe--tg .zs-chhead__back { color: var(--zs-tg-icon); }
  .zs-chframe--tg .zs-chhead__title { color: var(--zs-tg-text); }
  .zs-chhead--large .zs-chhead__large { display: none; }
  .zs-wa-x-chatscreen, .zs-tg-x-chatscreen { height: 100%; }
  /* Fill the full conversation pane on desktop for Telegram, WhatsApp and the social inboxes. */
  .zs-pane .zs-chat-thread { width: 100%; max-width: none; height: 100%; margin: 0; border-radius: 0; box-shadow: none; }
}

/* Empty conversation pane: WhatsApp Web / Telegram Web intro panel */
.zs-chintro { --zs-chintro-device: var(--zs-wa-bg); --zs-chintro-screen: var(--zs-wa-header-web); --zs-chintro-line: var(--zs-wa-divider);
  display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100%; padding: 40px 32px; background: var(--zs-wa-header-web); color: var(--zs-wa-text-2); text-align: center;
  border-bottom: 6px solid var(--zs-wa-accent); box-sizing: border-box; }
.zs-chintro__art { width: min(320px, 72%); margin-bottom: 18px; }
.zs-chintro__art svg { display: block; width: 100%; height: auto; }

/* WhatsApp inbox: keep the search and filter controls in the fixed header area while only chat rows scroll. */
.zs-wa-inbox-screen { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.zs-wa-inbox-screen > .zs-chframe--wa.zs-chframe--list { display: flex; height: 100%; min-height: 0; overflow: hidden; }
.zs-wa-inbox-screen .zs-chframe__body,
.zs-wa-inbox-screen .zs-wa-x-inbox,
.zs-wa-inbox-screen .zs-chat-screen--list,
.zs-wa-inbox-screen .zs-chat-list { min-width: 0; min-height: 0; overflow: hidden; }
.zs-wa-inbox-screen .zs-chframe__body,
.zs-wa-inbox-screen .zs-wa-x-inbox,
.zs-wa-inbox-screen .zs-chat-screen--list,
.zs-wa-inbox-screen .zs-chat-list { display: flex; flex: 1 1 0%; flex-direction: column; }
.zs-wa-inbox-screen .zs-chat-list__rows { flex: 1 1 0%; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px), (max-height: 559px) {
  #zs-app[data-layout="channel"]:has(> .zs-view > .zs-wa-inbox-screen) { height: 100dvh; min-height: 0; overflow: hidden; }
  #zs-app[data-layout="channel"]:has(> .zs-view > .zs-wa-inbox-screen) > .zs-view { display: flex; min-height: 0; overflow: hidden; flex-direction: column; }
  #zs-app[data-layout="channel"]:has(> .zs-view > .zs-wa-inbox-screen) > .zs-view > .zs-wa-inbox-screen { flex: 1 1 0%; height: 100%; }
  .zs-wa-inbox-screen > .zs-chframe--wa.zs-chframe--list { flex: 1 1 0%; height: 100%; min-height: 0; }
}
.zs-chintro__title { margin: 0; color: var(--zs-wa-text); font-size: 30px; line-height: 38px; font-weight: 300; letter-spacing: -.01em; }
.zs-chintro__text { max-width: 460px; margin: 0; font-size: 14px; line-height: 20px; }
.zs-chintro__foot { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 0; font-size: 13px; opacity: .85; }
.zs-chintro--tg { --zs-chintro-device: var(--zs-tg-bg); --zs-chintro-screen: var(--zs-tg-bg-2); --zs-chintro-line: var(--zs-tg-divider);
  background-color: var(--zs-tg-chat-bg); background-image: var(--zs-tg-pattern); background-size: 420px; color: var(--zs-tg-text-2); border-bottom: 0; }
.zs-chintro--tg .zs-chintro__title { display: inline-block; padding: 6px 16px; border-radius: 18px; background: var(--zs-tg-date-bg); color: var(--zs-tg-date-text); font-size: 15px; line-height: 22px; font-weight: 600; }
.zs-chintro--tg .zs-chintro__text, .zs-chintro--tg .zs-chintro__foot { padding: 6px 14px; border-radius: 14px; background: var(--zs-tg-date-bg); color: var(--zs-tg-date-text); }

/* WhatsApp Updates */
.zs-wa-updates { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 24px; }
.zs-wa-updates__sec { padding: 4px 0 10px; border-bottom: 1px solid var(--zs-wa-divider); }
.zs-wa-updates__h { margin: 8px 16px 10px; color: var(--zs-wa-text); font-size: 20px; line-height: 26px; font-weight: 700; }
.zs-wa-updates__mine { display: flex; align-items: center; gap: 14px; padding: 8px 16px; color: inherit; text-decoration: none; }
.zs-wa-updates__mine:hover { background: color-mix(in srgb, var(--zs-wa-text) 5%, transparent); }
.zs-wa-updates__ring { position: relative; flex: none; }
.zs-wa-updates__plus { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--zs-wa-green-strong); color: var(--zs-wa-on-fab); box-shadow: 0 0 0 2px var(--zs-wa-bg); }
.zs-wa-updates__body { display: grid; gap: 2px; min-width: 0; }
.zs-wa-updates__body b { color: var(--zs-wa-text); font-size: 16px; font-weight: 600; }
.zs-wa-updates__body small { color: var(--zs-wa-text-2); font-size: 13.5px; }
.zs-wa-updates .zs-wa-hint { margin: 0 16px 8px; }

/* Beginner setup guides (js/chat/guide.js, UI-CHANGES §I): numbered one-action steps, mock screenshots, copy rows */
.zs-guide { --zs-guide-accent: var(--zs-accent); --zs-guide-screen: var(--zs-surface); --zs-guide-card: var(--zs-fill, rgba(120,120,128,.12)); --zs-guide-line: var(--zs-hairline);
  --zs-guide-text: var(--zs-text); --zs-guide-muted: var(--zs-text-secondary); --zs-guide-hl: #FF9F0A;
  display: grid; gap: 16px; margin: 20px 0 8px; padding: 20px; border: 1px solid var(--zs-hairline); border-radius: 20px; background: var(--zs-surface); color: var(--zs-text); box-shadow: var(--zs-shadow-sm); }
.zs-guide--whatsapp { --zs-guide-accent: var(--zs-wa-green-strong, #00A884); }
.zs-guide--telegram { --zs-guide-accent: var(--zs-tg-accent, #3390EC); }
.zs-guide h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 650; }
.zs-guide__head { display: grid; gap: 8px; }
.zs-guide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.zs-guide__badge { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--zs-guide-accent) 14%, transparent); color: var(--zs-guide-accent); font-size: 12px; font-weight: 700; }
.zs-guide__time { display: inline-flex; align-items: center; gap: 5px; color: var(--zs-text-secondary); font-size: 13px; font-weight: 600; }
.zs-guide__title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 750; letter-spacing: -.015em; }
.zs-guide__intro { margin: 0; color: var(--zs-text-secondary); font-size: 15px; line-height: 22px; }
.zs-guide__progress { display: grid; gap: 6px; margin-top: 4px; }
.zs-guide__stepof { font-size: 13px; font-weight: 700; color: var(--zs-guide-accent); }
.zs-guide__bar { height: 6px; overflow: hidden; border-radius: 3px; background: var(--zs-guide-card); }
.zs-guide__bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--zs-guide-accent); transition: width 320ms var(--zs-ease-standard, ease); }
.zs-guide__before { padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--zs-guide-accent) 8%, var(--zs-surface)); }
.zs-guide__before ul { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.zs-guide__before li { display: flex; gap: 8px; font-size: 14.5px; line-height: 21px; }
.zs-guide__before li .zi { flex: none; margin-top: 1px; color: var(--zs-guide-accent); }
.zs-guide__steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.zs-guide__step { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
.zs-guide__step + .zs-guide__step { border-top: 1px solid var(--zs-hairline); }
.zs-guide__step::before { content: ""; position: absolute; top: 54px; bottom: -14px; left: 17px; width: 2px; background: var(--zs-hairline); }
.zs-guide__step:last-child::before { display: none; }
.zs-guide__num { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--zs-hairline); background: var(--zs-surface); color: var(--zs-text-secondary); font-size: 15px; transition: background-color 200ms, border-color 200ms, color 200ms; }
.zs-guide__num .zi { display: none; }
.zs-guide__step.is-current .zs-guide__num { border-color: var(--zs-guide-accent); color: var(--zs-guide-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--zs-guide-accent) 16%, transparent); }
.zs-guide__step.is-done .zs-guide__num { border-color: var(--zs-guide-accent); background: var(--zs-guide-accent); color: #fff; }
.zs-guide__step.is-done .zs-guide__num b { display: none; }
.zs-guide__step.is-done .zs-guide__num .zi { display: block; }
.zs-guide__stepbody { display: grid; gap: 10px; min-width: 0; }
.zs-guide__steptitle { padding-top: 6px; font-size: 16.5px !important; line-height: 23px !important; }
.zs-guide__step.is-done .zs-guide__steptitle { color: var(--zs-text-secondary); }
.zs-guide__text { margin: 0; color: var(--zs-text); font-size: 15px; line-height: 22px; }
.zs-guide__why { border-radius: 12px; background: var(--zs-guide-card); }
.zs-guide__why summary { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; color: var(--zs-guide-accent); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.zs-guide__why summary::-webkit-details-marker { display: none; }
.zs-guide__why p { margin: 0; padding: 0 12px 12px; color: var(--zs-text-secondary); font-size: 14px; line-height: 21px; }
.zs-guide__mock { max-width: 360px; margin: 0; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--zs-guide-accent) 6%, var(--zs-bg)); }
.zs-guide__mock svg { display: block; width: 100%; height: auto; }
.zs-guide__mock figcaption { margin-top: 6px; color: var(--zs-text-secondary); font-size: 12px; }
.zs-guide__copyrow { display: grid; gap: 5px; }
.zs-guide__copylabel { color: var(--zs-text-secondary); font-size: 12.5px; font-weight: 650; }
.zs-guide__copybox { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 4px 4px 12px; border: 1px solid var(--zs-hairline); border-radius: 12px; background: var(--zs-bg); }
.zs-guide__code { flex: 1; min-width: 0; overflow: hidden; font-family: var(--zs-font-mono, ui-monospace, monospace); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.zs-guide__copy { display: inline-flex; flex: none; align-items: center; gap: 5px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--zs-guide-accent); color: #fff; font-size: 13.5px; font-weight: 700; }
.zs-guide__copy.is-done { background: var(--zs-success, #1F9D55); }
.zs-guide__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.zs-guide__link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 1px solid var(--zs-hairline); border-radius: 999px; background: var(--zs-surface); color: var(--zs-text); font-size: 14.5px; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform 120ms, background-color 160ms; }
.zs-guide__link:hover { background: var(--zs-overlay-hover, rgba(0,0,0,.04)); }
.zs-guide__link:active { transform: scale(.97); }
.zs-guide__link.is-primary { border-color: transparent; background: var(--zs-guide-accent); color: #fff; }
.zs-guide__ext { opacity: .75; }
.zs-guide__check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; color: var(--zs-text-secondary); font-size: 14px; font-weight: 650; }
.zs-guide__check .zi { width: 18px; height: 18px; padding: 1px; border: 2px solid currentColor; border-radius: 50%; }
.zs-guide__check[aria-pressed="true"] { color: var(--zs-guide-accent); }
.zs-guide__check[aria-pressed="true"] .zi { background: var(--zs-guide-accent); border-color: var(--zs-guide-accent); color: #fff; }
.zs-guide__warn { display: flex; gap: 7px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--zs-warning-soft, rgba(255,159,10,.14)); color: var(--zs-text); font-size: 14px; line-height: 20px; }
.zs-guide__warn .zi { flex: none; margin-top: 2px; color: var(--zs-warning, #B25E00); }
.zs-guide__after { margin: 0; color: var(--zs-text-secondary); }
.zs-guide__more, .zs-guide__faq { display: grid; gap: 8px; }
.zs-guide__linkgrid { display: grid; gap: 8px; }
.zs-guide__link--row { justify-content: flex-start; border-radius: 14px; }
.zs-guide__link--row span { flex: 1; text-align: left; }
.zs-guide__qa, .zs-guide__glossary { border: 1px solid var(--zs-hairline); border-radius: 14px; background: var(--zs-surface); }
.zs-guide__qa summary, .zs-guide__glossary summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; font-size: 15px; font-weight: 650; cursor: pointer; list-style: none; }
.zs-guide__qa summary span, .zs-guide__glossary summary span { flex: 1; }
.zs-guide__qa summary::-webkit-details-marker, .zs-guide__glossary summary::-webkit-details-marker { display: none; }
.zs-guide__qa summary .zi:last-child, .zs-guide__glossary summary .zi:last-child { transition: transform 200ms; color: var(--zs-text-secondary); }
.zs-guide__qa[open] summary .zi:last-child, .zs-guide__glossary[open] summary .zi:last-child { transform: rotate(180deg); }
.zs-guide__qa > p, .zs-guide__qa > ol { margin: 0; padding: 0 14px 14px; color: var(--zs-text-secondary); font-size: 14.5px; line-height: 22px; }
.zs-guide__mini { display: grid; gap: 8px; padding-left: 34px !important; }
.zs-guide__mini li { color: var(--zs-text); }
.zs-guide__glossary dl { display: grid; gap: 10px; margin: 0; padding: 0 14px 14px; }
.zs-guide__glossary dt { font-weight: 700; font-size: 14.5px; }
.zs-guide__glossary dd { margin: -6px 0 0; color: var(--zs-text-secondary); font-size: 14px; line-height: 21px; }
.zs-guide__help { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--zs-guide-accent) 8%, var(--zs-surface)); }
.zs-guide__help > div { display: grid; gap: 2px; }
.zs-guide__help span { color: var(--zs-text-secondary); font-size: 14px; }
.zs-wa-guidehost { display: grid; gap: 8px; }
@media (max-width: 767px) {
  .zs-guide { margin-inline: 0; padding: 16px; border-radius: 18px; }
  .zs-guide__step { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .zs-guide__num { width: 32px; height: 32px; }
  .zs-guide__step::before { left: 15px; top: 50px; }
  .zs-guide__actions > * { flex: 1 1 auto; }
}
@media (min-width: 768px) { .zs-guide__linkgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .zs-guide__bar > span, .zs-guide__num { transition: none; } }

/* Hidden reply controls must not reserve a blank strip above the composer. */
#zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) .zs-chat-replybar[hidden],
#zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) .zs-chat-qr[hidden] { display: none; }

/* Phone composer: one channel canvas and one safe-area inset. */
@media (max-width: 767px) {
  #zs-app .zs-chat-frame[data-channel="wa"] { --zs-chat-footer-bg: var(--zs-wa-chat-bg); }
  #zs-app .zs-chat-frame[data-channel="tg"] { --zs-chat-footer-bg: var(--zs-tg-chat-bg); }
  html[data-platform] #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) > .zs-chat-composer-wrap {
    background: var(--zs-chat-footer-bg) !important;
    border-top: 0;
    box-shadow: none;
    padding-bottom: var(--zs-kb-safe-bottom, var(--zs-safe-bottom, 0px));
  }
  html[data-platform] #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) .zs-chat-composer-host,
  html[data-platform] #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) :is(.zs-wa-composer, .zs-tg-composer) {
    background: transparent !important;
    border-top: 0;
    box-shadow: none;
  }
  html[data-platform] #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) :is(.zs-wa-composer, .zs-tg-composer) { padding-bottom: 6px; }
  html.is-kb-open #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) > .zs-chat-composer-wrap { padding-bottom: 0; }
}

/* Keep exposed iOS chat shell and home-indicator canvas on the channel surface. */
@media (max-width: 767px) {
  html.is-channel-thread[data-channel="wa"] { --zs-thread-edge: var(--zs-wa-chat-bg); }
  html.is-channel-thread[data-channel="tg"] { --zs-thread-edge: var(--zs-tg-chat-bg); }
  html.is-channel-thread[data-channel="wa"],
  html.is-channel-thread[data-channel="tg"],
  html.is-channel-thread:is([data-channel="wa"], [data-channel="tg"]) body,
  html.is-channel-thread:is([data-channel="wa"], [data-channel="tg"]) #zs-app { background: var(--zs-thread-edge); }
}

/* iOS conversations: controls meet the visible chat bottom without an app spacer. */
@media (max-width: 767px) {
  html[data-platform="ios"] #zs-app .zs-chat-frame:is([data-channel="wa"], [data-channel="tg"]) :is(.zs-chat-composer-wrap, .zs-chat-composer-host, .zs-wa-composer, .zs-tg-composer) {
    padding-bottom: 0;
    margin-bottom: 0;
  }
}
@media (max-width: 767px) {
  html[data-platform="ios"] #zs-app .zs-chat-frame[data-channel="tg"] .zs-tg-composer__field { align-self: stretch; height: auto; }
}

/* Telegram contact profile: constrain the screen and scroll its body on mobile. */
@media(max-width:767px){
#zs-app .zs-screen[data-screen="tg.chat_info"]{height:100%;min-height:0;overflow:hidden}
#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-chframe{height:100%;min-height:0;overflow:hidden}
#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-chframe__body{min-height:0;overflow-y:auto;overscroll-behavior-y:contain}
#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-tg-x-page{flex:none;min-height:0;padding-bottom:max(16px,env(safe-area-inset-bottom));overflow:visible}
#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-chat-info{min-height:0;overflow:visible}
}

/* Desktop Telegram contact profile owns the full remaining pane height. */
@media(min-width:768px){#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-tg-x-page{padding-bottom:0;overflow:hidden}#zs-app .zs-screen[data-screen="tg.chat_info"] .zs-chat-info{box-sizing:border-box;flex:1;min-height:0;height:auto;padding-bottom:0;overflow-y:auto}}

/* Opaque backing for Telegram's gradient canvas on iOS conversation views. */
@media(max-width:767px){
html[data-platform="ios"][data-channel="tg"]:has(.zs-chat-frame[data-channel="tg"]){--zs-tg-canvas:#8bbfc9;background-color:var(--zs-tg-canvas)}
html[data-platform="ios"][data-channel="tg"][data-theme="dark"]:has(.zs-chat-frame[data-channel="tg"]){--zs-tg-canvas:#0e1621}
html[data-platform="ios"][data-channel="tg"]:has(.zs-chat-frame[data-channel="tg"]) :is(body,#zs-app,.zs-chat-frame[data-channel="tg"],.zs-chat-composer-wrap){background-color:var(--zs-tg-canvas)!important}
}

/* Contacts lists only: constrain the flex chain so the list owns scrolling.
   Does not affect conversations, composers, channel inboxes or financial pages. */
#zs-app:has(.zs-chat-contacts){height:100dvh!important;min-height:0!important}
.zs-app:has(.zs-chat-contacts)>.zs-view{min-height:0}
.zs-screen:has(.zs-chat-contacts){height:100%;min-height:0;overflow:hidden}
.zs-chframe:has(.zs-chat-contacts){height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.zs-chframe:has(.zs-chat-contacts)>.zs-chframe__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.zs-wa-x-contacts,.zs-tg-x-contacts{flex:1;min-height:0!important;height:auto!important;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;padding:8px 12px!important}
.zs-wa-x-contacts__intro,.zs-tg-x-contacts>.zs-list{flex-shrink:0}
.zs-wa-x-contacts__list,.zs-tg-x-contacts>.zs-tg-x-listhost{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.zs-wa-x-contacts .zs-chat-contacts,.zs-tg-x-contacts .zs-chat-contacts{flex:1;min-height:0;overflow:hidden}
.zs-chat-contacts__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
.zs-chat-contacts__pager{flex-shrink:0}
@media(max-width:767px){.zs-wa-x-contacts,.zs-tg-x-contacts{padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right))!important}}

/* Keyboard geometry belongs to visualViewport, never CSS easing. */
@media (max-width: 767px) {
  html[data-platform="ios"] #zs-app .zs-chat-frame,
  html[data-platform="ios"] #zs-app .zs-chat-frame :is(.zs-chat-composer-wrap, .zs-chat-composer-host, .zs-wa-composer, .zs-tg-composer, .zs-chat-composer__input) {
    transition: none !important;
    animation: none !important;
  }
  html[data-platform="ios"].is-chat-locked,
  html[data-platform="ios"].is-chat-locked body,
  html[data-platform="ios"] #zs-app .zs-chat-thread__scroll {
    scroll-behavior: auto !important;
  }
  html[data-platform="ios"] #zs-app .zs-chat-frame textarea[data-slot="input"] {
    font-size: max(16px, 1em);
  }
}


/* Keep setup/help content above the floating mobile menu, including viewport settlement. */
@media (max-width:767px), (max-height:559px) {
 #zs-app.has-tabbar > .zs-view:has(.zs-guide) {
  padding-bottom:calc(var(--zs-tabbar-h,64px) + max(12px,calc(var(--zs-safe-bottom,0px) - 12px)) + var(--zs-vv-bottom-gap,0px) + 32px);
  scroll-padding-bottom:calc(var(--zs-tabbar-h,64px) + max(12px,calc(var(--zs-safe-bottom,0px) - 12px)) + var(--zs-vv-bottom-gap,0px) + 32px);
 }
}
/* Pinned chats: a small pin mark on the row; pressing and holding a chat opens its menu instead of selecting text. */
.has-pinmark{position:relative}
.zs-chat-row__pinmark{position:absolute;left:3px;top:5px;display:inline-flex;width:13px;height:13px;color:var(--zs-text-tertiary,#8a93a3);pointer-events:none}
.zs-chat-row__pinmark svg{width:13px;height:13px}
@media(hover:none){.zs-chat-swipe__surface{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}}

/* ── Select and delete several messages (WhatsApp and Telegram) ─────────────────────────────────────────────── */
.zs-chat-select { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; gap: 10px; box-sizing: border-box; padding: 0 12px; padding-top: env(safe-area-inset-top, 0px); color: #fff; background: linear-gradient(100deg, #b12bf2 0%, #6a4dff 52%, #19b6ff 100%); animation: zs-chat-select-in .22s ease both; }
.zs-chat-select[hidden] { display: none !important; }
html .zs-chat-select button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px; color: #fff !important; background: rgba(255, 255, 255, .16) !important; cursor: pointer; transition: background .15s ease, transform .15s ease, opacity .15s ease; }
html .zs-chat-select button:hover { background: rgba(255, 255, 255, .26) !important; }
html .zs-chat-select button:active { transform: scale(.96); }
html .zs-chat-select button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html .zs-chat-select .zs-chat-select__close { width: 38px; padding: 0; font-size: 16px; }
.zs-chat-select__count { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
html .zs-chat-select .zs-chat-select__delete { color: #c21f3a !important; background: #fff !important; }
html .zs-chat-select .zs-chat-select__delete:hover { background: #ffe9ed !important; }
html .zs-chat-select .zs-chat-select__delete:disabled { opacity: .5; cursor: default; }
@keyframes zs-chat-select-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.zs-chat-selmark { display: none; }
.zs-chat-thread.is-selecting .zs-chat-thread__messages [data-msg-id] { cursor: pointer; -webkit-user-select: none; user-select: none; }
.zs-chat-thread.is-selecting .zs-chat-msg__more { display: none !important; }
.zs-chat-thread.is-selecting .zs-chat-selmark { position: absolute; z-index: 5; top: -7px; display: grid; width: 22px; height: 22px; place-items: center; box-sizing: border-box; border: 2px solid #8a7bff; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: background .15s ease, transform .15s ease; }
.zs-chat-thread.is-selecting .is-in > .zs-chat-selmark { right: -7px; }
.zs-chat-thread.is-selecting .is-out > .zs-chat-selmark { left: -7px; }
.zs-chat-thread.is-selecting .is-selected > .zs-chat-selmark { border-color: #6a4dff; background: #6a4dff; transform: scale(1.08); }
.zs-chat-thread.is-selecting .is-selected > .zs-chat-selmark::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
html .zs-chat-thread.is-selecting .zs-chat-thread__messages [data-msg-id].is-selected { outline: 2px solid #6a4dff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(106, 77, 255, .2); }
@media (prefers-reduced-motion: reduce) { .zs-chat-select { animation: none; } }

/* ============ One background colour per channel page (WhatsApp, Telegram, Facebook, Instagram, TikTok) ============
   The channel frame is a little shorter than the screen on phones, so the app's own (different) background showed as a
   second shade under the page, around the bottom menu. The frame now paints its own colour across the whole screen. */
@media (max-width: 768px) { html .zs-chframe::before { content: ""; position: fixed; inset: 0; z-index: -1; background: inherit; pointer-events: none; } }
/* WhatsApp pages: top bar, page and frame share one colour. */
html:has(.zs-chframe--wa), html:has(.zs-chframe--wa) body, html:has(.zs-chframe--wa) .zs-app, html:has(.zs-chframe--wa) .zs-view, html:has(.zs-chframe--wa) .zs-screen { background-color: var(--zs-wa-bg, var(--zs-bg)) !important; background-image: none !important; }
html .zs-chframe--wa, html .zs-chframe--wa > .zs-chframe__body, html .zs-chframe--wa .zs-chhead, html[data-platform="ios"] .zs-chframe--wa .zs-chhead { background: var(--zs-wa-bg, var(--zs-bg)) !important; background-image: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html .zs-chframe--wa .zs-wa-page, html .zs-chframe--wa .zs-wa-x-contacts, html .zs-chframe--wa .zs-ai-sender { background: transparent !important; }
/* Telegram pages: the app background behind the frame takes the page's colour. */
html:has(.zs-chframe--tg), html:has(.zs-chframe--tg) body, html:has(.zs-chframe--tg) .zs-app, html:has(.zs-chframe--tg) .zs-view, html:has(.zs-chframe--tg) .zs-screen { background-color: var(--zs-tg-bg, var(--zs-bg)) !important; background-image: none !important; }
html:has(.zs-chframe--tg > .zs-chframe__body > .zs-tg-x-page), html:has(.zs-chframe--tg > .zs-chframe__body > .zs-tg-x-page) body, html:has(.zs-chframe--tg > .zs-chframe__body > .zs-tg-x-page) .zs-app, html:has(.zs-chframe--tg > .zs-chframe__body > .zs-tg-x-page) .zs-view, html:has(.zs-chframe--tg > .zs-chframe__body > .zs-tg-x-page) .zs-screen { background-color: var(--zs-tg-bg-2, var(--zs-bg)) !important; }

/* ============ WhatsApp & Telegram contacts · 2026-11 redesign (zs-contacts2) ============ */
html .zs-contacts2 { box-sizing: border-box; animation: zs-contacts2-rise .45s cubic-bezier(.2, .8, .2, 1) both !important; }
html .zs-contacts2 > .zs-contact-total { display: none !important; }
/* Summary card */
html .zs-contacts2__hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 16px 18px; border: 1.5px solid transparent; border-radius: 22px; background: linear-gradient(var(--zs-surface, #111b21), var(--zs-surface, #111b21)) padding-box, linear-gradient(120deg, #b12bf2 0%, #6a4dff 52%, #19b6ff 100%) border-box; box-shadow: 0 22px 50px -36px rgba(106, 77, 255, .85); }
html .zs-contacts2__hero::before { content: ""; position: absolute; z-index: -1; top: -100px; right: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(177, 43, 242, .22), transparent 68%); pointer-events: none; animation: zs-contacts2-float 10s ease-in-out infinite !important; }
html .zs-contacts2__icon { display: grid; width: 50px; height: 50px; flex: none; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #b12bf2, #6a4dff 55%, #19b6ff); box-shadow: 0 12px 26px -14px rgba(106, 77, 255, .95); }
html .zs-contacts2__herotext { display: grid; gap: 1px; min-width: 0; }
html .zs-contacts2__label { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--zs-accent-text, #a594ff); }
html .zs-contacts2__count { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--zs-text, #e9edef); font-variant-numeric: tabular-nums; }
html .zs-contacts2__herotext small { font-size: 13px; line-height: 1.45; color: var(--zs-text-secondary, #8696a0); }
/* Search row */
html .zs-contacts2 .zs-contact-search-row { gap: 10px; margin: 0 0 10px; }
html .zs-contacts2 .zs-contact-search-row .zs-chat-search { min-height: 46px; padding: 0 14px; border: 1px solid var(--zs-border, rgba(134, 150, 160, .25)); border-radius: 999px; background: var(--zs-surface-2, rgba(134, 150, 160, .12)); box-sizing: border-box; display: flex; align-items: center; gap: 8px; }
html .zs-contacts2 .zs-contact-search-row .zs-chat-search input { border: 0; background: none; box-shadow: none; outline: none; min-height: 44px; font-size: 15px; color: inherit; }
html .zs-contacts2 .zs-contact-inline-total { display: none; }
html body .zs-contacts2 .zs-contact-search-row > .zs-btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--zs-border, rgba(134, 150, 160, .25)) !important; border-radius: 999px; color: var(--zs-text, #e9edef) !important; background: var(--zs-surface-2, rgba(134, 150, 160, .12)) !important; font-weight: 700; font-size: 14px; }
/* Selection bar */
html .zs-contacts2 .zs-contact-tools { margin: 0 0 10px; padding: 8px 8px 8px 16px; border-radius: 999px; color: #fff; background: linear-gradient(100deg, #b12bf2 0%, #6a4dff 52%, #19b6ff 100%); box-shadow: 0 14px 30px -18px rgba(106, 77, 255, .95); }
html .zs-contacts2 .zs-contact-selection-count { color: #fff; font-weight: 750; font-size: 14px; }
html body .zs-contacts2 .zs-contact-tools .zs-btn { min-height: 38px; border: 0 !important; border-radius: 999px; color: #fff !important; background: rgba(255, 255, 255, .18) !important; font-weight: 700; }
html body .zs-contacts2 .zs-contact-tools .zs-btn:last-child { color: #c21f3a !important; background: #fff !important; }
/* Contact list */
html .zs-contacts2 .zs-chat-contacts__list { display: grid; gap: 8px; }
html .zs-contacts2 .zs-chat-contact-entry { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 4px; border: 1px solid var(--zs-border, rgba(134, 150, 160, .2)); border-radius: 18px; background: var(--zs-surface-2, rgba(134, 150, 160, .08)); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; animation: zs-contacts2-rise .35s cubic-bezier(.2, .8, .2, 1) both !important; }
html .zs-contacts2 .zs-chat-contact-entry:hover { transform: translateY(-1px); border-color: rgba(124, 92, 255, .55); box-shadow: 0 16px 30px -24px rgba(106, 77, 255, .9); }
html .zs-contacts2 .zs-chat-contact-entry:has(input:checked) { border-color: #7c5cff; background: linear-gradient(120deg, rgba(177, 43, 242, .12), rgba(25, 182, 255, .08)), var(--zs-surface-2, rgba(134, 150, 160, .08)); }
html .zs-contacts2 .zs-contact-select { flex: 0 0 40px; min-height: 44px; }
html .zs-contacts2 .zs-contact-select input { width: 20px; height: 20px; accent-color: #6a4dff; border-radius: 6px; cursor: pointer; }
html .zs-contacts2 .zs-chat-contact-row { display: flex; align-items: center; gap: 12px; padding: 6px 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 0; border-bottom: 0 !important; }
html .zs-contacts2 .zs-chat-contact-row .zs-avatar { flex: none; }
html .zs-contacts2 .zs-chat-contact-row__body { display: grid; gap: 1px; min-width: 0; }
html .zs-contacts2 .zs-chat-contact-row__body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; font-weight: 700; color: var(--zs-text, #e9edef); }
html .zs-contacts2 .zs-chat-contact-row__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--zs-text-secondary, #8696a0); font-variant-numeric: tabular-nums; }
html .zs-contacts2 .zs-chat-contact-row__badge { flex: none; margin-left: auto; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--zs-danger, #f15c6d); background: rgba(229, 72, 77, .14); }
html body .zs-contacts2 .zs-chat-contact-remove { flex: none; min-height: 38px; padding: 0 12px; border: 1px solid transparent !important; border-radius: 999px; color: var(--zs-text-secondary, #8696a0) !important; background: transparent !important; font-size: 13px; font-weight: 650; transition: color .15s ease, background .15s ease, border-color .15s ease; }
html body .zs-contacts2 .zs-chat-contact-remove:hover { color: var(--zs-danger, #f15c6d) !important; border-color: rgba(229, 72, 77, .4) !important; background: rgba(229, 72, 77, .1) !important; }
/* Pager */
html .zs-contacts2 .zs-chat-contacts__pager { margin-top: 16px; }
html body .zs-contacts2 .zs-chat-contacts__pager .zs-btn, html body .zs-contacts2 .zs-chat-contacts__pager button { border-radius: 999px; }
@keyframes zs-contacts2-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes zs-contacts2-float { 50% { transform: translate(-14px, 18px) scale(1.06); } }
/* Phones: one compact line per contact; Remove becomes an icon button. */
@media (max-width: 640px) {
  html .zs-contacts2__hero { padding: 14px; border-radius: 19px; gap: 12px; }
  html .zs-contacts2__icon { width: 44px; height: 44px; border-radius: 14px; }
  html .zs-contacts2__count { font-size: 22px; }
  html .zs-contacts2__herotext small { font-size: 12.5px; }
  html body .zs-contacts2 .zs-contact-search-row > .zs-btn { padding: 0 14px; font-size: 13px; }
  html .zs-contacts2 .zs-chat-contact-entry { padding: 4px 6px 4px 2px; border-radius: 16px; }
  html .zs-contacts2 .zs-contact-select { flex-basis: 36px; }
  html .zs-contacts2 .zs-chat-contact-row { gap: 10px; }
  html .zs-contacts2 .zs-chat-contact-row__body strong { font-size: 15px; }
  html body .zs-contacts2 .zs-chat-contact-remove { width: 40px; padding: 0; justify-content: center; }
  html body .zs-contacts2 .zs-chat-contact-remove .zs-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { html .zs-contacts2, html .zs-contacts2 .zs-chat-contact-entry, html .zs-contacts2__hero::before { animation: none !important; } }
