/* chat.css · P26, Zibaldone chat: the layout of the chat on the design
   system's tokens. The components are the design system's (conversation,
   message, message box, inbox row, reaction, emoji picker, menu, dialog,
   palette, side panel); this file places them and draws the parts a chat has
   that the design system does not: the rows of a conversation with their
   gutter, the day and New dividers, the hover tools, the thread line, the
   voice bars and the safety digits. Every value is a token. */

.zc { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--paper); }

/* ── the conversation list ── */
.zc-nav { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ground); box-shadow: inset calc(-1 * var(--px)) 0 0 var(--line-2); }
.zc-ws { display: flex; align-items: center; gap: 8px; flex: none; height: 44px; padding: 0 8px 0 14px; }
.zc-ws-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; border-radius: var(--r-key); background: var(--brand, var(--ink)); color: var(--on-solid); }
.zc-ws-mark > svg { width: var(--icon-12); height: var(--icon-12); }
.zc-ws-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-550); color: var(--ink); }
.zc-find { flex: none; padding: 2px 12px 8px; }
.zc-find > [data-r="field"] { width: 100%; }
.zc-filters { flex: none; padding: 0 12px 10px; }
.zc-scroll { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--a20) transparent; padding-bottom: 12px; }
.zc-views { display: flex; flex-direction: column; gap: 1px; padding: 0 8px 10px; }
.zc-views > [data-r="sidebar-item"] { width: 100%; text-align: left; }
.zc-convs { display: flex; flex-direction: column; outline: none; }
.zc-convs:focus-visible [data-r="inbox-row"][aria-selected="true"] { outline: 1px solid var(--accent); outline-offset: -1px; }
.zc-group { display: flex; flex-direction: column; }
.zc-group + .zc-group { margin-top: 6px; }
.zc-group-head { margin: 0 12px 0 18px; }
.zc-group-head > [data-r="button"] { margin-left: -6px; }
.zc-small.zc-none { padding: 2px 18px 6px; }
.zc-face { grid-column: 2; display: inline-flex; }
[data-r="inbox-row"]:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.zc-t { overflow: hidden; text-overflow: ellipsis; }
.zc-title-row { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: top; }
.zc-mark { display: inline-flex; flex: none; color: var(--ink-3); }
.zc-mark > svg { width: var(--icon-12); height: var(--icon-12); }
.zc-sum { display: flex; align-items: center; gap: 6px; min-width: 0; }
.zc-prev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-draft, .zc-typing-row { font-weight: var(--fw-500); color: var(--accent-ink); }
.zc-me { display: flex; align-items: center; gap: 4px; flex: none; min-height: 52px; padding: 6px 8px 6px 12px; box-shadow: inset 0 var(--px) 0 var(--line-2); }
.zc-me-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin-left: 4px; }
.zc-me-name { padding-left: 2px; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-550); color: var(--ink); }
.zc-me-status { max-width: 128px; margin-left: -4px; }
.zc-me-status > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-spacer { flex: 1; }
.zc-net { margin-right: 4px; }

/* ── the page: header, conversation and panel ── */
.zc-page { min-width: 0; }
.zc-page > [data-r="page-header"] [data-part="bar"] { gap: 6px; }
.zc-back { display: none; }
.zc-conv-icon { display: inline-flex; color: var(--ink-3); }
.zc-conv-icon > svg { width: var(--icon-14); height: var(--icon-14); }
.zc-page > [data-r="page-header"] [data-part="title"] { flex: none; max-width: 40%; }
.zc-topic { flex: 0 1 auto; min-width: 0; max-width: 40%; }
@container page (width < 600px) { .zc-topic { display: none; } }
@container page (width < 520px) { .zc-page .zc-wide-only { display: none; } }
.zc-topic > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-topic-edit { flex: 1; min-width: 0; max-width: 480px; }
.zc-topic-edit > [data-r="field"] { width: 100%; }
.zc-sub { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); white-space: nowrap; }
.zc-sub > svg { width: var(--icon-12); height: var(--icon-12); }
.zc-members-btn { gap: 6px; }
.zc-here-label { color: var(--success-ink, var(--ink-3)); font-weight: var(--fw-450); }

