/* pinn. – Chat (css/chat.css, since 1.127.0). Looks like a messenger, in the colours of the app (--c-pine, --c-mustard, --c-paper). */
#chatSection { background: color-mix(in srgb, var(--c-pine) 5%, var(--c-paper)); }
.chat-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-main { flex: 1; min-height: 0; display: flex; }
.chat-hidden, .chat-ctx.hidden { display: none; }

/* List of chats */
.chat-list { width: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--c-paper); }
.chat-list-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 0.75rem; border-bottom: 1px solid rgba(37,35,31,0.1); }
.chat-list-title { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 1.125rem; line-height: 1.75rem; }
.chat-items { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.chat-item { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; text-align: left; background: transparent; border: 0; border-bottom: 1px solid rgba(37,35,31,0.06); cursor: pointer; font: inherit; color: inherit; }
.chat-item:hover, .chat-item.active { background: color-mix(in srgb, var(--c-pine) 8%, transparent); }
.chat-item-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.chat-item-title { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-prev { font-size: 0.82rem; color: rgba(37,35,31,0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-prev .chat-ticks { margin-right: 0.25rem; }
.chat-item-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.chat-item-time { font-size: 0.7rem; color: rgba(37,35,31,0.5); }
.chat-item-time.unread { color: var(--c-mustard); font-weight: 600; }
.chat-unread { min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--c-mustard); color: #fff; font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chat-avatar { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; overflow: hidden; background: rgba(37,35,31,0.1); font-size: 1.15rem; line-height: 1; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar-initial { color: #fff; font-weight: 600; font-size: 0.95rem; }
.chat-avatar-group { background: color-mix(in srgb, var(--c-pine) 18%, var(--c-paper)); }

/* Conversation */
.chat-conv { display: none; flex: 1; min-width: 0; min-height: 0; flex-direction: column; background: color-mix(in srgb, var(--c-pine) 6%, var(--c-paper)); }
.chat-main.show-conv .chat-list { display: none; }
.chat-main.show-conv .chat-conv { display: flex; }
.chat-conv-head { flex-shrink: 0; display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; background: var(--c-pine); color: #fff; }
.chat-conv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-conv-name { font-weight: 600; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-sub { font-size: 0.7rem; opacity: 0.75; }
.chat-icon-btn { flex-shrink: 0; width: 2.25rem; height: 2.25rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.chat-icon-btn:hover { background: rgba(255,255,255,0.14); }
.chat-icon-btn.dark:hover, .chat-list-head .chat-icon-btn:hover { background: rgba(37,35,31,0.08); }
.chat-list-head .chat-icon-btn { color: var(--c-pine); }
.chat-placeholder { margin: auto; max-width: 22rem; padding: 2rem; text-align: center; color: rgba(37,35,31,0.65); }
.chat-placeholder-note { font-size: 0.8rem; margin-top: 0.75rem; }
.chat-banners { flex-shrink: 0; }
.chat-banner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.9rem; font-size: 0.78rem; background: color-mix(in srgb, var(--c-mustard) 14%, var(--c-paper)); border-bottom: 1px solid rgba(37,35,31,0.08); }
.chat-banner.warn { background: color-mix(in srgb, #c0392b 14%, var(--c-paper)); }
.chat-banner-btn { flex-shrink: 0; padding: 0.3rem 0.65rem; border-radius: 0.5rem; border: 0; background: var(--c-pine); color: #fff; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0.75rem 0.75rem 0.5rem; display: flex; flex-direction: column; }
.chat-day { align-self: center; margin: 0.6rem 0; padding: 0.2rem 0.7rem; border-radius: 999px; font-size: 0.7rem; background: color-mix(in srgb, var(--c-paper) 85%, transparent); color: rgba(37,35,31,0.65); box-shadow: 0 1px 1px rgba(0,0,0,0.06); }
.chat-more { align-self: center; margin-bottom: 0.5rem; padding: 0.35rem 0.8rem; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--c-paper) 90%, transparent); font-size: 0.75rem; cursor: pointer; }
.chat-empty { align-self: center; max-width: 20rem; margin: auto; padding: 0.7rem 0.9rem; border-radius: 0.75rem; font-size: 0.78rem; text-align: center; background: color-mix(in srgb, var(--c-mustard) 14%, var(--c-paper)); }
.chat-row { display: flex; margin-top: 0.12rem; }
.chat-row.first { margin-top: 0.5rem; }
.chat-row.mine { justify-content: flex-end; }
.chat-row.flash .chat-bubble { outline: 2px solid var(--c-mustard); }
.chat-bubble { position: relative; max-width: min(78%, 34rem); padding: 0.35rem 0.55rem 0.25rem; border-radius: 0.7rem; background: var(--c-paper); box-shadow: 0 1px 1px rgba(0,0,0,0.1); cursor: pointer; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-row.mine .chat-bubble { background: color-mix(in srgb, var(--c-pine) 20%, var(--c-paper)); }
.chat-row.first.theirs .chat-bubble { border-top-left-radius: 0.15rem; }
.chat-row.first.mine .chat-bubble { border-top-right-radius: 0.15rem; }
.chat-sender { font-size: 0.74rem; font-weight: 700; color: var(--c-pine); margin-bottom: 0.1rem; }
.chat-text { font-size: 0.93rem; line-height: 1.32; white-space: pre-wrap; }
.chat-text.chat-muted { font-style: italic; color: rgba(37,35,31,0.55); }
.chat-link-a { color: var(--c-pine); text-decoration: underline; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: 0.25rem; margin-top: 0.05rem; font-size: 0.66rem; color: rgba(37,35,31,0.5); line-height: 1; }
.chat-ticks { letter-spacing: -0.12em; font-size: 0.78rem; color: rgba(37,35,31,0.4); }
.chat-ticks.read { color: var(--c-mustard); font-weight: 700; }
.chat-failed { color: #c0392b; }
.chat-retry { margin-top: 0.15rem; font-size: 0.72rem; color: #c0392b; text-align: right; }
.chat-quote, .chat-ctx-body { border-left: 3px solid var(--c-mustard); border-radius: 0.3rem; padding: 0.2rem 0.5rem; margin-bottom: 0.25rem; background: color-mix(in srgb, var(--c-pine) 9%, transparent); }
.chat-quote-name { font-size: 0.72rem; font-weight: 700; color: var(--c-mustard); }
.chat-quote-text { font-size: 0.8rem; color: rgba(37,35,31,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.chat-ref { display: flex; align-items: center; gap: 0.5rem; width: 100%; margin-bottom: 0.25rem; padding: 0.4rem 0.55rem; border: 1px solid rgba(37,35,31,0.12); border-radius: 0.5rem; background: color-mix(in srgb, var(--c-paper) 70%, transparent); text-align: left; font: inherit; font-size: 0.85rem; color: inherit; cursor: pointer; }
.chat-ref-ico { font-size: 1.1rem; }
.chat-ref-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Composer */
.chat-ctx { flex-shrink: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; background: var(--c-paper); border-top: 1px solid rgba(37,35,31,0.1); }
.chat-ctx-body { flex: 1; min-width: 0; margin: 0; }
.chat-composer { flex-shrink: 0; display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--c-pine) 6%, var(--c-paper)); }
.chat-input { flex: 1; min-width: 0; max-height: 130px; resize: none; padding: 0.55rem 0.85rem; border: 0; border-radius: 1.3rem; background: var(--c-paper); font: inherit; font-size: 16px; line-height: 1.3; box-shadow: 0 1px 1px rgba(0,0,0,0.08); outline: none; }
.chat-send { flex-shrink: 0; width: 2.6rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--c-pine); color: #fff; cursor: pointer; }

/* Setup, unlock */
.chat-gate { flex: 1; overflow-y: auto; display: flex; padding: 1rem; }
.chat-gate-card { margin: auto; width: 100%; max-width: 26rem; padding: 1.5rem; border-radius: 1rem; background: var(--c-paper); box-shadow: 0 2px 12px rgba(0,0,0,0.1); text-align: center; display: flex; flex-direction: column; gap: 0.8rem; }
.chat-gate-lock { font-size: 2.4rem; line-height: 1; }
.chat-gate-title { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 1.25rem; }
.chat-gate-text { font-size: 0.88rem; color: rgba(37,35,31,0.75); }
.chat-gate-error { min-height: 1.1rem; font-size: 0.8rem; color: #c0392b; }
.chat-code { padding: 0.8rem; border-radius: 0.7rem; background: color-mix(in srgb, var(--c-mustard) 14%, var(--c-paper)); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; word-break: break-all; user-select: all; }
.chat-code-input { padding: 0.7rem; border: 1px solid rgba(37,35,31,0.2); border-radius: 0.6rem; font: inherit; font-size: 16px; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.05em; background: transparent; }
.chat-btn { padding: 0.7rem 1rem; border: 0; border-radius: 0.7rem; background: var(--c-pine); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.chat-btn:disabled { opacity: 0.5; }
.chat-btn-light { background: color-mix(in srgb, var(--c-pine) 12%, var(--c-paper)); color: var(--c-pine); }
.chat-link { border: 0; background: transparent; color: rgba(37,35,31,0.6); font: inherit; font-size: 0.82rem; text-decoration: underline; cursor: pointer; }

/* Sheets */
.chat-sheet-back { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.4); }
.chat-sheet { width: 100%; max-width: 30rem; max-height: 88%; overflow-y: auto; padding: 0.75rem; border-radius: 1rem 1rem 0 0; background: var(--c-paper); display: flex; flex-direction: column; gap: 0.35rem; }
@media (min-width: 640px) { .chat-sheet-back { align-items: center; } .chat-sheet { border-radius: 1rem; } }
.chat-sheet-title { font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 1.1rem; padding: 0.25rem 0.4rem; }
.chat-sheet-sub { font-weight: 700; font-size: 0.85rem; padding: 0.5rem 0.4rem 0; }
.chat-sheet-text { font-size: 0.85rem; padding: 0 0.4rem; color: rgba(37,35,31,0.8); }
.chat-sheet-text.small { font-size: 0.76rem; color: rgba(37,35,31,0.6); }
.chat-sheet-note { font-size: 0.8rem; padding: 0.4rem; color: rgba(37,35,31,0.65); }
.chat-sheet-act { padding: 0.75rem 0.8rem; border: 0; border-radius: 0.6rem; background: transparent; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.chat-sheet-act:hover { background: color-mix(in srgb, var(--c-pine) 8%, transparent); }
.chat-sheet-act.danger { color: #c0392b; }
.chat-sheet-act.muted { color: rgba(37,35,31,0.55); text-align: center; }
.chat-num-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.4rem; }
.chat-num-mid { min-width: 0; }
.chat-num-name { font-size: 0.85rem; font-weight: 600; }
.chat-num { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; color: rgba(37,35,31,0.7); word-break: break-word; }
.chat-switch { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.6rem 0.4rem; cursor: pointer; }
.chat-switch input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; accent-color: var(--c-pine); }
.chat-switch-text { display: flex; flex-direction: column; }
.chat-switch-title { font-size: 0.88rem; font-weight: 600; }
.chat-switch-help { font-size: 0.75rem; color: rgba(37,35,31,0.6); }

/* Wide screens (iPad, computer): list and conversation side by side */
@media (min-width: 900px) {
  .chat-list { width: 21rem; flex: none; display: flex !important; border-right: 1px solid rgba(37,35,31,0.1); }
  .chat-conv { display: flex !important; }
  .chat-back { display: none; }
}

/* Dark mode */
html.dark .chat-list, html.dark .chat-bubble, html.dark .chat-input, html.dark .chat-ctx, html.dark .chat-gate-card, html.dark .chat-sheet { background: #26292b; color: #e9e9e6; }
html.dark .chat-row.mine .chat-bubble { background: #0d3d4b; }
html.dark .chat-conv, html.dark #chatSection { background: #16181a; }
html.dark .chat-composer { background: #1c1f21; }
html.dark .chat-item-prev, html.dark .chat-meta, html.dark .chat-quote-text, html.dark .chat-gate-text, html.dark .chat-sheet-text, html.dark .chat-num, html.dark .chat-item-time { color: rgba(233,233,230,0.65); }
html.dark .chat-list-head .chat-icon-btn { color: #e9e9e6; }
html.dark .chat-day, html.dark .chat-more { background: #26292b; color: #cfcfcb; }
html.dark .chat-link-a { color: #9ad0e0; }


/* Photos and videos (since 1.127.1) */
.chat-attach { flex-shrink: 0; width: 2.4rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: color-mix(in srgb, var(--c-pine) 80%, #000); cursor: pointer; }
.chat-media { position: relative; width: min(260px, 66vw); max-height: 340px; margin: 0 0 0.25rem; border-radius: 0.5rem; overflow: hidden; background: rgba(37,35,31,0.12); cursor: pointer; }
.chat-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-media-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.chat-media-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 2.8rem; height: 2.8rem; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; padding-left: 0.15rem; }
.chat-media-dur { position: absolute; left: 0.4rem; bottom: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 0.6rem; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.7rem; }
.chat-media-hd { position: absolute; right: 0.4rem; top: 0.4rem; padding: 0.05rem 0.4rem; border-radius: 0.4rem; background: var(--c-mustard); color: #fff; font-size: 0.65rem; font-weight: 700; }
.chat-media-hd.static { position: static; margin-left: auto; margin-right: 0.5rem; }
.chat-media-prog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); color: #fff; font-size: 0.85rem; font-weight: 600; text-align: center; padding: 0.5rem; }
.chat-media-cancel { position: absolute; right: 0.4rem; top: 0.4rem; width: 1.8rem; height: 1.8rem; border: 0; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; }
.chat-compose { max-width: 26rem; }
.chat-compose-prev { position: relative; align-self: center; width: 100%; max-height: 18rem; border-radius: 0.7rem; overflow: hidden; background: #111; display: flex; align-items: center; justify-content: center; }
.chat-compose-prev img, .chat-compose-prev video { max-width: 100%; max-height: 18rem; display: block; }
.chat-compose-count { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.8rem; }
.chat-compose-cap { padding: 0.65rem 0.8rem; border: 1px solid rgba(37,35,31,0.2); border-radius: 0.6rem; background: transparent; font: inherit; font-size: 16px; color: inherit; }
.chat-hd-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.2rem; }
.chat-hd { flex-shrink: 0; min-width: 3.2rem; padding: 0.45rem 0.7rem; border: 2px solid rgba(37,35,31,0.3); border-radius: 0.6rem; background: transparent; color: inherit; font: inherit; font-weight: 800; letter-spacing: 0.04em; cursor: pointer; }
.chat-hd.on { background: var(--c-mustard); border-color: var(--c-mustard); color: #fff; }
.chat-hd-info { min-width: 0; font-size: 0.8rem; }
.chat-hd-q { font-weight: 600; }
.chat-hd-size { color: rgba(37,35,31,0.6); }
.chat-compose-err { min-height: 1rem; font-size: 0.78rem; color: #c0392b; padding: 0 0.3rem; }
.chat-compose-acts { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.chat-compose-acts .chat-btn { min-width: 7rem; }
.chat-viewer { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #0c0d0e; color: #fff; }
.chat-viewer-top { flex-shrink: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem; background: rgba(0,0,0,0.5); }
.chat-viewer-title { flex: 1; min-width: 0; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-viewer-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.chat-viewer-stage > img, .chat-viewer-stage > video { max-width: 100%; max-height: 100%; object-fit: contain; }
.chat-viewer-stage > img.blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(8px); opacity: 0.6; }
.chat-viewer-status { position: relative; padding: 0.5rem 0.9rem; border-radius: 999px; background: rgba(0,0,0,0.6); font-size: 0.85rem; }
.chat-viewer-bar { flex-shrink: 0; display: flex; justify-content: space-around; gap: 0.25rem; padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom, 0px)); background: rgba(0,0,0,0.6); }
.chat-viewer-act { flex: 1; padding: 0.7rem 0.3rem; border: 0; border-radius: 0.6rem; background: transparent; color: #fff; font: inherit; font-size: 0.82rem; cursor: pointer; }
.chat-viewer-act:hover { background: rgba(255,255,255,0.12); }
.chat-viewer .chat-icon-btn:hover { background: rgba(255,255,255,0.14); }
.chat-field { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.2rem 0.3rem; }
.chat-field.hidden { display: none; }
.chat-field-lbl { font-size: 0.75rem; color: rgba(37,35,31,0.6); }
.chat-select { padding: 0.6rem 0.6rem; border: 1px solid rgba(37,35,31,0.2); border-radius: 0.6rem; background: transparent; font: inherit; font-size: 16px; color: inherit; }
html.dark .chat-compose-cap, html.dark .chat-select { border-color: rgba(255,255,255,0.2); }
html.dark .chat-select option { background: #26292b; }

/* "Discuss in chat": picker of chats on top of any page, small message, flash of the opened item */
.chat-pick-back { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.4); }
@media (min-width: 640px) { .chat-pick-back { align-items: center; } .chat-pick-back .chat-sheet { border-radius: 1rem; } }
.chat-pick-back .chat-sheet { color: var(--c-ink, #25231f); }
.chat-pick-ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-pick-row { display: flex; align-items: center; gap: 0.7rem; }
.chat-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-toast { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 600; max-width: 90%; padding: 0.6rem 1rem; border-radius: 0.7rem; background: #25231f; color: #fff; font-size: 0.85rem; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.chat-ref-flash { animation: chatRefFlash 1.8s ease-out 1; }
@keyframes chatRefFlash { 0%, 30% { box-shadow: 0 0 0 3px var(--c-mustard); } 100% { box-shadow: 0 0 0 3px transparent; } }
html.dark .chat-pick-back .chat-sheet { color: #e9e9e6; }
html.dark .chat-pick-ref { color: rgba(233,233,230,0.65); }

/* 1.127.3: groups, pinned chats, swipe actions, chat pictures */
.chat-list-tools { display: inline-flex; align-items: center; gap: 0.15rem; }
.chat-head-avatar { flex-shrink: 0; display: inline-flex; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer; position: relative; }
.chat-head-avatar:hover::after { content: ''; position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,0.18); }
.chat-item-badges { display: inline-flex; align-items: center; gap: 0.3rem; }
.chat-pin-ico { font-size: 0.72rem; opacity: 0.65; line-height: 1; }
.chat-unread-dot { min-width: 0.7rem; width: 0.7rem; height: 0.7rem; padding: 0; }
.chat-swipe { position: relative; overflow: hidden; border-bottom: 1px solid rgba(37,35,31,0.06); }
.chat-swipe .chat-item { border-bottom: 0; }
.chat-swipe-acts { position: absolute; top: 0; bottom: 0; right: 0; width: 150px; display: flex; visibility: hidden; }
.chat-swipe-btn { flex: 1; min-width: 0; padding: 0 0.3rem; border: 0; color: #fff; font: inherit; font-size: 0.72rem; font-weight: 600; line-height: 1.15; cursor: pointer; }
.chat-swipe-btn.pin { background: var(--c-mustard); }
.chat-swipe-btn.read { background: var(--c-pine); }
.chat-swipe-row { position: relative; background: var(--c-paper); touch-action: pan-y; will-change: transform; }
.chat-swipe-row:hover, .chat-swipe-row.active { background: color-mix(in srgb, var(--c-pine) 8%, var(--c-paper)); }
.chat-swipe-more { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); width: 1.8rem; height: 1.8rem; border: 0; border-radius: 999px; background: var(--c-paper); color: rgba(37,35,31,0.7); font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
@media (hover: hover) and (pointer: fine) { .chat-swipe:hover .chat-swipe-more, .chat-swipe-more:focus-visible { opacity: 1; } }
.chat-group-name { width: 100%; box-sizing: border-box; margin: 0.25rem 0 0.4rem; padding: 0.6rem 0.8rem; border: 1px solid rgba(37,35,31,0.2); border-radius: 0.6rem; background: #fff; font: inherit; color: #25231f; }
.chat-group-pick { display: flex; flex-direction: column; max-height: 38vh; overflow-y: auto; margin: 0.25rem 0; }
.chat-group-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.3rem; cursor: pointer; border-radius: 0.5rem; }
.chat-group-row:hover { background: color-mix(in srgb, var(--c-pine) 8%, transparent); }
.chat-group-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--c-pine); }
.chat-group-name-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-group-tag { font-size: 0.7rem; color: rgba(37,35,31,0.55); }
.chat-group-err { color: #c0392b; min-height: 1.1rem; padding-top: 0; padding-bottom: 0; }
.chat-sheet-primary { background: var(--c-pine); color: #fff; text-align: center; font-weight: 600; }
.chat-sheet-primary:hover { background: color-mix(in srgb, var(--c-pine) 88%, #000); }
.chat-sheet-primary:disabled { opacity: 0.55; cursor: default; }
.chat-sheet-pic { display: flex; justify-content: center; padding: 0.3rem 0 0.4rem; }
html.dark .chat-swipe-row { background: #26292b; }
html.dark .chat-swipe-row:hover, html.dark .chat-swipe-row.active { background: color-mix(in srgb, var(--c-pine) 18%, #26292b); }
html.dark .chat-swipe-more { background: #2f3335; color: #e9e9e6; }
html.dark .chat-group-name { background: #1f2224; color: #e9e9e6; border-color: rgba(233,233,230,0.25); }
html.dark .chat-group-tag { color: rgba(233,233,230,0.6); }


/* 1.127.4: voice messages, locations, polls, PDF, search, muting */
.chat-hide { display: none !important; }
.chat-dim { opacity: 0.45; }
.chat-unread.muted { background: rgba(37,35,31,0.35); }
.chat-attach-row { display: flex; align-items: center; gap: 0.8rem; }
.chat-attach-ico { font-size: 1.4rem; width: 2rem; text-align: center; }
.chat-mic { background: var(--c-pine); }
.chat-composer.recording > :not(.chat-rec) { display: none; }
.chat-rec { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.6rem; }
.chat-rec-dot { width: 0.7rem; height: 0.7rem; border-radius: 999px; background: #c0392b; animation: chatRecBlink 1s infinite; flex-shrink: 0; }
@keyframes chatRecBlink { 50% { opacity: 0.25; } }
.chat-rec-time { font-variant-numeric: tabular-nums; font-size: 0.9rem; min-width: 2.6rem; }
.chat-rec-bars { flex: 1; min-width: 0; height: 2rem; display: flex; align-items: center; gap: 2px; }
.chat-rec-bars i { flex: 1; min-width: 2px; height: 12%; border-radius: 2px; background: var(--c-pine); }
.chat-voice { display: flex; align-items: center; gap: 0.6rem; min-width: min(15rem, 62vw); padding: 0.1rem 0; position: relative; }
.chat-voice-play { flex-shrink: 0; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 999px; background: var(--c-pine); color: #fff; font-size: 0.95rem; cursor: pointer; }
.chat-voice-play:disabled { opacity: 0.5; }
.chat-voice.loading .chat-voice-play { opacity: 0.6; animation: chatRecBlink 0.8s infinite; }
.chat-voice-mid { flex: 1; min-width: 0; }
.chat-voice-bars { height: 1.7rem; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.chat-voice-bars i { flex: 1; min-width: 2px; border-radius: 2px; background: rgba(37,35,31,0.28); }
.chat-voice-bars i.on { background: var(--c-pine); }
.chat-voice-foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: rgba(37,35,31,0.6); }
.chat-voice-speed { border: 0; border-radius: 999px; padding: 0.05rem 0.45rem; background: rgba(37,35,31,0.1); font: inherit; font-size: 0.7rem; cursor: pointer; color: inherit; }
.chat-voice-prog { position: absolute; right: 0; top: -0.1rem; font-size: 0.68rem; color: rgba(37,35,31,0.55); }
.chat-map { position: relative; width: min(260px, 66vw); height: 150px; overflow: hidden; border-radius: 0.5rem; background: #E8E4DA; }
.chat-map-stage { position: absolute; left: 50%; top: 50%; width: 360px; height: 180px; margin: -90px 0 0 -180px; }
.chat-map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; }
.chat-map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.chat-loc { cursor: pointer; margin-bottom: 0.25rem; }
.chat-loc-cap { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.3rem 0.1rem 0; font-size: 0.85rem; }
.chat-loc-cap span { font-size: 0.72rem; color: rgba(37,35,31,0.6); }
.chat-loc-prev .chat-map { width: 100%; }
.chat-loc-stage { position: relative; }
.chat-pdf { display: flex; align-items: center; gap: 0.6rem; width: min(16rem, 66vw); margin-bottom: 0.25rem; padding: 0.5rem 0.6rem; border: 1px solid rgba(37,35,31,0.12); border-radius: 0.5rem; background: color-mix(in srgb, var(--c-paper) 70%, transparent); text-align: left; font: inherit; color: inherit; cursor: pointer; position: relative; }
.chat-pdf-ico { font-size: 1.8rem; line-height: 1; }
.chat-pdf-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-pdf-name { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pdf-size { font-size: 0.72rem; color: rgba(37,35,31,0.6); }
.chat-pdf-prog { border-radius: 0.5rem; }
.chat-viewer-doc { text-align: center; padding: 1rem; position: relative; }
.chat-viewer-doc-ico { font-size: 4rem; }
.chat-viewer-doc-name { font-weight: 600; margin-top: 0.5rem; word-break: break-word; }
.chat-viewer-doc-size { font-size: 0.8rem; opacity: 0.7; margin-top: 0.2rem; }
.chat-poll { min-width: min(15rem, 66vw); margin-bottom: 0.2rem; }
.chat-poll-q { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.4rem; }
.chat-poll-opt { position: relative; display: flex; align-items: center; gap: 0.5rem; width: 100%; margin-bottom: 0.3rem; padding: 0.45rem 0.6rem; border: 1px solid rgba(37,35,31,0.15); border-radius: 0.5rem; background: transparent; text-align: left; font: inherit; font-size: 0.88rem; color: inherit; cursor: pointer; overflow: hidden; }
.chat-poll-opt:disabled { cursor: default; }
.chat-poll-opt.mine { border-color: var(--c-pine); font-weight: 600; }
.chat-poll-opt.win { border-color: var(--c-mustard); }
.chat-poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--c-pine) 16%, transparent); transition: width 0.25s; }
.chat-poll-t { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chat-poll-n { position: relative; font-size: 0.78rem; font-weight: 700; }
.chat-poll-meta { font-size: 0.72rem; color: rgba(37,35,31,0.6); }
.chat-poll-opts { display: flex; flex-direction: column; }
.chat-search { flex-shrink: 0; display: flex; align-items: center; gap: 0.25rem; padding: 0.4rem 0.6rem; background: var(--c-paper); border-bottom: 1px solid rgba(37,35,31,0.1); }
.chat-search-in { flex: 1; min-width: 0; padding: 0.45rem 0.7rem; border: 1px solid rgba(37,35,31,0.2); border-radius: 999px; background: transparent; font: inherit; font-size: 16px; color: inherit; outline: none; }
.chat-search-count { font-size: 0.75rem; color: rgba(37,35,31,0.65); white-space: nowrap; }
html.dark .chat-search, html.dark .chat-poll-opt, html.dark .chat-pdf { background: #26292b; color: #e9e9e6; }
html.dark .chat-voice-bars i { background: rgba(233,233,230,0.3); }
html.dark .chat-voice-bars i.on { background: #9ad0e0; }
html.dark .chat-voice-foot, html.dark .chat-poll-meta, html.dark .chat-pdf-size, html.dark .chat-loc-cap span, html.dark .chat-search-count { color: rgba(233,233,230,0.65); }
html.dark .chat-list-head { border-bottom-color: rgba(255,255,255,0.12); }
