.registration-phone{width:min(100%,560px);max-width:560px}.chat-history{height:clamp(220px,48dvh,600px);overflow-y:auto;overscroll-behavior:auto;overflow-anchor:none;padding:12px;background:#eff3f1;border-radius:12px}.chat-bubble{width:fit-content;max-width:88%;margin:10px 0;padding:12px 14px;background:#fff;border-radius:16px 16px 16px 3px;overflow-wrap:anywhere;box-shadow:0 1px 2px #0002}.chat-bubble.mine{margin-left:auto;background:#d9f4e7;border-radius:16px 16px 3px 16px}.chat-bubble small{display:block;color:#4a5b54}.chat-bubble p,.chat-translation{white-space:pre-wrap}.chat-bubble button{background:transparent;color:#244b43;border:1px solid #91afa6}.chat-compose{position:relative;background:#fff;padding:12px 0 max(12px,env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr auto;gap:8px;z-index:2}.chat-compose label{grid-column:1/-1}.chat-compose textarea{min-width:0;resize:vertical;max-height:140px;font:inherit;padding:10px;border:1px solid #78978c;border-radius:8px}.chat-compose button{align-self:end}.chat-translation{border-top:1px solid #a3bfb5;margin-top:8px;font-size:.9em}button{min-height:44px;touch-action:manipulation}#chat-new{position:sticky;bottom:110px;background:#163a31;color:white;margin-left:auto}button[hidden]{display:none!important}@media(max-width:600px){.registration-shell{padding:0!important}.registration-phone{border-radius:0!important}.screen{padding:14px!important}.chat-history{height:46dvh}.chat-bubble{max-width:92%}input,select,textarea{font-size:16px!important}}

/* Keep chat content unclipped; the composer stays in flow below the history. */
.registration-phone{overflow:visible}.registration-phone .app-header{border-radius:26px 26px 0 0}@media(max-width:600px){.registration-phone .app-header{border-radius:0}}

.conversation-reference{display:block;overflow-wrap:anywhere;font-family:monospace;font-size:.78rem;font-weight:400}

/* Chat-only compact chrome; leaving or locking the chat restores the usual layout. */
.chat-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:.875rem;text-decoration:underline}
.chat-details summary::before{content:'▸';margin-right:8px}.chat-details[open] summary::before{content:'▾'}
#chat-status:empty{display:none}#chat-status:empty + #chat-reconnect{display:none}
@media(max-width:600px){
 body:has(.chat-history) .demo-bar{min-height:24px;padding:3px 10px;font-size:11px;line-height:18px}
 body:has(.chat-history) .demo-bar span{display:none}
 body:has(.chat-history) .app-header{padding:8px 12px}
 body:has(.chat-history) .brand{font-size:20px}
 body:has(.chat-history) .subbrand,body:has(.chat-history) .security-strip,body:has(.chat-history) .step-chip{display:none}
 body:has(.chat-history) .screen{padding:8px!important;min-height:0}
 body:has(.chat-history) .screen h1{font-size:18px;margin:0;line-height:26px}
 body:has(.chat-history) .registration-phone{min-height:0}
 .chat-details{margin:0}.chat-details p{margin:6px 0;font-size:14px}
 .chat-history{height:60dvh;min-height:200px;padding:8px}
 .chat-compose{gap:4px 8px;padding:6px 0 max(6px,env(safe-area-inset-bottom))}
 .chat-compose label{font-size:12px;line-height:18px}.chat-compose textarea{padding:6px 8px}
}

#chat-status{font-size:14px;margin:4px 0}

