/* Shared geometry: compact visual controls retain generous hit targets. */
:root{
 --e-control-hit:44px;--e-list-avatar:58px;--e-list-row:80px;--e-list-gap:12px;
 --e-row-title:var(--row-font,17px);--e-row-preview:calc(var(--row-font,17px) - 1px);
 --e-ui-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 --e-muted:var(--muted,#95959c);--e-menu-radius:20px;--e-sheet-radius:24px;
 --e-menu-fill:var(--panel,#252528);--e-menu-line:var(--line,#ffffff20);--e-danger:#ff746b;
}
.theme-light{--e-muted:#686e78;--e-danger:#c9362f}
.chat-list{--chat-avatar:var(--e-list-avatar);--chat-gap:var(--e-list-gap);padding-left:16px;padding-right:16px;padding-bottom:calc(86px + env(safe-area-inset-bottom))}
.chat-list .chat-row{min-height:var(--e-list-row);padding:8px 0;gap:var(--e-list-gap)}
.chat-row .avatar{width:var(--e-list-avatar);height:var(--e-list-avatar);font-size:23px}
.chat-row .row-top strong{font:600 var(--e-row-title)/1.25 var(--e-ui-font);letter-spacing:-.15px}
.chat-row .row-preview{font-size:var(--e-row-preview);line-height:1.25;max-height:calc(var(--e-row-preview) * 2.5);margin-top:3px;color:var(--e-muted)}
.chat-row .row-stamp time{font-size:12px;line-height:1.25;color:var(--e-muted)}
.side-head{min-height:64px;padding:8px 14px;gap:8px}
.side-head .icon,.side-head .edit-button,.heading-label{min-height:var(--e-control-hit)}
.side-head .heading-label,.side-head .story-heading-button{min-width:44px;min-height:44px;justify-content:center}
.side-head .story-heading-button{flex-shrink:0}
.side-head .header-tools{box-sizing:border-box;height:48px;padding:1px 3px;gap:2px}
.side-head .header-tools .icon{width:var(--e-control-hit);height:var(--e-control-hit)}
.side-head .edit-button{padding:8px 12px;font-size:17px;line-height:24px}
.side-head .story-stack .avatar{width:28px;height:28px;font-size:11px;margin-left:-12px}
.side-head .story-stack .avatar:first-child{margin-left:0}
.tabs button{min-height:var(--e-control-hit);padding:7px 14px;font-size:16px;line-height:1.25}
.sidebar .bottom-nav{height:64px;box-sizing:border-box;padding:4px;left:12px;right:12px;bottom:max(10px,env(safe-area-inset-bottom))}
.sidebar .bottom-nav button{min-width:0;min-height:54px;padding:4px 2px;gap:3px;font-size:11.5px;line-height:14px}
.sidebar .bottom-nav .nav-icon{height:26px;min-height:26px}
.sidebar .bottom-nav .nav-icon>.glyph{width:25px;height:25px}
.chat-head{min-height:58px;padding:6px 8px;gap:8px}
.conversation .chat-head{min-height:58px}
.chat-head .icon{width:var(--e-control-hit);min-width:var(--e-control-hit);height:var(--e-control-hit)}
.chat-head .avatar{width:36px;height:36px;font-size:15px}
.chat-head .chat-heading h2{font-size:17px;line-height:1.25}
.chat-head .chat-heading p{font-size:12px;line-height:1.3}
.composer,.composer.has-draft{grid-template-columns:44px minmax(0,1fr) 44px;min-height:44px}
.composer .icon,.composer #emoji-open,.composer #voice-record,.composer .send{box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px}
.composer #voice-record,.composer .send,.composer.has-draft .send{grid-column:3}
.composer:has(#recording-mode:not([hidden])):not(.has-draft){grid-template-columns:44px minmax(0,1fr) 44px 44px}
.composer:has(#recording-mode:not([hidden])):not(.has-draft) #voice-record{grid-column:4}
.composer #recording-mode{width:44px;height:44px}
.composer textarea{min-height:44px;line-height:1.3;padding:10px 44px 10px 12px;border-radius:23px}
.composer #emoji-open .glyph{width:22px;height:22px}
.full-page-dialog .page-head .icon,.account-settings>header .icon{min-width:44px;height:44px;min-height:44px}
.settings-menu .settings-row{min-height:48px;font-size:16px;line-height:1.3;padding:12px 14px}
/* The compact avatar belongs below the settings toolbar, including on scroll. */
.settings-home .settings-profile:not(.photo-expanded){margin-top:0;padding-top:12px}
#settings-dialog.account-settings:not(.photo-expanded)>header{background:var(--bg);border-bottom:1px solid var(--line)}
:is(#message-actions,#room-actions).e-context-menu{color:var(--text)}
.e-context-panel{border-radius:var(--e-menu-radius);background:var(--e-menu-fill);border-color:var(--e-menu-line);box-shadow:0 8px 30px #0003}
:is(#message-actions,#room-actions).e-context-menu .menu-actions{padding:6px 0}
:is(#message-actions,#room-actions).e-context-menu .e-context-item{min-height:44px;padding:10px 16px;gap:12px;font:400 16px/22px var(--e-ui-font)}
:is(#message-actions,#room-actions).e-context-menu .e-context-item .glyph{width:21px;height:21px;flex-basis:21px}
:is(#message-actions,#room-actions).e-context-menu .e-context-item.danger{color:var(--e-danger)}
.e-context-receipt{min-height:44px;padding:10px 16px;gap:12px;font-size:13px;color:var(--e-muted);border-color:var(--e-menu-line)}
.e-context-reactions{border-radius:24px;background:var(--e-menu-fill);color:var(--text);overflow:auto;scrollbar-width:none}
.e-context-reaction-top{height:52px;min-height:52px;padding:4px 6px;gap:4px;flex-shrink:0}
.e-context-reactions .reaction-picker{overflow:auto;scrollbar-width:none;overscroll-behavior:contain}
.e-context-reactions .reaction-picker button{flex:0 0 40px;width:40px;min-width:40px;height:44px;min-height:44px;line-height:44px;font-size:26px}
:is(#message-actions,#room-actions).e-context-menu .e-context-reaction-expand{width:44px;min-width:44px;height:44px;min-height:44px;flex-basis:44px;background:#8882;color:var(--text)}
.e-context-reaction-extra{grid-template-columns:repeat(auto-fit,minmax(44px,1fr));padding:4px 8px;gap:4px;flex-shrink:0}
.e-context-reaction-extra button{height:44px;min-height:44px;line-height:44px;font-size:26px}
#attachment-actions{border-radius:var(--e-sheet-radius)}
#attachment-actions .attachment-actions-close{width:44px;height:44px;min-width:44px}
#attachment-actions .attachment-action{min-height:48px;padding:11px 14px;gap:12px;font-size:16px}
#attachment-actions .attachment-action .glyph{width:22px;height:22px}
@media(min-width:701px){
 .app{grid-template-columns:clamp(320px,28vw,380px) minmax(0,1fr)}
 :root{--e-list-avatar:52px;--e-list-row:74px;--e-row-title:calc(var(--row-font,17px) - 1px);--e-row-preview:calc(var(--row-font,17px) - 2px)}
}
@media(max-width:360px){
 :root{--e-list-avatar:52px;--e-list-row:74px;--e-list-gap:10px;--e-row-title:calc(var(--row-font,17px) - 1px);--e-row-preview:calc(var(--row-font,17px) - 2px)}
 .chat-list{padding-left:12px;padding-right:12px}
 .side-head{padding-left:10px;padding-right:10px;gap:5px}
 .side-head .edit-button{font-size:16px;padding-left:10px;padding-right:10px}
 .side-head .story-stack .avatar{width:24px;height:24px;font-size:10px;margin-left:-12px}
 .sidebar .bottom-nav{left:8px;right:8px}
}
