.telegram-tabs,.telegram-dock{display:none}
:root[data-ui-style="telegram"]{--tg-bg:#fff;--tg-soft:#f4f4f5;--tg-text:#202124;--tg-muted:#626d77;--tg-accent:#176fa4;--tg-selected:#e7f3fb;--tg-line:#edf0f2;--tg-chat:#e8eef2;font-family:Arial,Helvetica,sans-serif;color:var(--tg-text);background:var(--tg-bg)}
:root[data-ui-style="telegram"][data-theme="dark"]{--tg-bg:#17212b;--tg-soft:#242f3d;--tg-text:#edf3f8;--tg-muted:#98a6b5;--tg-accent:#6ab7ef;--tg-selected:#253d51;--tg-line:#2b3845;--tg-chat:#0e1621}
:root[data-ui-style="telegram"] .app{display:grid;grid-template-columns:220px 380px minmax(0,1fr);gap:0;padding:0;min-height:0;background:var(--tg-bg)}
:root[data-ui-style="telegram"] .rail{background:var(--tg-bg);border-right:1px solid var(--tg-line);color:var(--tg-text)}
:root[data-ui-style="telegram"] .brand,:root[data-ui-style="telegram"] .titlebar h1{color:var(--tg-accent);font-weight:700;letter-spacing:-.4px}
:root[data-ui-style="telegram"] .list-pane{position:relative;display:flex;flex-direction:column;background:var(--tg-bg);border-right:1px solid var(--tg-line);border-radius:0;min-height:0}
:root[data-ui-style="telegram"] .list-top{background:var(--tg-bg);padding:22px 12px 10px;border:0;box-shadow:none}
:root[data-ui-style="telegram"] #sectionLabel{display:none}
:root[data-ui-style="telegram"] .titlebar{min-height:36px;padding:0 8px;gap:8px;background:none;border:0}
:root[data-ui-style="telegram"] .titlebar h1{margin:0;font-size:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:260px}
:root[data-ui-style="telegram"] .titlebar .icon,:root[data-ui-style="telegram"] .titlebar .add{background:none;color:var(--tg-text);border:0;border-radius:50%;width:36px;height:36px;font-size:23px}
:root[data-ui-style="telegram"] .search{margin:20px 0 10px;border:0;border-radius:28px;background:var(--tg-soft);color:var(--tg-muted);height:44px;padding:0 16px;display:flex;align-items:center;gap:12px}
:root[data-ui-style="telegram"] .search input{border:0;background:transparent;color:var(--tg-text);font-size:16px;min-width:0;width:100%;padding:0;outline-offset:5px}
:root[data-ui-style="telegram"] .search input::placeholder{color:var(--tg-muted);opacity:1}
:root[data-ui-style="telegram"] #tabs{display:none!important}
:root[data-ui-style="telegram"] .telegram-tabs{display:flex;align-items:center;background:var(--tg-bg);border:1px solid var(--tg-line);border-radius:28px;box-shadow:0 2px 6px #0000000d;padding:4px;gap:3px}
:root[data-ui-style="telegram"] .telegram-tabs button{flex:1;min-width:0;border:0;border-radius:24px;background:none;color:var(--tg-muted);font-size:14px;font-weight:700;padding:9px 4px;white-space:nowrap}
:root[data-ui-style="telegram"] .telegram-tabs button.active{background:var(--tg-selected);color:var(--tg-accent)}
:root[data-ui-style="telegram"] #telegramUnreadCount:not(:empty){background:var(--tg-muted);color:var(--tg-bg);padding:2px 5px;border-radius:14px;font-size:11px;margin-left:2px}
:root[data-ui-style="telegram"] .rows{display:block;flex:1;min-height:0;overflow:auto;padding:0 0 100px;background:var(--tg-bg)}
:root[data-ui-style="telegram"] .row{display:flex;align-items:center;gap:13px;min-height:82px;padding:12px 14px;margin:0;width:100%;border:0;border-radius:0;background:var(--tg-bg);color:var(--tg-text);box-shadow:none;text-align:left}
:root[data-ui-style="telegram"] .row:hover,:root[data-ui-style="telegram"] .row.selected{background:var(--tg-selected)}
:root[data-ui-style="telegram"] .row>.avatar,:root[data-ui-style="telegram"] .row>.space-avatar-frame-shell{width:54px;height:54px;flex:0 0 54px;border-radius:50%;margin:0}
:root[data-ui-style="telegram"] .row-info{display:block;min-width:0;flex:1;max-width:none;text-align:left}
:root[data-ui-style="telegram"] .row-head{display:flex;align-items:center;gap:7px;margin:0 0 6px}
:root[data-ui-style="telegram"] .row-head strong{font-size:17px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
:root[data-ui-style="telegram"] .row-head small{color:var(--tg-muted);font-size:11px;flex:none;font-weight:400;letter-spacing:0}
:root[data-ui-style="telegram"] .row-preview{display:block;font-size:15px;line-height:22px;color:var(--tg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
:root[data-ui-style="telegram"] .row-meta{display:none}
:root[data-ui-style="telegram"] .unread-count{background:var(--tg-muted);color:var(--tg-bg);border-radius:16px;padding:3px 7px;min-width:23px;font-size:12px}
:root[data-ui-style="telegram"] .telegram-mini-media{display:inline-block;width:22px;height:22px;position:relative;margin-right:5px;vertical-align:middle;overflow:hidden;border-radius:4px;background:var(--tg-soft)}
:root[data-ui-style="telegram"] .telegram-mini-media img{width:100%;height:100%;object-fit:cover}
:root[data-ui-style="telegram"] .telegram-mini-media>span{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:10px;text-shadow:0 1px 3px #000}
:root[data-ui-style="telegram"] .telegram-dock{display:flex;position:absolute;bottom:48px;left:16px;right:16px;border:1px solid var(--tg-line);border-radius:40px;background:var(--tg-bg);box-shadow:0 2px 9px #00000018;padding:4px;gap:3px;z-index:4}
:root[data-ui-style="telegram"] .telegram-dock button{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:none;border:0;border-radius:32px;color:var(--tg-text);padding:8px 3px;font-size:12px;font-weight:600;min-height:61px}
:root[data-ui-style="telegram"] .telegram-dock button.active{color:var(--tg-accent);background:var(--tg-selected)}
:root[data-ui-style="telegram"] .telegram-dock svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
:root[data-ui-style="telegram"] .telegram-dock [data-tg-action="chat"] svg{fill:currentColor;stroke:none}
:root[data-ui-style="telegram"] .telegram-profile-icon{height:25px;width:25px;display:grid;place-items:center}
:root[data-ui-style="telegram"] .telegram-profile-icon .user-avatar-shell,:root[data-ui-style="telegram"] .telegram-profile-icon .avatar{width:25px;height:25px;min-width:25px;margin:0}
:root[data-ui-style="telegram"] .list-foot{background:var(--tg-bg);color:var(--tg-muted);border-top:1px solid var(--tg-line);padding:4px 12px;font-size:11px;min-height:36px}
:root[data-ui-style="telegram"] .list-foot select{border:0;background:var(--tg-soft);color:var(--tg-text);font-size:11px;padding:4px 8px;border-radius:12px;max-width:150px;min-height:26px}
:root[data-ui-style="telegram"] .chat{background:var(--tg-chat);color:var(--tg-text);border:0;border-radius:0;min-height:0}
:root[data-ui-style="telegram"] .chat-head{background:var(--tg-bg);color:var(--tg-text);border-bottom:1px solid var(--tg-line);padding:12px 16px;min-height:68px;box-shadow:none}
:root[data-ui-style="telegram"] .chat-head h2{font-size:17px}
:root[data-ui-style="telegram"] .messages{background:var(--tg-chat);background-image:none;padding:16px}
:root[data-ui-style="telegram"] .bubble{background:var(--tg-bg);color:var(--tg-text);border:0;border-radius:14px 14px 14px 4px;box-shadow:0 1px 2px #00000010}
:root[data-ui-style="telegram"] .own .bubble{background:var(--tg-selected);border-radius:14px 14px 4px 14px}
:root[data-ui-style="telegram"] .compose,:root[data-ui-style="telegram"] .chat-utilities{background:var(--tg-bg);color:var(--tg-text);border-color:var(--tg-line)}
:root[data-ui-style="telegram"] .compose textarea{background:var(--tg-bg);color:var(--tg-text)}
:root[data-ui-style="telegram"] .compose button.primary{border-radius:50%;background:var(--tg-accent);color:#fff}
:root[data-ui-style="telegram"] .modal-box{background:var(--tg-bg);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:20px;box-shadow:0 12px 40px #0003}
:root[data-ui-style="telegram"] .modal-box>header{background:var(--tg-bg);color:var(--tg-text);border-color:var(--tg-line)}
:root[data-ui-style="telegram"] .nav,:root[data-ui-style="telegram"] .service-link{color:var(--tg-text)}
:root[data-ui-style="telegram"] .nav.active{background:var(--tg-selected);color:var(--tg-accent)}
:root[data-ui-style="telegram"] .rail{position:relative;inset:auto;transform:none;width:auto;grid-column:auto;grid-row:auto;display:flex;flex-direction:column}
:root[data-ui-style="telegram"] .rail nav{display:grid;grid-template-columns:1fr;gap:5px}
:root[data-ui-style="telegram"] .list-pane,:root[data-ui-style="telegram"] .chat{grid-column:auto;grid-row:auto;position:relative;inset:auto;width:auto;max-width:none;transform:none}
@media(max-width:1100px){:root[data-ui-style="telegram"] .app{grid-template-columns:340px minmax(0,1fr)}:root[data-ui-style="telegram"] #openRail{display:inline-flex}:root[data-ui-style="telegram"] .rail{position:fixed;inset:0 auto 0 0;width:280px;z-index:50;transform:translateX(-100%)}:root[data-ui-style="telegram"] .rail.open{transform:none}}
@media(max-width:720px){:root[data-ui-style="telegram"] .app{display:flex;height:100dvh}:root[data-ui-style="telegram"] .list-pane{width:100%;flex:1;border:0}:root[data-ui-style="telegram"] .chat{display:none}:root[data-ui-style="telegram"] .chat.active{display:flex;width:100%;flex:1}:root[data-ui-style="telegram"] .list-pane.hidden{display:none}:root[data-ui-style="telegram"] .conversation-open .telegram-dock{display:none}:root[data-ui-style="telegram"] .list-top{padding-top:18px}:root[data-ui-style="telegram"] .telegram-dock{bottom:calc(44px + env(safe-area-inset-bottom));max-width:440px;margin:auto}:root[data-ui-style="telegram"] .list-foot{padding-bottom:calc(4px + env(safe-area-inset-bottom))}:root[data-ui-style="telegram"] .titlebar h1{max-width:calc(100vw - 170px)}}
@media(max-width:359px){:root[data-ui-style="telegram"] .row{padding:10px;gap:10px}:root[data-ui-style="telegram"] .row-head strong{font-size:15px}:root[data-ui-style="telegram"] .telegram-tabs button{font-size:12px}:root[data-ui-style="telegram"] .telegram-dock{left:10px;right:10px}}
:root[data-ui-style="telegram"] #modal.telegram-settings-modal{background:#00000035;padding:0}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box{position:relative;width:480px;max-width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0;background:var(--tg-soft);display:flex;flex-direction:column;overflow:hidden}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box>header{flex:none;background:var(--tg-soft);border:0;height:48px;padding:8px 16px}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box>header h2{font-size:15px;color:var(--tg-muted)}
:root[data-ui-style="telegram"] .telegram-settings-modal #modalBody{overflow:auto;flex:1;min-height:0;padding:12px 12px 110px}
:root[data-ui-style="telegram"] .telegram-account-hero{text-align:center;padding:2px 0 20px}
:root[data-ui-style="telegram"] .telegram-account-avatar{display:inline-block;position:relative;border:0;background:none;padding:0}
:root[data-ui-style="telegram"] .telegram-account-avatar .user-avatar-shell,:root[data-ui-style="telegram"] .telegram-account-avatar .avatar{width:88px;height:88px;min-width:88px;font-size:28px;margin:0}
:root[data-ui-style="telegram"] .telegram-camera{position:absolute;right:-2px;bottom:0;border:3px solid var(--tg-soft);background:#25a5e6;color:#fff;border-radius:50%;width:32px;height:32px;display:grid;place-items:center;font-size:19px}
:root[data-ui-style="telegram"] .telegram-account-hero h2{margin:13px 0 4px;font-size:24px;color:var(--tg-text)}
:root[data-ui-style="telegram"] .telegram-account-hero p{font-size:13px;color:var(--tg-muted);margin:0;overflow-wrap:anywhere}
:root[data-ui-style="telegram"] .telegram-settings-card{background:var(--tg-bg);border-radius:20px;overflow:hidden;margin-bottom:14px}
:root[data-ui-style="telegram"] .telegram-settings-row{display:flex;align-items:center;width:100%;gap:14px;padding:15px 18px;background:none;border:0;text-align:left;color:var(--tg-text);border-radius:0}
:root[data-ui-style="telegram"] .telegram-settings-row:hover{background:var(--tg-selected)}
:root[data-ui-style="telegram"] .telegram-setting-icon{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;border-radius:10px;color:#fff;font-size:22px;line-height:1}
:root[data-ui-style="telegram"] .telegram-settings-row>span:nth-child(2){flex:1;min-width:0}
:root[data-ui-style="telegram"] .telegram-settings-row strong{display:block;font-size:16px;font-weight:500;line-height:1.4}
:root[data-ui-style="telegram"] .telegram-settings-row small{display:block;color:var(--tg-muted);font-size:12px;line-height:1.5;margin-top:3px}
:root[data-ui-style="telegram"] .telegram-setting-arrow{color:var(--tg-muted);font-size:20px}
:root[data-ui-style="telegram"] .telegram-settings-caption{font-size:13px;padding-left:16px;color:var(--tg-muted);font-weight:500}
:root[data-ui-style="telegram"] #telegramSettingsDock{position:fixed;width:calc(100% - 48px);max-width:430px;left:50%;right:auto;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom));margin:0;z-index:3}
@media(max-width:720px){:root[data-ui-style="telegram"] #modal.telegram-settings-modal{background:var(--tg-soft)}:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box{width:100%;box-shadow:none}}
:root[data-ui-style="telegram"] .telegram-setting-icon svg,:root[data-ui-style="telegram"] .telegram-camera svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box>header{min-height:54px;height:auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px;box-shadow:0 1px 4px #0000000a;z-index:2;background:var(--tg-bg)}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box>header h2{font-size:20px;color:var(--tg-text);flex:1;min-width:0}
:root[data-ui-style="telegram"] .telegram-settings-search-toggle{order:2;width:36px;height:36px;display:grid;place-items:center;background:none;border:0;color:var(--tg-text)}
:root[data-ui-style="telegram"] .telegram-settings-search-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2}
:root[data-ui-style="telegram"] .telegram-settings-search{flex:0 0 100%;order:3;padding-bottom:4px}
:root[data-ui-style="telegram"] .telegram-settings-search input{width:100%;border:0;background:var(--tg-soft);color:var(--tg-text);padding:10px 14px;border-radius:20px;font-size:14px}
:root[data-ui-style="telegram"] .telegram-settings-card select{max-width:120px;border:0;background:var(--tg-soft);color:var(--tg-text);padding:8px;border-radius:12px;font-size:12px}
:root[data-ui-style="telegram"] .telegram-help-card h3{padding:18px 18px 4px;margin:0;color:var(--tg-accent);font-size:14px}
:root[data-ui-style="telegram"] .telegram-settings-row[hidden],:root[data-ui-style="telegram"] .telegram-settings-card[hidden],:root[data-ui-style="telegram"] .telegram-settings-search[hidden]{display:none!important}
.telegram-settings-search-toggle,.telegram-settings-search{display:none}
:root[data-ui-style="telegram"] .telegram-settings-modal .telegram-settings-search-toggle{display:grid}
:root[data-ui-style="telegram"] .telegram-settings-modal .telegram-settings-search:not([hidden]){display:block}
:root[data-ui-style="telegram"] .telegram-contacts-page{display:flex;flex-direction:column;position:relative;flex:1;width:100%;height:100%;min-height:0;background:var(--tg-bg);color:var(--tg-text)}
:root[data-ui-style="telegram"] .telegram-contacts-header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:16px 16px 0;background:var(--tg-bg);border-bottom:1px solid var(--tg-line);flex:none}
:root[data-ui-style="telegram"] .telegram-contacts-header h1{flex:1;margin:0;font-size:23px;line-height:1.5}
:root[data-ui-style="telegram"] .telegram-contacts-header .icon{border:0;background:none;color:var(--tg-text);font-size:24px;width:36px;height:36px}
:root[data-ui-style="telegram"] .telegram-contacts-header .search{flex-basis:100%;margin:10px 0 14px}
:root[data-ui-style="telegram"] .telegram-contacts-body{flex:1;min-height:0;overflow:auto;padding:16px 16px 110px}
:root[data-ui-style="telegram"] .telegram-contacts-body .community-line{background:var(--tg-bg);color:var(--tg-text);border-color:var(--tg-line);padding:14px 0;gap:10px;flex-wrap:wrap}
:root[data-ui-style="telegram"] .telegram-contacts-body .sender-profile{display:flex;align-items:center;gap:10px;min-width:0;color:var(--tg-text);background:none;font-size:16px;text-align:left}
:root[data-ui-style="telegram"] .telegram-contacts-body .avatar{width:42px;height:42px;flex:0 0 42px;font-size:17px}
:root[data-ui-style="telegram"] .telegram-contacts-body .community-line[hidden]{display:none!important}
:root[data-ui-style="telegram"] .app.conversation-open .telegram-contacts-page .telegram-dock{display:flex;bottom:calc(16px + env(safe-area-inset-bottom));max-width:440px;margin:auto}
:root[data-ui-style="telegram"] .telegram-contacts-body input{background:var(--tg-soft);color:var(--tg-text);border:1px solid var(--tg-line);border-radius:12px;padding:10px;max-width:100%}
@media(min-width:721px){:root[data-ui-style="telegram"] .telegram-contacts-page .telegram-dock{left:50%;right:auto;transform:translateX(-50%);width:calc(100% - 32px)}}
:root[data-ui-style="telegram"] .list-top{padding-top:12px;padding-bottom:10px}
:root[data-ui-style="telegram"] #listPane .titlebar{height:48px;min-height:48px;margin-bottom:10px;padding:0 2px;gap:6px}
:root[data-ui-style="telegram"] #listPane .telegram-inline-search{display:none;margin:0;min-width:0;height:38px;padding:0 12px;flex:1}
:root[data-ui-style="telegram"] #listPane .telegram-inline-search>span{display:none}
:root[data-ui-style="telegram"] #listPane .telegram-inline-search input{font-size:15px}
:root[data-ui-style="telegram"] #listPane .telegram-search-open>.telegram-inline-search{display:flex}
:root[data-ui-style="telegram"] #listPane .telegram-search-open>div,:root[data-ui-style="telegram"] #listPane .telegram-search-open>#userCenter,:root[data-ui-style="telegram"] #listPane .telegram-search-open>#createBtn{display:none}
:root[data-ui-style="telegram"] #telegramSearchToggle{display:grid;place-items:center;flex:0 0 36px}
:root[data-ui-style="telegram"] #telegramSearchToggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
:root[data-ui-style="telegram"] #listPane .titlebar>div{min-width:0;overflow:hidden}
:root[data-ui-style="telegram"] #listPane .titlebar h1{max-width:none;font-size:22px}
:root[data-ui-style="telegram"] #listPane #userCenter{display:none}
/* Compact list controls live in the header instead of a second bottom bar. */
:root[data-ui-style="telegram"] .list-top{padding:8px 10px 8px}
:root[data-ui-style="telegram"] #listPane .titlebar{height:42px;min-height:42px;margin-bottom:6px}
:root[data-ui-style="telegram"] #listPane .titlebar h1{font-size:20px}
:root[data-ui-style="telegram"] .telegram-tabs{box-shadow:none;padding:3px}
:root[data-ui-style="telegram"] .telegram-tabs button{font-size:13px;padding:7px 4px;min-height:32px}
:root[data-ui-style="telegram"] .rows{padding-bottom:82px}
:root[data-ui-style="telegram"] .row{min-height:68px;padding:10px 12px;gap:11px}
:root[data-ui-style="telegram"] .row>.avatar,:root[data-ui-style="telegram"] .row>.space-avatar-frame-shell{width:46px;height:46px;flex-basis:46px}
:root[data-ui-style="telegram"] .row-head{margin-bottom:4px}
:root[data-ui-style="telegram"] .row-head strong{font-size:15px;line-height:20px}
:root[data-ui-style="telegram"] .row-head small{font-size:10px}
:root[data-ui-style="telegram"] .row-preview{font-size:13px;line-height:19px}
:root[data-ui-style="telegram"] .telegram-mini-media{width:19px;height:19px;margin-right:4px}
:root[data-ui-style="telegram"] .telegram-dock{bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;border-radius:32px;padding:3px;box-shadow:0 2px 8px #00000012}
:root[data-ui-style="telegram"] .telegram-dock button{min-height:52px;padding:6px 3px;font-size:11px;gap:3px}
:root[data-ui-style="telegram"] .telegram-dock svg{width:22px;height:22px}
:root[data-ui-style="telegram"] .telegram-list-options{position:relative;flex:0 0 34px}
:root[data-ui-style="telegram"] .telegram-list-options>summary{list-style:none;display:grid;place-items:center;cursor:pointer;width:34px;height:36px;border-radius:50%;color:var(--tg-text)}
:root[data-ui-style="telegram"] .telegram-list-options>summary::-webkit-details-marker{display:none}
:root[data-ui-style="telegram"] .telegram-list-options>summary:hover{background:var(--tg-soft)}
:root[data-ui-style="telegram"] .telegram-list-options svg{width:21px;height:21px;fill:var(--tg-bg);stroke:currentColor;stroke-width:1.8}
:root[data-ui-style="telegram"] .telegram-list-options-body{position:absolute;top:42px;right:0;z-index:8;width:270px;max-width:calc(100vw - 28px);padding:14px;border:1px solid var(--tg-line);border-radius:16px;background:var(--tg-bg);box-shadow:0 6px 24px #0002;font-size:13px}
:root[data-ui-style="telegram"] .telegram-list-options-body>.list-foot{display:flex;flex-wrap:wrap;gap:10px;min-height:0;border:0;padding:10px 0 0;background:none}
:root[data-ui-style="telegram"] .telegram-list-options-body .list-sort-label{flex-basis:100%;width:100%;display:block}
:root[data-ui-style="telegram"] .telegram-list-options-body select{width:100%;max-width:none;font-size:13px;min-height:36px}
:root[data-ui-style="telegram"] #listPane .titlebar{overflow:visible}
:root[data-ui-style="telegram"] .telegram-settings-row{padding:12px 16px;gap:12px}
:root[data-ui-style="telegram"] .telegram-settings-row strong{font-size:15px}
:root[data-ui-style="telegram"] .telegram-setting-icon{width:28px;height:28px;flex-basis:28px}
:root[data-ui-style="telegram"] .telegram-settings-row small{font-size:12px}
:root[data-ui-style="telegram"] .row>.space-avatar-frame-shell>.avatar{width:46px;height:46px;flex:0 0 46px}

/* Theme tokens also feed shared message/media components; room overrides still win. */
:root[data-ui-style="telegram"]{--site-text:var(--tg-text);--site-muted:var(--tg-muted);--site-pane:var(--tg-bg);--site-head:var(--tg-bg);--site-border:var(--tg-line);--site-chat:var(--tg-chat);--site-bubble:var(--tg-bg);--site-selected:var(--tg-selected);--site-accent:var(--tg-accent)}
:root[data-ui-style="telegram"] #chat .message-scroll{background-color:var(--room-background,var(--tg-chat))}
:root[data-ui-style="telegram"] #chat .bubble{background-color:var(--room-bubble,var(--tg-bg));color:var(--room-text,var(--tg-text));border-color:var(--tg-line)}
:root[data-ui-style="telegram"] #chat .own .bubble{background-color:var(--room-own-bubble,var(--tg-selected));color:var(--room-text,var(--tg-text))}
:root[data-ui-style="telegram"] .telegram-list-options-body{max-height:calc(var(--viewport-height,100dvh) - 100px);overflow:auto;overscroll-behavior:contain}
:root[data-ui-style="telegram"] .telegram-settings-modal .modal-box{height:var(--viewport-height,100dvh);max-height:var(--viewport-height,100dvh)}
:root[data-ui-style="telegram"] .telegram-settings-row>span{min-width:0}
:root[data-ui-style="telegram"] .telegram-settings-row strong,:root[data-ui-style="telegram"] .telegram-settings-row small{overflow-wrap:anywhere}
@media(max-height:500px){
 :root[data-ui-style="telegram"] .telegram-dock button{min-height:44px;padding:3px;font-size:10px}
 :root[data-ui-style="telegram"] .telegram-dock{bottom:calc(6px + env(safe-area-inset-bottom))}
 :root[data-ui-style="telegram"] .rows{padding-bottom:70px}
}

/* Telegram uses its bottom navigation and Settings, without a duplicate rail. */
:root[data-ui-style="telegram"] #rail,
:root[data-ui-style="telegram"] #shade,
:root[data-ui-style="telegram"] #openRail{display:none!important}
:root[data-ui-style="telegram"] .app{grid-template-columns:380px minmax(0,1fr)}
@media(min-width:721px) and (max-width:1100px){:root[data-ui-style="telegram"] .app{grid-template-columns:340px minmax(0,1fr)}}

:root[data-ui-style="telegram"] #listPane #createBtn{display:none}
:root[data-ui-style="telegram"] .telegram-create-space{display:block;width:100%;padding:12px;margin:0 0 14px;text-align:left;border:1px solid var(--tg-line);border-radius:12px;background:var(--tg-selected);color:var(--tg-accent);font-size:14px;font-weight:700;cursor:pointer}
:root[data-ui-style="telegram"] .telegram-create-space:focus-visible{outline:2px solid var(--tg-accent);outline-offset:2px}