/* Conversation identity and timestamps; no simulated read receipts or action buttons. */
.screen:has(.chat-header)>h1,.registration-phone:has(.chat-header)>.app-header,.registration-phone:has(.chat-header)>.security-strip{display:none}
.chat-header{position:sticky;top:0;z-index:4;display:flex;gap:12px;align-items:center;padding:14px 16px;background:#152d3d;color:#fff;border-radius:12px;margin-bottom:8px}
.chat-header>div{min-width:0}.chat-header h2{font-size:20px;line-height:1.4;margin:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.chat-header small{font-size:13px;color:#eadbb2}
.chat-avatar{width:42px;height:42px;flex:0 0 42px;border-radius:50%;background:#d4e3df;color:#214b43;display:grid;place-items:center;font-weight:700}
.chat-timezone,.chat-mode-note{font-size:12px;color:#52635c;margin:4px 0}.chat-mode-note{font-size:13px}
.chat-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chat-bubble{position:relative;margin-bottom:34px}.chat-bubble.theirs{margin-left:30px;max-width:calc(100% - 44px)}
.chat-message-avatar{position:absolute;left:-32px;top:2px;width:26px;height:26px;border-radius:50%;background:#d4e3df;color:#456d60;display:grid;place-items:center;font-size:12px}
.chat-sent-at{position:absolute;top:100%;margin-top:4px;left:0;white-space:nowrap;color:#4a5b54;font-size:12px;line-height:20px}.mine .chat-sent-at{left:auto;right:0}
.chat-bubble p{font-size:16px}.chat-translation{font-size:16px}.chat-translation:empty{display:none}
@media(max-width:600px){.chat-header h2{font-size:18px}.chat-history{height:54dvh}.chat-bubble.theirs{max-width:calc(100% - 34px)}}

/* Hide language captions even when small elements have an explicit display rule. */
.chat-bubble .chat-original-language{display:none!important}

.chat-sent-at{display:flex;gap:6px;flex-wrap:wrap;max-width:100%;line-height:16px}.chat-read[hidden]{display:none!important}.chat-read{white-space:nowrap}.chat-bubble{margin-bottom:46px}

.chat-stamp-tools{grid-column:1/-1;grid-row:3}.chat-stamp-tools>button{font-size:14px}.chat-stamps-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-height:32dvh;overflow:auto;padding:4px}.chat-stamps-grid button{min-width:0;padding:6px;background:#f4f5ef;color:#214b43;border:1px solid #d4e3df;display:flex;flex-direction:column;align-items:center;font-size:12px}.chat-sticker-image{display:inline-block;width:160px;max-width:100%;vertical-align:middle}.chat-sticker-image img{display:block;width:100%;height:auto}.chat-sticker-image [hidden],#chat-stamps-panel[hidden],#chat-stamp-preview[hidden]{display:none!important}.chat-stamps-grid .chat-sticker-image{width:80px}.chat-sticker-image>span{padding:12px;overflow-wrap:anywhere}.chat-bubble.chat-sticker{background:transparent;box-shadow:none;padding:4px;width:160px}.chat-sticker .chat-translation{display:none}.chat-stamps-grid button:focus-visible{outline:3px solid #bd8819;outline-offset:1px}#chat-stamp-preview .chat-sticker-image{width:90px}#chat-stamp-preview{padding:4px}.chat-compose:has(#chat-stamps-panel:not([hidden])){z-index:5}@media(max-width:380px){.chat-stamps-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.chat-sticker-image{width:140px}}

#chat-search-panel{padding:12px;background:#fff;border-radius:12px;margin-bottom:12px}#chat-search-query{box-sizing:border-box;width:100%;min-width:0;padding:12px}#chat-search-results{max-height:360px;overflow:auto}.chat-search-result{display:block;width:100%;text-align:left;margin:8px 0;white-space:normal;overflow-wrap:anywhere}.chat-search-result small,.chat-search-result span{display:block}#chat-history[hidden],#chat-search-panel[hidden]{display:none}

.chat-emoji-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}.chat-emoji-grid button{font-size:24px;min-width:0;min-height:44px;padding:4px}.chat-emoji-tools{grid-column:1/-1}#chat-emoji-panel[hidden]{display:none}#chat-emoji-panel{padding:8px;border:1px solid #a8b9b0;border-radius:8px}#chat-emoji-status:empty{display:none}@media(max-width:360px){.chat-emoji-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

.chat-compose textarea{grid-row:2;grid-column:1}.chat-compose>#chat-send{grid-row:2;grid-column:2}.chat-emoji-tools{grid-row:4}

.chat-image-tools{grid-column:1/-1;grid-row:5;min-width:0}.chat-image-previews,.chat-image-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.chat-image-previews img,.chat-image-grid img{max-width:100%;width:100%;height:120px;object-fit:contain}.chat-image-grid button{min-width:0;padding:4px}.chat-image-previews button{font-size:12px;max-width:100%}.chat-image-dialog{max-width:90vw;max-height:90dvh;padding:12px}.chat-image-dialog img{display:block;max-width:100%;max-height:75dvh;object-fit:contain}.chat-image-dialog::backdrop{background:#000b}

/* Private authenticated profile photographs, with letter fallback. */
.chat-avatar img,.chat-message-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.chat-bubble.mine{max-width:calc(100% - 44px)}
.profile-photo-settings{min-width:0}.profile-photo-current{display:grid;place-items:center;width:128px;height:128px;border-radius:50%;overflow:hidden;background:#d4e3df;font-size:40px;margin:12px 0}
.profile-photo-current img{width:100%;height:100%;object-fit:cover}.profile-photo-editor canvas{display:block;width:min(100%,256px);height:auto;border:1px solid #78978c}
.profile-photo-editor label{display:block;margin:12px 0}.profile-photo-editor input{width:100%;box-sizing:border-box}.profile-photo-editor[hidden]{display:none}.profile-photo-settings button{max-width:100%;white-space:normal;margin:4px}

.chat-voice-tools{grid-column:1/-1;grid-row:6;min-width:0}.chat-voice-tools p{font-size:13px}.chat-voice-tools button{margin:3px;max-width:100%}audio{display:block;width:100%;max-width:100%;min-width:0}audio[hidden]{display:none}
.chat-bubble:has(audio){width:300px;box-sizing:border-box}

/* One compact attachment row, directly beneath text and Send. */
.chat-compose{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.chat-compose>label{grid-row:1}.chat-compose textarea{grid-row:2;grid-column:1/4;width:100%;box-sizing:border-box}
.chat-compose>#chat-send{grid-row:2;grid-column:4;align-self:stretch;min-width:0;padding:8px}
.chat-compose .chat-stamp-tools,.chat-compose .chat-emoji-tools,.chat-compose .chat-image-tools,.chat-compose .chat-voice-tools{display:contents}
#chat-stamps-open{grid-row:3;grid-column:1}#chat-emoji-open{grid-row:3;grid-column:2}
.chat-image-tools>button{grid-row:3;grid-column:3}.chat-voice-record{grid-row:3;grid-column:4}
#chat-stamps-open,#chat-emoji-open,.chat-image-tools>button,.chat-voice-record{width:100%;min-width:0;min-height:44px;margin:0!important;padding:6px 3px;font-size:12px!important;line-height:1.25;white-space:normal;border-radius:8px;background:#f1f5f2;color:#244b43;border:1px solid #b5c8c0}
.chat-stamp-tools>div,.chat-emoji-tools>div,.chat-image-tools>div,.chat-compose .chat-voice-tools>p,.chat-compose .chat-voice-tools>audio,.chat-emoji-tools>p,.chat-image-tools>p,#chat-stamp-cancel{grid-column:1/-1;min-width:0}
.chat-compose .chat-voice-hint{grid-row:4;margin:2px 0;font-size:11px;line-height:1.35;color:#52635c}
.chat-compose .chat-voice-status{grid-row:5;margin:2px 0;font-size:13px}
.chat-voice-stop{grid-row:6;grid-column:1/3}.chat-voice-cancel{grid-row:6;grid-column:3/5}
.chat-compose .chat-voice-tools>audio{grid-row:7}.chat-voice-tools>button{margin:0}
.chat-compose:has(.chat-voice-stop:not([hidden])) .chat-voice-record{visibility:hidden}
.chat-compose p:empty,.chat-image-previews:empty{display:none}
.chat-compose button:focus-visible{outline:3px solid #bd8819;outline-offset:2px}

/* Accessible icon controls inside one message frame. */
.chat-compose{border:1px solid #a6bcb3;border-radius:18px;padding:10px!important;margin:10px 0;background:#fff;box-sizing:border-box}
.chat-compose:focus-within{border-color:#37695a;box-shadow:0 0 0 2px #37695a22}
.chat-compose>label{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.chat-compose textarea{border:0;background:transparent;outline:none;min-height:60px}
.chat-compose #chat-send{border-radius:12px;background:#173b31;color:#fff;border:0;align-self:center}
#chat-stamps-open,#chat-emoji-open,.chat-image-tools>button,.chat-voice-record,.chat-compose .chat-voice-stop,.chat-compose #chat-send{font-size:0!important;min-height:44px;min-width:0;display:flex;align-items:center;justify-content:center;padding:8px;gap:0}
#chat-stamps-open,#chat-emoji-open,.chat-image-tools>button,.chat-voice-record{background:transparent;border:0;color:#17231f}
.chat-compose .chat-voice-stop{grid-row:3;grid-column:4;color:#c62128;background:#fff0f0;border:1px solid #df7b7b;border-radius:10px;margin:0}
.chat-compose .chat-voice-cancel{grid-row:6;grid-column:1/-1;justify-self:start;font-size:13px}
#chat-stamps-open::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%223%22%20width%3D%2216%22%20height%3D%2218%22%20rx%3D%224%22%2F%3E%3Cpath%20d%3D%22M8%209h.01M16%209h.01M8%2014q4%204%208%200%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%223%22%20width%3D%2216%22%20height%3D%2218%22%20rx%3D%224%22%2F%3E%3Cpath%20d%3D%22M8%209h.01M16%209h.01M8%2014q4%204%208%200%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
#chat-emoji-open::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M8%209h.01M16%209h.01M8%2014q4%204%208%200%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M8%209h.01M16%209h.01M8%2014q4%204%208%200%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
.chat-image-tools>button::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%229%22%20r%3D%221.5%22%2F%3E%3Cpath%20d%3D%22m4%2018%205-5%203%203%204-6%205%207%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%229%22%20r%3D%221.5%22%2F%3E%3Cpath%20d%3D%22m4%2018%205-5%203%203%204-6%205%207%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
.chat-voice-record::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%229%22%20y%3D%222%22%20width%3D%226%22%20height%3D%2213%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M5%2010v2a7%207%200%200%200%2014%200v-2M12%2019v3M8%2022h8%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%229%22%20y%3D%222%22%20width%3D%226%22%20height%3D%2213%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M5%2010v2a7%207%200%200%200%2014%200v-2M12%2019v3M8%2022h8%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
.chat-voice-stop::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%222%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%222%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
#chat-send::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%203%2019%209-19%209%204-9-4-9Zm4%209h15%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%203%2019%209-19%209%204-9-4-9Zm4%209h15%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat}
