
        /* Saudi font (Ministry of Culture), self-hosted */
        @font-face { font-family: 'Saudi'; src: url('../vendor/fonts/saudi/Saudi-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
        @font-face { font-family: 'Saudi'; src: url('../vendor/fonts/saudi/Saudi-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
        @font-face { font-family: 'Saudi'; src: url('../vendor/fonts/saudi/Saudi-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
        @font-face { font-family: 'Saudi'; src: url('../vendor/fonts/saudi/Saudi-Bold.ttf') format('truetype'); font-weight: 700 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
        .brand-title { display: flex; align-items: center; justify-content: center; gap: 10px; }
        /* long channel names never push the header buttons off small screens */
        .main-header { min-width: 0; }
        #chat-title-heading { min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        #chat-topic-display { min-width: 0; flex-shrink: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        #chat-search-input { min-width: 0; flex-shrink: 1; }
        @media (max-width: 900px) { #footer-credits { display: none; } }
        /* bots */
        .bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
        .bot-card { position: relative; display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: transform .12s, box-shadow .12s, border-color .12s; }
        .bot-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.35); border-color: var(--border-focus); }
        .bot-card.open { border-color: var(--accent); }
        .bot-card.soon { opacity: .62; }
        .bot-banner { height: 64px; flex: none; background: linear-gradient(120deg, var(--bc1), var(--bc2)); }
        .bot-body { flex: 1; display: flex; flex-direction: column; padding: 0 16px 16px; min-width: 0; }
        .bot-avwrap { display: flex; align-items: flex-end; justify-content: space-between; margin-top: -30px; margin-bottom: 8px; }
        .bs-av { flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; line-height: 1; }
        .bot-avwrap .bs-av { border: 5px solid var(--bg-1); box-sizing: content-box; }
        .bot-added { font-size: 11px; font-weight: 700; color: var(--green); background: rgba(35,165,90,.12); border-radius: 4px; padding: 2px 8px; margin-bottom: 4px; }
        .bot-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin: 2px 0 6px; }
        .bot-card .bot-about { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 10px; font-size: 13px; line-height: 1.4; }
        .bot-card .feat-row { margin: 0 0 12px; }
        .bot-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
        .bot-foot small { color: var(--muted); font-size: 11.5px; line-height: 1.3; min-width: 0; }
        .bot-foot .btn { flex: none; }
        .bs-tag { display: inline-flex; align-items: center; gap: 2px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; padding: 0 5px 0 3px; border-radius: 4px; vertical-align: middle; text-transform: uppercase; }
        .bs-tag .ic { width: 11px; height: 11px; }
        .bs-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 6px; }
        .bs-h span { background: var(--bg-3); color: var(--text); border-radius: 8px; padding: 0 6px; font-size: 11px; }
        .bs-list { display: flex; flex-direction: column; gap: 8px; }
        .bs-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; }
        .bs-row.open { border-color: var(--accent); }
        .bs-rmeta { flex: 1; min-width: 0; }
        .bs-name { color: var(--bright); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
        .bs-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .bs-sub span { font-weight: 700; }
        .bs-ractions { display: flex; align-items: center; gap: 8px; flex: none; }
        .bs-x { color: var(--muted); } .bs-x:hover { color: var(--red); }
        .bs-empty { color: var(--muted); font-size: 13px; padding: 16px; border: 1px dashed var(--border); border-radius: 8px; text-align: center; }
        @media (max-width: 560px) { .bs-row { flex-wrap: wrap; } .bs-ractions { width: 100%; justify-content: flex-end; } }
        .bot-pav { color: #fff; border: 0 !important; display: flex; align-items: center; justify-content: center; line-height: 1; }
        .bd-pbody .bp-bio { margin-top: 8px; }
        .bp-banner { height: 96px; position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 0 22px; overflow: hidden; }
        .bp-big { font-size: 68px; opacity: .32; transform: rotate(-10deg); }
        .bp-body { padding: 0 20px 18px; } .bp-name { color: var(--bright); font-size: 20px; font-weight: 800; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
        .bp-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
        .bp-sec { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; margin: 14px 0 4px; }
        .bp-bio { color: var(--text); line-height: 1.5; font-size: 14px; }
        .bp-cmds { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-1); }
        .bp-cmds > div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); padding: 8px 12px !important; border-bottom: 1px solid var(--border); line-height: 1.4; }
        .bp-cmds > div:last-child { border-bottom: 0; }
        .bp-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
        .bp-cmds code { color: var(--accent-hi, var(--accent)); background: var(--bg-3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
        .bp-cmd-d { color: var(--muted); font-size: 12.5px; }
        .bot-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }
        .bot-ic .ic { width: 22px; height: 22px; }
        .bot-meta { flex: 1; min-width: 0; }
        .bot-name { color: var(--bright); font-weight: 700; display: flex; align-items: center; gap: 6px; }
        .bot-about { color: var(--muted); font-size: 12px; margin: 3px 0 8px; line-height: 1.4; }
        .bot-soon { font-size: 11px; color: var(--muted); border: 1px dashed var(--border); border-radius: 4px; padding: 2px 6px; }
        .bot-on { font-size: 12px; color: var(--green); font-weight: 600; }
        .noise-btn .noise-slash { display: none; } .noise-btn.noise-off { color: var(--red, #ef4444); } .noise-btn.noise-off .noise-slash { display: block; }
        .inv-dialog { padding: 0; border: 0; background: transparent; }
        #invite-box { width: 440px; max-width: 94vw; background: var(--panel, #1e1f22); color: var(--text, #fff); border-radius: 10px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
        .inv-splash { height: 140px; background-size: cover; background-position: center; background-color: var(--accent); }
        .inv-screen-body { padding: 18px 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
        .inv-iconwrap { margin-top: -54px; padding: 6px; border-radius: 24px; background: var(--panel, #1e1f22); }
        .inv-ic { border-radius: 16px; object-fit: cover; display: inline-flex; flex: none; }
        .inv-ini { background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; }
        .inv-who { font-size: 13px; opacity: .75; } .inv-by { font-weight: 700; opacity: 1; }
        .inv-name { margin: 0; font-size: 24px; display: inline-flex; align-items: center; gap: 8px; }
        .inv-stats { display: inline-flex; gap: 14px; font-size: 13px; opacity: .8; flex-wrap: wrap; justify-content: center; }
        .inv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #80848e; margin-inline-end: 5px; } .inv-dot.on { background: #23a55a; }
        .inv-big { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; }
        .inv-no { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 8px; } .inv-no:hover { text-decoration: underline; }
        .inv-broken { color: var(--accent); opacity: .85; line-height: 0; margin-top: 6px; } .inv-bad h2 { margin: 0; } .inv-bad p { margin: 0; opacity: .75; }
        .inv-card { max-width: 440px; margin-top: 6px; padding: 12px 14px; border-radius: 8px; background: var(--panel2, rgba(127,127,127,.12)); border: 1px solid var(--border, rgba(127,127,127,.25)); }
        .inv-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; opacity: .75; margin-bottom: 10px; }
        .inv-body { display: flex; align-items: center; gap: 12px; } .inv-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
        .inv-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .inv-meta .inv-stats { justify-content: flex-start; }
        .inv-join.joined { opacity: .7; }
        .inv-card.bad .inv-head { color: #f23f42; }
        .inv-voice { display: flex; flex-direction: column; gap: 10px; }
        .inv-vh { display: flex; align-items: center; gap: 8px; } .inv-vh b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .inv-vic { display: inline-flex; color: #23a55a; } .inv-vt { font-variant-numeric: tabular-nums; font-size: 13px; color: #23a55a; font-weight: 600; }
        .inv-pl { max-height: 128px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-inline-end: 4px; }
        .inv-p { display: flex; align-items: center; gap: 8px; min-width: 0; } .inv-p .stag { flex: none; } .inv-p .vs-live { margin-inline-start: auto; flex: none; }
        .inv-pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
        .inv-empty { font-size: 13px; opacity: .65; padding: 4px 0; }
        .inv-vjoin { width: 100%; padding: 10px; font-weight: 600; } .inv-vjoin.joined { opacity: .7; }
        .inv-note { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .7; margin-top: -2px; }
        .nl-top { display: flex; justify-content: space-between; align-items: center; } .nl-top h2 { margin: 0; }
        .nl-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
        .nl-actions { display: flex; gap: 12px; align-items: center; }
        .nl-result { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; } .nl-gain { color: #23a55a; font-weight: 700; }
        .nl-players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .nl-players audio { width: 100%; }
        @media (max-width: 520px) { .nl-meters, .nl-players { grid-template-columns: 1fr; } }
        .cc-box { width: 420px; max-width: 94vw; position: relative; padding: 22px 24px 20px !important; }
        .cc-title { margin: 0 0 10px; font-size: 20px; color: var(--bright); padding-inline-end: 32px; }
        .cc-text { font-size: 14px; line-height: 1.45; opacity: .85; margin-bottom: 22px; }
        .cc-text b { color: var(--bright); }
        .cc-x { position: absolute; top: 16px; inset-inline-end: 16px; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 4px; } .cc-x:hover { opacity: 1; } .cc-x svg { width: 20px; height: 20px; }
        .cc-actions { display: flex; gap: 12px; } .cc-actions .btn { flex: 1; padding: 11px 14px; font-size: 14px; font-weight: 600; border-radius: 6px; }
        .cc-ok.btn-danger { background: #da373c; border-color: #da373c; color: #fff; } .cc-ok.btn-danger:hover { background: #a12828; }
        .cm-dialog { padding: 0; border: 0; background: transparent; }
        .cm-dialog [data-cm-box] { position: relative; background: var(--panel, #1e1f22); color: var(--text); border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.6); overflow: hidden; max-width: 94vw; max-height: 92vh; overflow-y: auto; }
        #cm-card-dlg [data-cm-box] { width: 420px; } #cm-guide-dlg [data-cm-box] { width: 560px; } #cm-flow-dlg [data-cm-box] { width: 640px; display: flex; flex-direction: column; } #cm-event-dlg [data-cm-box], #cm-boost-dlg [data-cm-box] { width: 460px; padding: 22px 24px; }
        .bst-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .bst-top h2 { margin: 0; flex: 1; font-size: 20px; } .bst-gem { font-size: 28px; } .bst-lv { padding: 3px 10px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
        .bst-bar { height: 10px; border-radius: 6px; background: rgba(127,127,127,.25); margin: 16px 0 6px; overflow: hidden; } .bst-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ec4899, #8b5cf6); } .bst-sub { font-size: 13px; opacity: .8; } #cm-boost-dlg .cm-foot { padding: 12px 0 0; }
        .cm-card { background: var(--panel2, rgba(127,127,127,.1)); border-radius: 10px; overflow: hidden; }
        .cm-banner { height: auto; aspect-ratio: 2; background-size: cover; background-position: center; background-color: var(--accent); }
        .cm-card-body { padding: 0 18px 16px; } .cm-ic { margin-top: -34px; display: inline-block; padding: 5px; border-radius: 22px; background: var(--panel, #1e1f22); }
        .cm-name { margin: 6px 0 4px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
        .cm-verified { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #23a55a; color: #fff; flex: none; } .cm-verified .ic { width: 12px; height: 12px; stroke-width: 3; }
        .cm-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; opacity: .8; } .cm-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
        .cm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; } .cm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; background: rgba(127,127,127,.18); color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; } .cm-chip:hover { background: var(--accent); color: #fff; } .cm-chip .ic { width: 14px; height: 14px; }
        .cm-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 18px; }
        .cm-dialog .cc-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; background: rgba(0,0,0,.45); color: #fff; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; opacity: 1; }
        .cm-guide-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel, #1e1f22); z-index: 3; } .cm-guide-h h2 { margin: 0; font-size: 18px; flex: 1; } .cm-guide-h .cc-x { position: static; background: none; color: inherit; }
        .cm-guide-body { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 16px; }
        .cm-welcome p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; opacity: .85; white-space: pre-wrap; }
        .cm-sec { display: flex; flex-direction: column; gap: 6px; } .cm-sec-h { display: flex; justify-content: space-between; font-size: 13px; opacity: .85; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
        .cm-todo, .cm-res { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2, rgba(127,127,127,.08)); color: inherit; text-decoration: none; cursor: pointer; font: inherit; text-align: start; } .cm-todo:hover, .cm-res:hover { border-color: var(--accent); }
        .cm-res span { flex: 1; } .cm-res .ic { width: 18px; height: 18px; opacity: .75; }
        .cm-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(127,127,127,.6); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex: none; } .cm-tick .ic { width: 13px; height: 13px; stroke-width: 3; }
        .cm-todo.done .cm-tick { background: #23a55a; border-color: #23a55a; color: #fff; } .cm-todo.done .cm-todo-t { opacity: .6; text-decoration: line-through; } .cm-todo-t { flex: 1; font-weight: 600; } .cm-todo-c { opacity: .6; font-size: 12px; }
        .cm-flow-top { display: flex; justify-content: space-between; padding: 14px 22px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; border-bottom: 1px solid var(--border); }
        .cm-flow-body { padding: 22px 26px; overflow-y: auto; flex: 1; min-height: 240px; } .cm-flow-body h2 { margin: 0 0 6px; font-size: 22px; } .cm-sub { margin: 0 0 18px; opacity: .75; font-size: 14px; }
        .cm-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; } .cm-rule { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: var(--panel2, rgba(127,127,127,.1)); font-size: 14px; line-height: 1.4; } .cm-rule-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
        .cm-agree { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; } .cm-agree input { width: 18px; height: 18px; }
        .cm-q { margin-bottom: 18px; } .cm-q-t { font-weight: 700; margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; } .cm-q-t small { font-weight: 400; opacity: .6; } .cm-q-t i { color: #f23f42; font-style: normal; }
        .cm-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
        .cm-opt { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--panel2, rgba(127,127,127,.08)); color: inherit; cursor: pointer; font: inherit; text-align: start; position: relative; } .cm-opt:hover { border-color: rgba(127,127,127,.6); } .cm-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
        .cm-opt-e { font-size: 24px; } .cm-opt-l { display: flex; flex-direction: column; min-width: 0; flex: 1; } .cm-opt-l small { opacity: .65; font-size: 12px; }
        .cm-opt-ck { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: transparent; border: 2px solid rgba(127,127,127,.5); flex: none; } .cm-opt-ck .ic { width: 12px; height: 12px; stroke-width: 3; } .cm-opt.on .cm-opt-ck { background: var(--accent); border-color: var(--accent); color: #fff; }
        .cm-flow-foot { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); align-items: center; } .cm-sp { flex: 1; }
        .ev-row { list-style: none; display: flex; align-items: center; gap: 10px; margin: 6px 8px; padding: 9px 10px; border-radius: 8px; background: var(--panel2, rgba(127,127,127,.1)); cursor: pointer; border: 1px solid var(--border); } .ev-row:hover { border-color: var(--accent); } .ev-row.live { border-color: #23a55a; }
        .ev-ic { display: inline-flex; color: var(--accent); } .ev-row.live .ev-ic { color: #23a55a; } .ev-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; } .ev-txt small { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ev-more { font-size: 11px; opacity: .6; }
        .guide-row .ch-ic { color: var(--accent); }
        .cm-ev-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: rgba(127,127,127,.2); } .cm-ev-tag.live { background: #23a55a; color: #fff; } .cm-ev-tag i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
        .ev-cover { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 10px; margin: 0 0 10px; background: var(--bg-0); } .cm-ev-cover { margin-top: 26px; } .ew-cover { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } .ew-cover img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 10px; } .ew-cover .mc-btn { cursor: pointer; }
        .cm-ev-title { margin: 12px 0; font-size: 22px; } .cm-ev-line { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 8px 0; } .cm-ev-line .ic { width: 18px; height: 18px; opacity: .7; flex: none; } .cm-ev-desc { font-size: 14px; line-height: 1.45; white-space: pre-wrap; opacity: .9; } #cm-event-dlg .cm-foot { padding: 12px 0 0; }
        .cm-checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; opacity: .85; } .cm-checks li { display: flex; gap: 8px; align-items: center; margin: 3px 0; opacity: .6; } .cm-checks li.ok { opacity: 1; color: #23a55a; } .cm-checks .ic { width: 14px; height: 14px; }
        .cme-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; } .cme-row .w1 { flex: 1 1 130px; min-width: 0; } .cme-row .w2 { flex: 2 1 200px; min-width: 0; } .cme-row .we { flex: 0 0 64px; text-align: center; }
        .cme-q { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; }
        .cme-save { position: sticky; bottom: 12px; display: none; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 14px; border-radius: 8px; background: #111214; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.5); } .cme-save.show { display: flex; }
        @media (max-width: 560px) { .cm-opts { grid-template-columns: 1fr; } .cm-flow-body { padding: 16px; } }
        #voice-studio { padding: 0; border: 0; background: transparent; } #voice-studio-box { width: 760px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
        .vs-bar { display: flex; gap: 10px; margin: 6px 0; } .vs-bar .system-input { flex: 1; }
        .vs-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
        .vs-amt { display: flex; align-items: center; gap: 10px; } .vs-amt input[type=range] { width: 150px; accent-color: var(--accent, #8b5cf6); } .vs-amt b { min-width: 38px; color: var(--bright); font-variant-numeric: tabular-nums; }
        .vs-fast { display: flex; align-items: center; gap: 6px; cursor: pointer; }
        .vs-cw { position: relative; } .vs-cw .vs-card { width: 100%; }
        .vs-star { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
        .vs-star:hover, .vs-star:focus-visible { background: rgba(127,127,127,.2); color: var(--bright); } .vs-star.on { color: #f0b232; }
        [dir="rtl"] .vs-star { right: auto; left: 4px; }
        .vs-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .vs-tab { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border); background: none; color: inherit; cursor: pointer; font: inherit; font-size: 13px; } .vs-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
        .vs-scroll { overflow-y: auto; min-height: 200px; flex: 1; padding: 2px; } .vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
        .vs-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--panel2, rgba(127,127,127,.08)); color: inherit; cursor: pointer; font: inherit; text-align: start; position: relative; } .vs-card:hover { border-color: rgba(127,127,127,.6); } .vs-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
        .vs-e { font-size: 28px; } .vs-t { display: flex; flex-direction: column; min-width: 0; } .vs-t small { opacity: .65; font-size: 12px; } .vs-ck { position: absolute; top: 8px; inset-inline-end: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; } .vs-ck .ic { width: 11px; height: 11px; stroke-width: 3; }
        .vs-custom { display: flex; flex-direction: column; gap: 12px; padding: 14px; } .vs-sl { display: grid; grid-template-columns: 170px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; } .vs-sl b { text-align: end; }
        .vs-test { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); } .vs-test audio { flex: 1; min-width: 200px; } .vs-now { font-size: 13px; opacity: .85; }
        @media (max-width: 520px) { .vs-sl { grid-template-columns: 1fr; } }
        .stage-bar { align-items: center; gap: 12px; padding: 8px 14px; background: color-mix(in srgb, var(--accent) 18%, var(--panel, #1e1f22)); border-bottom: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; } .stage-bar .stg-role { font-weight: 700; flex: 1; } .stg-hands { opacity: .85; }
        .vs-ic.stg-spk { color: var(--accent); }
        .bd-box { width: 900px; max-width: 96vw; height: 86vh; padding: 0 !important; display: flex; overflow: hidden; }
        .bd-side { width: 200px; flex: none; padding: 14px 10px; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; background: var(--bg-1); }
        .bd-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; color: var(--bright); } .bd-head b { overflow-wrap: anywhere; font-size: 14px; }
        .bd-tab { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; background: none; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: start; }
        .bd-tab:hover { background: var(--bg-2); color: var(--text); } .bd-tab.on { background: var(--accent-bg); color: var(--accent-hi, var(--accent)); }
        .bd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
        .bd-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); } .bd-top h2 { margin: 0; font-size: 18px; color: var(--bright); }
        .bd-pane { flex: 1; overflow-y: auto; padding: 14px 20px 20px; }
        .bd-save { display: none; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--border-focus); background: var(--bg-1); } .bd-save.show { display: flex; } .bd-save span { font-size: 13px; }
        .bd-prev { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; background: var(--bg-2); } .bd-banner { height: 90px; } .bd-pbody { padding: 0 16px 14px; } .bd-av { margin-top: -38px; width: 72px; border: 5px solid var(--bg-2); border-radius: 50%; box-sizing: content-box; }
        .bd-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--muted); background: transparent; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; } .bd-x:hover { color: var(--bright); border-color: var(--bright); }
        .bd-col { width: 44px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
        @media (max-width: 640px) { .bd-box { flex-direction: column; height: 92vh; } .bd-side { width: auto; flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 8px; } .bd-head { display: none; } .bd-tab span { white-space: nowrap; } }
        .feat-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; } .feat-chip { font: inherit; font-size: 12px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; } .feat-chip.on { color: var(--bright); border-color: var(--accent); } .feat-chip.open { background: var(--accent-bg); color: var(--bright); } .feat-chip:hover { border-color: var(--accent); }
        .msg-avatar.bot-av { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }
        .msg-avatar.bot-av .ic { width: 22px; height: 22px; }
        .gd-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 8px; }
        .gd-num { width: 64px !important; display: inline-block; padding: 4px 6px !important; margin: 0 2px; text-align: center; }
        .gd-cmds div { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
        .gd-cmds div:last-child { border-bottom: 0; }
        .gd-cmds code { color: var(--bright); background: var(--bg-0); padding: 1px 5px; border-radius: 4px; margin-inline-end: 6px; }
        :root[lang="ar"] #svp-bots .sd, :root[lang="ar"] #svp-bots .st, :root[lang="ar"] .bot-about, :root[lang="ar"] .gd-cmds div { unicode-bidi: plaintext; text-align: start; }
        /* the bubble logo has no background of its own: the theme shows through it, and a faint shadow keeps its white rim visible on light themes */
        .brand-logo { width: 40px; height: 40px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .45)); }
        .rail-home .rail-logo { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .45)); pointer-events: none; transition: transform .15s; }
        .rail-home:hover .rail-logo, .rail-home.active .rail-logo { transform: scale(1.06); }
        .rail-home { overflow: visible; }
        .pc-banner .pc-close { z-index: 1; }
        /* easter egg: click the bubble a few times in a row */
        .rail-home.egg .rail-logo { animation: egg-pop .55s cubic-bezier(.3, 1.6, .5, 1); }
        @keyframes egg-pop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.28) rotate(-14deg); } 70% { transform: scale(.92) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
        .egg-bub { position: fixed; z-index: 100002; width: 14px; height: 14px; border-radius: 50%; pointer-events: none; border: 1.5px solid rgba(186,230,253,.9); background: radial-gradient(circle at 32% 30%, #fff 0 18%, rgba(186,230,253,.18) 22%); animation: egg-rise 1.3s ease-out forwards; }
        @keyframes egg-rise { from { transform: translate(0, 0) scale(.6); opacity: 1; } to { transform: translate(var(--dx), -90px) scale(1.15); opacity: 0; } }
        .ai-pick img.ai-bubble { border-radius: 0; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .45)); }
        /* ---- theme gallery + editor ---- */
        .th-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 12px 0 6px; }
        .th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
        .th-card { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text); font: inherit; text-align: start; transition: border-color .15s, transform .15s; }
        .th-card:hover { border-color: var(--border-focus); transform: translateY(-1px); }
        .th-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
        .th-prev { height: 54px; border-radius: 5px; border: 1px solid transparent; display: flex; gap: 4px; padding: 5px; overflow: hidden; }
        .th-prev > i { display: block; border-radius: 3px; }
        .th-prev > i:first-child { width: 28%; }
        .th-prev > i:last-child { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 5px; }
        .th-prev em { display: block; height: 5px; border-radius: 3px; width: 70%; }
        .th-prev em:nth-child(2) { width: 50%; } .th-prev em:nth-child(3) { width: 85%; }
        .th-new .th-prev { align-items: center; justify-content: center; border: 1px dashed var(--border-focus); color: var(--muted); }
        .th-new .th-prev .ic { width: 22px; height: 22px; }
        .th-name { font-size: 12.5px; font-weight: 600; color: var(--bright); }
        .th-on { position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
        .th-on .ic { width: 13px; height: 13px; }
        dialog.theme-editor-dlg { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: 360px; max-width: 100vw; background: transparent; border: 0; padding: 0; }
        dialog.theme-editor-dlg::backdrop { background: transparent; }
        :root[dir="rtl"] dialog.theme-editor-dlg { margin: 0 auto 0 0; }
        .te-box { height: 100%; display: flex; flex-direction: column; background: var(--bg-1); border-inline-start: 1px solid var(--border-focus); box-shadow: -12px 0 40px rgba(0,0,0,.45); color: var(--text); }
        .te-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; font-size: 16px; color: var(--bright); }
        .te-body { flex: 1; overflow: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
        .te-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 8px; }
        .te-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg-0); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
        .te-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid transparent; color: var(--muted); padding: 8px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; }
        .te-seg button.on { background: var(--bg-3); color: var(--bright); border-color: var(--border-focus); }
        .te-seg .ic { width: 15px; height: 15px; }
        .te-color { display: flex; align-items: center; gap: 8px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
        .te-sw { width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0; cursor: pointer; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
        .te-sw input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; }
        .te-hex { flex: 1; margin: 0 !important; font-family: var(--mono); text-transform: uppercase; }
        .te-wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
        .te-int { display: flex; justify-content: space-between; color: var(--bright); font-size: 13.5px; }
        .te-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
        .te-foot .btn { flex: 1; }
        /* two-colour custom themes: one gradient across the whole app */
        :root.theme-grad .rail, :root.theme-grad .channels-pane, :root.theme-grad .main, :root.theme-grad .members-pane { background: var(--app-grad) fixed !important; }
        :root.theme-grad .channels-pane, :root.theme-grad .members-pane { background: linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.18)), var(--app-grad) fixed !important; }
    