:root{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;font-synthesis:none;color-scheme:light;--bg:#fff;--secondary:#f2f2f7;--chat-bg:#d9e6e1;--text:#000;--sub:#8e8e93;--line:#c6c6c8;--accent:#007aff;--incoming:#fff;--outgoing:#d9f5c9;--bar:rgba(249,249,249,.94);--danger:#ff3b30}
:root[data-theme=dark]{color-scheme:dark;--bg:#1c1c1e;--secondary:#000;--chat-bg:#0e2028;--text:#fff;--sub:#8e8e93;--line:#38383a;--accent:#5ac8fa;--incoming:#262b31;--outgoing:#354e3c;--bar:rgba(30,30,32,.96);--danger:#ff6961}
*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden}body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button{border:0;background:none;color:inherit;cursor:pointer}button:active{opacity:.62}#app{height:100dvh;max-width:820px;margin:auto;display:flex;flex-direction:column;background:var(--bg);position:relative;overflow:hidden}#topbar{height:calc(48px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0;flex:none;display:flex;align-items:center;justify-content:space-between;background:var(--bar);border-bottom:.5px solid var(--line);z-index:3;backdrop-filter:blur(22px)}#heading{flex:1;min-width:0;text-align:center;font-weight:600;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#topbar.large #heading{text-align:left;font-size:34px;font-weight:700;letter-spacing:-.8px;align-self:end;padding-bottom:4px}#topbar.large{height:calc(67px + env(safe-area-inset-top))}.back,.top-action{min-width:42px;height:44px;color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:17px}.back{justify-content:flex-start;gap:2px}.back svg{width:23px;height:23px}.top-action svg{width:23px;height:23px}#main{flex:1;overflow:auto;overscroll-behavior:contain;background:var(--bg);scrollbar-width:none}#main::-webkit-scrollbar{display:none}#tabs{flex:none;height:calc(50px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:flex;border-top:.5px solid var(--line);background:var(--bar);backdrop-filter:blur(22px);z-index:3}#tabs[hidden]{display:none}#tabs button{flex:1;min-width:0;color:var(--sub);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;font-size:10px;line-height:12px}#tabs button.active{color:var(--accent)}#tabs svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.search-wrap{padding:8px 12px;background:var(--bg)}.search{width:100%;height:36px;border:0;border-radius:10px;background:var(--secondary);color:var(--text);padding:0 12px 0 36px;outline:none;font-size:16px}.search::placeholder{color:var(--sub)}.search-field{position:relative}.search-field svg{position:absolute;width:18px;height:18px;left:11px;top:9px;color:var(--sub)}.section-label{padding:19px 16px 6px;color:var(--sub);font-size:13px;font-weight:600;text-transform:uppercase;background:var(--secondary)}.list{background:var(--bg)}.row{width:100%;min-height:70px;padding:0 0 0 16px;display:flex;text-align:left;align-items:center;gap:12px;background:var(--bg);position:relative}.row-content{min-width:0;flex:1;align-self:stretch;padding:10px 16px 10px 0;border-bottom:.5px solid var(--line);display:flex;flex-direction:column;justify-content:center;gap:4px}.row:last-child .row-content{border-bottom:0}.row-line{display:flex;align-items:baseline;gap:7px;min-width:0}.row-title{font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.row-date{font-size:12px;color:var(--sub);flex:none}.row-sub{font-size:14px;color:var(--sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.row-sub strong{color:var(--text);font-weight:500}.badge{font-size:12px;font-weight:600;line-height:20px;min-width:20px;text-align:center;padding:0 5px;border-radius:12px;color:#fff;background:var(--accent);flex:none}.dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:none}.avatar{width:54px;height:54px;border-radius:50%;flex:none;display:grid;place-items:center;overflow:hidden;color:#fff;font-size:21px;font-weight:500;background:linear-gradient(145deg,#75c0f6,#3478bc)}.avatar img{width:100%;height:100%;object-fit:cover}.avatar.sm{width:38px;height:38px;font-size:15px}.avatar.lg{width:86px;height:86px;font-size:34px}.row-chevron{color:#c7c7cc;font-size:22px;line-height:1;align-self:center;margin-left:auto}.empty{padding:70px 32px;text-align:center;color:var(--sub);font-size:15px;line-height:1.45}.empty svg{width:58px;height:58px;display:block;margin:0 auto 16px;opacity:.55}.loading{padding:22px;text-align:center;color:var(--sub);font-size:14px}.more{display:block;margin:12px auto 18px;padding:9px 18px;color:var(--accent);font-weight:500}.filter-strip{display:flex;gap:8px;padding:8px 12px;overflow:auto;scrollbar-width:none}.chip{white-space:nowrap;border-radius:16px;background:var(--secondary);padding:7px 12px;color:var(--text);font-size:13px}.chip.active{background:var(--accent);color:#fff}.group{margin-top:18px;background:var(--bg)}.group:first-child{margin-top:0}.group .row{min-height:50px}.group .row-content{padding-top:13px;padding-bottom:13px}.group-header{padding:8px 16px;background:var(--secondary);color:var(--sub);font-size:13px;text-transform:uppercase}.detail-hero{padding:24px 16px;background:var(--bg);text-align:center;display:flex;align-items:center;flex-direction:column;gap:7px}.detail-hero h2{font-size:22px;margin:5px 0 0}.detail-hero .handle{color:var(--sub);font-size:15px}.status{color:var(--accent);font-size:13px}.info-row{display:flex;justify-content:space-between;gap:12px;padding:13px 16px;font-size:15px;border-bottom:.5px solid var(--line)}.info-row span:last-child{color:var(--sub)}.feed-intro{padding:14px 16px;background:var(--secondary);color:var(--sub);font-size:13px;line-height:1.4}.event-row{width:100%;padding:13px 16px;display:flex;gap:12px;align-items:flex-start;text-align:left;border-bottom:.5px solid var(--line)}.event-icon{width:38px;height:38px;border-radius:50%;background:var(--secondary);display:grid;place-items:center;color:var(--accent);font-size:18px;flex:none}.event-body{flex:1;min-width:0}.event-body b{display:block;font-size:15px;font-weight:600}.event-body p{margin:3px 0 0;color:var(--sub);font-size:13px;line-height:1.35}.event-time{color:var(--sub);font-size:12px;white-space:nowrap}.thread{height:100%;display:flex;flex-direction:column;background-color:var(--chat-bg);background-image:radial-gradient(circle at 8% 15%,rgba(255,255,255,.12) 0 2px,transparent 2.5px),radial-gradient(circle at 70% 55%,rgba(255,255,255,.1) 0 3px,transparent 3.5px);background-size:115px 120px,150px 140px}.thread-scroll{flex:1;overflow:auto;padding:10px 9px 12px;overscroll-behavior:contain;scrollbar-width:none}.thread-scroll::-webkit-scrollbar{display:none}.day-pill{display:table;margin:12px auto 14px;padding:5px 9px;border-radius:12px;background:rgba(60,75,77,.38);color:#fff;font-weight:600;font-size:12px;backdrop-filter:blur(4px)}.message-row{display:flex;margin:3px 0;max-width:100%}.message-row.out{justify-content:flex-end}.bubble{max-width:min(86%,490px);min-width:82px;background:var(--incoming);border-radius:16px 16px 16px 5px;padding:7px 9px 5px;box-shadow:0 1px 2px #0002;position:relative;overflow-wrap:anywhere;white-space:pre-wrap;font-size:15px;line-height:1.34;text-align:left}.out .bubble{background:var(--outgoing);border-radius:16px 16px 5px 16px}.bubble-text{white-space:pre-wrap}.bubble-meta{display:flex;justify-content:flex-end;gap:4px;font-size:10px;color:var(--sub);margin:3px 0 0 16px;white-space:nowrap}.bubble-media{display:block;max-width:100%;max-height:270px;border-radius:10px;object-fit:cover;margin-bottom:4px;background:#0002}.bubble audio{width:min(245px,67vw);height:42px;display:block}.bubble video{max-width:min(270px,68vw);max-height:270px}.file-tile{display:flex;gap:9px;align-items:center;min-width:170px;color:var(--accent);font-size:14px}.file-tile i{width:37px;height:37px;border-radius:9px;display:grid;place-items:center;background:var(--accent);color:#fff;font-style:normal;font-size:20px}.file-tile span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-note{margin:5px 0 2px;padding:6px 8px;border-left:2px solid var(--accent);background:rgba(120,120,120,.1);border-radius:3px;font-size:12px;color:var(--sub);white-space:pre-wrap}.history-note strong{color:var(--text)}.history-note.deleted{border-color:var(--danger)}.thread-footer{height:calc(52px + env(safe-area-inset-bottom));padding:0 12px env(safe-area-inset-bottom);display:flex;align-items:center;gap:9px;background:var(--bar);border-top:.5px solid var(--line);color:var(--sub);font-size:14px}.thread-footer svg{width:25px;height:25px;color:var(--accent)}.thread-footer span{border-radius:18px;background:var(--secondary);padding:9px 14px;flex:1}.thread-search{padding:7px 10px;background:var(--bar)}.thread-search .search{height:33px;font-size:14px}.thread-search .search-field svg{top:8px}.sheet-overlay{position:absolute;inset:0;background:#0007;z-index:8;display:flex;align-items:flex-end;justify-content:center}.sheet{width:min(100%,500px);padding:10px 10px calc(10px + env(safe-area-inset-bottom));animation:slideup .22s ease}.sheet button{display:block;width:100%;background:var(--bar);color:var(--accent);text-align:center;padding:15px;border-bottom:.5px solid var(--line);font-size:17px}.sheet button:first-child{border-radius:13px 13px 0 0}.sheet button:last-child{border-radius:0 0 13px 13px;border-bottom:0}.sheet .cancel{margin-top:9px;border-radius:13px;font-weight:600}.sheet-label{padding:10px;text-align:center;color:#fff;font-size:12px}.viewer{position:absolute;inset:0;background:#000;z-index:9;display:flex;align-items:center;justify-content:center}.viewer img,.viewer video{max-width:100%;max-height:100%;object-fit:contain}.viewer-close{position:absolute;top:calc(10px + env(safe-area-inset-top));right:15px;color:#fff;font-size:30px;z-index:10}.error{color:var(--danger)}.error-banner{padding:12px 16px;color:var(--danger);font-size:14px}.skeleton{height:70px;background:linear-gradient(90deg,var(--bg),var(--secondary),var(--bg));background-size:200% 100%;animation:shimmer 1.4s infinite;border-bottom:.5px solid var(--line)}@keyframes shimmer{to{background-position:-200% 0}}@keyframes slideup{from{transform:translateY(100%)}to{transform:translateY(0)}}@media(min-width:821px){#app{box-shadow:0 0 30px #0002}}@media(max-width:350px){.row{gap:9px}.avatar{width:48px;height:48px}.row-title{font-size:15px}.row-sub{font-size:13px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
[hidden]{display:none!important}.top-action svg,.search-field svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#topbar.profile{background:#80a852;border-bottom:0;color:#fff}#topbar.profile .back,#topbar.profile .top-action{color:#fff}#topbar.profile #heading{opacity:.95}.thread-heading{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}.thread-heading span:last-child{min-width:0}.thread-heading b,.thread-heading small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread-heading b{font-size:16px}.thread-heading small{font-size:11px;color:var(--sub);font-weight:400;margin-top:2px}.thread-heading .avatar{width:33px;height:33px;font-size:13px}#heading:has(.thread-heading){cursor:pointer}.profile-main{background:var(--secondary)!important}.profile-hero{position:relative;min-height:315px;padding:20px 16px 22px;background:linear-gradient(160deg,#9bb656 0%,#70a15b 48%,#328c60 100%);color:#fff;text-align:center;overflow:hidden;display:flex;align-items:center;flex-direction:column;justify-content:center}.profile-leaves{position:absolute;inset:10px 0 auto;font-size:31px;opacity:.18;letter-spacing:24px;white-space:nowrap;pointer-events:none;transform:rotate(-8deg)}.profile-hero .profile-avatar{width:116px;height:116px;font-size:48px;box-shadow:0 3px 14px #143b3444;border:3px solid #ffffff44;z-index:1}.profile-hero h2{font-size:25px;line-height:1.15;margin:13px 0 0;z-index:1}.profile-status{font-size:14px;color:#dbffe7;margin-top:6px;z-index:1}.profile-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;width:100%;margin-top:25px;z-index:1}.profile-actions button{min-height:68px;border-radius:15px;background:#ffffff29;backdrop-filter:blur(12px);font-size:11px;font-weight:600;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px}.profile-actions span{font-size:24px;line-height:28px}.profile-details{padding:14px 12px 30px}.profile-card{background:var(--bg);border-radius:17px;padding:17px 18px;margin-bottom:12px}.profile-card-label{font-size:14px;color:var(--sub);font-weight:500}.profile-handle{font-size:19px;color:var(--accent);font-weight:500;margin-top:3px;overflow-wrap:anywhere}.profile-separator{height:.5px;background:var(--line);margin:17px 0}.profile-id{font-size:15px;color:var(--sub)}.profile-id b{font-weight:500;color:var(--text);margin-left:5px}.profile-stat{display:flex;justify-content:space-between;padding:12px 0;border-bottom:.5px solid var(--line);font-size:15px}.profile-stat:last-of-type{border-bottom:0}.profile-stat b{color:var(--sub);font-weight:500}.profile-footnote{color:var(--sub);font-size:12px;margin-top:12px}.profile-segment{display:flex;margin:18px auto 0;padding:3px;border-radius:25px;background:var(--bg);border:.5px solid var(--line);max-width:380px}.profile-segment button{flex:1;min-width:0;border-radius:22px;padding:10px 8px;font-size:14px;font-weight:600}.profile-segment button:first-child{background:var(--secondary)}.bubble .sticker-media{width:150px;height:150px;max-height:none;object-fit:contain;background:transparent}.bubble:has(.sticker-media),.bubble:has(.lottie-sticker){background:transparent;box-shadow:none;padding:0}.bubble:has(.sticker-media) .bubble-meta,.bubble:has(.lottie-sticker) .bubble-meta{background:#0005;color:#fff;border-radius:8px;padding:3px 6px;width:max-content;margin-left:auto}.lottie-sticker{display:grid;place-items:center;width:150px;height:150px;font-size:58px}.lottie-sticker svg{width:100%;height:100%}.lottie-large{width:min(78vw,380px);height:min(78vw,380px)}.bubble .round-video{width:180px;height:180px;border-radius:50%;object-fit:cover}.audio-label{display:block;font-size:12px;color:var(--accent);margin:2px 0 4px}.viewer video{max-width:100%;max-height:100%}.bubble video.sticker-media{pointer-events:none}@media(max-width:350px){.profile-actions{gap:4px}.profile-actions button{font-size:10px}.profile-hero{min-height:300px}}
.media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:3px}.media-grid .empty{grid-column:1/-1}.media-tile{min-width:0;aspect-ratio:1;background:var(--secondary);position:relative;overflow:hidden;display:grid;place-items:center}.media-tile>img,.media-tile>video,.media-tile>.lottie-sticker{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover;border-radius:0!important;margin:0!important}.media-tile>audio{width:95%}.media-tile>.file-tile{min-width:0;display:flex;flex-direction:column;max-width:100%;padding:6px;font-size:11px;text-align:center}.media-tile>.file-tile span{max-width:100%}.media-tile .media-tile-label{position:absolute;left:0;right:0;bottom:0;padding:15px 5px 5px;color:#fff;font-size:11px;text-align:left;background:linear-gradient(transparent,#0009);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.media-placeholder{font-size:30px}.media-tile .lottie-sticker{font-size:40px}.media-tile video{pointer-events:none}.media-tile audio{pointer-events:none}
.archive-download{display:block;margin:12px auto 8px;padding:12px 18px;border-radius:12px;background:var(--accent);color:#fff;font-size:14px;font-weight:600;max-width:calc(100% - 24px)}
.viewer-download{position:absolute;left:16px;right:16px;bottom:calc(20px + env(safe-area-inset-bottom));max-width:440px;margin:auto;padding:13px 18px;border-radius:13px;background:#007aff;color:#fff;font-size:16px;font-weight:600;z-index:10}.viewer-download:disabled{opacity:.7}.viewer audio{width:min(90%,420px)}.viewer img,.viewer video,.viewer .lottie-large{max-height:calc(100% - 110px)}
.avatar{position:relative;isolation:isolate}.avatar img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover;border-radius:inherit;z-index:1}
/* Telegram themeParams are applied as CSS variables by app.js. */
#topbar{background:var(--header-bg,var(--bar))}#topbar.profile{background:var(--hero-top,#80a852);color:var(--hero-text,#fff)}#topbar.profile .back,#topbar.profile .top-action{color:var(--hero-text,#fff)}#tabs{background:var(--bar)}.profile-hero{background:linear-gradient(160deg,var(--hero-top,#9bb656),var(--hero-middle,#70a15b) 48%,var(--hero-bottom,#328c60));color:var(--hero-text,#fff)}.profile-status{color:var(--hero-status,#dbffe7)}.profile-actions button{background:var(--hero-action-bg,#ffffff29)}.chip.active,.badge,.file-tile i{background:var(--solid-accent,var(--accent));color:var(--button-text,#fff)}
.empty svg{stroke:var(--sub);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
