/* ==========================================================================
   Vorzyx Chat stylesheet — themes, layout, components. RTL-first via logical props.
   ========================================================================== */

/* ---------- theme tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #100f1f; --bg2: #181731; --panel: #17162b; --panel2: #201e38; --panel3: #2a2848;
  --line: #2b2947; --text: #ecebf7; --muted: #9a97b8; --faint: #6d6a8c;
  --accent: #7c5cff; --accent2: #4fb3ff; --on-accent: #fff; --accent-text: #fff;
  --ok: #3fd18b; --warn: #ffb547; --danger: #ff5d6c;
  --bubble: #1f1d36; --mine: #2b2559; --mention: rgba(255, 181, 71, .12);
  --topbar-bg: #14122b; --appbar-bg: #121025; --hover: rgba(255, 255, 255, .055);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(124, 92, 255, .07), transparent 60%), radial-gradient(700px 500px at 0 100%, rgba(79, 179, 255, .05), transparent 60%);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f4fb; --bg2: #f7f7fd; --panel: #ffffff; --panel2: #f1f2f9; --panel3: #e7e8f3;
  --line: #e3e4f0; --text: #1b1a2e; --muted: #6b6a86; --faint: #85849e;
  --accent: #6a4cf0; --accent2: #1f8de6; --on-accent: #fff; --accent-text: #fff;
  --ok: #1fa86a; --warn: #d98a00; --danger: #e5384a;
  --bubble: #ffffff; --mine: #ece8ff; --mention: rgba(255, 170, 0, .13);
  --topbar-bg: #ffffff; --appbar-bg: #f8f8fd; --hover: rgba(20, 20, 60, .05);
  --shadow: 0 18px 50px rgba(30, 30, 80, .16); --shadow-sm: 0 4px 14px rgba(30, 30, 80, .08);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(106, 76, 240, .06), transparent 60%);
  color-scheme: light;
}
[data-theme="ocean"] {
  --bg: #071b27; --bg2: #0b2534; --panel: #0b2a3d; --panel2: #10364d; --panel3: #16425c;
  --line: #17465f; --text: #e3f4fb; --muted: #86aec2; --faint: #5d8599;
  --accent: #22b8cf; --accent2: #3b82f6; --on-accent: #04252c; --accent-text: #04252c; /* dark text: white on this cyan was only ~2.4:1 */
  --ok: #3fd18b; --warn: #ffc15e; --danger: #ff6b7a;
  --bubble: #0f3247; --mine: #114a5e; --mention: rgba(255, 193, 94, .12);
  --topbar-bg: #0b2a3d; --appbar-bg: #092333; --hover: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(34, 184, 207, .08), transparent 60%);
  color-scheme: dark;
}
[data-theme="forest"] {
  --bg: #0b1a14; --bg2: #0f2219; --panel: #10261d; --panel2: #163226; --panel3: #1c3d2e;
  --line: #1f4232; --text: #e6f4ec; --muted: #8fb3a0; --faint: #628571;
  --accent: #34c27a; --accent2: #a3d65c; --on-accent: #06210f; --accent-text: #06210f;
  --ok: #4ade80; --warn: #fbbf24; --danger: #f87171;
  --bubble: #143024; --mine: #1a4431; --mention: rgba(251, 191, 36, .12);
  --topbar-bg: #10261d; --appbar-bg: #0d2018; --hover: rgba(255, 255, 255, .055);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(52, 194, 122, .07), transparent 60%);
  color-scheme: dark;
}
[data-theme="sunset"] {
  --bg: #1c0d16; --bg2: #24111c; --panel: #2a1420; --panel2: #361a29; --panel3: #432034;
  --line: #4a2437; --text: #fbe9ef; --muted: #c49aab; --faint: #8e6878;
  --accent: #ff6b6b; --accent2: #ffb347; --on-accent: #2b0707; --accent-text: #2b0707; /* dark text: white on this coral was only ~2.8:1 */
  --ok: #4ade80; --warn: #ffcf5c; --danger: #ff5470;
  --bubble: #331826; --mine: #4a1f33; --mention: rgba(255, 207, 92, .12);
  --topbar-bg: #2a1420; --appbar-bg: #22101a; --hover: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(255, 107, 107, .08), transparent 60%), radial-gradient(700px 500px at 0 100%, rgba(255, 179, 71, .05), transparent 60%);
  color-scheme: dark;
}
[data-theme="rose"] {
  --bg: #fff0f5; --bg2: #fff7fa; --panel: #ffffff; --panel2: #fff5f8; --panel3: #fde6ee;
  --line: #f6d5e1; --text: #3a1f2b; --muted: #9a6b7e; --faint: #a77a8c;
  --accent: #e84a8a; --accent2: #ff8a65; --on-accent: #fff; --accent-text: #fff;
  --ok: #18a368; --warn: #d97706; --danger: #dc2f4a;
  --bubble: #ffffff; --mine: #ffe1ec; --mention: rgba(255, 170, 0, .14);
  --topbar-bg: #fff5f8; --appbar-bg: #fff8fb; --hover: rgba(160, 30, 80, .06);
  --shadow: 0 18px 50px rgba(120, 30, 70, .14); --shadow-sm: 0 4px 14px rgba(120, 30, 70, .08);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(232, 74, 138, .07), transparent 60%);
  color-scheme: light;
}
[data-theme="grape"] {
  --bg: #140a24; --bg2: #1a0e2e; --panel: #1d1033; --panel2: #271644; --panel3: #321c56;
  --line: #36205a; --text: #f1e9ff; --muted: #a993cc; --faint: #7b6699;
  --accent: #b057ff; --accent2: #ff5fd2; --on-accent: #fff; --accent-text: #fff;
  --ok: #4ade80; --warn: #ffc857; --danger: #ff5c7c;
  --bubble: #241441; --mine: #35195e; --mention: rgba(255, 200, 87, .12);
  --topbar-bg: #1d1033; --appbar-bg: #180d2b; --hover: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3);
  --logbg: radial-gradient(900px 500px at 100% 0, rgba(176, 87, 255, .1), transparent 60%), radial-gradient(700px 500px at 0 100%, rgba(255, 95, 210, .06), transparent 60%);
  color-scheme: dark;
}
[data-theme="mono"] {
  --bg: #0f0f11; --bg2: #151518; --panel: #18181b; --panel2: #222226; --panel3: #2c2c31;
  --line: #2e2e33; --text: #ededf0; --muted: #9a9aa3; --faint: #6b6b73;
  --accent: #e4e4e7; --accent2: #a1a1aa; --on-accent: #111113; --accent-text: #111113;
  --ok: #4ade80; --warn: #facc15; --danger: #f87171;
  --bubble: #1f1f23; --mine: #2c2c31; --mention: rgba(250, 204, 21, .1);
  --topbar-bg: #18181b; --appbar-bg: #141416; --hover: rgba(255, 255, 255, .06);
  --shadow: 0 18px 50px rgba(0, 0, 0, .5); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3);
  --logbg: none;
  color-scheme: dark;
}
/* layout tokens derived for every colour theme (the default "sky" theme sets its own below) */
:root {
  --bar-grad: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, var(--topbar-bg)), var(--topbar-bg));
  --bar-text: var(--text); --bar-hover: var(--hover); --bar-badge-ring: var(--topbar-bg);
  --tabs-grad: linear-gradient(180deg, var(--panel2), var(--panel3)); --tab-text: var(--muted);
  --log-bg: var(--bg); --row-bg: transparent; --row-alt: color-mix(in srgb, var(--panel) 55%, transparent); --row-hover: var(--hover); --row-line: color-mix(in srgb, var(--line) 55%, transparent);
  --av-ring: color-mix(in srgb, var(--accent) 55%, transparent); --welcome-bg: color-mix(in srgb, var(--accent) 12%, var(--panel));
  --composer-bg: var(--panel); --input-bg: var(--bg2); --input-line: var(--line);
  --orange: #ff8a1f; --send-grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --topic-grad: linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, #7a2f80), color-mix(in srgb, var(--accent2) 66%, #101a3a)); /* both ends dark enough for white text */
  --card-grad: linear-gradient(160deg, var(--panel3), var(--panel2)); --card-text: var(--text); --card-btn: var(--hover); --card-btn-hover: var(--panel); --card-ic: var(--accent);
  --land-bg: var(--bg); --land-panel: linear-gradient(160deg, color-mix(in srgb, var(--accent) 75%, var(--bg)), color-mix(in srgb, var(--accent) 30%, var(--bg)));
  --toggle-bg: var(--bg2); --btn-grad: linear-gradient(90deg, var(--accent2), var(--accent));
}
[data-theme="mono"] { --topic-grad: linear-gradient(90deg, #45454d, #2a2a30); --male: #5f7590; --female: #8f6680; --brand-grad: linear-gradient(135deg, #52525b, #3f3f46); }
/* default theme ("sky"): bright blue bars, white panels, orange accents */
[data-theme="sky"], :root:not([data-theme]) {
  --bg: #e9f0fa; --bg2: #f4f7fc; --panel: #ffffff; --panel2: #f2f6fc; --panel3: #e4ecf8;
  --line: #dce6f4; --text: #24324a; --muted: #687892; --faint: #7f8da4;
  --accent: #3670c4; --accent2: #2f8be6; --on-accent: #fff; --accent-text: #fff;
  --ok: #22b46e; --warn: #f0a020; --danger: #e5484d;
  --bubble: #ffffff; --mine: #eaf2fe; --mention: rgba(255, 150, 40, .12);
  --topbar-bg: #4f86d6; --appbar-bg: #ffffff; --hover: rgba(54, 112, 196, .07);
  --shadow: 0 18px 50px rgba(30, 60, 120, .18); --shadow-sm: 0 4px 14px rgba(30, 60, 120, .1);
  --logbg: none;
  --bar-grad: linear-gradient(180deg, #b7d2f7 0%, #7ea7e3 22%, #6091d9 48%, #3670c4 100%);
  --bar-text: #fff; --bar-hover: rgba(255, 255, 255, .16); --bar-badge-ring: #3d76c8;
  --tabs-grad: linear-gradient(180deg, #e6effc, #cfdff6); --tab-text: #24324a;
  --log-bg: #ffffff; --row-bg: #ffffff; --row-alt: #f6f9fe; --row-hover: #eef4fd; --row-line: #edf2f9;
  --av-ring: #8db4ea; --welcome-bg: linear-gradient(135deg, rgba(47, 111, 228, .09), rgba(192, 106, 255, .09));
  --composer-bg: #f3f6fb; --input-bg: #fbfcfe; --input-line: #d6e1f0;
  --orange: #ff8a1f; --send-grad: linear-gradient(135deg, #ffb24a, #ff7a14);
  --topic-grad: linear-gradient(90deg, #c4479d 0%, #9b56c9 40%, #5c87da 100%);
  --card-grad: linear-gradient(160deg, #1f3a73, #2b5aa8); --card-text: #fff; --card-btn: rgba(255, 255, 255, .12); --card-btn-hover: rgba(255, 255, 255, .22); --card-ic: #8fc1ff;
  --land-bg: #eef3fb; --land-panel: linear-gradient(160deg, #6a9de3 0%, #4a7fd0 40%, #3463b3 75%, #2b4f96 100%);
  --toggle-bg: #edf2fa; --btn-grad: linear-gradient(90deg, #6f9fe3, #3670c4);
  color-scheme: light;
}
:root {
  --radius: 14px; --radius-sm: 10px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --brand-grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3fa9f5 100%);
  --top-h: 50px; --bot-h: 48px; --side-w: 300px;
  --font: "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", Roboto, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 40px; cursor: pointer; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
::placeholder { color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
svg { width: 22px; height: 22px; flex: none; }
.ic { width: 22px; height: 22px; flex: none; }
.ic-img { width: 22px; height: 22px; object-fit: contain; flex: none; }
[dir=rtl] .flip-rtl, [dir=rtl] .send-btn .ic, [dir=rtl] .pm-form .send .ic, [dir=rtl] .reply-bar > .ic { transform: scaleX(-1); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--panel2); font-weight: 600; white-space: nowrap; line-height: 1.3;
  transition: transform .08s, border-color .15s, background .15s, filter .15s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: var(--on-accent); border: 0; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.warn { color: color-mix(in srgb, var(--warn) 72%, var(--text)); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger-fill { background: color-mix(in srgb, var(--danger) 82%, #000); color: #fff; border: 0; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 12px 18px; font-size: 16px; }
.btn:disabled, .btn.loading { opacity: .65; }
.btn.loading { pointer-events: none; position: relative; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 0; background: transparent; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover, .icon-btn.pop-open { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn.send { color: var(--accent); }
.badge {
  position: absolute; inset-block-start: 2px; inset-inline-end: 1px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-style: normal;
  box-shadow: 0 0 0 2px var(--topbar-bg); pointer-events: none;
}
.count { position: absolute; inset-block-end: 1px; inset-inline-end: 0; font-size: 10.5px; font-weight: 800; color: var(--text); background: var(--panel3); border-radius: 8px; padding: 0 5px; line-height: 15px; }
.pill { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip .ic { width: 15px; height: 15px; }
.chip-mini { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--panel3); color: var(--muted); margin-inline-start: 6px; }
.spinner { display: inline-block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-wrap { display: grid; place-items: center; padding: 30px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; color: var(--muted); text-align: center; }
.empty .ic { width: 38px; height: 38px; opacity: .5; }
.empty p { margin: 0; font-size: 14px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field, .auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field-hint { color: var(--faint); font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.inline, .inline-row { display: flex; gap: 8px; align-items: flex-end; }
.inline-row input { flex: 1; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; }
.toggle-text b { font-weight: 600; font-size: 14px; }
.toggle-text small { color: var(--muted); font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--panel3); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; inset-block-start: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir=rtl] .switch input:checked + span::before { transform: translateX(-20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.seg { display: inline-flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.warn-box { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); font-size: 13.5px; }

/* ---------- status dots / avatars / names ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--panel3); display: block; }
.av-wrap { position: relative; display: inline-block; flex: none; line-height: 0; }
.st-dot { position: absolute; inset-block-end: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: var(--faint); z-index: 5; } /* always above picture frames / auras / effects */
.st-dot.inline { position: static; display: inline-block; border: 0; width: 9px; height: 9px; }
.st-dot.st1 { background: var(--ok); } .st-dot.st2 { background: var(--warn); } .st-dot.st3 { background: var(--danger); } .st-dot.st0 { background: var(--faint); }
.rank-ic { width: 17px; height: 17px; flex: none; vertical-align: -3px; }
/* own rank picture (memberships add-on, VorzyxChat.addRankIcon): same box as the rank icon, the picture kept whole */
.rank-ic.rank-own { object-fit: contain; border-radius: 3px; }
/* status message: ready-made texts + how long it stays */
.mood-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-row select { flex: 1 1 200px; min-width: 0; }
.uname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uname.link { cursor: pointer; }
.uname.link:hover { text-decoration: underline; }
:root { --r-owner: #ff5f87; --r-super: #ff8a4c; --r-admin: #f5a524; --r-mod: #2fc07e; --r-vip: #b77cff; --r-bot: #3aa8f0; }
/* light themes: deeper rank colours so names stay readable on white rows */
[data-theme="sky"], :root:not([data-theme]), [data-theme="light"], [data-theme="rose"] { --r-owner: #d42a63; --r-super: #d65a1c; --r-admin: #b87300; --r-mod: #14905a; --r-vip: #8a4fe0; --r-bot: #1a7fc4; }
.r-owner { color: var(--r-owner); } .r-super { color: var(--r-super); } .r-admin { color: var(--r-admin); } .r-mod { color: var(--r-mod); } .r-vip { color: var(--r-vip); } .r-bot { color: var(--r-bot); } .r-guest { color: var(--muted); }
/* a name keeps its rank colour wherever it is, even when clickable (.link) or in a join line (.jl-name); a member's own
   colour (.has-uc, later in this file) still wins */
.uname.r-owner { color: var(--r-owner); } .uname.r-super { color: var(--r-super); } .uname.r-admin { color: var(--r-admin); } .uname.r-mod { color: var(--r-mod); } .uname.r-vip { color: var(--r-vip); } .uname.r-bot { color: var(--r-bot); } .uname.r-guest { color: var(--muted); }
.verified-ic { width: 16px; height: 16px; color: var(--accent2); }
.ubadges { display: inline-flex; gap: 3px; align-items: center; }
.ubadges img { width: 16px; height: 16px; }
.flag { font-size: 15px; line-height: 1; }

/* ==========================================================================
   Chat app layout — top bar / side panel (start side) / chat / bottom bar
   ========================================================================== */
/* the chat page itself never scrolls: on iOS Safari a closed keyboard or a too-tall moment could leave the whole page
   shifted up (top bar cut, empty strip under the bottom bar); fixed + inset 0 pins it to the visible viewport */
.vc-chat { overflow: hidden; position: fixed; inset: 0; overscroll-behavior: none; }
.app {
  height: 100vh; height: 100dvh; display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr) var(--bot-h);
  grid-template-areas: "top top" "side main" "bot bot";
}
body.panel-hidden .app { grid-template-columns: 0 minmax(0, 1fr); }
body.panel-hidden .sidepanel { display: none; }
.grow { flex: 1; }

/* ---------- shared bar buttons (top + bottom bars) ---------- */
.bar-btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 54px; height: 100%; padding: 3px 6px 2px; border: 0; background: transparent; color: var(--bar-text);
  font-size: 11.5px; font-weight: 700; line-height: 1.15; white-space: nowrap; transition: background .15s;
}
.bar-btn:hover, .bar-btn.pop-open, .bar-btn.active { background: var(--bar-hover); }
.bar-btn .bar-ic { position: relative; display: grid; place-items: center; height: 24px; }
.bar-btn .ic, .bar-btn .ic-img { width: 22px; height: 22px; }
.bar-label { max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
.bar-btn .badge { inset-block-start: -5px; inset-inline-end: -11px; box-shadow: none; border: 2px solid var(--bar-badge-ring); line-height: 14px; }
.bar-btn .count { position: absolute; inset-block-start: -5px; inset-inline-end: -14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 800; text-align: center; font-style: normal; border: 2px solid var(--bar-badge-ring); line-height: 14px; }

/* ---------- top bar ---------- */
.topbar {
  grid-area: top; position: relative; z-index: 65; display: flex; align-items: stretch; min-width: 0; padding: 0 4px;
  background: var(--bar-grad); color: var(--bar-text); box-shadow: 0 2px 10px rgba(20, 50, 100, .18);
}
.top-buttons { display: flex; align-items: stretch; min-width: 0; }
.top-btn.ovf { display: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.topbar .brand { padding: 0 8px; }
.topbar .brand img { width: auto; height: 38px; max-width: 170px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); }
.avatar-btn { position: relative; flex: none; align-self: center; margin: 0 6px; padding: 0; border: 0; background: none; border-radius: 50%; line-height: 0; }
.avatar-btn img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 2px 8px rgba(0, 0, 0, .25); }
.avatar-btn .st-dot { border-color: #fff; }
.drawer-btn { flex: none; }
.only-mobile { display: none !important; }

/* ---------- menu dropdown (#appbar) ---------- */
.appbar {
  position: fixed; z-index: 70; inset-block-start: calc(var(--top-h) + 4px); inset-inline-end: 6px; width: 300px; max-width: calc(100vw - 12px);
  max-height: calc(100dvh - var(--top-h) - var(--bot-h) - 12px); overflow-y: auto; display: flex; flex-direction: column;
  background: var(--panel); color: var(--text); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line);
  visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .15s, transform .15s, visibility 0s .15s;
}
body.drawer-open .appbar { visibility: visible; opacity: 1; transform: none; transition: opacity .15s, transform .15s; }
.ab-room { display: flex; align-items: center; gap: 4px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); }
.room-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: transparent; border-radius: 12px; text-align: start; color: var(--text); }
.room-title:hover { background: var(--hover); }
.room-ic { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--panel2); }
.room-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.room-txt small { color: var(--muted); font-size: 12px; }
.room-txt strong { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-lock { width: 15px; height: 15px; color: var(--muted); }
.ab-me { margin: 8px; padding: 12px; border-radius: 14px; background: var(--card-grad); color: var(--card-text); box-shadow: var(--shadow-sm); }
.ab-me-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ab-me-head .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.ab-me-txt { min-width: 0; display: flex; flex-direction: column; }
.ab-me-txt .uname { font-size: 16px; }
.ab-me-txt small { display: flex; align-items: center; gap: 4px; opacity: .85; font-size: 12.5px; }
.ab-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ab-quick .ab-item { flex-direction: column; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; background: var(--card-btn); color: inherit; font-size: 11.5px; font-weight: 700; }
.ab-quick .ab-item:hover { background: var(--card-btn-hover); }
.ab-quick .ab-ic { width: auto; height: 24px; color: var(--card-ic); }
.appbar-items { display: flex; flex-direction: column; padding: 2px 6px 8px; }
.ab-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); font-size: 15px; font-weight: 600; text-align: start; transition: background .12s;
}
.ab-item:hover { background: var(--hover); text-decoration: none; }
.ab-item.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.ab-ic { position: relative; display: grid; place-items: center; width: 26px; height: 26px; flex: none; color: var(--accent); }
.ab-ic .ic, .ab-ic .ic-img { width: 22px; height: 22px; }
.ab-ic .badge { inset-block-start: -6px; inset-inline-end: -8px; box-shadow: 0 0 0 2px var(--panel); }
.ab-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-chev { width: 16px; height: 16px; color: var(--faint); }
.ab-quick .ab-label { flex: none; max-width: 100%; text-align: center; }
.appbar-brand { display: none; }

/* ---------- side panel ---------- */
.sidepanel { grid-area: side; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); border-inline-end: 1px solid var(--line); z-index: 25; }
.sp-top { display: flex; align-items: stretch; height: 40px; flex: none; background: var(--tabs-grad); border-bottom: 1px solid var(--line); }
.sp-tabs { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 50px; flex: 0 0 auto; padding: 2px 6px 0;
  border: 0; background: transparent; color: var(--tab-text); font-size: 11px; font-weight: 700; line-height: 1.1;
}
.sp-tab .bar-ic { position: relative; display: grid; place-items: center; height: 20px; }
.sp-tab .ic { width: 18px; height: 18px; }
.sp-tab:hover { background: var(--hover); }
.sp-tab.active { background: color-mix(in srgb, var(--panel) 55%, transparent); color: var(--accent); }
.sp-tab.active::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: 3px; background: var(--accent); }
.sp-tab .badge { inset-block-start: -6px; inset-inline-end: -10px; box-shadow: 0 0 0 2px var(--panel); }
.sp-tab-label { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-close { display: grid; place-items: center; width: 38px; flex: none; border: 0; background: transparent; color: var(--text); margin-inline-start: auto; }
.sp-close .ic { width: 16px; height: 16px; }
.sp-close:hover { background: var(--hover); }
.sp-head { display: none; }
.sp-body { flex: 1; min-height: 0; position: relative; }
.sp-box { position: absolute; inset: 0; overflow-y: auto; padding: 10px 10px 16px; }
.welcome-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; margin-bottom: 6px; border-radius: 12px; background: var(--welcome-bg); }
.wc-line { display: flex; align-items: center; gap: 6px; font-size: 15px; flex-wrap: wrap; }
.wc-line b { font-weight: 800; }
.wc-line .rank-ic { width: 20px; height: 20px; }
.wc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.wc-chip .ic { width: 15px; height: 15px; color: var(--orange); }
.search-wrap { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; padding: 0 10px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); }
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap .ic { width: 17px; height: 17px; color: var(--faint); }
.search-wrap input { border: 0; background: transparent; padding: 8px 0; box-shadow: none !important; }
.list-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 6px; font-size: 14px; font-weight: 800; color: var(--text); }
.list-group span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-group b { font-size: 13px; color: var(--muted); font-weight: 700; }
.list-group.off { padding-top: 16px; }
.ulist { display: flex; flex-direction: column; gap: 4px; }
/* user rows keep the classic order (rank, avatar, name … gender, flag) in both directions */
.urow { direction: ltr; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 50px; padding: 5px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; color: var(--text); transition: background .12s; }
.urow:hover { background: var(--hover); }
.urow.ignored { opacity: .45; }
.urow.self { background: var(--row-alt); border-color: var(--line); }
.urow.off .avatar { filter: grayscale(.85); opacity: .75; }
.urow.off .uname { opacity: .7; }
.urow-rank { width: 20px; display: grid; place-items: center; flex: none; }
.urow-rank .rank-ic { width: 20px; height: 20px; }
.urow .avatar { width: 38px; height: 38px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.urow-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.urow-name { display: flex; align-items: center; gap: 3px; min-width: 0; font-size: 14px; }
.urow-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.urow-room { display: inline-flex; align-items: center; gap: 3px; }
.urow-room .ic { width: 12px; height: 12px; }
.urow-end { display: flex; align-items: center; gap: 4px; flex: none; }
.sex-ic { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; }
.sex-ic .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.sex-ic.s1 { background: var(--male, #4c9be8); } .sex-ic.s2 { background: var(--female, #e957a5); }
.urow .flag { font-size: 15px; }
.muted-ic { width: 16px; height: 16px; color: var(--danger); }
.presence { font-size: 11px; color: var(--faint); }
.presence.on { color: var(--ok); font-weight: 700; }
.panel-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; }
.room-list { display: flex; flex-direction: column; gap: 0; }
.room-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: start; color: var(--text); }
.room-card:hover { background: var(--hover); }
.room-card.active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.room-card-ic { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--panel3); }
.room-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.room-card-info b { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; }
.room-card-info b .ic.tiny { width: 13px; height: 13px; color: var(--muted); }
.room-card-info small { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.room-count { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: var(--panel3); color: var(--muted); font-size: 12px; font-weight: 700; flex: none; }
.room-count .ic { width: 13px; height: 13px; }
.room-count.live { color: #04230f; background: var(--ok); }
.conv-list { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.conv { display: flex; align-items: center; border-radius: 12px; }
.conv:hover { background: var(--hover); }
.conv-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: transparent; text-align: start; color: var(--text); }
.conv-main .avatar { width: 42px; height: 42px; }
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-top time { font-size: 11px; color: var(--faint); flex: none; }
.conv-info small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conv.unread .conv-info small { color: var(--text); font-weight: 600; }
.conv-del { opacity: 0; margin-inline-end: 4px; }
.conv:hover .conv-del { opacity: 1; }

/* ---------- chat main ---------- */
.chat-main { grid-area: main; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--log-bg); }
.chat-log { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 0 8px; }
.boot { display: grid; place-items: center; height: 100%; }
.boot-error { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; color: var(--muted); text-align: center; }
.boot-error .ic { width: 40px; height: 40px; color: var(--danger); }
.log-intro { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 6px; }
.room-hero { display: flex; align-items: center; gap: 12px; padding: 2px; }
.room-hero img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: var(--panel2); box-shadow: var(--shadow-sm); }
.room-hero h2 { margin: 0; font-size: 19px; font-weight: 800; }
.room-hero p { margin: 0; color: var(--muted); font-size: 13.5px; }
.room-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.room-note .ic { width: 19px; height: 19px; color: var(--accent); margin-top: 1px; }
.room-note.welcome { background: var(--welcome-bg); }
.room-note.warn .ic { color: var(--warn); }

/* day / unread separators */
.day-sep, .unread-sep { display: flex; align-items: center; gap: 12px; margin: 10px 14px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.day-sep::before, .day-sep::after, .unread-sep::before, .unread-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-sep span { padding: 2px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.day-sep.sm { margin: 10px 0 6px; font-size: 11px; }
.unread-sep { color: var(--danger); }
.unread-sep::before, .unread-sep::after { background: color-mix(in srgb, var(--danger) 55%, transparent); }

/* system lines */
.msg-sys { display: flex; justify-content: center; margin: 6px 10px; }
.sys-pill { display: inline-flex; align-items: center; gap: 7px; max-width: 92%; padding: 3px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.sys-pill .ic { width: 14px; height: 14px; flex: none; }
.sys-pill time { color: var(--faint); font-size: 11px; flex: none; white-space: nowrap; } /* never squeezed: on an iPhone the text pushed the time out of the pill */
.sys-pill > span { min-width: 0; }
.msg-sys.t4 .sys-pill .ic { color: var(--ok); }
.msg-sys.t5 .sys-pill .ic { color: var(--faint); }
.msg-sys.custom { display: block; }
.sys-card { max-width: 640px; margin: 4px auto; }

/* messages: full-width rows, avatar on the left, time and menu on the right (classic order in both directions) */
.msg {
  direction: ltr; position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; column-gap: 10px;
  padding: 9px 12px 9px 10px; background: var(--row-bg); border-bottom: 1px solid var(--row-line);
}
.msg:nth-child(even of .msg, .msg-sys.jl-row) { background: var(--row-alt); }
.msg:hover { background: var(--row-hover); }
.msg.cont { padding-top: 2px; }
.msg.cont .msg-av { visibility: hidden; height: 0; }
.msg.cont .msg-head { display: none; }
.msg-av { border: 0; padding: 0; background: none; align-self: start; line-height: 0; border-radius: 50%; }
.msg-av .avatar { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--av-ring); transition: transform .15s; }
.msg-av:hover .avatar { transform: scale(1.05); }
.msg-main { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg-head { display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; min-height: 24px; margin-bottom: 2px; font-size: 15px; }
.msg-head .rank-ic { width: 16px; height: 16px; }
.msg-name { font-size: 15.5px; }
.msg-meta { display: flex; align-items: flex-start; gap: 4px; padding-top: 3px; color: var(--faint); font-size: 11px; white-space: nowrap; }
.msg-meta time { direction: ltr; line-height: 20px; }
.msg-more { display: grid; place-items: center; width: 24px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); }
.msg-more .ic { width: 15px; height: 15px; }
.msg-more:hover, .msg-more.pop-open { background: var(--hover); color: var(--text); }
.msg-bubble { --msg-color: inherit; position: relative; max-width: 100%; padding: 0; border-radius: 0; background: transparent; overflow-wrap: anywhere; word-break: break-word; }
.msg-bubble[class*="bub-"] { padding: 6px 12px; border-radius: 4px 14px 14px 14px; }
.msg.mention { box-shadow: inset 3px 0 0 var(--orange); }
.msg.mention .msg-bubble:not([class*="bub-"]) { background: transparent; } /* a bubble colour the member chose stays */
.msg-text { display: inline-block; max-width: 100%; white-space: pre-wrap; text-align: left; unicode-bidi: plaintext; color: var(--msg-color, inherit); font-size: calc(15px * var(--mz, 1)); }
.msg-bubble.tc .msg-text { color: var(--msg-color); }
.msg-bubble.tb .msg-text { font-weight: 700; }
.msg-bubble.ti .msg-text { font-style: italic; }
.msg-text.big-emo { font-size: calc(34px * var(--mz, 1)); line-height: 1.2; }
.msg-text.big-emo .emo { width: 44px; height: 44px; }
.msg-bubble.action { display: flex; gap: 8px; font-style: italic; color: var(--muted); }
.act-star { color: var(--accent); font-style: normal; }
.msg-bubble.custom { padding: 0; max-width: min(100%, 560px); }
.reply-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 0 0 6px; padding: 5px 10px; border: 0; border-inline-start: 3px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); text-align: start; font-size: 12.5px; color: var(--text); }
.reply-quote b { color: var(--accent); font-size: 12px; }
.reply-quote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.msg.flash { animation: flash 1.4s ease-out; }
.msg.removing { opacity: 0; transition: .2s; }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* rich content */
.emo { width: 22px; height: 22px; vertical-align: -5px; display: inline-block; object-fit: contain; }
.msg-text .emo.st[style], .pm-text .emo.st[style] { width: var(--es); height: var(--es); vertical-align: middle; } /* owner sticker size per category */
.link { color: var(--accent2); overflow-wrap: anywhere; }
.mention-tag { color: var(--accent); font-weight: 700; cursor: pointer; background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 0 4px; border-radius: 5px; }
.mention-tag.me { color: #1a1300; background: var(--warn); }
.inline-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.media-thumb { border: 0; padding: 0; background: var(--panel2); border-radius: 10px; overflow: hidden; line-height: 0; max-width: 100%; }
.media-thumb img { width: 160px; height: 130px; max-width: 100%; object-fit: cover; display: block; } /* one size for every picture in a message */

/* hover tools (reply / mention) */
.msg-tools {
  position: absolute; inset-block-start: 4px; inset-inline-end: 84px; display: none; gap: 2px; padding: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm); z-index: 2;
}
.msg-tools button { display: grid; place-items: center; width: 28px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.msg-tools button:hover { background: var(--hover); color: var(--text); }
.msg-tools .ic { width: 16px; height: 16px; }
.msg-tools:empty { display: none !important; }
.msg:hover .msg-tools { display: flex; }

/* style options */
/* message fonts: self-hosted faces (fonts.css), the same on every device; the chat font fills in what a face lacks (emoji) */
.font-sans .msg-text, .font-card.font-sans, .qs-chip.font-sans, .nf-sans { font-family: 'VC Tajawal', var(--font); }
.font-serif .msg-text, .font-card.font-serif, .qs-chip.font-serif, .nf-serif { font-family: 'VC Amiri', var(--font); }
.font-mono .msg-text, .font-card.font-mono, .qs-chip.font-mono, .nf-mono { font-family: 'VC IBM Plex Sans Arabic', var(--font); }
.font-round .msg-text, .font-card.font-round, .qs-chip.font-round, .nf-round { font-family: 'VC El Messiri', var(--font); }
.font-hand .msg-text, .font-card.font-hand, .qs-chip.font-hand, .nf-hand { font-family: 'VC Aref Ruqaa', var(--font); }
.font-kufi .msg-text, .font-card.font-kufi, .qs-chip.font-kufi, .nf-kufi { font-family: 'VC Noto Kufi Arabic', var(--font); }
.font-naskh .msg-text, .font-card.font-naskh, .qs-chip.font-naskh, .nf-naskh { font-family: 'VC Noto Naskh Arabic', var(--font); }
.font-narrow .msg-text, .font-card.font-narrow, .qs-chip.font-narrow, .nf-narrow { font-family: 'VC Cairo', var(--font); }
.font-almarai .msg-text, .font-card.font-almarai, .qs-chip.font-almarai, .nf-almarai { font-family: 'VC Almarai', var(--font); }
.font-readex .msg-text, .font-card.font-readex, .qs-chip.font-readex, .nf-readex { font-family: 'VC Readex Pro', var(--font); }
.font-changa .msg-text, .font-card.font-changa, .qs-chip.font-changa, .nf-changa { font-family: 'VC Changa', var(--font); }
.bub-sky { background: color-mix(in srgb, #4fb3ff 22%, var(--bubble)) !important; }
.bub-mint { background: color-mix(in srgb, #2fd19a 22%, var(--bubble)) !important; }
.bub-lemon { background: color-mix(in srgb, #ffd43b 24%, var(--bubble)) !important; }
.bub-peach { background: color-mix(in srgb, #ff9f6b 24%, var(--bubble)) !important; }
.bub-pink { background: color-mix(in srgb, #ff6fae 22%, var(--bubble)) !important; }
.bub-lilac { background: color-mix(in srgb, #a57bff 26%, var(--bubble)) !important; }
.bub-sand { background: color-mix(in srgb, #c9a36b 24%, var(--bubble)) !important; }
.bub-slate { background: color-mix(in srgb, #7d8ba6 26%, var(--bubble)) !important; }

/* new messages pill / offline bar */
.new-pill {
  position: absolute; inset-block-end: 70px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.new-pill .ic { width: 17px; height: 17px; }
.new-pill.has-new { background: var(--accent); color: var(--on-accent); border: 0; }
.offline-bar { display: none; position: absolute; inset-block-start: 10px; left: 50%; transform: translateX(-50%); z-index: 6; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--warn); color: #241600; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-sm); }
body.offline .offline-bar { display: inline-flex; }
/* "Reconnecting…": right under the top bar, above the log, the stage strip and open panels; the stage steps down meanwhile */
.offline-bar { position: fixed; inset-block-start: calc(var(--top-h) + 6px); z-index: 66; max-width: calc(100vw - 24px); white-space: nowrap; }
body.offline .vs-bar { margin-block-start: 46px; } /* the stage bar is a block above the log: the log steps down with it */

/* ---------- room topic (above the composer) ---------- */
.topic-box {
  position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 0; padding-block: 12px; padding-inline: 10px 40px; flex: none;
  background: var(--topic-grad); color: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 -2px 12px rgba(40, 40, 90, .12);
}
.topic-ic { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #8a96ad; }
.topic-ic .ic { width: 24px; height: 24px; }
.topic-ic b { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 3px; color: #ffb21f; font-size: 15px; font-weight: 900; }
.topic-txt { min-width: 0; flex: 1; }
.topic-txt b { display: block; font-size: 14.5px; font-weight: 800; }
.topic-txt p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; max-height: 4.5em; overflow-y: auto; overflow-wrap: anywhere; }
.topic-txt { text-shadow: 0 1px 2px rgba(0, 0, 0, .22); }
.topic-txt .emo { width: 18px; height: 18px; vertical-align: -4px; }
.topic-txt .link, .topic-txt .mention-tag { color: #fff; text-decoration: underline; background: none; }
.topic-x { position: absolute; inset-block-start: 8px; inset-inline-end: 10px; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: #fff; }
.topic-x .ic { width: 13px; height: 13px; }
.topic-x:hover { background: rgba(255, 255, 255, .2); }

/* ---------- composer ---------- */
.composer-wrap { position: relative; padding: 4px 6px; background: var(--composer-bg); border-top: 1px solid var(--line); flex: none; }
.composer { display: flex; align-items: flex-end; gap: 4px; }
.composer.disabled { opacity: .7; }
.send-btn { order: 0; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 10px; background: var(--send-grad); color: var(--on-accent); box-shadow: 0 3px 10px color-mix(in srgb, var(--orange) 40%, transparent); transition: transform .1s, filter .15s; }
.send-btn:hover { filter: brightness(1.06); }
.send-btn:active { transform: scale(.94); }
.send-btn.loading { opacity: .6; }
.send-btn .ic { width: 20px; height: 20px; }
.input-wrap { order: 1; position: relative; flex: 1; min-width: 0; display: flex; background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 22px; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
#msg-input { border: 0; background: transparent; box-shadow: none; resize: none; padding: 0 16px; height: 40px; max-height: 40px; min-height: 40px; line-height: 40px; /* one line box = the box: a wrapped line never peeks in the padding above (2026-11-21) */ overflow-y: auto; scrollbar-width: none; border-radius: 22px; }
#msg-input::-webkit-scrollbar, .pm-input::-webkit-scrollbar { display: none; }
#msg-input:focus { box-shadow: none; }
#msg-input::placeholder, .pm-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one-line boxes: a long hint ends with … instead of wrapping out of sight */
.cbtn { order: 2; width: 40px; height: 40px; border-radius: 10px; color: var(--accent); }
.cbtn .ic, .cbtn .ic-img { width: 24px; height: 24px; }
#btn-emoji { order: 2; }
.composer-mod { order: 3; display: flex; align-items: flex-end; gap: 0; }
.composer-mod .icon-btn { color: var(--accent); }
#btn-style { order: 4; }
#composer-more { order: 5; }
.char-count { position: absolute; inset-inline-end: 8px; inset-block-start: -20px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel); padding: 0 6px; border-radius: 6px; }
.char-count.danger { color: var(--danger); }
.reply-bar, .guest-cta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); }
.reply-bar > .ic { color: var(--accent); width: 19px; height: 19px; }
.reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.reply-info b { color: var(--accent); }
.reply-info span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-cta { justify-content: space-between; border-inline-start-color: var(--warn); font-size: 14px; }
.suggest { position: absolute; inset-inline: 10px; inset-block-end: calc(100% + 2px); z-index: 8; max-height: 280px; overflow-y: auto; padding: 5px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sugg-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; text-align: start; color: var(--text); }
.sugg-cmd { flex: none; direction: ltr; unicode-bidi: isolate; }
.sugg-item small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg-item.active, .sugg-item:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
/* short screens (phone landscape): the list stays between the top bar and the composer */
@media (max-height: 500px) { .suggest { max-height: min(280px, 42vh, 42dvh); } }
.sugg-item .avatar { width: 22px; height: 22px; }

/* ---------- bottom bar ---------- */
.bottombar { grid-area: bot; position: relative; z-index: 30; display: flex; align-items: stretch; padding: 0 4px; padding-bottom: env(safe-area-inset-bottom); background: var(--bar-grad); color: var(--bar-text); box-shadow: 0 -2px 10px rgba(20, 50, 100, .14); }
.bottom-buttons { display: flex; align-items: stretch; min-width: 0; }
.bottom-lead:empty { display: none; }
/* live state of a bar button (addTopButton({active})) – e.g. camera / mic on air */
.bar-btn.is-on .bar-ic::after { content: ""; position: absolute; inset-block-start: -3px; inset-inline-start: -6px; width: 9px; height: 9px; border-radius: 50%; background: #ff3b4e; box-shadow: 0 0 0 2px var(--bar-badge-ring); animation: vc-onair 1.6s ease-in-out infinite; }
@keyframes vc-onair { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .bar-btn.is-on .bar-ic::after { animation: none; } }
.bottombar .bar-btn { min-width: 58px; }
body:not(.panel-hidden) #btn-panel, body.panel-overlay-open #btn-panel { background: var(--bar-hover); }
.scrim { display: none; }
body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 60; background: transparent; }

/* ==========================================================================
   Popovers, menus, modals, toasts
   ========================================================================== */
.popover {
  position: fixed; z-index: 120; min-width: 200px; max-width: calc(100vw - 16px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(4px) scale(.98); transition: opacity .14s, transform .14s;
}
.popover.in { opacity: 1; transform: none; }
.menu-list { display: flex; flex-direction: column; padding: 6px; max-height: 70vh; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: start; font-size: 14px; font-weight: 500; }
.menu-item:hover { background: var(--hover); text-decoration: none; }
.menu-item .ic, .menu-item .ic-img { width: 19px; height: 19px; color: var(--muted); }
.menu-item span { flex: 1; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.ic-gap { width: 19px; flex: none; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.menu-pop.wide { width: 280px; }
.mm-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px; }
.mm-head .avatar { width: 46px; height: 46px; }
.mm-name { display: flex; align-items: center; gap: 5px; font-size: 15px; }
.mm-head small { color: var(--muted); }
.status-seg { display: flex; gap: 4px; margin: 0 10px 4px; padding: 4px; border-radius: 12px; background: var(--bg2); }
.status-seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.status-seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.status-seg .st-dot { position: static; border: 0; width: 8px; height: 8px; }

/* user card */
.ucard-pop { width: 300px; overflow: hidden; }
.ucard { position: relative; padding-bottom: 12px; }
/* cover: the theme gradient; a member with a name colour gets that colour blended into the theme accent */
.ucard-cover, .profile-cover { height: 70px; background: var(--grad); }
:is(.ucard-cover, .profile-cover)[style*="--ucol"] { background: linear-gradient(135deg, var(--ucol), color-mix(in srgb, var(--ucol) 40%, var(--accent))); }
.ucard-top { display: flex; align-items: flex-end; gap: 12px; padding: 0 14px; margin-top: -32px; }
.ucard-top .avatar { width: 64px; height: 64px; box-shadow: 0 0 0 4px var(--panel); }
.ucard-top .st-dot { width: 14px; height: 14px; border-width: 3px; }
.ucard-name { min-width: 0; padding-bottom: 2px; }
.ucard-line { display: flex; align-items: center; gap: 5px; font-size: 16px; }
.ucard-name small { color: var(--muted); font-size: 12.5px; }
.ucard-mood { margin: 10px 14px 0; padding: 8px 10px; border-radius: 10px; background: var(--panel2); font-size: 13.5px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 20, .55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; transition: opacity .16s; }
.modal.in { opacity: 1; }
/* a dialog is open: the chat behind it pauses its CSS animations (decorated names, frames, list effects), so the blurred
   backdrop is not redrawn every frame; dialogs, toasts, PM windows and gift flights are outside #app and keep moving */
body.vc-modal #app *, body.vc-modal #app *::before, body.vc-modal #app *::after { animation-play-state: paused !important; }
.modal.out { opacity: 0; }
.modal-card {
  position: relative; width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
  transform: translateY(10px) scale(.98); transition: transform .18s;
  /* one composited layer for the whole life of the dialog: iPhone Safari otherwise promotes the card for the entry
     animation and demotes it afterwards, and the part of the card that grew in between (a tool pane, a button) stays
     unpainted until the next zoom / scroll (owner 2026-11-21). One layer per open dialog, released when it closes. */
  will-change: transform;
}
.modal.in .modal-card { transform: none; }
.modal-card.sm { width: min(420px, 100%); }
.modal-card.md { width: min(560px, 100%); }
.modal-card.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h3 { margin: 0; flex: 1; font-size: 17px; }
.modal-ic { width: 22px; height: 22px; color: var(--accent); }
.modal-x.floating { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; z-index: 3; background: rgba(0, 0, 0, .28); color: #fff; }
.modal-x.floating:hover { background: rgba(0, 0, 0, .45); color: #fff; }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel2); flex: none; }
/* inner pages of a dialog (m.push): the dialog's own content stays in place (hidden, state kept) and the page takes the
   card with its own head: back arrow, title, X */
.modal-card.paged > :not(.mpage) { display: none; }
.mpage { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: mpage-in .2s ease-out; }
.mpage[hidden] { display: none; }
.mpage-head { padding-inline-start: 10px; }
.mpage-back .ic { width: 20px; height: 20px; }
@keyframes mpage-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .mpage { animation-name: mpage-in-rtl; }
@keyframes mpage-in-rtl { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mpage { animation: none; } }
.confirm-text { margin: 0; font-size: 15px; }
/* staff notice boxes of a staff action (V.staffNotify) */
.sn-box { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; padding: 9px 11px; border: 1px dashed var(--line, rgba(127,127,127,.35)); border-radius: 10px; font-size: 13.5px; }
.sn-box small { flex-basis: 100%; opacity: .75; }
.sn-check { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; min-height: 28px; }
.sn-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent, #1f6feb); }
.sn-check input:disabled + span { opacity: .5; }
.target-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); }
.target-line .avatar { width: 32px; height: 32px; }

/* profile */
.profile-modal .modal-body { padding: 0; }
.profile { padding-bottom: 18px; }
.profile-cover { height: 120px; }
.profile-head { display: flex; align-items: flex-end; gap: 16px; padding: 0 22px; margin-top: -52px; }
.profile-av { border: 0; padding: 0; background: none; line-height: 0; border-radius: 50%; }
.profile-av .avatar { width: 104px; height: 104px; box-shadow: 0 0 0 5px var(--panel); }
.profile-av .st-dot { width: 20px; height: 20px; border-width: 4px; inset-block-end: 6px; inset-inline-end: 6px; }
.profile-id { min-width: 0; padding-bottom: 4px; }
.profile-id h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 22px; }
.profile-id h2 .rank-ic { width: 22px; height: 22px; }
.profile-rank { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.rank-chip { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, currentColor 14%, transparent); }
.rank-chip.r-user { color: var(--muted); }
.profile-mood { margin: 6px 0 0; color: var(--muted); font-style: italic; font-size: 14px; overflow-wrap: anywhere; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 22px 0; }
.fact-chips .chip { background: color-mix(in srgb, var(--panel) 92%, transparent); border-color: var(--line); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.fact-chips .chip .ic { color: var(--accent); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 0; }
.seg-tabs { display: flex; gap: 4px; margin: 18px 22px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg-tabs button { position: relative; padding: 9px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.seg-tabs button.active { color: var(--text); }
.seg-tabs button.active::after { content: ""; position: absolute; inset-inline: 10px; inset-block-end: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.profile-tab-body { padding: 14px 22px 0; min-height: 90px; }
.about-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.info-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-list > div { padding: 9px 12px; border-radius: 12px; background: var(--panel2); }
.info-list dt { font-size: 11.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.info-list dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* settings */
.settings-modal .modal-body { padding: 0; display: flex; }
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); width: 100%; min-height: min(560px, 70dvh); }
.set-nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; border-inline-end: 1px solid var(--line); background: var(--panel2); }
.set-nav button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; text-align: start; }
.set-nav button .ic { width: 19px; height: 19px; }
.set-nav button:hover { background: var(--hover); color: var(--text); }
.set-nav button.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }
.set-content { padding: 18px 22px 22px; overflow-y: auto; max-height: calc(100dvh - 120px); }
.set-title { margin: 0 0 14px; font-size: 18px; }
.set-body { display: flex; flex-direction: column; gap: 6px; }
.set-section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-section:last-of-type { border-bottom: 0; }
.set-section h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.set-actions { display: flex; justify-content: flex-end; padding-top: 14px; position: sticky; bottom: -22px; background: linear-gradient(transparent, var(--panel) 30%); padding-bottom: 4px; }
.avatar-edit { display: flex; align-items: center; gap: 18px; padding: 4px 0 6px; }
.avatar-edit .avatar { width: 96px; height: 96px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.avatar-edit .avatar.loading { opacity: .4; }
.avatar-edit-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-edit-btns small { flex-basis: 100%; }
/* Settings › My profile: link to «My look» (the window itself has its own lazy stylesheet) */
.look-link { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); color: var(--muted); font-size: 13px; }
.look-link > span { flex: 1; }
.look-link .ic { color: var(--accent); flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); padding: 0; display: grid; place-items: center; background: var(--panel2); color: var(--muted); }
.swatch .ic { width: 16px; height: 16px; }
.swatch.active { box-shadow: 0 0 0 2px var(--text); }
.swatch.custom { cursor: pointer; overflow: hidden; background: conic-gradient(#ff5d6c, #ffb547, #3fd18b, #4fb3ff, #7c5cff, #ff5d6c); color: #fff; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-card { display: flex; flex-direction: column; gap: 7px; padding: 6px 6px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); font-weight: 600; font-size: 13px; }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.theme-prev { position: relative; display: block; height: 70px; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.theme-prev i { position: absolute; display: block; }
.tp-top { inset: 0 0 auto 0; height: 13px; background: var(--topbar-bg); border-bottom: 1px solid var(--line); }
.tp-side { inset-block: 13px 0; inset-inline-start: 0; width: 14px; background: var(--appbar-bg); }
.tp-msg { height: 10px; border-radius: 6px; inset-inline-start: 22px; }
.tp-msg.a { top: 22px; width: 55%; background: var(--bubble); border: 1px solid var(--line); }
.tp-msg.b { top: 37px; width: 40%; background: var(--mine); }
.tp-msg.c { top: 52px; width: 30%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.theme-name { text-align: center; }
.preview-box { padding: 14px; border-radius: 14px; background: var(--bg); background-image: var(--logbg); border: 1px solid var(--line); margin-bottom: 4px; }
.style-preview { margin: 0; animation: none; }
.style-preview:hover { background: transparent; }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.font-card { padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); font-size: 15px; }
.font-card.active, .bubble-sw.active { border-color: var(--accent); }
.bubble-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.bubble-sw { width: 46px; height: 32px; border-radius: 10px 10px 10px 3px; border: 2px solid var(--line); background: var(--bubble); display: grid; place-items: center; color: var(--muted); }
.bubble-sw .ic { width: 15px; height: 15px; }
.sound-kinds { display: flex; flex-direction: column; padding-inline-start: 10px; border-inline-start: 2px solid var(--line); margin: 6px 0; }
.sound-kind { display: flex; align-items: center; gap: 8px; }
.sound-kind .toggle-row { flex: 1; padding: 6px 0; }
.danger-zone { padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.danger-zone p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.help-list { display: flex; flex-direction: column; gap: 6px; }
.help-list h4 { margin: 12px 0 2px; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.help-row { display: flex; gap: 12px; align-items: baseline; padding: 6px 10px; border-radius: 10px; background: var(--panel2); }
.help-row code { flex: none; min-width: 150px; color: var(--accent); font-weight: 700; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.help-row span { color: var(--muted); font-size: 14px; }

/* emoji picker */
.emoji-pop { width: 344px; }
.emoji-picker { display: flex; flex-direction: column; height: 340px; }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.emoji-tabs button { display: grid; place-items: center; width: 36px; height: 32px; flex: none; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.emoji-tabs button .ic { width: 19px; height: 19px; }
.emoji-tabs button .ic-img { width: 22px; height: 22px; object-fit: contain; } /* emoticon category tab (first picture of the pack) */
.emoji-tabs button.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px; align-content: start; }
.emoji-grid.emoticons { grid-template-columns: repeat(7, 1fr); }
.emoji-btn { display: grid; place-items: center; aspect-ratio: 1; border: 0; border-radius: 9px; background: transparent; font-size: 23px; line-height: 1; padding: 0; transition: transform .08s, background .1s; }
.emoji-btn:hover { background: var(--hover); transform: scale(1.15); }
.emoji-btn img { width: 32px; height: 32px; object-fit: contain; }
/* emoticon search (by code), shown only when emoticons are offered */
.emoji-search { flex: none; margin: 6px 6px 0; width: auto; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--text); font-size: 14px; }
.emoji-none { grid-column: 1 / -1; margin: 18px 6px; text-align: center; color: var(--muted); font-size: 14px; }

/* toasts */
.toasts { position: fixed; inset-block-start: calc(var(--top-h) + 10px); inset-inline-end: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); animation: toast-in .22s ease-out; transition: opacity .25s, transform .25s;
}
.toast.clickable { cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(-6px); }
.toast-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; flex: none; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.toast-ic .ic { width: 18px; height: 18px; }
.toast.ok .toast-ic { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.toast.err .toast-ic { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.toast-img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.toast-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; overflow-wrap: anywhere; }
.toast-text b { font-size: 13.5px; }
.toast-text b + span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-x { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--faint); }
.toast-x .ic { width: 15px; height: 15px; }
.toast-x:hover { background: var(--hover); color: var(--text); }
.toast-act { flex: none; align-self: center; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Private message windows
   ========================================================================== */
/* base window styles; desktop layout = body.pm-d block below, phones = body.pm-m block */
.pm-dock { position: fixed; inset-block-end: calc(var(--bot-h) + 70px); inset-inline-end: 16px; z-index: 48; display: flex; flex-direction: column; align-items: stretch; gap: 8px; pointer-events: none; }
.pm-row, .pm-chips { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; pointer-events: none; min-width: 0; }
.pm-chips { gap: 8px; }
.pm-chips:not(:has(.pm-win)) { display: none; }
.pm-win {
  pointer-events: auto; width: 330px; height: min(450px, var(--pm-maxh, 450px)); display: flex; flex-direction: column; flex: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  animation: pm-in .2s ease-out;
}
@keyframes pm-in { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.pm-win.min { height: 40px; width: 172px; border-radius: 20px; border: 0; animation: none; }
.pm-win.min .pm-log, .pm-win.min .pm-form, .pm-win.min .pm-reply-bar { display: none; }
.pm-win.min .pm-head { height: 40px; padding: 3px 4px; gap: 6px; border-radius: 20px; }
.pm-win.min .pm-head .avatar { width: 30px; height: 30px; }
.pm-win.min .pm-status, .pm-win.min .pm-opts, .pm-win.min .pm-min { display: none; }
.pm-win.min .pm-x { width: 26px; height: 26px; }
.pm-head { display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 10px; background: var(--bar-grad); color: var(--bar-text, #fff); flex: none; cursor: default; }
.pm-win.min .pm-head { cursor: pointer; }
.pm-head .icon-btn { color: var(--bar-text, #fff); opacity: .9; }
.pm-head .icon-btn:hover { background: var(--bar-hover); color: var(--bar-text); }
.pm-head .avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.pm-head .st-dot { border-color: var(--bar-badge-ring); }
.pm-grab, .pm-size, .pm-ic-m, .pm-divider { display: none; }
.pm-who { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; color: var(--bar-text); padding: 0; text-align: start; line-height: 1.25; }
.pm-name { display: flex; align-items: center; gap: 4px; max-width: 100%; font-size: 14px; }
.pm-name .uname { color: var(--bar-text) !important; }
.pm-status { font-size: 11.5px; opacity: .85; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-name .uname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* six header buttons (calls, minimize, size, options, close): tighter so the name and "last seen" keep room */
body:not(.pm-m) .pm-win:not(.min) .pm-head { gap: 4px; padding-inline-end: 4px; }
body:not(.pm-m) .pm-win:not(.min) .pm-head .icon-btn.sm { width: 28px; height: 28px; min-width: 28px; flex: none; }
.pm-log { flex: 1; overflow-y: auto; padding: 10px 10px 6px; background: var(--bg); background-image: var(--logbg); display: flex; flex-direction: column; gap: 3px; }
.pm-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); }
.pm-empty .avatar { width: 64px; height: 64px; }
.pm-msg { display: flex; animation: msg-in .18s ease-out; }
.pm-msg.mine { justify-content: flex-end; }
.pm-bubble { max-width: 82%; padding: 7px 11px 5px; border-radius: 16px; background: var(--bubble); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); overflow-wrap: anywhere; }
.pm-msg.theirs .pm-bubble { border-end-start-radius: 5px; }
.pm-msg.mine .pm-bubble { background: var(--grad); color: var(--on-accent); border: 0; border-end-end-radius: 5px; }
.pm-msg.mine .link, .pm-msg.mine .mention-tag { color: inherit; text-decoration: underline; }
.pm-msg.custom .pm-bubble { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.pm-text { white-space: pre-wrap; font-size: calc(14.5px * var(--mz, 1)); }
.pm-text.big-emo { font-size: 30px; }
.pm-text.big-emo .emo { width: 38px; height: 38px; }
.pm-meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 10.5px; opacity: .7; margin-top: 1px; }
.seen-ic { width: 14px; height: 14px; }
/* ticks: grey = sent / delivered, blue = read (--tick-read, overridable per theme); on own bubbles the grey follows the bubble text */
:root { --tick-read: #34b7f1; }
.pm-tick { display: inline-flex; line-height: 0; }
.seen-ic.sent, .seen-ic.delivered { color: var(--muted); }
.seen-ic.seen { color: var(--tick-read); opacity: 1; }
/* own bubbles use the accent gradient (often blue): the ticks sit on a small panel-coloured chip so grey and blue stay readable in every theme */
.pm-msg.mine .pm-tick { padding: 0 2px; border-radius: 6px; background: var(--panel); }
.pm-msg.mine .pm-meta:has(.pm-tick) { opacity: 1; }
.pm-msg.mine .pm-meta time, .pm-msg.mine .pm-meta .msg-edited { opacity: .75; }
.pm-form { display: flex; align-items: flex-end; gap: 2px; padding: 6px; border-top: 1px solid var(--line); background: var(--panel); flex: none; }
.pm-tools { display: flex; }
.pm-htools { display: flex; flex: none; align-items: center; gap: 0; }
.pm-htools:empty { display: none; }
.pm-win.min .pm-htools { display: none; }
body.pm-d .pm-head .pm-htools { order: 0; }
.pm-input { flex: 1; border: 0; background: var(--bg2); border-radius: 12px; resize: none; padding: 0 10px; height: 34px; max-height: 34px; min-height: 34px; line-height: 34px; /* the line box fills the 34px box: the previous line never peeks in the padding */ overflow-y: auto; scrollbar-width: none; }
/* PM reply quote / reply bar (core) */
.pm-quote { border-left: 0; border-inline-start: 3px solid var(--accent); margin-bottom: 4px; }
.pm-msg.mine .pm-quote { background: rgba(255, 255, 255, .18); color: inherit; border-inline-start-color: rgba(255, 255, 255, .75); }
.pm-msg.mine .pm-quote b, .pm-msg.mine .pm-quote span { color: inherit; opacity: .92; }
.pm-reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); border-inline-start: 3px solid var(--accent); background: var(--panel2); font-size: 12.5px; color: var(--muted); flex: none; }
.pm-reply-bar[hidden] { display: none; }
.pm-reply-bar svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.pm-reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* extra presence states */
.st-dot.st4 { background: #8b5cf6; }
.st-dot.st5 { background: #eab308; }
.st-dot.st6 { background: #3b82f6; }
.st-dot.st7 { background: #06b6d4; }
/* «Invisible» status (8): hollow ring; .inv-tag = small mark shown to staff who may see invisible members */
.st-dot.st8 { background: var(--panel); box-shadow: inset 0 0 0 2px var(--faint); }
.st-dot.inline.st8 { box-shadow: inset 0 0 0 1.5px var(--faint); }
.inv-tag { font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px; border: 1px dashed var(--faint); color: var(--muted); white-space: nowrap; }
.status-opt.st-inv { border-top: 1px solid var(--line); }
.status-seg { flex-wrap: wrap; }
.status-seg button { flex: 1 1 30%; min-width: 0; }
.pm-unread { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1099px) {
  .app, body.panel-hidden .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "bot"; }
  .sidepanel, body.panel-hidden .sidepanel {
    display: flex; position: fixed; inset-block: var(--top-h) var(--bot-h); inset-inline-start: 0; width: min(330px, 88vw); z-index: 55;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); border-radius: 0 0 14px 0;
  }
  [dir=rtl] .sidepanel, [dir=rtl] body.panel-hidden .sidepanel { transform: translateX(105%); border-radius: 0 0 0 14px; }
  body.panel-overlay-open .sidepanel { transform: none !important; }
  body.panel-overlay-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 var(--bot-h); z-index: 50; background: rgba(15, 25, 45, .35); }
  /* keyboard up while typing in the panel (news / wall comments): the panel ends at the top of the keyboard, so its
     last items and its field can be scrolled to (it ended under the keyboard) */
  html.vc-kb .sidepanel { inset-block-end: auto; height: max(160px, calc(var(--vv-top, 0px) + var(--vv-h, 100dvh) - var(--top-h))); }
}
@media (max-width: 760px) {
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 0; }
  .topbar .brand { display: none; }
  .bar-btn { min-width: 44px; padding-inline: 3px; font-size: 10.5px; }
  .bar-label { max-width: 58px; }
  .bottombar .bar-btn { min-width: 54px; }
  .avatar-btn { margin: 0 4px; }
  .avatar-btn img { width: 36px; height: 36px; }
  .appbar { inset-inline: 8px; width: auto; }
  .msg { grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 8px; padding: 8px 8px 8px 6px; }
  .msg-av .avatar { width: 34px !important; height: 34px !important; } /* phones: the row as tall as its text (the picture carries its size inline) */
  .msg-tools { display: none !important; }
  .composer-wrap { padding: 4px; padding-bottom: 4px; }
  .composer-mod .icon-btn:nth-child(n+2) { display: none; }
  .cbtn { width: 38px; }
  .topic-box { border-radius: 10px 10px 0 0; }
  .new-pill { inset-block-end: 64px; }
  .toasts { inset-inline: 10px; width: auto; inset-block-start: calc(var(--top-h) + 6px); }
  /* the sheet sits on the VISIBLE bottom of the screen (100dvh: above Safari's toolbar) and keeps clear of the home bar,
     so its last button is never under the browser bar (owner 2026-11-21: «Verify» showed only after a pinch) */
  .modal { padding: 0; align-items: end; height: 100dvh; bottom: auto; }
  .modal-card, .modal-card.sm, .modal-card.md, .modal-card.wide { width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(40px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal.in .modal-card { transform: none; }
  /* keyboard up (vc-kb, set from the visible viewport): the dialog fits above it and scrolls to its very end */
  html.vc-kb .modal { top: var(--vv-top, 0px); height: var(--vv-h, 100dvh); }
  html.vc-kb .modal-card, html.vc-kb .modal-card.sm, html.vc-kb .modal-card.md, html.vc-kb .modal-card.wide { max-height: calc(var(--vv-h, 94dvh) - 6px); padding-bottom: 0; }
  html.vc-kb .modal-card.settings-modal { height: calc(var(--vv-h, 92dvh) - 6px); }
  .settings { grid-template-columns: 1fr; min-height: 0; }
  .set-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .set-nav button { flex: none; padding: 8px 12px; }
  .set-content { max-height: none; padding: 14px 16px 18px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > :last-child { grid-column: 1 / -1; }
  .info-list { grid-template-columns: 1fr; }
  .profile-head { padding: 0 16px; }
  .fact-chips, .profile-actions, .profile-tab-body { padding-inline: 16px; }
  .seg-tabs { margin-inline: 16px; }
  .emoji-pop { width: calc(100vw - 16px); }
  .emoji-picker { height: 300px; }
  .emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .pm-bubble { max-width: 86%; }
  .conv-del { opacity: 1; }
}
/* ---- phones (body.pm-m, set by JS): PM = bottom sheet (half / full) + round draggable chat heads ---- */
body.pm-m .pm-dock { inset: 0 auto auto auto; z-index: 45; flex-direction: column; align-items: center; gap: 0; }
body.pm-m .pm-chips { flex-direction: column-reverse; align-items: center; gap: 8px; }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-head { gap: 0; }
body.pm-m .pm-dock.side-r { right: calc(10px + env(safe-area-inset-right)); left: auto; }
body.pm-m .pm-dock.side-l { left: calc(10px + env(safe-area-inset-left)); right: auto; }
body.pm-m .pm-win { animation: none; will-change: transform; }
body.pm-m .pm-win:not(.min) {
  position: fixed; z-index: 1; inset: auto 0; width: auto; border: 0; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 28px rgba(10, 20, 45, .22), 0 60vh 0 0 var(--panel); /* 2nd shadow fills under the sheet while it is dragged up */
}
body.pm-m .pm-win:not(.min).dragging { transition: none !important; }
body.pm-m .pm-win:not(.min) .pm-head { position: relative; flex-wrap: nowrap; gap: 6px; padding: 16px 6px 8px 12px; border-radius: 20px 20px 0 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
body.pm-m .pm-win:not(.min) .pm-grab { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: color-mix(in srgb, var(--bar-text) 50%, transparent); }
body.pm-m .pm-win:not(.min) .pm-size { display: inline-grid; }
body.pm-m .pm-win .pm-ic-d { display: none; }
body.pm-m .pm-win .pm-ic-m { display: inline-block; }
body.pm-m .pm-win .pm-size .pm-ic-half, body.pm-m .pm-win.full .pm-size .pm-ic-full { display: none; }
body.pm-m .pm-win.full .pm-size .pm-ic-half { display: inline-block; }
body.pm-m .pm-win:not(.min) .pm-head .icon-btn { width: 36px; height: 36px; flex: none; }
body.pm-m .pm-head .pm-muted { display: none; } /* phones: the header is full; "Unmute notifications" stays in the ⋮ menu */
body.pm-m .pm-win:not(.min) .pm-form { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
body.pm-m .pm-win.kb:not(.min) .pm-form { padding-bottom: 6px; }
body.pm-m .pm-win:not(.min) .pm-log { overscroll-behavior: contain; }
:is(body.pm-m, body.pm-d) .pm-win.min {
  position: relative; z-index: 2; width: 54px; height: 54px; border: 0; border-radius: 50%; overflow: visible; box-shadow: 0 4px 14px rgba(10, 20, 45, .3);
  animation: pm-head-in .24s cubic-bezier(.2, .8, .25, 1.3);
}
body.pm-m .pm-win.min.dragging { z-index: 3; box-shadow: 0 10px 26px rgba(10, 20, 45, .4); }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-head { position: relative; padding: 0; width: 54px; height: 54px; border-radius: 50%; justify-content: center; background: var(--brand-grad); touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-head > :not(.pm-av):not(.pm-unread) { display: none; }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-av .avatar { width: 48px; height: 48px; }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-av .st-dot { inset-block-end: 1px; inset-inline-end: 1px; }
:is(body.pm-m, body.pm-d) .pm-win.min .pm-unread { position: absolute; inset-block-start: -4px; inset-inline-end: -4px; min-width: 20px; text-align: center; pointer-events: none; }
/* chat heads on a phone: a gutter on their side of the log (heads 54px + 10px edge) */
body.pm-m.pm-gut-r .chat-log { padding-right: calc(66px + env(safe-area-inset-right, 0px)); }
body.pm-m.pm-gut-l .chat-log { padding-left: calc(66px + env(safe-area-inset-left, 0px)); }
body.pm-m.pm-full .toasts { inset-block-start: calc(var(--top-h) + 70px); } /* keep the full sheet's header buttons reachable */
@keyframes pm-head-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- desktop (body.pm-d, set by JS): ONE open conversation + round bubbles, all next to the side panel ----
   compact  = window docked at the bottom of the chat column by the side panel; the room composer/topic move aside (same row)
   expanded = a real grid column between the side panel and the room (the room shrinks, both stay usable), resizable divider
   pm-over  = small desktops where room (420) + column (300) don't fit: the expanded column overlays the room instead
   --pm-x = where the PM area starts (end of the docked side panel / rail menu); --pm-r = bubble rail, --pm-w = window width (JS) */
body.pm-d { --pm-x: 0px; }
@media (min-width: 1100px) {
  body.pm-d:not(.panel-hidden) { --pm-x: var(--side-w); }
  body.pm-d.menu-rail:not(.panel-hidden) { --pm-x: calc(250px + var(--side-w)); }
  body.pm-d.menu-rail.panel-hidden { --pm-x: 250px; }
}
body.pm-d .app { grid-template-columns: var(--side-w) var(--pm-gc, 0px) minmax(0, 1fr); grid-template-areas: "top top top" "side pmc main" "bot bot bot"; }
body.pm-d.panel-hidden .app { grid-template-columns: 0 var(--pm-gc, 0px) minmax(0, 1fr); }
@media (min-width: 1100px) {
  body.pm-d.menu-rail .app { grid-template-columns: 250px var(--side-w) var(--pm-gc, 0px) minmax(0, 1fr); grid-template-areas: "top top top top" "rail side pmc main" "bot bot bot bot"; }
  body.pm-d.menu-rail.panel-hidden .app { grid-template-columns: 250px 0 var(--pm-gc, 0px) minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  body.pm-d .app, body.pm-d.panel-hidden .app { grid-template-columns: var(--pm-gc, 0px) minmax(0, 1fr); grid-template-areas: "top top" "pmc main" "bot bot"; }
}
body.pm-d .composer-wrap { margin-inline-start: var(--pm-shift, 0px); }
html[dir=rtl] body.pm-d .topic-box { margin-right: var(--pm-shift, 0px); }
html:not([dir=rtl]) body.pm-d .topic-box { margin-left: var(--pm-shift, 0px); }
body.pm-d .pm-dock {
  position: fixed; inset-block: var(--top-h) var(--bot-h); inset-inline-start: var(--pm-x); inset-inline-end: auto;
  width: calc(var(--pm-r, 0px) + var(--pm-w, 0px)); display: block; z-index: 40; pointer-events: none;
}
body.pm-d .pm-row { position: absolute; inset-block-end: 0; inset-inline: var(--pm-r, 0px) 0; height: min(480px, calc(100% - 10px)); display: block; }
body.pm-d.pm-exp .pm-row { height: 100%; }
body.pm-d.pm-lift .pm-row { inset-block-end: var(--pm-lift, 0px); height: min(480px, calc(100% - 10px - var(--pm-lift, 0px))); }
body.pm-d.pm-lift .pm-row .pm-win { border-radius: 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
body.pm-d .pm-row .pm-win { width: 100%; height: 100%; border-radius: 16px 16px 0 0; border-bottom: 0; box-shadow: 0 -6px 26px rgba(15, 30, 60, .2); }
body.pm-d.pm-col .pm-row .pm-win { border-radius: 0; border-block: 0; border-inline-start: 0; box-shadow: none; animation: none; }
body.pm-d.pm-over .pm-row .pm-win { border-radius: 0; border-block: 0; box-shadow: 0 0 34px rgba(15, 30, 60, .3); }
body.pm-d .pm-chips {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--pm-r, 0px); display: flex; flex-direction: column-reverse;
  align-items: center; justify-content: flex-start; gap: 8px; padding: 12px 0; overflow: visible;
}
body.pm-d.pm-col .pm-chips, body.pm-d.pm-over .pm-chips { background: var(--panel2); border-inline-end: 1px solid var(--line); pointer-events: auto; }
body.pm-d .pm-win:not(.min) .pm-size { display: inline-grid; order: 1; }
body.pm-d .pm-head .pm-min { order: 2; }
body.pm-d .pm-head .pm-opts { order: 3; }
body.pm-d .pm-head .pm-x { order: 4; }
body.pm-d .pm-size .pm-ic-half, body.pm-d.pm-exp .pm-size .pm-ic-full { display: none; }
body.pm-d.pm-exp .pm-size .pm-ic-half { display: inline-block; }
body.pm-d .pm-win.min { cursor: pointer; }
body.pm-d .pm-win.min:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 18px rgba(10, 20, 45, .3); }
body.pm-d .pm-win.min:hover .pm-head > .pm-x {
  display: grid; position: absolute; inset-block-start: -5px; inset-inline-start: -5px; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(10, 20, 45, .35);
}
body.pm-d .pm-win.min .pm-head > .pm-x .ic { width: 11px; height: 11px; }
body.pm-d .pm-win.min.bump { animation: pm-bump .7s ease; }
body.pm-d .pm-win.min.bump .pm-unread { animation: pm-pulse .7s ease; }
@keyframes pm-bump { 0%, 100% { transform: none; } 15% { transform: rotate(-14deg) scale(1.08); } 35% { transform: rotate(11deg) scale(1.08); } 55% { transform: rotate(-7deg); } 75% { transform: rotate(4deg); } }
@keyframes pm-pulse { 0%, 100% { transform: none; } 40% { transform: scale(1.35); } }
body.pm-d.pm-exp .pm-divider { display: block; position: absolute; inset-block: 0; inset-inline-end: -6px; width: 12px; z-index: 3; cursor: col-resize; pointer-events: auto; touch-action: none; }
body.pm-d.pm-exp .pm-divider::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 5px; width: 2px; background: transparent; transition: background .15s; }
body.pm-d.pm-exp .pm-divider::before {
  content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 3px; width: 6px; height: 40px; margin-top: -20px; border-radius: 3px;
  background: var(--line); box-shadow: 0 0 0 1px var(--panel); transition: background .15s;
}
body.pm-d.pm-exp .pm-divider:hover::after, body.pm-resizing .pm-divider::after, body.pm-d.pm-exp .pm-divider:hover::before, body.pm-resizing .pm-divider::before { background: var(--accent); }
body.pm-d.pm-exp .toasts { inset-block-start: calc(var(--top-h) + 66px); } /* keep the PM column header buttons reachable */
body.pm-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.pm-resizing iframe, body.pm-resizing .chat-log { pointer-events: none; }
body.pm-d.pm-anim .app { transition: grid-template-columns .26s cubic-bezier(.2, .8, .25, 1); }
body.pm-d.pm-anim .pm-dock { transition: width .26s cubic-bezier(.2, .8, .25, 1); }
body.pm-d.pm-anim .pm-row { transition: height .26s cubic-bezier(.2, .8, .25, 1); }
/* admin "Private chat windows side" = the screen edge opposite the members panel: same pieces, mirrored */
body.pm-d.pm-far .app { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--pm-gc, 0px); grid-template-areas: "top top top" "side main pmc" "bot bot bot"; }
body.pm-d.pm-far.panel-hidden .app { grid-template-columns: 0 minmax(0, 1fr) var(--pm-gc, 0px); }
@media (min-width: 1100px) {
  body.pm-d.pm-far.menu-rail .app { grid-template-columns: 250px var(--side-w) minmax(0, 1fr) var(--pm-gc, 0px); grid-template-areas: "top top top top" "rail side main pmc" "bot bot bot bot"; }
  body.pm-d.pm-far.menu-rail.panel-hidden .app { grid-template-columns: 250px 0 minmax(0, 1fr) var(--pm-gc, 0px); }
}
@media (max-width: 1099px) {
  body.pm-d.pm-far .app, body.pm-d.pm-far.panel-hidden .app { grid-template-columns: minmax(0, 1fr) var(--pm-gc, 0px); grid-template-areas: "top top" "main pmc" "bot bot"; }
}
body.pm-d.pm-far .pm-dock { inset-inline-start: auto; inset-inline-end: 0; }
body.pm-d.pm-far .pm-row { inset-inline: 0 var(--pm-r, 0px); }
body.pm-d.pm-far .pm-chips { inset-inline-start: auto; inset-inline-end: 0; }
body.pm-d.pm-far.pm-col .pm-chips, body.pm-d.pm-far.pm-over .pm-chips { border-inline-end: 0; border-inline-start: 1px solid var(--line); }
body.pm-d.pm-far.pm-col .pm-row .pm-win { border-inline-start: 1px solid var(--line); border-inline-end: 0; }
body.pm-d.pm-far .composer-wrap { margin-inline-start: 0; margin-inline-end: var(--pm-shift, 0px); }
html[dir=rtl] body.pm-d.pm-far .topic-box { margin-right: 0; margin-left: var(--pm-shift, 0px); }
html:not([dir=rtl]) body.pm-d.pm-far .topic-box { margin-left: 0; margin-right: var(--pm-shift, 0px); }
body.pm-d.pm-far.pm-exp .pm-divider { inset-inline-end: auto; inset-inline-start: -6px; }
body.pm-d.pm-far.pm-anim .composer-wrap, body.pm-d.pm-far.pm-anim .topic-box { transition: margin .26s cubic-bezier(.2, .8, .25, 1); }
body.pm-d.pm-anim .composer-wrap, body.pm-d.pm-anim .topic-box { transition: margin .26s cubic-bezier(.2, .8, .25, 1); }
@media (hover: none) {
  .msg-tools { display: none !important; }
  .msg:hover { background: var(--row-bg); }
  .msg:nth-child(even of .msg, .msg-sys.jl-row):hover { background: var(--row-alt); }
  .conv-del { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Landing / login page — live panel (start side) + login card
   ========================================================================== */
.vc-auth { min-height: 100%; background: var(--land-bg); }
.landing { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.land-info {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 26px; padding: 30px clamp(20px, 5vw, 56px) 34px;
  background: var(--land-panel); color: #fff;
}
.land-info::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.4px); background-size: 22px 22px; opacity: .6; }
.land-info::after { content: ""; position: absolute; width: 360px; height: 360px; inset-block-end: -140px; inset-inline-end: -120px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 160, 70, .45), transparent); pointer-events: none; }
.land-info > * { position: relative; z-index: 1; }
.land-brand { display: flex; align-items: center; gap: 12px; }
.land-logo img { display: block; width: auto; height: 48px; max-width: 190px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }
.land-brand-txt { min-width: 0; display: flex; flex-direction: column; }
.land-brand h1 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.land-brand small { font-size: 13px; opacity: .85; }
.land-live { display: flex; align-items: center; gap: 22px; margin-top: 30px; }
.live-orb { position: relative; display: grid; place-items: center; width: 150px; height: 150px; flex: none; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 14px rgba(255, 255, 255, .04); }
.live-orb::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(255, 175, 90, .45); animation: orb 2.6s ease-out infinite; }
.live-orb span { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffc06b, #ff8a1f 60%, #f0700e); box-shadow: 0 10px 30px rgba(255, 120, 20, .45), inset 0 -6px 14px rgba(180, 70, 0, .25); }
.live-orb .ic { width: 46px; height: 46px; color: #fff; }
@keyframes orb { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.12); opacity: 0; } }
.live-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.live-n { font-size: 84px; line-height: .95; font-weight: 600; letter-spacing: -1px; text-shadow: 0 4px 18px rgba(0, 0, 0, .15); }
.live-lbl { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; color: #ffb35a; font-size: 22px; font-weight: 800; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff8a1f; box-shadow: 0 0 0 4px rgba(255, 138, 31, .28); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 138, 31, 0); } }
.live-txt small { margin-top: 4px; font-size: 14px; opacity: .9; }
.land-rooms { padding: 18px 20px 8px; border-radius: 20px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 10px 30px rgba(10, 30, 80, .15); backdrop-filter: blur(4px); }
.lr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.lr-head b { font-size: 15px; }
.lr-head small { font-size: 12px; opacity: .8; }
.lr-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(60px, 150px) 48px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.lr-row:last-child { border-bottom: 0; }
.lr-tile { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; overflow: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }
.lr-tile img { width: 28px; height: 28px; object-fit: cover; border-radius: 7px; }
.lr-tile.t1 { background: linear-gradient(135deg, #a8c4f0, #6d97de); } .lr-tile.t2 { background: linear-gradient(135deg, #ffb357, #ff8a1f); }
.lr-tile.t3 { background: linear-gradient(135deg, #c264d6, #8d3fb3); } .lr-tile.t4 { background: linear-gradient(135deg, #ffd08a, #ffa94a); }
.lr-tile.t5 { background: linear-gradient(135deg, #6fd3b8, #2fa98a); } .lr-tile.t6 { background: linear-gradient(135deg, #ff9db5, #e8507a); }
.lr-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-bar { height: 7px; border-radius: 6px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.lr-bar i { display: block; height: 100%; min-width: 0; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7)); }
[dir=rtl] .lr-bar i { margin-inline-start: auto; }
.lr-n { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-weight: 800; font-size: 15px; direction: ltr; }
.lr-n .ic { width: 13px; height: 13px; opacity: .75; }
.lr-empty { margin: 8px 0 12px; opacity: .8; }
.land-chips { display: flex; flex-direction: column; gap: 10px; }
.chips-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.land-chips .chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); color: #fff; font-size: 14.5px; font-weight: 700; white-space: nowrap; transition: background .3s, box-shadow .3s, transform .3s; }
.land-chips .chip .ic { width: 18px; height: 18px; }
.land-chips .chip:hover { background: rgba(255, 255, 255, .18); }
.land-chips .chip.on { background: linear-gradient(135deg, #ffb04f, #ff8216); border-color: transparent; box-shadow: 0 8px 22px rgba(255, 130, 22, .4); transform: translateY(-2px); }
.chips-dots { display: flex; justify-content: flex-end; gap: 6px; }
.chips-dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .35); transition: width .3s, background .3s; }
.chips-dots i.on { width: 22px; background: #ff9a3c; }

.land-side {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 40px 20px 24px;
  background: radial-gradient(420px 380px at 0% 8%, rgba(120, 165, 235, .28), transparent 70%), radial-gradient(360px 320px at 100% 92%, rgba(255, 168, 80, .3), transparent 70%), var(--land-bg);
}
.auth-card { position: relative; width: min(410px, 100%); padding: 32px 28px 26px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(40, 70, 130, .16); text-align: center; }
.auth-title { margin: 0; font-size: 27px; font-weight: 800; color: var(--text); }
.auth-sub { margin: 4px 0 20px; color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 15px; background: var(--toggle-bg); }
.tabs.single { display: none; }
.tab { flex: 1; padding: 9px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 800; font-size: 15px; }
.tabs .tab.active { background: var(--btn-grad); color: var(--on-accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.auth-form { display: none; flex-direction: column; gap: 12px; text-align: start; }
.auth-form.active { display: flex; }
.auth-form label.auth-keep { flex-direction: row; align-items: center; gap: 8px; margin: -2px 2px 0; cursor: pointer; user-select: none; }
.auth-form label.auth-keep input { width: 17px; height: 17px; margin: 0; }
.inp { position: relative; display: flex; align-items: center; }
.auth-form label.inp, .auth-modal label.inp { flex-direction: row; gap: 0; }
.inp > .ic { position: absolute; inset-block-start: 50%; margin-top: -8.5px; inset-inline-start: 16px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.inp input { height: 48px; padding-inline-start: 44px; border-radius: 14px; background: var(--input-bg); border-color: var(--input-line); font-size: 15px; }
.inp input[type=password], .inp input[name=password] { padding-inline-end: 44px; }
.pw-eye { position: absolute; inset-block-start: 50%; margin-top: -16px; inset-inline-end: 8px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--faint); cursor: pointer; }
.pw-eye:hover, .pw-eye.on { color: var(--accent); background: var(--hover); }
.pw-eye .ic { width: 18px; height: 18px; }
.auth-go { width: 100%; height: 52px; margin-top: 2px; border-radius: 15px; background: var(--btn-grad) !important; font-size: 17px; font-weight: 800; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent) !important; }
.auth-go .ic { width: 20px; height: 20px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; }
.forgot-slot a, .auth-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.forgot-slot a { margin: 0 !important; line-height: 1.4; }
.forgot-slot a:hover, .auth-link:hover { color: var(--accent); text-decoration: none; }
.auth-link .ic { width: 15px; height: 15px; }
.auth-error { margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font-weight: 600; font-size: 14px; text-align: start; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--faint); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { display: flex; gap: 10px; }
.auth-alt .btn { flex: 1; height: 48px; border-radius: 14px; font-size: 15px; font-weight: 800; }
.auth-alt .btn .ic { width: 19px; height: 19px; }
.alt-guest { background: var(--toggle-bg); border-color: var(--input-line); color: var(--text); }
.auth-card.on-guest .alt-guest { display: none; }
.auth-card.on-guest .only-guest-alt { display: none; } /* no «New account» under the card: the «or» line goes too */
.alt-reg { background: linear-gradient(135deg, #ffb04f, #ff8216) !important; color: #fff !important; border: 0; box-shadow: 0 10px 22px rgba(255, 130, 22, .35); }
.alt-reg.active { box-shadow: 0 0 0 3px rgba(255, 130, 22, .35); }
.auth-feat { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 0; border: 0; background: none; color: var(--orange); font-weight: 800; font-size: 14.5px; }
.auth-feat .ic { width: 17px; height: 17px; }
.auth-feat:hover { text-decoration: underline; }
/* readable small texts of the sign-in card (contrast 4.5:1 on light and dark themes): the muted / orange colour leans to the text colour */
#auth :is(.tab:not(.active), .auth-keep span, .vc-ac-forgot) { color: color-mix(in srgb, var(--muted) 60%, var(--text)); }
#auth .auth-feat { color: color-mix(in srgb, var(--orange) 60%, var(--text)); }
.play-badge { display: flex; align-items: center; gap: 9px; margin: 14px auto 0; padding: 7px 16px 7px 12px; border-radius: 10px; background: #000; color: #fff; border: 1px solid #a6a6a6; text-decoration: none; line-height: 1.05; width: max-content; }
.play-badge svg { width: 26px; height: 26px; flex: none; }
.play-badge span { display: flex; flex-direction: column; text-align: left; }
.play-badge small { font-size: 10.5px; letter-spacing: .02em; }
.play-badge b { font-size: 17px; font-weight: 600; }
.play-badge:hover { background: #1a1a1a; }
.play-badge[hidden] { display: none; }
.land-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; text-align: center; }
.land-foot p { margin: 0; }
.land-foot a { color: var(--muted); }
.land-foot p:first-child a { color: var(--accent); font-weight: 700; }
.land-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.land-foot nav a, .land-foot .auth-link { font-size: 13.5px; color: var(--muted); }
.land-foot .powered { font-size: 12px; opacity: .85; }
.land-foot .powered a { font-weight: 700; }
.vc-ac-contact-link { position: static !important; }
/* modal dialogs (register / language / features) */
.auth-modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 16px; background: rgba(20, 35, 70, .45); backdrop-filter: blur(3px); }
.auth-modal.in { display: grid; animation: fade-in .15s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.auth-modal-card { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 26px 22px 22px; border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); text-align: start; }
.auth-modal-card.sm { width: min(320px, 100%); }
.auth-modal-card h3 { margin: 0 0 16px; font-size: 18px; font-weight: 800; }
.auth-modal .auth-form { display: flex; }
.auth-x { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text); }
.auth-x:hover { background: var(--hover); }
.auth-x .ic { width: 16px; height: 16px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
.fld input, .fld select { height: 46px; border-radius: 12px; background: var(--input-bg); border-color: var(--input-line); }
.lang-list { display: flex; flex-direction: column; }
.lang-list a { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 600; }
.lang-list a:last-child { border-bottom: 0; }
.lang-list a:hover { background: var(--hover); text-decoration: none; }
.lang-list a.on { color: var(--accent); }
.lang-list .ic { width: 18px; height: 18px; margin-inline-start: auto; }
.lang-code { display: grid; place-items: center; width: 34px; height: 24px; border-radius: 6px; background: var(--panel3); color: var(--muted); font-size: 11.5px; font-weight: 800; }
.feat-list { display: flex; flex-direction: column; gap: 14px; }
.feat-item { display: flex; gap: 12px; align-items: flex-start; }
.feat-item b { display: block; font-size: 15px; }
.feat-item p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.feat-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--btn-grad); color: var(--on-accent); }
.feat-ic .ic { width: 21px; height: 21px; }
/* phones + centered layout: live panel on top, card below */
@media (max-width: 900px) {
  .landing { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) { .landing .land-info { padding: 18px 16px 40px; } }
.landing.layout-center { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) {
  .land-info { gap: 14px; border-radius: 0 0 30px 30px; }
  .land-logo img { height: 40px; }
  .land-brand h1 { font-size: 19px; }
  .land-live { margin-top: 0; justify-content: center; gap: 14px; }
  .live-orb { width: 90px; height: 90px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 0 0 8px rgba(255, 255, 255, .04); }
  .live-orb span { width: 70px; height: 70px; }
  .live-orb .ic { width: 30px; height: 30px; }
  .live-n { font-size: 50px; }
  .live-lbl { font-size: 17px; }
  .live-txt small { display: none; }
  .land-rooms { padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; }
  .lr-head { display: none; }
  .lr-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .lr-list::-webkit-scrollbar { display: none; }
  .lr-row { display: flex; flex: none; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 14px; background: rgba(255, 255, 255, .12); }
  .lr-bar { display: none; }
  .lr-tile { width: 32px; height: 32px; border-radius: 9px; }
  .lr-tile img { width: 22px; height: 22px; }
  .lr-name { font-size: 14px; max-width: 140px; }
  .lr-n { font-size: 14px; }
  .chips-row { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 4px 16px; }
  .chips-row::-webkit-scrollbar { display: none; }
  .land-chips .chip { padding: 9px 15px; font-size: 14px; }
  .chips-dots { display: none; }
  .land-side { justify-content: flex-start; padding: 0 16px 24px; margin-top: -26px; background: transparent; gap: 22px; }
  .auth-card { padding: 26px 18px 22px; border-radius: 22px; }
  .auth-title { font-size: 24px; }
  .auth-modal { padding: 0; align-items: end; }
  .auth-modal-card { width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh; }
}
.landing.layout-center .land-info { border-radius: 0 0 30px 30px; padding-bottom: 48px; }
.landing.layout-center .land-info > * { width: min(720px, 100%); margin-inline: auto; }
.landing.layout-center .land-live { margin-top: 0; justify-content: center; }
.landing.layout-center .land-side { justify-content: flex-start; margin-top: -30px; background: transparent; }
@media (min-width: 901px) {
  .landing.layout-split .land-info { min-height: 100vh; min-height: 100dvh; justify-content: flex-start; }
  .landing.layout-split .land-live { justify-content: flex-start; }
}
/* phones / small tablets: rooms = snap carousel kept inside the gutters, edge fades set by JS (--fs/--fe) */
@media (max-width: 900px) {
  .landing .land-info { padding-top: calc(18px + env(safe-area-inset-top, 0px)); padding-inline: calc(16px + env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-right, 0px)); }
  .landing .land-side { padding-inline: calc(16px + env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-right, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .land-brand h1 { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; text-wrap: balance; }
  .land-brand small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.4; }
  .lr-list { --fl: 0px; --fr: 0px; margin-inline: 0; padding: 2px 0; gap: 8px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); }
  .lr-row { flex: 0 0 auto; width: 172px; min-width: 0; scroll-snap-align: start; padding-inline: 6px 12px; }
  .lr-name { flex: 1; min-width: 0; max-width: none; }
  [dir=ltr] .lr-name { text-align: left; } [dir=rtl] .lr-name { text-align: right; }
  .lr-n { flex: none; }
}
@media (max-width: 760px), (max-width: 900px) and (max-height: 500px) {
  .landing .land-info { gap: 11px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: 36px; }
  .land-brand { gap: 10px; align-items: center; }
  .land-logo { flex: none; }
  .land-logo img { height: 38px; max-width: 120px; }
  .land-brand h1 { font-size: 17px; line-height: 1.3; }
  .land-brand small { font-size: 12.5px; opacity: .82; }
  /* compact live counter: mini orb + "● 1 online now" on one line */
  .landing .land-info > .land-live { width: auto; margin-inline: auto; }
  .land-live { align-self: center; gap: 10px; padding: 3px 4px; padding-inline-end: 16px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
  .live-orb { width: 36px; height: 36px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); }
  .live-orb::before { inset: 1px; border-width: 1.5px; }
  .live-orb span { width: 30px; height: 30px; box-shadow: 0 4px 12px rgba(255, 120, 20, .4); }
  .live-orb .ic { width: 15px; height: 15px; }
  .live-txt { flex-direction: row; align-items: center; gap: 7px; }
  .live-lbl { display: contents; font-size: 15px; }
  .live-dot { order: -1; width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(255, 138, 31, .28); }
  .live-n { font-size: 22px; line-height: 1; font-weight: 800; letter-spacing: 0; color: #fff; }
  .lr-tile img { width: 22px; height: 22px; }
  .lr-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; row-gap: 0; align-items: center; width: calc((100% - 16px) / 2.35); max-width: 168px; padding: 6px 12px 6px 6px; padding-inline: 6px 12px; }
  .lr-tile { grid-row: 1 / 3; width: 32px; height: 32px; }
  .lr-name { font-size: 13.5px; line-height: 1.3; }
  .lr-n { justify-content: flex-start; font-size: 12px; font-weight: 700; gap: 4px; opacity: .85; line-height: 1.2; }
  [dir=rtl] .lr-n { justify-content: flex-end; }
  .lr-n .ic { width: 11px; height: 11px; }
  /* feature chips: two neat rows instead of a clipped strip */
  .chips-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-inline: 0; padding: 0; overflow: visible; }
  .land-chips .chip { justify-content: center; min-width: 0; padding: 8px 10px; font-size: 13.5px; }
  .land-chips .chip .ic { width: 16px; height: 16px; flex: none; }
  .land-chips .chip.on { transform: none; box-shadow: 0 6px 16px rgba(255, 130, 22, .35); }
  .landing .land-side { margin-top: -24px; gap: 20px; }
  .auth-card { padding: 22px 16px 20px; }
  .auth-title { font-size: 22px; }
  .auth-sub { margin: 2px 0 14px; font-size: 13.5px; }
  .tabs { margin-bottom: 12px; }
  .tab { padding: 8px; }
  .auth-form { gap: 10px; }
  .inp input { height: 46px; }
  .auth-go { height: 50px; }
}
/* phones: one clean brand row (logo, name, live count, language), compact rooms, the form right under it; no decorative layers */
.tab-reg, .land-lang { display: none; }
@media (max-width: 760px) {
  .landing .land-info { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; row-gap: 14px; padding-bottom: 36px; }
  .land-info::before, .land-info::after, .land-chips { display: none; }
  .landing .land-info > .land-brand { grid-column: 1; grid-row: 1; width: auto; min-width: 0; margin: 0; }
  .land-brand small { display: none; }
  .land-brand h1 { -webkit-line-clamp: 1; line-clamp: 1; font-size: 17px; }
  .land-logo img { height: 34px; filter: none; }
  .landing .land-info > .land-live { grid-column: 2; grid-row: 1; width: auto; margin: 0; gap: 7px; padding: 6px 12px; }
  .live-orb { display: none; }
  .live-lbl { display: inline-flex; order: -1; font-size: 0; }
  .live-dot { animation: none; box-shadow: 0 0 0 3px rgba(255, 138, 31, .3); }
  .live-n { font-size: 17px; }
  .landing .land-info > .land-lang { grid-column: 3; grid-row: 1; display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .12); color: #fff; }
  .land-lang .ic { width: 18px; height: 18px; }
  .landing .land-info > .land-rooms { grid-column: 1 / -1; width: auto; margin: 0; }
  .lr-list { -webkit-mask-image: none; mask-image: none; }
  .tab-reg { display: block; }
  .tabs .tab { padding: 9px 4px; font-size: 14px; }
  .tabs .tab.active { box-shadow: none; }
  .auth-or, .auth-alt, .auth-row .auth-link, .land-foot .auth-link[data-open="lang-modal"] { display: none; }
  .auth-row:has(.forgot-slot:empty) { display: none; }
  .auth-card { box-shadow: 0 6px 20px rgba(40, 70, 130, .10); }
  .auth-go { box-shadow: none !important; }
  .auth-modal { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20, 35, 70, .55); }
}
@media (prefers-reduced-motion: reduce) { .live-orb::before, .live-dot { animation: none; } }
@media (min-width: 761px) and (max-width: 900px) and (max-height: 500px) {
  .chips-row { grid-template-columns: repeat(4, max-content); justify-content: center; }
}

/* ---------- static pages / install / maintenance ---------- */
.land-nav.slim { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: var(--top-h); padding: 4px 16px; background: var(--bar-grad); color: var(--bar-text); box-shadow: 0 2px 10px rgba(20, 50, 100, .18); }
.land-nav.slim .brand { color: var(--bar-text); font-size: 17px; }
.land-nav.slim .brand img { width: auto; height: 36px; }
.land-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.land-links > a { padding: 6px 12px; border-radius: 99px; color: var(--bar-text); font-weight: 700; opacity: .88; }
.land-links > a:hover, .land-links > a.active { opacity: 1; background: var(--bar-hover); text-decoration: none; }
@media (max-width: 560px) { .land-nav.slim .brand span { display: none; } .land-links > a { padding: 5px 8px; font-size: 13px; } }
.vc-page { min-height: 100%; background: var(--bg); background-image: var(--logbg); }
.page-wrap { width: min(860px, 100%); margin: 0 auto; padding: 32px 16px 48px; }
.page-wrap.center { text-align: center; padding-top: 14vh; }
.page-title { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.page-title h1 { margin: 0; font-size: 30px; }
.page-content { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; line-height: 1.75; box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
/* owner-made pages: the few tags Services\Pages keeps */
.page-rich > :first-child { margin-top: 0; }
.page-rich > :last-child { margin-bottom: 0; }
.page-rich h2, .page-rich h3, .page-rich h4 { margin: 1.2em 0 .4em; line-height: 1.35; }
.page-rich h2 { font-size: 22px; } .page-rich h3 { font-size: 18px; } .page-rich h4 { font-size: 16px; }
.page-rich p { margin: 0 0 .9em; }
.page-rich ul, .page-rich ol { margin: 0 0 .9em; padding-inline-start: 1.4em; }
.page-rich blockquote { margin: 0 0 .9em; padding: 6px 14px; border-inline-start: 4px solid var(--accent); background: var(--panel-2, rgba(127, 127, 127, .08)); border-radius: 8px; }
.page-rich a { color: var(--accent); text-decoration: underline; }
.page-rich hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
/* login page: the owner's background picture under the live panel (Admin › Appearance), darkened for the white text */
.land-info.has-bg { background: linear-gradient(rgba(8, 18, 40, .55), rgba(8, 18, 40, .55)), var(--login-bg) center / cover no-repeat, var(--land-panel); }
.page-back { margin-top: 18px; }
.auth-logo { width: 84px; height: 84px; }
.maint-art { position: relative; display: inline-block; margin-bottom: 8px; }
.gear-spin { position: absolute; inset-block-end: -6px; inset-inline-end: -14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--accent); animation: spin 6s linear infinite; }
.install-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.install-head h1 { flex: 1; margin: 0; }
.install-head .auth-logo { width: 56px; height: 56px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--danger); }
@media (max-width: 760px) {
  .row2 { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr; }
}

/* ---------- admin ---------- */
.vc-admin { min-height: 100%; }
.adm { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.adm-nav { background: var(--panel); border-inline-end: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.adm-nav .brand { padding: 6px 8px 16px; }
.adm-nav > a:not(.brand) { padding: 9px 12px; border-radius: 9px; color: var(--text); }
.adm-nav > a:not(.brand):hover { background: var(--panel2); text-decoration: none; }
.adm-nav > a.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-weight: 700; }
.adm-nav .back { margin-top: auto; color: var(--muted) !important; }
.adm-nav .ver { color: var(--muted); padding: 6px 12px; }
.adm-main { padding: 22px 26px; min-width: 0; }
.adm-main h1 { margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
details.card summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.card[open] summary { margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.stat b { font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
table.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.u { display: inline-flex; align-items: center; gap: 8px; }
.u img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--panel2); margin-inline-start: 4px; }
.tag.red { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.tag.orange { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.tag.green { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.toolbar, .inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; flex-direction: row; }
.toolbar input, .inline-form input, .inline-form select, .toolbar select { width: auto; flex: 1; min-width: 140px; }
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.flash.err { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subnav a { padding: 7px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.subnav a.active { border-color: var(--accent); color: var(--accent); }
.set-row { display: grid; grid-template-columns: 280px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.set-row label { display: flex; flex-direction: column; }
.set-row small { color: var(--muted); font-weight: 400; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; inset-block-start: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir=rtl] .switch input:checked + span::before { transform: translateX(-20px); }
.user-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.user-head img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.user-head h2 { margin: 0; }
.action-forms { display: flex; flex-direction: column; gap: 8px; }
.action-forms form { display: flex; gap: 8px; align-items: center; }
.action-forms input { width: 120px; flex: none; }
.action-forms input[name=reason] { flex: 1; width: auto; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.pager a.active { background: var(--accent); color: var(--accent-text); }
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .adm-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .adm-nav .back, .adm-nav .ver { margin-top: 0; }
  .grid2, .set-row { grid-template-columns: 1fr; }
  .adm-main { padding: 16px; }
  table.list { display: block; overflow-x: auto; }
}
.profile-cover.has-img { background-size: cover; background-position: center; height: 150px; }
/* login layout: centered variant */
.maint-text { max-width: 560px; margin-inline: auto; }
.pm-msg { position: relative; align-items: center; gap: 2px; }
.pm-more { order: 2; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--faint); opacity: 0; transition: opacity .12s; }
.pm-msg.mine .pm-more { order: 0; }
.pm-msg.theirs .pm-bubble { order: 1; }
.pm-more .ic { width: 15px; height: 15px; }
.pm-msg:hover .pm-more, .pm-more.pop-open { opacity: 1; }
.pm-more:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .pm-more { opacity: .6; } }
/* name blocks sit below the cover banner */
.ucard-top { align-items: flex-start; }
.ucard-name { margin-top: 36px; }
.profile-head { align-items: flex-start; }
.profile-id { margin-top: 58px; }
.toasts { inset-inline-end: auto; left: 50%; transform: translateX(-50%); align-items: center; }
.conv-info small .emo, .reply-quote .emo, .reply-info .emo { width: 16px; height: 16px; vertical-align: -3px; }
.conv-info small .mention-tag, .reply-quote .mention-tag { pointer-events: none; }
@media (max-width: 760px) { .toasts { left: 10px; right: 10px; transform: none; } }
/* phones: the top of the log (room card, "Load earlier messages") is on screen -> toasts sit above the log's bottom edge */
.toasts.low { inset-block-start: auto !important; inset-block-end: var(--toast-low, 90px); flex-direction: column-reverse; }
/* landscape phones: the log is short - narrow toasts in the end corner, clear of the room title (start) and the centred "Load earlier" */
@media (max-height: 500px) and (min-width: 761px) { .toasts.low { left: auto; right: auto; inset-inline-end: 10px; transform: none; width: min(320px, 38vw); align-items: stretch; } }

/* ==========================================================================
   Admin › Display layouts (body.menu-* / body.msgs-*). Default: menu-bar + msgs-rows = sky layout.
   ========================================================================== */
/* menu "icons": compact bars without labels */
.menu-icons .topbar .bar-label, .menu-icons .bottombar .bar-label { display: none; }
.menu-icons .topbar .bar-btn, .menu-icons .bottombar .bar-btn { min-width: 46px; }
.menu-icons .bar-btn .bar-ic { height: 26px; }
/* menu "rail": the menu stays open as a column at the start side on large screens */
@media (min-width: 1100px) {
  .menu-rail .app { grid-template-columns: 250px var(--side-w) minmax(0, 1fr); grid-template-areas: "top top top" "rail side main" "bot bot bot"; }
  body.menu-rail.panel-hidden .app { grid-template-columns: 250px 0 minmax(0, 1fr); }
  .menu-rail .appbar {
    grid-area: rail; position: relative; inset: auto; z-index: 20; width: auto; max-width: none; max-height: none; min-height: 0;
    visibility: visible; opacity: 1; transform: none; transition: none; border: 0; border-inline-end: 1px solid var(--line); border-radius: 0; box-shadow: none;
  }
  .menu-rail .drawer-btn { display: none; }
}
/* messages "bubbles": rounded speech bubbles, own messages tinted */
.msgs-bubbles .msg, .msgs-bubbles .msg:nth-child(even of .msg, .msg-sys.jl-row) { background: transparent; border-bottom: 0; padding-block: 5px; }
.msgs-bubbles .msg:hover { background: transparent; }
.msgs-bubbles .msg-bubble:not(.custom):not(.action) { padding: 7px 13px; border-radius: 4px 16px 16px 16px; background: var(--panel); box-shadow: 0 1px 2px rgba(20, 40, 80, .12); }
.msgs-bubbles .msg.mine .msg-bubble:where(:not(.custom):not(.action):not([class*="bub-"])) { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); } /* low weight: a worn message frame (add-on) goes over it */
.msgs-bubbles .msg.mention .msg-bubble:not(.custom) { box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 55%, transparent); }
/* messages "compact": one line per message, small avatars, no stripes */
.msgs-compact .msg, .msgs-compact .msg:nth-child(even of .msg, .msg-sys.jl-row) { grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 8px; padding: 3px 10px; background: transparent; border-bottom: 0; }
.msgs-compact .msg:hover { background: var(--row-hover); }
.msgs-compact .msg-av .avatar { width: 24px !important; height: 24px !important; box-shadow: none; }
.msgs-compact .msg-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.msgs-compact .msg-head { margin: 0; min-height: 0; font-size: 14px; }
.msgs-compact .msg-name { font-size: 14px; }
.msgs-compact .msg-head::after { content: ":"; color: var(--faint); }
.msgs-compact .msg-text { font-size: calc(14px * var(--mz, 1)); }
.msgs-compact .msg.cont { padding-top: 0; }
.msgs-compact .msg-meta { padding-top: 0; }

/* ---------- room lobby (room chooser) ---------- */
.lobby { max-width: 920px; margin: 0 auto; padding: 18px 14px 28px; }
.lobby-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lobby-head > .ic { width: 42px; height: 42px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex: none; }
.lobby-head h2 { margin: 0 0 2px; font-size: 20px; }
.lobby-head p { margin: 0; }
.lobby-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lobby-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); text-align: start; transition: border-color .15s, transform .15s; }
.lobby-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.lobby-card.pinned { border-inline-start: 4px solid var(--accent); }
.lobby-ic { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; flex: none; background: var(--panel2); }
.lobby-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.lobby-info b { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lobby-info small { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body.in-lobby .topic-box, body.in-lobby #room-edit { display: none !important; }
.pin-ic { color: var(--accent); }
.room-card.pinned .room-card-info b { color: var(--text); }
@media (max-width: 760px) { .lobby-grid { grid-template-columns: 1fr; } .lobby { padding: 12px 10px 20px; } }

/* Touch devices: form fields must be >= 16px, otherwise mobile browsers (iOS Safari) auto-zoom the page on focus
   and leave it zoomed. Applies to every input/textarea/select in the chat, dialogs and login. */
@media (pointer: coarse) {
  /* !important: module fields (wall comments, store search, live comments, ...) set their own smaller size with class
     selectors that would win, and iOS then zooms on focus (owner 2026-11-21) */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea, [contenteditable="true"], #msg-input, .inp input { font-size: 16px !important; }
}

/* user card with a real cover picture */
.ucard-cover.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* ==========================================================================
   Member actions: user card, quick buttons, "More" sheet, moderation dialog
   Colour language: social = neutral, broadcast = blue, room = orange, moderation = red
   ========================================================================== */
:root { --ua-social: var(--text); --ua-broadcast: #58a6ff; --ua-room: #ff9f45; --ua-mod: #ff5d6c; --ua-staff: #ad92ff; --ua-report: var(--muted); }
[data-theme="sky"], :root:not([data-theme]), [data-theme="light"], [data-theme="rose"] { --ua-broadcast: #1f6fd6; --ua-room: #d76c08; --ua-mod: #d93a42; --ua-staff: #6a48cc; }
.uag-social { --g: var(--ua-social); } .uag-broadcast { --g: var(--ua-broadcast); } .uag-room { --g: var(--ua-room); }
.uag-moderation { --g: var(--ua-mod); } .uag-staff { --g: var(--ua-staff); } .uag-report { --g: var(--ua-report); }

/* user card */
.ucard-pop { width: 330px; }
.ucard-head { cursor: pointer; border-radius: 16px 16px 0 0; outline: none; }
.ucard-head:hover .uname, .ucard-head:focus-visible .uname { text-decoration: underline; text-underline-offset: 3px; }
.ucard-cover { height: 84px; }
.ucard-top { margin-top: -36px; }
.ucard-top .avatar { width: 72px; height: 72px; }
.ucard-name { margin-top: 40px; flex: 1; }
.ucard-line { flex-wrap: wrap; }
.ucard-sub { display: flex; align-items: center; gap: 6px; }
.ucard-flag { font-size: 15px; line-height: 1; }
.ucard-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.ucard-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel2); color: var(--text); font-size: 12.5px; font-weight: 700; }
.ucard-chip .ic { width: 14px; height: 14px; }
button.ucard-chip.lvl { color: var(--accent); cursor: pointer; }
button.ucard-chip.lvl:hover { border-color: var(--accent); }
.ucard-mood { margin-top: 8px; }
.ucard-actions { padding: 12px 14px 0; }
.uq-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.uq-btn { --g: var(--ua-social); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; transition: background .12s, border-color .12s; }
.uq-btn > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; overflow-wrap: anywhere; }
.uq-btn .ic, .uq-btn .ic-img { width: 22px; height: 22px; flex: none; color: var(--g); }
.uq-btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--hover); }
.uq-btn:focus-visible, .uq-mini:focus-visible, .uas-item:focus-visible, .md2-act:focus-visible, .md2-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uq-btn.main { background: var(--grad); border-color: transparent; color: var(--on-accent); }
.uq-btn.main .ic { color: currentColor; }
.uq-btn.uq-friend[data-action="fr_cancel"] { border-style: dashed; color: var(--muted); }
.uq-btn.uq-friend[data-action="fr_accept"] { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.uq-btn.uq-friend[data-action="fr_accept"] .ic { color: var(--ok); }
.uq-btn.uq-more .ic { color: var(--muted); }
.uq-wait { display: grid; place-items: center; border-style: dashed; background: transparent; }
.uq-minirow { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 34px; }
.uq-mini { --g: var(--ua-social); display: grid; place-items: center; width: 36px; height: 34px; padding: 0; border: 1px solid color-mix(in srgb, var(--g) 30%, var(--line)); border-radius: 10px; background: transparent; color: var(--g); }
.uq-mini.uag-social { color: var(--muted); }
.uq-mini:hover { background: color-mix(in srgb, var(--g) 10%, transparent); }
.uq-mini .ic { width: 18px; height: 18px; }
.uq-mini[data-action="av_watch"] { position: relative; }
.uq-mini[data-action="av_watch"]::after { content: ""; position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--panel); }
.ucard-plink { display: inline-flex; align-items: center; gap: 2px; padding: 6px 4px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 800; }
.ucard-plink .ic { width: 14px; height: 14px; }
.ucard-plink:hover { text-decoration: underline; }
/* phones: the card is a bottom sheet */
.ucard-modal .modal-body { padding: 0; }
.ucard-modal .ucard { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.ucard-modal .ucard-cover { height: 104px; }
.ucard-modal .ucard-top, .ucard-modal .ucard-chips, .ucard-modal .ucard-actions { padding-inline: 16px; }
.ucard-modal .ucard-mood { margin-inline: 16px; }

/* full profile: one action bar */
.profile-actions.ua-bar { display: block; padding: 14px 22px 0; }
.ua-bar .uq-btn { flex-direction: row; gap: 8px; min-height: 44px; padding: 8px 12px; font-size: 13.5px; }
.ua-bar .uq-btn .ic { width: 19px; height: 19px; }

/* "More" sheet: titled sections */
.uas-modal .modal-body { padding: 12px 16px 18px; }
.uas-target { display: flex; align-items: center; gap: 10px; padding: 2px 2px 4px; }
.uas-target .avatar { width: 40px; height: 40px; }
.uas-who { min-width: 0; }
.uas-name { display: flex; align-items: center; gap: 5px; font-weight: 800; }
.uas-who small { color: var(--muted); font-size: 12.5px; }
.uas-sec { margin-top: 10px; padding: 10px; border: 1px solid color-mix(in srgb, var(--g) 22%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--g) 4%, var(--panel)); }
.uas-sec.uag-social, .uas-sec.uag-report { border-color: var(--line); background: var(--panel); }
.uas-sec.uag-moderation { border-inline-start: 3px solid var(--g); }
.uas-title { display: flex; align-items: center; gap: 6px; margin: 0 2px 8px; color: var(--g); font-size: 12px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.uas-sec.uag-social .uas-title, .uas-sec.uag-report .uas-title { color: var(--muted); }
.uas-title .ic { width: 15px; height: 15px; }
.uas-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.uas-item { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); font-size: 13.5px; font-weight: 600; text-align: start; }
.uas-item:hover { border-color: color-mix(in srgb, var(--g) 45%, var(--line)); background: color-mix(in srgb, var(--g) 7%, var(--panel)); }
.uas-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--g) 14%, transparent); color: var(--g); }
.uas-sec.uag-social .uas-ic, .uas-sec.uag-report .uas-ic { background: var(--panel2); color: var(--text); }
.uas-ic .ic, .uas-ic .ic-img { width: 17px; height: 17px; }
.uas-label { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.uas-item.danger { color: var(--ua-mod); }
.uas-item.danger .uas-ic { background: color-mix(in srgb, var(--ua-mod) 14%, transparent); color: var(--ua-mod); }

/* unified moderation dialog */
.md2 { gap: 16px; }
.md2-who { min-width: 0; }
.md2-who > div { display: flex; align-items: center; gap: 5px; font-weight: 800; }
.md2-who small { color: var(--muted); font-size: 12px; }
.md2-target .avatar { width: 36px; height: 36px; }
.md2-field { display: flex; flex-direction: column; gap: 7px; }
.md2-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; }
.md2-act { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 700; text-align: start; }
.md2-act .ic { width: 17px; height: 17px; flex: none; color: var(--ua-mod); }
.md2-act span { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.md2-act:hover { border-color: color-mix(in srgb, var(--ua-mod) 40%, var(--line)); }
.md2-act.active { border-color: var(--ua-mod); background: color-mix(in srgb, var(--ua-mod) 10%, var(--panel)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ua-mod) 22%, transparent); }
.md2-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.md2-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel2); color: var(--text); font-size: 12.5px; font-weight: 700; }
.md2-chip .ic { width: 13px; height: 13px; }
.md2-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.md2-chip.active { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.md2-custom { display: flex; gap: 6px; }
.md2-opts { display: flex; flex-direction: column; gap: 6px; }
.md2-custom input { width: 110px; flex: none; }
.md2-custom select { flex: 1; width: auto; }
.md2-qr .md2-chip { background: transparent; color: var(--muted); font-weight: 600; }
.md2-qr .md2-chip:hover { color: var(--text); }
.md2-modal .modal-foot .btn .ic { width: 17px; height: 17px; }
@media (max-width: 760px) {
  .profile-actions.ua-bar { padding-inline: 16px; }
  .ua-bar .uq-btn { flex-direction: column; gap: 3px; min-height: 58px; padding: 8px 4px; font-size: 12px; }
  .ua-bar .uq-btn .ic { width: 21px; height: 21px; }
  .uas-modal .modal-body { padding-inline: 12px; }
  .md2-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.md2-room { --ua-mod: var(--ua-room); }

/* "Commands" button for staff viewers */
.uq-btn.uq-cmd .ic { color: var(--ua-mod, var(--danger)); }

/* temporary panel title row (messages, rooms, wall...) with a back arrow instead of an extra tab */
.sp-head.show { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.sp-head.show h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-back { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--text); flex: none; }
.sp-back:hover { background: var(--hover); }
.sp-back .ic { width: 18px; height: 18px; }
[dir="rtl"] .sp-back .ic { transform: scaleX(-1); }

/* quick text-style panel (composer T button) */
.qstyle-pop { width: 340px; padding: 12px; }
.qstyle { display: flex; flex-direction: column; gap: 10px; }
.qs-preview { padding: 8px; border-radius: 12px; background: var(--log-bg); border: 1px solid var(--line); }
.qs-preview .msg-bubble { display: inline-block; max-width: 100%; }
.qs-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qs-tg { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 800; color: var(--text); }
.qs-tg:nth-child(2) { font-style: italic; font-family: serif; }
.qs-tg.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.qs-fonts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.qs-chip { min-width: 0; height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.qs-chip.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.qs-bubbles { gap: 6px; }
.qs-more { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--accent); font-weight: 700; }
.qs-more:hover { background: var(--hover); }
.qs-more .ic { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .qstyle-pop { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

.qs-head { display: flex; align-items: center; gap: 8px; position: relative; }
.qs-head strong { flex: 1; font-size: 14px; }
.qs-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); flex: none; }
.qs-x .ic { width: 16px; height: 16px; }
.qs-grip { display: none; }
@media (max-width: 760px) {
  /* bottom sheet: grab handle, dimmed page behind (tap outside closes), visible close button */
  .qstyle-pop { box-shadow: 0 0 0 100vmax rgba(10, 16, 30, .45), 0 -8px 30px rgba(0,0,0,.18); max-height: 85vh; overflow-y: auto; }
  .qs-grip { display: block; position: absolute; inset-block-start: -6px; inset-inline-start: 50%; width: 42px; height: 5px; border-radius: 3px; background: var(--line); transform: translateX(-50%); }
  [dir="rtl"] .qs-grip { transform: translateX(50%); }
  .qs-head { padding-top: 6px; }
}

/* popovers taller than the visible screen scroll as one piece (iOS-safe) */
.popover.pop-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.popover.pop-scroll .menu-list { max-height: none; overflow: visible; }

/* avatar menu: current status row + expandable list */
.status-box { margin: 0 8px 4px; }
.status-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--text); font-size: 14px; font-weight: 600; text-align: start; }
.status-row:hover { background: var(--hover); }
.status-row .status-cur { flex: 1; }
.status-row .status-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.status-row[aria-expanded="true"] .status-chev { transform: rotate(180deg); }
.status-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding: 4px; border-radius: 12px; background: var(--bg2); }
.status-list[hidden] { display: none; }
.status-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 13.5px; text-align: start; }
.status-opt:hover { background: var(--hover); }
.status-opt.active { background: var(--panel); font-weight: 700; box-shadow: var(--shadow-sm); }
.status-opt span { flex: 1; }
.status-opt .status-check { width: 16px; height: 16px; color: var(--accent); }

/* avatar menu: status opens as a sub-page that slides in (no inline expansion) */
.mm-views { overflow: hidden; }
.mm-view[hidden] { display: none; }
.mm-in-r { animation: mm-in-r .18s ease-out; }
.mm-in-l { animation: mm-in-l .18s ease-out; }
@keyframes mm-in-r { from { transform: translateX(24px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes mm-in-l { from { transform: translateX(-24px); opacity: .3; } to { transform: none; opacity: 1; } }
[dir="rtl"] .mm-in-r { animation-name: mm-in-l; }
[dir="rtl"] .mm-in-l { animation-name: mm-in-r; }
.mm-subhead { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mm-subhead strong { font-size: 15px; }
.mm-back { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); }
.mm-back .ic { width: 18px; height: 18px; }
[dir="rtl"] .mm-back .ic { transform: scaleX(-1); }
.mm-sub .status-list { margin: 4px 8px 8px; background: transparent; padding: 0; }
.status-row .status-chev { transform: rotate(-90deg); }
[dir="rtl"] .status-row .status-chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .mm-in-r, .mm-in-l { animation: none; } }

/* ==========================================================================
   UI polish: compact topic on phones, popovers that fit the screen, touch targets, contrast tokens
   ========================================================================== */
/* room topic: 2 lines on phones, 1 line on short (landscape) screens, tap to read it all (no nested scroller) */
@media (max-width: 760px), (max-height: 500px) {
  .topic-box { align-items: center; gap: 9px; padding-block: 7px; padding-inline: 8px 36px; }
  .topic-ic { width: 30px; height: 30px; }
  .topic-ic .ic { width: 18px; height: 18px; }
  .topic-ic b { font-size: 12px; }
  .topic-txt b { font-size: 13px; line-height: 1.3; }
  .topic-txt p { max-height: none; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 13.5px; line-height: 1.45; }
  .topic-box.clamped { cursor: pointer; }
  .topic-box.open .topic-txt p { display: block; max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
  .topic-x { inset-block-start: 50%; margin-top: -13px; }
  .topic-box.open .topic-x { inset-block-start: 6px; margin-top: 0; }
}
@media (max-height: 500px) {
  .topic-box { padding-block: 5px; }
  .topic-ic { width: 26px; height: 26px; }
  .topic-txt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .topic-txt b { flex: none; }
  .topic-txt p { margin: 0; -webkit-line-clamp: 1; line-clamp: 1; flex: 1; min-width: 0; }
  .topic-box.open .topic-txt { display: block; }
}
/* emoji picker inside a height-capped popover: the grid shrinks and scrolls, not the whole popover */
.emoji-pop.pop-scroll { overflow: hidden; }
.emoji-pop .emoji-picker { max-height: calc(var(--pop-h, 100dvh) - 2px); }
/* white labels on the light-blue sky bars: a soft shadow keeps them readable on the pale top of the gradient */
[data-theme="sky"] .bar-label, :root:not([data-theme]) .bar-label { text-shadow: 0 1px 2px rgba(16, 48, 110, .35); }
.bar-btn .count { background: color-mix(in srgb, var(--orange) 82%, #000); }
/* touch screens: the message "…" button is a real tap target */
@media (pointer: coarse) {
  .msg-more { width: 32px; height: 28px; margin-top: -4px; }
  .msg-more .ic { width: 17px; height: 17px; }
}
/* settings on phones: one steady sheet height (no jumping between sections), the section strip stays on top
   and only the section content scrolls */
@media (max-width: 760px) {
  .modal-card.settings-modal { height: 92dvh; }
  .settings-modal .modal-body { overflow: hidden; }
  .settings-modal .settings { grid-template-rows: auto minmax(0, 1fr); height: 100%; }
  .settings-modal .set-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  /* Save: a solid full-width footer of the section (no see-through gradient over the fields); focused fields
     scroll clear of it */
  .settings-modal .set-actions { bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); margin-inline: -16px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 14px -10px rgba(0, 0, 0, .25); }
  .settings-modal .set-content { scroll-padding-block-end: 84px; }
  /* a short section: «Save» still sits at the bottom of the sheet (no empty white strip under it) */
  .settings-modal .set-content { display: flex; flex-direction: column; }
  .settings-modal .set-content > .set-body:has(.set-actions) { flex: 1 0 auto; display: flex; flex-direction: column; }
  .settings-modal .set-body > :has(> .set-actions) { flex: 1 0 auto; display: flex; flex-direction: column; }
  .settings-modal .set-content .set-actions { margin-top: auto; margin-bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); }
}
@media (max-height: 520px) and (pointer: coarse) {
  .modal-card.settings-modal { height: calc(100dvh - 32px); }
  .settings-modal .modal-body { overflow: hidden; }
  .settings-modal .settings { min-height: 0; height: 100%; }
  .settings-modal .set-nav { overflow-y: auto; min-height: 0; }
  .settings-modal .set-content { max-height: none; min-height: 0; overflow-y: auto; }
}
/* "jump to latest" pill: just above the topic card / composer instead of on top of them; the log gets matching
   room below its last row while the pill shows */
.chat-log.pill-gap { padding-bottom: 52px; }
.new-pill { inset-block-end: calc(var(--log-gap, 60px) + 12px); }
@media (max-width: 760px) { .new-pill { inset-block-end: calc(var(--log-gap, 56px) + 10px); } }
/* full profile: a steady height while switching tabs (no jumping sheet / re-centred dialog) */
.modal-card.profile-modal { height: min(760px, calc(100dvh - 32px)); }
@media (max-width: 760px) { .modal-card.profile-modal { height: 92dvh; } }
.seg-tabs { scroll-padding-inline: 16px; }
/* sideways-scrolling tab strips (JS tabStrip): a soft fade only on the side where more tabs are hidden */
.tab-strip { --fade-l: #000; --fade-r: #000; }
.tab-strip.fade-l { --fade-l: transparent; }
.tab-strip.fade-r { --fade-r: transparent; }
.tab-strip.fade-l, .tab-strip.fade-r {
  -webkit-mask-image: linear-gradient(90deg, var(--fade-l), #000 22px, #000 calc(100% - 22px), var(--fade-r));
  mask-image: linear-gradient(90deg, var(--fade-l), #000 22px, #000 calc(100% - 22px), var(--fade-r));
}
/* desktop: the profile tabs wrap onto a second line instead of hiding */
@media (min-width: 761px) { .seg-tabs { flex-wrap: wrap; overflow: visible; } }
/* settings on desktop too: fixed dialog height, the section content scrolls (no re-centring jump per section) */
@media (min-width: 761px) {
  .modal-card.settings-modal { height: min(680px, calc(100dvh - 32px)); }
  .settings-modal .modal-body { overflow: hidden; }
  .settings-modal .settings { min-height: 0; height: 100%; }
  .settings-modal .set-nav { overflow-y: auto; min-height: 0; }
  .settings-modal .set-content { max-height: none; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
/* primary gradients of the light-accent themes: deep enough for white button text and own PM bubbles */
[data-theme="ocean"] { --grad: linear-gradient(135deg, #138da1, #2f6fdf); }
[data-theme="sunset"] { --grad: linear-gradient(135deg, #e0475a, #d9662a); }
[data-theme="rose"] { --grad: linear-gradient(135deg, #d63a7a, #df5a3a); --accent2: #d9542c; }
/* keyboard focus: one consistent ring for every control that has no own focus style */
:is(button, a, [role="button"], [tabindex]):focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 1px; }
:is(.bar-btn, .sp-tab):focus-visible { outline-color: var(--bar-text); outline-offset: -3px; }
.sp-tab:focus-visible { outline-color: var(--accent); }
.menu-item.active { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); }
.menu-item.active .ic { color: var(--accent); }
/* guest name on the coloured "me" card of the app menu */
.ab-me .uname.r-guest { color: color-mix(in srgb, var(--card-text) 82%, transparent); }
/* long member names in the user card / profile header wrap instead of losing their end */
.profile-id h2, .ucard-line { min-width: 0; flex-wrap: wrap; }
.profile-id h2 .uname, .ucard-line .uname, .uas-name .uname { white-space: normal; overflow-wrap: anywhere; }
/* iPhone safe areas (viewport-fit=cover): the bars grow by the notch / home-indicator insets instead of
   squeezing their buttons; in landscape the bars and the chat keep clear of the notch sides */
:root { --top-h: calc(50px + env(safe-area-inset-top, 0px)); --bot-h: calc(48px + env(safe-area-inset-bottom, 0px)); }
.topbar { padding-top: env(safe-area-inset-top, 0px); }
.topbar, .bottombar { padding-left: max(var(--bar-pad, 4px), env(safe-area-inset-left, 0px)); padding-right: max(var(--bar-pad, 4px), env(safe-area-inset-right, 0px)); }
@media (max-width: 760px) { .topbar { --bar-pad: 0px; } }
.chat-main { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
/* sky: the "me" card of the app menu is dark blue, so rank names keep their bright colours there */
[data-theme="sky"] .ab-me, :root:not([data-theme]) .ab-me { --r-owner: #ff7fa3; --r-super: #ffa36f; --r-admin: #ffc94d; --r-mod: #5ee3a6; --r-vip: #cfa6ff; --r-bot: #74c8ff; }

/* ---------- reactions (room + private messages; colours from the theme tokens) ---------- */
.rx-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; max-width: 100%; }
.rx-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--muted); font: inherit; font-size: 12px; line-height: 1;
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background .12s, border-color .12s, transform .1s;
}
.rx-chip:hover { background: var(--hover); color: var(--text); }
.rx-chip:active { transform: scale(.94); }
.rx-chip.on { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); color: var(--text); }
.rx-e { font-size: 15px; line-height: 1; }
.rx-n { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.pm-bubble > .rx-bar { margin: 5px 0 1px; }
.pm-msg.mine .rx-chip { border-color: color-mix(in srgb, var(--on-accent) 35%, transparent); background: color-mix(in srgb, var(--on-accent) 16%, transparent); color: var(--on-accent); }
.pm-msg.mine .rx-chip.on { background: color-mix(in srgb, var(--on-accent) 30%, transparent); border-color: var(--on-accent); }
.rx-row { display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 2px; padding: 6px; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.rx-row::-webkit-scrollbar { display: none; }
.rx-row > * { flex: none; }
.rx-pick.rx-more { background: var(--hover); color: var(--muted); }
.rx-pick.rx-more .ic { width: 20px; height: 20px; }
.menu-pop .rx-row { border-bottom: 1px solid var(--line); }
.rx-pick { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; transition: transform .12s, background .12s; }
.rx-pick:hover { background: var(--hover); transform: scale(1.15); }
.rx-pick.on { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.rx-pop { min-width: 0; }
/* phase 7A: exclusive set (membership perk), hot message, send animation, message text size */
.rx-sep { width: 1px; align-self: stretch; margin: 6px 3px; background: var(--line); }
.rx-pick.plus { position: relative; box-shadow: inset 0 0 0 1px color-mix(in srgb, #f5b301 45%, transparent); }
.rx-pick.locked { filter: grayscale(.85); opacity: .7; }
.rx-pick .rx-lock { position: absolute; inset-inline-end: 1px; bottom: 1px; width: 12px; height: 12px; color: var(--muted); }
.rx-bar.rx-hot .rx-chip { border-color: color-mix(in srgb, #ff7a1a 70%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, #ff7a1a 35%, transparent), 0 0 10px color-mix(in srgb, #ff7a1a 45%, transparent); }
.rx-chip.rx-burst .rx-e { animation: rx-burst .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rx-burst { 0% { transform: scale(.4); } 55% { transform: scale(1.45) rotate(-8deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .rx-chip.rx-burst .rx-e { animation: none; } }
.rx-log { display: flex; flex-direction: column; gap: 2px; max-height: min(60vh, 460px); overflow-y: auto; }
.rx-log-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.rx-log-row .rx-log-e { font-size: 18px; width: 26px; text-align: center; flex: none; }
button.rx-log-who { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.rx-log-row .rx-log-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-log-row small { color: var(--muted); flex: none; }
.rx-log-row.act0 .rx-log-e { opacity: .45; text-decoration: line-through; }
.rx-log-row.act2 .rx-log-e { opacity: .45; }
.mz-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.mz-box output { min-width: 52px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.mz-box .mz-sample { flex: 1 0 100%; font-size: calc(15px * var(--mz-try, 1)); color: var(--muted); text-align: center; }
.mz-box { flex-wrap: wrap; justify-content: center; max-width: 260px; }
/* who reacted: sheet with tabs «All N» + one per emoji (rxSheet) */
.rx-sheet .modal-body { padding: 4px 14px 14px; }
.rx-sheet .seg-tabs.rx-sheet-tabs { margin: 0 0 6px; flex-wrap: nowrap; overflow-x: auto; }
.rx-sheet-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 9px 12px; }
.rx-sheet-tabs .rx-e { font-size: 17px; }
.rx-sheet-list { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; min-height: 80px; }
.rx-sheet-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; touch-action: manipulation; }
.rx-sheet-row:hover { background: var(--hover); }
.rx-sheet-row .avatar { flex: none; }
.rx-sheet-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rx-sheet-who .uname, .rx-sheet-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-sheet-who small { font-size: 12px; }
.rx-sheet-e { flex: none; font-size: 20px; line-height: 1; }
.rx-sheet-more { padding: 8px 6px 0; text-align: center; }

/* ---------- "typing…" in private chats ---------- */
.pm-status.is-typing { font-style: italic; opacity: 1; }
.pm-head { position: relative; }
.pm-tdots { display: none; position: absolute; z-index: 2; inset-block-end: 1px; inset-inline-start: 26px; align-items: center; gap: 2px; padding: 3px 4px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); pointer-events: none; }
.pm-tdots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: pm-tdot 1.1s infinite ease-in-out; }
.pm-tdots i:nth-child(2) { animation-delay: .15s; }
.pm-tdots i:nth-child(3) { animation-delay: .3s; }
:is(body.pm-m, body.pm-d) .pm-win.min.typing .pm-head > .pm-tdots { display: inline-flex; inset-block-end: -3px; inset-inline-start: 50%; transform: translateX(-50%); }
[dir=rtl] :is(body.pm-m, body.pm-d) .pm-win.min.typing .pm-head > .pm-tdots { transform: translateX(50%); }
@keyframes pm-tdot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .pm-tdots i { animation: none; } }

/* ---------- edited messages ---------- */
.msg-edited { display: inline-block; margin-inline-start: 6px; color: var(--faint); font-size: 11px; font-style: italic; font-weight: 400; white-space: nowrap; vertical-align: baseline; }
.msg-bubble.action .msg-edited { align-self: flex-end; }
.pm-meta .msg-edited { margin: 0 2px 0 0; color: inherit; font-size: 10.5px; }
.reply-bar.editing { border-inline-start-color: var(--warn); }
.reply-bar.editing > .ic { color: var(--warn); }
.pm-reply-bar.editing { border-inline-start-color: var(--warn); }
.pm-reply-bar.editing svg { color: var(--warn); }
.edit-vers { display: flex; flex-direction: column; gap: 10px; }
.edit-ver { padding: 8px 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.edit-ver.now { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.edit-ver-text { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }

/* ---------- YouTube links: click-to-play card, player created on click ---------- */
.yt-media { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; vertical-align: top; white-space: normal; } /* as wide as its thumbnails: a decorated bubble fits them */
/* YouTube thumbnail in a message (the link itself is never shown): small, like the classic chats */
.yt-card { position: relative; display: block; width: 200px; max-width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); line-height: 0; cursor: pointer; }
.yt-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s, filter .2s; }
.yt-card:hover img { transform: scale(1.04); filter: brightness(.9); }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; }
.yt-play i { position: relative; display: block; width: 40px; height: 28px; border-radius: 9px; background: rgba(0, 0, 0, .62); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .15s, background .15s; }
.yt-play i::after { content: ""; position: absolute; inset-block-start: 50%; left: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; }
.yt-card:hover .yt-play i { transform: scale(1.08); background: var(--accent); }
/* «▶ video» button where thumbnails are not shown (quotes, ranks without the right) */
.yt-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 2px; padding: 2px 10px 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); color: var(--text); font: inherit; font-size: .9em; font-weight: 700; cursor: pointer; vertical-align: middle; }
.yt-chip i { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--accent); }
[dir="rtl"] .yt-chip i { transform: scaleX(-1); }
.yt-chip:hover { border-color: var(--accent); }
/* the floating video window (YouTube, uploaded videos, add-ons): small / medium / full screen, moved anywhere */
.fw { position: fixed; z-index: 1000; left: 16px; top: 120px; width: min(380px, calc(100vw - 32px)); border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fw.fw-mid { width: min(640px, calc(100vw - 32px)); }
.fw.fw-tall:not(.fw-mid) { width: 240px; }
.fw-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px; background: #111; color: #fff; cursor: grab; touch-action: none; }
.fw-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.fw-tools { display: contents; }
.fw-btn, .fw-head .wt-btn { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #fff; cursor: pointer; }
.fw-btn:hover, .fw-head .wt-btn:hover { background: rgba(255, 255, 255, .12); }
.fw-btn .ic, .fw-head .wt-btn .ic { width: 16px; height: 16px; }
.fw-box { position: relative; aspect-ratio: 16 / 9; }
.fw.fw-tall .fw-box { aspect-ratio: 9 / 16; }
.fw-box > iframe, .fw-box > video { width: 100%; height: 100%; display: block; border: 0; background: #000; object-fit: contain; }
.fw img { -webkit-user-drag: none; pointer-events: none; }
.fw.max, .fw:fullscreen { z-index: 2147483000; inset: 0 !important; width: 100% !important; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
.fw.max .fw-head { padding-top: max(4px, env(safe-area-inset-top)); }
.fw.max .fw-box, .fw:fullscreen .fw-box { flex: 1; aspect-ratio: auto !important; }
.fw.max .fw-btn, .fw:fullscreen .fw-btn { width: 36px; height: 36px; }
/* kept playing out of sight (sound only): a real size, tiny embeds may refuse to play */
.fw.fw-off { left: 0 !important; top: 0 !important; width: 200px !important; opacity: 0; pointer-events: none; clip-path: inset(50%); z-index: -1; }
@media (max-width: 760px) {
  .fw { width: min(58vw, 300px); border-radius: 12px; }
  .fw.fw-mid { width: 100%; border-radius: 0; }
  .fw.fw-tall:not(.fw-mid) { width: min(42vw, 200px); }
  .fw:not(.fw-live) { touch-action: none; }
  /* a passive picture (watch together): the bar lies over it and shows on a tap */
  .fw:not(.fw-live) .fw-head { position: absolute; inset-inline: 0; inset-block-start: 0; z-index: 2; padding: 2px 4px 14px; background: linear-gradient(rgba(0, 0, 0, .75), transparent); cursor: default; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .fw.show-head .fw-head, .fw.max .fw-head, .fw:fullscreen .fw-head { opacity: 1; pointer-events: auto; }
  .fw:not(.fw-mid):not(.max) .fw-title { visibility: hidden; } /* its room stays: the place to grab the bar */
  .fw.max .fw-head, .fw:fullscreen .fw-head { position: static; background: #111; padding-bottom: 4px; }
}
.yt-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yt-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pm-text .yt-card, .pm-text .yt-frame { width: min(260px, 100%); }
.pm-text .yt-card.short, .pm-text .yt-frame.short { width: min(170px, 100%); }

/* ---------- room pop-up announcement ---------- */
.modal-card.vc-pop { width: min(440px, 100%); }
.vc-pop .modal-head { background: var(--accent); color: var(--on-accent); border-bottom: 0; }
.vc-pop .modal-head h3 { color: var(--on-accent); overflow-wrap: anywhere; }
.vc-pop .modal-head .modal-ic, .vc-pop .modal-head .modal-x { color: var(--on-accent); }
.vc-pop .modal-head .modal-x:hover { background: color-mix(in srgb, var(--on-accent) 18%, transparent); }
/* each line takes its own direction (Arabic / English words never reversed), all lines align to the UI side */
.vc-pop-text { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; unicode-bidi: plaintext; }
[dir=rtl] .vc-pop-text { text-align: right; }
.vc-pop-text .aa-title { display: block; margin-bottom: 4px; }
.vc-pop .modal-foot { justify-content: center; }
.vc-pop-img { display: block; max-width: 100%; max-height: 46vh; margin: 0 auto 10px; border-radius: 10px; object-fit: contain; }
.vc-pop .modal-foot .btn { min-width: 120px; }
.vc-pop-ta { position: relative; display: flex; }
.vc-pop-ta textarea { flex: 1; padding-bottom: 40px; resize: vertical; }
/* emoji button in the bottom corner: never covers the placeholder / first line, whatever the text direction */
.vc-pop-emo { position: absolute; inset-block-end: 6px; inset-inline-end: 6px; }
@media (max-width: 760px) {
  .modal:has(> .vc-pop) { align-items: center; padding: 16px; }
  .modal-card.vc-pop { width: 100%; max-height: 86dvh; border-radius: 18px; border-bottom: 1px solid var(--line); transform: scale(.96); }
  .modal.in .modal-card.vc-pop { transform: none; }
}

/* ---------- chat direction (Admin › Appearance › Chat direction): body.cd-room-l|r, cd-users-l|r, cd-pm-l|r ----------
   The side decides the row order (avatar, name, bubble … time); inside a message every line keeps its own direction
   (unicode-bidi: plaintext = per line "dir=auto": Arabic and English words never reversed) and all lines align to the side. */
.cd-room-r .msg, .cd-room-r .msg-sys.jl-row { direction: rtl; }
.cd-room-r .msg-text { text-align: right; }
.cd-room-r .msg.mention { box-shadow: inset -3px 0 0 var(--orange); }
.cd-room-r .msg-bubble[class*="bub-"] { border-radius: 14px 4px 14px 14px; }
.cd-room-r.msgs-bubbles .msg-bubble:not(.custom):not(.action) { border-radius: 16px 4px 16px 16px; }
.cd-room-r .msg-meta time { direction: ltr; unicode-bidi: isolate; }
.cd-users-r .urow { direction: rtl; text-align: right; }
/* a decorated member row / message out of sight (scrolled away in a long list or the room history) pauses its effects */
.fx-off, .fx-off::before, .fx-off::after, .fx-off *, .fx-off *::before, .fx-off *::after { animation-play-state: paused !important; }
.cd-users-r .urow-info small { text-align: right; }
/* private messages: the side of the OTHER person's bubbles (own bubbles on the opposite side); no class = the usual layout */
.cd-pm-l .pm-msg { direction: ltr; }
.cd-pm-r .pm-msg { direction: rtl; }
.pm-text { unicode-bidi: plaintext; }
/* message time hidden: keep the menu button aligned */
.mt-none .msg-meta { padding-top: 0; }
.pm-meta time { direction: ltr; unicode-bidi: isolate; }
/* empty auto-direction fields: placeholder follows the page direction (typed text still picks its own direction) */
html[dir=rtl] :is(input, textarea)[dir=auto]:placeholder-shown { direction: rtl; }
/* Firefox paints nothing for the placeholder of an empty RTL composer textarea (one-line hint): keep the empty box LTR
   and give the hint itself the page direction (other engines keep the rule above) */
@supports (-moz-appearance: none) {
  html[dir=rtl] :is(#msg-input, .pm-input):placeholder-shown { direction: ltr; }
  html[dir=rtl] :is(#msg-input, .pm-input)::placeholder { direction: rtl; }
}

/* ---------- phones: the time moves into the name line and the "…" button floats in the corner,
   so the message text gets the full width of the row (rows / bubbles / compact, both chat directions) ---------- */
@media (max-width: 760px) {
  .msg, .msgs-compact .msg, .msgs-compact .msg:nth-child(even of .msg, .msg-sys.jl-row) { grid-template-columns: 40px minmax(0, 1fr); }
  .msgs-compact .msg, .msgs-compact .msg:nth-child(even of .msg, .msg-sys.jl-row) { grid-template-columns: 26px minmax(0, 1fr); }
  .msg-meta { position: absolute; inset-block-start: 6px; inset-inline-end: 2px; padding: 0; }
  /* the time stays beside the three dots (top corner); the name line / first text line leave room for both */
  .msg-head { align-self: stretch; padding-inline-end: var(--meta-w, 104px); }
  .mt-time { --meta-w: 72px; } .mt-datetime { --meta-w: 96px; } .mt-none { --meta-w: 26px; }
  .msg.cont .msg-main, .msgs-compact .msg-main { padding-inline-end: var(--meta-w, 104px); }
  .msgs-compact .msg-head { align-self: auto; padding-inline-end: 0; }
  .msgs-compact .msg-meta { inset-block-start: 1px; }
}

/* ---------- landscape phones (short screens): the chat log gets the room. Slim bars (icon + label in one row),
   one-line topic, slimmer composer; the voice stage is one slim row (voicestage.css) ---------- */
@media (max-height: 500px) {
  :root { --top-h: calc(40px + env(safe-area-inset-top, 0px)); --bot-h: calc(38px + env(safe-area-inset-bottom, 0px)); }
  .bar-btn { flex-direction: row; gap: 5px; min-width: 40px; padding: 0 8px; font-size: 11px; }
  .bottombar .bar-btn { min-width: 40px; }
  .bar-btn .bar-ic { height: 22px; }
  .bar-btn .bar-ic:has(.badge:not([hidden]), .count) + .bar-label { margin-inline-start: 7px; }
  body.pm-m .pm-win:not(.min) .pm-head { padding-block: 12px 4px; }
  .bar-btn .ic, .bar-btn .ic-img { width: 20px; height: 20px; }
  .avatar-btn img { width: 30px; height: 30px; }
  .topbar .brand img { height: 28px; }
  .topic-box { padding-block: 3px; gap: 8px; }
  .topic-ic { width: 22px; height: 22px; }
  .topic-ic .ic { width: 14px; height: 14px; }
  .topic-ic b { font-size: 10px; }
  .topic-txt b, .topic-txt p { font-size: 12.5px; }
  .topic-x { width: 22px; height: 22px; margin-top: -11px; }
  .composer-wrap { padding-block: 3px; }
  #msg-input { height: 36px; min-height: 36px; max-height: 36px; padding-block: 0; line-height: 36px; }
  .send-btn, .cbtn { width: 36px; height: 36px; }
  .msg { padding-block: 5px; }
  .msg-av .avatar { width: 34px; height: 34px; }
  .msg, .msgs-compact .msg { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .day-sep { margin-block: 6px 4px; }
}

/* ---------- visual sweep fixes (2026-11-08) ---------- */
/* room names follow the page direction, whatever script the name is in (landing "active rooms", room lists) */
html[dir=ltr] .lr-name { text-align: left; } html[dir=rtl] .lr-name { text-align: right; }
/* toasts never wider than the screen; long titles wrap */
.toast { max-width: 100%; box-sizing: border-box; min-width: 0; }
.toast > * { min-width: 0; overflow-wrap: anywhere; }
/* profile action bar */
/* long labels (English "Private message", Arabic «إضافة صديق») take two lines instead of being cut */
.ua-bar .uq-btn { white-space: normal; min-width: 0; padding-inline: 8px; }
.ua-bar .uq-btn span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; word-break: normal; text-align: center; }
/* very narrow phones: smaller stage cells so five fit */
@media (max-width: 370px) { .vs-bar { --vs-cell: 34px; } }
/* admin lists on phones: header labels never run together */
.list th { white-space: nowrap; }
[data-theme="mono"] .urow.off .uname { opacity: .88; } /* dark mono: offline names keep readable contrast */

/* touch screens: tab strips only slide sideways, panels only scroll up/down (nothing drags loose in the profile / settings windows) */
.tab-strip, .seg-tabs, .set-nav { overflow-y: hidden; overscroll-behavior-x: contain; }
.modal-body, .set-content { overflow-x: hidden; overscroll-behavior: contain; }
.set-content { min-width: 0; flex: 1; }
.modal input[type=date], .modal input[type=time] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }

/* short drop-down list (assets/js/vsel.js) */
.vsel-list { position: fixed; z-index: 100000; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.vsel-it { padding: 7px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsel-it:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.vsel-it.on { background: var(--accent); color: var(--on-accent, #fff); }
.vsel-it.off { color: var(--muted); cursor: default; background: none; }
.birth3 { display: flex; gap: 8px; }
.birth3 select { flex: 1 1 0; min-width: 0; }
.birth3 select.bm { flex-grow: 1.6; }

/* member list: status chip in the welcome card, alternating rows (admin: list_alt_rows / list_status_pick) */
.wc-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wc-status { cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.wc-status .st-dot { position: static; width: 9px; height: 9px; border: 0; }
.wc-status .ic { width: 12px; height: 12px; color: var(--muted); }
.ulist.alt > .urow:nth-of-type(even) { background: var(--row-alt); }
.ulist.alt > .urow.self { background: color-mix(in srgb, var(--accent) 12%, var(--row-alt)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* private chat: "Load older" (core, works without the chattools module) */
.pm-older { display: flex; align-items: center; gap: 6px; margin: 6px auto 10px; }
.pm-older svg { width: 14px; height: 14px; }
.ct-older-end { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 10px; }

/* ---------- menus reorganisation (2026-11-15): group headings, drawer dividers, phone-only top bar ---------- */
.menu-head { padding: 8px 12px 3px; color: var(--faint, var(--muted)); font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.menu-list > .menu-head:first-child { padding-top: 3px; }
.ab-sep { height: 1px; margin: 6px 14px; background: var(--line); }
.set-group { padding: 10px 12px 2px; color: var(--faint, var(--muted)); font-size: 11.5px; font-weight: 800; }
.set-group:first-child { padding-top: 0; }
.room-leave .ic { width: 17px; height: 17px; }
.vnt-req { display: none; width: 100%; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); color: var(--text); font-weight: 700; text-align: start; }
.vnt-req .ic { width: 19px; height: 19px; color: var(--accent); }
.vnt-req span { flex: 1; }
@media (max-width: 760px) {
  .top-btn.no-phone { display: none !important; }
  .vnt-req { display: flex; }
}
@media (max-width: 760px) {
  /* settings strip on phones: a thin divider instead of the group title */
  .set-nav .set-group { flex: none; align-self: stretch; width: 1px; margin: 6px 4px; padding: 0; overflow: hidden; color: transparent; background: var(--line); }
}
@media (min-width: 761px) { .set-nav .set-group.bare { height: 1px; margin: 8px 12px 2px; padding: 0; background: var(--line); } }

/* ---------- stage-4 (T9): phone keyboard, landscape room, touch targets ---------- */
/* phone keyboard open (portrait, little height left): icons only in the bars instead of labels cut to "Ro…" */
@media (max-height: 500px) and (max-width: 560px) {
  .topbar .bar-label, .bottombar .bar-label { display: none; }
  .bar-btn { min-width: 40px; padding-inline: 6px; }
}
/* landscape keyboard (very short screen): the bottom bar steps aside, the log and the composer keep the room */
@media (max-height: 300px) and (pointer: coarse) {
  :root { --bot-h: 0px; }
  .bottombar { display: none; }
}
/* landscape phones: slimmer message rows give the chat log more lines */
@media (max-height: 500px) and (pointer: coarse) {
  .msg { padding-block: 3px; }
  .msg-av .avatar { width: 28px; height: 28px; }
  .msg, .msgs-compact .msg { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .day-sep { margin-block: 3px 2px; }
}
/* landscape phones: the Settings sheet uses the whole height, with a slim header, section strip and save bar */
@media (max-height: 520px) and (pointer: coarse) {
  .modal:has(> .settings-modal) { padding: 4px; }
  .modal-card.settings-modal { height: calc(100dvh - 8px); max-height: calc(100dvh - 8px); }
  .settings-modal .modal-head { padding-block: 5px; }
  .settings-modal .set-nav { padding-block: 3px; }
  .settings-modal .set-nav button { padding-block: 4px; min-height: 32px; }
  .settings-modal .set-content { padding-top: 8px; }
  .settings-modal .set-actions { padding-block: 4px; }
}
/* touch targets: at least 24 px everywhere, 32 px on touch screens (stage and wall parts: their module CSS) */
.msg-more { min-height: 24px; }
.set-content input[type=checkbox], .vpf-check input[type=checkbox] { width: 18px; height: 18px; }
@media (pointer: coarse) {
  .set-content input[type=checkbox], .vpf-check input[type=checkbox] { width: 22px; height: 22px; }
  /* the whole row is the tap target: 32 px high; the message "…" button too */
  .vpf-check, .set-content label.check { min-height: 32px; }
  .msg-more { height: 32px; margin-top: -6px; }
}
/* landing: small text links are real tap targets (forgot password, chat features, footer links) */
.forgot-slot a, .auth-link, .auth-feat, .land-foot nav a { min-height: 24px; }
.land-foot nav a { display: inline-flex; align-items: center; }
@media (pointer: coarse) {
  .forgot-slot a, .auth-link, .auth-feat, .land-foot nav a { min-height: 32px; }
}

/* ---- member options sheet: quick row, staff quick actions, one tab at a time, inline steps (owner 2026-11-15) ---- */
.uas-top, .uas-staff { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.uas-q { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.uas-q .ic, .uas-q .ic-img { width: 20px; height: 20px; color: var(--g, var(--accent)); }
.uas-q span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uas-q:hover { border-color: color-mix(in srgb, var(--g, var(--accent)) 45%, var(--line)); background: color-mix(in srgb, var(--g, var(--accent)) 7%, var(--panel)); }
.uas-staff { padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--ua-mod) 6%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ua-mod) 20%, var(--line)); }
.uas-sq { min-height: 52px; }
.uas-q.danger { color: var(--ua-mod); }
.uas-tabs { margin-top: 12px; }
.uas-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.uas-tabs button .ic { width: 15px; height: 15px; }
.uas-list { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.uas-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; text-align: start; }
.uas-row:last-child { border-bottom: 0; }
.uas-row:hover, .uas-row:focus-visible { background: color-mix(in srgb, var(--g) 7%, var(--panel)); }
.uas-row .uas-ic { width: 30px; height: 30px; }
.uas-row .uas-go { width: 15px; height: 15px; color: var(--muted); flex: none; }
.uas-row.danger { color: var(--ua-mod); }
.uas-row.danger .uas-ic { background: color-mix(in srgb, var(--ua-mod) 14%, transparent); color: var(--ua-mod); }
.uas-sep { height: 6px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.uas-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.uas-step-head > .ic { width: 18px; height: 18px; color: var(--accent); }
.uas-step-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .uas-modal .modal-body { max-height: 70vh; overflow-y: auto; }
  .uas-q { min-height: 54px; font-size: 11.5px; }
}

/* room rules: marks on room cards (read-only, slow mode, no guests) and a full room's member count */
.rule-mark { display: inline-flex; vertical-align: middle; margin-inline-start: 4px; color: var(--muted); }
.rule-mark .ic { width: 13px; height: 13px; }
.room-count.full { color: #fff; background: var(--danger); }
.room-rules-box { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-top: 4px; }
.room-rules-box h4 { margin: 4px 0 6px; font-size: 13px; }

/* staff: an IP opens a lookup, with a copy button */
.ip-node { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; word-break: break-all; }
.ip-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ip-copy { width: 26px; height: 26px; flex: none; }
.ip-copy .ic { width: 14px; height: 14px; }

/* guests: a member section shown with the reason and Create account / Log in (settings, «My look», messages panel) */
.guest-gate { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 14px; border: 1px dashed var(--line); border-radius: 14px; margin: 6px 0; }
.guest-gate .gg-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.guest-gate .gg-ic .ic { width: 22px; height: 22px; }
.guest-gate p { margin: 0; max-width: 34em; overflow-wrap: anywhere; }
.guest-gate .gg-text { font-weight: 600; }
.guest-gate .gg-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
/* emoji picker: a tab a free account gets (guest view): lock mark, faded pictures, a pick asks to register */
.emoji-tabs button.locked { position: relative; }
.emoji-tabs button .emo-lock { position: absolute; inset-inline-end: 1px; bottom: 1px; width: 11px; height: 11px; color: var(--muted); }
.emoji-grid.locked .emoji-btn { opacity: .55; }

/* card / profile: the rank icon and the name stay together; a long plain name wraps inside, beside its icon */
.rank-name { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.rank-name > :not(.uname) { flex: none; }
/* the name shrinks (framed: "…", plain: wraps) only when the line is really too narrow; no percentage max-width here
   (a % of this shrink-to-fit box made framed names collapse to "V…") */
.rank-name > .uname, .profile-id h2 .rank-name > .uname.vns-f, .ucard-line .rank-name > .uname.vns-f { flex: 0 1 auto; min-width: 0; max-width: none; }
/* rename form: live availability check (phase 8C) */
.name-check { display: block; min-height: 1.2em; color: var(--muted); }
.name-check.ok { color: var(--ok, #2e9d5b); }
.name-check.bad { color: var(--danger, #d64545); }
/* profile / member card name: never shrunk by the flex line (iPhone Safari cut a short name to «sa…» or broke it to
   «sar / a»): the rank wrapper steps aside (display: contents), the name keeps its own width and moves to its own line
   when the line is full; only a name wider than the whole line is cut with an ellipsis */
.profile-id h2 .rank-name, .ucard-line .rank-name { display: contents; }
:is(.profile-id h2, .ucard-line) :is(.rank-name > .uname, .uname, .rank-name > .uname.vns-f.vns-f) { flex: none; min-width: 0; max-width: none; width: auto; white-space: nowrap; overflow: visible; text-overflow: clip; overflow-wrap: normal; }
/* names are short (length limit), so nothing is ever cut here: iPhone Safari measured the box before the name font
   loaded and then cut the wider text to «sa…»; with nothing clipped the full name always shows */
/* room topic: one slim line above the composer (owner choice 2026-11-21: no wide coloured banner); «More» opens the
   whole text, ✕ hides it until the topic changes */
#topic-box.topic-box { align-items: center; gap: 8px; margin: 4px 8px; padding-block: 5px; padding-inline: 10px 36px; color: var(--text);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-inline-start: 3px solid var(--accent); border-radius: 10px; box-shadow: none; } /* a light touch of the theme colour: a room notice, not a message */
#topic-box .topic-ic { width: 20px; height: 20px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-size: 12px; font-weight: 800; font-style: normal; line-height: 1; }
#topic-box .topic-txt { text-shadow: none; display: block; }
#topic-box .topic-txt p { margin: 0; font-size: 13.5px; line-height: 1.45; display: block; max-height: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -webkit-line-clamp: unset; }
#topic-box.open .topic-txt p { white-space: normal; overflow-wrap: anywhere; max-height: 32vh; overflow-y: auto; overscroll-behavior: contain; }
#topic-box .topic-txt .link, #topic-box .topic-txt .mention-tag { color: var(--accent); }
#topic-box.clamped { cursor: pointer; }
#topic-box .topic-more { display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 0 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
#topic-box .topic-more[hidden] { display: none; }
#topic-box .topic-more .ic { width: 13px; height: 13px; transition: transform .15s; }
#topic-box.open .topic-more .ic { transform: rotate(180deg); }
#topic-box.open { align-items: flex-start; }
#topic-box .topic-x { inset-block-start: 50%; margin-top: -13px; color: var(--muted); }
#topic-box.open .topic-x { inset-block-start: 4px; margin-top: 0; }
#topic-box .topic-x:hover { background: var(--hover); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* member list section headings (owner 2026-11-21): dot + title + count pill + theme line + fold arrow */
.list-group.lg2 { width: 100%; justify-content: flex-start; gap: 7px; padding: 12px 6px 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; cursor: pointer; text-align: start; }
.list-group.lg2 span { flex: 0 1 auto; }
.list-group.lg2 .lg-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #22c55e); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok, #22c55e) 22%, transparent); }
.list-group.lg2.off .lg-dot { background: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 18%, transparent); }
.list-group.lg2.g-staff .lg-dot { background: #ef4444; box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 20%, transparent); }
.list-group.lg2.g-vip .lg-dot { background: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 22%, transparent); }
.list-group.lg2.g-guest .lg-dot { background: #94a3b8; box-shadow: 0 0 0 3px color-mix(in srgb, #94a3b8 22%, transparent); }
.list-group.lg2 .lg-n { flex: none; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 11px; font-weight: 800; text-align: center; }
.list-group.lg2 .lg-line { flex: 1 1 auto; min-width: 12px; height: 1px; background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, var(--accent) 45%, transparent), transparent); }
[dir="rtl"] .list-group.lg2 .lg-line { --lg-end: left; }
.list-group.lg2 .lg-chev { flex: none; width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.list-group.lg2.folded .lg-chev { transform: rotate(-90deg); }
[dir="rtl"] .list-group.lg2.folded .lg-chev { transform: rotate(90deg); }
.list-group.lg2:hover .lg-n { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.list-group.lg2.off { padding-top: 16px; }
.ulist-groups[hidden], .list-group.lg2[hidden] { display: none; }
/* picker buttons whose content is a sample (animated designs, colours, cards): the button itself is the only tap
   target. iPhone Safari did not always turn a tap on an animated sample inside a button into a click on the button. */
:is(.prs-chip, .fx-card, .bubble-sw, .ts-card, .skin-card, .theme-card, .ps-id-pick, .vnw-pick, .vfr-tile, .tsr-tile, .gp-chip, .md2-chip, .vw2-pick, .vw2-chip, .vst-chip, .lv-card, .gpt-card, .wc-chip, .qs-chip, .stc-tab) > * { pointer-events: none; }
:is(.prs-chip, .fx-card, .bubble-sw, .ts-card, .skin-card, .theme-card, .ps-id-pick, .vnw-pick, .vfr-tile, .tsr-tile, .gp-chip, .md2-chip, .vw2-pick, .vw2-chip, .vst-chip, .lv-card, .gpt-card, .wc-chip, .qs-chip, .stc-tab) { touch-action: manipulation; }

/* phone conversation header: every button stays in the bar (call, video, minimize, full / half screen, ⋮, ✕), a bit
   smaller and closer together, so the name keeps its room instead of «SYSA…» */
body.pm-m .pm-win:not(.min) .pm-head { gap: 2px; padding-inline-end: 2px; }
body.pm-m .pm-win:not(.min) .pm-head .icon-btn { width: 32px; height: 32px; min-width: 32px; }
body.pm-m .pm-win:not(.min) .pm-head .icon-btn .ic { width: 19px; height: 19px; }
body.pm-m .pm-win:not(.min) .pm-head .pm-av { margin-inline-end: 6px; }
body.pm-m .pm-win:not(.min) .pm-head .pm-who { flex: 1 1 auto; min-width: 0; }
body.pm-m .pm-win:not(.min) .pm-head .pm-name { font-size: 15px; }

/* join / leave lines like the classic chats: a full-width row – the member's picture (or icon) at the start, «X joined
   the room» with his name and rank, the time at the end – on a soft tint with a coloured edge */
.msg-sys.jl-row { direction: ltr; justify-content: flex-start; align-items: center; gap: 10px; margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--row-line, var(--line));
  border-inline-start: 3px solid var(--accent); background: var(--row-bg, var(--panel)); }
.msg-sys.jl-row.t5 { border-inline-start-color: var(--faint); }
.msg-sys.jl-row .jl-pill { flex: 1; min-width: 0; max-width: none; border: 0; border-radius: 0; padding: 0; background: none; justify-content: flex-start; }
.msg-sys.jl-row .jl-pill time { margin-inline-start: auto; flex: none; }
.jl-av { flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.jl-av .avatar, .jl-av img { width: 30px; height: 30px; }
.jl-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; }
.jl-ic .ic { width: 18px; height: 18px; color: var(--accent); }
.msg-sys.t5 .jl-ic .ic { color: var(--faint); }
.jl-ic .rank-ic { width: 22px; height: 22px; }
.jl-pill { border-radius: 14px; padding: 5px 12px; background: color-mix(in srgb, var(--ok) 8%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 25%, var(--line)); color: var(--text); }
.msg-sys.t5 .jl-pill { color: var(--muted); }
.jl-pill .rank-ic { width: 16px; height: 16px; }
.jl-name { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; }
.jl-name:hover { text-decoration: underline; }
.msg-sys.jl-row .jl-pill .jl-kind { width: 16px; height: 16px; flex: none; color: var(--accent); }
.msg-sys.jl-row.t5 .jl-pill .jl-kind { color: var(--faint); }
/* join / leave rows share the alternating row colours of the messages (one light, one darker) */
body:not(.msgs-bubbles):not(.msgs-compact) .msg-sys.jl-row:nth-child(even of .msg, .msg-sys.jl-row) { background: var(--row-alt); }
.msgs-bubbles .msg-sys.jl-row, .msgs-compact .msg-sys.jl-row { background: transparent; }
/* rank icon right before the name, like the message header */
.jl-who { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.jl-who .rank-ic { width: 16px; height: 16px; }

/* ---------- rows style options (Admin › Appearance) ----------
   mfr: every message / join row is a rounded frame with coloured edges, rows alternating between two close colours (the
   theme accent and a neighbour hue, or the owner's two colours); mtp-inline: «name : text» on one line, a long text wraps under itself, the
   reply quote and pictures go under the line */
/* the theme's own colour (accent + a lighter shade of it), or the owner's pair set on <body>: message frames and picture rings */
.vc-chat { --fr1: var(--accent); --fr2: color-mix(in srgb, var(--accent) 55%, var(--panel)); --ring1: var(--fr1); --ring2: var(--fr2); }
.msgs-rows.mfr .chat-log { padding-inline: 6px; }
.msgs-rows.mfr .msg, .msgs-rows.mfr .msg-sys.jl-row { margin-top: 4px; border: 1px solid var(--row-line); border-radius: 8px;
  border-inline: 3px solid var(--fr1); }
/* both edges of a row share one colour; the rows alternate between the two colours (like the striped backgrounds) */
.msgs-rows.mfr :is(.msg, .msg-sys.jl-row):nth-child(even of .msg, .msg-sys.jl-row) { border-inline-color: var(--fr2); }
.msgs-rows.mfr .msg.cont { margin-top: 1px; }
.msgs-rows.mfr .msg.mention { box-shadow: inset 0 0 0 1px var(--orange); }
.msgs-rows.mtp-inline .msg-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.msgs-rows.mtp-inline .msg-head { margin: 0; flex: none; }
.msgs-rows.mtp-inline .msg-head::after { content: ":"; color: var(--faint); font-weight: 700; line-height: 1; }
.msgs-rows.mtp-inline .msg-bubble:not([class*="bub-"]):not(.custom):not(.action):not(.prs-sm) { display: contents; }
/* a decorated bubble (frame, hearts…) stays one piece beside the name, as wide as its text */
.msgs-rows.mtp-inline .msg-main > .msg-bubble:is(.prs-sm, [class*="bub-"], .custom) { flex: 0 1 auto; max-width: 100%; }
.msgs-rows.mtp-inline .msg-main > .msg-bubble, .msgs-rows.mtp-inline .msg-main .msg-text { flex: 1 1 180px; min-width: 0; }
.msgs-rows.mtp-inline .msg-main .reply-quote { order: 2; flex: 1 1 100%; margin: 6px 0 0; }
.msgs-rows.mtp-inline .msg-main > :not(.msg-head):not(.msg-bubble):not(.msg-text):not(.reply-quote) { flex-basis: 100%; }
@media (max-width: 760px) {
  /* phones: «name : text» flows like a paragraph; a float holds the time + dots corner on the first line only, so a short
     text stays beside the name and a long text, gift or decorated message drops under it and uses the whole width */
  /* (a reply keeps the flex layout of wider screens: its quote goes under the text) */
  .msgs-rows.mtp-inline .msg-main:not(:has(.reply-quote)) { display: block; }
  .msgs-rows.mtp-inline .msg-main::before { content: ""; float: inline-end; width: var(--meta-w, 104px); height: 22px; }
  .msgs-rows.mtp-inline .msg-main:has(.reply-quote)::before { float: none; order: 1; flex: 0 0 var(--meta-w, 104px); height: 0; }
  .msgs-rows.mtp-inline .msg-head { display: inline-flex; vertical-align: top; margin-inline-end: 6px; padding-inline-end: 0; }
  .msgs-rows.mtp-inline .msg-main:not(:has(.reply-quote)) > .msg-bubble { display: inline-block; vertical-align: top; max-width: 100%; }
  .msgs-rows.mtp-inline .msg-main:not(:has(.reply-quote)) > .msg-bubble:not([class*="bub-"]):not(.custom):not(.action):not(.prs-sm) { display: contents; }
  .msgs-rows.mtp-inline .msg-main .msg-text { display: inline-block; vertical-align: top; max-width: 100%; }
}
/* join / leave / move rows at the size of the room messages (avatar, text, padding) so the log reads evenly */
.msg-sys.jl-row { padding: 9px 12px 9px 10px; }
.msg-sys.jl-row .jl-av .avatar, .msg-sys.jl-row .jl-av img { width: 44px; height: 44px; }
.msg-sys.jl-row .jl-ic { width: 44px; justify-content: center; }
.msg-sys.jl-row .jl-pill { font-size: calc(15px * var(--mz, 1)); }
.msg-sys.jl-row .jl-pill .jl-kind { width: 18px; height: 18px; }
.msg-sys.jl-row .jl-who .rank-ic { width: 16px; height: 16px; }
.msg-sys.jl-row .jl-pill time { font-size: 11px; }
@media (max-width: 760px) { .msg-sys.jl-row .jl-av .avatar, .msg-sys.jl-row .jl-av img { width: 40px; height: 40px; } .msg-sys.jl-row .jl-ic { width: 40px; } }
/* picture ring (Admin › Appearance «Picture ring colour»): one gradient of the theme pair for everyone (default), the rank
   colour of staff, or the gender colour; drawn behind the picture so the row layout does not move */
.vc-chat:not(.msgs-compact) :is(.msg-av, .jl-av) { position: relative; isolation: isolate; width: fit-content; height: fit-content; justify-self: start; }
.vc-chat:not(.msgs-compact) :is(.msg-av, .jl-av):not(.ps-fr):not(.cl-pf)::before { content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 50%;
  background: linear-gradient(135deg, var(--ring1), var(--ring2)); }
.vc-chat:not(.msgs-compact) .msg-av .avatar, .vc-chat:not(.msgs-compact) .jl-av .avatar { box-shadow: 0 0 0 2px var(--panel); }
.ring-rank .av-r-owner { --ring1: var(--r-owner); --ring2: var(--r-owner); } .ring-rank .av-r-super { --ring1: var(--r-super); --ring2: var(--r-super); }
.ring-rank .av-r-admin { --ring1: var(--r-admin); --ring2: var(--r-admin); } .ring-rank .av-r-mod { --ring1: var(--r-mod); --ring2: var(--r-mod); }
.ring-rank .av-r-vip { --ring1: var(--r-vip); --ring2: var(--r-vip); } .ring-rank .av-r-bot { --ring1: var(--r-bot); --ring2: var(--r-bot); }
.ring-rank .av-r-guest { --ring1: var(--faint); --ring2: var(--faint); }
.ring-gender .av-s1 { --ring1: var(--male, #4c9be8); --ring2: var(--male, #4c9be8); } .ring-gender .av-s2 { --ring1: var(--female, #e957a5); --ring2: var(--female, #e957a5); }
/* message time beside the three dots: a soft small tag */
.msg-meta time { padding: 0; color: var(--faint); font-size: 10.5px; line-height: 18px; font-variant-numeric: tabular-nums; unicode-bidi: isolate; } /* plain small faint text (no pill): less width */
.msgs-rows.mtp-inline .msg-main:has(> .msg-bubble.custom) { align-items: center; } /* a gift / card line: «name :» centred on it */
/* message head: the picture column is exactly the picture, 4px from its ring (the ring is drawn 4px around it) to the rank
   icon, 3px between rank, verified mark and name; the name line and the text share one writing line (the head aligns on
   the name's text, its icons centred beside it). Join / leave rows keep the same spacing. */
.vc-chat:not(.msgs-compact) .msg { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; }
.msg-head { align-items: baseline; gap: 3px; }
.msg-sys.jl-row { gap: 8px; }
.jl-who { gap: 3px; }
.msg-head > :not(.msg-name) { align-self: center; }
@media (max-width: 760px) {
  .msgs-rows.mtp-inline .msg-head, .msgs-rows.mtp-inline .msg-main .msg-text, .msgs-rows.mtp-inline .msg-main:not(:has(.reply-quote)) > .msg-bubble { vertical-align: baseline; }
}
/* «name : text»: a message with a box of its own (message frame, bubble colour, special message) is taller than the name
   line; the name stays at the top of the row (level with the picture), the box beside it from the same top */
.msgs-rows.mtp-inline .msg-main:has(.cl-mf, .msg-bubble[class*="bub-"], .prs-sm) { align-items: flex-start; }
@media (max-width: 760px) {
  .msgs-rows.mtp-inline .msg-main:has(.cl-mf, .msg-bubble[class*="bub-"], .prs-sm) :is(.msg-head, .msg-text, .msg-bubble) { vertical-align: top; }
}
@media (max-width: 760px) { .vc-chat:not(.msgs-compact) .msg { grid-template-columns: auto minmax(0, 1fr); } }

/* ---------- member list «tiers» look (Admin › Appearance «Member list look», default) ----------
   a coloured heading per standing (staff gold, VIP violet, members blue, guests grey); staff rows a light gold touch,
   VIP rows their cover softly behind, guests a little paler; the picture has the room ring and the level on its top
   corner. A member's own store looks (row light, name frame, status line, picture frame) always win. */
[dir="rtl"] .ls-tiers { --lg-end: left; }
.ls-tiers .list-group.lg2:is(.g-owner, .g-staff, .g-vip, .g-user, .g-guest, .on, .off) { --tc: var(--accent); width: 100%; margin: 4px 0 2px; padding: 12px 6px 6px; background: none; color: var(--tc); font-size: 12.5px; }
/* slim section label: icon + name in the standing's colour, a count pill, a thin line of the same colour fading out; it
   scrolls with the list */
.ls-tiers .list-group.lg2:is(.g-owner, .g-staff, .g-vip, .g-user, .g-guest, .on, .off) .lg-dot { display: none; }
.ls-tiers .list-group.lg2:is(.g-owner, .g-staff, .g-vip, .g-user, .g-guest, .on, .off) span::before { margin-inline-end: 6px; font-size: 13px; }
.ls-tiers .list-group.lg2:is(.g-owner, .g-staff, .g-vip, .g-user, .g-guest, .on, .off) .lg-line { height: 2px; border-radius: 2px; background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, var(--tc) 55%, transparent), transparent); }
.ls-tiers .list-group.lg2:is(.g-owner, .g-staff, .g-vip, .g-user, .g-guest, .on, .off) .lg-n { background: color-mix(in srgb, var(--tc) 14%, var(--panel)); color: var(--tc); }
.ls-tiers .list-group.lg2.g-owner { --tc: color-mix(in srgb, #c88a00 85%, var(--text)); }
.ls-tiers .list-group.lg2.g-owner span::before { content: "👑"; }
.ls-tiers .list-group.lg2.g-owner .lg-line { background: linear-gradient(to var(--lg-end, right), #f5c542, color-mix(in srgb, #c88a00 40%, transparent), transparent); }
.ls-tiers .list-group.lg2.g-staff { --tc: color-mix(in srgb, #c2410c 85%, var(--text)); }
.ls-tiers .list-group.lg2.g-staff span::before { content: "🛡️"; }
.ls-tiers .list-group.lg2.g-vip { --tc: #8a4fe0; }
.ls-tiers .list-group.lg2.g-vip span::before { content: "💎"; }
.ls-tiers .list-group.lg2.g-user span::before { content: "👤"; }
.ls-tiers .list-group.lg2.g-guest { --tc: var(--muted); }
.ls-tiers .list-group.lg2.g-guest span::before { content: "👋"; }
.ls-tiers .list-group.lg2.on { --tc: color-mix(in srgb, var(--ok, #22c55e) 70%, var(--text)); }
.ls-tiers .list-group.lg2.on span::before { content: "👥"; }
.ls-tiers .list-group.lg2.off { --tc: var(--muted); }
.ls-tiers .list-group.lg2.off span::before { content: "💤"; }
.ls-tiers .g-staff + .ulist .urow { background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, #ffd27a 30%, transparent), transparent); }
.ls-tiers .urow.has-cv { position: relative; isolation: isolate; overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, #a064e6 35%, transparent); }
.ls-tiers .urow.has-cv::before { content: ""; position: absolute; inset: -16px; z-index: -2; background: var(--cv) center / cover; filter: blur(10px) saturate(1.2); opacity: .5; }
.ls-tiers .urow.has-cv::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, var(--panel) 30%, transparent), color-mix(in srgb, var(--panel) 85%, transparent)); }
.ls-tiers :is(.urow, .wc2) .av-wrap:not(.ps-fr):not(.cl-pf) { isolation: isolate; }
.ls-tiers :is(.urow, .wc2) .av-wrap:not(.ps-fr):not(.cl-pf)::before { content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: linear-gradient(135deg, var(--ring1), var(--ring2)); }
.ls-tiers :is(.urow, .wc2) .av-wrap:not(.ps-fr):not(.cl-pf) .avatar { box-shadow: 0 0 0 2px var(--panel); }
.ls-tiers .urow .lv-chip.lv-av { inset-block-start: -4px; inset-block-end: auto; inset-inline-end: -4px; }

/* ---------- standing look: side panel tabs, flat and equal (like the big messaging apps): icon over a small label for
   every tab, the active one in the theme colour with a rounded line under it; the member count a small dot on the
   members icon; the close button on the same line ---------- */
.ls-tiers .sp-top { height: auto; align-items: center; padding: 2px 4px 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.ls-tiers .sp-tabs { gap: 0; }
.ls-tiers .sp-tab { flex: 1 1 0; min-width: 0; gap: 3px; padding: 7px 2px 9px; border-radius: 0; background: none; color: var(--muted); transition: color .15s; }
.ls-tiers .sp-tab:hover { background: none; color: var(--text); }
.ls-tiers .sp-tab.active { background: none; color: var(--accent); }
.ls-tiers .sp-tab::after { content: ""; position: absolute; inset-inline: 24%; inset-block-end: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.ls-tiers .sp-tab.active::after { display: block; transform: scaleX(1); }
.ls-tiers .sp-tab-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
.ls-tiers .sp-cnt { position: absolute; inset-block-start: 3px; inset-inline-start: calc(50% + 7px); min-width: 16px; height: 15px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; line-height: 15px; text-align: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--accent); box-shadow: 0 0 0 2px var(--panel); }
.ls-tiers .sp-tab.active .sp-cnt { background: var(--accent); color: var(--on-accent, #fff); }
.ls-tiers .sp-close { width: 28px; height: 28px; border-radius: 8px; color: var(--faint); }
/* the personal card */
.ls-tiers .welcome-card.wc2 { position: relative; isolation: isolate; overflow: hidden; align-items: stretch; gap: 6px; padding: 12px; border-radius: 16px;
  background: none; border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 10%, transparent); }
.ls-tiers .wc2::before { content: ""; position: absolute; inset: -20px; z-index: -2; background: var(--accent); filter: blur(16px); opacity: .18; }
.ls-tiers .wc2.has-cv::before { background: var(--cv) center / cover; opacity: .5; }
.ls-tiers .wc2::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, var(--panel) 55%, transparent), color-mix(in srgb, var(--panel) 88%, transparent)); }
.wc2-top { display: flex; align-items: center; gap: 12px; }
.wc2-top .av-wrap { flex: none; }
.wc2-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wc2-hi { color: var(--muted); font-size: 12px; }
.wc2-name { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 16px; font-weight: 800; }
.wc2-name .uname { font-size: 16px; }
.wc2-name .rank-ic { width: 17px; height: 17px; }
.wc2-xp { height: 7px; margin-top: 4px; border-radius: 5px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.wc2-xp i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.wc2-xpt { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 11px; }
.ls-tiers .wc2 .wc-row { margin-top: 4px; }
.ls-tiers .wc2 .wc-row { flex-wrap: nowrap; gap: 5px; }
/* the room button of the card: a softly blinking green dot + the number of members in the room (one short button, the
   «in the room» words and the room name are its tooltip) */
.ls-tiers .wc2 .wc-chip:not(.wc-status):not(.wc2-gold) > .ic, .ls-tiers .wc2 .wc-chip:not(.wc-status):not(.wc2-gold) .wc-t { display: none; }
.ls-tiers .wc2 .wc-chip:not(.wc-status):not(.wc2-gold)::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22b46e; box-shadow: 0 0 0 0 rgba(34, 180, 110, .55); animation: wc2-live 1.8s ease-out infinite; }
@keyframes wc2-live { 0% { box-shadow: 0 0 0 0 rgba(34, 180, 110, .55); } 70%, 100% { box-shadow: 0 0 0 6px rgba(34, 180, 110, 0); } }
@media (prefers-reduced-motion: reduce) { .ls-tiers .wc2 .wc-chip::before { animation: none; } }
.ls-tiers .wc2 .wc2-gold { min-width: 0; }
.ls-tiers .wc2 .wc2-gold .eco-amt b { overflow: hidden; text-overflow: ellipsis; }
.ls-tiers .wc2 .wc-chip { min-width: 0; padding: 3px 9px; background: color-mix(in srgb, var(--panel) 85%, transparent); font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.ls-tiers .wc2 .wc-chip { flex: none; }
.ls-tiers .wc2 .st-dot { flex: none; }
.ls-tiers .wc2 .wc-chip .wc-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc2-gold { cursor: pointer; font: inherit; color: #a06a00; border-color: #f3d48a !important; background: #fff8e6 !important; }
.wc2-gold .eco-amt { display: inline-flex; align-items: center; gap: 4px; }
.ls-tiers .wc2 .lv-chip.lv-av { inset-block-start: -4px; inset-block-end: auto; inset-inline-end: -4px; }
/* text beside the name: a message with a video / picture lines «name :» up with its top (a media-only message has no text
   line to align on, its name would drop to the bottom) */
/* any message that is not plain text (cards, gifts, pictures, videos, stickers, voice, add-on content) lines «name :» up
   with its top — one rule for every kind, present and future; a big emoji alone stays centred (rule below) */
.msgs-rows.mtp-inline .msg-main:has(> .msg-bubble.custom, .prs-gc, .yt-media, .inline-media, .emo.st, .msg-bubble img:not(.emo), .msg-bubble video, .msg-bubble audio) { align-items: flex-start; }
@media (max-width: 760px) {
  .msgs-rows.mtp-inline .msg-main:has(> .msg-bubble.custom, .prs-gc, .yt-media, .inline-media, .emo.st, .msg-bubble img:not(.emo), .msg-bubble video, .msg-bubble audio) :is(.msg-head, .msg-text, .msg-bubble) { vertical-align: top; }
}
/* standing look, one even list: a light tint of the theme behind the whole panel, every row alike — alternating with a
   shade of the theme (Admin «Alternate list row colours»), else one colour with a thin line; a quiet gender mark; offline
   members keep their dimmed picture; store row lights always show */
.ls-tiers .sidepanel .sp-body { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.ls-tiers .ulist > .urow { background: transparent; border-color: transparent; border-radius: 8px; }
.ls-tiers .ulist.alt > .urow:nth-child(even of .urow) { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.ls-tiers .ulist:not(.alt) > .urow { border-radius: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.ls-tiers .ulist > .urow.self { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.ls-tiers .g-staff + .ulist > .urow:not(.self) { background: linear-gradient(to var(--lg-end, right), color-mix(in srgb, #ffd27a 30%, transparent), transparent); }
.ls-tiers .urow .sex-ic { width: 16px; height: 16px; background: none; }
.ls-tiers .urow .sex-ic.s1 { color: color-mix(in srgb, var(--male, #4c9be8) 75%, var(--panel)); }
.ls-tiers .urow .sex-ic.s2 { color: color-mix(in srgb, var(--female, #e957a5) 75%, var(--panel)); }
.ls-tiers .sidepanel :is(.sp-body, .sp-box) { overflow-x: hidden; } /* the member list never scrolls sideways */

/* ---------- live icons (Admin › Appearance «Icon style», default): two-tone set in the bars and the composer, a capsule
   under the open / on-air button, a short move when a counter grows, a quiet sign while on air ---------- */
.ico-live .bar-btn .bar-ic { width: 46px; height: 28px; border-radius: 14px; transition: background .2s, color .2s; }
.ico-live .bar-btn .bar-ic .ic { width: 23px; height: 23px; }
.ico-live .topbar .bar-btn .bar-ic { width: 36px; height: 30px; border-radius: 11px; background: color-mix(in srgb, var(--bar-text) 12%, transparent); }
.ico-live .bar-btn:is(.is-open, .is-on) .bar-ic { background: color-mix(in srgb, var(--bar-text) 92%, transparent); color: var(--accent); }
.ico-live .bar-btn:is(.is-open, .is-on) .bar-ic .ic { transform: scale(1.04); }
/* on air: camera keeps its red dot; the microphone a soft breathing ring; listening a gentle wave */
.ico-live .bar-btn.is-on[data-key="av_mic"] .bar-ic::after, .ico-live .bar-btn.is-on[data-key="player"] .bar-ic::after {
  inset: -3px; width: auto; height: auto; border-radius: 16px; background: none; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 70%, transparent); animation: ico-breathe 1.6s ease-in-out infinite; }
@keyframes ico-breathe { 0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, #22c55e 70%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, #22c55e 0%, transparent); } }
/* a counter that grows: the bell rings, the letter jumps, a request pops, any other icon bounces */
.ico-live .ico-ev .bar-ic .ic { animation: ico-pop .6s ease-out; transform-origin: 50% 20%; }
.ico-live .ico-ev[data-key="notifications"] .bar-ic .ic { animation: ico-ring .9s ease-in-out; }
.ico-live .ico-ev[data-key="messages"] .bar-ic .ic { animation: ico-jump .7s ease-out; }
@keyframes ico-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes ico-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
@keyframes ico-jump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-5px) rotate(-6deg); } 60% { transform: translateY(1px); } }
/* composer: the tools in one soft capsule, a round send button in the theme colour that is a microphone while empty */
.cbar { display: contents; }
.ico-live .cbar { order: 2; display: flex; align-items: center; gap: 0; padding: 2px; border-radius: 22px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.ico-live .cbar .cbtn { width: 36px; height: 36px; border-radius: 50%; }
.ico-live .cbar .cbtn .ic { width: 22px; height: 22px; }
.ico-live #composer-mod [data-key="voicemsg"] { display: none; } /* the send button records while the box is empty */
.ico-live .send-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.ico-live .send-btn .ic { width: 21px; height: 21px; transition: transform .2s; }
.ico-live .composer.vm-mode .send-btn .ic { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) { .ico-live .ico-ev .bar-ic .ic, .ico-live .bar-btn.is-on .bar-ic::after { animation: none !important; } }
.conv-last, .conv-last * { pointer-events: none; } /* a tap on the preview opens the conversation, never a link or a name */
/* live icons: counters sit on the corner of the icon box (they spilled over the next icon / off the screen edge) */
.ico-live .bar-btn .badge, .ico-live .bar-btn .count { inset-block-start: -2px; inset-inline-end: -5px; } /* inside the bar: nothing above the icon boxes is shown */
.ico-live .topbar .bar-btn .badge, .ico-live .topbar .bar-btn .count { inset-block-start: -2px; inset-inline-end: -6px; } /* inside the bar: the top bar has no room above its icon boxes */
.ico-live .drawer-btn .bar-ic .badge { inset-inline-end: auto; inset-inline-start: -4px; } /* the menu button sits at the screen edge */
/* private conversations (standing look): a calm list like the big messaging apps — names in the text colour (no member
   colours or effects here), one background, a hairline under each row starting after the picture; only unread rows stand
   out (bold name and preview, time in the theme colour, count pill); the open conversation softly highlighted; read
   ticks before my own last message; compact head: a filter box and two small icon buttons */
.ls-tiers .conv-head { gap: 6px; align-items: center; }
.ls-tiers .conv-filter { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--panel); font: inherit; font-size: 13px; }
.ls-tiers .conv-head:not(:has(.conv-filter))::before { content: ""; flex: 1; }
.ls-tiers .conv-list { gap: 0; }
.ls-tiers .conv { position: relative; border-radius: 12px; }
.ls-tiers .conv::after { content: ""; position: absolute; inset-block-end: 0; inset-inline-start: 66px; inset-inline-end: 8px; height: 1px; background: var(--line); }
.ls-tiers .conv:last-child::after { display: none; }
.ls-tiers .conv:hover { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.ls-tiers .conv.current { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.ls-tiers .conv-main { gap: 12px; padding: 9px 8px; }
.ls-tiers .conv-main .avatar { width: 48px; height: 48px; }
.ls-tiers .conv-main .av-wrap:not(.ps-fr):not(.cl-pf) { isolation: isolate; }
.ls-tiers .conv-main .av-wrap:not(.ps-fr):not(.cl-pf)::before { content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: linear-gradient(135deg, var(--ring1), var(--ring2)); }
.ls-tiers .conv-main .av-wrap:not(.ps-fr):not(.cl-pf) .avatar { box-shadow: 0 0 0 2px var(--panel); }
.ls-tiers .conv-top { align-items: baseline; }
.ls-tiers .conv-top .uname { color: var(--text) !important; font-weight: 600; background: none !important; -webkit-text-fill-color: currentColor; text-shadow: none; animation: none; }
.ls-tiers .conv-top .uname::before, .ls-tiers .conv-top .uname::after { display: none; }
.ls-tiers .conv-top time { color: var(--faint); }
.ls-tiers .conv-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ls-tiers .conv-sub .conv-last { flex: 1; min-width: 0; color: var(--muted); }
.ls-tiers .conv-sub .pill { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent, #fff); font-size: 11px; line-height: 20px; text-align: center; }
.ls-tiers .conv.unread .conv-top .uname { font-weight: 800; }
.ls-tiers .conv.unread .conv-sub .conv-last { color: var(--text); font-weight: 600; }
.ls-tiers .conv.unread .conv-top time { color: var(--accent); font-weight: 700; }
.conv-you { font-weight: 700; color: var(--muted); }
.conv-tick { width: 15px; height: 15px; margin-inline-end: 2px; vertical-align: -3px; color: var(--faint); }
.conv-tick.seen { color: #2f8be6; }
.ls-tiers .conv .conv-del { opacity: 0; pointer-events: none; transition: opacity .15s; }
.ls-tiers .conv:is(:hover, .show-del) .conv-del { opacity: 1; pointer-events: auto; }
@media (hover: none) { .ls-tiers .conv:hover:not(.show-del) .conv-del { opacity: 0; pointer-events: none; } }
/* member colours stay readable on the theme: on light themes a too-light colour is darkened, on dark themes a too-dark one
   lightened (same hue, CSS only); name effects of the store keep their own colours */
.uname.has-uc { color: var(--uc); }
@supports (color: oklch(from red l c h)) {
  /* only plain names: a name with its own store look, or on a row light / decorated bubble, keeps the member's colour */
  .uname.has-uc:not([class*="vns-"]):not([class*="nfx"]):not(.prs-sm *):not([class*="bub-"] *) { color: oklch(from var(--uc) clamp(.74, l, 1) c h); }
  :is([data-theme="sky"], [data-theme="light"], [data-theme="rose"], :root:not([data-theme])) .uname.has-uc:not([class*="vns-"]):not([class*="nfx"]):not(.prs-sm *):not([class*="bub-"] *) { color: oklch(from var(--uc) clamp(0, l, .62) c h); }
}
/* wide screens are larger and dimmer than phones: the member list tint is lighter there (4% / 7%; phones keep 7% / 12%) */
@media (min-width: 761px) {
  .ls-tiers .sidepanel .sp-body { background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
  .ls-tiers .ulist.alt > .urow:nth-child(even of .urow) { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
}

/* ---------- rooms list (standing look): a head on one line that stays at the top (search, «+», «⚙» with the room
   tools folded under it); cards with the name on one line, a one-line description, the member count as a theme pill
   (grey when empty), the temporary-room timer on the corner of the room picture, «you are here» on the current room ---------- */
.ls-tiers .rooms-top { position: sticky; inset-block-start: -10px; z-index: 4; margin: -10px -10px 6px; padding: 10px 10px 8px; background: color-mix(in srgb, var(--accent) 4%, var(--panel)); border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .ls-tiers .rooms-top { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); } }
.ls-tiers .rooms-top-row { display: flex; align-items: center; gap: 6px; }
.ls-tiers .rooms-top-row > .ct-room-search { flex: 1; min-width: 0; margin: 0; }
.ls-tiers .rooms-top-row > .grow { flex: 1; }
.ls-tiers .rt-btn { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--accent); }
.ls-tiers .rt-btn.rt-new { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.ls-tiers .rt-btn.on { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.ls-tiers .rooms-manage { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ls-tiers .rooms-manage[hidden] { display: none; }
.ls-tiers .rooms-manage > * { margin: 0; padding: 0; }
.ls-tiers .rooms-manage > .panel-actions { display: contents; }
.ls-tiers .rooms-manage > .vp-room-station { flex: 1 1 100%; }
.ls-tiers .room-list { gap: 0; }
.ls-tiers .room-card { position: relative; padding: 10px 8px; border-bottom: 0; border-radius: 12px; }
.ls-tiers .room-list > .room-card:nth-child(even of .room-card:not([hidden])) { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
@media (max-width: 760px) { .ls-tiers .room-list > .room-card:nth-child(even of .room-card:not([hidden])) { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); } }
.ls-tiers .room-card.active { background: transparent; } /* the current room keeps the alternating rows: its «you are here» dot marks it */
.ls-tiers .room-card-ic { width: 48px; height: 48px; }
.ls-tiers .room-card-info { gap: 2px; }
.ls-tiers .room-card-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-tiers .room-card-info b .ic.tiny, .ls-tiers .room-card-info b .chip-mini, .ls-tiers .room-card-info b .rule-mark { vertical-align: middle; margin-inline-start: 3px; }
.ls-tiers .room-card-info small { -webkit-line-clamp: 1; }
.ls-tiers .room-count { min-width: 44px; justify-content: center; background: color-mix(in srgb, var(--muted) 14%, var(--panel)); }
.ls-tiers .room-count.live { background: var(--accent); color: var(--on-accent, #fff); }
.ls-tiers .room-count.full { background: var(--danger); color: #fff; }
/* rooms list: a room with people shows its count in green with a softly blinking dot (like the personal card), empty
   rooms stay grey, full ones red; a stronger alternate row on phones */
.ls-tiers .room-count.live { background: #16a34a; color: #fff; }
.ls-tiers .room-count.live > .ic { display: none; }
.ls-tiers .room-count.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: wc2-live-w 1.8s ease-out infinite; }
@keyframes wc2-live-w { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70%, 100% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); } }
.ls-tiers .room-count.full { background: var(--danger); }
.ls-tiers .room-count.full::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .ls-tiers .room-count.live::before { animation: none; } }
@media (max-width: 760px) { .ls-tiers .room-list > .room-card:nth-child(even of .room-card:not([hidden])) { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); } }
/* join / move lines: plain inline text in every browser (no flex inside: iPhone Safari broke the flex rows and draws the
   letters a little wider). The sentence beside the picture on the owner's chat side, the door icon and the time at the
   far end; the member name first and whole. NOTHING is ever cut: a line too long for the phone continues on a second
   line, the room name kept in one piece */
.msg-sys.jl-row .jl-pill > span { display: block; flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: normal; text-align: left; }
.cd-room-r .msg-sys.jl-row .jl-pill > span { text-align: right; }
.msg-sys.jl-row .jl-pill > span > .jl-who { display: inline-flex; vertical-align: middle; max-width: 100%; white-space: nowrap; }
.msg-sys.jl-row .jl-pill > span > .jl-who .uname { min-width: 0; }
.msg-sys.jl-row .jl-pill > span > .jl-words { display: inline; margin-inline-start: .3em; vertical-align: middle; }
.msg-sys.jl-row .prs-room { white-space: nowrap; }
/* a framed line (collection pill): the same inline text inside the pill, its sign an inline picture at the end, the pill
   as wide as its words; the door icon steps aside (the pill's sign marks the line) and phones use a slightly smaller
   font. «body» outranks the collection's own pill rule, which loads later */
body .msg-sys.jl-row.cl-jl .jl-pill > span:first-child { display: inline-block; width: auto; flex: 0 1 auto; text-align: start; border-radius: 16px; line-height: 1.6; }
body .msg-sys.jl-row.cl-jl .jl-pill > span:first-child::after { display: inline-block; vertical-align: middle; margin-inline-start: 6px; }
.msg-sys.jl-row.cl-jl .jl-pill > .jl-kind { display: none; }
@media (max-width: 760px) { body .msg-sys.jl-row.cl-jl .jl-pill > span:first-child { font-size: .9em; } }

/* ---------- one type scale for the whole chat: main 15 (every message text — room, private, bots, system lines — and
   every name), secondary 13 (status line, conversation preview), times as they are; text medium (500), names extra
   bold (800); «Bold» of the text style is 800 so it still stands out. Members' own fonts, effects and zoom still apply ---------- */
.msg-text, .pm-text { font-weight: 500; }
.pm-text { font-size: calc(15px * var(--mz, 1)); }
.msg-bubble.tb .msg-text, .msg-bubble.tb .pm-text { font-weight: 800; }
.uname { font-weight: 800; }
.msg-name, .urow-name, .conv-top .uname { font-size: 15px; }
.msg-sys .sys-pill, .msg-sys.jl-row .jl-pill { font-size: calc(15px * var(--mz, 1)); font-weight: 500; color: var(--text); }
.urow-info small, .conv-info small { font-size: 13px; font-weight: 500; }
.ls-tiers .conv-top .uname { font-weight: 700; }
.ls-tiers .conv.unread .conv-top .uname { font-weight: 800; }
/* staff IP lookup shown in place */
.ip-wrap { display: inline-flex; flex-direction: column; gap: 6px; max-width: 100%; }
.ip-text { overflow-wrap: anywhere; }
.ip-info { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, var(--panel)); border: 1px solid var(--line); font-size: 13px; text-align: start; direction: inherit; }
.ip-info[hidden] { display: none; }
.ip-row { display: flex; gap: 8px; }
.ip-row b { flex: none; min-width: 84px; color: var(--muted); font-weight: 600; }
.ip-warn { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 12%, var(--panel)); color: var(--danger); font-weight: 700; }
.ip-warn .ic { width: 15px; height: 15px; }
/* text beside the name: a big-emoji message centres «name :» on the emoji (on its baseline the name dropped to the bottom) */
.msgs-rows.mtp-inline .msg-main:has(.big-emo) { align-items: center; }
.msgs-rows.mtp-inline .msg-main:has(.big-emo) .msg-head { align-self: center; }
@media (max-width: 760px) {
  .msgs-rows.mtp-inline .msg-main:has(.big-emo) :is(.msg-head, .msg-text) { vertical-align: middle; }
}
/* rooms with people: a livelier blink — the dot pulses with a wide ring and the pill glows softly */
.ls-tiers .room-count.live { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); animation: rc-glow 1.6s ease-out infinite; }
.ls-tiers .room-count.live::before { width: 8px; height: 8px; animation: rc-dot 1.6s ease-in-out infinite; }
@keyframes rc-glow { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } }
@keyframes rc-dot { 0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); } 50% { opacity: .35; transform: scale(.75); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .ls-tiers .room-count.live, .ls-tiers .room-count.live::before { animation: none; } }
/* room card, standing look: an arc on every room like the room messages (dark / light by turns, theme colours); row 1 =
   name, «you are here» dot, status (temporary time, members) and star; row 2 = the description across the card, two lines */
.ls-tiers .room-card { border-inline-start: 3px solid var(--fr1); }
.ls-tiers .room-list > .room-card:nth-child(even of .room-card:not([hidden])) { border-inline-start-color: var(--fr2); }
.ls-tiers .room-card .room-card-info { gap: 3px; }
.ls-tiers .room-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ls-tiers .room-top > b { flex: 0 1 auto; min-width: 0; font-size: 15px; }
.ls-tiers .room-top > .grow { flex: 1; }
.ls-tiers .room-here-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.ls-tiers .room-top .room-count { padding: 2px 8px; font-size: 11.5px; min-width: 38px; }
.ls-tiers .room-ic-wrap { position: relative; flex: none; display: block; }
.ls-tiers .room-ic-wrap > .tr-mark { position: absolute; inset-block-end: -5px; left: 50%; transform: translateX(-50%); margin: 0; padding: 0 7px; border-radius: 9px; background: #f59e0b; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 17px; white-space: nowrap; box-shadow: 0 0 0 2px var(--panel); }
.ls-tiers .room-ic-wrap > .tr-mark.soon { background: #ef4444; }
.ls-tiers .room-ic-wrap > .tr-mark .ic { width: 10px; height: 10px; color: currentColor; }
.ls-tiers .room-top .fv-star { position: static; flex: none; width: 26px; height: 26px; }
.ls-tiers .room-card-info > small { -webkit-line-clamp: 2; font-size: 13px; line-height: 1.45; }
.ls-tiers .room-card-info > small.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
/* phones: the side lists a little darker (panel 11%, alternate rows 17% members / 20% rooms) */
@media (max-width: 760px) {
  .ls-tiers .sidepanel .sp-body, .ls-tiers .rooms-top { background: color-mix(in srgb, var(--accent) 11%, var(--panel)); }
  .ls-tiers .ulist.alt > .urow:nth-child(even of .urow) { background: color-mix(in srgb, var(--accent) 17%, var(--panel)); }
  .ls-tiers .room-list > .room-card:nth-child(even of .room-card:not([hidden])) { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); }
}
/* personal card: the greeting with the time beside it, a quiet pill */
.wc2-hi { display: flex; align-items: center; gap: 8px; }
.wc2-hi > small { font-size: 12px; }
.wc2-clock { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); font-size: 11px; font-weight: 700; line-height: 18px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
/* member text colours stay readable on the theme too (same rule as the names): a too-dark colour is lightened on dark
   themes, a too-light one darkened on light themes, same hue; bubbles with their own store background keep it as chosen */
@supports (color: oklch(from red l c h)) {
  .msg-bubble.tc:not([class*="bub-"]):not(.prs-sm) .msg-text { color: oklch(from var(--msg-color) clamp(.74, l, 1) c h); }
  :is([data-theme="sky"], [data-theme="light"], [data-theme="rose"], :root:not([data-theme])) .msg-bubble.tc:not([class*="bub-"]):not(.prs-sm) .msg-text { color: oklch(from var(--msg-color) clamp(0, l, .62) c h); }
}
/* text beside the name: a reply reads like the «below» layout — the name line (time at the far end), the quote across
   the message, then the text — so the quote never meets the time on phones */
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) { display: block; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) > .msg-head { display: flex; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) > .msg-head::after { content: none; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) > .msg-bubble { display: block; width: fit-content; max-width: 100%; margin-top: 4px; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) > .msg-bubble:not([class*="bub-"]):not(.custom):not(.action):not(.prs-sm) { display: block; width: auto; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) .reply-quote { margin: 0 0 6px; }
.msgs-rows.mtp-inline .msg-main:has(.reply-quote) .msg-text { display: block; }
@media (max-width: 760px) {
  .msgs-rows.mtp-inline .msg-main:has(.reply-quote)::before { float: inline-end; flex: none; height: 22px; }
}
/* a very light name colour (or a very dark one on dark themes) with a store look keeps its colour and gets a thin
   outline, only when it needs it, so it reads on any theme */
@supports (color: oklch(from red l c h)) {
  :is(.uname.has-uc:is([class*="vns-"], [class*="nfx"]), :is(.prs-sm, [class*="bub-"]) .uname.has-uc) {
    -webkit-text-stroke: .7px oklch(from var(--uc) .9 .02 h / clamp(0, (.34 - l) * 6, 1)); paint-order: stroke fill; }
  :is([data-theme="sky"], [data-theme="light"], [data-theme="rose"], :root:not([data-theme])) :is(.uname.has-uc:is([class*="vns-"], [class*="nfx"]), :is(.prs-sm, [class*="bub-"]) .uname.has-uc) {
    -webkit-text-stroke: .7px oklch(from var(--uc) .32 .04 h / clamp(0, (l - .78) * 6, 1)); }
}

/* ==========================================================================
   Live entrance (Admin › Appearance › Entrance look = live): the theme colours only — accent glows on the page
   background, the bar gradient for titles and buttons, a preview phone, live cards, feature tiles
   ========================================================================== */
.lvx-land { position: relative; min-height: 100vh; min-height: 100dvh; overflow-x: clip; background: var(--land-bg); color: var(--text); }
.lvx-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lvx-bg i { position: absolute; border-radius: 50%; } /* soft glows drawn as radial gradients: big blur filters turn black on iPhone Safari */
.lvx-g1 { width: 1100px; height: 1100px; inset-block-start: -520px; inset-inline-end: -380px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent); }
.lvx-g2 { width: 860px; height: 860px; inset-block-start: 120px; inset-inline-start: -400px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 20%, transparent), transparent); }
.lvx-g3 { width: 800px; height: 800px; inset-block-end: -420px; inset-inline-end: 20%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 15%, transparent), transparent); }
.lvx-bg .lvx-grid { inset: 0; width: auto; height: auto; border-radius: 0; background-image: linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px); background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse 70% 55% at 60% 30%, #000 25%, transparent 75%); mask-image: radial-gradient(ellipse 70% 55% at 60% 30%, #000 25%, transparent 75%); }
.lvx-nav { position: relative; z-index: 2; display: flex; align-items: center; gap: 26px; padding: 20px clamp(18px, 5vw, 64px); }
.lvx-logo img { display: block; height: 42px; width: auto; }
.lvx-links { display: flex; gap: 22px; }
.lvx-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.lvx-links a:hover { color: var(--accent); }
.lvx-sp { flex: 1; }
.lvx-lang { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.lvx-lang .ic { width: 17px; height: 17px; color: var(--accent); }
.lvx-hero { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: start; padding: 10px clamp(18px, 5vw, 64px) 56px; }
.lvx-pill { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 14%, transparent); font-size: 14px; font-weight: 600; }
.lvx-stk { display: inline-flex; }
.lvx-stk img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--panel); margin-inline-start: -9px; background: var(--panel2); }
.lvx-stk img:first-child { margin-inline-start: 0; }
.lvx-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .22); animation: wc2-live 1.6s ease-out infinite; }
.lvx-h1 { margin: 20px 0 14px; font-size: clamp(36px, 5vw, 64px); line-height: 1.12; font-weight: 800; letter-spacing: -1px; }
.lvx-h1 span, .lvx-h1 em { display: block; }
.lvx-h1 em { font-style: normal; background: var(--bar-grad, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 6px; }
.lvx-lead { margin: 0; max-width: 560px; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.75; }
/* the live numbers under the title: three small glass cards (icon, number, label); «online» breathes */
.lvx-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.lvx-st { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 16px 10px 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--panel) 72%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 10%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lvx-st-ic { grid-row: 1 / span 2; position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 13%, var(--panel)); color: var(--accent); }
.lvx-st-ic .ic { width: 19px; height: 19px; }
.lvx-st.live .lvx-st-ic { background: color-mix(in srgb, #16a34a 14%, var(--panel)); color: #16a34a; }
.lvx-st.live .lvx-st-ic i { position: absolute; inset-block-start: -2px; inset-inline-end: -2px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 2px var(--panel); animation: lvx-pulse 2s ease-out infinite; }
@keyframes lvx-pulse { 0% { box-shadow: 0 0 0 2px var(--panel), 0 0 0 2px rgba(34, 197, 94, .55); } 100% { box-shadow: 0 0 0 2px var(--panel), 0 0 0 10px rgba(34, 197, 94, 0); } }
.lvx-st b { font-size: 21px; font-weight: 800; line-height: 1.1; color: var(--text); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.lvx-st small { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.lvx-card { margin-top: 24px; max-width: 440px; }
.lvx-card .auth-card { width: 100%; text-align: start; padding: 22px 22px 18px; box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 20%, transparent); }
.lvx-card .auth-title, .lvx-card .auth-sub { display: none; }
.lvx-card .auth-card .tabs { margin-top: 0; }
/* the preview phone, tilted, with live cards around it */
.lvx-show { position: relative; height: 656px; perspective: 1600px; }
.lvx-phone { position: absolute; inset-block-start: 6px; left: 50%; width: 310px; height: 645px; margin-left: -155px; padding: 11px; border-radius: 50px; /* screen 288 x 623 = the clips' 540 x 1168 */ background: linear-gradient(145deg, #2b3550, #0e1428 45%, #1f2742); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14), 0 50px 100px rgba(10, 25, 60, .35), 0 0 90px color-mix(in srgb, var(--accent) 35%, transparent); transform: rotateY(-13deg) rotateX(5deg) rotateZ(1deg); }
.lvx-scr { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: 40px; overflow: hidden; background: var(--bg); }
.lvx-pbar { flex: none; display: flex; align-items: flex-end; justify-content: center; height: 78px; padding-bottom: 10px; background: var(--bar-grad, var(--accent)); }
.lvx-pbar img { height: 24px; width: auto; }
.lvx-plog { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px; }
.lvx-pm { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 14px; background: var(--panel); border-inline-start: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(20, 50, 100, .06); }
.lvx-pm:nth-child(even) { border-inline-start-color: color-mix(in srgb, var(--accent) 55%, var(--panel)); }
.lvx-pav { flex: none; width: 34px; height: 34px; border-radius: 50%; padding: 2px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); }
.lvx-pav img { width: 100%; height: 100%; border-radius: 50%; background: var(--panel); }
.lvx-pm b { font-size: 13px; font-weight: 800; }
.lvx-pm p { margin: 1px 0 0; font-size: 13px; color: var(--text); line-height: 1.45; }
.lvx-pin { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 10px 14px; padding: 0 6px 0 14px; height: 42px; border-radius: 21px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.lvx-pin span { flex: 1; }
.lvx-pin i { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); }
.lvx-shine { position: absolute; inset: 11px; border-radius: 40px; background: linear-gradient(115deg, rgba(255, 255, 255, .22), transparent 32%); pointer-events: none; }
.lvx-ev { position: absolute; z-index: 3; display: flex; align-items: center; gap: 11px; padding: 10px 14px 10px 10px; border-radius: 18px; background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid color-mix(in srgb, var(--panel) 60%, var(--line)); box-shadow: 0 16px 40px rgba(20, 45, 100, .18); white-space: nowrap; animation: lvx-float 6s ease-in-out infinite; }
.lvx-ev b { display: block; font-size: 13.5px; font-weight: 700; }
.lvx-ev small { display: block; color: var(--muted); font-size: 11.5px; }
.lvx-eic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.lvx-eic img { width: 100%; height: 100%; object-fit: cover; }
.lvx-eic .ic { width: 21px; height: 21px; }
.lvx-e1 { inset-block-start: 64px; inset-inline-start: 0; }
.lvx-e2 { inset-block-start: 270px; inset-inline-end: 0; animation-delay: -2s; }
.lvx-e3 { inset-block-end: 130px; inset-inline-start: 6px; animation-delay: -4s; }
.lvx-e4 { inset-block-end: 26px; inset-inline-end: 30px; animation-delay: -1s; }
@keyframes lvx-float { 50% { transform: translateY(-8px); } }
/* features */
.lvx-feat { position: relative; z-index: 1; padding: 20px clamp(18px, 5vw, 64px) 60px; }
.lvx-feat h2 { margin: 0; text-align: center; font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.5px; }
.lvx-feat-sub { margin: 6px 0 30px; text-align: center; color: var(--muted); font-size: 16px; }
.lvx-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 200px; gap: 16px; }
.lvx-tile { position: relative; overflow: hidden; padding: 22px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 10%, transparent); }
.lvx-tile.big { grid-column: span 2; grid-row: span 2; }
.lvx-tile.wide { grid-column: span 2; }
.lvx-tic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.lvx-tic .ic { width: 22px; height: 22px; }
.lvx-tile h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.lvx-tile p { margin: 0; max-width: 340px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.lvx-seats { position: absolute; inset-block-end: 26px; inset-inline: 22px; display: flex; justify-content: center; gap: 14px; }
.lvx-seat { display: grid; place-items: center; width: 72px; height: 72px; padding: 3px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.lvx-seat img { width: 100%; height: 100%; border-radius: 50%; background: var(--panel); }
.lvx-seat.on { box-shadow: 0 0 0 3px #22c55e, 0 0 0 9px rgba(34, 197, 94, .18), 0 0 30px rgba(34, 197, 94, .4); }
.lvx-seat.host { box-shadow: 0 0 0 3px #f5b301, 0 0 24px rgba(245, 179, 1, .35); }
.lvx-seat.free { border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); background: none; color: color-mix(in srgb, var(--accent) 60%, var(--muted)); }
.lvx-seat.free .ic { width: 24px; height: 24px; }
.lvx-wave { position: absolute; inset-block-end: 116px; inset-inline: 30px; display: flex; gap: 6px; align-items: center; justify-content: center; height: 60px; }
.lvx-wave i { width: 6px; border-radius: 3px; background: var(--bar-grad, var(--accent)); animation: lvx-wave 1.2s ease-in-out infinite; }
.lvx-wave i:nth-child(1) { height: 18px; } .lvx-wave i:nth-child(2) { height: 36px; animation-delay: -.2s; } .lvx-wave i:nth-child(3) { height: 26px; animation-delay: -.5s; }
.lvx-wave i:nth-child(4) { height: 50px; animation-delay: -.1s; } .lvx-wave i:nth-child(5) { height: 30px; animation-delay: -.7s; } .lvx-wave i:nth-child(6) { height: 44px; animation-delay: -.3s; }
.lvx-wave i:nth-child(7) { height: 20px; animation-delay: -.6s; } .lvx-wave i:nth-child(8) { height: 38px; animation-delay: -.4s; } .lvx-wave i:nth-child(9) { height: 24px; animation-delay: -.8s; }
@keyframes lvx-wave { 50% { transform: scaleY(.45); } }
.lvx-tv { position: absolute; inset-block-end: 18px; left: 22px; width: 44%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #000), color-mix(in srgb, var(--accent) 25%, #000)); box-shadow: 0 14px 30px rgba(10, 30, 70, .3); }
.lvx-tv i { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.lvx-tv i::after { content: ""; position: absolute; top: 12px; left: 16px; border-style: solid; border-width: 8px 0 8px 12px; border-color: transparent transparent transparent var(--accent); }
.lvx-foot { position: relative; z-index: 1; padding: 0 16px 24px; }
.lvx-foot .land-foot { max-width: 900px; margin: 0 auto; }
@media (max-width: 900px) {
  .lvx-hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 30px; }
  .lvx-links { display: none; }
  .lvx-card { max-width: none; }
  .lvx-show { height: 560px; max-width: 420px; width: 100%; margin: 6px auto 0; }
  .lvx-phone { width: 260px; height: 542px; margin-left: -130px; border-radius: 44px; padding: 9px; }
  .lvx-scr { border-radius: 36px; } .lvx-shine { inset: 9px; border-radius: 36px; }
  .lvx-ev { padding: 8px 11px 8px 8px; } .lvx-eic { width: 34px; height: 34px; } .lvx-ev b { font-size: 12.5px; }
  .lvx-e3 { display: none; }
  .lvx-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 180px; }
  .lvx-tile.big { grid-row: span 2; }
}
@media (max-width: 560px) {
  .lvx-nav { padding: 14px 16px; gap: 12px; } .lvx-logo img { height: 34px; }
  .lvx-lang { height: 36px; padding: 0 10px; font-size: 13px; }
  .lvx-hero { padding: 4px 16px 24px; gap: 18px; }
  .lvx-stats { gap: 8px; } .lvx-st { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; text-align: center; } .lvx-st-ic { width: 34px; height: 34px; } .lvx-st b { font-size: 20px; } .lvx-st small { font-size: 11.5px; }
  .lvx-bento { grid-template-columns: minmax(0, 1fr); }
  .lvx-tile.big, .lvx-tile.wide { grid-column: auto; }
  .lvx-tile.big { grid-row: span 2; }
}
.lvx-tile.lvx-fill1 { grid-column: span 1; } .lvx-tile.lvx-fill2 { grid-column: span 2; } .lvx-tile.lvx-fill3 { grid-column: span 3; } .lvx-tile.lvx-fill4 { grid-column: span 4; }
/* the entry card of the live entrance: three equal tabs (member, guest, new account) on every screen; the duplicate buttons
   under the card step aside */
.lvx-card .auth-card .tab-reg { display: block; }
.lvx-card .auth-card .auth-or, .lvx-card .auth-card .auth-alt { display: none; }
@media (max-width: 900px) { .lvx-tile.lvx-fill3, .lvx-tile.lvx-fill4 { grid-column: span 2; } }
@media (max-width: 560px) {
  .lvx-tile[class*="lvx-fill"] { grid-column: auto; }
  .lvx-tile:has(.lvx-tv) { height: auto; grid-row: span 1; }
  .lvx-tv { position: relative; left: auto; inset-block-end: auto; width: 100%; margin-top: 14px; }
  .lvx-bento { grid-auto-rows: minmax(150px, auto); }
}
/* live entrance tiles: the feature at work in each tile */
.lvx-bento { grid-auto-rows: 250px; }
.lvx-tile { display: flex; flex-direction: column; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel) 60%); border-color: color-mix(in srgb, var(--accent) 14%, var(--line)); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 14px 34px color-mix(in srgb, var(--accent) 10%, transparent); }
.lvx-tile.rise { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.lvx-tile.rise.in { opacity: 1; transform: none; }
.lvx-tile > :is(.lvx-rooms, .lvx-giftl, .lvx-stories, .lvx-tools, .lvx-names) { margin-top: auto; }
.lvx-seatw { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.lvx-seat { position: relative; }
.lvx-crown { position: absolute; inset-block-start: -14px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 18px; }
.lvx-seat.on { animation: lvx-talk 1.4s ease-in-out infinite; }
@keyframes lvx-talk { 50% { box-shadow: 0 0 0 3px #22c55e, 0 0 0 14px rgba(34, 197, 94, .1), 0 0 40px rgba(34, 197, 94, .45); } }
.lvx-seats { inset-block-end: 22px; }
/* watch together: the floating window with a moving scene */
.lvx-fwin { position: absolute; inset-block-end: 18px; left: 20px; width: 46%; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 16px 36px rgba(10, 30, 70, .3); }
.lvx-fwh { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #111; color: #fff; font-size: 11px; direction: ltr; }
.lvx-fwh i { width: 6px; height: 6px; border-radius: 50%; background: #ef4444; }
.lvx-fwh b { flex: 1; font-weight: 600; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvx-fwh span { opacity: .6; letter-spacing: 4px; }
.lvx-scene { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: linear-gradient(#7cc3ff, #cfe9ff 60%, #e9f6ff); }
.lvx-sun { position: absolute; width: 34px; height: 34px; border-radius: 50%; inset-block-start: 14%; left: 18%; background: radial-gradient(#fff6c2, #ffd23f); box-shadow: 0 0 30px #ffd23f; animation: lvx-sun 8s ease-in-out infinite; }
.lvx-hill { position: absolute; bottom: -40%; border-radius: 50%; }
.lvx-hill.h1 { width: 90%; height: 90%; left: -20%; background: linear-gradient(#5fbf6f, #3b9a55); }
.lvx-hill.h2 { width: 100%; height: 80%; right: -30%; background: linear-gradient(#4aa660, #2f8247); }
.lvx-cloud { position: absolute; top: 18%; width: 46px; height: 14px; border-radius: 10px; background: #fff; box-shadow: 14px -7px 0 2px #fff, 28px 0 0 #fff; animation: lvx-cloud 12s linear infinite; }
@keyframes lvx-cloud { from { left: -30%; } to { left: 110%; } }
@keyframes lvx-sun { 50% { transform: translateY(6px); } }
.lvx-fwp { height: 3px; background: #333; }
.lvx-fwp i { display: block; height: 100%; width: 35%; background: var(--accent); animation: lvx-prog 14s linear infinite; }
@keyframes lvx-prog { from { width: 5%; } to { width: 95%; } }
.lvx-viewers { position: absolute; inset-block-end: 22px; right: 22px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); color: var(--accent); font-size: 12px; font-weight: 700; }
.lvx-viewers i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
/* live camera tiles */
.lvx-cams { position: relative; margin-top: auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; height: 104px; }
.lvx-cam { position: relative; overflow: hidden; border-radius: 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 55%, #0b1430), #0b1430); display: grid; place-items: center; }
.lvx-cam img { width: 54%; max-width: 64px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.lvx-cam b { position: absolute; inset-block-end: 6px; inset-inline-start: 8px; color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.lvx-cam.talk { box-shadow: 0 0 0 2.5px #22c55e inset; }
.lvx-camv { position: absolute; inset-block-start: 7px; inset-inline-end: 8px; display: flex; gap: 2px; align-items: end; height: 12px; }
.lvx-camv em { width: 3px; border-radius: 2px; background: #22c55e; animation: lvx-wave 1s ease-in-out infinite; }
.lvx-camv em:nth-child(1) { height: 6px; } .lvx-camv em:nth-child(2) { height: 12px; animation-delay: -.3s; } .lvx-camv em:nth-child(3) { height: 8px; animation-delay: -.6s; }
.lvx-onair { position: absolute; z-index: 1; inset-block-start: 6px; inset-inline-start: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.lvx-onair::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: wc2-live-w 1.6s ease-out infinite; }
/* rooms */
.lvx-rooms { display: grid; gap: 7px; }
.lvx-room { display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); }
.lvx-room:nth-child(even) { border-inline-start-color: color-mix(in srgb, var(--accent) 55%, var(--panel)); }
.lvx-room img { width: 30px; height: 30px; border-radius: 9px; }
.lvx-room b { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvx-rn { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; background: #16a34a; color: #fff; font-size: 11.5px; font-weight: 800; }
.lvx-rn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: wc2-live-w 1.8s ease-out infinite; }
.lvx-rn.z { background: color-mix(in srgb, var(--muted) 16%, var(--panel)); color: var(--muted); }
.lvx-rn.z::before { display: none; }
/* gifts */
.lvx-giftl { position: relative; padding-top: 34px; }
.lvx-gl { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, #ec4899 10%, var(--panel)); border: 1.5px solid color-mix(in srgb, #ec4899 40%, var(--line)); font-size: 13px; }
.lvx-gl b { color: #d6336c; }
.lvx-gl em { font-style: normal; font-size: 18px; }
.lvx-fly { position: absolute; inset-block-start: 0; inset-inline-end: 20%; font-size: 30px; animation: lvx-fly 3.2s ease-in-out infinite; }
@keyframes lvx-fly { 0% { transform: translate(0, 30px) scale(.6) rotate(-10deg); opacity: 0; } 30% { opacity: 1; } 70% { transform: translate(-30px, -6px) scale(1.1) rotate(8deg); opacity: 1; } 100% { transform: translate(-50px, -16px) scale(.8); opacity: 0; } }
/* stories */
.lvx-stories { display: flex; gap: 14px; }
.lvx-story { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.lvx-story i { display: block; width: 56px; height: 56px; padding: 3px; border-radius: 50%; background: conic-gradient(#f59e0b, #ec4899, #8b5cf6, #f59e0b); }
.lvx-story.seen i { background: var(--line); }
.lvx-story img { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--panel); background: var(--panel); }
/* moderation tools */
.lvx-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lvx-tool { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.lvx-tool .ic { width: 16px; height: 16px; color: var(--accent); }
.lvx-tool:nth-child(3) .ic { color: var(--danger, #e03131); }
/* names with store looks */
.lvx-names { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lvx-nm { padding: 6px 16px; border-radius: 999px; font-size: 17px; font-weight: 800; }
.lvx-nm.n1 { border: 2px dotted #ec4899; background: color-mix(in srgb, #ec4899 8%, var(--panel)); color: #d6336c; }
.lvx-nm.n2 { background: linear-gradient(90deg, #ff5f6d, #ffc371); color: #fff; box-shadow: 0 6px 16px rgba(255, 95, 109, .35); }
.lvx-nm.n3 { background: #0b1020; color: #67e8f9; text-shadow: 0 0 8px #22d3ee, 0 0 16px #22d3ee; border: 1px solid #22d3ee; }
@media (max-width: 560px) {
  .lvx-bento { grid-auto-rows: minmax(210px, auto); }
  .lvx-fwin { position: relative; left: auto; inset-block-end: auto; width: 100%; margin-top: 14px; }
  .lvx-viewers { position: static; align-self: flex-start; margin-top: 10px; }
  .lvx-seats { position: relative; inset: auto; margin-top: auto; gap: 10px; }
  .lvx-seat { width: 60px; height: 60px; }
  .lvx-wave { position: relative; inset: auto; margin: 16px 0 10px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .lvx-tile.rise { opacity: 1; transform: none; } }
/* live entrance, story look: one feature at a time beside a phone that keeps its place (sticky); its screen follows */
.lvs-steps { display: flex; flex-direction: column; }
.lvs-kicker { position: relative; color: var(--accent); font-weight: 800; font-size: 15px; line-height: 1.5; margin: 0 0 6px; }
.lvs-step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; padding: 0 4px; opacity: .3; transition: opacity .45s; }
.lvs-step.on { opacity: 1; }
.lvs-step h3 { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; font-size: clamp(28px, 3.2vw, 42px); font-weight: 800; letter-spacing: -.8px; }
.lvs-step h3 .lvx-tic { margin: 0; width: 52px; height: 52px; border-radius: 16px; }
.lvs-step h3 .lvx-tic .ic { width: 26px; height: 26px; }
.lvs-step p { margin: 0; max-width: 520px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.lvs-step ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.lvs-step li { padding: 6px 14px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 10%, var(--panel)); color: var(--accent); font-weight: 700; font-size: 14px; }
.lvs-scr { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transform: scale(.97); transition: opacity .45s ease, transform .45s ease; }
.lvs-scr.on { opacity: 1; transform: none; }
/* the clips are a little taller than the phone screen: anchored at the bottom, the chat's bottom bar shows whole and the
   few pixels left over come off the top of the header (owner 11-30: no notch, nothing cut at the bottom) */
.lvs-scr .lvs-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; background: #f4f6fb; z-index: 2; border-radius: inherit; pointer-events: none; }
.lvs-pbar { flex: none; display: flex; align-items: flex-end; height: 86px; padding: 0 18px 10px; background: var(--bar-grad, var(--accent)); color: #fff; font-weight: 800; font-size: 13px; }
.lvs-log { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px; }
.lvs-msg { display: flex; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--panel); border-inline-start: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(20, 50, 100, .06); }
.lvs-msg:nth-child(even) { border-inline-start-color: color-mix(in srgb, var(--accent) 55%, var(--panel)); }
.lvs-av { flex: none; width: 34px; height: 34px; padding: 2px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); }
.lvs-av img { width: 100%; height: 100%; border-radius: 50%; background: var(--panel); }
.lvs-msg b { font-size: 13px; font-weight: 800; } .lvs-msg p { margin: 1px 0 0; font-size: 13px; }
.lvs-in { flex: none; display: flex; align-items: center; gap: 8px; margin: 0 10px 14px; height: 42px; padding: 0 6px 0 14px; border-radius: 21px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.lvs-in span { flex: 1; } .lvs-in i { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); }
.lvs-stage { margin: 8px 10px 0; padding: 12px 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 14%, transparent); }
.lvs-st-top { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 12px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.lvs-st-top b { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.lvs-st-top b i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
.lvs-seats { display: flex; justify-content: space-between; }
.lvs-seat { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); }
.lvs-seat i { position: relative; display: grid; place-items: center; width: 52px; height: 52px; padding: 2px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.lvs-seat img { width: 100%; height: 100%; border-radius: 50%; }
.lvs-seat.host i { box-shadow: 0 0 0 3px #f5b301; }
.lvs-seat.host i::before { content: "👑"; position: absolute; top: -14px; font-size: 15px; font-style: normal; }
.lvs-seat.talk i { animation: lvx-talk 1.4s ease-in-out infinite; box-shadow: 0 0 0 3px #22c55e; }
.lvs-seat.free i { background: none; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); color: color-mix(in srgb, var(--accent) 60%, var(--muted)); }
.lvs-seat.free .ic { width: 20px; height: 20px; }
.lvs-cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 10px 0; }
.lvs-cam { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 65%, #0b1430), #0b1430); }
.lvs-cam img { width: 58%; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.lvs-cam b { position: absolute; inset-block-end: 8px; inset-inline-start: 10px; color: #fff; font-size: 12px; }
.lvs-cam.talk { box-shadow: 0 0 0 3px #22c55e inset; }
.lvs-cam em { position: absolute; top: 8px; inset-inline-start: 8px; padding: 1px 8px; border-radius: 99px; background: #ef4444; color: #fff; font-style: normal; font-size: 10.5px; font-weight: 800; }
.lvs-fw { position: absolute; z-index: 2; top: 98px; left: 12px; width: 64%; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.lvs-fwh { display: flex; justify-content: space-between; padding: 5px 9px; background: #111; color: #fff; font-size: 11px; direction: ltr; }
.lvs-fw .lvx-scene { aspect-ratio: 16 / 9; }
/* numbers band */
.lvs-band { position: relative; z-index: 1; display: flex; justify-content: space-around; gap: 20px; margin: 30px 0 0; padding: 52px clamp(18px, 6vw, 90px); background: var(--bar-grad, var(--accent)); color: #fff; text-align: center; overflow: hidden; }
.lvs-band::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.4px); background-size: 22px 22px; pointer-events: none; }
/* the numbers band: glass cards on the theme gradient (icon, counting number, label) */
.lvs-bc { position: relative; z-index: 1; flex: 1 1 0; max-width: 260px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 20px;
  border-radius: 22px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 34px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lvs-bc-ic { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: rgba(255, 255, 255, .2); }
.lvs-bc-ic .ic { width: 22px; height: 22px; }
.lvs-bc.live .lvs-bc-ic::after { content: ""; position: absolute; inset-block-start: -3px; inset-inline-end: -3px; width: 11px; height: 11px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); animation: lvx-pulse2 2s ease-out infinite; }
@keyframes lvx-pulse2 { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 100% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } }
.lvs-bc b { display: block; font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; line-height: 1.05; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.lvs-bc-t { opacity: .9; font-size: 14.5px; font-weight: 600; }
/* the other features */
/* closing call */
.lvs-cta { position: relative; z-index: 1; margin: 40px clamp(18px, 6vw, 90px) 50px; padding: 56px 24px; border-radius: 32px; text-align: center; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 70px color-mix(in srgb, var(--accent) 16%, transparent); overflow: hidden; }
.lvs-cta::before { content: ""; position: absolute; width: 640px; height: 640px; inset-block-start: -320px; inset-inline-end: -200px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 18%, transparent), transparent); pointer-events: none; }
.lvs-cta h2 { position: relative; margin: 0 0 10px; font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -1px; }
.lvs-cta p { position: relative; margin: 0 0 26px; color: var(--muted); font-size: 18px; }
.lvs-go { position: relative; height: 60px; padding: 0 44px; border: 0; border-radius: 18px; background: var(--bar-grad, var(--accent)); color: #fff; font: inherit; font-size: 20px; font-weight: 800; cursor: pointer; box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 40%, transparent); }
/* phones: the phone sits on top (sticky, smaller) and the features scroll under it */
@media (max-width: 900px) {
  .lvs-kicker { position: static; margin-top: 12px; }
  .lvs-step { min-height: 46vh; text-align: start; }
  .lvs-step p { font-size: 16px; }
  .lvs-band { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 34px 16px; }
  .lvs-bc { max-width: none; padding: 16px 10px 14px; border-radius: 18px; }
  .lvs-bc-ic { width: 40px; height: 40px; border-radius: 13px; }
  .lvs-bc b { font-size: 30px; }
  .lvs-bc-t { font-size: 13px; }
  .lvs-bc:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .lvs-scr { transition: none; } }
/* story: step numbers, a progress rail, check bullets, screens that move */
.lvs-steps { position: relative; padding-inline-start: 30px; }
.lvs-rail { position: absolute; inset-block: 70px 60px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lvs-rail i { position: absolute; inset-inline: 0; top: 0; height: calc(100% * var(--lvs-i, 1) / var(--lvs-n, 1)); border-radius: 3px; background: var(--bar-grad, var(--accent)); transition: height .5s ease; }
.lvs-step { position: relative; }
.lvs-step::before { content: attr(data-n); display: block; margin-bottom: 4px; font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -2px; background: var(--bar-grad, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .35; pointer-events: none; }
.lvs-step h3, .lvs-step p, .lvs-step ul { position: relative; }
.lvs-step ul { flex-direction: column; gap: 10px; }
.lvs-step li { display: inline-flex; align-items: center; gap: 10px; padding: 0; background: none; color: var(--text); font-size: 16px; font-weight: 600; }
.lvs-step li .ic { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); }
.lvs-scr.on .lvs-msg, .lvs-scr.on .lvs-gift, .lvs-scr.on .lvs-b { animation: lvs-in .5s ease both; }
.lvs-scr.on :is(.lvs-log, .lvs-pmlog) > :nth-child(2) { animation-delay: .35s; } .lvs-scr.on :is(.lvs-log, .lvs-pmlog) > :nth-child(3) { animation-delay: .7s; }
.lvs-scr.on :is(.lvs-log, .lvs-pmlog) > :nth-child(4) { animation-delay: 1.05s; } .lvs-scr.on :is(.lvs-log, .lvs-pmlog) > :nth-child(5) { animation-delay: 1.4s; }
@keyframes lvs-in { from { opacity: 0; transform: translateY(12px); } }
/* gifts screen */
.lvs-banner { margin: 10px 10px 0; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, #f59e0b, #ec4899); color: #fff; font-size: 13px; font-weight: 800; text-align: center; box-shadow: 0 8px 20px rgba(236, 72, 153, .35); }
.lvs-scr.on .lvs-banner { animation: lvs-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes lvs-pop { from { opacity: 0; transform: scale(.7); } }
.lvs-bigfly { position: absolute; z-index: 2; top: 150px; left: 50%; font-size: 70px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .3)); opacity: 0; }
.lvs-scr.on .lvs-bigfly { animation: lvs-big 2.6s ease .3s both; }
@keyframes lvs-big { 0% { opacity: 0; transform: translate(-50%, 60px) scale(.3); } 35% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -10px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(.8); } }
.lvs-gift { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px; background: color-mix(in srgb, #ec4899 10%, var(--panel)); border: 1.5px solid color-mix(in srgb, #ec4899 40%, var(--line)); font-size: 13px; }
.lvs-gift span { font-size: 18px; } .lvs-gift b { color: #d6336c; }
/* identity screen */
.lvs-card { position: relative; margin: 10px; padding: 0 14px 14px; border-radius: 20px; background: var(--panel); box-shadow: 0 10px 26px rgba(20, 50, 100, .12); text-align: center; overflow: hidden; }
.lvs-cov { height: 86px; margin: 0 -14px; background: linear-gradient(135deg, #8b5cf6, #ec4899 55%, #f59e0b); }
.lvs-cav { position: relative; display: inline-block; width: 86px; height: 86px; margin-top: -44px; padding: 4px; border-radius: 50%; background: conic-gradient(#f59e0b, #ec4899, #8b5cf6, #22d3ee, #f59e0b); animation: lvs-spin 6s linear infinite; }
.lvs-cav img { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--panel); background: var(--panel); animation: lvs-spin 6s linear infinite reverse; }
.lvs-cav em { position: absolute; bottom: 0; inset-inline-end: -2px; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 13px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; line-height: 26px; box-shadow: 0 0 0 2px var(--panel); animation: lvs-spin 6s linear infinite reverse; }
@keyframes lvs-spin { to { transform: rotate(360deg); } }
.lvs-cnm { display: block; margin-top: 6px; font-size: 22px; font-weight: 800; background: linear-gradient(90deg, #ec4899, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lvs-cnm.sm { display: inline; margin: 0; font-size: 15px; }
.lvs-crk { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, #8b5cf6 12%, var(--panel)); color: #7048e8; font-size: 12px; font-weight: 800; }
.lvs-card p { margin: 8px 0 10px; color: var(--muted); font-size: 12.5px; font-style: italic; }
.lvs-cst { display: flex; justify-content: space-around; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.lvs-cst b { display: block; color: var(--text); font-size: 15px; }
.lvs-row { display: flex; align-items: center; gap: 10px; margin: 4px 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, #ec4899 16%, var(--panel)), color-mix(in srgb, #8b5cf6 16%, var(--panel))); box-shadow: 0 0 0 1.5px color-mix(in srgb, #ec4899 40%, transparent), 0 0 18px color-mix(in srgb, #ec4899 30%, transparent); }
/* stories screen */
.lvs-rings { display: flex; gap: 12px; padding: 12px 12px 6px; }
.lvs-sring { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.lvs-sring i { display: block; width: 54px; height: 54px; padding: 3px; border-radius: 50%; background: conic-gradient(#f59e0b, #ec4899, #8b5cf6, #f59e0b); }
.lvs-sring.seen i { background: var(--line); }
.lvs-sring img { width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid var(--bg); background: var(--panel); }
.lvs-reel { position: relative; flex: 1; margin: 6px 10px 14px; border-radius: 20px; overflow: hidden; }
.lvs-reelbg { position: absolute; inset: 0; background: linear-gradient(160deg, #0ea5e9, #8b5cf6 50%, #ec4899); background-size: 200% 200%; animation: lvs-bg 6s ease-in-out infinite alternate; }
@keyframes lvs-bg { to { background-position: 100% 100%; } }
.lvs-reelp { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.lvs-reelp::after { content: ""; position: absolute; top: 17px; left: 22px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #8b5cf6; }
.lvs-reelt { position: absolute; inset-block-end: 22px; inset-inline-start: 14px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.lvs-reelt b { display: block; font-size: 15px; } .lvs-reelt small { font-size: 12px; opacity: .9; }
.lvs-reelbar { position: absolute; inset-inline: 14px; top: 12px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); }
.lvs-reelbar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: #fff; animation: lvx-prog 6s linear infinite; }
/* private chat screen */
.lvs-pmh { flex: none; display: flex; align-items: center; gap: 10px; height: 86px; padding: 30px 14px 0; background: var(--bar-grad, var(--accent)); color: #fff; }
.lvs-pmh b { display: block; font-size: 14px; } .lvs-pmh small { font-size: 11px; opacity: .9; }
.lvs-pmlog { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
.lvs-b { max-width: 78%; padding: 8px 12px; border-radius: 16px; font-size: 13px; line-height: 1.45; }
.lvs-b.th { align-self: flex-start; background: var(--panel); border-end-start-radius: 4px; box-shadow: 0 2px 8px rgba(20, 50, 100, .06); }
.lvs-b.me { align-self: flex-end; background: var(--accent); color: #fff; border-end-end-radius: 4px; }
.lvs-b i { margin-inline-start: 6px; font-style: normal; font-size: 11px; color: #9be7ff; }
.lvs-voice { display: flex; align-items: center; gap: 8px; }
.lvs-vplay { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); position: relative; }
.lvs-vplay::after { content: ""; position: absolute; top: 8px; left: 11px; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent #fff; }
.lvs-wavef { display: flex; align-items: center; gap: 2px; height: 22px; }
.lvs-wavef i { width: 3px; margin: 0; border-radius: 2px; background: color-mix(in srgb, var(--accent) 60%, var(--line)); animation: lvx-wave 1s ease-in-out infinite; }
.lvs-wavef i:nth-child(3n) { height: 18px; } .lvs-wavef i:nth-child(3n+1) { height: 9px; animation-delay: -.3s; } .lvs-wavef i:nth-child(3n+2) { height: 14px; animation-delay: -.6s; }
.lvs-voice small { color: var(--muted); font-size: 11px; }
.lvs-pic { padding: 4px; }
.lvs-pimg { display: block; width: 150px; height: 96px; border-radius: 12px; background: linear-gradient(#7cc3ff, #d8eeff 55%, #5fbf6f 56%, #3b9a55); }
/* catalogue */
.lvs-more { position: relative; z-index: 1; padding: 64px clamp(18px, 6vw, 90px) 20px; text-align: center; }
.lvs-more h2 { margin: 0; font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -.8px; }
.lvs-more-sub { margin: 8px 0 30px; color: var(--muted); font-size: 17px; }
.lvs-tabs { display: none; }
.lvs-cat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1200px; margin: 0 auto; text-align: start; }
.lvs-grp { padding: 22px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 9%, transparent); }
.lvs-grp h3 { margin: 0 0 14px; font-size: 18px; font-weight: 800; color: var(--accent); }
.lvs-fi { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 15px; font-weight: 600; border-bottom: 1px dashed var(--line); }
.lvs-fi:last-child { border-bottom: 0; }
.lvs-fi span { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 11%, var(--panel)); color: var(--accent); }
.lvs-fi .ic { width: 17px; height: 17px; }
@media (max-width: 900px) {
  .lvs-steps { padding-inline-start: 0; } .lvs-rail { display: none; }
  .lvs-step::before { font-size: 46px; }
  .lvs-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 16px; padding: 0 18px 4px; scrollbar-width: none; }
  .lvs-tab { flex: none; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
  .lvs-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .lvs-cat { grid-template-columns: minmax(0, 1fr); }
  .lvs-grp { display: none; } .lvs-grp.on { display: block; }
  .lvs-grp h3 { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lvs-scr.on * { animation: none !important; } .lvs-bigfly { display: none; } }
/* story look: one phone. It sits beside the card, stays with the reader (sticky) through the features, stands up and shows
   each one; the floating cards step aside once the features start */
.lvx-flow { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); grid-template-rows: auto auto; }
.lvx-flow > .lvx-copy { grid-column: 1; grid-row: 1; }
.lvx-flow > .lvs-steps { grid-column: 1; grid-row: 2; margin-top: 30px; }
.lvx-flow > .lvx-show { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: max(10px, calc(50vh - 338px)); }
.lvx-flow .lvx-phone { transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.lvx-flow.lvs-live .lvx-phone { transform: none; }
.lvx-flow .lvx-ev { transition: opacity .4s, transform .4s; }
.lvx-flow.lvs-live .lvx-ev { opacity: 0; transform: scale(.9); pointer-events: none; animation: none; }
.lvx-scr .lvs-scr[data-s="intro"] { display: flex; flex-direction: column; }
.lvx-scr .lvs-scr[data-s="intro"] .lvx-plog { flex: 1; }
@media (max-width: 900px) {
  .lvx-flow { grid-template-columns: minmax(0, 1fr); }
  .lvx-flow > .lvx-copy { grid-row: 1; }
  .lvx-flow > .lvx-show { grid-column: 1; grid-row: 2; position: sticky; top: 0; z-index: 2; height: 388px; max-width: none; margin: 10px -16px 0; width: auto; background: transparent; overflow: visible; transition: background .4s, -webkit-backdrop-filter .4s, backdrop-filter .4s; }
  /* pinned over the features: a frosted glass that blends with the page (no flat band); it fades out at its lower edge */
  .lvx-flow.lvs-live > .lvx-show { background: color-mix(in srgb, var(--land-bg) 94%, transparent); -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
    -webkit-mask-image: linear-gradient(#000 95%, transparent); mask-image: linear-gradient(#000 95%, transparent); }
  .lvx-flow .lvx-phone { width: 310px; height: 645px; margin-left: -155px; transform: scale(.58) rotateY(-10deg) rotateX(4deg); transform-origin: top center; }
  .lvx-flow.lvs-live .lvx-phone { transform: scale(.58); }
  .lvx-flow .lvx-ev { transform: scale(.85); }
  .lvx-flow > .lvs-steps { grid-row: 3; margin-top: 0; }
}
/* the rank colour swatch («My look» › name colour): the member's rank colour with a small ring mark */
.swatch.none.rk { position: relative; border: 0; box-shadow: 0 0 0 2px var(--panel) inset; }
.swatch.none.rk::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 11px; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
/* the level under the flag at the end of a list row (the picture stays clean for its frame) */
.urow-end.has-lv { display: grid; grid-template-columns: auto auto; justify-items: center; align-items: center; row-gap: 2px; column-gap: 4px; }
.urow-end.has-lv > .lv-end { grid-column: 1 / -1; }
.lv-chip.lv-end { height: 15px; padding: 0 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .2px; }
/* staff: a member's picture / cover dialog */
.spic-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sp-prev { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--panel2); box-shadow: 0 0 0 1px var(--line); }
.sp-prev.wide { width: 100%; height: 110px; border-radius: 12px; }
.sp-prev[src=""] { visibility: hidden; height: 0; }
.sp-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spic-box .sn-box { align-self: stretch; }

/* «name : text» on wide screens: a short text beside the name, a text longer than the rest of the line goes under it with
   the whole width (like phones), so every line of it starts at the same edge */
.msgs-rows.mtp-inline .msg-main > .msg-bubble, .msgs-rows.mtp-inline .msg-main .msg-text { flex: 0 1 auto; }

/* staff to-do in the bell (taskNotice): Approve / Refuse, the inline reason, or who decided */
.tk-box { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tk-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-refuse { display: flex; flex-direction: column; gap: 6px; }
.tk-refuse textarea { width: 100%; font: inherit; font-size: .88rem; }
.tk-done { width: fit-content; padding: 3px 8px; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.tk-done.ok { background: color-mix(in srgb, #2fb67a 14%, transparent); color: #1f9d66; }
.tk-done.no { background: color-mix(in srgb, #f47c2c 14%, transparent); color: #d9661c; }
.tk-done.gone { background: var(--panel2); color: var(--muted); }

/* ==========================================================================
   Formatting phase (2026-11-29): profile header, number strip, titled chips, sticky tabs, own camera buttons,
   phone Settings list, «Edit profile» page. Nothing here animates; no new images.
   ========================================================================== */
.profile-cover { position: relative; }
.profile-avbox { position: relative; flex: none; line-height: 0; }
.pf-cam { position: absolute; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer; z-index: 3; }
.pf-cam .ic { width: 17px; height: 17px; }
.pf-cam:hover { filter: brightness(1.08); }
.pf-cam-av { inset-block-end: 2px; inset-inline-end: 2px; }
.pf-cam-cover { inset-block-start: 10px; inset-inline-start: 10px; border-color: rgba(255, 255, 255, .7); background: rgba(0, 0, 0, .45); }
.profile-modal .modal-x.floating { z-index: 4; }
.pf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-top: 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pf-meta > span + span::before { content: "·"; margin-inline: 7px; color: var(--faint); font-weight: 400; }
.pf-meta-rank { font-weight: 800; }
.pf-meta .flag { font-size: 15px; vertical-align: -1px; }
.profile-rank:empty { display: none; }
.profile-mood { display: flex; align-items: flex-start; gap: 6px; font-style: normal; }
.pf-mood-ic { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--faint); }
.pf-titles { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 22px 0; }
.pf-titles[hidden], .pf-stats[hidden] { display: none; }
.pf-title { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel2); color: var(--text); font: inherit; cursor: pointer; }
[dir="rtl"] .pf-title { padding: 3px 10px 3px 4px; }
.pf-title-k { flex: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.pf-title > :not(.pf-title-k) { min-width: 0; margin: 0 !important; }
.pf-title .cl-ttl-row { margin: 0; }
/* a title inside its chip (hall of fame «لقب»...): an ordinary inline pill the chip can hold (display: table overflowed on iPhone) */
.pf-titles .pf-title > .hof-title { display: block; flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0; font-size: 12px; line-height: 1.5; } /* beats .hof-title.in-profile (display: table; margin auto) of the add-on stylesheet, which loads later */
.pf-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 14px 22px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); overflow: hidden; }
.pf-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 9px 4px; border: 0; background: none; color: var(--text); font: inherit; }
.pf-stat + .pf-stat { border-inline-start: 1px solid var(--line); }
button.pf-stat { cursor: pointer; }
button.pf-stat:hover { background: var(--hover); }
.pf-stat b { font-size: 17px; line-height: 1.2; }
.pf-stat span { max-width: 100%; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
/* the tab strip stays in view while the profile scrolls; its edges fade instead of cutting a label */
.profile .pf-tabs { position: sticky; top: 0; z-index: 2; flex-wrap: nowrap; margin-inline: 0; padding-inline: 16px; background: var(--panel); }
.profile .vpf-glance { margin-top: 4px; }
.profile-tab-body { overflow-wrap: anywhere; }
.profile-tab-body img, .profile-tab-body video { max-width: 100%; }
.pf-sec-t { margin: 16px 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.pf-sub:empty { display: none; }
.pf-sub { margin-top: 12px; }
/* profile music: a small round button in the cover's corner */
/* the profile music button: the free corner of the cover, opposite the photo (start side) and below the close button (top end) */
.pm-music.pmu-cover { position: absolute; inset-block-end: 10px; inset-inline-end: 12px; inset-inline-start: auto; z-index: 2; margin: 0; padding: 6px 12px; border: 0; border-radius: 99px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pm-music.pmu-cover .ic { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .profile-head { padding-inline: 16px; gap: 12px; }
  .pf-titles { padding-inline: 16px; }
  .pf-stats { margin-inline: 16px; }
  .fact-chips, .profile-actions, .profile-actions.ua-bar { padding-inline: 16px; }
  .profile-tab-body { padding-inline: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .profile .pf-tabs { padding-inline: 10px; }
  .profile-id h2 { font-size: 20px; }
}
/* member card: one title only (the hall-of-fame title wins over a collection title) */
.ucard:has(.hof-title) .cl-ttl-row { display: none; }
.ucard-mood { display: flex; align-items: flex-start; gap: 6px; font-style: normal; }
.ucard-mood .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--faint); }

/* phones: Settings is a list of titled groups; each section opens as an inner page */
.set-home { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
.set-hgroup { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.set-htitle { padding: 10px 14px 6px; color: var(--muted); font-size: 12px; font-weight: 800; background: var(--panel2); border-bottom: 1px solid var(--line); }
.set-hitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: start; }
.set-hitem + .set-hitem { border-top: 1px solid var(--line); }
.set-hitem:active, .set-hitem:hover { background: var(--hover); }
.set-hic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.set-hic .ic { width: 18px; height: 18px; }
.set-hl { flex: 1; min-width: 0; }
.set-hgo { flex: none; width: 16px; height: 16px; color: var(--faint); }
.modal-card.set-phone { height: 92dvh; }
.set-phone .modal-body { display: block; padding: 12px 14px; }
.set-phone .mpage-body { padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
/* «Edit profile»: the parts of the page, each with its title */
.ep-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.ep-title .ic { width: 18px; height: 18px; color: var(--accent); }
.ep-page .mpage-body, .ep-modal .modal-body { padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
/* «My look» › What I wear */
.wr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.wr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); }
.wr-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.wr-k { color: var(--muted); font-size: 12px; font-weight: 700; }
.wr-v { min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.wr-src { color: var(--faint); font-size: 11.5px; }
.wr-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; max-width: 48%; }
.wr-sw { display: inline-flex; align-items: center; gap: 6px; }
.wr-sw i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
/* store: after a purchase (one small window) and the duration note */
.vst-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px 6px; text-align: center; }
.vst-done-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: color-mix(in srgb, #2fbf71 18%, transparent); color: #2fbf71; }
.vst-done-ic .ic { width: 28px; height: 28px; }
.vst-done b { font-size: 16px; overflow-wrap: anywhere; }
.vst-done-modal .modal-foot { justify-content: center; }
.vst-dnote { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.vst-dnote .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; }
/* member actions sheet: the member's current state, titled parts of the staff tabs */
.uas-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 2px; }
.uas-state small { color: var(--muted); font-weight: 700; }
.uas-flag { padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, #e53950 14%, transparent); color: #c62839; font-size: 12px; font-weight: 800; }
.uas-sec { margin: 12px 4px 4px; color: var(--muted); font-size: 12px; font-weight: 800; }
.uas-sec:first-child { margin-top: 2px; }
.uas-sec.danger { color: #d33; }
.status-opt .st-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: start; }
.status-opt .st-hint { color: var(--muted); font-size: 11.5px; font-weight: 500; line-height: 1.4; white-space: normal; }
.fx-one { margin: 2px 0 6px; }
/* phones: the Settings list and its inner pages scroll (the wide Settings window keeps overflow hidden on its body) */
.modal-card.set-phone > .modal-body, .modal-card.set-phone .mpage-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* the sticky tab strip lets the window's tint (collection paint) show through instead of a flat band */
.profile .pf-tabs { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
/* info rows: a value that starts with a number (age, level…) keeps the page's side, like the label above it */
html[dir="rtl"] .info-list dd { text-align: right; }
html[dir="ltr"] .info-list dd { text-align: left; }
/* pinned at the top, the tab strip leaves room for the window's floating close button */
.profile .pf-tabs { margin-inline-end: 52px; padding-inline-end: 6px; }

/* Admin › Appearance › «Members panel position»: the members panel on the other screen side than the language puts it
   (body.sp-flip). The page grid is mirrored by flipping the direction of .app; every part keeps the page direction for
   its own content, so texts, menus and messages are unchanged. On phones the panel slides in from that side. */
html[dir=ltr] body.sp-flip .app { direction: rtl; }
html[dir=rtl] body.sp-flip .app { direction: ltr; }
html[dir=ltr] body.sp-flip .app > * { direction: ltr; }
html[dir=rtl] body.sp-flip .app > * { direction: rtl; }
body.sp-flip .sidepanel { border-inline-end: 0; border-inline-start: 1px solid var(--line); }
@media (min-width: 1100px) {
  body.sp-flip.menu-rail .appbar { border-inline-end: 0; border-inline-start: 1px solid var(--line); }
}
@media (max-width: 1099px) {
  body.sp-flip .sidepanel, body.sp-flip.panel-hidden .sidepanel { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(105%); border-radius: 0 0 0 14px; }
  [dir=rtl] body.sp-flip .sidepanel, [dir=rtl] body.sp-flip.panel-hidden .sidepanel { transform: translateX(-105%); border-radius: 0 0 14px 0; }
}
/* private chat area (desktop) mirrors with the grid: the dock flips the same way, the window contents keep the page direction */
html[dir=ltr] body.sp-flip.pm-d .pm-dock { direction: rtl; }
html[dir=rtl] body.sp-flip.pm-d .pm-dock { direction: ltr; }
html[dir=ltr] body.sp-flip.pm-d .pm-dock .pm-win > * { direction: ltr; }
html[dir=rtl] body.sp-flip.pm-d .pm-dock .pm-win > * { direction: rtl; }
body.sp-flip.pm-d:not(.pm-far) .composer-wrap { margin-inline-start: 0; margin-inline-end: var(--pm-shift, 0px); }
body.sp-flip.pm-d.pm-far .composer-wrap { margin-inline-end: 0; margin-inline-start: var(--pm-shift, 0px); }
html[dir=rtl] body.sp-flip.pm-d:not(.pm-far) .topic-box { margin-right: 0; margin-left: var(--pm-shift, 0px); }
html:not([dir=rtl]) body.sp-flip.pm-d:not(.pm-far) .topic-box { margin-left: 0; margin-right: var(--pm-shift, 0px); }
html[dir=rtl] body.sp-flip.pm-d.pm-far .topic-box { margin-left: 0; margin-right: var(--pm-shift, 0px); }
html:not([dir=rtl]) body.sp-flip.pm-d.pm-far .topic-box { margin-right: 0; margin-left: var(--pm-shift, 0px); }
