@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url("fonts/figtree-400.woff2") format("woff2"); }
@font-face { font-family: Figtree; font-weight: 700; font-display: swap; src: url("fonts/figtree-700.woff2") format("woff2"); }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url("fonts/figtree-600.woff2") format("woff2"); }

/* Accent from the logo's large bubble (#866af0), darkened in light mode for 6:1 text contrast. */
:root {
  --bg: #f3f5f8; --card: #fff; --raised: #fff; --fill: #e7ebf0; --fill-hover: #dde2e9;
  --text: #14181f; --text-2: #5d6673; --muted: #5d6673; --sep: rgb(20 24 31 / 0.1);
  --accent: #6247d4; --accent-hover: #563cc2; --on-accent: #fff; --accent-text: #6247d4;
  --tint: rgb(98 71 212 / 0.1); --tint-strong: rgb(98 71 212 / 0.16);
  --mine: #6247d4; --on-mine: #fff;
  --green: #177a42; --green-dot: #1f9d55; --red: #d4302a; --amber: #9a6208; --amber-fill: rgb(194 124 14 / 0.12);
  --scrim: rgb(20 24 31 / 0.42); --shadow: 0 12px 40px rgb(20 24 31 / 0.16), 0 2px 6px rgb(20 24 31 / 0.06);
  --glow: 16%; --banner: #dcd5fb; --red-fill: #d4302a; --control-line: rgb(20 24 31 / 0.46);
  --font: Figtree, "Noto Color Emoji", system-ui, sans-serif; --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", monospace;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --gold: #c9971f; --gold-text: #8a6410; --on-gold: #1f1604; --gold-btn: #d9a52c; --gold-btn-hover: #cb9822; --gold-glow: 24%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --bg: #000; --card: #0c0c0f; --text: #f1f4f8; color-scheme: dark; } }
:root[data-theme="dark"], :root[data-theme="oled"], :root[data-theme="gray"], :root[data-theme="midnight"], :root[data-theme="forest"], :root[data-theme="plum"] {
  --bg: #000; --card: #0c0c0f; --raised: #16161a; --fill: #1f1f25; --fill-hover: #2c2c33;
  --text: #f1f4f8; --text-2: #9aa3b2; --muted: #9aa3b2; --sep: rgb(255 255 255 / 0.09);
  --accent: #b3a1ff; --accent-hover: #c4b6ff; --on-accent: #120a2e; --accent-text: #b8a7ff;
  --tint: rgb(179 161 255 / 0.14); --tint-strong: rgb(179 161 255 / 0.22);
  --mine: #4a37a6; --on-mine: #fff;
  --green: #3ecf8e; --green-dot: #3ecf8e; --red: #ff5a4f; --amber: #f0b44c; --amber-fill: rgb(240 180 76 / 0.12);
  --scrim: rgb(0 0 0 / 0.62); --shadow: 0 12px 40px rgb(0 0 0 / 0.55), 0 2px 6px rgb(0 0 0 / 0.3);
  --glow: 30%; --banner: #2a2250; --red-fill: #c8322a; --control-line: rgb(255 255 255 / 0.38);
  --gold: #e3b54f; --gold-text: #f0c869; --gold-btn: #e8bd5a; --gold-btn-hover: #f0c869;
  color-scheme: dark;
}
:root[data-theme="oled"] { --card: #000; --raised: #0c0c0f; --fill: #141418; --fill-hover: #1e1e23; --sep: rgb(255 255 255 / 0.12); }
:root[data-theme="gray"] { --bg: #1c1c1f; --card: #232327; --raised: #2c2c31; --fill: #313137; --fill-hover: #3a3a41; --sep: rgb(255 255 255 / 0.08); }
:root[data-theme="midnight"] { --bg: #0a1228; --card: #111b36; --raised: #182444; --fill: #1f2d52; --fill-hover: #293a66; --sep: rgb(160 180 255 / 0.13); --banner: #22346a;
  --accent: #8fb4ff; --accent-hover: #a9c5ff; --on-accent: #0a1530; --accent-text: #9dbdff; --tint: rgb(143 180 255 / 0.15); --tint-strong: rgb(143 180 255 / 0.24); --mine: #2d4fa8; }
:root[data-theme="forest"] { --bg: #08160f; --card: #0f2219; --raised: #152e22; --fill: #1c3a2c; --fill-hover: #254a38; --sep: rgb(160 255 200 / 0.12); --banner: #1e4632;
  --accent: #6fdba5; --accent-hover: #8fe6ba; --on-accent: #04200f; --accent-text: #7fe2b0; --tint: rgb(111 219 165 / 0.14); --tint-strong: rgb(111 219 165 / 0.22); --mine: #1f6b47; }
:root[data-theme="plum"] { --bg: #170a1c; --card: #22112a; --raised: #2c1736; --fill: #391f45; --fill-hover: #472856; --sep: rgb(230 170 255 / 0.13); --banner: #4a2160;
  --accent: #e3a0ff; --accent-hover: #ebb8ff; --on-accent: #2a0838; --accent-text: #e6aaff; --tint: rgb(227 160 255 / 0.15); --tint-strong: rgb(227 160 255 / 0.24); --mine: #73329a; }

/* base */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: default; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 16px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--sep); margin: 8px 0; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.fine { color: var(--text-2); font-size: 13px; }
.error-text, .danger-text { color: var(--red); }
.warn-text { color: var(--amber); font-size: 14px; }
.loading { color: var(--text-2); padding: 24px; text-align: center; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.self-start { align-self: flex-start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; }
.phone-only { display: none !important; }
.clickable-user { cursor: pointer; }

.scroll, .sb-list, .popover, .modal, .members, .settings-view, .ss-body, .ss-nav { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--fill-hover) transparent; }
@supports selector(::-webkit-scrollbar) {
  .scroll::-webkit-scrollbar, .sb-list::-webkit-scrollbar, .popover::-webkit-scrollbar, .modal::-webkit-scrollbar, .members::-webkit-scrollbar, .settings-view::-webkit-scrollbar, .ss-body::-webkit-scrollbar { width: 10px; }
  .scroll::-webkit-scrollbar-thumb, .sb-list::-webkit-scrollbar-thumb, .popover::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb, .members::-webkit-scrollbar-thumb, .settings-view::-webkit-scrollbar-thumb, .ss-body::-webkit-scrollbar-thumb {
    background: var(--fill-hover); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
}

/* the one glow: accent falling from the top edge, behind the shell */
/* one glow for the whole viewport: fixed, so the surfaces above the canvas continue it instead of covering it */
:root { --glow-top: radial-gradient(ellipse 70% 520px at 50% -10%, color-mix(in srgb, var(--accent) var(--glow), transparent), transparent 100%) fixed; }
.layout, .center-screen { background: var(--glow-top), var(--bg); }

/* buttons: pills, one primary per view */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 980px;
  background: var(--fill); color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; transition: background-color 0.15s; }
.btn:hover:not(:disabled) { background: var(--fill-hover); text-decoration: none; }
.btn:disabled { opacity: 0.45; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.danger { background: var(--red-fill); color: #fff; }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 88%, #000); }
.btn.ok { background: var(--green-dot); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: var(--fill); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.plain { background: none; height: auto; padding: 4px 2px; color: var(--accent-text); font-weight: 600; }
.btn.plain:hover:not(:disabled) { background: none; text-decoration: underline; }
.btn.danger-text, .btn.ghost.danger-text, .btn.plain.danger-text { color: var(--red); }
.btn .icon { width: 17px; height: 17px; }

.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); flex: none; position: relative; transition: background-color 0.15s, color 0.15s; }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn.active { background: var(--tint); color: var(--accent-text); }
.icon-btn.tiny { width: 28px; height: 28px; }
.icon-btn.tiny .icon { width: 16px; height: 16px; }
.icon-btn.off { color: var(--red); }
.icon-btn.on { background: var(--tint); color: var(--accent-text); }
.icon-btn.danger { background: var(--red-fill); color: #fff; }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); color: #fff; }
.icon-btn.danger-hover:hover { color: var(--red); }
.icon-btn.round { width: 40px; height: 40px; background: var(--fill); color: var(--text); }
.icon-btn.round.ok { color: var(--green); }
.icon-btn.send { color: var(--accent-text); }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 14px; color: var(--text-2); }
.field small { color: var(--text-2); font-size: 13px; }
.input, .search { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--control-line); background: var(--bg); color: var(--text); outline: none; font-size: 16px; }
textarea.input { padding: 11px 14px; line-height: 1.45; resize: vertical; }
.input:focus, .search:focus { border-color: transparent; outline: 2px solid var(--accent); outline-offset: 0; }
.input::placeholder, .search::placeholder, .composer-input::placeholder { color: var(--text-2); opacity: 1; }
select.input, select.lang-select { appearance: none; padding-right: 38px; border-radius: 12px; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a93a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") right 16px center / 12px 8px no-repeat; }
.input.tri { width: auto; min-height: 32px; padding: 0 30px 0 10px; }
.range { width: 100%; accent-color: var(--accent); }
.range:disabled { opacity: 0.4; }
input[type="checkbox"] { accent-color: var(--accent); }

.switch { position: relative; width: 46px; height: 28px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.switch-track { position: absolute; inset: 0; border-radius: 14px; background: var(--fill-hover); transition: background-color 0.2s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.22s var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
:root:not([data-theme="light"]) .switch input:checked + .switch-track::after { background: var(--on-accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch.disabled { opacity: 0.45; cursor: not-allowed; }

.segmented { display: flex; gap: 2px; padding: 3px; margin: 16px 24px 4px; background: var(--fill); border-radius: 980px; flex: none; max-width: 440px; }
.ss-role-editor .segmented, .modal .segmented { margin: 0; }
.seg { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 980px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg:hover { color: var(--text); }
.seg.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--control-line); }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot-badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.dot-badge:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; }
.tag { margin-left: auto; font-size: 13px; font-weight: 600; }
.tag.ok { color: var(--green); }
.tag.warn { color: var(--amber); }
.bot-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--fill); color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: 0; vertical-align: 2px; }
.live-tag { flex: none; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 17px; letter-spacing: 0.02em; }
.pulse-badge { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--red); }

.avatar { border-radius: 50%; object-fit: cover; flex: none; display: block; background: var(--fill); }
.avatar.initials, .avatar.group-default { display: grid; place-items: center; color: #fff; font-weight: 600; user-select: none; }
.status-wrap { position: relative; flex: none; }
.status-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--bg); }
.status-dot.on { background: var(--green-dot); }
.status-dot.off { background: #8a93a1; }
.group-avatar { position: relative; flex: none; }
.group-avatar > :first-child { position: absolute; left: 0; top: 0; }
.group-avatar > :nth-child(2) { position: absolute; right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--bg); }
.hero-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--tint); color: var(--accent-text); display: grid; place-items: center; }
.hero-icon.small { width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 600; }

.skeleton { background: var(--fill); border-radius: 8px; animation: skel 1.2s ease-in-out infinite alternate; }
.skeleton-row { display: flex; gap: 14px; padding: 12px 24px; align-items: flex-start; }
.skeleton-row .skeleton.round { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.skeleton-lines .skeleton { height: 12px; }
.img-skeleton { width: 240px; height: 160px; border-radius: 16px; background: var(--fill); animation: skel 1.2s ease-in-out infinite alternate; }
@keyframes skel { to { opacity: 0.58; } }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--fill-hover); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign-in and onboarding: one centred card */
.center-screen { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; position: relative; }
.card { width: min(440px, 100%); background: var(--card); border-radius: 22px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.card h1 { font-size: 28px; letter-spacing: -0.03em; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand-mark { width: 32px; height: 32px; object-fit: contain; flex: none; }
.brand-logo { height: 88px; width: auto; display: block; align-self: center; object-fit: contain; }
.lang-float { position: absolute; top: 16px; right: 16px; }
.lang-wrap { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); position: relative; }
.lang-wrap .icon { position: absolute; left: 14px; pointer-events: none; }
.lang-wrap .lang-select { min-height: 40px; padding-left: 38px; font-size: 15px; width: auto; border: 1px solid var(--control-line); background-color: var(--card); color: var(--text); }
.field .lang-wrap { align-self: flex-start; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.check-row:hover { background: var(--fill); }
.check-row input { width: 18px; height: 18px; flex: none; }
.check-row.big { align-items: flex-start; padding: 16px 4px; border-radius: 0; border-top: 1px solid var(--sep); }
.check-row.big:hover { background: none; }
.check-row.big + .check-row.big { border-top: 1px solid var(--sep); }
.check-row.big small { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.facts { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.dl { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 0 18px; border-radius: 16px; background: var(--fill); color: var(--text); font-weight: 600; }
.dl:hover { background: var(--fill-hover); text-decoration: none; }
.dl small { font-weight: 400; color: var(--text-2); }

/* app shell: top bar, navigation on the tonal canvas, and one round card holding the list and the content */
:root { --canvas-grad: linear-gradient(180deg, #f3f5f8 0%, #eef0f6 55%, #f1eef7 100%); }
:root:not([data-theme="light"]) { --canvas-grad: linear-gradient(180deg, #000 0%, #05040a 60%, #0a0812 100%); }
:root[data-theme="gray"] { --canvas-grad: linear-gradient(180deg, #1c1c1f 0%, #1a1922 100%); }
:root[data-theme="midnight"] { --canvas-grad: linear-gradient(180deg, #0a1228 0%, #0e1838 100%); }
:root[data-theme="forest"] { --canvas-grad: linear-gradient(180deg, #08160f 0%, #0b1d14 100%); }
:root[data-theme="plum"] { --canvas-grad: linear-gradient(180deg, #170a1c 0%, #1e0d26 100%); }
.layout { --rail-w: 248px; --list-w: 330px; --members-w: 248px; position: relative; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); height: 100vh; height: 100dvh; background: var(--glow-top), var(--canvas-grad); }
.appbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 18px; min-width: 0; }
.appbar-brand { display: flex; align-items: center; gap: 10px; width: calc(var(--rail-w) - 34px); flex: none; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; border-radius: 980px; }
.appbar-brand img { width: 30px; height: 30px; }
.appbar-search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; color: var(--text-2); }
.appbar-search .icon { position: absolute; left: 15px; pointer-events: none; }
.appbar-search .search { min-height: 40px; padding-left: 42px; background: var(--fill); border-color: transparent; }
.appbar-search .search:focus { background: var(--card); }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar-me { border-radius: 50%; display: grid; }
.appbar-me:focus-visible { outline-offset: 3px; }
.rail { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 10px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.nav-new { margin-bottom: 14px; flex: none; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 980px; color: var(--text); font-size: 15px; text-align: left; flex: none; position: relative; }
.nav-item > .icon { color: var(--text-2); width: 18px; height: 18px; }
.nav-item:hover { background: var(--fill); }
.nav-item.on { background: var(--tint); font-weight: 600; }
.nav-item.on > .icon { color: var(--accent-text); }
.nav-item.unread .nav-label { font-weight: 600; }
.nav-item .badge { margin-left: auto; }
.nav-item .dot-badge { position: static; margin-left: auto; box-shadow: none; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { position: relative; display: grid; flex: none; }
.nav-icon .srv-icon { border-radius: 50%; }
.nav-group { display: flex; align-items: center; justify-content: space-between; padding: 18px 6px 6px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); flex: none; }
.nav-servers { display: flex; flex-direction: column; gap: 2px; }
.nav-add { width: 26px; height: 26px; border-radius: 50%; place-items: center; border: 1.5px dashed var(--control-line); color: var(--text-2); }
.nav-item.add { color: var(--text-2); }
.nav-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.nav-foot .voice-box, .nav-foot .update-box { margin: 0; }
.nav-controls { display: flex; align-items: center; gap: 2px; }
.nav-controls .nav-item { flex: 1; min-width: 0; }
.nav-foot .legal-links { padding: 0 6px; text-align: left; }
.voice-badge { position: absolute; bottom: -3px; right: -4px; width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; background: var(--green-dot); color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.srv-icon { border-radius: 14px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 600; flex: none; }
.card-shell { position: relative; grid-row: 2; grid-column: 2; min-width: 0; min-height: 0; margin: 0 14px 14px 0; display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr) auto; background: var(--card); border-radius: 28px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(20 24 31 / 0.04), 0 12px 40px rgb(60 40 120 / 0.06); }
/* the edge ring sits above the panes: an inset shadow hides under the content's background on one side only */
.card-shell::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
:root:not([data-theme="light"]) .card-shell::after { box-shadow: inset 0 0 0 1px var(--sep); }
.sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--sep); }
.main { background: linear-gradient(180deg, var(--card) 0%, color-mix(in srgb, var(--card) 95%, var(--accent)) 100%); display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.members { width: var(--members-w); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--sep); }
.chat-head .icon-btn, .chat-search { display: none; }

.sb-head { height: 64px; padding: 0 10px 0 18px; display: flex; align-items: center; gap: 4px; flex: none; }
.sb-title { font-size: 24px; letter-spacing: -0.03em; margin-right: auto; }
.search-wrap { padding: 0 12px 10px; flex: none; }
.search { min-height: 40px; border-radius: 980px; background: var(--card); padding: 0 16px; font-size: 15px; }
.search:focus { background: var(--card); }
.sb-list { flex: 1; min-height: 0; padding: 2px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.sb-nav { padding: 8px 10px 0; }
.sb-section { display: flex; align-items: center; justify-content: space-between; padding: 18px 8px 6px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.sb-empty { color: var(--text-2); font-size: 14px; padding: 10px; }
.sb-empty.welcome { display: flex; flex-direction: column; gap: 10px; padding: 18px 10px; line-height: 1.5; }
.sb-empty.welcome > b { color: var(--text); font-size: 16px; }
.sb-item { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 15px; text-align: left; }
.sb-item .icon { color: var(--text-2); width: 18px; height: 18px; }
.sb-item:hover { background: var(--fill); }
.sb-item.active, .sb-item[aria-current="page"] { background: var(--tint); font-weight: 600; }
.sb-item.active .icon, .sb-item[aria-current="page"] .icon { color: var(--accent-text); }
.sb-item.unread .sb-name { font-weight: 600; }
.sb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-text small { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conv-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; color: var(--text); text-align: left; }
.conv-row:hover { background: var(--fill); }
.conv-row.active { background: var(--tint); }
.conv-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.conv-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { flex: none; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.conv-preview { flex: 1; min-width: 0; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row.unread .conv-preview { color: var(--text); }
.conv-row.unread .conv-time { color: var(--accent-text); font-weight: 600; }
.in-call { color: var(--green); display: inline-flex; align-items: center; gap: 4px; }

.voice-box, .update-box { margin: 0 10px 8px; padding: 10px 8px 10px 14px; border-radius: 16px; background: var(--card); display: flex; align-items: center; gap: 4px; }
.voice-info { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; line-height: 1.3; }
.voice-state { color: var(--green); font-weight: 600; font-size: 14px; }
.voice-info small { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-box { gap: 10px; padding-right: 10px; }
.update-notes { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.update-notes summary { cursor: pointer; color: var(--text); }
.update-notes ul { margin: 4px 0 0; padding-left: 16px; }
.user-panel { display: flex; align-items: center; gap: 2px; padding: 8px 10px; flex: none; border-top: 1px solid var(--sep); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; border-radius: 12px; text-align: left; }
.me:hover { background: var(--fill); }
.legal-links { padding: 2px 12px 12px; text-align: center; font-size: 13px; color: var(--text-2); }
.legal-links a { color: var(--text-2); }
.tabbar { display: none; }

/* drag handles between the panes */
.resizer { position: absolute; z-index: 5; width: 10px; margin-left: -5px; cursor: col-resize; touch-action: none; }
.resizer::after { content: ""; position: absolute; inset: 0 4px; border-radius: 2px; transition: background-color 0.15s; }
.resizer:hover::after, .resizer.dragging::after, .resizer:focus-visible::after { background: var(--accent); }
.resizer:focus-visible { outline: none; }
.resizer.rail-edge { top: 60px; bottom: 14px; left: var(--rail-w); }
.resizer.list-edge { top: 0; bottom: 0; left: var(--list-w); }
.resizer.members-edge { top: 0; bottom: 0; right: calc(var(--members-w) - 5px); margin-left: 0; }
.members[hidden] ~ .resizer.members-edge { display: none; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe, body.resizing video { pointer-events: none; }

/* server sidebar */
.srv-head { height: 64px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--sep); gap: 4px; }
.srv-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border-radius: 12px; font-weight: 600; font-size: 17px; text-align: left; }
.srv-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-title:hover { background: var(--fill); }
.ch-section { margin-top: 14px; }
.ch-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.ch-cat { padding-left: 0; }
.ch-cat-btn { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; padding: 4px 2px; color: var(--text-2); font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; }
.ch-cat-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cat-btn:hover { color: var(--text); }
.ch-cat-btn svg { flex: none; transition: transform 0.18s var(--ease); }
.ch-cat.closed .ch-cat-btn svg { transform: rotate(-90deg); }
.ch-row { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 12px; color: var(--text-2); text-align: left; }
.ch-row .icon { width: 18px; height: 18px; }
.ch-row:hover { background: var(--fill); color: var(--text); }
.ch-row.active { background: var(--tint); color: var(--text); font-weight: 600; }
.ch-row.active .icon { color: var(--accent-text); }
.ch-row.unread { color: var(--text); font-weight: 600; }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row[draggable="true"], .ch-cat[draggable="true"] { cursor: grab; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.vc-user { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 10px 0 38px; font-size: 14px; color: var(--text-2); }
.vc-user .avatar { transition: box-shadow 0.15s; }
.vc-user.speaking .avatar { box-shadow: 0 0 0 2px var(--green-dot); }
.vc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-flags { margin-left: auto; display: inline-flex; gap: 3px; color: var(--red); flex: none; }
.voice-duration { margin-left: auto; flex: none; color: var(--green); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fill); }
.invite-row code { font-family: var(--mono); font-size: 13px; }
.invite-row small { flex: 1; }
.invite-row.dead { opacity: 0.55; }
.invite-preview { display: flex; align-items: center; gap: 10px; }
.invite-preview:empty { display: none; }

/* members */
.member { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 12px; color: var(--text); }
.member:hover { background: var(--fill); }
.member .sb-name { flex: 1; }
.member.off { opacity: 0.55; }
.member small.playing { color: var(--green); }
.member-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.crown { display: inline-flex; margin-left: 4px; color: var(--amber); vertical-align: -2px; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* content header */
.top { height: 64px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--sep); color: var(--text-2); }
.top h2 { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h2.clickable { cursor: pointer; }
.top .status-dot { border-color: var(--card); }
.head-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.head-text h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-text small { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-text small.on, .head-text small.playing { color: var(--green); }
.head-text.clickable { cursor: pointer; }
.handle { color: var(--text-2); font-size: 14px; font-weight: 400; }
.e2e-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.page-title { font-size: 20px; letter-spacing: -0.02em; }
.tabs { display: flex; gap: 4px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--sep); overflow-x: auto; scrollbar-width: none; }
.tab { min-height: 34px; padding: 0 14px; border-radius: 980px; color: var(--text-2); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--fill); color: var(--text); }
.tab.active { background: var(--tint); color: var(--text); }
.tab.add { background: var(--accent); color: var(--on-accent); }
.tab.add.active { background: var(--tint); color: var(--accent-text); }
.m-back { display: none; }

.banner { display: flex; align-items: center; gap: 10px; margin: 10px 20px 0; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.banner.warn { background: var(--amber-fill); color: var(--amber); }
.banner span { flex: 1; color: var(--text); }

/* friends */
.pad { padding: 20px 24px; flex: 1; }
.list-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding: 6px 10px 8px; }
.friend-list { display: flex; flex-direction: column; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; }
.friend-row { position: relative; }
.friend-row + .friend-row::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 1px; background: var(--sep); }
.friend-row:hover { background: var(--fill); }
.friend-row:hover::before, .friend-row:hover + .friend-row::before { opacity: 0; }
.friend-row small.playing { color: var(--green); }
.row-actions { display: flex; align-items: center; gap: 8px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-2); padding: 64px 20px; text-align: center; }
.add-friend { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.add-row { display: flex; gap: 8px; margin-top: 8px; padding: 4px 4px 4px 6px; border-radius: 980px; background: var(--fill); }
.add-row:focus-within { outline: 2px solid var(--accent); }
.add-row .input { border: 0; background: transparent; outline: none; }
.add-row .btn { flex: none; }

/* chat */
.messages { flex: 1; min-height: 0; padding: 8px 0 12px; }
.intro { padding: 32px 24px 12px; display: flex; flex-direction: column; gap: 8px; }
.intro h1 { font-size: 28px; letter-spacing: -0.03em; margin-top: 8px; }
.e2e-note { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.e2e-note .icon { color: var(--accent-text); }
.e2e-note.warn, .e2e-note.warn .icon { color: var(--amber); }
.day { display: flex; align-items: center; gap: 12px; margin: 20px 24px 8px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--sep); }

.mrow { display: flex; gap: 14px; padding: 3px 24px 3px 20px; margin-top: 14px; }
.mrow.cont { margin-top: 0; }
.mrow:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); }
.mrow.picked { background: var(--fill); }
.row-avatar { width: 40px; flex: none; padding-top: 2px; }
.mrow.has-reply .row-avatar { padding-top: 24px; }
.row-side { width: 40px; flex: none; padding-top: 4px; font-size: 11px; color: transparent; text-align: right; font-variant-numeric: tabular-nums; }
.mrow:hover .row-side { color: var(--text-2); }
.row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.row-head { display: flex; align-items: baseline; gap: 8px; }
.row-author { font-weight: 600; color: var(--text); }
.row-text { color: var(--text); font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 760px; }
.row-text.jumbo { font-size: 40px; line-height: 1.2; }
.msg-time { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.edited { color: var(--text-2); font-size: 12.5px; }
.mrow.mentioned { background: var(--amber-fill); }
.mrow.sending .row-main, .msg.sending .bubble-col { opacity: 0.55; transition: opacity 0.2s 0.3s; }
.mrow.enter, .msg.enter { animation: msg-in 0.22s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { background: var(--tint-strong); } }

.msg { display: flex; align-items: flex-end; gap: 8px; padding: 0 12px; margin-top: 2px; }
.msg.first { margin-top: 12px; }
.msg.mine { flex-direction: row-reverse; }
.msg-avatar { width: 28px; flex: none; margin-bottom: 22px; }
.bubble-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: min(80%, 560px); min-width: 0; }
.msg.mine .bubble-col { align-items: flex-end; }
.msg-author { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 12px 2px; }
.bubble { padding: 9px 14px; border-radius: 20px; font-size: 16px; background: var(--fill); color: var(--text); line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.msg.mine .bubble { background: var(--mine); color: var(--on-mine); }
.msg.mine .bubble a { color: inherit; text-decoration: underline; }
.msg.theirs:not(.first) .bubble-col > :first-child, .msg.theirs .bubble-col > :not(:first-child):not(.msg-meta) { border-top-left-radius: 6px; }
.msg.theirs:not(.last) .bubble-col > :last-child, .msg.theirs .bubble-col > :not(:last-child) { border-bottom-left-radius: 6px; }
.msg.mine:not(.first) .bubble-col > :first-child, .msg.mine .bubble-col > :not(:first-child):not(.msg-meta) { border-top-right-radius: 6px; }
.msg.mine:not(.last) .bubble-col > :last-child, .msg.mine .bubble-col > :not(:last-child) { border-bottom-right-radius: 6px; }
.bubble.jumbo { background: none !important; padding: 0 2px; font-size: 44px; line-height: 1.15; }
.msg-meta { font-size: 12px; color: var(--text-2); padding: 2px 8px 0; }
.msg.picked .bubble { box-shadow: 0 0 0 2px var(--accent); }
.msg.mentioned .bubble { box-shadow: inset 0 0 0 1.5px var(--amber); }
.undecryptable, .bubble.undecryptable { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-style: italic; font-size: 14px; }

.sys-msg { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 24px 6px; color: var(--text-2); font-size: 14px; }
.sys-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; white-space: nowrap; }
.sys-chip.live, .sys-chip.live .icon { color: var(--green); }
.sys-time { color: var(--text-2); }

.reply-line { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; margin: 0 0 2px; color: var(--text-2); font-size: 13px; text-align: left; }
.reply-line b { flex: none; color: var(--text); font-weight: 600; }
.reply-line .avatar, .reply-line svg { flex: none; }
.reply-text, .reply-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
button.reply-line:hover .reply-text, button.reply-line:hover b { color: var(--text); text-decoration: underline; }
.reply-line.missing, .reply-older { font-style: italic; }
.reply-older, .reply-to { flex: none; white-space: nowrap; }
.msg.mine .reply-line { align-self: flex-end; }

.mn { color: var(--accent-text); background: var(--tint); border-radius: 6px; padding: 0 3px; font-weight: 600; cursor: pointer; }
.mn.mn-me { color: var(--amber); background: var(--amber-fill); }
.msg.mine .bubble .mn { color: inherit; background: rgb(255 255 255 / 0.2); }
.spoiler-reveal { font: inherit; color: var(--text); background: var(--fill-hover); border-radius: 8px; padding: 1px 8px; cursor: pointer; }
.spoiler-shown { background: var(--tint); border-radius: 6px; padding: 1px 3px; overflow-wrap: anywhere; }
.custom-emoji { width: 1.5em; height: 1.5em; vertical-align: middle; object-fit: contain; }

.chat-format { white-space: normal; overflow-wrap: anywhere; }
.chat-format > :first-child { margin-top: 0; }
.chat-format > :last-child { margin-bottom: 0; }
.chat-format p { margin: 0.35em 0; white-space: pre-wrap; }
.chat-format h3 { margin: 0.5em 0 0.2em; font-size: 1em; line-height: 1.3; }
.chat-format ul, .chat-format ol { margin: 0.35em 0; padding-left: 1.4em; }
.chat-format li { margin: 0.1em 0; }
.chat-format blockquote { margin: 0.35em 0; padding-left: 0.75em; border-left: 2px solid var(--fill-hover); white-space: pre-wrap; }
.chat-format code { font-family: var(--mono); font-size: 0.9em; background: var(--fill); border-radius: 6px; padding: 0.1em 0.35em; }
.chat-format pre { margin: 0.35em 0; padding: 10px 12px; border-radius: 12px; background: var(--fill); overflow-x: auto; max-width: 100%; white-space: pre; }
.chat-format pre code { background: none; padding: 0; }
.msg.mine .chat-format code, .msg.mine .chat-format pre { background: rgb(0 0 0 / 0.2); }

.rx-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.msg.mine .rx-row { justify-content: flex-end; }
.rx-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--fill); font-size: 13px; }
.rx-chip:hover { background: var(--fill-hover); }
.rx-chip.mine { background: var(--tint-strong); box-shadow: inset 0 0 0 1px var(--accent); }
.rx-emoji { font-size: 15px; line-height: 1; }
.rx-count { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.rx-quick { display: flex; align-items: center; gap: 2px; padding: 2px 2px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--sep); }
.rx-q { width: 40px; height: 40px; border-radius: 12px; font-size: 22px; display: grid; place-items: center; }
.rx-q:hover { background: var(--fill); }
.rx-q.more { color: var(--text-2); font-size: 16px; }

/* attachments */
.attachment { position: relative; width: fit-content; max-width: min(420px, 100%); border-radius: 16px; overflow: hidden; }
.img-att { max-width: 100%; max-height: 340px; display: block; cursor: zoom-in; }
.attachment .fav { position: absolute; top: 6px; right: 6px; background: rgb(0 0 0 / 0.55); color: #fff; opacity: 0; }
.attachment:hover .fav, .attachment:focus-within .fav { opacity: 1; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: min(260px, 70vw); background: var(--fill); }
.file-card > .icon { color: var(--accent-text); }
.video-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: min(360px, 70vw); aspect-ratio: 16 / 9; background: var(--fill); color: var(--text-2); border-radius: inherit; }
.video-card.loading .skeleton { width: 100%; aspect-ratio: 16 / 9; }
.video-card .play { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.video-card .play .icon { fill: currentColor; margin-left: 3px; }
.video-name { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); }
.video-att { display: block; max-width: min(480px, 100%); max-height: 360px; background: #000; }
.audio-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: min(360px, 70vw); min-height: 64px; background: var(--fill); color: var(--text); text-align: left; }
.audio-card > .icon { color: var(--accent-text); }
.audio-card .sb-name, .audio-name { overflow-wrap: anywhere; }
.audio-card[disabled] { cursor: wait; opacity: 0.65; }
.audio-player { width: min(360px, 70vw); padding: 12px; background: var(--fill); }
.audio-name { margin: 0 4px 10px; font-size: 14px; }
.audio-att { display: block; width: 100%; height: 54px; }
.gifbox-message { display: inline-flex; flex-direction: column; gap: 5px; max-width: 100%; }
.gifbox-message img, .gifbox-message video { display: block; width: auto; max-width: min(360px, 100%); max-height: 280px; border-radius: 16px; }
.caption { font-size: 13px; color: var(--text-2); }

/* composer */
.composer-wrap { position: relative; padding: 0 20px 10px; flex: none; }
.composer { display: flex; align-items: flex-end; gap: 2px; min-height: 52px; padding: 6px; border-radius: 26px; background: var(--fill); }
.composer:focus-within { background: var(--card); box-shadow: 0 0 0 1px var(--sep), 0 1px 3px rgb(0 0 0 / 0.06); }
.composer:has(.composer-input:focus-visible) { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.composer.disabled .icon-btn, .composer.disabled .gif-btn { opacity: 0.45; }
.composer-input { flex: 1; min-width: 0; min-height: 40px; max-height: 240px; padding: 9px 6px; background: transparent; border: 0; outline: none; resize: none; line-height: 1.45; font-size: 15.5px; }
.composer .icon-btn { width: 40px; height: 40px; }
.gif-btn { height: 40px; padding: 0 10px; border-radius: 980px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-2); }
.gif-btn:hover { background: var(--fill-hover); color: var(--text); }
.composer-wrap.editing .composer { box-shadow: 0 0 0 2px var(--accent); }
.edit-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px 6px 14px; font-size: 13px; color: var(--accent-text); }
.edit-bar:empty { display: none; }
.edit-bar .icon-btn { margin-left: auto; }
.tools-toggle { display: none; }
.typing { height: 22px; padding: 2px 8px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; }
.typing b { color: var(--text); font-weight: 600; }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
.pending { display: flex; gap: 8px; flex-wrap: wrap; }
.pending:not(:empty) { padding: 8px 0; }
.chip { display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 6px 6px 6px 8px; border-radius: 14px; background: var(--fill); font-size: 13px; }
.chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main.drop::after { content: attr(data-drop); position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 22px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--accent-text); font-weight: 600; font-size: 18px; pointer-events: none; }
.mn-pop { position: absolute; left: 20px; right: 20px; bottom: 100%; margin-bottom: 6px; padding: 6px; border-radius: 16px; background: var(--raised); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; z-index: 30; }
.mn-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 10px; text-align: left; }
.mn-opt.on, .mn-opt:hover { background: var(--fill); }
.mn-opt small { color: var(--text-2); }

/* forum */
.forum-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--sep); }
.forum-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 24px; display: flex; flex-direction: column; }
.post-card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 16px 12px; border-radius: 14px; text-align: left; color: var(--text); }
.post-card + .post-card { box-shadow: 0 -1px 0 var(--sep); }
.post-card:hover { background: var(--fill); box-shadow: none; }
.post-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.post-preview { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.post-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.post-dot { opacity: 0.6; }

/* calls */
.call-banner { display: flex; align-items: center; gap: 12px; margin: 10px 20px 0; padding: 10px 12px 10px 14px; border-radius: 16px; background: var(--fill); }
.call-banner span { flex: 1; font-weight: 600; }
.call-banner .avatars { display: flex; }
.call-banner .avatars > * { margin-right: -8px; box-shadow: 0 0 0 2px var(--fill); }
.call-stage { container-type: inline-size; flex: none; max-height: 62vh; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); border-bottom: 1px solid var(--sep); }
:root:not([data-theme="light"]) .call-stage { background: #000; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 0; overflow: auto; padding: 4px; }
.tile { position: relative; width: 200px; aspect-ratio: 16 / 10; border-radius: 18px; background: var(--card); display: grid; place-items: center; overflow: hidden; }
:root:not([data-theme="light"]) .tile { background: #16161a; }
.tiles.has-video .tile.video { width: min(640px, 100%); flex: 1 1 420px; }
.tile.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.video video.mirror { transform: scaleX(-1); }
.tile.person.speaking { box-shadow: 0 0 0 3px var(--green-dot); }
.tile.person.connecting { opacity: 0.7; }
.tile.person.adjustable { cursor: pointer; }
.tile.person.adjustable:hover { box-shadow: 0 0 0 2px var(--fill-hover); }
.tile.person.adjustable.speaking:hover { box-shadow: 0 0 0 3px var(--green-dot); }
.tile.paused { background: var(--fill); }
.tile-label { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 980px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 13px; overflow: hidden; white-space: nowrap; }
.tile-label small { color: rgb(255 255 255 / 0.8); }
.tile-label .conn-fail { color: #ffb4ab; }
.tile-label .vc-flags { margin-left: 4px; color: #ffb4ab; }
.tile-fs, .tile-audio { position: absolute; top: 8px; right: 8px; background: rgb(0 0 0 / 0.55); color: #fff; opacity: 0; }
.tile-audio { opacity: 1; }
.tile.focus .tile-audio { right: 50px; }
.tile-audio.off { color: #ffb4ab; }
.tile:hover .tile-fs, .tile:focus-within .tile-fs { opacity: 1; }
.tile-fs:hover, .tile-audio:hover { background: rgb(0 0 0 / 0.75); color: #fff; }
.tile.video:fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; background: #000; }
.live-badge { position: absolute; top: 8px; left: 8px; padding: 0 7px; border-radius: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; letter-spacing: 0.02em; }
.stream-stats { position: absolute; top: 8px; left: 58px; width: fit-content; max-width: calc(100% - 116px); padding: 3px 8px; border-radius: 8px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.encoder-diag { display: block; margin-top: 4px; color: var(--text-2); }
.paused-info { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; color: var(--text-2); text-align: center; }
.paused-info b { color: var(--text); }
.paused-info small { font-size: 13px; }
.vol-badge { color: var(--amber); }
.vol-pop { display: flex; flex-direction: column; gap: 10px; width: 260px; }
.vol-val { font-variant-numeric: tabular-nums; }
.call-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.cbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 980px; background: var(--fill); color: var(--text); font-size: 14px; font-weight: 600; transition: background-color 0.15s; }
:root:not([data-theme="light"]) .call-stage .cbtn { background: #1c1c21; }
.cbtn:hover, :root:not([data-theme="light"]) .call-stage .cbtn:hover { background: var(--fill-hover); }
.cbtn.off { color: var(--red); }
.cbtn.on { background: var(--tint-strong) !important; color: var(--accent-text); }
.cbtn.danger, :root:not([data-theme="light"]) .call-stage .cbtn.danger { background: var(--red-fill); color: #fff; }
.cbtn.danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); }
.cbtn-group { display: inline-flex; }
.cbtn-group .cbtn:first-child { border-radius: 980px 0 0 980px; padding-right: 14px; }
.cbtn-group .cbtn.chev { min-width: 44px; border-radius: 0 980px 980px 0; padding: 0 12px 0 10px; margin-left: 1px; }
@container (max-width: 860px) { .cbtn-label { display: none; } .cbtn { padding: 0 15px; } }
.call-controls .icon-btn.round { width: 46px; height: 46px; }
.call-controls .icon-btn.round.off { color: var(--red); }
.call-controls .icon-btn.round.on { background: var(--tint-strong); color: var(--accent-text); }
.call-controls .icon-btn.round.danger { background: var(--red-fill); color: #fff; }
.mic-menu { min-width: 260px; }
.mic-menu .menu-item.active { color: var(--accent-text); font-weight: 600; }
.main.stage-full #messages, .main.stage-full #banner, .main.stage-full .composer-wrap { display: none; }
.main.stage-full #call-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.call-stage.voice-full { flex: 1 1 auto; max-height: none; min-height: 0; border-bottom: 0; justify-content: center; }
.call-stage.voice-full .tiles { flex: 1 1 auto; align-content: center; }
.call-stage.focus-mode { max-height: 58vh; }
.call-stage.focus-mode.expanded { flex: 1 1 auto; max-height: none; min-height: 0; border-bottom: 0; }
.stage-focus { flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
.stage-focus .tile.video { flex: 1 1 auto; width: auto; height: auto; min-width: 0; align-self: stretch; aspect-ratio: auto; background: #000; }
.stage-strip { display: flex; gap: 10px; justify-content: center; overflow-x: auto; flex: none; padding: 4px; }
.stage-strip .tile { width: 168px; flex: none; }
.stage-strip .tile.video { cursor: pointer; }
.stage-strip .tile-label { font-size: 12px; left: 6px; bottom: 6px; }
.stage-strip .paused-info small, .stage-strip .paused-info .icon { display: none; }
.voice-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-2); }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.source { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 16px; background: var(--fill); text-align: left; }
.source:hover { box-shadow: 0 0 0 2px var(--accent); }
.source img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #000; border-radius: 10px; }
.source span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-own { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.stream-own-title { display: flex; align-items: center; gap: 8px; }
.stream-menu { display: flex; flex-direction: column; gap: 2px; min-width: 240px; }

/* watch together */
.watch-box { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: #000; container-type: inline-size; }
.watch-bar, .watch-controls { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #16161a; color: #e6e8ec; font-size: 13px; }
.watch-bar .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-warn { color: #f0b44c; }
.watch-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.watch-body > .video-card, .watch-body > .undecryptable { margin: auto; }
.watch-body > .video-card { width: min(360px, 80%); }
.watch-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.watch-stage > .watch-video { position: absolute; inset: 0; object-fit: contain; }
.watch-video { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.wc-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: inherit; }
.wc-btn:hover { background: rgb(255 255 255 / 0.12); }
.wc-time { color: #b9bfca; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wc-seek { flex: 1 1 auto; min-width: 60px; accent-color: var(--accent); cursor: pointer; }
.wc-vol { width: 80px; accent-color: var(--accent); }
@container (max-width: 520px) { .wc-vol, .watch-controls > .icon { display: none; } }
.watch-tap { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 980px; background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* drawing guide on a stream */
.guide-layer { position: absolute; z-index: 2; pointer-events: none; overflow: hidden; }
.guide-layer.interactive { pointer-events: auto; touch-action: none; cursor: crosshair; }
.guide-tools { position: absolute; z-index: 3; left: 50%; top: 8px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: calc(100% - 120px); padding: 4px; border-radius: 980px; background: rgb(16 16 20 / 0.94); }
.guide-btn { min-height: 30px; padding: 0 10px; border-radius: 980px; color: #eceef2; font-size: 12.5px; white-space: nowrap; }
.guide-btn:hover:enabled { background: rgb(255 255 255 / 0.12); }
.guide-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.guide-btn:disabled { opacity: 0.45; }

/* mic meter */
.meter { position: relative; height: 10px; margin: 6px 0; border-radius: 5px; background: var(--fill); overflow: visible; }
.meter-fill { height: 100%; width: 0; border-radius: 5px; background: var(--text-2); transition: width 60ms linear; }
.meter.open .meter-fill { background: var(--green-dot); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.meter-mark.dim { opacity: 0.35; }

/* overlays */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: var(--scrim); animation: fade 0.18s ease-out; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); padding: 22px 24px 24px; border-radius: 22px; background: var(--raised); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; animation: pop 0.3s var(--ease); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 19px; }
.close-label { display: none; }
.modal-head .icon-btn.back-exit { order: -1; }
.lightbox img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 12px; border-radius: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } }

.popover { position: fixed; z-index: 40; width: 360px; max-height: 440px; padding: 10px; border-radius: 18px; background: var(--raised); box-shadow: var(--shadow); animation: pop 0.22s var(--ease); }
:root:not([data-theme="light"]) .popover, :root:not([data-theme="light"]) .modal, :root:not([data-theme="light"]) .ctx-menu, :root:not([data-theme="light"]) .mn-pop, :root:not([data-theme="light"]) .voice-card { box-shadow: var(--shadow), inset 0 0 0 1px var(--sep); }
.popover:has(.vol-pop) { width: auto; max-height: none; }
.gif-popover { width: min(560px, calc(100vw - 16px)); }
.menu { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 12px; text-align: left; font-size: 15px; color: var(--text); }
.menu-item:hover { background: var(--fill); }
.menu-item .icon { color: var(--text-2); width: 18px; height: 18px; }
.menu-item.danger, .menu-item.danger .icon { color: var(--red); }
.ctx-menu { position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--raised); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: pop 0.16s var(--ease); }
.ctx-menu .menu-item { min-height: 38px; font-size: 14px; border-radius: 10px; }
.voice-card { position: fixed; z-index: 60; min-width: 190px; max-width: 270px; padding: 12px 14px; border-radius: 16px; background: var(--raised); box-shadow: var(--shadow); pointer-events: none; font-size: 13px; }
.voice-card-name { display: block; margin-bottom: 6px; font-weight: 600; }
.voice-card-chan + .voice-card-chan { margin-top: 8px; }
.voice-card-title { display: flex; align-items: center; gap: 6px; color: var(--text-2); margin-bottom: 4px; }
.voice-card-user { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 20px; }
.voice-card-user span:not(.live-tag) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.emoji-cat { padding: 10px 4px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji { height: 40px; border-radius: 10px; font-size: 24px; }
.emoji:hover { background: var(--fill); }
.emoji .custom-emoji { width: 28px; height: 28px; }
.gif-picker { display: flex; flex-direction: column; gap: 10px; }
.gif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gif-consent { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; line-height: 1.5; }
.gif-consent p, .gif-consent > span { width: 100%; }
.gif-cell { position: relative; }
.gif-cell img, .gif-send video { display: block; width: 100%; height: 140px; object-fit: contain; border-radius: 12px; cursor: pointer; }
.gif-cell .icon-btn { position: absolute; top: 4px; right: 4px; background: rgb(0 0 0 / 0.55); color: #fff; opacity: 0; }
.gif-cell:hover .icon-btn, .gif-cell:focus-within .icon-btn { opacity: 1; }
.gif-send { width: 100%; padding: 0; background: transparent; }
.srch-results { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow-y: auto; }
.srch-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px; border-radius: 14px; text-align: left; }
.srch-row:hover { background: var(--fill); }
.srch-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.srch-meta { display: flex; gap: 8px; align-items: baseline; }
.srch-meta span { color: var(--accent-text); font-size: 13px; font-weight: 600; }
.srch-meta small { color: var(--text-2); }
.srch-text mark { background: var(--amber-fill); color: inherit; border-radius: 4px; padding: 0 1px; }
.safety { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: var(--fill); }
.safety.focus { box-shadow: inset 0 0 0 1.5px var(--amber); }
.safety pre { margin: 0; font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; color: var(--text); white-space: pre-wrap; }

.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { max-width: 100%; padding: 11px 18px; border-radius: 980px; background: #1c1c21; color: #fff; text-align: center; overflow-wrap: anywhere; box-shadow: var(--shadow); pointer-events: auto; transition: opacity 0.4s; animation: toast-in 0.36s var(--ease); }
:root:not([data-theme="light"]) .toast { background: #2a2a31; }
.toast.error { background: var(--red); color: #fff; }
.toast.ok { background: #1c1c21; }
.toast.gone { opacity: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
body.offline::before { content: attr(data-offline); position: fixed; top: 0; left: 0; right: 0; z-index: 90; padding: 4px; padding-top: max(4px, env(safe-area-inset-top));
  background: var(--amber); color: #231800; text-align: center; font-size: 13px; font-weight: 600; animation: fade 0.3s ease-out 1.2s both; }
:root:not([data-theme="light"]) body.offline::before { color: #231800; }

/* image viewer and crop */
.viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: rgb(0 0 0 / 0.94); color: #fff; animation: fade 0.18s ease-out; }
.viewer-bar { display: flex; align-items: center; gap: 4px; padding: 10px 12px 10px 18px; padding-top: max(10px, env(safe-area-inset-top)); }
.viewer-bar .icon-btn { color: #fff; }
.viewer-bar .icon-btn:hover { background: rgb(255 255 255 / 0.12); }
.viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.viewer-stage { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; padding: 0 12px 16px; }
.viewer-stage.zoomed { cursor: grab; }
.viewer-stage.zoomed:active { cursor: grabbing; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; will-change: transform; }
.crop { align-items: center; }
.crop .row { width: 100%; max-width: 340px; color: var(--text-2); }
.crop .range { flex: 1; }
.crop-view { position: relative; overflow: hidden; border-radius: 16px; background: #000; touch-action: none; cursor: grab; flex: none; }
.crop-view:active { cursor: grabbing; }
.crop-img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.6); }
.crop-view.round .crop-mask { border-radius: 50%; box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.55), inset 0 0 0 2px rgb(255 255 255 / 0.6); }

/* profile card */
.pc { border-radius: 18px; overflow: hidden; background: var(--pc-bg, var(--card)); }
.modal .pc { --pc-bg: var(--raised); }
.pc-banner { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--banner); }
.pc-head { padding: 0 20px; margin-top: -44px; }
.pc-head .status-wrap { width: fit-content; }
.pc-head .avatar { box-shadow: 0 0 0 5px var(--pc-bg, var(--card)); }
.pc-head .status-dot { width: 20px; height: 20px; border-width: 4px; border-color: var(--pc-bg, var(--card)); right: 1px; bottom: 1px; }
.pc-body { padding: 10px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.pc-body h2 { font-size: 22px; letter-spacing: -0.03em; }
.pc-handle { color: var(--text-2); font-size: 14px; }
.pc-status { color: var(--text); }
.pc-game { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 14px; }
.pc-hint { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.pc-section { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--sep); display: flex; flex-direction: column; gap: 4px; }
.pc-section > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.pc-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-edit { align-self: flex-start; margin-top: 8px; }
.avatar-edit, .icon-pick { position: relative; cursor: pointer; flex: none; }
.avatar-edit { border-radius: 50%; }
.icon-pick { border-radius: 20px; }
.avatar-edit span, .icon-pick span { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity 0.15s; }
.avatar-edit:hover span, .icon-pick:hover span { opacity: 1; }
.group-pic { display: flex; align-items: center; gap: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--fill); box-shadow: inset 0 0 0 1px var(--sep); }
.swatch.on { outline: 2px solid var(--text); outline-offset: 2px; }
.swatch.color-default { width: auto; padding: 0 16px; border-radius: 980px; font-size: 14px; font-weight: 600; color: var(--text); }
.custom-color { margin-top: 10px; }
.custom-color input[type="color"] { width: 88px; height: 44px; padding: 4px; border: 1px solid var(--sep); border-radius: 12px; background: var(--card); cursor: pointer; }

/* settings: the shell stays, the sidebar becomes the category list */
.settings-head { padding-left: 10px; }
.settings-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 980px; color: var(--text-2); font-size: 15px; }
.settings-back:hover { background: var(--fill); color: var(--text); }
.settings-title { padding: 0 20px 12px; margin: 0; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.settings-view { flex: 1; min-height: 0; overflow-y: auto; background: var(--glow-top), var(--bg); }
.settings-lead { width: min(880px, 100%); padding: 24px 24px 0; color: var(--text-2); font-size: 15px; }
.settings-body { width: min(880px, 100%); padding: 16px 24px 48px; display: flex; flex-direction: column; gap: 16px; font-size: 16px; }
.settings-body .lead { color: var(--text-2); font-size: 15px; margin: 0 4px 4px; }
.settings-body > .stack, .settings-body > form, .set-card, .ss-card { background: var(--card); border-radius: 22px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.settings-body > .set-groups { background: none; padding: 0; gap: 16px; }
.set-card h3, .settings-body h3 { font-size: 19px; }
/* Plan comparison (chat+): the "+" of a plan name is always gold at deldown. */
.gold-plus { color: var(--gold); }
.plan-lead { color: var(--text-2); font-size: 15px; margin: 0 0 8px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 23px; border-radius: 22px; border: 1px solid var(--sep); }
.plan-plus { border-color: var(--gold); background: radial-gradient(ellipse 90% 220px at 50% -40px, color-mix(in srgb, var(--gold) var(--gold-glow), transparent), transparent 100%); }
.plan-name { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
.plan-plus .plan-name { color: var(--text); }
.plan-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: 0.39px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-sub { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price b { font-size: 34px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.plan-price .daenru-mark { margin-left: -2px; fill: var(--text); }
.daenru-bar { stroke: var(--card); stroke-width: 16; }
.plan-price span { margin-left: 2px; color: var(--text-2); font-size: 15px; }
.plan .btn { width: 100%; }
.plan-current { background: none; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--sep); cursor: default; }
.plan-buy { background: var(--gold-btn); color: var(--on-gold); }
.plan-buy:hover:not(:disabled) { background: var(--gold-btn-hover); }
.plan-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.4; }
.plan-feats li { display: flex; gap: 12px; align-items: flex-start; }
.plan-feats .icon { flex: none; margin-top: 1px; color: var(--text-2); }
.plan-plus .plan-feats .icon { color: var(--gold-text); }
.plan-feats-head { font-weight: 600; }
.plan .fine { margin: auto 0 0; padding-top: 8px; }
.plan .fine a, .plan .fine .link-btn { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.link-btn { font-size: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.settings-body > .set-groups > .plan-grid { margin-bottom: 12px; }
@media (max-width: 760px) { .plan { background-color: var(--card); } }
.sound-list { list-style: none; margin: -4px 0 -8px; padding: 0; }
.sound-list li + li { border-top: 1px solid var(--sep); }
.sound-list b { display: block; font-size: 16px; }
.sound-list li > div > span { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.sound-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.sound-list li > div:first-child { flex: 1; min-width: 160px; }
.sound-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.plus-toggle { display: flex; align-items: center; gap: 16px; }
.plus-toggle > div { flex: 1; }
.plus-toggle small { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
@media (max-width: 560px) {
  .sound-actions { width: 100%; }
}
.set-card > .muted { margin-top: -10px; }
.settings-body .row.end { padding-top: 4px; }
.profile-form .profile-preview { margin: -28px -32px 4px; }
.profile-form .profile-preview .pc { border-radius: 22px 22px 0 0; }
.profile-form .profile-preview .pc-head, .profile-form .profile-preview .pc-body { padding-left: 32px; padding-right: 32px; }
.profile-media { gap: 10px; }
.profile-form textarea.input { min-height: 96px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-opt { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 12px; border-radius: 16px; background: var(--fill); font-weight: 600; text-align: left; }
.theme-opt:hover { background: var(--fill-hover); }
.theme-opt.on { background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent); }
.theme-opt.locked { opacity: .55; }
.theme-opt .plus-tag { font-size: 12px; color: var(--accent-text); margin-left: 6px; }
.theme-swatch { height: 60px; display: flex; align-items: flex-end; gap: 4px; padding: 8px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgb(128 128 128 / 0.3); }
.theme-swatch i { height: 10px; border-radius: 5px; }
.theme-swatch i:first-child { width: 40%; }
.theme-swatch i:last-child { width: 30%; margin-left: auto; background: var(--accent); }
.tpl-details > summary { list-style: none; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--fill); display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; }
.tpl-details > summary::-webkit-details-marker { display: none; }
.tpl-details > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--text-2); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.2s var(--ease); }
.tpl-details[open] > summary::after { transform: rotate(-135deg); }
.tpl-details > :not(summary) { margin-top: 10px; }
.sfx-test .icon { color: var(--accent-text); }
.emoji-upload-list { display: grid; gap: 8px; }
.emoji-upload-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.emoji-upload-row img { width: 40px; height: 40px; object-fit: contain; }

/* server settings */
.modal.wide:has(> .ss) { width: min(1040px, 100%); height: min(780px, calc(100vh - 32px)); padding: 0; gap: 0; overflow: hidden; }
.modal:has(> .ss) > .modal-head { padding: 14px 18px; border-bottom: 1px solid var(--sep); }
.ss { display: grid; grid-template-columns: 240px minmax(0, 1fr); flex: 1; min-height: 0; }
.ss-nav { padding: 16px 10px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); }
.ss-server { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.ss-server b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-group { display: flex; flex-direction: column; gap: 2px; }
.ss-group > span { padding: 0 10px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.ss-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text); text-align: left; }
.ss-link .icon { color: var(--text-2); width: 18px; height: 18px; }
.ss-link:hover { background: var(--fill); }
.ss-link.on { background: var(--tint); font-weight: 600; }
.ss-link.on .icon { color: var(--accent-text); }
.ss-body { min-height: 0; position: relative; background: var(--bg); }
.ss-pane { padding: 24px 28px 96px; display: flex; flex-direction: column; gap: 16px; }
.ss-pane > h2 { font-size: 22px; letter-spacing: -0.03em; }
.srv-banner { height: 96px; margin: 8px 8px 0; border-radius: 16px; background: var(--fill) center / cover no-repeat; flex: none; }
.srv-banner.preview { margin: 0; height: 120px; }
.plus-badge { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 12px; font-weight: 600; vertical-align: middle; }
.boost-step { gap: 10px; }
.boost-step h3 { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.boost-step.on { background: var(--tint); }
.boost-step.on h3, .boost-step.on h3 .icon { color: var(--accent-text); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ss-card.danger { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 45%, transparent); }
.ss-icon { flex-direction: row; align-items: flex-start; gap: 18px; }
.ss-roles-layout, .roles-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.ss-roles, .role-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.ss-role, .role-item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 12px; cursor: pointer; text-align: left; }
.ss-role:hover, .role-item:hover { background: var(--fill); }
.ss-role.on { background: var(--tint); font-weight: 600; }
.ss-role.sub { padding-left: 30px; }
.role-move { margin-left: auto; }
.ss-role-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ss-role-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ss-role-editor .segmented { max-width: none; }
.perm-grid { display: flex; flex-direction: column; gap: 4px; }
.perm-grid .check-row:has(select) { justify-content: space-between; }
.perm-group h4 { margin: 8px 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--sep); }
.perm-row:last-child { border-bottom: 0; }
.perm-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-row small { color: var(--text-2); font-size: 13px; }
.perm-row.warn b { color: var(--amber); }
.tri-switch { display: flex; flex: none; padding: 2px; gap: 2px; border-radius: 980px; background: var(--fill); }
.tri-switch button { width: 36px; height: 30px; border-radius: 980px; display: grid; place-items: center; color: var(--text-2); font-weight: 600; }
.tri-switch .deny.on { background: var(--red); color: #fff; }
.tri-switch .inherit.on { background: var(--card); color: var(--text); }
.tri-switch .allow.on { background: var(--green-dot); color: #fff; }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 980px; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--text); }
.chip-btn.on { background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); }
.chip-btn.static { cursor: default; }
.chip-btn.add { width: 30px; justify-content: center; padding: 0; }
.chip-x { color: var(--text-2); font-size: 15px; line-height: 1; padding-left: 2px; }
.chip-x:hover { color: var(--red); }
.ss-member { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; }
.ss-member:hover { background: var(--fill); }
.save-bar { position: sticky; bottom: 16px; margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 980px; background: var(--raised); box-shadow: var(--shadow); }
.save-bar span { flex: 1; font-weight: 600; }

/* legal pages */
.legal-body { overflow: auto; }
.legal { max-width: 860px; margin: 0 auto; padding: 40px 20px 80px; line-height: 1.65; font-size: 16px; }
.legal h1 { font-size: 32px; letter-spacing: -0.03em; margin: 8px 0 6px; }
.legal h2 { font-size: 20px; margin: 36px 0 10px; padding-top: 12px; border-top: 1px solid var(--sep); }
.legal p, .legal li { color: var(--text); margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal-top { font-size: 14px; }
.legal .legal-draft { background: var(--amber-fill); color: var(--amber); font-weight: 600; padding: 10px 14px; border-radius: 12px; }
.legal-table { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px; border-bottom: 1px solid var(--sep); }
.legal th { color: var(--text-2); font-weight: 600; }

/* medium widths: the members panel goes, the sidebar narrows */
@media (max-width: 1180px) {
  .layout { --rail-w: 216px; --list-w: 290px; --members-w: 224px; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .layout { grid-template-columns: 76px minmax(0, 1fr); }
  .resizer.rail-edge { display: none; }
  .appbar-brand { width: 44px; } .appbar-brand span { display: none; }
  .rail { padding: 6px 10px 10px; align-items: center; }
  .nav-new { width: 48px; padding: 0; font-size: 0; gap: 0; }
  .nav-item { width: 48px; justify-content: center; padding: 0; }
  .nav-label, .nav-group span, .nav-foot .legal-links, .nav-controls .icon-btn, .nav-item .badge { display: none; }
  .nav-group { padding: 14px 0 6px; justify-content: center; }
  .nav-foot .voice-box { flex-wrap: wrap; justify-content: center; padding: 8px; } .nav-foot .voice-info { display: none; }
}

/* phones: list and content are two screens; sheets instead of floating dialogs */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: clip; }
  .appbar { display: none; }
  .card-shell { grid-row: 1; grid-column: 1; margin: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); box-shadow: none !important; background: transparent; }
  .sidebar { border-right: 0; }
  .chat-head .icon-btn:not(.desk-only) { display: grid; }
  .chat-search { display: block; }
  .layout[data-pane="list"] .main, .layout[data-pane="main"] .sidebar { display: none; }
  .rail, .members, .desk-only, .user-panel, .legal-links, .resizer, .card-shell::after { display: none; }
  .phone-only { display: grid !important; }
  .main { border-left: 0; }
  .m-back { display: grid; margin-left: -8px; }
  .sb-head { height: 64px; }
  .sb-title { font-size: 30px; }
  .conv-row { padding: 10px 12px; }
  .conv-name { font-size: 16.5px; }
  .conv-preview { font-size: 15px; }
  .tabbar { display: flex; flex: none; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sep); background: var(--card); }
  .tabbar-item { flex: 1; position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
  .tabbar-item .icon { width: 24px; height: 24px; }
  .tabbar-item.on { color: var(--accent-text); }
  .tabbar-item .dot-badge { top: 2px; right: calc(50% - 24px); }
  .sidebar:has(.search:focus) .tabbar { display: none; }
  .top { height: 60px; padding: 0 16px 0 12px; }
  .top > .icon:first-child, .top .handle { display: none; }
  .friend-row .sb-name .handle { display: block; font-size: 13px; }
  .tabs { margin-left: 0; padding-left: 0; border-left: 0; }
  .tab { flex: none; }
  .pad { padding: 16px; }
  .segmented { margin: 12px 16px 4px; max-width: none; }
  .friend-row { flex-wrap: wrap; row-gap: 6px; }
  .friend-row .sb-text small { white-space: normal; }
  .intro { padding: 24px 16px 8px; }
  .day { margin: 18px 16px 8px; }
  .composer-wrap { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer .tool { display: none; }
  .composer.tools-open .tool { display: grid; }
  .tools-toggle { display: grid; }
  .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .bubble-col { max-width: 84%; }
  .tile { width: min(240px, 70vw); }
  .call-stage:not(.expanded):not(.voice-full) { max-height: 40vh; padding: 10px; gap: 10px; }
  .call-stage:not(.expanded):not(.voice-full) .tile { width: 168px; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: sheet-up 0.4s var(--ease); }
  .modal::before { content: ""; align-self: center; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-hover); }
  .modal.wide:has(> .ss) { height: 100dvh; max-height: none; border-radius: 0; }
  .modal.wide:has(> .ss)::before { display: none; }
  .popover { left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: auto; max-height: 60dvh; border-radius: 22px 22px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); animation: sheet-up 0.4s var(--ease); }
  .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .toasts { bottom: calc(env(safe-area-inset-bottom) + 88px); }
  .settings-body { padding: 4px 12px 40px; gap: 12px; }
  .settings-body > .stack, .settings-body > form, .set-card { padding: 22px 20px; border-radius: 18px; }
  .settings-body > .set-groups { padding: 0; border-radius: 0; }
  .profile-form .profile-preview { margin: -22px -20px 4px; }
  .profile-form .profile-preview .pc { border-radius: 18px 18px 0 0; }
  .profile-form .profile-preview .pc-head, .profile-form .profile-preview .pc-body { padding-left: 20px; padding-right: 20px; }
  .ss { grid-template-columns: 1fr; grid-template-rows: max-content minmax(0, 1fr); }
  .ss-nav { flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; scrollbar-width: none; border-bottom: 1px solid var(--sep); }
  .ss-server, .ss-group > span { display: none; }
  .ss-group { flex-direction: row; }
  .ss-link { white-space: nowrap; }
  .ss-pane { padding: 16px 12px 96px; }
  .ss-card { padding: 22px 20px; border-radius: 18px; }
  .ss-roles-layout, .roles-layout { grid-template-columns: 1fr; }
  .ss-roles, .role-list { position: static; flex-direction: row; flex-wrap: wrap; }
  .forum-bar { padding: 10px 16px; }
  .forum-list { padding: 8px 16px 20px; }
  .guide-tools { top: 36px; max-width: calc(100% - 16px); width: max-content; }
  .layout.nav[data-pane="main"] .main { animation: push-in 0.42s var(--ease); }
  .layout.nav[data-pane="list"] .sidebar { animation: back-in 0.42s var(--ease); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes push-in { from { transform: translateX(100%); } }
@keyframes back-in { from { transform: translateX(-24%); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

:root:not([data-theme="light"]) .ss-card { border: 1px solid var(--sep); }
@media (max-width: 760px) {
  :root:not([data-theme="light"]) .settings-body > .stack, :root:not([data-theme="light"]) .settings-body > form, :root:not([data-theme="light"]) .set-card { border: 1px solid var(--sep); }
  :root:not([data-theme="light"]) .settings-body > .set-groups { border: 0; }
}
/* Settings sit inside the big shell card: flat sections split by hairlines, never cards in the card (deldown design).
   Phones drop the big card, so the sections stay cards there. */
@media (min-width: 761px) {
  .settings-view { background: var(--card); }
  .settings-body > .stack, .settings-body > form, .settings-body .set-card { background: none; border-radius: 0; padding: 0; }
  .settings-body > .set-groups { gap: 0; }
  .settings-body > .set-groups > .set-card { padding: 28px 0; }
  .settings-body > .set-groups > .set-card:first-child { padding-top: 8px; }
  .settings-body > .set-groups > .set-card + .set-card { border-top: 1px solid var(--sep); }
  .profile-form .profile-preview { margin: 0 0 4px; }
  .profile-form .profile-preview .pc { border-radius: 22px; }
  .profile-form .profile-preview .pc-head, .profile-form .profile-preview .pc-body { padding-left: 24px; padding-right: 24px; }
}
.composer.disabled .composer-input::placeholder { color: var(--text-2); }
.btn.plain.friend-decline { color: var(--text-2); }
@media (max-width: 760px) {
  .scroll, .sb-list, .settings-view, .members, .popover, .modal { scrollbar-width: none; }
  .scroll::-webkit-scrollbar, .sb-list::-webkit-scrollbar, .settings-view::-webkit-scrollbar { display: none; }
  .settings-lead { padding: 16px 12px 0; }
  .settings-view > .settings-body:first-child { padding-top: 16px; }
  .btn.small, .row-actions .btn.small { height: 44px; padding: 0 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .top .icon-btn, .composer .icon-btn { width: 44px; height: 44px; }
  .pc-banner { height: 88px; }
}
.icon-more { stroke-width: 3.2; }
.top .icon-btn { color: var(--text-2); }
.check-row.big small { display: block; }
@media (max-width: 760px) {
  .icon-btn.round { width: 44px; height: 44px; }
  .tabbar-item { font-size: 12px; }
  .msg-meta, .reply-line { font-size: 12.5px; }
  .friend-row .sb-text small, .conv-time { font-size: 13px; }
}
.composer { box-shadow: inset 0 0 0 1px var(--control-line); }
.check-row.big small { margin-top: 2px; }
@media (max-width: 760px) {
  .friend-row .sb-text { flex: 1 1 calc(100% - 60px); }
  .friend-row .row-actions { margin-left: 52px; }
  .layout[data-pane="list"] .conv-row.active, .layout[data-pane="list"] .settings-nav .sb-item.active { background: none; font-weight: inherit; }
  .layout[data-pane="list"] .settings-nav .sb-item.active .icon { color: var(--text-2); }
  .ch-row, .sb-item { min-height: 44px; }
}
.composer { box-shadow: inset 0 0 0 1px var(--control-line); }
.seg.on { box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--sep); }
:root:not([data-theme="light"]) .seg.on { background: var(--fill-hover); }
.check-row.big { margin: 0; }
.check-row.big > div { display: flex; flex-direction: column; gap: 2px; }
.check-row.big { padding: 14px 4px 2px; }
.check-row.big:has(+ :not(.check-row.big)) { padding-bottom: 14px; border-bottom: 1px solid var(--sep); }
.profile-form .profile-preview { margin-bottom: -10px; }
:root:not([data-theme="light"]) .tile { box-shadow: inset 0 0 0 1px var(--sep); }
:root:not([data-theme="light"]) .tile.person.speaking { box-shadow: 0 0 0 3px var(--green-dot); }
@media (max-width: 760px) {
  .head-text small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
  .reply-line { font-size: 14px; }
  .settings-back { min-height: 44px; font-size: 16px; }
}
/* narrow call bars keep their words: a short label under each icon */
@container (max-width: 860px) {
  .cbtn-label { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.2; }
  .cbtn { flex-direction: column; gap: 2px; height: 56px; min-width: 56px; padding: 0 8px; border-radius: 16px; }
  .cbtn-group .cbtn:first-child { border-radius: 16px 0 0 16px; }
  .cbtn-group .cbtn.chev { border-radius: 0 16px 16px 0; min-width: 44px; height: 56px; }
}
.pc-body { gap: 2px; }
.pc-body h2 + .pc-handle { margin-top: -2px; }
.range { height: 24px; }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--fill-hover); }
:root:not([data-theme="light"]) .tile { background: var(--fill); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16); }
@container (max-width: 860px) { .cbtn-label { font-size: 12.5px; } }
@media (max-width: 760px) { .tabbar-item { font-size: 12.5px; } }