/* the conversation: one column of rows in the feed; the feed's own gap is for its two children */
.zc-banner:empty { display: none; }
.zc-banner { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.zc-log { display: flex; flex-direction: column; min-width: 0; }
[data-r="conversation"][data-drop] > [data-r="scroll-area"],
[data-part="side"][data-drop] > [data-r="scroll-area"] { box-shadow: inset 0 0 0 2px var(--accent); }
/* Jump to latest: a round button with the count of new messages, beside the column where there is room and over the box on a narrow screen, clear of the bubbles */
.zc-fab-wrap { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.zc-fab-wrap[hidden] { display: none; }
.zc-fab { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-round); background: var(--raised); color: var(--ink-2); box-shadow: 0 0 0 var(--px) var(--line-3), var(--e2); transition: background-color var(--state-out); }
.zc-fab > svg { width: var(--icon-16); height: var(--icon-16); }
.zc-fab:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.zc-fab > [data-r="count"] { position: absolute; top: -6px; right: -6px; }
@media (hover: hover) { .zc-fab:hover { background: var(--raised-hover); color: var(--ink); transition-duration: 0s; } }
@container (min-width: 900px) { .zc-fab-wrap { position: absolute; right: -52px; bottom: calc(var(--chat-foot) + 4px); margin: 0; } }
.zc-typing { min-height: var(--lh-12); margin: 6px 4px 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-typing:empty::before { content: "\00a0"; }

.zc-start { display: flex; flex-direction: column; gap: 4px; padding: 8px 0 20px; color: var(--ink-2); }
.zc-start > b { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); color: var(--ink); }
.zc-start-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 6px; border-radius: var(--r-row); background: var(--well); color: var(--ink-2); }
.zc-start-icon > svg { width: var(--icon-16); height: var(--icon-16); }
.zc-more { display: flex; justify-content: center; padding: 4px 0 12px; }

.zc-day { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; margin: 10px 0 0; padding: 6px 0; background: var(--plane); pointer-events: none; }
.zc-day > span { padding: 3px 10px; border-radius: var(--r-press); background: var(--paper); box-shadow: 0 0 0 var(--px) var(--line-2), var(--e1); font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-500); color: var(--ink-2); }
.zc-new { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--danger-ink); font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-500); }
.zc-new::before { content: ""; flex: 1; height: var(--px); background: var(--danger-dot); }
.zc-sys { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); text-align: center; }
.zc-sys > svg { width: var(--icon-12); height: var(--icon-12); flex: none; }
.zc-sys-warn { color: var(--warning-ink, var(--ink-2)); }

