:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#edf2f7;background:#0b111b;font-size:15px;color-scheme:dark}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100vh}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:12px;background:#5d8fff;color:#fff;padding:11px 16px;font-weight:700}button:hover{filter:brightness(1.1)}input,select{border:1px solid #344157;border-radius:9px;background:#141f30;color:#edf2f7;padding:9px;min-width:0}input[type=checkbox],input[type=range]{accent-color:#6696ff}header,main{max-width:980px;margin:auto}header{padding:27px 20px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px}h1{font-size:24px;margin:4px 0 0;letter-spacing:.02em}header small{font-size:10px;color:#6f8bb4;letter-spacing:.18em}main{padding:0 20px 40px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:15px}.panel{background:#141d2b;border:1px solid #263247;border-radius:18px;padding:20px;box-shadow:0 12px 35px #0002}.hero{grid-column:1/-1}.section-title{display:flex;justify-content:space-between;align-items:center;color:#fff;font-weight:700;margin-bottom:18px}.section-title span+span{color:#8290a6;font-weight:400;font-size:12px}.status{border-radius:30px;background:#493327;color:#ffc18a;padding:7px 12px;font-size:12px;white-space:nowrap}.status.ok{background:#123b32;color:#64d7aa}.coins{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.coin{background:#182436;border:1px solid #27384e;border-radius:14px;padding:15px}.coin-head{display:flex;align-items:center;gap:11px}.coin-head small{display:block;color:#8495ad;font-size:11px;margin-top:2px}.coin-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;font-size:20px}.btc{background:#594326;color:#ffba53}.eth{background:#323f67;color:#9eafff}.coin strong{font-size:31px;display:block;margin:13px 0 3px;font-variant-numeric:tabular-nums}.coin>span{font-size:12px;color:#899bb4}.up{color:#56dbac!important}.down{color:#ff777b!important}canvas{width:100%;height:70px;display:block;margin-top:10px}.player{text-align:center}.player .section-title{text-align:left}.onair{font-size:11px;color:#ff6e74;letter-spacing:.2em;font-weight:800}.play{border-radius:50%;width:84px;height:84px;font-size:31px;margin:15px 0 4px;box-shadow:0 0 0 8px #5d8fff20}#nowPlaying{color:#8fa0b7;font-size:12px;min-height:18px}.controls{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-top:18px;text-align:left}.controls label{flex:1;font-size:12px;color:#899bb4}.controls select{display:block;width:100%;margin-top:6px}.secondary{background:#26364d;color:#dfe9fa}.alerts{max-height:240px;overflow:auto;font-size:13px;color:#9cabbe}.alert{padding:10px 0;border-top:1px solid #29384a;display:flex;justify-content:space-between;gap:8px}.alert b{color:#f2f5fa}.alert small{white-space:nowrap;color:#6d7c92}dialog{width:min(760px,calc(100vw - 20px));max-height:92vh;background:#121c2b;color:#e8f0fa;border:1px solid #33445b;border-radius:18px;padding:0}dialog::backdrop{background:#030811cb}dialog form{display:flex;flex-direction:column;max-height:92vh}.dialog-head,.dialog-actions{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #29384a}.dialog-head h2{margin:0;font-size:19px}.dialog-actions{border-bottom:0;border-top:1px solid #29384a;gap:8px}.icon{background:none;padding:3px 8px}.settings-body{padding:0 20px 16px;overflow:auto}.settings-body h3{font-size:14px;margin:23px 0 12px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid2 label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#9aaac0}.grid2 label.check{flex-direction:row;align-items:center}.hint{font-size:11px;color:#8799b0}.threshold-row{display:grid;grid-template-columns:62px 70px 1fr 1fr;align-items:center;gap:7px;margin:6px 0;font-size:12px}.threshold-row input[type=number]{width:100%}.threshold-row small{color:#8b9bb2}#settingMessage{padding:0 20px;margin:0 0 12px;color:#77d7ab;font-size:12px}.login{display:grid;place-items:center;min-height:100vh;padding:20px}.login .panel{width:min(360px,100%)}.login form{display:grid;gap:15px}.login p{margin:0;color:#93a3bb}.error{color:#ff8488!important;font-size:12px}@media(max-width:700px){header{padding:20px 15px 16px}main{padding:0 12px 30px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.panel{padding:16px}.hero{grid-column:1/-1}.player{grid-column:1}.coin strong{font-size:27px}.coins{grid-template-columns:1fr 1fr;gap:8px}.coin{padding:10px}.coin-head{gap:5px}.coin-head b{font-size:12px}.coin-head small{font-size:9px}.coin-icon{width:24px;height:24px;font-size:16px}.coin strong{font-size:19px}.coin>span{font-size:10px}canvas{height:42px}.grid2{gap:9px}.threshold-row{grid-template-columns:50px 55px 1fr 1fr}}
[hidden]{display:none!important}
@media(max-width:700px){.alerts-panel{grid-column:2}.coin>span{display:block;min-height:28px;line-height:1.35}}
:root[data-theme=light]{color:#182538;background:#eef3f9;color-scheme:light}
:root[data-theme=light] .panel{background:#fff;border-color:#d8e1ec;box-shadow:0 10px 30px #25405b12}
:root[data-theme=light] .coin{background:#f5f8fc;border-color:#dce5ef}
:root[data-theme=light] .section-title,:root[data-theme=light] .alert b{color:#172538}
:root[data-theme=light] input,:root[data-theme=light] select{background:#f7f9fc;color:#1e2b3d;border-color:#ccd8e6}
:root[data-theme=light] .secondary{background:#e4ecf6;color:#233954}
:root[data-theme=light] dialog{background:#fff;color:#182538;border-color:#d8e1ec}
:root[data-theme=light] .dialog-head,:root[data-theme=light] .dialog-actions{border-color:#e2e9f1}
:root[data-theme=light] .alert{border-color:#e2e9f1}
.news{grid-column:1/-1}.news-tabs{display:flex;align-items:center;gap:8px;margin:-4px 0 14px}.news-tab,.news-refresh{padding:7px 11px;background:#23334a;color:#a9b9d0;font-size:12px;border-radius:9px}.news-tab.active{background:#446fc9;color:#fff}.news-refresh{margin-left:auto}.news-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;touch-action:pan-y}.news-card{background:#182436;border:1px solid #293a50;border-radius:12px;padding:13px;min-width:0}.news-card h3{font-size:14px;line-height:1.5;margin:0 0 7px}.news-card p{font-size:12px;line-height:1.55;color:#a8b7cb;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.news-card footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.news-card small{font-size:11px;color:#7e91aa;margin-right:auto}.news-card a{font-size:11px;color:#8eb4ff;text-decoration:none}.news-card button{padding:5px 9px;font-size:11px;border-radius:7px}.news-audio-status{font-size:12px;color:#9db0cb;margin:10px 0 0;min-height:14px}.news-empty{color:#91a4bb;font-size:13px;padding:16px 0}.news-card button:disabled{opacity:.55}
.news{grid-column:1/-1}.news-tabs{display:flex;align-items:center;gap:8px;margin:-4px 0 14px}.news-tab,.news-refresh{padding:7px 11px;background:#23334a;color:#a9b9d0;font-size:12px;border-radius:9px}.news-tab.active{background:#446fc9;color:#fff}.news-refresh{margin-left:auto}.news-list{display:grid;grid-template-columns:1fr 1fr;gap:10px;touch-action:pan-y}.news-card{background:#182436;border:1px solid #293a50;border-radius:12px;padding:13px;min-width:0}.news-card-open{cursor:pointer}.news-card-open:hover{border-color:#5d8fff}.news-card-open:focus-visible{outline:2px solid #5d8fff;outline-offset:2px}.news-card h3{font-size:14px;line-height:1.5;margin:0 0 7px}.news-card p{font-size:12px;line-height:1.55;color:#a8b7cb;margin:0 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.news-card footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.news-card small{font-size:11px;color:#7e91aa;margin-right:auto}.news-card a{font-size:11px;color:#8eb4ff;text-decoration:none}.news-card button{padding:5px 9px;font-size:11px;border-radius:7px}.news-audio-status{font-size:12px;color:#9db0cb;margin:10px 0 0;min-height:14px}.news-empty{color:#91a4bb;font-size:13px;padding:16px 0}.news-card button:disabled{opacity:.55}
:root[data-theme=light] .news-card{background:#f5f8fc;border-color:#dce5ef}:root[data-theme=light] .news-card p{color:#52677e}:root[data-theme=light] .news-tab,:root[data-theme=light] .news-refresh{background:#e4ecf6;color:#314963}:root[data-theme=light] .news-tab.active{background:#446fc9;color:#fff}
@media(max-width:700px){.news{grid-column:1/-1}.alerts-panel{grid-column:2}.news-list{grid-template-columns:1fr}.news-card{padding:11px}.news-tabs{gap:6px}.news-tab,.news-refresh{padding:7px 9px}}
.news-dialog{width:min(760px,calc(100vw - 20px));max-height:90vh}.news-dialog-wrap{display:flex;flex-direction:column;max-height:90vh}.news-dialog .dialog-head{gap:12px}.news-dialog .dialog-head h2{font-size:17px;line-height:1.45}.news-dialog-meta{padding:10px 20px;color:#91a7c3;font-size:12px}.news-dialog-body{overflow:auto;padding:6px 20px 20px;white-space:pre-wrap;line-height:1.8;font-size:14px;min-height:110px}.news-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #29384a;padding:12px 20px}.news-dialog-actions a{color:#8eb4ff;font-size:12px}.news-dialog-actions button:disabled{opacity:.5}.news-dialog .news-audio-status{padding:0 20px 14px;margin:0}.news-card footer button{white-space:nowrap}:root[data-theme=light] .news-dialog-actions{border-color:#e2e9f1}
@media(max-width:700px){.news-dialog .dialog-head{padding:12px 14px}.news-dialog .dialog-head h2{font-size:15px}.news-dialog-meta,.news-dialog-body{padding-left:14px;padding-right:14px}.news-dialog-body{font-size:13px}.news-dialog-actions{padding:10px 14px}}
@media(max-width:700px){.news-tabs{flex-wrap:wrap}#newsPlayAll{order:3;width:100%;margin-left:0;text-align:center}}
.alert-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:-5px 0 13px}.alert-tools button{padding:7px 10px;font-size:12px}.alert-tools span{font-size:11px;color:#91a4bb}.alert-toast{position:fixed;z-index:20;top:15px;left:50%;transform:translateX(-50%);width:min(440px,calc(100vw - 24px));background:#273b59;color:#fff;border:1px solid #ff777b;border-radius:13px;padding:13px 16px;box-shadow:0 12px 38px #0009;font-size:14px;font-weight:700}.alert-toast.down{border-color:#ff777b}.alert-toast.up{border-color:#56dbac}
.news-tab-rail{position:relative;min-width:0;overflow:hidden}.news-tab-strip{display:flex;align-items:center;gap:7px;min-width:0;overflow-x:auto;scrollbar-width:none}.news-tab-strip::-webkit-scrollbar{display:none}.news-tab-strip .news-tab{flex:none}.news-tabs>.news-refresh{flex:none}@media(max-width:700px){.news-tab-rail{width:100%;order:0}.news-tabs{row-gap:8px}#newsPlayAll{order:2;width:auto;flex:1}#newsRefresh{order:3;margin-left:0}}

/* Pair live audio with recent alerts at every supported phone width. */
.player,.alerts-panel{min-width:0}.alerts-panel{display:flex;flex-direction:column}.alerts-panel .alerts{flex:1;min-height:84px;max-height:210px}.alert-tools{align-items:flex-start}.alert-tools span{line-height:1.4}.player{background:linear-gradient(155deg,#172438,#141d2b 64%)}.alerts-panel{background:linear-gradient(155deg,#1b2635,#141d2b 64%)}
@media(max-width:700px){.player,.alerts-panel{padding:12px;border-radius:15px}.player .section-title,.alerts-panel .section-title{font-size:13px;margin-bottom:12px;gap:5px}.player .section-title span+span,.alerts-panel .section-title span+span{font-size:10px;white-space:nowrap}.onair{font-size:9px;letter-spacing:.12em}.play{width:66px;height:66px;font-size:25px;margin:10px 0 3px}#nowPlaying{font-size:10px;line-height:1.4;min-height:28px;margin:8px 0}.controls{flex-direction:column;align-items:stretch;gap:8px;margin-top:11px}.controls label{font-size:11px}.controls select{margin-top:4px;font-size:12px;padding:7px}.controls .secondary{padding:8px;font-size:12px}.alert-tools{gap:5px;margin:-3px 0 8px}.alert-tools button{font-size:10px;padding:5px 7px}.alert-tools span{font-size:9px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.alerts-panel .alerts{max-height:158px;font-size:11px}.alert{padding:7px 0;flex-direction:column;gap:3px}.alert small{font-size:9px}}
@media(max-width:360px){main{gap:7px;padding-left:8px;padding-right:8px}.player,.alerts-panel{padding:9px}.player .section-title,.alerts-panel .section-title{font-size:12px}.player .section-title span+span,.alerts-panel .section-title span+span{font-size:9px}.play{width:58px;height:58px}}
:root[data-theme=light] .player{background:linear-gradient(155deg,#f8fbff,#fff 65%)}:root[data-theme=light] .alerts-panel{background:linear-gradient(155deg,#f6f9fd,#fff 65%)}

.header-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}.theme-toggle{cursor:pointer;border:1px solid #3b4e6b;background:#1c2b40;color:#e8f0ff;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:700;line-height:1.2;white-space:nowrap}.theme-toggle:focus-visible{outline:3px solid #5d8fff;outline-offset:2px}.theme-toggle:disabled{opacity:.6}:root[data-theme=light] .theme-toggle{background:#fff;color:#344d71;border-color:#d1ddeb;box-shadow:0 3px 12px #25405b12}:root[data-theme=light] header small{color:#55729a}:root[data-theme=light] .status{background:#fff0df;color:#8b511a}:root[data-theme=light] .status.ok{background:#e0f5eb;color:#176648}:root[data-theme=light] .coin>span{color:#5b6f86}:root[data-theme=light] .alerts,:root[data-theme=light] #nowPlaying,:root[data-theme=light] .controls label{color:#60738a}:root[data-theme=light] .news-audio-status,:root[data-theme=light] .news-empty{color:#60738a}
@media(max-width:700px){.header-actions{gap:5px}.theme-toggle{padding:6px 9px;font-size:11px}header .status{padding:6px 8px;font-size:10px}header h1{font-size:21px}}
@media(max-width:360px){header{gap:7px;padding-left:10px;padding-right:10px}.theme-toggle{padding:6px 7px}header h1{font-size:19px}header small{font-size:8px}}

/* Keep alert timestamps clear of the list scrollbar. */
@media(min-width:701px){.alerts-panel .alert small{margin-right:1em}}

/* Keep the settings form within narrow phone screens. */
@media(max-width:700px){.settings-body .grid2{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-body .grid2 label{min-width:0}.settings-body .grid2 label.check{font-size:11px;line-height:1.35;overflow-wrap:anywhere}.settings-body .grid2 input,.settings-body .grid2 select{max-width:100%}.dialog-actions{padding:10px 12px}.dialog-actions button{flex:1;min-width:0;padding:9px 4px;font-size:11px;line-height:1.3}}

/* Detailed market chart opened from either price card. */
.coin-open{cursor:pointer;position:relative;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.coin-open:hover{transform:translateY(-2px);border-color:#628ef1;box-shadow:0 10px 25px #0002}.coin-open:focus-visible{outline:3px solid #5d8fff;outline-offset:3px}.coin-hint{display:block;text-align:right;color:#90a8ca;font-size:11px;margin-top:4px}:root[data-theme=light] .coin-hint{color:#597dad}.chart-dialog{width:min(1120px,calc(100vw - 24px));max-width:none;max-height:min(94dvh,900px);padding:0;border-radius:18px;overflow:auto;background:#131e2d;color:#ecf3fc;border:1px solid #36475e;box-shadow:0 24px 80px #0009}.chart-dialog::backdrop{background:#060b14be;backdrop-filter:blur(4px)}.chart-shell{padding:20px 22px 14px}.chart-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.chart-top h2{font-size:22px;margin:3px 0 0}.chart-eyebrow{font-size:11px;letter-spacing:.09em;color:#8ea2bc}.chart-top .icon{flex:none}.chart-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 10px}.chart-intervals,.chart-types{display:flex;align-items:center;gap:5px}.chart-toolbar button{font-size:12px;padding:7px 10px;border-radius:8px;background:transparent;color:#9caec5;white-space:nowrap}.chart-toolbar button.active{background:#426fe0;color:#fff}.chart-toolbar button:hover{background:#294165;color:#fff}.chart-status{font-size:12px;color:#9fb0c4;min-height:20px;font-variant-numeric:tabular-nums}.chart-plot{height:min(58dvh,520px);min-height:300px;width:100%}.chart-plot canvas{height:auto;margin:0}.chart-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;padding-top:10px;font-size:11px;color:#879ab4}.chart-footer a{color:#8eafff;text-decoration:none}:root[data-theme=light] .chart-dialog{background:#fff;color:#1b2d44;border-color:#d8e2ee;box-shadow:0 24px 80px #1f355344}:root[data-theme=light] .chart-eyebrow,:root[data-theme=light] .chart-status,:root[data-theme=light] .chart-footer{color:#647a94}:root[data-theme=light] .chart-toolbar button{color:#587089}:root[data-theme=light] .chart-toolbar button.active{color:#fff}:root[data-theme=light] .chart-footer a{color:#3669c2}
@media(max-width:700px){.chart-dialog{width:calc(100vw - 10px);max-height:96dvh;border-radius:14px}.chart-shell{padding:13px 9px 10px}.chart-top h2{font-size:18px}.chart-toolbar{align-items:stretch;flex-direction:column;margin:11px 0 8px}.chart-intervals{overflow-x:auto;scrollbar-width:none}.chart-intervals::-webkit-scrollbar{display:none}.chart-toolbar button{font-size:11px;padding:7px 8px}.chart-types{justify-content:flex-end}.chart-plot{height:55dvh;min-height:280px}.chart-footer{font-size:10px}}
:root[data-theme=light] .chart-top .icon{color:#314965}

/* Gate-style chart tools and a compact, real public futures order book. */
.chart-extras{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 6px}.chart-indicators{display:flex;align-items:center;gap:4px;font-size:11px;color:#869ab3}.chart-indicators button,.chart-latest{background:transparent;color:#8fa8ca;border-radius:7px;padding:5px 8px;font-size:11px}.chart-indicators button.active{color:#fff;background:#354a68}.chart-indicators button:hover,.chart-latest:hover{background:#354a68;color:#fff}.chart-workspace{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:14px;min-width:0}.chart-workspace .chart-plot{height:min(58dvh,520px);min-width:0}.chart-book{border:1px solid #304258;border-radius:10px;min-width:0;padding:9px 8px;display:flex;flex-direction:column;overflow:hidden}.chart-book-head{display:flex;align-items:baseline;justify-content:space-between;gap:5px}.chart-book-head b{font-size:13px}.chart-book-head small,.book-status{font-size:10px;color:#869bb2}.book-cols{display:flex;justify-content:space-between;color:#8ba0ba;font-size:10px;padding:9px 3px 5px;border-bottom:1px solid #304258}.book-levels{display:grid;grid-template-rows:repeat(10,1fr);min-height:0;flex:1}.book-row{display:flex;align-items:center;justify-content:space-between;position:relative;gap:6px;padding:0 3px;min-height:19px;font-size:11px;font-variant-numeric:tabular-nums}.book-row::before{content:"";position:absolute;right:0;top:1px;bottom:1px;width:var(--depth);background:var(--depth-bg);z-index:0}.book-row span{position:relative;z-index:1}.book-row.ask{color:#ff7380;--depth-bg:#ff697525}.book-row.bid{color:#3ed0a0;--depth-bg:#28c99625}.book-row span:last-child{color:#d9e3f1}.book-spread{padding:8px 3px;margin:3px 0;border-top:1px solid #304258;border-bottom:1px solid #304258;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums}.book-status{margin-top:5px}.chart-dialog .chart-top .icon{color:#dfe9fa}:root[data-theme=light] .chart-book{border-color:#dce5f0}:root[data-theme=light] .book-cols,:root[data-theme=light] .book-spread{border-color:#dce5f0}:root[data-theme=light] .book-row span:last-child{color:#34495f}:root[data-theme=light] .chart-indicators{color:#73869e}:root[data-theme=light] .chart-indicators button,:root[data-theme=light] .chart-latest{color:#5a7294}:root[data-theme=light] .chart-indicators button.active{background:#e3edff;color:#245ac1}:root[data-theme=light] .chart-dialog .chart-top .icon{color:#314965}
@media(max-width:700px){.chart-workspace{grid-template-columns:minmax(0,1fr);gap:12px}.chart-workspace .chart-plot{height:52dvh;min-height:300px}.chart-book{padding:9px}.book-levels{grid-template-rows:repeat(10,20px)}.book-row{font-size:12px}.chart-extras{margin-top:2px}.chart-indicators button,.chart-latest{padding:5px 7px}.chart-book-head b{font-size:14px}}
.chart-actions{display:flex;align-items:center;gap:3px;flex-wrap:wrap;justify-content:flex-end}.chart-gesture-hint,.chart-legend{font-size:11px;line-height:1.4;color:#8fa3bb;margin:2px 0 5px}.chart-legend{font-variant-numeric:tabular-nums;color:#d3a94b}.chart-plot{touch-action:pan-y pinch-zoom}
:root[data-theme=light] .chart-gesture-hint{color:#647a94}:root[data-theme=light] .chart-legend{color:#886620}
@media(max-width:700px){.chart-dialog{width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;overflow-x:hidden}.chart-shell{padding:12px 10px 18px}.chart-extras{flex-direction:column;align-items:stretch;gap:3px}.chart-indicators{white-space:nowrap}.chart-actions{gap:2px;flex-wrap:nowrap}.chart-actions .chart-latest{font-size:11px;padding:5px 6px}.chart-workspace .chart-plot{height:68dvh;min-height:420px}.chart-gesture-hint{margin:4px 0 5px}}
.chart-plot-wrap{position:relative;min-width:0}.chart-candle-info{position:absolute;top:30px;right:52px;z-index:5;width:184px;padding:9px 11px;border:1px solid #344a64;border-radius:10px;background:#172538ed;box-shadow:0 10px 32px #0005;color:#e8f0f8;font-size:11px;font-variant-numeric:tabular-nums;backdrop-filter:blur(8px)}.chart-candle-info[hidden]{display:none}.chart-candle-head{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:5px}.chart-candle-head strong{font-size:11px;white-space:nowrap}.chart-candle-head button{border:0;background:transparent;color:inherit;font-size:17px;line-height:1;padding:1px 3px}.chart-candle-row{display:flex;justify-content:space-between;gap:10px;padding:2px 0}.chart-candle-row span{color:#99acc0}.chart-candle-row b{font-weight:600;white-space:nowrap}.chart-candle-row .up{color:#1fc58c}.chart-candle-row .down{color:#ff6875}:root[data-theme=light] .chart-candle-info{background:#fffffff0;color:#26384e;border-color:#d9e4ef;box-shadow:0 8px 28px #29446635}:root[data-theme=light] .chart-candle-row span{color:#718298}@media(max-width:700px){.chart-candle-info{top:42px;right:52px;width:164px;padding:8px 9px;font-size:10px}.chart-candle-head strong{font-size:10px}}
.chart-live-price{font-size:13px;font-weight:700;color:#1bc389;margin:2px 0 5px;font-variant-numeric:tabular-nums}:root[data-theme=light] .chart-live-price{color:#087f61}.chart-candle-info{pointer-events:none}.chart-candle-head button{pointer-events:auto;cursor:pointer}
.chart-live-price{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding:9px 12px;margin:5px 0 8px;border:1px solid #1b9d76;border-radius:11px;background:#0b3c34;color:#bdf5de;box-shadow:0 4px 18px #071b2080}.chart-live-price span{font-size:11px;letter-spacing:.04em}.chart-live-price strong{font-size:22px;line-height:1.1;color:#6bffd0;font-variant-numeric:tabular-nums}.chart-live-price small{font-size:12px;color:#d4f8e8;margin-left:auto}:root[data-theme=light] .chart-live-price{background:#e6f8ef;border-color:#96d8b8;color:#21644a;box-shadow:0 4px 14px #18774a1a}:root[data-theme=light] .chart-live-price strong{color:#087c55}:root[data-theme=light] .chart-live-price small{color:#487b66}@media(max-width:700px){.chart-live-price{padding:9px 10px;gap:3px 9px}.chart-live-price strong{font-size:20px}.chart-live-price small{font-size:11px}}
.chart-live-price{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:10px 12px}.chart-live-price span{grid-column:1;grid-row:1}.chart-live-price small{grid-column:2;grid-row:1;margin:0}.chart-live-price strong{grid-column:1/-1;grid-row:2;font-size:30px}.chart-current-bar{font-size:12px;font-weight:700;line-height:1.5;color:#d4e6fa;background:#21344b;border-left:3px solid #48a5ff;border-radius:5px;padding:6px 9px;margin:2px 0 6px;font-variant-numeric:tabular-nums}:root[data-theme=light] .chart-current-bar{background:#eef5ff;color:#315378;border-left-color:#4778e7}@media(max-width:700px){.chart-live-price strong{font-size:27px}.chart-current-bar{font-size:11px}}
.chart-candle-info.side-left{left:10px;right:auto}.chart-candle-info.side-right{left:auto;right:52px}

/* Live, deduplicated page and audio listener count in the top-right header. */
.online-count{display:inline-flex;align-items:center;gap:6px;border:1px solid #2f5a51;background:#143a33;color:#7be1b4;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}.online-count::before{content:"";width:6px;height:6px;border-radius:50%;background:#50d69f;box-shadow:0 0 0 3px #50d69f23}:root[data-theme=light] .online-count{background:#e7f7ef;border-color:#c4e8d4;color:#247457}
@media(max-width:700px){.header-actions{max-width:160px}.online-count{padding:6px 8px;font-size:10px;gap:4px}.online-count::before{width:5px;height:5px}}

.chart-history-notice{margin:8px 0;padding:9px 12px;border-radius:10px;background:#eaf2ff;color:#24549d;font-size:13px;font-weight:700;line-height:1.4}
html[data-theme="dark"] .chart-history-notice{background:#203451;color:#bfd5ff}
.chart-history-notice[hidden]{display:none}

/* Keep the quote beside the title and put chart periods directly above the plot. */
.chart-top{gap:8px}.chart-top h2{margin-top:1px}.chart-shell{padding-top:14px}.chart-live-price{margin:7px 0 5px;padding:8px 11px;gap:2px 8px}.chart-live-price strong{font-size:25px}.chart-current-bar{margin:0 0 5px;padding:4px 8px}.chart-toolbar{margin:6px 0 3px;min-width:0}.chart-intervals{min-width:0}.chart-extras{margin:0 0 2px}.chart-gesture-hint{margin:5px 0 0}.chart-status,.chart-legend{min-height:0;margin:1px 0;line-height:1.25}.chart-history-notice{margin:4px 0}.chart-workspace{margin-top:2px}
@media(max-width:700px){.chart-shell{padding:8px 10px 12px}.chart-top h2{font-size:17px}.chart-eyebrow{font-size:10px}.chart-live-price{padding:6px 9px;margin:5px 0 4px}.chart-live-price strong{font-size:23px}.chart-live-price span,.chart-live-price small{font-size:10px}.chart-current-bar{padding:3px 7px;font-size:10px;line-height:1.35}.chart-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px;margin:5px 0 2px}.chart-intervals{overflow-x:auto;scrollbar-width:none;white-space:nowrap}.chart-toolbar button{padding:5px 7px}.chart-types{justify-content:flex-end;flex:none}.chart-types button{padding:5px 6px}.chart-extras{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:2px;margin:0 0 2px}.chart-indicators{gap:1px}.chart-indicators button,.chart-actions .chart-latest{padding:3px 5px;font-size:10px}.chart-actions{margin-left:auto}.chart-status,.chart-legend{font-size:10px}.chart-gesture-hint{font-size:10px}.chart-workspace .chart-plot{height:clamp(360px,62dvh,640px);min-height:0}}
@media(orientation:landscape) and (max-height:600px){.chart-dialog{width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;overflow-x:hidden}.chart-shell{padding:5px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left))}.chart-top{min-height:28px}.chart-top h2{display:inline;font-size:15px}.chart-eyebrow{display:inline;margin-right:8px}.chart-live-price{display:flex;align-items:baseline;gap:8px;margin:2px 0;padding:3px 8px}.chart-live-price span,.chart-live-price small,.chart-live-price strong{grid-column:auto;grid-row:auto}.chart-live-price strong{font-size:19px}.chart-live-price small{margin-left:auto}.chart-current-bar{padding:2px 7px;margin:2px 0;font-size:10px}.chart-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;margin:2px 0}.chart-extras{display:flex;flex-direction:row;flex-wrap:nowrap;margin:0 0 2px}.chart-indicators,.chart-actions{white-space:nowrap}.chart-gesture-hint{display:none}.chart-workspace{display:block;margin-top:0}.chart-workspace .chart-plot{height:clamp(245px,calc(100dvh - 145px),520px);min-height:0}.chart-book{margin-top:8px}.chart-footer{padding-top:6px}}

/* Public chat: keep its entrance beside the online count on narrow phones. */
.header-social{display:flex;align-items:center;gap:7px;white-space:nowrap}
.chat-entry{padding:7px 12px;border:1px solid #6687dd;border-radius:999px;background:#305bb9;color:#fff;font-size:12px;line-height:1.2;white-space:nowrap;box-shadow:0 3px 12px #3769c335}
.chat-entry:focus-visible{outline:3px solid #8ab0ff;outline-offset:2px}
.chat-dialog{width:min(560px,calc(100vw - 16px));max-width:none;height:min(780px,calc(100dvh - 24px));max-height:none;overflow:hidden}
.chat-shell{position:relative;height:100%;display:flex;flex-direction:column;min-height:0;background:#101b2b}
.chat-head{padding:18px 20px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #30415a}
.chat-head small{color:#8099ba;font-size:10px;letter-spacing:.14em}
.chat-head h2{margin:3px 0 0;font-size:21px}.chat-head h2 span{font-size:13px;font-weight:500;color:#9aadc6}
.chat-head .icon{color:#dbe8f9;font-size:20px}
.chat-subhead{display:flex;justify-content:space-between;gap:8px;padding:9px 20px;background:#182940;color:#91a7c3;font-size:11px}
.chat-subhead .ready{color:#59d4a0}
.chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:20px 16px;display:flex;flex-direction:column;gap:13px;background:linear-gradient(135deg,#111f31,#17283d)}
.chat-empty{margin:auto;text-align:center;color:#90a4bd;font-size:13px;line-height:1.7}
.chat-row{display:flex;justify-content:flex-start}.chat-row.own{justify-content:flex-start}
.chat-bubble{max-width:min(82%,380px);padding:10px 12px;border:1px solid #354b68;border-radius:15px 15px 15px 4px;background:#223650;box-shadow:0 4px 12px #06101e25}
.chat-row.own .chat-bubble{border-color:#5275d8;border-radius:15px 15px 4px 15px;background:#305cba}
.chat-meta{display:flex;align-items:center;gap:9px;margin-bottom:5px;font-size:11px;color:#b6c9e1}.chat-meta b{font-weight:700}.chat-meta time{opacity:.7;font-variant-numeric:tabular-nums}
.chat-bubble p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;font-size:14px;color:#f6f9ff}
.chat-compose{padding:11px 15px max(12px,env(safe-area-inset-bottom));border-top:1px solid #30415a;background:#142237;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px}
.chat-compose label{font-size:11px;color:#9bb0cb}.chat-nickname{width:130px;max-width:100%;padding:7px 9px;font-size:12px}
.chat-write{grid-column:1/-1;display:flex;align-items:center;gap:7px}.chat-write input{flex:1;min-width:0}.chat-write button{padding:9px 16px}
.chat-compose p{grid-column:1/-1;margin:0;color:#8ba2bd;font-size:10px;min-height:12px}
:root[data-theme=light] .chat-shell{background:#fff}:root[data-theme=light] .chat-head{border-color:#dfe7f2}:root[data-theme=light] .chat-subhead{background:#eef4fb;color:#637a95}:root[data-theme=light] .chat-messages{background:linear-gradient(135deg,#f5f9ff,#eaf1fa)}:root[data-theme=light] .chat-bubble{background:#fff;border-color:#d5e1ef}:root[data-theme=light] .chat-bubble p{color:#20334b}:root[data-theme=light] .chat-meta{color:#527297}:root[data-theme=light] .chat-row.own .chat-bubble{background:#4775dc;border-color:#4775dc}:root[data-theme=light] .chat-row.own .chat-bubble p,:root[data-theme=light] .chat-row.own .chat-meta{color:#fff}:root[data-theme=light] .chat-compose{background:#fff;border-color:#dfe7f2}
:root[data-theme=light] .chat-head .icon{color:#34506d}
@media(max-width:700px){header{align-items:flex-start}.header-actions{max-width:170px}.header-social{gap:4px}.chat-entry{padding:6px 8px;font-size:10px}.chat-dialog{width:100%;height:100dvh;margin:0;border:0;border-radius:0}.chat-head{padding:12px 15px}.chat-subhead{padding:8px 15px}.chat-messages{padding:15px 12px}}

.chat-entry{position:relative}.chat-unread-dot{position:absolute;top:-3px;right:-3px;width:9px;height:9px;border-radius:50%;background:#ff5965;box-shadow:0 0 0 2px #fff,0 2px 7px #b9233680}
.chat-subhead{align-items:center}
.chat-older{align-self:center;padding:6px 12px;background:#293f5d;color:#bbd3f6;border-radius:999px;font-size:11px}
.chat-row{align-items:flex-end;gap:7px}.chat-row.own{flex-direction:row-reverse}
.chat-avatar-box,.chat-avatar-self{flex:none;width:30px;height:30px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#446890;color:white;font-size:13px;font-weight:700}.chat-avatar-box img,.chat-avatar-self img{width:100%;height:100%;object-fit:cover;margin:0}.chat-avatar-self{width:34px;height:34px;padding:0;border:2px solid #7598d6}
.chat-row.own .chat-avatar-box{background:#4e7de0}
.chat-photo{display:block;width:auto;max-width:100%;max-height:280px;margin:4px 0;border-radius:9px;object-fit:contain;cursor:zoom-in}.chat-photo:focus-visible{outline:2px solid #83adff}
.chat-profile{grid-column:1/-1;display:flex;align-items:center;gap:7px}.chat-profile label{margin-left:3px}.chat-profile small{font-size:10px;color:#8299b7}
.chat-photo-preview{grid-column:1/-1;display:flex;align-items:center;gap:9px}.chat-photo-preview img{max-width:85px;max-height:70px;border-radius:8px;object-fit:cover}.chat-photo-preview button{padding:6px 8px;font-size:11px}
.chat-photo-pick{flex:none;width:44px;height:44px;display:grid;place-items:center;padding:0;border-radius:12px;background:#304b73;color:#e4efff;touch-action:manipulation}.chat-photo-pick svg{display:block}
.chat-write .chat-avatar-self{width:44px;height:44px;padding:0;border-radius:50%;cursor:pointer}
.chat-profile-overlay{position:absolute;inset:0;z-index:15;display:grid;place-items:center;padding:18px;background:#06101eb8}.chat-profile-overlay[hidden]{display:none}
.chat-profile-card{width:min(100%,340px);padding:20px;border:1px solid #3b5679;border-radius:18px;background:#17283e;color:#edf5ff;box-shadow:0 18px 55px #0007}
.chat-profile-head{display:flex;align-items:center;justify-content:space-between}.chat-profile-head h3{margin:0;font-size:18px}.chat-profile-head button{padding:4px 7px;background:transparent;color:inherit;font-size:19px}
.chat-profile-avatar-pick{display:flex;align-items:center;gap:13px;width:100%;margin:16px 0;padding:8px;background:#263b56;color:#e8f2ff;text-align:left}.chat-profile-avatar-frame{width:58px;height:58px;flex:none;display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#4165a3;font-size:24px}.chat-profile-avatar-frame img{width:100%;height:100%;object-fit:cover}
.chat-profile-card p{min-height:18px;color:#9db2cc;font-size:12px}
:root[data-theme=light] .chat-profile-card{background:#fff;border-color:#d6e1ef;color:#20334b}:root[data-theme=light] .chat-profile-avatar-pick{background:#edf3fb;color:#28446b}:root[data-theme=light] .chat-profile-card p{color:#69809b}
.chat-image-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0;padding:40px 10px 10px;background:#07101aeb;display:none;align-items:center;justify-content:center}.chat-image-dialog[open]{display:flex}.chat-image-dialog img{max-width:100%;max-height:100%;object-fit:contain}.chat-image-dialog button{position:absolute;right:15px;top:12px;padding:7px 11px;background:#253c58;color:#fff;font-size:20px}
:root[data-theme=light] .chat-older{background:#e3edfa;color:#4267a0}:root[data-theme=light] .chat-photo-pick{background:#e4ecf7;color:#2e4d78}
.chart-extreme-label{position:absolute;z-index:4;pointer-events:none;white-space:nowrap;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;line-height:16px;color:#dce7f5;text-shadow:0 1px 2px #07111c}.chart-extreme-label[hidden]{display:none}.chart-extreme-label::before{content:"";position:absolute;top:50%;width:16px;border-top:1px solid currentColor}.chart-extreme-label.side-right::before{right:100%}.chart-extreme-label.side-left::before{left:100%}:root[data-theme=light] .chart-extreme-label{color:#263648;text-shadow:0 1px 2px #fff}
.chart-plot{touch-action:pan-y}.chart-actions button{touch-action:manipulation}

/* Stronger contrast for light-theme market data. */
:root[data-theme=light] .down{color:#c9233d!important}
:root[data-theme=light] .book-row.ask{color:#c9233d;--depth-bg:#d62f452b}
:root[data-theme=light] .book-row span:last-child{color:#1d2b3c}
:root[data-theme=light] .chart-candle-info{color:#1d2b3c}
:root[data-theme=light] .chart-candle-row span{color:#4b5f76}
:root[data-theme=light] .chart-extreme-label{color:#182536;text-shadow:0 1px 2px #fff}

/* Keep live prices visible beside chat on desktop. */
@media(min-width:1100px){
  body.chat-docked{--chat-side:max(12px,calc(50vw - 812px))}
  body.chat-docked #app{width:min(1200px,calc(100% - 424px - var(--chat-side) - var(--chat-side)));margin-left:var(--chat-side);margin-right:0}
  body.chat-docked header,body.chat-docked main{max-width:1200px}
  body.chat-docked .chat-dialog{position:fixed;inset:12px var(--chat-side) 12px auto;margin:0;width:400px;height:calc(100dvh - 24px);max-height:none;border:1px solid #34465f;border-radius:16px;box-shadow:0 16px 42px #06101e30;z-index:30}
  :root[data-theme=light] body.chat-docked .chat-dialog{border-color:#d5e1ef;box-shadow:0 16px 42px #29446626}
}

.target-price-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 18px}.target-price-grid label{display:flex;flex-direction:column;gap:7px;color:#9aaac0;font-size:12px}.target-price-grid textarea{width:100%;min-height:68px;resize:vertical;border:1px solid #344157;border-radius:10px;background:#141f30;color:#edf2f7;padding:10px;font:inherit;font-size:14px;line-height:1.5}:root[data-theme=light] .target-price-grid label{color:#536b88}:root[data-theme=light] .target-price-grid textarea{background:#f7faff;color:#182536;border-color:#cbd9e9}@media(max-width:700px){.target-price-grid{grid-template-columns:1fr;gap:10px}}

.alert-tools{display:flex;flex-direction:column;align-items:stretch;gap:9px;margin:-3px 0 14px}.alert-action-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}.alert-action-row>span{flex:1;min-width:0;color:#90a6c1;font-size:12px;line-height:1.4}.alert-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;flex:none}.alert-buttons button{min-height:34px;padding:7px 11px;font-size:12px;white-space:nowrap}.alert-tools #pushStatus{display:block;padding:8px 10px;border-radius:9px;background:#ffffff0b;color:#91a4bb;font-size:11px;line-height:1.4}:root[data-theme=light] .alert-action-row>span{color:#607997}:root[data-theme=light] .alert-tools #pushStatus{background:#edf3fa;color:#667f9c}@media(max-width:700px){.alert-action-row{display:block}.alert-action-row>span{display:block;margin-bottom:8px}.alert-buttons{justify-content:flex-start;gap:6px}.alert-buttons button{min-height:30px;padding:6px 8px;font-size:10px}.alert-tools #pushStatus{padding:7px 8px}}

/* Keep the exchange beside the title and group the chat controls on phones. */
@media(max-width:700px){
  #app > header {
    display: grid;
    grid-template-columns: max-content max-content minmax(0, 1fr) max-content;
    grid-template-areas: "eyebrow eyebrow eyebrow eyebrow" "title source . ." "social social social theme";
    align-items: center;
    gap: 5px 7px;
  }
  .header-brand, .header-actions { display: contents; }
  .header-brand-meta { grid-area: eyebrow; }
  .header-brand-row { grid-area: title; }
  .market-source-picker { grid-area: source; }
  .header-social { grid-area: social; justify-self: end; }
  .header-theme-control, #app > header #themeToggle { grid-area: theme; }
}
@media(max-width:380px){header{gap:5px;padding-left:10px;padding-right:10px}header h1{font-size:18px}header small{font-size:8px;letter-spacing:.08em}}

/* Keep touch scrolling in chat without zooming the page. */
.chat-dialog,
.chat-messages,
.chat-direct-inbox,
.chat-image-dialog {
  touch-action: pan-y;
}

.chat-swipe-viewport, .chat-swipe-track, .chat-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.chat-swipe-viewport, .chat-content { overflow: clip; }
.chat-swipe-track > .swipe-preview { height: 100%; }

/* Full-screen chat locks the market page; the desktop dock only owns its own scroll. */
:root:has(#chatDialog:modal) {
  overflow: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
}
.chat-dialog, .chat-messages, .chat-direct-inbox {
  overscroll-behavior-y: none;
}

/* iOS Safari zooms when focusing inputs smaller than 16px. */
.chat-write input {
  font-size: 16px;
}

.chat-profile-overlay { overflow-y: auto; touch-action: pan-y; }
.chat-profile-card { max-height: 100%; overflow-y: auto; }
.chat-profile-row {
  display: grid;
  grid-template-columns: 2.5em minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  border-bottom: 1px solid #849cc437;
}
.chat-profile-row > :nth-child(2) { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-profile-edit {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
}
.chat-profile-editor { display: grid; gap: 8px; margin: 8px 0 12px; font-size: 13px; }
.chat-profile-editor input, .chat-profile-editor textarea {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid #849cc488;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.chat-profile-editor > div { display: flex; justify-content: flex-end; gap: 8px; }
.chat-profile-card #chatProfileHint { margin: 10px 0 0; }
.chat-profile-card #chatProfileHint:empty { margin: 0; min-height: 0; }

button.chat-avatar-box { padding: 0; border: none; cursor: pointer; }
.chat-member-identity { display: flex; align-items: center; gap: 12px; margin: 16px 0; overflow-wrap: anywhere; }
.chat-member-dialog { max-height: calc(100dvh - 24px); }
#chatMemberMessage { width: 100%; }
.chat-direct-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-direct-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 5px;
}
.chat-direct-head > button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: inherit;
}
.chat-direct-head > button:hover { background: #849cc42b; }
.chat-direct-inbox { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 8px; }
.chat-direct-inbox small { font-weight: 400; }
.chat-direct-messages { display: flex; flex-direction: column; gap: 10px; }
.chat-direct-compose { display: grid; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); }
.chat-direct-compose input { flex: 1; min-width: 0; font-size: 16px; }
#chatDirectStatus { margin: 6px 12px; font-size: 12px; }
#chatDirectStatus:empty { display: none; }
#chatDirectBadge { color: #ff8998; font-weight: 800; }
:root[data-theme=light] #chatDirectBadge { color: #b72540; }

.chat-direct-write { display: flex; align-items: center; gap: 7px; }
.chat-direct-peer .chat-avatar-box { width: 36px; height: 36px; }
.chat-direct-peer strong, .chat-direct-peer small, #chatMemberHandle { display: block; }
.chat-direct-peer small, #chatMemberHandle { margin-top: 3px; opacity: .8; }
#chatHandleAccept { width: auto; }

.chat-view-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  margin: 8px 12px;
  border-radius: 10px;
  background: #22334b;
}
.chat-view-nav button { padding: 7px; border-radius: 7px; background: transparent; color: inherit; font-size: 13px; }
.chat-view-nav button[aria-pressed=true] { background: #3b65b9; color: #fff; }
:root[data-theme=light] .chat-view-nav { background: #eaf0f8; }
:root[data-theme=light] .chat-view-nav button[aria-pressed=true] { background: #fff; color: #234d9f; box-shadow: 0 1px 3px #20345224; }

.chat-direct-inbox button.chat-direct-peer {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 60px;
  padding: 9px 8px;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid #849cc44d;
  background: transparent;
  color: inherit;
}
.chat-direct-peer:hover, .chat-direct-peer:focus-visible { background: #849cc42b !important; }
.chat-conversation { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat-conversation .chat-peer-text { display: grid; grid-template-columns: minmax(0, max-content) auto; align-items: center; }
.chat-conversation .chat-peer-text small { grid-row: 2; grid-column: 1 / -1; }
.chat-conversation-states { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; opacity: .75; }
.chat-conversation-states svg { width: 14px; height: 14px; }
.chat-peer-text { min-width: 0; font-size: 14px; }
.chat-peer-text strong, .chat-peer-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer-meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; font-weight: 400; opacity: .85; }
.chat-tab-dot, .chat-peer-unread {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eb394f;
}
.chat-tab-dot { margin-inline-start: 5px; vertical-align: .12em; }
.chat-request-count { margin-inline-start: 8px; color: #ff8d9e; font-size: 11px; font-weight: 650; }
:root[data-theme=light] .chat-request-count { color: #ab2640; }
.chat-friend-requests {
  --friend-request-surface: #1b2a42;
  --friend-request-line: #344d70;
  --friend-request-secondary: #263c58;
  margin-block: 5px 14px;
  border: 1px solid var(--friend-request-line);
  border-radius: 12px;
  background: var(--friend-request-surface);
}
:root[data-theme=light] .chat-friend-requests {
  --friend-request-surface: #f1f6ff;
  --friend-request-line: #d4e1f2;
  --friend-request-secondary: #e1eaf6;
}
.chat-direct-inbox .chat-friend-requests h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding: 10px 11px 8px;
  gap: 5px;
}
.chat-friend-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-top: 1px solid var(--friend-request-line);
}
.chat-direct-inbox .chat-friend-request > button.chat-direct-peer {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 6px;
  min-height: 52px;
  padding: 5px 4px;
  border: 0;
  border-radius: 8px;
}
.chat-friend-request-actions { display: flex; gap: 5px; }
.chat-friend-request-action {
  min-height: 36px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--friend-request-secondary);
  color: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.chat-friend-request-action.primary { background: #315ec6; color: #fff; }
.chat-friend-request-action:disabled { opacity: .58; }

.chat-photo-pick.chat-emoji-pick { width: 38px; height: 40px; padding: 0; font-size: 24px; line-height: 1; }
.chat-emoji-panel { grid-column: 1/-1; min-width: 0; padding: 7px; background: #1b2e46; border: 1px solid #344b67; border-radius: 12px; }
.chat-emoji-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.chat-emoji-tabs button { padding: 5px 9px; border-radius: 6px; background: transparent; color: inherit; font-size: 12px; }
.chat-emoji-tabs button[aria-pressed=true] { background: #345582; color: #fff; }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-height: min(23dvh, 145px); overflow-y: auto; }
.chat-emoji-grid.sticker-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.chat-emoji-grid button { min-width: 0; min-height: 34px; padding: 2px; background: transparent; font-size: 21px; border-radius: 6px; }
.chat-emoji-grid button:hover, .chat-emoji-grid button:focus-visible { background: #6e9edc38; }
.chat-emoji-grid img { width: 100%; display: block; border-radius: 7px; aspect-ratio: 1; }
:root[data-theme=light] .chat-emoji-panel { background: #f1f5fb; border-color: #d9e5f4; }
:root[data-theme=light] .chat-emoji-tabs button[aria-pressed=true] { color: #1d448c; background: #dbe8fb; }
@media (max-width: 390px) {
  .chat-write { gap: 5px; }
  .chat-write .chat-avatar-self, .chat-write .chat-photo-pick { width: 34px; height: 36px; }
  .chat-write .chat-photo-pick { padding: 0; }
  .chat-write #chatSend { padding: 8px 10px; }
}

.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.news-pagination button { min-height: 36px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.news-pagination button:disabled { opacity: .45; cursor: default; }
#newsPageInfo { color: #93a9c4; font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
:root[data-theme=light] #newsPageInfo { color: #5b708c; }
.news-swipe-viewport { overflow: clip; touch-action: pan-y pinch-zoom; }
.swipe-track { position: relative; }
.swipe-preview { position: absolute; top: 0; width: 100%; pointer-events: none; }
#newsList { scroll-margin-top: 12px; }
#newsUpdated { font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.news-card footer a { color: inherit; font-size: 12px; white-space: nowrap; text-decoration: none; }
.news-card footer a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .chat-view-nav button, .news-tab {
    transition: color 160ms ease;
  }
}
.chat-view-nav { position: relative; isolation: isolate; }
.swipe-tab-highlight { position: absolute; left: 0; z-index: -1; pointer-events: none; }
.chat-view-nav.swipe-highlight-active > button[aria-pressed="true"] {
  background: transparent !important;
  box-shadow: none !important;
}
/* The pill and its white labels share one clipping layer outside the scroller. */
:root .news-tab-strip.swipe-highlight-active > .news-tab {
  background: #23334a;
  color: #a9b9d0;
  transition: none;
}
:root[data-theme=light] .news-tab-strip.swipe-highlight-active > .news-tab {
  background: #e4ecf6;
  color: #314963;
}
.news-swipe-tab-highlight {
  position: absolute;
  left: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  color: white;
}
.news-swipe-tab-highlight > span {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  place-items: center;
  white-space: nowrap;
}
@media (forced-colors: active) {
  .news-swipe-tab-highlight { forced-color-adjust: none; background: Highlight !important; color: HighlightText; }
}
@media (pointer: coarse) {
  :root { overscroll-behavior-y: none; }
}
#app { position: relative; }
#app.home-pull-active > :is(header, main) {
  transform: translate3d(0, var(--home-pull-offset), 0);
}
.home-refresh {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  place-items: center;
  height: var(--home-pull-offset, 0px);
  overflow: hidden;
  pointer-events: none;
  color: #a9bed8;
  font-size: 13px;
  font-weight: 650;
  opacity: var(--home-pull-opacity, 0);
}
:root[data-theme=light] .home-refresh { color: #425f82; }
.home-refresh-label {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  transform: translateY(4px);
}
.home-refresh:is([data-state=pull], [data-state=ready]) .home-refresh-instruction,
.home-refresh[data-state=loading] .home-refresh-loading,
.home-refresh:is([data-state=done], [data-state=error]) .home-refresh-result {
  opacity: 1;
  transform: translateY(0);
}
.home-refresh[data-state=ready] .home-refresh-arrow { transform: rotate(180deg); }
.home-refresh[data-state=done] .home-refresh-result { color: #45bda0; }
:root[data-theme=light] .home-refresh[data-state=done] .home-refresh-result { color: #157961; }
.home-refresh[data-state=done] .home-refresh-result-icon::before { content: "✓"; }
.home-refresh[data-state=error] .home-refresh-result-icon::before { content: "!"; }
.home-refresh-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid #7298da70;
  border-top-color: currentColor;
  border-radius: 50%;
}
.home-refresh-status {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .home-refresh-label { transition: opacity 200ms ease, transform 240ms cubic-bezier(.22,.75,.3,1); }
  .home-refresh-arrow { transition: transform 180ms ease; }
  .home-refresh[data-state=loading] .home-refresh-spinner { animation: home-refresh-spin .7s linear infinite; }
}
@keyframes home-refresh-spin { to { transform: rotate(360deg); } }

.book-row-empty { visibility: hidden; }
@media (pointer: coarse) {
  .chart-dialog { overscroll-behavior-y: contain; overflow-anchor: none; }
  .chart-book {
    overflow: visible;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
  }
}

.chart-quote-overlay { position: absolute; z-index: 3; left: 0; right: 0; height: 0; pointer-events: none; color: #72dfbd; }
.chart-quote-guide { position: absolute; left: 0; top: 0; border-top: 1px dashed currentColor; opacity: .76; }
#chartQuoteButton {
  pointer-events: auto;
  position: absolute;
  right: 2px;
  top: 0;
  transform: translateY(-50%);
  color: #d6fff2;
  background: #173b35;
  border: 1px solid #368875;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
  touch-action: manipulation;
}
.chart-quote-overlay.is-history #chartQuoteButton { right: 10px; }
:root[data-theme=light] .chart-quote-overlay { color: #087b5d; }
:root[data-theme=light] #chartQuoteButton { background: #f3fffa; border-color: #79b7a7; color: #07624a; }

#closeChart {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #6ca6ff;
  border-radius: 50%;
  line-height: 1;
}
:root[data-theme=light] #closeChart { border-color: #387bd6; }

.chat-photo-editor {
  width: min(580px, calc(100vw - 20px));
  max-height: 94dvh;
  border: 1px solid #526782;
  border-radius: 16px;
  background: #172638;
  color: #e6edf7;
  padding: 12px;
}
.chat-photo-editor::backdrop { background: #08101ccc; }
:root[data-theme=light] .chat-photo-editor { background: #fff; color: #1a293b; border-color: #cad9e9; }
.chat-photo-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chat-editor-image { position: relative; width: fit-content; max-width: 100%; margin: auto; }
#chatEditorBase {
  display: block;
  max-width: 100%;
  max-height: 65dvh;
  width: min(100%, calc(65dvh * var(--photo-ratio, 1)));
  height: auto;
}
#chatEditorOverlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.chat-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.chat-editor-actions button { padding: 8px 9px; font-size: 12px; }
.chat-editor-actions [data-photo-tool] { background: #314966; color: #eef4ff; }
.chat-editor-actions [data-photo-tool][aria-pressed=true] { background: #3d68c4; color: #fff; }
:root[data-theme=light] .chat-editor-actions [data-photo-tool][aria-pressed=false] { background: #e6eef9; color: #284267; }
#chatEditorDone { margin-left: auto; }
#chatEditorHint { margin: 8px 0 0; color: #d94b5c; font-size: 12px; }
#chatEditorHint:empty { display: none; }
.chat-photo-preview { flex-wrap: wrap; }

.chat-voice-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.chat-voice-preview audio, .chat-message-audio { width: 220px; max-width: 100%; height: 40px; display: block; }
.chat-voice-preview button { font-size: 12px; padding: 6px 8px; }
.chat-bubble:has(.chat-message-audio) { min-width: min(248px, 100%); }
@media (max-width: 390px) {
  .chat-photo-pick.chat-emoji-pick { width: 32px; height: 36px; }
}
.chat-emoji-grid.sticker-grid button { display: grid; place-items: center; gap: 2px; line-height: 1.1; min-height: 48px; color: #1b2941; }
.chat-emoji-grid.sticker-grid small { font-size: 10px; font-weight: 700; white-space: nowrap; }

.chat-draft-wrap { flex: 1; min-width: 0; position: relative; }
.chat-write, .chat-direct-write { align-items: flex-end; }
.chat-draft {
  display: block;
  width: 100%;
  min-height: 40px;
  max-height: min(44dvh, 22rem);
  padding: 8px 9px;
  border: 1px solid #344157;
  border-radius: 10px;
  background: #141f30;
  color: #edf2f7;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
:root[data-theme=light] .chat-draft { background: #f7f9fc; border-color: #ccd8e6; color: #1e2b3d; }
.chat-recording-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 3px;
  border-radius: 9px;
  background: #385baa;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}
.chat-recording-cover.cancel { background: #b22947; }

.chat-voice-target {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 1px solid #344157;
  border-radius: 10px;
  padding: 4px 8px;
  background: #141f30;
  color: #bac9dc;
  font-size: 13px;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
:root[data-theme=light] .chat-voice-target { background:#f7f9fc; color:#526a89; border-color:#ccd8e6; }
.chat-draft:not(:placeholder-shown) + .chat-voice-target { display: none; }
.chat-draft:focus + .chat-voice-target { color: transparent; background: transparent; border-color: transparent; }
.chat-recording-cover { z-index: 1; }
.chat-recording-card {
  position: absolute;
  z-index: 5;
  top: 49%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(180px, calc(100% - 32px));
  padding: 14px 10px;
  border-radius: 16px;
  color: #fff;
  background: #23417c;
  box-shadow: 0 10px 38px #14274960;
  text-align: center;
  font-size: 12px;
  pointer-events: none;
}
.chat-recording-card.cancel { background: #a92643; }
.chat-recording-card time { color: #e2ecff; font-variant-numeric: tabular-nums; }
.chat-recording-bars { height: 20px; display: flex; align-items: center; gap: 3px; }
.chat-recording-bars i { width: 3px; height: 8px; border-radius: 2px; background: #bcd6ff; }
.chat-recording-bars i:nth-child(2n) { height: 13px; }
.chat-recording-bars i:nth-child(3) { height: 19px; }
.chat-recording-card.recording i { animation: chat-record-meter 650ms ease-in-out infinite alternate; }
.chat-recording-card.recording i:nth-child(2n) { animation-delay: -350ms; }
@keyframes chat-record-meter { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chat-recording-card.recording i { animation: none; } }
.chat-bubble p.chat-recalled { font-size: 12px; font-weight: 500; opacity: .76; }

.chat-view-nav { grid-template-columns: repeat(5, minmax(0, 1fr)) 38px; }
.chat-view-nav button { white-space: nowrap; }
.chat-social-list > button:first-child { margin: 4px 0 10px; }
.chat-social-list h3 { margin: 14px 0 7px; font-size: 13px; }
.chat-social-note { margin: 10px 0; font-size: 13px; line-height: 1.5; }
.chat-social-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-social-actions button, #chatActionBody button { font-size: 13px; padding: 8px 12px; }
#chatActionBody { display: grid; gap: 8px; margin-top: 12px; }
#chatActionBody > input { width: 100%; font-size: 16px; }
#chatActionStatus, #chatRelationshipStatus { margin: 8px 0 0; font-size: 13px; }
#chatActionStatus:empty, #chatRelationshipStatus:empty { display: none; }
.chat-group-options { max-height: min(38dvh, 320px); overflow: auto; margin: 0; padding: 0; }
.chat-group-options label { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.chat-group-options input { width: 18px; height: 18px; }
.chat-invite-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.chat-invite-users { overscroll-behavior: contain; }
.chat-invite-users label { min-height: 46px; gap: 9px; padding: 6px 4px; cursor: pointer; }
.chat-invite-users label + label { border-top: 1px solid color-mix(in srgb, currentColor 13%, transparent); }
.chat-invite-users input { flex: none; margin: 0 3px 0 auto; accent-color: #3b65b9; }
.chat-invite-friend-name { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.chat-invite-friend-name small { font-size: 11px; opacity: .76; }
.chat-danger { color: #ff9cab; background: #6e2937; }
:root[data-theme=light] .chat-danger { color: #a81b34; background: #fae6eb; }
.chat-meta .chat-message-menu, .chat-meta .chat-inline-member {
  color: inherit; background: transparent; padding: 2px 3px; border-radius: 4px; line-height: 1;
}
.chat-meta .chat-message-menu { margin-inline-start: auto; font-size: 16px; }
.chat-meta .chat-inline-member { font-size: inherit; }
.chat-bubble { -webkit-touch-callout: none; }
@media (any-pointer: coarse) {
  .chat-bubble { -webkit-user-select: none; user-select: none; }
}
.chat-pinned-bar { display: flex; gap: 4px; padding: 0 12px 8px; }
.chat-pinned-bar button { min-height: 42px; background: #274a7b; color: #fff; font-size: 13px; padding: 6px 10px; }
:root[data-theme=light] .chat-pinned-bar button { background: #e0eafa; color: #1b4176; }
.chat-pinned-bar svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#chatPinnedJump, #chatPublicPinnedJump { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; text-align: start; }
.chat-pinned-bar button > span { min-width: 0; }
.chat-pinned-bar strong { display: block; line-height: 1.1; font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-pinned-bar small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
:is(#chatPinnedList, #chatPublicPinnedList, #chatPinnedRemove, #chatPublicPinnedRemove) { display: grid; place-items: center; min-width: 42px; }
.chat-pin-flash .chat-bubble { animation: chat-pin-flash 1.3s ease-out; }
@keyframes chat-pin-flash { from { box-shadow: 0 0 0 3px #6f9dff; } }

.chat-view-nav #chatAddOpen {
  display: grid; place-items: center; padding: 0; min-height: 34px;
  border-radius: 8px; font-size: 23px; line-height: 1; background: #314e79; color: #f3f7ff;
}
:root[data-theme=light] .chat-view-nav #chatAddOpen { background: #dce8fb; color: #214b96; }
#chatActionBody .chat-plus-item {
  display: flex; align-items: center; gap: 11px; width: 100%; color: inherit;
  text-align: start; background: #213753; min-width: 0; padding: 10px;
}
:root[data-theme=light] #chatActionBody .chat-plus-item { background: #eef3fb; }
.chat-plus-item span:last-child { min-width: 0; overflow-wrap: anywhere; }
.chat-plus-item strong, .chat-plus-item small { display: block; }
.chat-plus-item strong { font-size: 14px; }
.chat-plus-item small { margin-top: 2px; opacity: .8; font-weight: 500; }
.chat-plus-symbol {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  background: #3867c4; color: #fff; border-radius: 9px; font-size: 20px;
}
.chat-lookup-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px;
  align-items: stretch; padding: 0; margin: 0; background: transparent;
}
.chat-lookup-form input, .chat-group-field input, .chat-group-field textarea, .chat-group-field select {
  min-width: 0; width: 100%; font-size: 16px;
}
.chat-group-field { display: grid; gap: 5px; font-size: 13px; }
.chat-group-field textarea { resize: vertical; }
#chatActionBody .chat-primary { background: #3b65b9; color: #fff; }
.chat-direct-messages .chat-row .chat-avatar-box { flex: none; }

.chat-action-heading { min-width: 0; flex: 1; }
.chat-action-heading h3 { overflow-wrap: anywhere; }
:is(.chat-group-card, .chat-member-settings) {
  --group-surface: #1d3049;
  --group-line: #394b64;
  --group-muted: #a1b2c9;
  --group-accent: #afc7ff;
  --group-primary: #3764c4;
  --group-track: #4f6179;
}
.chat-group-card {
  width: min(414px, calc(100vw - 24px));
  max-height: min(700px, calc(100dvh - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
}
:root[data-theme=light] :is(.chat-group-card, .chat-member-settings) {
  --group-surface: #f5f8fc;
  --group-line: #dce5f1;
  --group-muted: #556d88;
  --group-accent: #2c58a4;
  --group-primary: #315ebe;
  --group-track: #94a4b8;
}
:root[data-theme=light] .chat-group-card { box-shadow: 0 20px 66px #0d1e3c40; }
.chat-group-card[open] { display: flex; flex-direction: column; }
.chat-group-card::backdrop { background: #0b13237d; }
.chat-group-card .chat-profile-head {
  flex: none;
  gap: 11px;
  padding: 15px 17px 13px;
  border-bottom: 1px solid var(--group-line);
}
.chat-group-card .chat-profile-head h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.28;
}
#chatActionSubtitle {
  display: block;
  margin-top: 2px;
  color: var(--group-muted);
  font-size: 12px;
  line-height: 1.5;
}
#chatActionIcon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--group-primary);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
.chat-group-card .chat-profile-head button {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: var(--group-surface);
  color: var(--group-muted);
  font-size: 16px;
}
.chat-group-card .chat-profile-head #chatActionBack { font-size: 25px; }
.chat-group-card .chat-profile-head #chatActionEdit {
  flex-basis: auto;
  padding-inline: 12px;
  color: var(--group-accent);
  font-size: 13px;
  white-space: nowrap;
}
.chat-group-card #chatActionBody {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 0;
  padding: 14px 17px 17px;
}
.chat-group-card #chatActionBody > * { flex: none; }
.chat-group-card #chatActionStatus { margin: 0; padding: 0 17px 11px; }
.chat-conversation-menu {
  width: min(330px, calc(100vw - 32px));
  --menu-text: inherit;
  --menu-hover: var(--group-surface);
  --menu-danger: #ff8d9a;
}
:root[data-theme=light] .chat-conversation-menu { --menu-danger: #bd2944; }
.chat-conversation-menu #chatActionBody { padding-block: 7px 12px; }
.chat-conversation-actions { display: grid; }
#chatActionBody .chat-conversation-actions .chat-message-action { min-height: 44px; }
#chatActionBody .chat-conversation-actions .chat-message-delete { border-top: 1px solid var(--group-line); border-radius: 0 0 8px 8px; }
.chat-conversation-confirm { margin: 5px 0 0; color: var(--group-muted); font-size: 14px; line-height: 1.55; }
.chat-group-description { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.chat-group-intro .chat-group-list { padding: 9px 11px; }
.chat-group-intro .chat-group-description { color: inherit; }
.chat-group-intro .chat-group-description a { color: var(--group-accent); text-underline-offset: 2px; }
.chat-group-description-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
#chatActionBody .chat-group-description-toggle {
  display: block;
  margin: 4px 0 0 auto;
  min-height: 32px;
  padding: 3px 0 3px 12px;
  background: transparent;
  color: var(--group-accent);
  font-size: 13px;
}
.chat-room-profile-shortcuts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
#chatActionBody .chat-room-profile-shortcuts button { min-height: 42px; padding-inline: 6px; border-radius: 10px; }
.chat-group-section h4 {
  margin: 0 0 5px 2px;
  color: var(--group-muted);
  font-size: 12px;
  font-weight: 600;
}
.chat-group-list {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--group-line);
  background: var(--group-surface);
}
.chat-group-roster { max-height: min(187px, 28dvh); overflow-y: auto; }
:is(#chatActionBody, #chatMemberSettings) .chat-group-row, #chatActionBody .chat-group-list > .chat-danger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 43px;
  padding: 6px 11px;
  border-radius: 0;
  line-height: 1.35;
  background: transparent;
  color: inherit;
  text-align: start;
  font-size: 14px;
  font-weight: 550;
  touch-action: manipulation;
}
#chatActionBody .chat-group-list > .chat-danger { color: #ff9cab; }
:root[data-theme=light] #chatActionBody .chat-group-list > .chat-danger { color: #a81b34; }
:is(#chatActionBody, #chatMemberSettings) .chat-group-list > button + button { border-top: 1px solid var(--group-line); }
:is(#chatActionBody, #chatMemberSettings) .chat-group-row:focus-visible, #chatActionBody .chat-group-list > .chat-danger:focus-visible {
  outline: 2px solid var(--group-accent);
  outline-offset: -2px;
}
#chatActionBody .chat-group-person { min-height: 48px; }
.chat-pinned-page { width: min(510px, calc(100vw - 24px)); height: min(620px, 84dvh); }
:is(.chat-pinned-page, .chat-room-profile) #chatActionClose { display: none; }
.chat-pinned-page #chatActionBody { flex: 1; overflow: hidden; }
.chat-pinned-page #chatActionBody > .chat-pinned-page-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
  min-height: 0;
}
.chat-pinned-page-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px 13px 5px;
  border-radius: 14px;
  border: 1px solid var(--group-line);
  background: var(--group-surface);
}
.chat-pinned-message-head, .chat-pinned-message-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-pinned-message-head time { color: var(--group-muted); font-size: 12px; white-space: nowrap; }
.chat-pinned-page-row p { margin: 0; color: inherit; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-pinned-page-row p a { color: var(--group-accent); }
.chat-pinned-page-row audio { max-width: 100%; }
.chat-pinned-page-row video { max-width: 100%; max-height: 240px; }
#chatActionBody .chat-pinned-photo { justify-self: start; padding: 0; background: transparent; }
.chat-pinned-photo img { margin: 0; max-height: 220px; }
#chatActionBody .chat-pin-remove {
  color: var(--group-accent); background: transparent; padding: 4px 6px; min-height: 39px; font-size: 13px;
}
.chat-pinned-page-toolbar { display: flex; align-items: center; gap: 8px; justify-content: end; }
.chat-pinned-search {
  display: flex; align-items: center; gap: 6px; border-radius: 20px; border: 1px solid var(--group-line);
  padding-inline: 11px 4px; background: var(--group-surface); color: var(--group-muted);
}
.chat-pinned-search input {
  flex: 1; width: 100%; min-height: 42px; padding: 4px; color: inherit; background: transparent; border: 0; font-size: 16px;
}
.chat-pinned-search:focus-within { border-color: var(--group-accent); }
.chat-pinned-search input:focus { outline: 0; }
.chat-pinned-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
#chatActionBody .chat-pinned-search-trigger, #chatActionBody .chat-pinned-search button {
  display: grid; place-items: center; min-width: 44px; min-height: 42px; padding: 0; border-radius: 13px;
  background: var(--group-surface); color: var(--group-accent);
}
.chat-pinned-page-toolbar svg, .chat-pinned-search svg, .chat-room-shortcut svg {
  flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.chat-room-profile #chatActionBody .chat-room-shortcut {
  display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 60px;
  border: 1px solid var(--group-line); border-radius: 12px; background: var(--group-surface); color: var(--group-accent);
}
.chat-room-profile .chat-group-roster { max-height: none; overflow-y: visible; }
@media (max-width: 700px) {
  #chatActionDialog:is(.chat-pinned-page, .chat-room-profile) {
    position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0;
  }
  :is(.chat-pinned-page, .chat-room-profile) .chat-profile-head { padding-top: max(15px, env(safe-area-inset-top)); }
  :is(.chat-pinned-page, .chat-room-profile) #chatActionBody { padding-bottom: max(17px, env(safe-area-inset-bottom)); }
}
.chat-group-person .chat-peer-text { flex: 1; }
.chat-group-person .chat-peer-text strong { display: block; }
.chat-group-role {
  flex: none;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--group-muted);
  font-size: 11px;
}
.chat-group-role:is([data-role=owner], [data-role=admin]) {
  background: #6288de29;
  color: var(--group-accent);
}
.chat-group-row-detail { margin-inline-start: auto; color: var(--group-muted); font-size: 12px; }
.chat-group-chevron {
  width: 7px;
  height: 7px;
  margin-inline: auto 3px;
  border-top: 1.5px solid var(--group-muted);
  border-right: 1.5px solid var(--group-muted);
  transform: rotate(45deg);
}
.chat-group-row-detail + .chat-group-chevron { margin-inline-start: 0; }
.chat-group-switch {
  display: flex;
  align-items: center;
  flex: 0 0 34px;
  height: 20px;
  margin-inline-start: auto;
  padding: 2px;
  border-radius: 11px;
  background: var(--group-track);
}
.chat-group-switch::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.chat-group-row[aria-checked=true] .chat-group-switch { justify-content: flex-end; background: var(--group-primary); }

#chatMemberDialog {
  width: min(392px, calc(100vw - 24px));
  padding: 17px;
  overscroll-behavior-y: contain;
}
.chat-member-settings { margin-top: 13px; }
#chatMemberDialog .chat-member-identity { margin: 14px 0; }
#chatMemberName { font-size: 18px; }
#chatMemberLetter { color: #fff; }
#chatMemberHandle { color: #a6b8d1; font-size: 12px; }
:root[data-theme=light] #chatMemberHandle { color: #516782; }
.chat-member-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0,1fr);
  gap: 6px;
}
.chat-member-actions button {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 62px;
  gap: 5px;
  padding: 6px 2px;
  border: 1px solid #3c5271;
  border-radius: 12px;
  background: #233a55;
  color: #e3edff;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.chat-member-actions svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-member-actions button[aria-pressed=true] { background: #315bb0; color: white; }
:root[data-theme=light] .chat-member-actions button { border-color: #d7e3f5; background: #edf4fd; color: #23497f; }
:root[data-theme=light] .chat-member-actions button[aria-pressed=true] { background: #315bb0; color: white; }
.chat-member-links {
  margin-top: 12px;
  padding-inline: 10px;
  border: 1px solid #405471;
  border-radius: 11px;
  background: #1d3049;
}
:root[data-theme=light] .chat-member-links { background: #f4f7fc; border-color: #dce5f1; }
.chat-member-links button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 3px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  font-size: 14px;
  font-weight: 550;
}
.chat-member-links button + button { border-top: 1px solid #8194af55; }
.chat-member-links button span { font-size: 18px; opacity: .65; }
.chat-member-links #chatMemberCommon span { font-size: 12px; }
.chat-file-preview { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-file-preview strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-file-preview button { padding: 6px 9px; font-size: 12px; flex: none; }
.chat-file-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
  padding: 8px 10px;
  background: #709ed521;
  border-radius: 8px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.chat-file-link small { opacity: .78; }
.chat-bubble video, .chat-shared-item video { display: block; width: 100%; max-height: 225px; background: #101c2b; border-radius: 8px; }
.chat-bubble a { color: inherit; text-underline-offset: 2px; overflow-wrap: anywhere; }
.chat-shared-tabs {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  background: var(--group-surface);
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--group-line);
  border-radius: 10px;
}
.chat-group-profile-tabs { grid-template-columns: repeat(5,minmax(0,1fr)); }
#chatActionBody .chat-shared-tabs button {
  padding-inline: 2px;
  border-radius: 7px;
  background: transparent;
  color: var(--group-muted);
}
#chatActionBody .chat-shared-tabs button[aria-pressed=true] { color: #fff; background: var(--group-primary); }
.chat-shared-items { display: grid; gap: 8px; min-width: 0; }
.chat-shared-items[data-kind=media] { grid-template-columns: repeat(2,minmax(0,1fr)); }
.chat-shared-items > p { grid-column: 1 / -1; padding: 18px 0; text-align: center; }
.chat-shared-item {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--group-line);
  background: var(--group-surface);
  min-width: 0;
}
.chat-shared-item > a:not(.chat-file-link) { display: block; color: var(--group-accent); overflow-wrap: anywhere; font-size: 13px; }
.chat-shared-item audio { width: 100%; max-width: none; }
#chatActionBody .chat-shared-photo { display: block; width: 100%; padding: 0; background: transparent; }
.chat-shared-photo img { width: 100%; height: 98px; margin: 0; object-fit: cover; }
.chat-shared-item video { height: 98px; object-fit: contain; }
.chat-shared-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 11px; color: var(--group-muted); }
#chatActionBody .chat-shared-options { padding: 0 7px; min-height: 27px; background: transparent; color: inherit; font-size: 18px; }
#chatActionBody .chat-shared-refresh { padding: 5px 8px; background: var(--group-surface); color: var(--group-accent); }

.chat-call-dialog {
  width: min(342px, calc(100vw - 28px));
  text-align: center;
  padding: 22px;
  --call-bg: #101923;
}
.chat-call-header { position: relative; }
.chat-call-dialog h3 { margin: 0 0 18px; font-size: 19px; }
#chatCallMinimize { position: absolute; top: -6px; right: -6px; min-width: 44px; min-height: 40px; padding: 6px 9px; font-size: 12px; }
#chatCallIcon {
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #385da8;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
#chatCallName { font-size: 18px; overflow-wrap: anywhere; }
#chatCallStatus { margin: 7px 0 18px; font-variant-numeric: tabular-nums; }
#chatCallAudioHint { margin: -9px 0 7px; min-height: 0; }
#chatCallRestoreAudio { margin: 0 auto 12px; padding: 7px 12px; font-size: 12px; }
.chat-call-buttons { display: flex; justify-content: center; gap: 8px; }
.chat-call-buttons button { flex: 1; min-height: 42px; padding: 7px; }
#chatCallAccept { background: #087c5b; }
#chatCallEnd { background: #b93450; }
#chatCallMute[aria-pressed=true] { background: #446fcb; color: #fff; }
dialog#chatCallDialog.chat-video-call {
  box-sizing: border-box;
  width: min(840px, calc(100vw - 28px));
  max-width: none;
  height: min(720px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--call-bg);
  color: #fff;
}
.chat-call-video-home:empty { display: none; }
.chat-video-call .chat-call-video-home,
.chat-call-video-stage { position: absolute; inset: 0; }
.chat-call-video-stage { isolation: isolate; overflow: hidden; background: #101923; }
.chat-call-picture {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f0f5fb;
  background: #182631;
  overflow: hidden;
}
.chat-call-picture > :is(video, img) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-call-local-picture video { transform: scaleX(-1); }
.chat-call-picture > span { padding: 7px; font-size: 13px; line-height: 1.4; }
.chat-call-video-stage .chat-call-local-picture,
.chat-call-video-stage.local-primary .chat-call-remote-picture,
#chatCallSwap {
  position: absolute;
  inset: max(82px, calc(env(safe-area-inset-top) + 66px)) max(14px, env(safe-area-inset-right)) auto auto;
  width: clamp(84px, 24%, 154px);
  aspect-ratio: 3 / 4;
  max-height: 34%;
  z-index: 2;
  border-radius: 10px;
}
.chat-call-video-stage.local-primary .chat-call-local-picture {
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  z-index: 1;
  border-radius: 0;
}
#chatCallSwap {
  padding: 0;
  font-size: 0;
  background: transparent;
  cursor: pointer;
}
#chatCallSwap:focus-visible { outline: 2px solid #dcecff; outline-offset: 3px; }
.chat-video-call .chat-call-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  padding: max(14px, env(safe-area-inset-top)) max(66px, calc(env(safe-area-inset-right) + 60px)) 22px max(16px, env(safe-area-inset-left));
  text-align: left;
  pointer-events: none;
  background: linear-gradient(#08101bd1, #08101b00);
  text-shadow: 0 1px 4px #0009;
}
.chat-video-call #chatCallIcon, .chat-video-call #chatCallTitle { display: none; }
.chat-video-call #chatCallName { font-size: 17px; }
.chat-video-call #chatCallStatus { margin: 3px 0 0; color: #e6eef8; font-size: 13px; }
.chat-video-call #chatCallMinimize {
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  color: #fff;
  background: #0b1829a8;
  pointer-events: auto;
}
.chat-video-call .chat-call-footer {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: 26px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(#08101b00, #08101bee);
}
.chat-video-call .chat-call-buttons button { flex: 0 1 112px; min-height: 46px; }
.chat-video-call .chat-call-footer .secondary { color: #fff; background: #172637d9; }
.chat-video-call #chatCallAudioHint { margin: 0 0 7px; color: #e6eef8; font-size: 12px; }
#chatCallCamera[aria-pressed=true] { background: #446fcb; color: #fff; }
.chat-call-dock {
  position: fixed;
  z-index: 100;
  isolation: isolate;
  box-sizing: border-box;
  display: grid;
  width: 144px;
  min-height: 58px;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #6f8aa066;
  box-shadow: 0 7px 24px #0d172748;
  background: #182631;
  color: #fff;
}
.chat-call-dock.video { width: 112px; height: 140px; }
.chat-call-dock-info {
  z-index: 3;
  align-self: end;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  font-size: 12px;
}
.chat-call-dock-info strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-call-dock-info span { color: #e6eef8; font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.chat-call-dock.video .chat-call-dock-info { padding: 14px 8px 7px; background: linear-gradient(transparent, #09131be5); }
.chat-call-dock.video .chat-call-video-stage:not(.local-primary) .chat-call-local-picture,
.chat-call-dock.video .chat-call-video-stage.local-primary .chat-call-remote-picture { opacity: 0; }
.chat-call-dock .chat-call-picture > span { font-size: 11px; }
#chatCallExpand {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 0;
  border-radius: 0;
  background: transparent;
  touch-action: none;
  cursor: grab;
}
#chatCallExpand:active { cursor: grabbing; }
#chatCallExpand:focus-visible { outline: 2px solid #a7c8ff; outline-offset: -3px; }
@media (max-width: 700px), (pointer: coarse) and (max-height: 520px) {
  dialog#chatCallDialog.chat-video-call { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
}
.chat-direct-head #chatDirectTitle {
  min-width: 0;
  max-width: 100%;
  padding: 3px 0;
  background: transparent;
  color: inherit;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  text-align: center;
}
.chat-direct-heading { min-width: 0; }
.chat-direct-head > #chatDirectAvatar { background: #446890; color: #fff; font-size: 16px; }
.chat-direct-identity { display: grid; justify-items: center; min-width: 0; }
.chat-direct-details { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px 8px; }
.chat-direct-details small { color: #788ca4; font-size: 11px; }
.chat-presence { color: #788ca4; font-size: 11px; line-height: 1.4; }
.chat-presence.online, .chat-direct-details .online { color: #168765; }
.chat-presence::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.chat-read-receipt { white-space: nowrap; font-size: 10px; opacity: .8; }
.chat-read-receipt.read { opacity: 1; }
@media (hover: hover) {
  .chat-meta button.chat-inline-member:hover { text-decoration: underline; }
}
.chat-reply-draft {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  background: #638bcc26;
  border-inline-start: 3px solid #668dda;
  border-radius: 7px;
  font-size: 12px;
}
.chat-reply-draft span, .chat-reply-quote { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-draft button { flex: none; padding: 4px 7px; background: transparent; color: inherit; }
.chat-bubble .chat-reply-quote {
  display: block;
  max-width: 100%;
  margin: 4px 0;
  padding: 5px 8px;
  border-radius: 5px;
  border-inline-start: 2px solid currentColor;
  background: #779bd52b;
  color: inherit;
  font-size: 11px;
  text-align: start;
}
.chat-reaction-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chat-reaction-bar .chat-reaction-pill {
  border: 1px solid transparent;
  padding: 2px 5px;
  border-radius: 12px;
  background: #779bd537;
  color: inherit;
  font-size: 11px;
}
.chat-reaction-bar .chat-reaction-pill[aria-pressed=true] { border-color: currentColor; }
#chatActionDialog.chat-message-actions {
  --menu-surface: #1d2a3b;
  --menu-line: #364557;
  --menu-text: #eef4ff;
  --menu-muted: #a9b9cb;
  --menu-accent: #a2bfff;
  --menu-hover: #2b3c53;
  --menu-danger: #ff9ca9;
  position: fixed;
  inset: auto;
  left: var(--message-left, 12px);
  top: var(--message-top, 12px);
  width: min(288px, var(--message-width, calc(100vw - 24px)));
  max-width: none;
  max-height: var(--message-height, calc(100dvh - 24px));
  box-sizing: border-box;
  margin: 0;
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--menu-text);
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
:root[data-theme=light] #chatActionDialog.chat-message-actions {
  --menu-surface: #fbfdff;
  --menu-line: #dbe5f0;
  --menu-text: #17263b;
  --menu-muted: #5c7089;
  --menu-accent: #2e5ba6;
  --menu-hover: #eaf1fb;
  --menu-danger: #b32642;
}
.chat-message-actions::backdrop {
  background: #0e1b34a6;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
:root[data-theme=light] .chat-message-actions::backdrop { background: #23354d66; }
.chat-message-actions .chat-profile-head { display: none; }
.chat-message-actions #chatActionBody { margin: 0; gap: 7px; }
.chat-message-actions :is(.chat-reaction-picker, .chat-action-preview, .chat-message-action-list, #chatActionStatus:not(:empty)) {
  border: 1px solid var(--menu-line);
  background: var(--menu-surface);
}
.chat-reaction-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 4px 6px;
  border-radius: 24px;
}
#chatActionBody .chat-reaction-picker button {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0;
  border-radius: 20px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
#chatActionBody .chat-reaction-picker button[aria-pressed=true] {
  background: var(--menu-hover);
  box-shadow: inset 0 0 0 1px var(--menu-accent);
}
.chat-action-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  padding: 9px 8px 9px 12px;
  border-radius: 13px;
}
.chat-action-preview:has(img) { grid-template-columns: 36px minmax(0, 1fr) 36px; }
.chat-action-preview img { width: 36px; height: 36px; object-fit: cover; border-radius: 7px; }
.chat-action-preview div div { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--menu-muted); }
.chat-action-preview strong { max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--menu-accent); }
.chat-action-preview time { white-space: nowrap; font-variant-numeric: tabular-nums; }
#chatActionBody .chat-action-preview p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.4;
  min-height: 0;
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--menu-text);
}
.chat-message-action-list {
  display: grid;
  width: fit-content;
  min-width: min(208px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  justify-self: start;
  padding: 2px 7px;
  border-radius: 13px;
}
.chat-message-action-list.own { justify-self: end; }
.chat-message-delete-list { display: grid; }
.chat-message-action + .chat-message-delete-list { margin-top: 2px; padding-top: 2px; border-top: 1px solid var(--menu-line); }
#chatActionBody .chat-message-action, #chatActionBody .chat-message-dismiss {
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--menu-text);
}
#chatActionBody .chat-message-action {
  gap: 9px;
  min-height: 39px;
  font-size: 14px;
  font-weight: 600;
  text-align: start;
}
#chatActionBody .chat-message-dismiss { justify-content: center; width: 36px; height: 36px; color: var(--menu-muted); }
#chatActionBody .chat-message-delete { color: var(--menu-danger); }
.chat-message-actions svg, .chat-conversation-menu #chatActionBody svg, .chat-conversation-states svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-message-actions svg, .chat-conversation-menu #chatActionBody svg { width: 18px; height: 18px; }
@media (hover: hover) {
  #chatActionBody :is(.chat-reaction-picker button, .chat-message-action, .chat-message-dismiss):hover { background: var(--menu-hover); }
}
.chat-message-actions :is(button, button:focus-visible) { touch-action: manipulation; }
.chat-message-actions #chatActionStatus:not(:empty) {
  margin: 7px 0 0;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--menu-danger);
}
.chat-selecting :is(#chatForm, #chatDirectForm, .chat-message-menu) { display: none; }
.chat-selection-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid #3b506b;
  background: #17283e;
  color: #e3eeff;
}
:root[data-theme=light] .chat-selection-bar { border-color: #dce6f2; background: #fff; color: #253d5e; }
.chat-selection-bar [role=status] { text-align: center; font-size: 13px; font-weight: 650; }
.chat-selection-bar button { min-height: 39px; padding: 7px 13px; font-weight: 650; white-space: nowrap; }
.chat-selection-bar button:disabled { opacity: .5; }
.chat-selecting .chat-row {
  position: relative;
  padding-inline-start: 34px;
  border-radius: 12px;
  cursor: pointer;
}
.chat-selecting .chat-row.chat-selected { background: #4775dc25; }
.chat-select-check {
  position: absolute;
  inset-inline-start: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid #849abb;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.chat-select-check[aria-pressed=true] { background: #3968c6; border-color: #3968c6; }
.chat-select-check[aria-pressed=true]::after {
  content: '';
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.chat-subhead .chat-settings-open {
  --chat-settings-fill: #30445e;
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 5px;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--chat-settings-fill);
  color: #e4eefb;
  font-size: 11px;
}
:root[data-theme=light] .chat-settings-open {
  --chat-settings-fill: #dfebf9;
  color: #294869;
}
#chatSound .chat-group-switch { margin-inline-start: 0; }
.chat-theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chat-theme-swatch {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px;
  border-radius: 6px;
  background: var(--chat-theme-sample);
}
.chat-theme-swatch::before, .chat-theme-swatch::after {
  content: '';
  width: 60%;
  height: 12px;
  border-radius: 7px 7px 7px 3px;
  background: #fff;
}
.chat-theme-swatch::after {
  justify-self: end;
  background: var(--chat-theme-accent);
  border-radius: 7px 7px 3px 7px;
}
[data-chat-theme=classic] { --chat-theme-sample: #e3ebfa; --chat-theme-accent: #4775dc; }
[data-chat-theme=jade] { --chat-theme-sample: #dcefe8; --chat-theme-accent: #256854; }
[data-chat-theme=violet] { --chat-theme-sample: #ece5f8; --chat-theme-accent: #6842a3; }
[data-chat-theme=graphite] { --chat-theme-sample: #e3e8ec; --chat-theme-accent: #3a4d60; }
:root .chat-dialog[data-chat-theme]:not([data-chat-theme=classic]) .chat-row.own .chat-bubble,
:root .chat-dialog[data-chat-theme]:not([data-chat-theme=classic]) .chat-view-nav button[aria-pressed=true],
.chat-dialog[data-chat-theme]:not([data-chat-theme=classic]) :is(#chatSend, #chatDirectSend) {
  border-color: var(--chat-theme-accent);
  background: var(--chat-theme-accent);
  color: #fff;
}
.chat-wallpaper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
#chatActionBody .chat-wallpaper-option {
  display: grid;
  gap: 4px;
  padding: 4px 4px 6px;
  border: 1px solid var(--group-line);
  border-radius: 10px;
  background: var(--group-surface);
  color: inherit;
  font-size: 12px;
}
#chatActionBody .chat-wallpaper-option[aria-pressed=true] {
  border-color: var(--group-accent);
  box-shadow: inset 0 0 0 1px var(--group-accent);
}
.chat-wallpaper-swatch {
  display: block;
  min-height: 45px;
  aspect-ratio: 1.8;
  border-radius: 6px;
  background: var(--chat-wallpaper-paint, linear-gradient(135deg, #1c3048, #121e30));
}
[data-chat-wallpaper] { --chat-wallpaper-paint: var(--wallpaper-dark); }
:root[data-theme=light] [data-chat-wallpaper] { --chat-wallpaper-paint: var(--wallpaper-light); }
:root[data-theme=light] .chat-wallpaper-swatch { background: var(--chat-wallpaper-paint, linear-gradient(135deg, #f5f9ff, #eaf1fa)); }
#chatMessages[data-chat-wallpaper]:not([data-chat-wallpaper=default]),
#chatDirectThread[data-chat-wallpaper]:not([data-chat-wallpaper=default]) { background: var(--chat-wallpaper-paint); }
[data-chat-wallpaper=mist] {
  --wallpaper-light: radial-gradient(ellipse at 15% 18%, #fff9, transparent 46%), radial-gradient(ellipse at 76% 70%, #bfd4e8, transparent 60%), #dcebf5;
  --wallpaper-dark: radial-gradient(ellipse at 15% 18%, #51678970, transparent 46%), radial-gradient(ellipse at 76% 70%, #2a4f69, transparent 60%), #192a3e;
}
[data-chat-wallpaper=mint] {
  --wallpaper-light: radial-gradient(ellipse at 80% 10%, #f4fff4, transparent 60%), linear-gradient(154deg, #c9eddd, #dbeee7);
  --wallpaper-dark: radial-gradient(ellipse at 80% 10%, #306957, transparent 60%), linear-gradient(154deg, #143c37, #1c3438);
}
[data-chat-wallpaper=sunset] {
  --wallpaper-light: linear-gradient(145deg, #f5d5c9, #eddaea 55%, #d9e2f6);
  --wallpaper-dark: linear-gradient(145deg, #563930, #402f4c 55%, #243450);
}
[data-chat-wallpaper=dune] {
  --wallpaper-light: repeating-linear-gradient(165deg, #fff0 0 54px, #bf8b5520 56px 57px, #fff0 59px 77px), linear-gradient(145deg, #f9efdc, #f1ddc1);
  --wallpaper-dark: repeating-linear-gradient(165deg, #fff0 0 54px, #e0ad7725 56px 57px, #fff0 59px 77px), linear-gradient(145deg, #493d2d, #352b25);
}
[data-chat-wallpaper=waves] {
  --wallpaper-light: repeating-radial-gradient(ellipse at 110% 118%, #fff0 0 24px, #4b97bd30 25px 26px, #fff0 27px 42px), #d7ecf4;
  --wallpaper-dark: repeating-radial-gradient(ellipse at 110% 118%, #fff0 0 24px, #79c3e32b 25px 26px, #fff0 27px 42px), #19384b;
}
[data-chat-wallpaper=stars] {
  --wallpaper-light: radial-gradient(circle, #687ab371 1px, transparent 1.5px) 0 0 / 21px 18px, radial-gradient(circle, #fff 1px, transparent 1.6px) 9px 6px / 21px 18px, #dce2f5;
  --wallpaper-dark: radial-gradient(circle, #a0b8f396 1px, transparent 1.5px) 0 0 / 21px 18px, radial-gradient(circle, #dee7ff63 1px, transparent 1.6px) 9px 6px / 21px 18px, #222f50;
}
[data-chat-wallpaper=linen] {
  --wallpaper-light: repeating-linear-gradient(0deg, #7e745a18 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, #7e745a13 0 1px, transparent 1px 5px), #f5f1e6;
  --wallpaper-dark: repeating-linear-gradient(0deg, #c5bda315 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, #c5bda312 0 1px, transparent 1px 5px), #363631;
}
[data-chat-wallpaper=grid] {
  --wallpaper-light: linear-gradient(#777fac27 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, #777fac27 1px, transparent 1px) 0 0 / 18px 18px, #eaedf7;
  --wallpaper-dark: linear-gradient(#8ba1da24 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, #8ba1da24 1px, transparent 1px) 0 0 / 18px 18px, #283245;
}
[data-chat-wallpaper=hills] {
  --wallpaper-light: radial-gradient(ellipse at 0 115%, #8eb7ac 0 53%, transparent 54%), radial-gradient(ellipse at 100% 122%, #a9c5ba 0 53%, transparent 54%), #e2ede7;
  --wallpaper-dark: radial-gradient(ellipse at 0 115%, #31534f 0 53%, transparent 54%), radial-gradient(ellipse at 100% 122%, #354d49 0 53%, transparent 54%), #223837;
}
[data-chat-wallpaper=petals] {
  --wallpaper-light: radial-gradient(ellipse, #da9fba46 0 25%, transparent 29%) 2px 8px / 28px 32px, radial-gradient(ellipse, #f9f3f7d0 0 26%, transparent 30%) 15px 24px / 28px 32px, #f3e0e9;
  --wallpaper-dark: radial-gradient(ellipse, #c481a24a 0 25%, transparent 29%) 2px 8px / 28px 32px, radial-gradient(ellipse, #d7adc62c 0 26%, transparent 30%) 15px 24px / 28px 32px, #412d40;
}
[data-chat-wallpaper=photo] {
  --wallpaper-light: linear-gradient(#f8fbff55, #f8fbff55), var(--chat-wallpaper-photo) center / cover no-repeat;
  --wallpaper-dark: linear-gradient(#101a3050, #101a3050), var(--chat-wallpaper-photo) center / cover no-repeat;
}
.chat-forwarded {
  margin: 0 0 4px;
  color: inherit;
  opacity: .78;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.chat-forward-hide {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--group-line);
  background: var(--group-surface);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.chat-forward-hide input { width: 17px; height: 17px; margin: 0; accent-color: var(--group-primary); }
.chat-forward-destinations { max-height: min(290px, 40dvh); overflow-y: auto; }
.chat-forward-destinations .chat-social-note { margin: 10px 11px; }
#chatActionBody .chat-forward-target[aria-pressed=true] {
  background: #6288de29;
  box-shadow: inset 2px 0 var(--group-accent);
}
.chat-forward-target[aria-pressed=true]::after {
  content: '✓';
  color: var(--group-accent);
  margin-inline-start: auto;
}
.alert-sound-settings { align-items: end; }
.alert-tone-fields { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.alert-tone-fields button { min-height: 36px; }
.alert-history-controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.alert-history-controls button { padding: 7px 10px; font-size: 12px; border-radius: 8px; }

#settingsDialog .dialog-head { flex-shrink: 0; }
#closeSettings {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  font-size: 20px;
}
#closeSettings:hover { background: #8194ad29; }

.network-latency {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #98a9bf;
}
.network-latency::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.network-latency[data-state=ready] { color: #65dfb4; }
.network-latency[data-state=slow] { color: #f3c674; }
.network-latency[data-state=high] { color: #ff9fae; }
#chatStatus[data-state=slow] { color: #e6af60; }
.network-latency:is([data-state=offline], [data-state=retry]),
#chatStatus:is([data-state=offline], [data-state=retry]) { color: #ff929a; }
:root[data-theme=light] .network-latency { color: #516b87; }
:root[data-theme=light] .network-latency[data-state=ready] { color: #087556; }
:root[data-theme=light] .network-latency[data-state=slow] { color: #a46716; }
:root[data-theme=light] .network-latency[data-state=high] { color: #b32d46; }
:root[data-theme=light] #chatStatus[data-state=slow] { color: #8c5413; }
:root[data-theme=light] :is(.network-latency, #chatStatus):is([data-state=offline], [data-state=retry]) { color: #b42340; }

.chart-top-actions { display: flex; flex: none; align-items: center; gap: 10px; }
.chart-back-edge { display: none; }
@media (any-pointer: coarse) {
  @media (max-width: 700px), (orientation: landscape) and (max-height: 600px) {
    .chart-dialog { overscroll-behavior-x: none; box-shadow: none; }
    .chart-dialog::backdrop { background: transparent; backdrop-filter: none; }
    .chart-dialog .chart-shell { position: relative; }
    .chart-back-edge {
      display: block;
      position: absolute;
      inset: 0 auto 0 0;
      width: max(22px, env(safe-area-inset-left));
      z-index: 7;
      touch-action: pan-y;
    }
  }
}

@media (max-width: 700px) {
  #app > header { grid-template-areas: "eyebrow eyebrow eyebrow eyebrow" "title source latency latency" "social social social theme"; }
  .network-latency { grid-area: latency; justify-self: end; font-size: 10px; }
}

.chat-swipe-viewport { position: relative; }
.chat-history-jumps {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.chat-swipe-viewport:has(.chat-content > #chatPublicPinnedBar:not([hidden])) .chat-history-jumps { top: 58px; }
.chat-swipe-viewport:has(.chat-direct-head:not([hidden])) .chat-history-jumps { top: 55px; }
.chat-swipe-viewport:has(.chat-direct-head:not([hidden])):has(#chatPinnedBar:not([hidden])) .chat-history-jumps { top: 105px; }
.chat-history-jumps button {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--border, #43607e);
  border-radius: 999px;
  background: #263957;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  pointer-events: auto;
}
:root[data-theme=light] .chat-history-jumps button {
  background: #f2f7ff;
  color: #244571;
  border-color: #aec5e6;
}
.chat-edited { font-size: 11px; opacity: .85; white-space: nowrap; }
.chat-search-form, .chat-feature-results { display: grid; gap: 10px; min-width: 0; }
.chat-search-form label { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.chat-search-form :is(input, select, textarea) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  font-size: 16px;
}
.chat-search-form textarea { resize: vertical; }
.chat-feature-results { gap: 0; }
.chat-feature-feedback:empty, .chat-feature-results:empty { display: none; }
.chat-feature-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  width: 100%;
  padding: 11px 4px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-bottom-color: color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.chat-feature-result > span { display: grid; gap: 4px; }
.chat-feature-result :is(strong, span) { min-width: 0; overflow-wrap: anywhere; }
.chat-feature-result > span > span { font-weight: 500; }
.chat-feature-result time { opacity: .75; font-size: 11px; font-weight: 500; white-space: nowrap; }

#chatMemberAvatarOpen { padding: 0; color: #fff; }
#chatMemberAvatarOpen:disabled { cursor: default; opacity: 1; }
.chat-image-dialog.avatar-preview {
  padding: max(60px, env(safe-area-inset-top)) 18px max(75px, env(safe-area-inset-bottom));
}
.chat-image-dialog.avatar-preview img { width: min(100%, 420px); border-radius: 12px; }
.chat-image-dialog.avatar-preview #chatImageClose {
  top: max(12px, env(safe-area-inset-top));
  right: max(15px, env(safe-area-inset-right));
}
#chatImageSave {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  color: #fff;
  background: #315fab;
  font-weight: 650;
  text-decoration: none;
}

@media (max-width: 350px) {
  .chat-view-nav { gap: 3px; grid-template-columns: repeat(5, minmax(0, 1fr)) 33px; }
  .chat-view-nav button { padding-inline: 3px; }
}
.chat-direct-inbox, .chat-social-list { overscroll-behavior-y: contain; touch-action: pan-y; }
.chat-channel-subscribe { min-height: 36px; padding: 6px 11px; white-space: nowrap; background: #335eac; color: #fff; }
.chat-channel-form { display: grid; gap: 10px; min-width: 0; }
.chat-channel-form .chat-group-field { margin: 0; }
.chat-invite-approval {
  display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px;
}
.chat-invite-approval input { width: 18px; height: 18px; }
.chat-invite-request {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 6px 8px; overflow-wrap: anywhere;
}
.chat-invite-request > div { display: flex; gap: 6px; }
.chat-invite-request + .chat-invite-request { border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.chat-channel-view-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chat-channel-stat-period { display: flex; gap: 8px; }
#chatActionBody .chat-channel-stat-period [aria-pressed=true] { background: #3b65b9; color: #fff; }
.chat-channel-stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; }
.chat-channel-stat-grid > div {
  padding: 10px; border-radius: 9px; border: 1px solid color-mix(in srgb,currentColor 20%,transparent);
}
.chat-channel-stat-grid dt { font-size: 12px; opacity: .76; }
.chat-channel-stat-grid dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chat-slow-mode { margin: 0; padding: 5px 12px; font-size: 12px; opacity: .78; }
.chat-scheduled-card { display: grid; gap: 5px; padding: 10px; }
.chat-scheduled-card + .chat-scheduled-card { border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.chat-scheduled-card p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-scheduled-card small { opacity: .78; }
.chat-scheduled-card > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.chat-directory-bar { padding: 8px 12px 2px; }
#chatDirectoryOpen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #a3b8d125;
  border-radius: 20px;
  background: #233349;
  color: #b3c3d9;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}
:root[data-theme=light] #chatDirectoryOpen { background: #eef3f9; color: #536b88; border-color: #dce5f0; }
#chatDirectoryOpen svg, .chat-search-screen svg, #chatActionBody .chat-profile-search svg {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-dialog:has(#chatSearchScreen:not([hidden])) { touch-action: pan-x pan-y; }
.chat-search-screen {
  --search-surface: #101b2b;
  --search-text: #edf4ff;
  --search-muted: #9fb1ca;
  --search-field: #202f44;
  --search-line: #263951;
  --search-accent: #a9c9ff;
  --search-selected: #253e62;
  --search-hit: #294b77;
  position: absolute;
  inset: 0 0 var(--search-covered, 0px);
  z-index: 18;
  display: flex;
  flex-flow: column nowrap;
  min-height: 0;
  background: var(--search-surface);
  color: var(--search-text);
  touch-action: pan-x pan-y;
}
:root[data-theme=light] .chat-search-screen {
  --search-surface: #fdfefe;
  --search-text: #172942;
  --search-muted: #576e88;
  --search-field: #edf2f8;
  --search-line: #e0e9f3;
  --search-accent: #23579b;
  --search-selected: #e5effc;
  --search-hit: #dceaff;
}
@keyframes search-panel-enter {
  from { opacity: .4; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.chat-search-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(11px, env(safe-area-inset-top)) 13px 9px;
}
.chat-search-toolbar form {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  flex-flow: row nowrap;
  align-items: center;
  padding-inline-start: 11px;
  border: 1px solid transparent;
  border-radius: 21px;
  background: var(--search-field);
  color: var(--search-muted);
}
.chat-search-toolbar form:focus-within { border-color: color-mix(in srgb,var(--search-accent) 32%,transparent); }
#chatSearchInput {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 5px 8px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--search-text);
  font-size: 16px;
}
#chatSearchInput::placeholder { color: var(--search-muted); opacity: 1; }
#chatSearchInput::-webkit-search-cancel-button { -webkit-appearance: none; }
.chat-search-toolbar button {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 40px;
  padding: 0;
  color: var(--search-muted);
  background: transparent;
}
.chat-search-toolbar .chat-search-back { width: 42px; min-height: 42px; border-radius: 50%; background: var(--search-field); }
.chat-search-screen[data-mode=directory] .chat-search-back { order: 1; }
.chat-search-screen[data-mode=directory] .chat-search-arrow,
.chat-search-screen[data-mode=messages] .chat-search-close { display: none; }
.chat-search-filters-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 13px 10px;
  border-bottom: 1px solid var(--search-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-search-filters-bar button {
  flex: none;
  padding: 6px 8px;
  min-height: 34px;
  border-radius: 8px;
  background: transparent;
  color: var(--search-muted);
  font-size: 13px;
}
.chat-search-filters-bar button[aria-pressed=true] {
  background: var(--search-selected);
  color: var(--search-accent);
  font-weight: 700;
}
.chat-search-scope {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 2px 15px 9px;
  border-bottom: 1px solid var(--search-line);
  font-size: 13px;
}
.chat-search-scope strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-search-scope .chat-avatar-box { width: 26px; height: 26px; font-size: 12px; }
.chat-search-results {
  flex: 1;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  padding: 5px 12px max(12px, env(safe-area-inset-bottom));
}
@media (prefers-reduced-motion: no-preference) {
  .chat-search-results { animation: search-panel-enter 140ms ease-out; }
}
#chatSearchStatus { margin: 20px 6px; color: var(--search-muted); font-size: 13px; text-align: center; }
.chat-search-results h3 { margin: 12px 5px 3px; color: var(--search-muted); font-size: 12px; font-weight: 650; }
.chat-search-contact-rail {
  display: flex;
  gap: 6px;
  margin-inline: -12px;
  padding: 4px 12px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.chat-search-contact {
  flex: 0 0 62px;
  display: grid;
  justify-items: center;
  min-width: 0;
  gap: 7px;
  padding: 5px 4px;
  border-radius: 10px;
  background: transparent;
  color: var(--search-text);
  font-size: 12px;
  font-weight: 550;
}
.chat-search-contact:hover, .chat-search-contact:focus-visible { background: var(--search-field); }
.chat-search-contact .chat-avatar-box { width: 48px; height: 48px; font-size: 17px; }
.chat-search-contact > span:last-child { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-search-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid var(--search-line);
}
.chat-search-history-head h3 { margin-block: 0; }
.chat-search-history-head button {
  min-height: 42px;
  padding: 0 9px;
  background: transparent;
  color: var(--search-accent);
  font-size: 13px;
}
#chatSearchHistory > p { margin: 17px 5px; color: var(--search-muted); font-size: 13px; }
.chat-search-results .chat-search-result {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 57px;
  padding: 8px 5px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: start;
}
.chat-search-results .chat-search-result + .chat-search-result::before {
  content: '';
  position: absolute;
  inset: 0 5px auto 53px;
  border-top: 1px solid var(--search-line);
}
.chat-search-results .chat-search-result:focus-visible { outline-offset: -2px; }
.chat-search-results .chat-search-result:is(:hover, :focus-visible) { background: var(--search-field); }
.chat-search-result .chat-avatar-box { width: 38px; height: 38px; }
.chat-search-result .chat-peer-text :is(strong, small) { display: block; }
.chat-search-result .chat-peer-text small { margin-top: 3px; color: var(--search-muted); font-weight: 400; }
#chatSearchRows .chat-search-message { grid-template-columns: 38px minmax(0,1fr) auto; }
.chat-search-message > span:nth-child(2) > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--search-muted);
  font-size: 13px;
}
.chat-search-message time { align-self: start; padding-top: 3px; color: var(--search-muted); }
.chat-search-result mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--search-hit);
  color: var(--search-accent);
}
#chatSearchMore {
  display: block;
  margin: 10px auto 3px;
  background: var(--search-selected);
  color: var(--search-accent);
  min-height: 38px;
  font-size: 13px;
}
.chat-channel-footer {
  padding: 7px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}
.chat-channel-footer button { width: 100%; min-height: 43px; font-size: 14px; }
.chat-channel-footer button { background: #223b62; color: #dceaff; }
:root[data-theme=light] .chat-channel-footer button { background: #eaf2ff; color: #22477d; }
#chatActionBody .chat-profile-search { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; }
.chat-saved-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.chat-saved-row > button:last-child { padding-inline: 9px; }
.chat-channel-avatar svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.chat-group-danger { color: #e66c7f; }
:root[data-theme=light] .chat-group-danger { color: #aa3048; }

.market-source-picker, .radio-choice-menu {
  --market-menu-bg: #172438;
  --market-menu-border: #34465f;
  --market-menu-text: #e3edf9;
  --market-menu-active: #264364;
  --market-menu-accent: #a8d0ff;
}
:root[data-theme=light] :is(.market-source-picker, .radio-choice-menu) {
  --market-menu-bg: #fff;
  --market-menu-border: #d5e1ef;
  --market-menu-text: #253951;
  --market-menu-active: #eaf2ff;
  --market-menu-accent: #234f99;
}
.market-source-picker {
  position: relative;
  justify-self: start;
  -webkit-tap-highlight-color: transparent;
}
.market-source.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1.15;
  cursor: pointer;
}
.market-source.status::after {
  content: '';
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.market-source.status[aria-expanded=true]::after { transform: translateY(2px) rotate(225deg); }
.market-source.status:focus-visible { outline: 2px solid #5d8fff; outline-offset: 2px; }
.market-source.status:disabled { cursor: default; }
.market-source-menu {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 7px) 0 auto auto;
  width: 146px;
  padding: 5px;
  border: 1px solid var(--market-menu-border);
  border-radius: 13px;
  background: var(--market-menu-bg);
  box-shadow: 0 10px 26px #0b1c3629;
}
.market-source-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 6px 11px;
  border-radius: 8px;
  background: transparent;
  color: var(--market-menu-text);
  text-align: start;
  font-size: 13px;
  font-weight: 650;
}
.market-source-menu button:hover,
.market-source-menu button[aria-checked=true] { background: var(--market-menu-active); color: var(--market-menu-accent); }
.market-source-menu button:focus-visible { outline: 2px solid var(--market-menu-accent); outline-offset: -2px; }
.market-source-menu button[aria-checked=true]::after {
  content: '';
  width: 6px;
  height: 10px;
  margin-right: 2px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
@media (max-width:700px) {
  header .market-source.status { min-height: 34px; gap: 6px; padding: 6px 8px; font-size: 11px; }
}

.radio-choice-field {
  display: grid;
  align-content: end;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  color: #9aaac0;
}
.controls .radio-choice-field { flex: 1; }
:root[data-theme=light] .radio-choice-field { color: #536b88; }
.radio-choice-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #34455c;
  border-radius: 9px;
  background: #182437;
  color: #e8f0fa;
  text-align: start;
  font: inherit;
  font-weight: 650;
  -webkit-tap-highlight-color: transparent;
}
:root[data-theme=light] .radio-choice-trigger { border-color: #cedbea; background: #f5f8fc; color: #243951; }
.radio-choice-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-choice-trigger::after {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.radio-choice-trigger[aria-expanded=true] { border-color: #7194e2; }
.radio-choice-trigger[aria-expanded=true]::after { transform: translateY(2px) rotate(225deg); }
.radio-choice-trigger:focus-visible { outline: 2px solid #5d8fff; outline-offset: 2px; }
.radio-choice-trigger:disabled { opacity: .65; cursor: default; }
.header-theme-control .radio-choice-trigger {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.radio-choice-menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-tap-highlight-color: transparent;
}

:root { --price-arrow-up: #62edb6; --price-arrow-down: #ff8394; }
:root[data-theme=light] { --price-arrow-up: #087454; --price-arrow-down: #bd2340; }
#btcPrice::after, #ethPrice::after, #chartLivePrice strong::after, #chartQuoteButton::after {
  content: var(--live-price-arrow, '');
  display: inline-block;
  width: .85em;
  margin-inline-start: .22em;
  font-size: .72em;
  line-height: 1;
  text-align: center;
  vertical-align: .09em;
}
:is(#btcPrice, #ethPrice)[data-price-direction=up],
#chartDialog[data-price-direction=up] :is(#chartLivePrice strong, #chartQuoteButton[data-live-price=true]) {
  --live-price-arrow: '↑';
  color: var(--price-arrow-up);
}
:is(#btcPrice, #ethPrice)[data-price-direction=down],
#chartDialog[data-price-direction=down] :is(#chartLivePrice strong, #chartQuoteButton[data-live-price=true]) {
  --live-price-arrow: '↓';
  color: var(--price-arrow-down);
}

.header-brand-row {
  display: flex; align-items: center; gap: 10px; margin-top: 4px;
}
.header-brand-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.android-version {
  display: inline-flex; align-items: center; gap: 4px; min-height: 25px; padding: 2px 7px;
  border: 1px solid #57729755; border-radius: 999px; background: #5772971a;
  color: #bbcee6; font-size: 10px; line-height: 1.2; white-space: nowrap;
}
.android-version:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
:root[data-theme=light] .android-version { color: #40577a; background: #e4ecf6; }
.android-update-dot { width: 6px; height: 6px; border-radius: 50%; background: #ed5364; }
.header-brand-row h1 { margin: 0; white-space: nowrap; }
.home-download {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 9px;
  border: 1px solid #82dbce45; border-radius: 999px; background: #82dbce12; color: #82dbce;
  text-decoration: none; white-space: nowrap; font-size: 12px; font-weight: 650;
}
.home-download:hover { background: #82dbce28; }
.home-download:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
:root[data-theme=light] .home-download { color: #136c61; border-color: #c9e5df; background: #e6f4f0; }
:root[data-theme=light] .home-download:hover { background: #d7eee7; }
@media(max-width:700px) {
  .header-brand-row { gap: 7px; margin: 0; }
  .home-download { min-height: 29px; padding-inline: 7px; font-size: 11px; }
}
