/* Zalkrit Anonymous Chat — visitor side. WhatsApp-like, v1.5.0.
 * WhatsApp palette: header #008069, own bubbles #d9fdd3, other bubbles
 * white, ticks blue #53bdeb, chat background #efeae2.
 * v1.4.0 fix kept: [hidden] must beat display:flex — several panels use
 * display:flex, which used to override the hidden attribute. */
.zalkrit-chat [hidden] { display: none !important; }
.zalkrit-chat-file-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; overflow: hidden !important; pointer-events: none !important; }
.zalkrit-chat-attach-preview:empty, .zalkrit-chat-reply-preview:empty { display: none !important; }
.zalkrit-chat { max-width: 600px; margin: 0 auto; font-family: inherit; border: 1px solid #d1d7db; border-radius: 12px; background: #f0f2f5; box-sizing: border-box; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.zalkrit-chat * { box-sizing: border-box; }
.zalkrit-chat-title { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.zalkrit-chat-sub { font-size: 16px; color: #555; margin: 0 0 18px; }
.zalkrit-chat-start { padding: 20px; background: #fff; }
.zalkrit-chat-label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.zalkrit-chat-input { width: 100%; font-size: 18px; padding: 14px; border: 2px solid #ccc; border-radius: 10px; margin-bottom: 12px; }
.zalkrit-chat-input:focus { border-color: #008069; outline: none; }
.zalkrit-chat-btn { width: 100%; font-size: 18px; font-weight: 700; padding: 14px; border: 0; border-radius: 10px; background: #00a884; color: #fff; cursor: pointer; }
.zalkrit-chat-btn:hover { background: #008069; }
.zalkrit-chat-btn:disabled { opacity: .6; cursor: wait; }
.zalkrit-chat-error { color: #b32d2e; font-size: 15px; margin: 8px 0 0; }

/* --- WhatsApp header: avatar + name/online + icon buttons --- */
.zalkrit-chat-window { display: flex; flex-direction: column; }
.zalkrit-chat-header { display: flex; align-items: center; gap: 10px; background: #008069; color: #fff; padding: 10px 12px; flex: none; }
.zalkrit-chat-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #d9fdd3; color: #075e54; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.zalkrit-chat-who-wrap { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.zalkrit-chat-peer { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zalkrit-chat-online { color: #d1f4cc; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v1.6.4 HEADER: the current user lives on its own smaller third
 * line inside the who-wrap (min-width:0, so it ellipsises instead
 * of running into the buttons). The right side holds icon buttons
 * only, each a fixed 32px square with proper spacing. */
.zalkrit-chat-as-line { font-size: 11px; color: #d1f4cc; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zalkrit-chat-head-btns { display: flex; align-items: center; gap: 2px; flex: none; flex-shrink: 0; }
.zalkrit-chat-head-btn, .zalkrit-chat-mute-btn { border: 0; background: none; cursor: pointer; font-size: 19px; line-height: 1; color: #fff; padding: 6px; border-radius: 50%; min-width: 32px; min-height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.zalkrit-chat-head-btn:hover, .zalkrit-chat-mute-btn:hover { background: rgba(255,255,255,.15); }

/* --- Message list: the ONLY scrolling area; input bar is fixed below --- */
.zalkrit-chat-messages { flex: 1 1 auto; min-height: 320px; max-height: 480px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 8px; background: #efeae2; background-image: radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px); background-size: 18px 18px; overscroll-behavior: contain; }
.zalkrit-chat-empty { color: #667781; text-align: center; margin-top: 60px; }
.zalkrit-chat-date-sep { align-self: center; background: #fff; color: #54656f; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); margin: 6px 0; position: sticky; top: 0; z-index: 2; }
.zalkrit-chat-msg { max-width: 78%; padding: 7px 10px 6px; border-radius: 8px; font-size: 15.5px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.12); word-break: break-word; position: relative; }
.zalkrit-chat-msg-visitor { align-self: flex-end; background: #d9fdd3; color: #111b21; border-top-right-radius: 2px; }
.zalkrit-chat-msg-owner { align-self: flex-start; background: #fff; color: #111b21; border-top-left-radius: 2px; }
.zalkrit-chat-who { display: block; font-size: 12px; font-weight: 700; color: #008069; margin-bottom: 1px; }
.zalkrit-chat-msg-visitor .zalkrit-chat-who { color: #075e54; }
.zalkrit-chat-meta { float: right; font-size: 11px; color: #8696a0; margin: 6px 0 0 8px; white-space: nowrap; }
.zalkrit-chat-ticks { font-size: 13px; margin-left: 3px; }
.zalkrit-chat-ticks-seen { color: #53bdeb !important; font-weight: 800; }
.zalkrit-chat-msg-visitor .zalkrit-chat-ticks-seen { color: #53bdeb !important; background: none; padding: 0; }
.zalkrit-chat-edited { font-size: 11px; opacity: .7; font-style: italic; }
.zalkrit-chat-msg-deleted { font-style: italic; opacity: .7; }
.zalkrit-chat-actions { display: inline-block; margin-left: 4px; }
.zalkrit-chat-more { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: #8696a0; opacity: .9; padding: 0 2px; }
.zalkrit-chat-menu { position: fixed; background: #fff; color: #111; border: 1px solid #d1d7db; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 999999; display: flex; flex-direction: column; min-width: 180px; }
.zalkrit-chat-menu button { border: 0; background: none; text-align: left; padding: 10px 12px; cursor: pointer; font-size: 15px; }
.zalkrit-chat-menu button:hover { background: #f0f2f5; }
.zalkrit-chat-edit-input { width: 100%; font-size: 15px; padding: 8px; border-radius: 8px; border: 1px solid #008069; }

/* --- Typing slot: fixed height, always reserved, so showing/hiding
 * the typing indicator can NEVER push messages up or down. --- */
.zalkrit-chat-typing-slot { flex: none; height: 30px; background: #efeae2; padding: 0 14px; overflow: hidden; }
.zalkrit-chat-typing { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #54656f; height: 30px; }
.zalkrit-chat-typing-dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #008069; margin-right: 3px; animation: zalkrit-typing 1.2s infinite; }
.zalkrit-chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.zalkrit-chat-typing-dots span:nth-child(3) { animation-delay: .3s; }

/* --- Compose area: fixed at the bottom of the chat box --- */
.zalkrit-chat-compose-wrap { position: relative; flex: none; background: #f0f2f5; padding: 8px 10px 10px; }
.zalkrit-chat-compose { display: flex; gap: 8px; align-items: center; }
.zalkrit-chat-compose .zalkrit-chat-input { margin-bottom: 0; flex: 1; min-width: 0; border: 0; border-radius: 24px; padding: 11px 16px; font-size: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.zalkrit-chat-compose .zalkrit-chat-input:focus { border: 0; box-shadow: 0 0 0 2px #008069; }
.zalkrit-chat-send { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: #00a884; color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.zalkrit-chat-send:hover { background: #008069; }
.zalkrit-chat-send:disabled { opacity: .6; cursor: wait; }
.zalkrit-chat-attach-btn { font-size: 22px; line-height: 1; padding: 8px 10px; border: 0; border-radius: 50%; background: none; color: #54656f; cursor: pointer; flex-shrink: 0; }
.zalkrit-chat-attach-btn:hover { background: rgba(0,0,0,.06); }
.zalkrit-chat-img { display: block; max-width: 220px; max-height: 220px; width: auto; height: auto; border-radius: 8px; margin-top: 6px; cursor: pointer; }
.zalkrit-chat-file-link { display: inline-block; margin-top: 6px; color: inherit; text-decoration: underline; word-break: break-all; }
.zalkrit-chat-file-size { font-size: 13px; opacity: .8; }
.zalkrit-chat-attach-preview { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px dashed #ccc; border-radius: 10px; margin-bottom: 8px; font-size: 15px; background: #fff; }
.zalkrit-chat-preview-img { max-width: 80px; max-height: 80px; border-radius: 8px; }
.zalkrit-chat-preview-name { flex: 1; word-break: break-all; }
.zalkrit-chat-preview-remove { font-size: 22px; line-height: 1; border: 0; background: none; cursor: pointer; color: #b32d2e; }
.zalkrit-chat-hint { font-size: 13px; color: #667781; margin: 8px 0 0; padding: 0 4px 2px; }

/* --- Emoji picker v1.5.0: an OVERLAY above the compose bar, never in
 * the page flow, so opening/closing it cannot move the message list. --- */
.zalkrit-chat-emoji-panel { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 40; background: #fff; border: 1px solid #d1d7db; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.22); padding: 8px; max-height: 280px; overflow-y: auto; }
.zalkrit-chat-emoji-search { width: 100%; font-size: 15px; padding: 9px 12px; border: 1px solid #d1d7db; border-radius: 20px; margin-bottom: 8px; }
.zalkrit-chat-emoji-search:focus { outline: none; border-color: #008069; }
.zalkrit-chat-emoji-group { font-size: 12px; font-weight: 700; color: #8696a0; text-transform: uppercase; letter-spacing: .05em; margin: 8px 4px 4px; }
.zalkrit-chat-emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.zalkrit-chat-emoji { font-size: 24px; border: 0; background: none; cursor: pointer; padding: 5px; border-radius: 8px; line-height: 1; }
.zalkrit-chat-emoji:hover { background: #f0f2f5; transform: scale(1.15); }
.zalkrit-chat-emoji-empty { color: #8696a0; font-size: 14px; padding: 10px; text-align: center; }

/* v1.3.0 — animations, reactions, reply, All Chats, search */
@keyframes zalkrit-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zalkrit-pop { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes zalkrit-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zalkrit-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes zalkrit-send-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
.zalkrit-chat-start { animation: zalkrit-fade-in .45s ease both; }
.zalkrit-chat-window { animation: zalkrit-fade-in .35s ease both; }
.zalkrit-chat-msg-new { animation: zalkrit-msg-in .25s ease both; }
.zalkrit-chat-btn-sending { animation: zalkrit-send-pulse .45s ease; }
.zalkrit-chat-emoji-panel.zalkrit-chat-pop, .zalkrit-chat-menu { animation: zalkrit-pop .18s ease both; }
.zalkrit-chat-reply, .zalkrit-chat-reply-preview { display: block; font-size: 13px; opacity: .9; border-left: 3px solid #008069; padding: 4px 8px; margin-bottom: 6px; background: rgba(0,0,0,.05); border-radius: 6px; }
.zalkrit-chat-reply-preview { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; background: #fff; }
.zalkrit-chat-reactions { display: block; margin-top: 4px; }
.zalkrit-chat-reaction { border: 1px solid rgba(0,0,0,.12); background: rgba(255,255,255,.9); color: #111; border-radius: 12px; padding: 2px 8px; font-size: 13px; cursor: pointer; margin-right: 4px; animation: zalkrit-pop .18s ease both; }
.zalkrit-chat-menu-reacts { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid #eee; }
.zalkrit-chat-menu-emoji { font-size: 20px; border: 0; background: none; cursor: pointer; padding: 4px; }
.zalkrit-chat-menu-emoji:hover { transform: scale(1.25); }
.zalkrit-chat-search { margin: 10px 12px 0; width: auto; border-radius: 8px; }
.zalkrit-chat-all { border: 1px solid #d1d7db; border-radius: 10px; padding: 10px; margin: 10px; background: #fff; animation: zalkrit-fade-in .3s ease both; }
.zalkrit-chat-all-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.zalkrit-chat-all-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.zalkrit-chat-all-item { text-align: left; border: 1px solid #d1d7db; background: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.zalkrit-chat-all-item:hover { border-color: #008069; }
.zalkrit-chat-all-last { color: #555; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zalkrit-chat-all-time { color: #888; font-size: 12px; }
.zalkrit-chat-btn-small { font-size: 13px; padding: 6px 10px; border: 1px solid #ccc; background: #fff; border-radius: 8px; cursor: pointer; }

/* --- v1.5.0 expandable chat: near full viewport, survives reload --- */
/* v1.6.5: an expanded panel must never be taller than the
 * viewport — when it re-opened in remembered expanded mode the
 * header ("Zalkrit" first line) was clipped at the top. The
 * height:auto here beats .zalkrit-chat-floating's fixed height,
 * and max-height caps it to the viewport on every screen. */
.zalkrit-chat-expanded { position: fixed !important; inset: 12px !important; z-index: 99999 !important; max-width: none !important; margin: 0 !important; display: flex; flex-direction: column; border-radius: 12px; height: auto !important; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.zalkrit-chat-expanded .zalkrit-chat-window { flex: 1; min-height: 0; }
.zalkrit-chat-expanded .zalkrit-chat-messages { max-height: none; flex: 1; min-height: 0; }
.zalkrit-chat-expanded .zalkrit-chat-emoji-panel { max-height: 340px; }
@media (max-width: 640px) {
  .zalkrit-chat-expanded { inset: 0 !important; border-radius: 0; max-height: 100vh; max-height: 100dvh; }
  .zalkrit-chat-floating.zalkrit-chat-expanded { inset: 0 !important; max-height: 100vh; max-height: 100dvh; }
  .zalkrit-chat-msg { max-width: 88%; }
  /* v1.6.4: tighter header on phones, but the "Chatting as" line
   * stays visible — it just gets smaller, never hidden. */
  .zalkrit-chat-header { gap: 6px; padding: 8px 10px; }
  .zalkrit-chat-as-line { font-size: 10px; }
}

/* Dark mode — visitor chat */
.zalkrit-chat-dark { background: #111b21; color: #e9edef; border-color: #222d34; }
.zalkrit-chat-dark .zalkrit-chat-start { background: #111b21; }
.zalkrit-chat-dark .zalkrit-chat-sub, .zalkrit-chat-dark .zalkrit-chat-hint { color: #8696a0; }
.zalkrit-chat-dark .zalkrit-chat-input { background: #202c33; color: #e9edef; border-color: #2a3942; }
.zalkrit-chat-dark .zalkrit-chat-messages, .zalkrit-chat-dark .zalkrit-chat-typing-slot { background: #0b141a; }
.zalkrit-chat-dark .zalkrit-chat-msg-owner { background: #202c33; color: #e9edef; }
.zalkrit-chat-dark .zalkrit-chat-msg-visitor { background: #005c4b; color: #e9edef; }
.zalkrit-chat-dark .zalkrit-chat-date-sep { background: #182229; color: #aebac1; }
.zalkrit-chat-dark .zalkrit-chat-emoji-panel, .zalkrit-chat-dark .zalkrit-chat-all { background: #202c33; border-color: #2a3942; }
.zalkrit-chat-dark .zalkrit-chat-all-item { background: #202c33; border-color: #2a3942; color: #e9edef; }
.zalkrit-chat-dark .zalkrit-chat-compose-wrap { background: #111b21; }
.zalkrit-chat-dark .zalkrit-chat-compose .zalkrit-chat-input { background: #2a3942; }
.zalkrit-chat-dark .zalkrit-chat-attach-btn { color: #aebac1; }
.zalkrit-chat-dark .zalkrit-chat-typing { color: #aebac1; }

/* --- v1.6.0: bigger, clearer join screen --- */
.zalkrit-chat-start { padding: 28px 24px; text-align: center; }
.zalkrit-chat-start-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #00a884; color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; }
.zalkrit-chat-title { font-size: 28px; }
.zalkrit-chat-start .zalkrit-chat-label { text-align: left; }
.zalkrit-chat-start .zalkrit-chat-sub { font-size: 17px; }
.zalkrit-chat-load-error { background: #fff3f3; border: 1px solid #e0a3a3; border-radius: 10px; padding: 12px 14px; margin: 12px; }

/* --- v1.6.0: floating chat bubble (bottom-right, always visible) --- */
.zalkrit-chat-float-btn { position: fixed; right: 20px; bottom: 20px; z-index: 99990; display: flex; align-items: center; gap: 8px; background: #00a884; color: #fff; border: 0; border-radius: 999px; padding: 12px 18px 12px 14px; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.35); font-family: inherit; }
.zalkrit-chat-float-btn:hover { background: #008069; transform: scale(1.05); }
.zalkrit-chat-float-label { font-size: 16px; font-weight: 700; }
.zalkrit-chat-float-btn[hidden] { display: none !important; }
.zalkrit-chat-floating { position: fixed !important; right: 16px; bottom: 16px; left: auto; top: auto; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); z-index: 99995 !important; margin: 0 !important; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.zalkrit-chat-floating .zalkrit-chat-window { flex: 1; min-height: 0; }
.zalkrit-chat-floating .zalkrit-chat-messages { max-height: none; flex: 1; min-height: 0; }
.zalkrit-chat-floating .zalkrit-chat-start { flex: 1; overflow-y: auto; }
/* v1.6.5: expanded + floating combined (this rule comes after
 * .zalkrit-chat-floating, so it wins the cascade): same viewport
 * cap, panel fills the inset instead of keeping the 620px height. */
.zalkrit-chat-floating.zalkrit-chat-expanded { inset: 12px !important; top: 12px !important; bottom: 12px !important; left: 12px !important; right: 12px !important; width: auto !important; height: auto !important; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }

/* --- v1.6.6: expanded panel must start BELOW the WordPress admin
 * toolbar when signed in — the toolbar is a fixed 32px bar (46px
 * on screens <= 782px) that sits above the page, so an expanded
 * panel at inset 12px slid underneath it and the "Zalkrit" header
 * line and the top of the "Z" avatar were cut off. Visitors never
 * see the admin bar, so these rules only apply under
 * body.admin-bar; the 12px gap below the bar is kept. --- */
body.admin-bar .zalkrit-chat-expanded,
body.admin-bar .zalkrit-chat-floating.zalkrit-chat-expanded { top: 44px !important; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); }
@media (max-width: 782px) {
  body.admin-bar .zalkrit-chat-expanded,
  body.admin-bar .zalkrit-chat-floating.zalkrit-chat-expanded { top: 46px !important; max-height: calc(100vh - 46px); max-height: calc(100dvh - 46px); }
}

/* --- v1.6.1: side bubble only + hidden by default. The whole chat
 * root is fully hidden in the page (no inline chat box at the
 * bottom at all); only the floating bubble shows. The root is only
 * displayed as the fixed popup panel when opened. --- */
.zalkrit-chat-collapsed { display: none !important; }
.zalkrit-chat-collapsed.zalkrit-chat-floating { display: flex !important; }
/* --- v1.6.1: email cover at the top of the side panel --- */
.zalkrit-chat-email-box { background: #f0f2f5; border: 1px solid #d1d7db; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.zalkrit-chat-divider { text-align: center; color: #667781; font-size: 13px; margin: 4px 0 12px; }
.zalkrit-chat-divider span { background: #fff; padding: 0 8px; }
@media (max-width: 640px) {
  .zalkrit-chat-floating { right: 0; bottom: 0; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .zalkrit-chat-float-btn { right: 14px; bottom: 14px; }
}

/* --- v1.6.0: inline edit box with Save/Cancel --- */
.zalkrit-chat-edit-box { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.zalkrit-chat-edit-box .zalkrit-chat-edit-input { flex: 1 1 160px; }

/* --- v1.6.0: photo editor (canvas) --- */
.zalkrit-chat-photo-editor { background: #fff; border: 1px solid #d1d7db; border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.zalkrit-chat-photo-editor-title { font-weight: 700; margin: 0 0 8px; font-size: 16px; }
.zalkrit-chat-photo-canvas { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 0 auto 10px; background: #111; }
.zalkrit-chat-photo-controls, .zalkrit-chat-photo-filters, .zalkrit-chat-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.zalkrit-chat-photo-controls .zalkrit-chat-btn-small, .zalkrit-chat-photo-filters .zalkrit-chat-btn-small { padding: 7px 12px; font-size: 14px; }
.zalkrit-chat-photo-active { background: #008069 !important; color: #fff !important; border-color: #008069 !important; }
.zalkrit-chat-photo-send { background: #00a884; color: #fff; border-color: #00a884; font-weight: 700; }
.zalkrit-chat-photo-note { font-size: 13px; color: #667781; margin: 4px 0 0; }
.zalkrit-chat-dark .zalkrit-chat-photo-editor { background: #202c33; border-color: #2a3942; }
.zalkrit-chat-dark .zalkrit-chat-photo-note { color: #aebac1; }

/* --- v1.6.4 VOICE: WhatsApp-style voice bubbles + recording --- */
.zalkrit-chat-voice { display: flex; align-items: center; gap: 8px; min-width: 200px; max-width: 100%; }
.zalkrit-chat-voice-icon { font-size: 18px; flex: none; }
.zalkrit-chat-voice-audio { flex: 1 1 auto; min-width: 0; max-width: 220px; height: 36px; }
.zalkrit-chat-voice-duration { font-size: 12px; color: #667781; white-space: nowrap; flex: none; }
.zalkrit-chat-recording { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #b32d2e; white-space: nowrap; flex: none; }
.zalkrit-chat-recording-dot { width: 10px; height: 10px; border-radius: 50%; background: #e02424; animation: zalkrit-chat-rec-pulse 1s infinite; }
@keyframes zalkrit-chat-rec-pulse { 50% { opacity: .25; } }
.zalkrit-chat-mic-recording { background: rgba(224,36,36,.25) !important; }
/* --- v1.6.4 REGISTER: the two small mode links under Continue --- */
.zalkrit-chat-start #zalkrit-chat-register-link, .zalkrit-chat-start #zalkrit-chat-register-back { margin-top: 8px; }

/* --- v1.6.0: bigger, roomier chat on phones (mobile view was cramped) --- */
@media (max-width: 640px) {
  .zalkrit-chat { width: 100%; max-width: none; border-radius: 0; border-left: 0; border-right: 0; }
  .zalkrit-chat-messages { min-height: 55vh; max-height: 70vh; padding: 16px 12px 8px; }
  .zalkrit-chat-msg { font-size: 17px; line-height: 1.45; padding: 10px 12px 8px; max-width: 88%; }
  .zalkrit-chat-who { font-size: 13px; }
  .zalkrit-chat-meta { font-size: 12px; }
  .zalkrit-chat-ticks { font-size: 14px; }
  .zalkrit-chat-peer { font-size: 18px; }
  .zalkrit-chat-online { font-size: 14px; }
  .zalkrit-chat-avatar { width: 46px; height: 46px; font-size: 23px; }
  .zalkrit-chat-head-btn, .zalkrit-chat-mute-btn { font-size: 22px; padding: 10px; min-width: 44px; min-height: 44px; }
  .zalkrit-chat-compose .zalkrit-chat-input { font-size: 17px; padding: 13px 18px; }
  .zalkrit-chat-send { width: 52px; height: 52px; font-size: 22px; }
  .zalkrit-chat-attach-btn { font-size: 26px; padding: 10px 12px; min-width: 48px; min-height: 48px; }
  /* Every text field is 16px or bigger on mobile: below 16px iOS
   * Safari zooms in on focus, which scrolls the page and makes the
   * chat jump up while typing. */
  .zalkrit-chat-emoji-search, .zalkrit-chat-edit-input, .zalkrit-chat-search { font-size: 16px; }
  .zalkrit-chat-edit-input { padding: 10px; }
  .zalkrit-chat-menu { min-width: 200px; }
  .zalkrit-chat-menu button { font-size: 16px; padding: 13px 16px; }
  .zalkrit-chat-float-btn { font-size: 30px; padding: 14px 20px 14px 16px; }
  .zalkrit-chat-float-label { font-size: 17px; }
  .zalkrit-chat-start { padding: 28px 20px; }
  .zalkrit-chat-title { font-size: 30px; }
  .zalkrit-chat-start .zalkrit-chat-sub { font-size: 18px; }
  .zalkrit-chat-btn { font-size: 19px; padding: 16px; }
  .zalkrit-chat-typing { font-size: 14px; }
  .zalkrit-chat-all-list { max-height: 50vh; }
  .zalkrit-chat-photo-controls .zalkrit-chat-btn-small, .zalkrit-chat-photo-filters .zalkrit-chat-btn-small { padding: 10px 14px; font-size: 16px; }
  .zalkrit-chat-photo-send { padding: 12px 16px; font-size: 16px; }
}

/* --- v1.6.2: Album / Camera chooser menu (visitor) ---
 * Overlay above the compose bar (like the emoji panel), so opening it
 * never moves the message list. Big touch targets on phones. */
.zalkrit-chat-attach-menu { position: absolute; left: 8px; bottom: 64px; z-index: 9999; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid #d1d7db; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 6px; min-width: 200px; }
.zalkrit-chat-attach-menu[hidden] { display: none !important; }
.zalkrit-chat-attach-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 12px 14px; font-size: 16px; font-family: inherit; color: #111b21; cursor: pointer; }
.zalkrit-chat-attach-menu button:hover { background: #f0f2f5; }
.zalkrit-chat-dark .zalkrit-chat-attach-menu { background: #233138; border-color: #2a3942; }
.zalkrit-chat-dark .zalkrit-chat-attach-menu button { color: #e9edef; }
.zalkrit-chat-dark .zalkrit-chat-attach-menu button:hover { background: #2a3942; }

/* --- v1.6.2: Logout / Switch user button in the chat header --- */
.zalkrit-chat-logout-btn { font-size: 13px !important; width: auto !important; min-width: 0 !important; padding: 6px 10px !important; border-radius: 999px !important; background: rgba(255,255,255,.18) !important; color: #fff !important; font-weight: 700; white-space: nowrap; }
.zalkrit-chat-logout-btn:hover { background: rgba(255,255,255,.3) !important; }