/* a message: the gutter (the avatar on the first of a group, the time on hover), the name and time, the design system's message */
.zc-row { --gut: 40px; position: relative; display: grid; grid-template-columns: var(--gut) minmax(0, 1fr); column-gap: 8px; margin: 0 -10px; padding: 2px 10px; border-radius: var(--r-row); outline: none; transition: background-color var(--state-out); }
.zc-row[data-first] { margin-top: 14px; }
.zc-row:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.zc-row[data-mentions-me] { background: var(--accent-tint); }
.zc-row[data-mentions-me]::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: var(--r-key); background: var(--accent); }
.zc-row[data-ring] { background: var(--label-yellow-bg); transition-duration: 0s; }
.zc-row[data-pending] [data-part="bubble"] { opacity: .72; }
.zc-gutter { display: flex; justify-content: center; align-items: flex-start; padding-top: 2px; }
.zc-body { display: flex; flex-direction: column; min-width: 0; }
.zc-row[data-from="me"] .zc-body { align-items: flex-end; }
.zc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-size: var(--fs-13); line-height: var(--lh-13); }
.zc-head > b { font-weight: var(--fw-550); color: var(--ink); }
.zc-head > time { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.zc-body > [data-r="message"] { align-self: stretch; min-width: 0; }
.zc-row[data-from="them"] [data-r="message"] > [data-part="bubble"] { align-self: flex-start; }
.zc-bubble > * + * { margin-top: 6px; }
.zc-bubble p { margin: 0; }
/* your own bubbles are Zibaldone's violet, a light step in light mode and a deep one in dark; the parts inside take the tint's plane */
.zc { --zc-own: var(--violet-100); --zc-own-well: var(--violet-150); --zc-own-line: var(--violet-300); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .zc { --zc-own: var(--violet-800); --zc-own-well: var(--violet-750); --zc-own-line: var(--violet-600); } }
:root[data-theme="dark"] .zc { --zc-own: var(--violet-800); --zc-own-well: var(--violet-750); --zc-own-line: var(--violet-600); }
.zc-row[data-from="me"] [data-r="message"] > [data-part="bubble"] { --plane-selected: var(--zc-own); --well: var(--zc-own-well); }
/* a tail on the first bubble of a group, on the sender's side */
.zc-row[data-first] [data-r="message"] > [data-part="bubble"] { position: relative; }
.zc-row[data-first] [data-r="message"] > [data-part="bubble"]::before { content: ""; position: absolute; top: 0; width: 20px; height: 12px; background: var(--plane-selected); pointer-events: none; }
.zc-row[data-first][data-from="them"] [data-r="message"] > [data-part="bubble"]::before { left: -7px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.zc-row[data-first][data-from="me"] [data-r="message"] > [data-part="bubble"]::before { right: -7px; clip-path: polygon(0 0, 100% 0, 0 100%); }
/* one to three emoji and nothing else, large and without a bubble */
.zc-jumbo { display: flex; flex-direction: column; align-items: flex-start; }
.zc-row[data-from="me"] .zc-jumbo { align-items: flex-end; }
.zc-jumbo-emoji { font-size: 24px; line-height: 32px; letter-spacing: 2px; } /* allow: type · a message of emoji only takes the largest size of the reading register */
/* a mention is a chip on the bubble's fill: the chip takes the raised plane, so it shows and the space after it reads as one space */

.zc-bubble em { font-style: italic; }
.zc-bubble :is(ul, ol) { margin: 0; padding-left: 20px; }
.zc-bubble blockquote { margin: 0; padding-left: 10px; box-shadow: inset 2px 0 0 var(--line-4); color: var(--ink-2); }
.zc-bubble code { padding: 1px 4px; border-radius: var(--r-key); background: var(--well); font-family: var(--font-mono); font-size: var(--fs-13); }
.zc-pre { margin: 0; padding: 8px 10px; font-family: var(--font-mono); border-radius: var(--r-row); background: var(--well); overflow-x: auto; white-space: pre; font-size: var(--fs-13); line-height: var(--lh-13); }
.zc-pre > code { padding: 0; background: transparent; }
.zc-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.zc-struck > :not(.zc-fwd):not([data-r="embed"]) { text-decoration: line-through; text-decoration-color: var(--danger-ink); }
.zc-gone { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.zc-gone > svg { width: var(--icon-14); height: var(--icon-14); }
.zc-fwd { display: flex; align-items: center; gap: 4px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-fwd > svg { width: var(--icon-12); height: var(--icon-12); }
.zc-fwd-text { color: var(--ink-2); }
.zc-quoted, .zc-work { margin: 0; align-items: flex-start; white-space: normal; }
.zc-quoted { box-shadow: inset 2px 0 0 var(--accent); }
.zc-work > svg { margin-top: 1px; }
/* a card: the title on its first line, what it is on the second */
.zc-card-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.zc-card-title { font-weight: var(--fw-500); color: var(--ink); overflow-wrap: anywhere; }
.zc-quoted .zc-card-title { color: var(--accent-ink); }
.zc-card-meta { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zc-quoted:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.zc-media { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-thumb { --w: 240px; padding: 0; border: 0; }
.zc-thumb[data-shape="tall"] { --w: 160px; }
.zc-thumb[data-shape="square"] { --w: 200px; }
.zc-media > [data-r="file"], .zc-doc > [data-r="file"] { min-width: 220px; max-width: 320px; text-decoration: none; }
.zc-media { margin-bottom: 4px; }
.zc-album { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 300px; max-width: 100%; }
.zc-album > [data-r="thumb"] { --w: 100%; }
.zc-album[data-count="3"] > :first-child { grid-column: 1 / -1; }
.zc-album-more { position: absolute; right: 6px; bottom: 6px; }
.zc-doc { display: flex; flex-direction: column; gap: 4px; width: 280px; max-width: 100%; }
.zc-doc > [data-r="file"] { min-width: 0; max-width: none; }
.zc-doc-page { display: block; height: 120px; overflow: hidden; border-radius: var(--r-row); background: var(--raised); box-shadow: 0 0 0 var(--px) var(--line-3); }
.zc-doc-page > img { display: block; width: 100%; height: auto; }
.zc-media [data-r="file"] > svg { width: var(--icon-14); height: var(--icon-14); color: var(--ink-3); }
.zc-voice { display: flex; align-items: center; gap: 8px; min-width: 240px; }
.zc-bars { display: flex; align-items: center; gap: 2px; height: 24px; }
.zc-bars > i { width: 3px; height: calc(var(--h, 20) * 1%); min-height: 3px; border-radius: var(--r-key); background: var(--ink-4); }
.zc-bars > i[data-on] { background: var(--ink); }
.zc-voice-mark { display: inline-flex; color: var(--ink-3); }
.zc-voice-mark > svg { width: var(--icon-14); height: var(--icon-14); }
.zc-voice-mark[data-played="true"] { color: var(--accent-ink); }
.zc-rec-lock { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.zc-rec-lock > svg, .zc-rec-hint > svg { width: var(--icon-12); height: var(--icon-12); vertical-align: -2px; }
.zc-rec-lock[data-near], .zc-rec-hint[data-near] { color: var(--accent-ink); }
.zc-record[data-state="hold"] { touch-action: none; }
.zc-dur { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.zc-reacts { display: flex; flex-wrap: wrap; gap: 4px; }
.zc-thread-btn { align-self: flex-start; }
.zc-row[data-from="me"] .zc-thread-btn { align-self: flex-end; }
.zc-thread-btn[data-fresh] .zc-thread-n { color: var(--accent-ink); }
.zc-thread-when { color: var(--ink-3); font-weight: var(--fw-450); }
.zc-in-thread { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-in-thread > svg { width: var(--icon-12); height: var(--icon-12); }
.zc-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.zc-note > span { display: inline-flex; align-items: center; gap: 4px; }
.zc-note svg { width: var(--icon-12); height: var(--icon-12); }
/* the time and the ticks are drawn inside the bubble, bottom right, as WhatsApp sets them */
.zc-stamp { float: right; position: relative; top: 5px; display: inline-flex; align-items: center; gap: 3px; margin: 0 -6px 0 12px; font-size: var(--fs-11); line-height: var(--lh-11); font-weight: var(--fw-450); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; text-decoration: none; }
.zc-stamp svg { width: var(--icon-12); height: var(--icon-12); }
.zc-stamp-row { display: flex; justify-content: flex-end; }
.zc-stamp-row > .zc-stamp { float: none; top: 0; margin: 2px -6px -2px 0; }
.zc-ticks { display: inline-flex; align-items: center; }
.zc-ticks > svg + svg { margin-left: -7px; }
.zc-ticks[data-receipt="read"] { color: var(--accent); }
.zc-stamp-mark { display: inline-flex; }
.zc-mention { color: var(--accent-ink); font-weight: var(--fw-550); }
.zc-dot { color: var(--ink-4); }

/* the tools over a message while the pointer or the focus is on it */
.zc-tools { position: absolute; top: -16px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: var(--r-row); background: var(--raised); box-shadow: 0 0 0 var(--px) var(--line-3), var(--e2); opacity: 0; pointer-events: none; transition: opacity var(--state-out); }
.zc-tools > [data-r="toolbar-separator"] { margin: 0 3px; }
.zc-row:is(:hover, :focus-within, [data-menu-open]) > .zc-tools { opacity: 1; pointer-events: auto; transition-duration: 0s; }
.zc-row[data-first]:is(:hover, :focus-within, [data-menu-open]) > .zc-tools { top: -10px; }
.zc-row[data-tools-in] > .zc-tools, .zc-row[data-first][data-tools-in] > .zc-tools { top: 2px; }
@media (hover: none) { .zc-tools { display: none; } }

/* compact: the rows closer, the avatars smaller */
.zc[data-density="compact"] .zc-row { --gut: 28px; }
.zc[data-density="compact"] .zc-row[data-first] { margin-top: 8px; }
.zc[data-density="compact"] .zc-head { margin-bottom: 2px; }

/* ── the composer ── */
.zc-strip { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 8px 0 14px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); }
.zc-strip > svg { width: var(--icon-14); height: var(--icon-14); flex: none; color: var(--ink-3); }
.zc-strip > b { flex: none; font-weight: var(--fw-550); color: var(--ink); }
.zc-strip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.zc-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; }
.zc-file-item { display: inline-flex; align-items: center; gap: 2px; }
.zc-file-thumb { --w: 56px; }
.zc-file-item > [data-r="file"] { max-width: 240px; }
.zc-record { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 8px 8px 8px 14px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); }
.zc-rec-dot { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--danger-dot); animation: zc-pulse 1s ease-in-out infinite alternate; }
@keyframes zc-pulse { to { opacity: .35; } }
.zc-rec-time { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 32px; }
.zc-rec-hint { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-3); white-space: nowrap; }
.zc-level { width: 140px; overflow: hidden; }
[data-r="message-box"][data-recording] > :is([data-part="text"], [data-part="bar"]) { display: none; }
.zc-ref { display: contents; }
.zc-ref > [data-r="token"] { max-width: 220px; min-width: 0; }
.zc-ref > [data-r="token"] > [data-part="label"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-also { padding: 0 10px 8px; }
.zc-ta-emoji { width: 16px; text-align: center; font-size: var(--fs-13); }

/* ── the side panel ── */
.zc-side-dock { flex: none !important; padding: 8px 12px 12px; box-shadow: inset 0 var(--px) 0 var(--line-1); }
.zc-side-actions { display: inline-flex; align-items: center; }
.zc-side { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 24px; min-width: 0; }
.zc-side .zc-row { margin: 0 -8px; padding: 2px 8px; }
.zc-side .zc-row > .zc-tools { right: 6px; }
.zc-thread-root > .zc-row { margin-top: 0; }
.zc-thread-sep { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-thread-sep::after { content: ""; flex: 1; height: var(--px); background: var(--line-2); }
.zc-thread-log .zc-row[data-first] { margin-top: 10px; }
.zc-results { display: flex; flex-direction: column; margin: 0 -16px; }
.zc-results mark { border-radius: var(--r-key); background: var(--label-yellow-bg); color: var(--label-yellow-fg); }
.zc-in { font-weight: var(--fw-450); color: var(--ink-3); }
.zc-row-end { grid-column: 3; grid-row: 2; display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
.zc-search { display: flex; flex-direction: column; gap: 10px; }
.zc-search > [data-r="field"] { width: 100%; }
.zc-filters-row { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-has { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-state { min-height: 0; padding: 32px 8px; }
.zc-small { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-h { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-500); color: var(--ink-3); }
.zc-details { display: flex; flex-direction: column; gap: 20px; }
.zc-sec { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.zc-sec + .zc-sec { padding-top: 16px; box-shadow: inset 0 var(--px) 0 var(--line-1); }
.zc-sec-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-16); line-height: var(--lh-16); color: var(--ink); }
.zc-sec-title > b { font-weight: var(--fw-550); }
.zc-sec-title > svg { width: var(--icon-16); height: var(--icon-16); color: var(--ink-3); }
.zc-members { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
.zc-member { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.zc-member-name { flex: 1; color: var(--ink); font-weight: var(--fw-500); }
.zc-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; min-height: 40px; }
.zc-set > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zc-set > span > b { font-weight: var(--fw-500); color: var(--ink); }
.zc-safety { display: flex; flex-direction: column; gap: 8px; align-self: stretch; padding: 12px; border-radius: var(--r-contain); background: var(--plane); box-shadow: 0 0 0 var(--px) var(--line-2); }
.zc-safety-head { display: flex; align-items: center; gap: 8px; }
.zc-safety-head > b { flex: 1; font-weight: var(--fw-550); color: var(--ink); }
.zc-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px; font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-500); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.zc-sched { display: flex; flex-direction: column; gap: 10px; }
.zc-sched-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-contain); box-shadow: 0 0 0 var(--px) var(--line-2); }
.zc-sched-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.zc-sched-head > b { font-weight: var(--fw-550); color: var(--ink); }
.zc-sched-head > svg { width: var(--icon-14); height: var(--icon-14); color: var(--ink-3); }
.zc-sched-text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* ── linking a device: the code, the QR code and the digits both screens compare ── */
.zc-dev-actions { display: flex; justify-content: flex-end; padding-top: 8px; }
.zc-link-sheet { display: flex; flex-direction: column; gap: 14px; color: var(--ink-2); }
.zc-link-sheet p { margin: 0; }
.zc-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.zc-link-code, .zc-link-digits { display: flex; justify-content: center; gap: 12px; padding: 14px 12px; border-radius: var(--r-contain); background: var(--well); color: var(--ink); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.zc-qr-box { display: flex; justify-content: center; }
.zc-qr { width: 168px; height: 168px; padding: 8px; border-radius: var(--r-row); background: var(--gray-0); color: var(--gray-900); box-shadow: 0 0 0 var(--px) var(--line-3); } /* dark modules on light in both themes: a camera reads that best */
[data-device-name] { margin-right: 6px; }

/* ── popovers and dialogs ── */
.zc-pop { max-width: none; }
.zc-schedule { width: 328px; padding: 0; }
.zc-pop-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 0; }
.zc-pop-head > b { font-weight: var(--fw-550); color: var(--ink); }
.zc-pop-head > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-presets { padding: 10px 12px 0; }
.zc-presets [data-r="chips"] { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-time-row { display: flex; align-items: center; gap: 8px; }
.zc-time-row > [data-r="field"] { flex: 1; }
.zc-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 32px; }
.zc-keys-group { display: flex; flex-direction: column; gap: 6px; }
.zc-key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; color: var(--ink-2); }
.zc-info-msg { display: flex; flex-direction: column; gap: 2px; }
.zc-info-msg > b { font-weight: var(--fw-550); color: var(--ink); }
.zc-info-msg > p { margin: 6px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.zc-props { display: flex; flex-direction: column; gap: 4px; }
.zc-mono-free { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.zc-edits { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.zc-edits p { margin: 2px 0 0; color: var(--ink-2); }
.zc-quote-box > [data-r="embed"] { margin: 0; }
.zc-stage { display: flex; align-items: center; justify-content: center; }
.zc-stage > img { max-width: calc(100% - 112px); max-height: calc(100% - 32px); object-fit: contain; border-radius: var(--r-row); }
.zc-lb-foot { flex: none; padding: 10px 16px; border-top: var(--px) solid var(--line-3); }
.zc-lb-caption { margin: 0 auto; max-width: 640px; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink); text-align: center; white-space: pre-wrap; }
/* Details: what the conversation has shared, in three tabs */
.zc-shared { align-items: stretch; }
.zc-shared-panel { display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.zc-shared-panel > .zc-results { margin: 0 -8px; }
.zc-month { display: flex; flex-direction: column; gap: 6px; }
.zc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.zc-grid > [data-r="thumb"] { --w: 100%; padding: 0; border: 0; }

/* ── a narrow window: the list is narrower ── */
@media (max-width: 899px) { .zc { grid-template-columns: 240px minmax(0, 1fr); } }
/* ── a phone: the list and the conversation are two screens ── */
@media (max-width: 599px) {
  .zc { grid-template-columns: minmax(0, 1fr); }
  .zc[data-view="list"] > .zc-page, .zc[data-view="conv"] > .zc-nav { display: none; }
  .zc-nav { box-shadow: none; }
  .zc-back { display: inline-flex; }
  .zc-topic, .zc-wide-only { display: none; }
  .zc-row { --gut: 32px; }
  .zc-tools { right: 4px; }
  .zc-voice { min-width: 0; gap: 6px; }
  .zc-voice .zc-bars { gap: 1px; }
  .zc-voice .zc-bars > i { width: 2px; }
  [data-r="message-box"] [data-part="hint"] { display: none; }
  .zc-stage > img { max-width: 100%; max-height: 100%; border-radius: 0; }
}
@media (max-width: 480px) {
  [data-r="message-box"] :is([data-act="format"], [data-act="mention"]) { display: none; }
}

/* ── the phone's gestures (gestures.mjs): a message swiped right shows the reply icon under the finger; a row in the list swiped shows its actions ── */
.zc-row { touch-action: pan-y; }
.zc-swipe-reply { position: absolute; left: 4px; top: 50%; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: -14px; border-radius: var(--r-round); background: var(--well); color: var(--ink-3); opacity: 0; pointer-events: none; transition: opacity 120ms, background-color 120ms; }
.zc-swipe-reply > svg { width: var(--icon-16); height: var(--icon-16); }
.zc-swipe-reply[data-armed] { background: var(--accent-tint); color: var(--accent-ink); }
.zc-swipe { position: relative; touch-action: pan-y; overflow: hidden; border-radius: var(--r-row); }
.zc-row[data-swiping] { overflow: hidden; }
.zc-swipe-acts { position: absolute; top: 0; bottom: 0; z-index: 0; display: flex; align-items: center; gap: 2px; width: 0; overflow: hidden; border-radius: var(--r-row); background: var(--well); }
.zc-swipe-acts[data-side="start"] { left: 0; justify-content: flex-start; padding-left: 0; background: var(--accent-tint); color: var(--accent-ink); }
.zc-swipe-acts[data-side="end"] { right: 0; justify-content: flex-end; }
.zc-swipe-act { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-500); white-space: nowrap; }
.zc-swipe-act > svg { width: var(--icon-16); height: var(--icon-16); }
.zc-swipe > [data-r="inbox-row"] { position: relative; z-index: 1; }
.zc-swipe[data-open] > .zc-swipe-acts[data-side="end"] { width: 168px; padding-right: 4px; }
.zc-swipe[data-open] > [data-r="inbox-row"] { transform: translateX(-168px); }

/* ── a link preview in a message, and in the box before it is sent ── */
.zc-preview { display: flex; flex-direction: column; overflow: hidden; margin: 2px 0 6px; max-width: 360px; border-radius: var(--r-row); background: var(--well); color: var(--ink); text-decoration: none; cursor: default; }
.zc-preview:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.zc-preview-img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.zc-preview-img[data-small] { aspect-ratio: auto; max-height: 160px; object-fit: contain; }
.zc-preview-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.zc-preview-site { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.zc-preview-title { font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-550); color: var(--ink); }
.zc-preview-desc { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zc-pv-img { flex: none; width: 40px; height: 40px; object-fit: cover; border-radius: var(--r-key); }
.zc-pv-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.zc-pv-text > b { font-weight: var(--fw-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── a shared P23 document: a card inside the message, live or pinned ── */
.zc-docc { display: flex; flex-direction: column; gap: 6px; width: 360px; max-width: 100%; margin: 6px 0 2px; padding: 10px 12px 8px; border-radius: var(--r-row); background: var(--raised); box-shadow: 0 0 0 var(--px) var(--line-3); }
.zc-docc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.zc-docc-head > svg { flex: none; width: var(--icon-16); height: var(--icon-16); color: var(--ink-3); }
.zc-docc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-13); line-height: var(--lh-13); font-weight: var(--fw-550); color: var(--ink); }
.zc-docc-text { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zc-docc-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.zc-docc-meta { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.zc-sd-row { display: flex; flex-direction: column; min-width: 0; }
