body.chat-route{overflow:hidden;background:#e9efec}
body.chat-route>.personal-alerts{display:none}
.chat-page{position:fixed;inset:var(--chat-top,0px) 0 auto;height:var(--chat-height,100dvh);max-width:980px;margin:0 auto;background:#f2f5f3;display:flex;flex-direction:column;color:#193b30;box-shadow:0 0 0 1px #dce5df;overflow:hidden}
.chat-topbar{display:flex;align-items:center;gap:12px;min-height:76px;padding:12px 24px;padding-top:max(12px,env(safe-area-inset-top));background:#193f33;color:#fff;flex-shrink:0}
.chat-back{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;color:#fff;flex-shrink:0}.chat-back .icon{transform:rotate(180deg)}
.chat-page .chat-avatar{width:42px;height:42px;flex:0 0 42px;background:#d9e9cf;color:#204333;font-size:18px}
.chat-peer{min-width:0;flex:1}.chat-peer h1{font-size:18px;font-weight:600;letter-spacing:-.02em;margin:0 0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}.chat-peer #other-status{font-size:12px;line-height:1.4;color:#d0dfd5}.chat-peer #other-status.available-text{color:#d4edb6}
.chat-list-link{font-size:12px;color:#f1f6ee;line-height:1.4;padding:10px;border-radius:10px;flex-shrink:0;min-height:44px;display:flex;align-items:center}
.chat-main{min-height:0;flex:1;display:flex;flex-direction:column;padding:0;width:100%;max-width:none;margin:0}
.chat-page .chat-meeting{font-size:12px;line-height:1.45;margin:0;padding:8px 24px;text-align:center;color:#53675b;background:#e6eee8;flex-shrink:0;overflow-wrap:anywhere}
.chat-page .chat-meeting.connection-lost{background:#fff1d5;color:#73460c}
.chat-page .chat-thread{position:relative;flex:1;min-height:70px;display:flex;flex-direction:column;padding:0;border:0;border-radius:0;background:#f2f5f3;overflow:hidden}
.chat-page #messages{height:auto;max-height:none;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:24px;scrollbar-gutter:stable;display:flex;flex-direction:column;gap:14px}
.chat-page .message{max-width:82%;width:fit-content;flex-shrink:0;align-self:flex-start;background:#fff;border:1px solid #dfe7e2;border-radius:18px 18px 18px 5px;padding:12px 16px;margin:0;box-shadow:0 2px 5px #193f3305;overflow-wrap:anywhere}
.chat-page .message.mine{align-self:flex-end;background:#235a44;color:#fff;border-color:#235a44;border-radius:18px 18px 5px 18px;margin:0}
.chat-page .message>div{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:5px}.chat-page .message strong{font-size:11px;font-weight:600;color:#5a7164}.chat-page .message time{font-size:10px;color:#67796d;font-variant-numeric:tabular-nums}.chat-page .message.mine strong,.chat-page .message.mine time{color:#dceade}
.chat-page .message p{font-size:16px;line-height:1.6;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-page .message-empty{text-align:center;color:#64776a;font-size:15px;line-height:1.7;max-width:280px;margin:auto;align-self:center;padding:20px 0}
.chat-page .chat-new{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);border:1px solid #acc5ad;border-radius:99px;padding:10px 18px;min-height:44px;background:#e1f0cc;color:#234831;font-size:13px;white-space:nowrap;box-shadow:0 3px 12px #183f331a;cursor:pointer}.chat-page .chat-new[hidden]{display:none}
.chat-extras{flex-shrink:0;background:#fff;border-top:1px solid #dce5de;overflow:auto;max-height:40%}.chat-extras>summary{list-style:none;display:flex;align-items:center;gap:10px;padding:10px 24px;min-height:44px;font-size:13px;color:#486554;cursor:pointer}.chat-extras>summary::-webkit-details-marker{display:none}.chat-extras>summary .icon{width:18px;height:18px}.chat-extras-body{padding:4px 24px 20px}
.chat-page .room-options{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:8px 0}.chat-page .identity-button{margin:0;text-decoration:none}.chat-page #my-identity{font-size:12px;color:#627365}.chat-page .context-details{flex-basis:100%}.chat-page .media-details{margin:12px 0}.chat-page .signals{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.chat-page .signals .button{font-size:12px;flex:none;min-height:44px;padding:10px 12px}.chat-page .room-actions{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0 10px}.chat-retention{font-size:12px;line-height:1.7;color:#66766a;margin:12px 0 0}
.chat-page .chat-composer{display:block;flex-shrink:0;padding:12px 24px max(12px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dce5de;margin:0}.chat-composer>label{display:block;font-size:12px;font-weight:600;color:#486554;margin:0 0 7px}.chat-compose-row{display:flex;align-items:flex-end;gap:10px}
.chat-page #message{flex:1;min-width:0;width:100%;font:inherit;font-size:16px;line-height:1.5;min-height:52px;max-height:130px;padding:13px 15px;background:#f4f7f5;color:#183b2d;border:1.5px solid #b3c6b8;border-radius:15px;resize:none;margin:0;overflow-y:auto}.chat-page #message:focus{outline:0;border-color:#2e7150;box-shadow:0 0 0 3px #2e715020;background:#fff}
.chat-page .chat-compose-row>.button{min-height:52px;min-width:52px;border-radius:15px;padding:13px 18px;flex-shrink:0;background:#245c45;color:#fff}.chat-compose-row>.button .icon{width:22px;height:22px}.chat-page .chat-send-status{font-size:11px;line-height:1.5;color:#63776a;margin:7px 0 0}.chat-page .chat-composer .form-error:empty{display:none}.chat-page .chat-composer .form-error{font-size:13px;line-height:1.5;margin:8px 0 0;color:#9b302b}
.chat-page a:focus-visible,.chat-page button:focus-visible,.chat-page summary:focus-visible{outline:3px solid #91b95e;outline-offset:3px}.chat-page button:disabled{opacity:.55;cursor:wait}
@media(hover:hover){.chat-back:hover,.chat-list-link:hover{background:#ffffff15}.chat-extras>summary:hover{background:#f0f5f1}}
@media(max-width:600px){.chat-topbar{min-height:68px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));gap:8px}.chat-peer h1{font-size:16px}.chat-peer #other-status{font-size:11px}.chat-list-link{max-width:78px;font-size:11px;padding:8px}.chat-page .chat-avatar{width:36px;height:36px;flex-basis:36px}.chat-page .chat-meeting{font-size:11px;padding:6px 12px}.chat-page #messages{padding:16px 12px;gap:12px}.chat-page .message{max-width:88%;padding:10px 13px}.chat-page .message p{font-size:16px}.chat-page .chat-composer{padding:10px 12px max(10px,env(safe-area-inset-bottom))}.chat-compose-row>.button span{display:none}.chat-page .chat-compose-row>.button{padding:12px;min-width:52px}.chat-extras>summary{padding:10px 14px}.chat-extras-body{padding:2px 14px 18px}.chat-page .chat-send-status{font-size:10px}}
@media(prefers-reduced-motion:reduce){.chat-page *{scroll-behavior:auto!important}}
.chat-page .chat-thread{min-height:0}
.chat-extras{flex-shrink:1;min-height:44px}
.chat-page #message{max-height:clamp(52px,calc(var(--chat-height,100dvh)*.22),130px)}
.chat-page.chat-short .chat-meeting{display:none}
.chat-page.chat-short .chat-meeting.connection-lost{display:block}
.chat-page.chat-short .chat-topbar{min-height:56px;padding-top:6px;padding-bottom:6px}
.chat-page.chat-short .chat-composer{padding-top:8px;padding-bottom:max(8px,env(safe-area-inset-bottom))}
.chat-page.chat-tiny .chat-topbar{display:none}

/* Unified readable message contrast & composer focus across group, live, and circle chats. */
:is(.group-conversation,.live-conversation,.circle-conversation) .messages{display:flex;flex-direction:column;gap:12px;background:#f2f5f3;overscroll-behavior:contain;scrollbar-gutter:stable}
:is(.group-conversation,.live-conversation,.circle-conversation) .message{max-width:85%;width:fit-content;flex-shrink:0;align-self:flex-start;background:#fff;border:1px solid #dfe7e2;border-radius:18px 18px 18px 5px;padding:12px 16px;margin:0;box-shadow:0 2px 5px #193f3305;overflow-wrap:anywhere}
:is(.group-conversation,.live-conversation,.circle-conversation) .message.mine{align-self:flex-end;background:#235a44;color:#fff;border-color:#235a44;border-radius:18px 18px 5px 18px;margin:0}
:is(.group-conversation,.live-conversation,.circle-conversation) .message>div{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:5px}
:is(.group-conversation,.live-conversation,.circle-conversation) .message strong{font-size:11px;font-weight:600;color:#5a7164}
:is(.group-conversation,.live-conversation,.circle-conversation) .message time{font-size:10px;color:#67796d;font-variant-numeric:tabular-nums}
:is(.group-conversation,.live-conversation,.circle-conversation) .message.mine strong,:is(.group-conversation,.live-conversation,.circle-conversation) .message.mine time{color:#dceade}
:is(.group-conversation,.live-conversation,.circle-conversation) .message p{font-size:16px;line-height:1.6;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
:is(.group-conversation,.live-conversation,.circle-conversation) .message-empty{text-align:center;color:#64776a;font-size:15px;line-height:1.7;max-width:280px;margin:auto;align-self:center;padding:24px 0}
:is(#group-message,#live-message,#circle-message){background:#f4f7f5;border:1.5px solid #b3c6b8;border-radius:15px;color:#183b2d;font-size:16px;line-height:1.5;max-height:130px;overflow-y:auto}
:is(#group-message,#live-message,#circle-message):focus{outline:0;border-color:#2e7150;box-shadow:0 0 0 3px #2e715020;background:#fff}
:is(.group-conversation,.live-conversation,.circle-conversation) .chat-send-status{font-size:11px;line-height:1.5;color:#63776a;margin:7px 0 0}
:is(#live-message-form,#circle-message-form) .chat-send-status{margin-bottom:10px}
:is(.group-conversation,.live-conversation,.circle-conversation) .message .message-safety{color:#67796d}
@media(max-width:600px){:is(.group-conversation,.live-conversation,.circle-conversation) .message{max-width:90%;padding:10px 13px}:is(.group-conversation,.live-conversation,.circle-conversation) .chat-send-status{font-size:10px}}
