/* Mobile product layer. Keep upstream messaging and permission behaviour intact. */
:root {
  --app-accent: light-dark(#4665ed, #8da2ff);
  --app-accent-soft: light-dark(#edf1ff, #252e4d);
  --app-page: light-dark(#f7f8fc, #151a24);
  --app-surface: light-dark(#fff, #1e2430);
  --app-ink: light-dark(#1c2536, #ecedf5);
  --app-muted: light-dark(#788195, #9fa8bc);
  --app-line: light-dark(#edf0f5, #2c3341);
  --app-field: light-dark(#f3f5f9, #282f3d);
  --clr-primary-accent: var(--app-accent);
  --clr-primary-action: var(--app-accent);
  --clr-primary-accent-hover: light-dark(#344fc7, #adc0ff);
  --clr-text-primary: var(--app-ink);
  --clr-text-secondary: light-dark(#536076, #b2bfd4);
  --clr-text-tertiary: var(--app-muted);
  --clr-text-placeholder: var(--app-muted);
  --clr-bright: var(--app-surface);
  --clr-background-off-white: var(--app-surface);
  --clr-background-blue-gray-50: var(--app-page);
  --clr-background-blue-gray-75: var(--app-accent-soft);
  --clr-background-blue-gray-100: var(--app-accent-soft);
  --clr-background-blue-gray-300: var(--app-surface);
  --clr-background-extra-light-gray: var(--app-line);
  --clr-border-light: var(--app-line);
  --clr-button-primary-bg: #4665ed;
  --clr-button-primary-text: #fff;
  --clr-button-primary-hover-bg: #3655da;
  --clr-button-secondary-bg: var(--app-accent-soft);
  --clr-button-secondary-text: var(--app-accent);
  --clr-bubble-left-bg: var(--app-surface);
  --clr-bubble-right-bg: light-dark(#e5ebff, #303f6b);
  --clr-bubble-text: var(--app-ink);
  --clr-bubble-timestamp-text: light-dark(#8290a9, #a3b3d1);
  --clr-bubble-meta-text: var(--app-muted);
  --clr-bubble-meta-date-bg: transparent;
  --clr-bubble-author-text: var(--app-accent);
  --caption-panel-height: 64px;
}
* { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', sans-serif; -webkit-tap-highlight-color: transparent; }
.material-icons { font-family: 'Material Icons'; }
html, body { font-size: 14px; background: light-dark(#e9edf4, #10141c); box-shadow: none; }
body { -webkit-font-smoothing: antialiased; }
#mountPoint { padding: 0; }
#app-container { width: 100%; max-width: 480px; border-radius: 0; background: var(--app-surface); box-shadow: 0 0 60px #1726430d; }
#sidepanel, #info-view, #topic-view { width: 100%; min-width: 0; flex: 1; }
#sidepanel, #info-view { background: var(--app-page); }
.main-view { background: var(--app-surface) !important; }
.app-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
button, a, input, textarea { touch-action: manipulation; }
a:hover { text-decoration: none; }
button { height: 46px; line-height: 1.4; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 600; text-transform: none; box-shadow: none; margin: 0; }
button:active { box-shadow: none; transform: translateY(1px); }
button:hover:not([disabled]) { color: inherit; }
button.primary:hover:not([disabled]) { color: #fff; }
:where(button, a, [role=button], input, textarea):focus-visible { outline: 3px solid #90a5ff; outline-offset: 3px; }
button:disabled { opacity: .45; filter: none; }
.icon-button { width: 44px; height: 44px; min-width: 44px; border: 0; border-radius: 14px; display: inline-flex; justify-content: center; align-items: center; padding: 0; background: transparent; color: var(--app-ink); }
.icon-button:hover { background: var(--app-field); }
.mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(22px + env(safe-area-inset-top)) 22px 16px; flex-shrink: 0; background: var(--app-surface); }
.brand-label { display: block; font-size: 10px; letter-spacing: 1.7px; color: var(--app-accent); font-weight: 750; line-height: 1.5; }
.brand-label span { color: var(--app-muted); margin-left: 10px; font-size: 10px; letter-spacing: .7px; font-weight: 400; }
.mobile-header h1 { font-size: 27px; font-weight: 700; letter-spacing: -.7px; line-height: 1.35; margin-top: 5px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-compose { background: var(--app-accent-soft); color: var(--app-accent); border-radius: 15px; }
.connection-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--app-muted); white-space: nowrap; }
.connection-pill i { width: 5px; height: 5px; border-radius: 50%; background: #d59a47; }
.connection-pill.is-connected i { background: #31b496; }
.mobile-navigation { display: flex; justify-content: space-around; align-items: stretch; padding: 7px 10px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--app-line); background: var(--app-surface); flex: none; z-index: 5; }
.nav-item { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; flex: 1; min-width: 0; height: 52px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--app-muted); font-size: 11px; font-weight: 500; line-height: 1.3; }
.nav-symbol { position: relative; display: inline-flex; width: 48px; height: 30px; border-radius: 11px; justify-content: center; align-items: center; transition: background-color 140ms; }
.nav-item.is-active { color: var(--app-accent); font-weight: 650; }
.nav-item.is-active .nav-symbol { background: var(--app-accent-soft); }
.nav-unread { position: absolute; left: 28px; top: -3px; min-width: 17px; height: 17px; line-height: 15px; padding: 0 4px; border: 2px solid var(--app-surface); border-radius: 10px; font-size: 9px; font-weight: 700; color: #fff; background: #ed6570; }
.conversation-view { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.list-tools { padding: 0 22px; flex: none; }
.app-search { width: 100%; display: flex; align-items: center; gap: 9px; border-radius: 12px; padding: 0 12px; margin: 0; background: var(--app-field); color: var(--app-muted); border: 1px solid transparent; }
.app-search:focus-within { border-color: var(--app-accent); }
.app-search input[type=search] { height: 42px; width: 100%; flex: 1; min-width: 0; margin: 0; font-size: 14px; border: 0; box-shadow: none; background: transparent; padding: 0; outline: 0; }
.app-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { min-width: 30px; height: 32px; padding: 0; border: 0; background: none; color: var(--app-muted); }
.list-filters { display: flex; gap: 8px; padding: 16px 0 10px; }
.list-filters button { border: 0; min-width: 56px; height: 32px; border-radius: 9px; padding: 0 14px; font-size: 13px; color: var(--app-muted); background: transparent; font-weight: 500; }
.list-filters button.selected { background: var(--app-accent-soft); color: var(--app-accent); font-weight: 650; }
.list-filters button span { margin-left: 5px; font-size: 11px; }
.conversation-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 12px; }
.list-section-label { display: flex; align-items: center; gap: 7px; color: var(--app-muted); font-size: 11px; padding: 10px 24px 4px; }
.list-section-label span { font-size: 10px; background: var(--app-field); padding: 1px 5px; border-radius: 5px; }
.contact-box { padding: 0; margin: 0; }
.contact-box > li { min-height: 82px; padding: 14px 22px; align-items: center; background: var(--app-surface); overflow: visible; }
.contact-box > li::after { content: ''; position: absolute; height: 1px; left: 84px; right: 22px; bottom: 0; background: var(--app-line); }
.contact-box > li:last-child::after { display: none; }
.contact-box > li:hover { background: var(--app-page); }
.contact-box > li.selected, .contact-box > li.tpinned { background: var(--app-accent-soft); border-right: 0; }
.contact-box .avatar-box { width: 50px; height: 50px; min-width: 50px; min-height: 50px; margin-right: 13px; overflow: visible; font-size: 21px; }
.contact-box .avatar, .avatar-box .lettertile, img.avatar { width: 100%; height: 100%; border-radius: 16px; }
.lettertile > div { border-radius: inherit; }
.contact-box .text-box { flex: 1; min-width: 0; gap: 7px; }
.contact-box .text-box > div { min-width: 0; }
.contact-box .contact-title { font-size: 15px; font-weight: 600; letter-spacing: .1px; flex: 1; min-width: 0; }
.contact-box .contact-comment { font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--app-muted); gap: 4px; }
.contact-comment > span:not(.unread) { flex: 1; }
.conversation-time { font-size: 10px; font-weight: 400; color: var(--app-muted); margin-left: 10px; flex-shrink: 0; }
.unread { background: #ed6570; color: white; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: auto; border-radius: 9px; text-align: center; font-size: 10px; flex: none; }
.contact-box .menuTrigger { right: 5px; top: 32px; opacity: 0; }
.contact-box li:focus-within .menuTrigger, .contact-box li:hover .menuTrigger { opacity: .75; }
.online { background-color: #31b496; border: 2px solid var(--app-surface); width: 10px; height: 10px; right: -1px; bottom: -1px; }
.offline { display: none; }
.directory-add { display: flex; align-items: center; gap: 12px; width: calc(100% - 44px); margin: 7px 22px 13px; min-height: 70px; padding: 14px; text-align: left; background: var(--app-page); border: 1px solid var(--app-line); color: var(--app-ink); border-radius: 16px; }
.directory-add > div { flex: 1; min-width: 0; }
.directory-add strong { display: block; font-size: 14px; font-weight: 600; }
.directory-add small { display: block; margin-top: 4px; color: var(--app-muted); font-size: 11px; font-weight: 400; white-space: normal; }
.directory-add > .app-icon { color: var(--app-muted); }
.row-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--app-accent-soft); color: var(--app-accent); flex: none; }
.app-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px 32px; }
.empty-icon { display: grid; place-items: center; width: 78px; height: 78px; background: var(--app-accent-soft); color: var(--app-accent); border-radius: 26px; margin-bottom: 22px; }
.app-empty h2 { font-size: 17px; font-weight: 600; }
.app-empty p { font-size: 13px; color: var(--app-muted); margin: 10px 0 24px; line-height: 1.8; }
.mobile-home-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.profile-view { background: var(--app-page); padding: 8px 18px 20px; }
.profile-identity { display: flex; align-items: center; gap: 16px; width: 100%; height: auto; padding: 25px 4px 28px; background: transparent; color: var(--app-ink); text-align: left; border: 0; }
.profile-identity > .avatar-box { height: 70px; width: 70px; font-size: 29px; }
.identity-copy { flex: 1; min-width: 0; }
.identity-copy h2 { font-size: 22px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy p { color: var(--app-muted); font-size: 11px; font-weight: 400; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; }
.identity-copy > span { display: block; color: var(--app-accent); font-size: 11px; font-weight: 400; margin-top: 10px; }
.profile-identity > .app-icon { color: var(--app-muted); }
.profile-note { color: var(--app-muted); font-size: 13px; line-height: 1.6; padding: 0 5px 20px; overflow-wrap: anywhere; }
.profile-section { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 17px; overflow: hidden; margin-bottom: 16px; }
.profile-row { display: flex; align-items: center; gap: 12px; width: 100%; height: 65px; border: 0; border-radius: 0; padding: 0 15px; background: transparent; color: var(--app-ink); text-align: left; font-weight: 500; font-size: 14px; position: relative; }
.profile-row:not(:last-child)::after { content: ''; position: absolute; bottom: 0; left: 64px; right: 16px; height: 1px; background: var(--app-line); }
.profile-row > span:nth-child(2) { flex: 1; }
.profile-row small { font-size: 11px; color: var(--app-muted); font-weight: 400; }
.profile-row > .app-icon { color: var(--app-muted); }
.profile-row .row-icon { width: 34px; height: 34px; background: var(--app-page); color: #637590; border-radius: 10px; }
.profile-row:hover { background: var(--app-page); }
.section-eyebrow { font-size: 11px; color: var(--app-muted); padding: 2px 5px 10px; letter-spacing: .5px; }
.profile-footnote { font-size: 11px; color: var(--app-muted); text-align: center; padding: 15px 0; letter-spacing: .5px; }
/* Shared details and settings. */
.caption-panel { min-height: 64px; height: auto; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; box-shadow: none; border-bottom: 1px solid var(--app-line); gap: 6px; background: var(--app-surface); }
#side-caption-panel, #info-caption-panel, #topic-caption-panel { background: var(--app-surface); color: var(--app-ink); }
#side-caption-panel a, #side-caption-panel :hover, #info-caption-panel a, #topic-caption-panel a { color: var(--app-ink); padding-left: 0; }
.panel-title, #sidepanel-title { font-size: 17px; font-weight: 600; margin-left: 0; }
.scrollable-panel { margin: 0; min-height: 0; scroll-behavior: auto; padding-bottom: env(safe-area-inset-bottom); }
.panel-form-column, .panel-form-row { padding: 16px 22px; line-height: 1.7; }
.panel-form-column > .group { margin: 8px 0; }
label.small { color: var(--app-muted); font-size: 12px; }
.hr { border: 0; height: 1px; background: var(--app-line); margin: 4px 22px; }
.flat-button { min-height: 48px; display: flex; align-items: center; font-size: 14px; color: var(--app-ink); border-radius: 10px; }
.flat-button .material-icons { color: var(--app-accent); margin-right: 8px; font-size: 22px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=search], textarea { border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface); box-shadow: none; height: 48px; padding: 10px 13px; font-size: 16px; }
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=tel]:focus, input[type=search]:focus, textarea:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px light-dark(#4665ed12, #8093ff15); }
input::placeholder, textarea::placeholder { font-weight: 400; }
.group-focus { position: relative; }
.group-focus .with-icon-right { margin-right: 0; padding-right: 48px; }
.password-toggle { position: absolute; display: grid; place-items: center; right: 2px; top: 4px; width: 44px; min-width: 44px; height: 44px; padding: 0; background: transparent; color: var(--app-muted); border: 0; }
.tabbar { padding: 10px 16px; background: var(--app-surface); border: 0; gap: 6px; }
.tabbar li { flex: 1; border: 0; border-radius: 10px; overflow: hidden; }
.tabbar li a { padding: 12px 6px; text-align: center; font-size: 13px; color: var(--app-muted); text-transform: none; }
.tabbar li.active { background: var(--app-accent-soft); border: 0; }
.tabbar li.active a { color: var(--app-accent); }
.center-medium-text { padding: 40px 24px; color: var(--app-muted); font-size: 14px; line-height: 1.8; }
.avatar-upload { margin: 14px auto; }
.avatar-upload .avatar, .avatar-upload .blank, .avatar-upload img.preview { border-radius: 28px; }
.info-box { margin: 8px 16px; border-radius: 12px; font-size: 13px; flex: none; }
.view-login { background: var(--app-surface) !important; }
.view-login .caption-panel { border: 0; }
.view-login #sidepanel-title { font-size: 14px; color: var(--app-muted); }
#login-form { padding: 12px 30px 26px; overflow: auto; flex: 1; }
.login-hero { padding: 8px 0 30px; }
.login-mark { display: grid; place-items: center; width: 65px; height: 65px; border-radius: 22px; background: #4665ed; color: white; margin-bottom: 20px; box-shadow: 0 10px 24px #4665ed22; }
.login-hero h1 { font-size: 33px; font-weight: 650; line-height: 1.45; letter-spacing: -1px; margin: 12px 0 10px; }
.login-hero p { color: var(--app-muted); font-size: 13px; }
.input-label { display: block; font-size: 12px; font-weight: 600; margin: 14px 0 5px; }
#login-form input { background: var(--app-field); border-color: transparent; }
#login-form input:focus { border-color: var(--app-accent); }
#login-form .panel-form-row { padding: 15px 0 23px; font-size: 12px; }
#login-form .panel-form-row label { font-size: 12px; color: var(--app-muted); }
#login-form .dialog-buttons { padding: 0; }
#login-form .dialog-buttons button { width: 100%; height: 50px; margin: 0; }
.login-register { display: flex; justify-content: center; gap: 7px; color: var(--app-muted); font-size: 13px; margin-top: 25px; }
.login-register a { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.login-signature { color: var(--app-muted); text-align: center; font-size: 11px; letter-spacing: 1px; margin-top: 36px; }
/* Conversation details. */
#topic-caption-panel { padding-left: 8px; padding-right: 12px; }
#topic-caption-panel .avatar-box { width: 38px; min-width: 38px; height: 38px; font-size: 17px; margin-right: 5px; }
#topic-caption-panel .avatar-box .avatar { border-radius: 12px; }
#hide-message-view { margin: 0; min-width: 36px; width: 36px; }
#topic-title { font-size: 15px; line-height: 1.45; }
#topic-last-seen { font-size: 10px; color: var(--app-muted); margin-top: 3px; }
#topic-users { display: none; }
#messages-container { min-height: 0; flex: 1; }
#messages-container::before { background-color: var(--app-page); }
#messages-panel { padding: 18px 16px; overflow-x: hidden; }
.chat-box, .chat-box.group { padding: 0 0 15px; margin: 0; }
.chat-box li.single { margin-bottom: 17px; }
.chat-box li.first, .chat-box li.middle { margin-bottom: 5px; }
.chat-box li.last { margin-bottom: 17px; }
.bubble { max-width: 86%; min-width: 70px; border-radius: 17px; padding: 11px 12px; filter: none; box-shadow: 0 2px 4px #17264304; }
.left .bubble { border: 1px solid var(--app-line); margin-right: 20px; }
.right .bubble { margin-left: 20px; }
.left .bubble.tip { border-bottom-left-radius: 5px; }
.right .bubble.tip { border-bottom-right-radius: 5px; }
.bubble.tip::before { display: none; }
.bubble div.message-content { padding: 0; font-size: max(15px, var(--message-text-size)); line-height: 1.65; }
.chat-box .timestamp { font-size: 10px; line-height: 1.4; top: 4px; padding-left: 10px; }
.chat-box .timestamp .material-icons { font-size: 14px; }
.chat-box .meta { margin: 8px 0 23px; }
.chat-box .meta .bubble { padding: 0; border: 0; box-shadow: none; font-size: 10px; }
.chat-box .avatar-box { width: 27px; height: 27px; min-width: 27px; min-height: 27px; margin-right: 8px; margin-bottom: 4px; font-size: 12px; }
.chat-box .author { font-size: 11px; padding-bottom: 5px; }
#send-message-wrapper { background: var(--app-surface); border-top: 1px solid var(--app-line); box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }
#send-message-panel { background: var(--app-surface); min-height: 74px; padding: 12px 14px; gap: 5px; }
#send-message-panel > a { display: inline-flex; width: 34px; height: 44px; align-items: center; justify-content: center; flex: none; color: #8390a6; }
#send-message-input { margin: 0 5px; padding: 10px 12px; min-height: 44px; max-height: 130px; height: 44px; font-size: 16px; line-height: 23px; border: 1px solid transparent; background: var(--app-field); border-radius: 13px; transition-property: -tinode-mobile; }
#send-message-input:focus { border-color: var(--app-line); box-shadow: none; }
.composer-send { display: grid; place-items: center; background: #4665ed; color: white; border: 0; border-radius: 14px; padding: 0; min-width: 42px; width: 42px; height: 44px; }
.composer-send:hover:not([disabled]) { color: #fff; background: #3655da; }
.composer-send:disabled { opacity: 1; background: var(--app-accent-soft); color: #9aa9d4; }
#reply-quote-preview { margin: 8px 14px 0; border-radius: 12px; background: var(--app-field); font-size: 13px; }
.doc-card { border: 1px solid var(--app-line); border-radius: 12px; padding: 10px; background: var(--app-surface); }
#image-preview { background: var(--app-page); }
#preview-caption-panel, #image-preview-footer { background: var(--app-surface); padding: 12px; box-shadow: none; }
#preview-caption-panel a { color: var(--app-ink); }
#go-to-latest { border: 1px solid var(--app-line); background: var(--app-surface); color: var(--app-accent); box-shadow: 0 4px 18px #18295214; }
.context-menu { border: 1px solid var(--app-line); border-radius: 14px; box-shadow: 0 8px 32px #1c2d4b20; overflow: hidden; }
.context-menu li { padding: 12px 18px; min-height: 44px; font-size: 14px; }
.alert, .forward-dialog { border-radius: 20px; max-width: calc(100% - 32px); box-shadow: 0 20px 70px #17264330; }
.forward-dialog { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; }
@media (max-width: 360px) {
  .mobile-header { padding-left: 18px; padding-right: 18px; }
  .brand-label span { display: none; }
  .header-actions { gap: 9px; }
  .list-tools { padding: 0 18px; }
  .contact-box > li { padding: 13px 18px; }
  .profile-row small { display: none; }
  #send-message-panel { padding: 10px 8px; gap: 2px; }
  #send-message-panel > a { width: 29px; }
  .bubble { max-width: 87%; }
  #login-form { padding: 0 24px 24px; }
  .login-hero h1 { font-size: 29px; }
  .login-hero { padding-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Final interaction, avatar and intrinsic-size refinements. */
.nav-item.is-active:hover:not([disabled]), .list-filters button.selected:hover:not([disabled]) { color: var(--app-accent); }
.nav-symbol { transition: none; }
.app-checkbox { width: 19px; height: 19px; min-width: 19px; margin: 0; accent-color: #4665ed; cursor: pointer; }
.app-checkbox + label { cursor: pointer; }
.chat-box li > div:not(.avatar-box) { max-width: 86%; min-width: 0; }
.chat-box li.meta > div { max-width: 100%; }
.chat-box .bubble { max-width: 100%; }
.chat-box .right .bubble, .chat-box .left .bubble { margin: 0; }
.chat-box .bubble .inline-image { max-width: 100%; border-radius: 10px; }
.chat-box .bubble img.inline-image { height: auto; object-fit: contain; }
.chat-box .meta .message-content { font-size: 11px; }
.chat-box .menuTrigger { opacity: .2; right: 3px; top: 3px; }
.chat-box .menuTrigger .material-icons { font-size: 15px; }
/* Shared identity palette: topic IDs already select a stable color class. */
.lettertile {
  --avatar-top: #729ded;
  --avatar-bottom: #4169ce;
  position: relative;
  width: 100%;
  height: 100%;
  padding-bottom: 0;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(ellipse at 24% 0%, #ffffff20, transparent 65%),
    linear-gradient(155deg, var(--avatar-top), var(--avatar-bottom));
  box-shadow: inset 0 1px 0 #ffffff36, inset 0 -1px 1px #182e5214, 0 2px 4px #2034540e;
}
.lettertile:is(.lt-bg-0, .dk-bg-0, .lt-bg-8, .dk-bg-8) { --avatar-top: #65b8ab; --avatar-bottom: #318e83; }
.lettertile:is(.lt-bg-1, .dk-bg-1, .lt-bg-9, .dk-bg-9) { --avatar-top: #ae89e6; --avatar-bottom: #7e57be; }
.lettertile:is(.lt-bg-2, .dk-bg-2, .lt-bg-10, .dk-bg-10) { --avatar-top: #729ded; --avatar-bottom: #4169ce; }
.lettertile:is(.lt-bg-3, .dk-bg-3, .lt-bg-11, .dk-bg-11) { --avatar-top: #ecaa79; --avatar-bottom: #cf7455; }
.lettertile:is(.lt-bg-4, .dk-bg-4, .lt-bg-12, .dk-bg-12) { --avatar-top: #72bce0; --avatar-bottom: #3c8abe; }
.lettertile:is(.lt-bg-5, .dk-bg-5, .lt-bg-13, .dk-bg-13) { --avatar-top: #df91b2; --avatar-bottom: #b65586; }
.lettertile:is(.lt-bg-6, .dk-bg-6, .lt-bg-14, .dk-bg-14) { --avatar-top: #8bba83; --avatar-bottom: #4e8e69; }
.lettertile:is(.lt-bg-7, .dk-bg-7, .lt-bg-15, .dk-bg-15) { --avatar-top: #8e9bdf; --avatar-bottom: #6268ba; }
.lettertile > div {
  border-radius: inherit;
  padding-top: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
  letter-spacing: -.025em;
  color: #fff;
  text-shadow: 0 1px 2px #20375c1c;
}
#topic-caption-panel .lettertile, #topic-caption-panel .lettertile > div { border-radius: 12px; }
.profile-identity .lettertile, .profile-identity .lettertile > div { border-radius: 22px; }
#settings-form.app-settings { padding: 18px; }
.settings-section { border: 1px solid var(--app-line); border-radius: 16px; padding: 20px 17px; margin-bottom: 16px; background: var(--app-surface); }
.settings-section h2 { font-size: 15px; font-weight: 600; }
.settings-section h2 span { float: right; color: var(--app-accent); font-size: 12px; }
.settings-section > p { font-size: 12px; color: var(--app-muted); margin-top: 6px; }
.theme-options { display: flex; gap: 12px; padding-top: 18px; }
.theme-option { position: relative; flex: 1; min-width: 0; font-size: 12px; text-align: center; margin: 0; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-preview { display: flex; flex-direction: column; gap: 9px; background: #f1f3fa; border: 2px solid transparent; border-radius: 12px; height: 100px; padding: 14px 9px; margin-bottom: 9px; }
.theme-preview i { display: block; width: 70%; height: 12px; background: #fff; border-radius: 4px; }
.theme-preview i:nth-child(2) { align-self: flex-end; background: #b6c4ff; }
.theme-dark .theme-preview { background: #252e41; }
.theme-dark .theme-preview i { background: #435371; }
.theme-dark .theme-preview i:nth-child(2) { background: #7e91d5; }
.theme-auto .theme-preview { background: linear-gradient(90deg,#f1f3fa 50%,#252e41 50%); }
.theme-option input:checked + .theme-preview { border-color: var(--app-accent); }
.theme-option input:focus-visible + .theme-preview { outline: 3px solid #90a5ff; outline-offset: 2px; }
.theme-option:has(input:checked) { color: var(--app-accent); }
.text-size-preview { padding: 17px 12px; border-radius: 11px; background: var(--app-page); margin: 16px 0; line-height: 1.6; }
.range-label { font-size: 12px; color: var(--app-muted); }
.settings-section input[type=range] { width: 100%; height: 30px; accent-color: #4665ed; }
.range-extents { display: flex; justify-content: space-between; color: var(--app-muted); font-size: 11px; }
.settings-wallpaper { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: transparent; font-size: 14px; color: var(--app-ink); height: 28px; }
.settings-wallpaper span { font-size: 12px; font-weight: 400; color: var(--app-muted); }
.settings-choice { display: flex; align-items: center; gap: 12px; font-size: 13px; padding-top: 20px; cursor: pointer; }
.settings-choice small { display: block; font-size: 11px; margin-top: 5px; color: var(--app-muted); }
.settings-choice input { accent-color: #4665ed; width: 18px; height: 18px; }
.advanced-permissions { color: var(--app-muted); font-size: 13px; }
.advanced-permissions summary { padding: 12px 0; cursor: pointer; }
/* Media uses upstream inline dimensions; clamp both minima and height to the bubble. */
.chat-box .bubble img.inline-image { min-width: 0 !important; min-height: 0 !important; height: auto !important; }
#settings-form .settings-choice { display: flex; }
.list-filters button { min-height: 44px; }
.list-filters { padding-top: 10px; padding-bottom: 6px; }
.about-view { padding: 36px 22px; text-align: center; }
.about-view .login-mark { margin: 0 auto 16px; }
.about-view > h1 { font-size: 27px; font-weight: 650; }
.about-view > p { color: var(--app-muted); margin: 10px 0 30px; font-size: 13px; }
.about-view .settings-section { text-align: left; }
.about-view .settings-section p { line-height: 1.8; }
.about-view .settings-section a { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; font-size: 14px; }
.version-details { text-align: left; color: var(--app-muted); font-size: 12px; padding: 10px; }
.version-details summary { cursor: pointer; }
.version-details p { margin-top: 10px; }
ul.tabbar { padding: 12px 18px; background: var(--app-surface); gap: 6px; }
ul.tabbar > li { flex: 1; height: 44px; border-radius: 10px; box-shadow: none; background: transparent; }
ul.tabbar > li > a { display: flex; height: 44px; align-items: center; justify-content: center; padding: 0 8px; line-height: 1.3; font-size: 13px; color: var(--app-muted); }
ul.tabbar li.active { background: var(--app-accent-soft); }
ul.tabbar li.active > a { color: var(--app-accent); font-weight: 600; }
ul.tabbar li::after { display: none; }
.contact-search-form { display: flex; align-items: center; gap: 10px; padding: 16px 20px; flex: none; }
.contact-search-form .app-search { flex: 1; min-width: 0; background: var(--app-surface); border: 1px solid var(--app-line); }
.contact-search-form .search-submit { border: 0; background: transparent; min-width: 40px; padding: 0 2px; color: var(--app-accent); font-size: 14px; }
.view-newtpk .panel-form { overflow-y: auto; }
.group-create-form .avatar-upload, .group-create-form .avatar-upload .avatar-box, .group-create-form .avatar-upload .blank, .group-create-form .avatar-upload img.preview { width: 88px; height: 88px; }
.group-create-form .avatar-upload .blank { line-height: 88px; font-size: 11px; border-radius: 24px; }
.group-create-form .panel-form-column { padding-top: 2px; }
.group-options { margin: 5px 22px; font-size: 13px; color: var(--app-muted); }
.group-options summary { padding: 12px 0; cursor: pointer; }
.group-create-form .dialog-buttons, .registration-form .dialog-buttons { padding: 18px 22px 26px; }
.group-create-form .dialog-buttons button, .registration-form .dialog-buttons button { width: 100%; margin: 0; height: 48px; }
.registration-form { overflow-y: auto; flex: 1; }
.registration-heading { padding: 10px 0 8px; }
.registration-heading h1 { font-size: 25px; font-weight: 650; }
.registration-heading p { font-size: 13px; color: var(--app-muted); margin-top: 8px; }
.registration-form .register-identity { flex-direction: column-reverse; }
.register-identity .umn { width: 100%; }
.registration-form .avatar-upload, .registration-form .avatar-upload .avatar-box, .registration-form .avatar-upload .blank, .registration-form .avatar-upload img.preview { width: 80px; height: 80px; }
.registration-form .avatar-upload .blank { line-height: 80px; border-radius: 24px; font-size: 10px; }
.registration-form .dialog-buttons { padding-left: 0; padding-right: 0; }
.view-edit .avatar-upload, .view-edit .avatar-upload .avatar-box { width: 92px; height: 92px; font-size: 36px; }
.hr { min-height: 1px; max-height: 1px; box-shadow: none; flex: none; }
#info-view-content > .panel-form-column:first-child { margin: 16px; border: 1px solid var(--app-line); border-radius: 18px; padding: 16px; background: var(--app-surface); }
#info-view-content .avatar-upload, #info-view-content .avatar-upload .avatar-box { width: 86px; height: 86px; font-size: 34px; }
#info-view-content .panel-form-row { flex-wrap: wrap; gap: 5px; }
#info-view-content .panel-form-row > div:first-child { min-width: 0; }
#info-view-content tt { font-size: 11px; overflow-wrap: anywhere; }
#info-view-content .large { font-size: 17px; font-weight: 600; }
#info-view-content .flat-button { padding: 0 10px; }
#info-view-content .contact-box { margin: 0 16px 16px; border: 1px solid var(--app-line); border-radius: 16px; overflow: hidden; }
#info-view-content .contact-box > li { padding: 14px; }
.avatar-upload label.round { display: grid; place-items: center; background: var(--app-surface); border: 1px solid var(--app-line); color: var(--app-accent); }
.avatar-upload .blank { border-color: var(--app-line); background: var(--app-field); color: var(--app-muted); }
.app-loading { display: flex; flex-direction: column; flex: 1; align-items: center; justify-content: center; gap: 16px; color: var(--app-muted); background: var(--app-page); font-size: 13px; }
.app-loading::before { content: ''; width: 26px; height: 26px; border: 2px solid var(--app-line); border-top-color: var(--app-accent); border-radius: 50%; animation: app-spin .8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
input[type=text]::placeholder, input[type=password]::placeholder, input[type=email]::placeholder, input[type=tel]::placeholder, input[type=search]::placeholder, textarea::placeholder { color: var(--app-muted); opacity: 1; font-weight: 400; }
.conversation-welcome { text-align: center; padding: 58px 20px 30px; color: var(--app-muted); }
.conversation-welcome > span { display: inline-grid; place-items: center; width: 70px; height: 70px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 24px; color: #9aa9cc; }
.conversation-welcome h2 { font-size: 15px; color: var(--app-ink); font-weight: 500; margin: 20px 0 10px; }
.conversation-welcome p { font-size: 12px; }
.chip-input { border: 1px solid var(--app-line); background: var(--app-surface); border-radius: 13px; padding: 8px; box-shadow: none; gap: 5px; }
.chip-input.focused { border: 1px solid var(--app-accent); box-shadow: 0 0 0 3px #4665ed12; }
.chip-input > input[type=text] { min-width: 80px; width: 100%; min-height: 40px; height: 40px; flex: 1 1 100px; border-radius: 8px; padding: 6px; outline: 0; background: transparent; }
.chip { min-height: 30px; background: var(--app-accent-soft); color: var(--app-accent); border-radius: 9px; padding-right: 7px; font-size: 12px; }
.chip .avatar-box { width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin-left: 3px; font-size: 12px; }
#group-manager-buttons { height: auto; min-height: 76px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); gap: 12px; border: 0; border-top: 1px solid var(--app-line); box-shadow: none; background: var(--app-surface); }
#group-manager-buttons button { flex: 1; }
.bubble div.message-content { font-size: var(--message-text-size, 16px); }
span.in-place-edit { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 13px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface); font-size: 15px; margin: 7px 0; }
span.in-place-edit > span { flex: 1; min-width: 0; }
span.in-place-edit > .app-icon { color: var(--app-muted); }
span.in-place-edit.placeholder { color: var(--app-muted); }
.edit-hint { font-size: 12px; color: var(--app-muted); line-height: 1.7; }
.topic-edit-form .avatar-upload, .topic-edit-form .avatar-upload .avatar-box, .topic-edit-form .avatar-upload .blank, .topic-edit-form .avatar-upload img.preview { width: 92px; height: 92px; }
.topic-edit-form .avatar-upload .blank { line-height: 92px; font-size: 11px; border-radius: 24px; }
.topic-edit-form .avatar-upload { margin: 22px auto; }

/* Public discovery: feed, publishing and discussion use the same mobile shell. */
.feed-tabs {display:flex;align-items:center;gap:24px;padding:0 22px 10px;flex-shrink:0;background:var(--app-surface);}
.feed-tabs button[role=tab] {position:relative;padding:0;height:38px;background:none;border:0;border-radius:0;color:var(--app-muted);font-size:15px;font-weight:500;}
.feed-tabs button[aria-selected=true] {color:var(--app-ink);font-weight:700;}
.feed-tabs button[aria-selected=true]::after {content:'';position:absolute;bottom:0;left:calc(50% - 9px);width:18px;height:3px;background:var(--app-accent);border-radius:3px;}
.feed-tabs .icon-button {margin-left:auto;height:36px;color:var(--app-muted);}
.discover-feed {background:var(--app-page);padding:16px 16px 0;}
.feed-invitation {position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;min-height:135px;padding:21px 20px;border:1px solid light-dark(#e4eafd,#354263);border-radius:20px;background:light-dark(linear-gradient(110deg,#edf1ff,#f4f6ff),linear-gradient(110deg,#283550,#1e293e));}
.feed-invitation>div {position:relative;z-index:1;}
.feed-invitation span:not(.feed-orbit) {font-size:10px;letter-spacing:2px;color:var(--app-accent);}
.feed-invitation h2 {font-size:21px;letter-spacing:-.6px;line-height:1.6;margin:5px 0 3px;}
.feed-invitation p {font-size:11px;color:var(--app-muted);line-height:1.6;}
.feed-orbit {position:absolute;right:16px;top:26px;display:grid;place-items:center;width:83px;height:83px;color:var(--app-accent);opacity:.25;transform:rotate(-16deg);border:1px solid currentColor;border-radius:50%;}
.feed-orbit i {position:absolute;right:1px;top:3px;width:10px;height:10px;background:var(--app-accent);border-radius:50%;box-shadow:0 0 0 5px var(--app-accent-soft);}
.feed-compose-entry {display:flex;align-items:center;gap:11px;background:var(--app-surface);border:1px solid var(--app-line);width:100%;height:74px;margin-top:12px;padding:0 16px;border-radius:17px;color:var(--app-muted);text-align:left;font-size:13px;font-weight:400;}
.feed-compose-entry>span:nth-child(2) {flex:1;}
.feed-compose-entry>.app-icon {color:var(--app-accent);}
.feed-avatar {display:inline-flex;flex-shrink:0;width:40px;height:40px;overflow:hidden;border-radius:14px;align-items:center;justify-content:center;background:var(--app-field);}
.feed-avatar .avatar,.feed-avatar .lettertile,.feed-avatar .material-icons {width:100%;height:100%;min-width:0;min-height:0;border-radius:inherit;}
.feed-avatar img {object-fit:cover;}
.feed-avatar .lettertile>div {font-size:17px;line-height:40px;}
.feed-section-title {display:flex;align-items:center;justify-content:space-between;margin:23px 3px 13px;gap:8px;}
.feed-section-title h2 {font-size:15px;font-weight:650;}
.feed-section-title>span {font-size:10px;color:var(--app-muted);}
.feed-card {background:var(--app-surface);border:1px solid var(--app-line);border-radius:18px;padding:17px 16px 0;margin-bottom:12px;overflow:hidden;}
.feed-author {display:flex;gap:11px;align-items:center;min-width:0;}
.feed-author>div {min-width:0;flex:1;}
.feed-author strong {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:650;line-height:1.6;}
.feed-author>div>span {display:flex;gap:6px;align-items:center;font-size:10px;color:var(--app-muted);margin-top:3px;}
.feed-author i {font-style:normal;}
.feed-post-menu {color:var(--app-muted);width:36px;min-width:36px;height:40px;margin-right:-8px;}
.feed-post-text {margin:13px 0 12px;font-size:15px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;}
.feed-post-text.is-collapsed {display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;}
.feed-expand {height:32px;display:block;margin:-7px 0 8px;padding:0;color:var(--app-accent);font-size:12px;background:none;border:0;}
.feed-images {display:grid;gap:5px;margin:13px 0 14px;border-radius:12px;overflow:hidden;}
.feed-images.images-2 {grid-template-columns:repeat(2,minmax(0,1fr));}
.feed-images.images-3 {grid-template-columns:repeat(3,minmax(0,1fr));}
.feed-images button {padding:0;border:0;height:auto;border-radius:0;background:var(--app-field);overflow:hidden;aspect-ratio:1;}
.feed-images img {display:block;width:100%;height:100%;object-fit:cover;}
.feed-images.images-1 button {max-height:360px;aspect-ratio:auto;}
.feed-images.images-1 img {height:auto;max-height:360px;object-fit:cover;}
.feed-card-actions {border-top:1px solid var(--app-line);height:51px;display:flex;align-items:center;gap:24px;}
.feed-card-actions button {display:flex;align-items:center;gap:7px;padding:0 2px;height:44px;min-width:48px;border:0;background:none;color:var(--app-muted);font-weight:400;font-size:12px;}
.feed-card-actions button.is-liked {color:light-dark(#d95778,#ff88a6);}
.feed-card-actions .is-liked svg {fill:light-dark(#fbe7ed,#612e42);}
.feed-public-note {margin-left:auto;font-size:9px;color:var(--app-muted);}
.feed-empty {padding:28px 12px 37px;text-align:center;}
.feed-empty>span {display:inline-flex;align-items:center;justify-content:center;width:66px;height:66px;border-radius:22px;background:var(--app-accent-soft);color:var(--app-accent);}
.feed-empty h3 {font-size:17px;margin-top:18px;}
.feed-empty p {font-size:12px;color:var(--app-muted);line-height:1.9;margin:10px 0 21px;white-space:pre-line;}
.feed-empty .primary {display:inline-flex;gap:22px;align-items:center;justify-content:center;font-size:13px;}
.feed-notice {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;margin:10px 0;background:light-dark(#fff2e9,#442f24);color:light-dark(#95532b,#edb898);font-size:12px;line-height:1.7;border-radius:12px;overflow-wrap:anywhere;}
.feed-notice .icon-button {height:28px;min-width:28px;width:28px;color:inherit;}
.feed-load-more {display:block;margin:10px auto 24px;color:var(--app-accent);background:var(--app-accent-soft);font-size:12px;border:0;}
.feed-end {padding:14px 0 28px;text-align:center;color:var(--app-muted);font-size:10px;letter-spacing:1px;}
.feed-progress {color:var(--app-muted);font-size:12px;text-align:center;padding:12px;}
.feed-loading {text-align:center;font-size:12px;color:var(--app-muted);padding-bottom:30px;}
.feed-skeleton {display:block;height:118px;background:var(--app-surface);border:1px solid var(--app-line);border-radius:18px;margin-bottom:12px;}
.feed-toast {position:absolute;z-index:45;bottom:calc(85px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);white-space:nowrap;display:flex;gap:9px;align-items:center;padding:13px 17px;background:#253044ef;color:#fff;border-radius:12px;font-size:12px;box-shadow:0 6px 24px #15213a22;pointer-events:none;}
.feed-overlay {position:absolute;z-index:30;inset:0;background:var(--app-surface);display:flex;flex-direction:column;min-height:0;outline:none!important;}
.feed-dialog-header {flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--app-line);padding:calc(12px + env(safe-area-inset-top)) 17px 12px;min-height:68px;}
.feed-dialog-header h2 {font-size:16px;font-weight:650;}
.feed-dialog-header small {font-size:12px;font-weight:400;color:var(--app-muted);margin-left:7px;}
.feed-text-button {background:none;border:0;padding:0 6px;color:var(--app-muted);font-size:14px;}
.feed-dialog-header .feed-publish {height:36px;min-width:66px;font-size:13px;border-radius:10px;padding:0 14px;}
.feed-composer-scroll {padding:22px;overflow:auto;flex:1;min-height:0;}
.feed-composer textarea {display:block;width:100%;min-height:158px;resize:vertical;border:0;padding:20px 0 0;margin:0;background:transparent;color:var(--app-ink);font-size:16px;line-height:1.85;outline-offset:1px;}
.feed-composer textarea::placeholder {color:var(--app-muted);font-size:15px;}
.feed-counter {font-size:10px;text-align:right;color:var(--app-muted);padding:10px 0 17px;}
.over-limit {color:light-dark(#cb3655,#ff94ac)!important;}
.feed-draft-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.feed-draft-grid>div {position:relative;aspect-ratio:1;}
.feed-draft-grid img {width:100%;height:100%;object-fit:cover;border-radius:12px;}
.feed-draft-grid .icon-button {position:absolute;right:3px;top:3px;background:#172238bf;color:#fff;width:28px;height:28px;min-width:28px;border-radius:9px;}
.feed-add-image {aspect-ratio:1;height:auto;border:1px dashed light-dark(#cdd5e7,#44506c);background:var(--app-field);color:var(--app-muted);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;padding:8px;border-radius:12px;font-size:11px;font-weight:400;}
.feed-composer-footer {display:flex;align-items:center;justify-content:center;gap:8px;color:var(--app-muted);font-size:10px;border-top:1px solid var(--app-line);padding:17px 14px calc(17px + env(safe-area-inset-bottom));}
.feed-confirm-overlay {z-index:50;background:#17223866;align-items:center;justify-content:center;padding:22px;backdrop-filter:blur(3px);}
.feed-confirm {width:100%;max-width:340px;background:var(--app-surface);padding:24px;border-radius:22px;box-shadow:0 16px 60px #10233b26;}
.feed-confirm h3 {font-size:17px;}
.feed-confirm p {font-size:13px;line-height:1.8;color:var(--app-muted);margin:13px 0 23px;}
.feed-confirm>div {display:flex;gap:10px;}
.feed-confirm button {flex:1;border:0;background:var(--app-field);color:var(--app-ink);font-size:14px;}
.feed-confirm .feed-danger {background:light-dark(#fbeaf0,#4f2834);color:light-dark(#bc3152,#ff97b0);}
.feed-comment-scroll {flex:1;min-height:0;overflow:auto;padding:0 20px 16px;}
.feed-comment-context {border-bottom:1px solid var(--app-line);padding:17px 0;}
.feed-comment-context>span {font-size:11px;color:var(--app-muted);}
.feed-comment-context p {font-size:13px;line-height:1.7;margin-top:7px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:88px;overflow:auto;}
.feed-comment-empty {text-align:center;padding:52px 0;color:var(--app-muted);}
.feed-comment-empty h3 {font-size:15px;color:var(--app-ink);margin:16px 0 8px;}
.feed-comment-empty p {font-size:12px;}
.feed-comment {display:flex;gap:10px;padding:18px 0;border-bottom:1px solid var(--app-line);}
.feed-comment>.feed-avatar {width:33px;height:33px;border-radius:11px;}
.feed-comment .lettertile>div {font-size:14px;line-height:33px;}
.feed-comment>div {flex:1;min-width:0;}
.feed-comment strong {font-size:12px;font-weight:600;overflow-wrap:anywhere;}
.feed-comment p {font-size:14px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0;}
.feed-comment-meta {display:flex;align-items:center;gap:12px;color:var(--app-muted);font-size:10px;}
.feed-comment-meta button {height:30px;background:none;border:0;padding:0 7px;font-size:10px;font-weight:400;color:var(--app-muted);}
.feed-comment-form {flex:none;border-top:1px solid var(--app-line);padding:12px 17px calc(12px + env(safe-area-inset-bottom));}
.feed-comment-form textarea {display:block;width:100%;height:75px;max-height:160px;resize:vertical;margin:0;border:1px solid var(--app-line);border-radius:12px;padding:11px 12px;background:var(--app-field);font-size:14px;line-height:1.6;color:var(--app-ink);}
.feed-comment-form>div {display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px;}
.feed-comment-form span {color:var(--app-muted);font-size:10px;}
.feed-comment-form button {height:36px;font-size:12px;}
.feed-lightbox {background:#111620;justify-content:space-between;color:#fff;}
.feed-lightbox header {display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top)) 17px 10px;font-size:13px;}
.feed-lightbox .icon-button {color:#fff;}
.feed-lightbox>img {display:block;flex:1;min-height:0;width:100%;object-fit:contain;}
.feed-lightbox footer {display:flex;justify-content:space-between;padding:14px 18px calc(14px + env(safe-area-inset-bottom));}
.feed-lightbox footer button {display:flex;align-items:center;gap:8px;border:0;background:#ffffff14;color:#fff;font-size:12px;}
@media(max-width:360px) {.discover-feed{padding:12px 12px 0;}.feed-invitation{padding:18px 16px;}.feed-orbit{right:10px;opacity:.15;}.feed-public-note{display:none;}.feed-composer-scroll{padding:18px;}.feed-card{padding:15px 13px 0;}}
.feed-avatar {position:relative;}
.feed-avatar .lettertile {padding-bottom:0;}
.feed-composer textarea, .feed-comment-form textarea {resize:none;}

/* Mobile visual system. All primary screens share the same spacing, surfaces and controls. */
:root {
  --app-accent: light-dark(#4263df, #a2b5ff);
  --app-page: light-dark(#f5f7fb, #141b28);
  --app-surface: light-dark(#fff, #1e2736);
  --app-ink: light-dark(#202b40, #edf2fc);
  --app-muted: light-dark(#6e7a90, #a3afc4);
  --app-line: light-dark(#ecf0f6, #303c4e);
  --app-field: light-dark(#f2f5fa, #263244);
  --app-accent-soft: light-dark(#edf2ff, #2a395a);
  --app-shadow: 0 4px 18px light-dark(#263c6405, #0000000d);
  --clr-bubble-right-bg: #496be7;
  --clr-bubble-left-bg: var(--app-surface);
  --caption-panel-height: 68px;
}
html, body { background: light-dark(#e8edf5, #101620); }
#app-container { box-shadow: 0 12px 64px #17264312; }
button { transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
button:active { transform: none; }
button.primary, .composer-send { background: linear-gradient(155deg, #496bde, #3e5fd6); }
button.primary:active, .composer-send:active { filter: brightness(.94); }
.mobile-header { min-height: 84px; padding: calc(20px + env(safe-area-inset-top)) 20px 16px 24px; }
.mobile-header h1 { margin: 0; font-size: 28px; line-height: 1.35; letter-spacing: -.7px; font-weight: 650; }
.header-actions { gap: 10px; }
.header-compose { width: 44px; height: 44px; border-radius: 15px; color: var(--app-accent); background: var(--app-accent-soft); box-shadow: inset 0 1px 0 light-dark(#ffffffb3, #ffffff0a); }
.header-compose:active { background: light-dark(#e0e8ff, #34466b); }
.header-profile .header-compose { background: var(--app-field); color: var(--app-ink); }
.header-connection { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--app-muted); }
.header-connection i { width: 5px; height: 5px; background: #dba55a; border-radius: 50%; }

/* Icon, label and touch target dimensions stay identical in every tab state. */
.mobile-navigation { padding: 8px 12px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--app-line); background: var(--app-surface); box-shadow: 0 -6px 24px light-dark(#24365304, #00000010); }
.mobile-navigation .nav-item { height: 56px; gap: 4px; border-radius: 14px; color: light-dark(#78859a, #a4afc2); font-size: 11px; line-height: 15px; font-weight: 500; transition: color 140ms ease; }
.mobile-navigation .nav-symbol { width: 48px; height: 32px; border-radius: 12px; background: transparent; transition: background-color 140ms ease, filter 120ms ease; }
.navigation-icon { display: block; flex: none; overflow: visible; }
.nav-label { min-height: 15px; letter-spacing: .02em; white-space: nowrap; }
.mobile-navigation .nav-item.is-active { color: var(--app-accent); font-weight: 600; }
.mobile-navigation .nav-item.is-active .nav-symbol { background: var(--app-accent-soft); box-shadow: inset 0 1px 0 light-dark(#ffffff80, #ffffff05); }
.mobile-navigation .nav-item:active { transform: none; }
.mobile-navigation .nav-item:active .nav-symbol { background: var(--app-accent-soft); filter: brightness(.94); }
.mobile-navigation .nav-item:focus-visible { outline-offset: -2px; }
.mobile-navigation .nav-unread { display: grid; place-items: center; left: auto; right: -3px; top: -2px; min-width: 20px; height: 20px; padding: 0 4px; border: 2px solid var(--app-surface); border-radius: 10px; background: #ee586b; color: #fff; font-size: 10px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .mobile-navigation .nav-item:not(.is-active):hover .nav-symbol { background: var(--app-field); } }

/* Conversation list: quiet metadata, prominent identities, one consistent alignment. */
.list-tools { padding: 0 20px; }
.app-search { border-radius: 14px; gap: 9px; padding: 0 14px; border: 1px solid light-dark(#eaf0f7, #303c4e); background: var(--app-field); transition: border-color 150ms, box-shadow 150ms; }
.app-search:focus-within { border-color: light-dark(#a6b8f4, #839bd6); box-shadow: 0 0 0 3px light-dark(#4665ed0a, #839bd612); }
.app-search input[type=search] { height: 46px; font-size: 14px; }
.app-search .search-clear { width: 44px; min-width: 44px; height: 44px; }
.list-filters { padding: 4px; gap: 4px; margin: 14px 0 10px; border: 1px solid var(--app-line); border-radius: 13px; background: var(--app-field); }
.list-filters button { flex: 1; min-width: 0; min-height: 40px; height: 40px; padding: 0 8px; border-radius: 9px; font-size: 13px; font-weight: 500; }
.list-filters button.selected { background: var(--app-surface); color: var(--app-accent); box-shadow: 0 2px 6px light-dark(#25395f0a, #00000020), 0 0 0 1px light-dark(#25395f04, #ffffff04); }
.list-filters button span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; background: var(--app-accent-soft); font-size: 10px; }
.conversation-scroll { padding: 2px 0 12px; scrollbar-width: thin; scrollbar-color: var(--app-line) transparent; }
.contact-box > li { padding: 15px 22px; min-height: 88px; transition: background-color 140ms ease; }
.contact-box > li::after { left: 92px; right: 22px; background: var(--app-line); }
.contact-box > li.selected { background: var(--app-surface); }
.contact-box > li:active { background: var(--app-field); }
.contact-box > li.tpinned { background: light-dark(#f7f9ff, #202e46); }
.contact-box .avatar-box { width: 54px; height: 54px; min-width: 54px; min-height: 54px; margin-right: 15px; }
.contact-box .contact-title { font-size: 16px; line-height: 1.5; font-weight: 600; letter-spacing: 0; }
.contact-box .contact-comment { font-size: 13px; line-height: 1.55; }
.contact-box .text-box { gap: 6px; }
.conversation-time { font-size: 10px; line-height: 1.5; margin-left: 9px; font-variant-numeric: tabular-nums; }
.contact-box .as-badge { color: var(--app-muted); font-size: 15px; opacity: .75; }
.contact-box .contact-comment .material-icons { font-size: 16px; }
.contact-pin { color: var(--app-accent); margin-left: 7px; }
.contact-pin .app-icon { fill: currentColor; }
.contact-box .unread { background: #4b6be5; min-width: 20px; height: 20px; line-height: 20px; font-size: 10px; font-weight: 600; }
.contact-box .avatar, .avatar-box .lettertile, .avatar-box .lettertile > div, img.avatar,
#topic-caption-panel .avatar-box .avatar, #topic-caption-panel .lettertile, #topic-caption-panel .lettertile > div,
.profile-identity .lettertile, .profile-identity .lettertile > div { border-radius: 50%; }
img.avatar { object-fit: cover; box-shadow: 0 0 0 1px light-dark(#20345408, #ffffff0d), 0 2px 5px #2034540a; }
.online { width: 12px; height: 12px; bottom: 0; right: 0; background: #39b998; }

/* Directory shortcuts are distinct from people, with the same full-size touch targets. */
.directory-view { position: relative; }
.directory-view .list-tools { padding-bottom: 16px; }
.directory-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 0 20px 6px; background: var(--app-surface); }
.directory-add { width: 100%; min-height: 108px; height: auto; margin: 0; padding: 14px; gap: 10px; flex-wrap: wrap; border: 1px solid light-dark(#e6edfc, #334365); border-radius: 18px; background: light-dark(#f4f7ff, #25324b); }
.directory-add > div { flex: 1 1 100%; }
.directory-add strong { font-size: 13px; font-weight: 600; }
.directory-add small { font-size: 10px; margin-top: 3px; }
.directory-add > .app-icon { margin-left: auto; }
.directory-add .row-icon { width: 36px; height: 36px; border-radius: 11px; background: light-dark(#e4ecff, #354969); color: light-dark(#5274da, #b4c7ff); }
.groups-shortcut { background: light-dark(#f0f9f6, #203c38); border-color: light-dark(#e0f0e9, #2e4a42); }
.groups-shortcut .row-icon { background: light-dark(#ddf2e9, #2c4b43); color: light-dark(#378870, #a5d9c8); }
.directory-add > .app-icon { order: 0; }
.directory-add > div { order: 1; }
.groups-shortcut[aria-pressed=true] { box-shadow: inset 0 0 0 1px #5caa92; }
.list-section-label { padding: 19px 22px 12px; font-size: 12px; font-weight: 500; gap: 7px; }
.list-section-label span { font-size: 10px; background: var(--app-field); padding: 1px 6px; border-radius: 5px; }
.directory-letter { padding: 4px 22px; margin: 0; background: var(--app-page); font-size: 11px; line-height: 22px; color: var(--app-muted); font-weight: 600; }
.directory-groups { padding-right: 18px; }
.directory-groups .contact-box > li { min-height: 76px; padding-top: 11px; padding-bottom: 11px; }
.directory-groups .contact-box .avatar-box { width: 46px; height: 46px; min-width: 46px; min-height: 46px; }
.directory-groups .contact-box > li.tpinned { background: var(--app-surface); }
.directory-groups .contact-pin { display: none; }
.directory-index { position: absolute; top: 45%; right: 1px; transform: translateY(-25%); display: flex; flex-direction: column; max-height: 65%; overflow: auto; }
.directory-index button { width: 25px; min-height: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; color: var(--app-muted); background: transparent; font-size: 10px; font-weight: 500; }
.directory-index button:active { color: var(--app-accent); background: var(--app-accent-soft); }

/* Personal space: a restrained identity card and semantic, softly colored menu icons. */
.header-profile { background: var(--app-page); }
.profile-view { padding: 0 18px 18px; }
.profile-identity { position: relative; margin: 0 0 23px; width: 100%; padding: 23px 18px; background: light-dark(linear-gradient(120deg, #fff 40%, #eef3ff), linear-gradient(120deg,#243044,#2a3853)); border: 1px solid light-dark(#e5ecfa, #35435a); border-radius: 22px; gap: 15px; box-shadow: var(--app-shadow); }
.profile-identity > .avatar-box { width: 72px; min-width: 72px; height: 72px; min-height: 72px; padding: 3px; background: var(--app-surface); border: 1px solid light-dark(#e4eafa, #455572); border-radius: 50%; box-shadow: 0 4px 12px #334a7510; }
.identity-copy h2 { font-size: 20px; line-height: 1.4; font-weight: 650; }
.identity-copy p { font-size: 10px; margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.identity-copy > span { color: var(--app-muted); font-size: 11px; line-height: 1.6; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-edit { display: grid; place-items: center; flex: none; width: 30px; height: 34px; align-self: flex-start; color: var(--app-accent); }
.section-eyebrow { margin: 0; font-size: 11px; line-height: 1.5; color: var(--app-muted); padding: 0 6px 10px; font-weight: 500; letter-spacing: .04em; }
.profile-section { border: 1px solid var(--app-line); border-radius: 18px; margin-bottom: 19px; box-shadow: var(--app-shadow); }
.profile-row { min-height: 60px; height: 60px; gap: 13px; padding: 0 14px; font-size: 14px; }
.profile-row .row-icon { color: light-dark(#5775d3, #abc0ff); background: light-dark(#edf2ff, #2d3d60); width: 34px; height: 34px; border-radius: 11px; }
.profile-row .row-icon .app-icon { width: 20px; height: 20px; }
.profile-row.tone-green .row-icon { color: light-dark(#338571, #9fdac7); background: light-dark(#eaf7f2, #28463f); }
.profile-row.tone-amber .row-icon { color: light-dark(#b78333, #edd1a0); background: light-dark(#fff6e7, #4b402d); }
.profile-row.tone-violet .row-icon { color: light-dark(#8570c7, #c5b7fa); background: light-dark(#f2eefd, #3d3554); }
.profile-row.tone-rose .row-icon { color: light-dark(#be7593, #efbdd1); background: light-dark(#fbeef3, #4c3443); }
.profile-row.tone-slate .row-icon { color: light-dark(#7285a2, #b0bfd7); background: var(--app-field); }
.profile-row > .app-icon { width: 14px; height: 14px; color: light-dark(#a8b3c5, #8392aa); }
.profile-row:not(:last-child)::after { left: 61px; right: 14px; }

/* Public posts use a compact composer and readable, individually framed cards. */
.feed-tabs { gap: 8px; padding: 0 20px 14px; border: 0; }
.feed-tabs button[role=tab] { flex: 1; height: 42px; border-radius: 12px; font-size: 13px; background: var(--app-field); }
.feed-tabs button[aria-selected=true] { color: var(--app-accent); background: var(--app-accent-soft); }
.feed-tabs button[aria-selected=true]::after { display: none; }
.feed-tabs .icon-button { margin: 0; width: 44px; min-width: 44px; height: 44px; border: 1px solid var(--app-line); border-radius: 13px; }
.discover-feed { padding: 14px 14px 0; border-top: 1px solid var(--app-line); }
.feed-compose-entry { height: 70px; margin: 0 0 14px; padding: 0 13px; border-radius: 18px; box-shadow: var(--app-shadow); }
.feed-compose-entry .feed-avatar { width: 38px; height: 38px; }
.feed-compose-image { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--app-accent); background: var(--app-accent-soft); }
.feed-card { border: 1px solid var(--app-line); border-radius: 20px; padding: 16px 16px 8px; margin-bottom: 14px; overflow: visible; box-shadow: var(--app-shadow); }
.feed-avatar, .feed-comment > .feed-avatar { width: 42px; height: 42px; border-radius: 50%; }
.feed-author { gap: 11px; }
.feed-author strong { font-size: 14px; font-weight: 600; }
.feed-author > div > span { font-size: 11px; margin-top: 3px; gap: 5px; }
.feed-post-options { position: relative; align-self: flex-start; color: var(--app-muted); }
.feed-post-options summary { list-style: none; cursor: pointer; width: 44px; min-width: 44px; margin-right: -8px; }
.feed-post-options summary::-webkit-details-marker { display: none; }
.feed-post-options > button { position: absolute; right: 0; top: 41px; z-index: 2; display: flex; align-items: center; gap: 8px; height: 46px; white-space: nowrap; background: var(--app-surface); border: 1px solid var(--app-line); color: var(--app-ink); box-shadow: 0 6px 24px #18223515; font-size: 13px; }
.feed-post-text { margin: 14px 0 12px; font-size: 14px; line-height: 1.8; color: var(--app-ink); }
.feed-images { margin: 10px 0 4px; gap: 5px; border-radius: 13px; }
.feed-images button { border-radius: 10px; }
.feed-card-actions { border: 0; min-height: 48px; height: 48px; gap: 24px; }
.feed-card-actions button { min-height: 44px; font-size: 12px; color: var(--app-muted); }
.feed-comment-preview { display: block; width: 100%; height: auto; min-height: 36px; padding: 9px 12px; border: 0; border-radius: 8px; text-align: left; background: var(--app-field); color: var(--app-muted); font-size: 12px; font-weight: 400; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-comment-preview strong { font-weight: 500; color: light-dark(#536076, #b9c7df); }
.feed-end { letter-spacing: 0; }
.feed-notice { margin: 10px 14px; }
.feed-loading { padding: 16px; }
.feed-dialog-header { position: relative; min-height: 62px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; gap: 8px; }
.feed-dialog-header h2 { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; white-space: nowrap; }
.feed-dialog-header .feed-publish { height: 36px; border-radius: 8px; font-size: 14px; }
.feed-text-button { color: var(--app-ink); }
.header-spacer { width: 44px; }
.feed-composer-scroll { padding: 24px 20px 20px; }
.feed-composer textarea { min-height: clamp(180px, 30dvh, 300px); font-size: 16px; line-height: 1.8; padding-top: 24px; }
.feed-composer textarea:focus { box-shadow: none; outline: none; }
.feed-counter { text-align: left; padding: 12px 0 15px; font-size: 11px; }
.feed-draft-grid { gap: 7px; }
.feed-draft-grid > div, .feed-add-image { aspect-ratio: 1; }
.feed-draft-grid img { border-radius: 9px; }
.feed-draft-grid .icon-button { min-width: 30px; width: 30px; height: 30px; border-radius: 50%; }
.feed-add-image { border-radius: 9px; gap: 10px; }
.feed-image-count { font-size: 11px; color: var(--app-muted); margin-top: 10px; }
.feed-composer-footer { font-size: 12px; margin: 0 20px; padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); }
.feed-comment-scroll { padding: 0; }
.feed-comment-context { display: flex; align-items: flex-start; gap: 10px; padding: 18px; }
.feed-comment-context > div { flex: 1; min-width: 0; }
.feed-comment-context strong { font-size: 14px; font-weight: 600; }
.feed-comment-context p { margin-top: 4px; font-size: 13px; line-height: 1.55; max-height: 61px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-comment-context > img { width: 64px; height: 64px; border-radius: 7px; object-fit: cover; }
.feed-comment { margin: 0 18px; padding: 20px 0; gap: 12px; }
.feed-comment > .feed-avatar { width: 42px; height: 42px; }
.feed-comment strong { font-size: 14px; }
.feed-comment p { font-size: 15px; margin: 4px 0 7px; }
.feed-comment-meta { font-size: 11px; }
.feed-comment-meta button { margin-left: auto; font-size: 11px; min-height: 36px; }
.feed-comment-form { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.feed-comment-form .feed-comment-input-row { display: flex; gap: 9px; align-items: flex-start; margin: 0; }
.feed-comment-form textarea { flex: 1; min-width: 0; height: 44px; min-height: 44px; max-height: 96px; field-sizing: content; padding: 11px 14px; border: 0; border-radius: 23px; font-size: 14px; }
.feed-comment-form button { height: 44px; min-width: 66px; padding: 0 13px; border-radius: 10px; font-size: 14px; }
.feed-comment-form > span { display: block; margin-top: 5px; }

/* Chat details and keyboard-safe composer. Media and file controls remain native Tinode. */
#topic-caption-panel { min-height: 68px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px 8px; border-bottom: 1px solid var(--app-line); }
#topic-caption-panel .avatar-box { width: 40px; min-width: 40px; height: 40px; margin-right: 8px; }
#topic-title { font-size: 15px; font-weight: 600; }
#topic-last-seen { font-size: 11px; }
#messages-panel { padding: 20px 14px; }
.chat-box li { align-items: flex-start; }
.chat-box li > .message-stack { max-width: calc(100% - 48px); min-width: 0; }
.chat-box li.right > .message-stack { max-width: 85%; }
.chat-box .avatar-box { width: 36px; height: 36px; min-width: 36px; min-height: 36px; margin: 0 8px 0 0; font-size: 15px; }
.chat-box .bubble { border: 1px solid transparent; min-width: 0; border-radius: 18px; padding: 10px 13px; box-shadow: 0 2px 4px #24385b05; }
.chat-box .left .bubble { border-color: var(--app-line); }
.chat-box .right .bubble { background: linear-gradient(140deg, #496bde, #3e5fd6); }
.chat-box li.meta .bubble { border: 0; border-radius: 8px; padding: 4px 10px; color: var(--app-muted); background: light-dark(#eaf0f6, #283344); box-shadow: none; }
.chat-box .left .bubble.tip { border-bottom-left-radius: 18px; border-top-left-radius: 6px; }
.chat-box .right .bubble.tip { border-bottom-right-radius: 18px; border-top-right-radius: 6px; }
.chat-box .right .bubble { color: #fff; --clr-text-secondary: #e5ecff; --clr-text-placeholder: #e5ecff; }
.chat-box .right .bubble a { color: #fff; text-decoration: underline; }
.chat-box .right .bubble .gray, .chat-box .right .bubble .light-gray { color: #e1e8ff; }
.chat-box .right .bubble .attachment, .chat-box .right .bubble .quote { background: #ffffff14; border-radius: 8px; }
.chat-box .bubble .attachment { font-size: 13px; padding: 4px 0; max-width: 100%; }
.chat-box .bubble .attachment > div { min-width: 0; }
.attachment { display: flex; align-items: center; gap: 10px; }
.attachment-type { width: 38px; height: 46px; flex: none; display: grid; place-items: center; background: var(--app-accent-soft); color: var(--app-accent); border-radius: 8px; }
.attachment-type.is-pdf { background: #ff6676; color: #fff; }
.attachment-type .material-icons { font-size: 27px; }
.attachment-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.attachment-copy strong { font-weight: 600; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.attachment-meta { font-size: 11px; opacity: .75; }
.attachment-download { width: 40px; min-width: 40px; height: 44px; display: flex; justify-content: center; align-items: center; background: var(--app-field); color: var(--app-muted); border-radius: 50%; }
.chat-box .right .attachment-type, .chat-box .right .attachment-download { background: #ffffff24; color: #fff; }
.chat-box .bubble div.message-content { line-height: 1.65; }
.chat-box .bubble:has(.inline-image) { padding: 3px; }
.chat-box .message-meta { display: flex; margin-top: 5px; min-height: 14px; padding: 0 3px; }
.chat-box .right .message-meta { justify-content: flex-end; }
.chat-box .message-meta .timestamp { position: static; float: none; top: auto; padding: 0; color: var(--app-muted); font-size: 10px; }
.chat-box .message-meta .timestamp .material-icons.blue { color: var(--app-accent); }
.chat-box .author { font-size: 11px; padding-top: 3px; padding-bottom: 5px; }
.chat-box li.single, .chat-box li.last { margin-bottom: 18px; }
.chat-box .menuTrigger { opacity: 0; }
.chat-box li:hover .menuTrigger, .chat-box li:focus-within .menuTrigger { opacity: .7; }
.chat-box .right .menuTrigger a { color: #fff; }
#send-message-panel { gap: 6px; min-height: 68px; padding: 10px 12px; align-items: flex-end; }
#send-message-panel .composer-attach { min-width: 44px; width: 44px; height: 44px; color: var(--app-ink); }
.composer-field { display: flex; align-items: flex-end; flex: 1; min-width: 0; background: var(--app-field); border: 1px solid var(--app-line); border-radius: 22px; transition: box-shadow 150ms ease; }
#send-message-input { flex: 1; min-width: 0; width: 100%; margin: 0; padding: 11px 4px 10px 15px; min-height: 44px; max-height: 130px; height: 44px; line-height: 23px; border: 0; background: transparent; font-size: 15px; }
#send-message-input:focus { box-shadow: none; outline: none; }
.composer-field:focus-within { box-shadow: 0 0 0 2px light-dark(#4665ed12, #a2b5ff18); }
#send-message-panel .composer-emoji { width: 44px; min-width: 44px; height: 44px; color: var(--app-ink); }
.composer-send { min-width: 42px; width: 42px; height: 42px; margin-bottom: 1px; border-radius: 50%; }
.composer-send:disabled { color: light-dark(#8599cd, #8a9fc9); background: var(--app-accent-soft); opacity: 1; }
.composer-tray { border-top: 1px solid var(--app-line); background: var(--app-page); padding: 15px; max-height: 38dvh; overflow: auto; }
.emoji-tray { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 2px; }
.emoji-tray button { height: 44px; width: 100%; padding: 0; border: 0; background: transparent; font-size: 27px; font-weight: 400; }
.emoji-tray button:hover { background: var(--app-accent-soft); }
.attachment-tray { display: flex; gap: 18px; padding: 20px; }
.attachment-tray button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; height: auto; padding: 0; background: transparent; color: var(--app-muted); border: 0; font-size: 12px; font-weight: 400; }
.attachment-tray button > span { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px; border: 1px solid var(--app-line); background: var(--app-surface); color: var(--app-accent); box-shadow: var(--app-shadow); }
@media (max-width: 360px) {
  .mobile-header { padding-left: 16px; }
  .profile-identity { padding-left: 16px; padding-right: 16px; gap: 12px; }
  .identity-copy h2 { font-size: 21px; }
  .profile-identity > .avatar-box { width: 64px; min-width: 64px; height: 64px; min-height: 64px; }
  .feed-card { padding-left: 14px; padding-right: 14px; }
  .feed-composer-scroll { padding: 20px 16px; }
  .emoji-tray { grid-template-columns: repeat(7,minmax(0,1fr)); }
  #send-message-panel { padding-left: 8px; padding-right: 8px; gap: 4px; }
}
/* Voice calling shares the mobile chat visual language. */
#topic-caption-panel .voice-call-entry {color:var(--app-ink);border:0;background:transparent;flex-shrink:0;}
#topic-caption-panel .voice-call-entry:disabled {opacity:.35;}
#video-container.voice-call {background:light-dark(linear-gradient(165deg,#edf2ff,#f7f9fc 55%,#e6edff),linear-gradient(165deg,#293a58,#182232 55%,#233550));z-index:20;}
#video-container.voice-call:not(.minimized) {border:0;inset:0;border-radius:0;}
.voice-call #controls button,.voice-incoming-overlay #controls button {position:relative;overflow:visible;}
.voice-control-label {position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);font-size:12px;white-space:nowrap;line-height:1.4;color:var(--app-muted);font-weight:400;}
.voice-call.minimized .voice-control-label {display:none;}
#video-container.voice-call .call-party.peer {background:transparent;}
#video-container.voice-call .caller-card {padding-bottom:110px;}
#video-container.voice-call .caller-card .avatar-box {width:96px;height:96px;font-size:42px;}
#video-container.voice-call .caller-card .caller-name {background:none;margin-top:24px;font-size:23px;font-weight:650;color:var(--app-ink);text-shadow:none;}
.voice-call-status {margin-top:12px;font-size:14px;color:var(--app-muted);font-variant-numeric:tabular-nums;}
#video-container.voice-call #controls {bottom:calc(68px + env(safe-area-inset-bottom));gap:42px;}
#video-container.voice-call #controls button {width:64px;height:64px;box-shadow:none;}
#video-container.voice-call #controls .danger {background:#ef5267;color:#fff;}
#video-container.voice-call #controls .secondary {background:var(--app-surface);color:var(--app-ink);}
#video-container.voice-call #controls .secondary[aria-pressed="true"] {background:#5364e5;color:white;}
#video-container.voice-call .full-screen {color:var(--app-muted);}
#video-container.voice-call.minimized {background:#edf0ff;}
#video-container.voice-call.minimized .caller-card {padding-bottom:0;}
#video-container.voice-call.minimized .caller-card .avatar-box {width:48px;height:48px;font-size:24px;}
#video-container.voice-call.minimized .caller-card .caller-name {margin-top:6px;font-size:16px;}
#video-container.voice-call.minimized #controls {bottom:16px;gap:12px;}
#video-container.voice-call.minimized #controls button {width:42px;height:42px;}
.voice-incoming-overlay {z-index:40;background:rgba(27,34,58,.46);backdrop-filter:blur(8px);}
.voice-incoming-overlay .incoming-call {width:calc(100% - 40px);max-width:360px;min-width:0;margin:auto;border-radius:28px;background:var(--app-surface);}
.voice-incoming-overlay .caller-card {padding:42px 20px 126px;}
.voice-incoming-overlay .avatar-box {width:84px;height:84px;font-size:38px;}
.voice-incoming-overlay .caller-name {margin-top:20px;background:none;color:var(--app-ink);font-size:22px;}
.voice-incoming-overlay #controls {bottom:30px;gap:64px;}
.voice-incoming-overlay #controls button {width:60px;height:60px;box-shadow:none;}
.voice-enable-sound {margin-top:20px;border-radius:20px;padding:10px 16px;color:#4254d4;background:white;}
@media (prefers-reduced-motion:reduce) {.voice-call .pulse,.voice-incoming-overlay .pulse,.voice-call .pulse .lettertile,.voice-incoming-overlay .pulse .lettertile {animation:none!important;}}

/* Shared forms, empty states and overlays complete the same visual system. */
.app-empty .empty-icon, .feed-empty > span { border: 1px solid light-dark(#e0e8ff, #3a4d76); border-radius: 26px; background: light-dark(linear-gradient(145deg,#f5f8ff,#e6edff), linear-gradient(145deg,#324565,#26354c)); box-shadow: inset 0 2px 0 light-dark(#ffffffd9,#ffffff0a), 0 8px 24px #4665ed09; }
.app-empty h2, .feed-empty h3 { font-size: 17px; font-weight: 600; }
.app-empty p, .feed-empty p { color: var(--app-muted); line-height: 1.8; }
.app-empty button, .feed-empty .primary { border-radius: 13px; font-size: 13px; }
.settings-section { border-radius: 18px; box-shadow: var(--app-shadow); }
.context-menu { padding: 5px; border-radius: 16px; box-shadow: 0 12px 36px #1c2d4b24; }
.context-menu li { border-radius: 9px; }
.feed-confirm, .alert { border: 1px solid var(--app-line); border-radius: 24px; }
.feed-confirm button { border-radius: 12px; }
.feed-comment-form { border-top: 1px solid var(--app-line); }
.feed-comment-form textarea { background: var(--app-field); }
.feed-comment-form button { border-radius: 14px; }
#login-form { padding: 16px 28px 28px; }
.login-hero { padding: 12px 0 28px; }
.login-mark { border-radius: 23px; background: linear-gradient(145deg, #6b8df5, #4263df); box-shadow: inset 0 1px 0 #ffffff40, 0 8px 20px #4665ed25; }
.login-hero h1 { font-size: 31px; letter-spacing: -.8px; line-height: 1.5; }
#login-form .input-label { margin-top: 18px; margin-bottom: 8px; }
#login-form input { border-radius: 14px; border-color: var(--app-line); height: 50px; }
#login-form .dialog-buttons button { height: 50px; border-radius: 14px; box-shadow: 0 5px 14px #4665ed1a; }
@media (max-width: 360px) {
  .mobile-header { min-height: 78px; padding-left: 20px; padding-right: 16px; }
  .mobile-header h1 { font-size: 26px; }
  .list-tools { padding-left: 16px; padding-right: 16px; }
  .contact-box > li { padding-left: 16px; padding-right: 16px; }
  .contact-box .avatar-box { width: 48px; min-width: 48px; height: 48px; min-height: 48px; margin-right: 12px; }
  .contact-box > li::after { left: 76px; right: 16px; }
  .directory-shortcuts { padding-left: 16px; padding-right: 16px; }
  .profile-view { padding-left: 14px; padding-right: 14px; }
  .profile-identity { padding: 20px 12px; gap: 10px; }
  .identity-copy h2 { font-size: 18px; }
  .identity-edit { width: 24px; }
  .discover-feed { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) { button, .mobile-navigation .nav-item, .mobile-navigation .nav-symbol, .app-search, .composer-field { transition: none; } }

/* Call summaries keep the same contrast and icon language as text bubbles. */
.chat-box .call-message { align-items: center; gap: 10px; padding: 2px 1px; font-size: 14px; line-height: 1.5; }
.call-message-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--app-accent-soft); color: var(--app-accent); }
.chat-box .call-message .duration { font-weight: 400; font-size: 12px; margin-top: 4px; color: var(--app-muted); }
.chat-box .call-message .duration .material-icons { font-size: 15px; }
.call-result.is-missed { color: light-dark(#c24e62, #f69caf); }
.call-result.is-complete { color: light-dark(#328674, #9bdcc9); }
.chat-box .right .call-message-icon { background: #ffffff20; color: #fff; }
.chat-box .right .call-message .duration, .chat-box .right .call-message .duration .material-icons { color: #eef3ff; }
#hide-message-view { width: 44px; min-width: 44px; }
#topic-title-group { min-width: 0; }
#topic-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topic-last-seen { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
