/* ---------- Rənglər ---------- */
:root, :root[data-theme="dark"] {
  /* Surfaces climb in even steps: rail < side < main < card < overlay < raised. */
  --bg-rail: #070C0F;
  --bg-side: #0F1518;
  --bg-main: #181F22;
  --bg-card: #21282C;
  --bg-card-2: #1C2326;
  --bg-input: #0D1215;
  --bg-overlay: #252D31;
  --bg-overlay-hover: #343D42;
  --bg-raised: #2A3237;
  --bg-hover: #1E2528;
  --hover-tint: rgba(255, 255, 255, .035);
  --line: #252D30;
  --line-2: #2A3236;
  --border: #30383D;
  --border-2: #394348;
  --dash: #3A4650;
  --text: #E8EDF0;
  --text-2: #C9D2D9;
  --text-3: #B5C0C8;
  --muted: #9AA7B1;
  --label: #8E9BA6;
  --teal: #35C9B5;
  --on-teal: #06231F;
  --link: #5FD9C8;
  --link-hover: #8BE6DA;
  --teal-soft: #133430;
  --teal-line: #2A5C55;
  --teal-text: #DFF7F3;
  --amber: #F0B23E;
  --on-amber: #2B1C00;
  --amber-soft: #3A3220;
  --amber-deep: #221E14;
  --amber-text: #F5C76A;
  --coral: #FF8A73;
  --on-coral: #2A0904;
  --danger: #E5484D;
  --danger-text: #FF9C88;
  --online: #3DDC84;
  --away: #F0B23E;
  --busy: #FF8A73;
  --offline: #6B7780;
  --coral-text: #FF8A73;
  --mention-bg: rgba(240, 178, 62, .08);
  --mention-ring: rgba(240, 178, 62, .28);
  --text-msg: #DCE3E8;
  --placeholder: #85929C;
  --focus: #5FD9C8;
  --scrim: rgba(6, 9, 11, .72);
  /* Elevation: 1 = toolbars and chips, 2 = popovers and menus, 3 = dialogs and big cards. */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45), 0 4px 12px rgba(0, 0, 0, .25);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .5);
  --shadow: var(--shadow-3);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg-rail: #E0E7EB;
  --bg-side: #EFF3F6;
  --bg-main: #FFFFFF;
  --bg-card: #F3F7F9;
  --bg-card-2: #F6F9FB;
  --bg-input: #ECF1F4;
  --bg-overlay: #FFFFFF;
  --bg-overlay-hover: var(--bg-raised);
  --bg-raised: #E5ECEF;
  --bg-hover: #EAEFF2;
  --hover-tint: rgba(14, 26, 32, .035);
  --line: #DAE1E4;
  --line-2: #E2E8EB;
  --border: #CFD7DC;
  --border-2: #C1CBD0;
  --dash: #A8B4BC;
  --text: #0E1A20;
  --text-2: #24343D;
  --text-3: #34444E;
  --muted: #55656F;
  --label: #5B6B75;
  --teal: #35C9B5;
  --on-teal: #06231F;
  --link: #0B7A6D;
  --link-hover: #075A50;
  --teal-soft: #DDF4F0;
  --teal-line: #8FD9CE;
  --teal-text: #064A42;
  --amber: #F0B23E;
  --on-amber: #2B1C00;
  --amber-soft: #FBEED3;
  --amber-deep: #FFF7E6;
  --amber-text: #8A5800;
  --coral: #FF8A73;
  --on-coral: #2A0904;
  --danger: #D93A40;
  --danger-text: #B42318;
  --online: #1FA75A;
  --away: #C98A10;
  --busy: #E5484D;
  --offline: #8B98A3;
  --coral-text: #B93C22;
  --mention-bg: rgba(240, 178, 62, .14);
  --mention-ring: rgba(201, 138, 16, .35);
  --text-msg: var(--text-2);
  --placeholder: #5B6B75;
  --focus: #0B7A6D;
  --scrim: rgba(14, 26, 32, .45);
  --shadow-1: 0 1px 2px rgba(14, 26, 32, .08), 0 3px 10px rgba(14, 26, 32, .06);
  --shadow-2: 0 2px 6px rgba(14, 26, 32, .08), 0 12px 32px rgba(14, 26, 32, .12);
  --shadow-3: 0 4px 12px rgba(14, 26, 32, .08), 0 24px 60px rgba(14, 26, 32, .18);
  --shadow: var(--shadow-3);
  color-scheme: light;
}

/* ---------- Təməl ölçülər ---------- */
:root {
  /* Radius: one scale for the whole site. */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 20px; --r-4xl: 28px;
  --r-full: 999px;
  /* Motion: fast = hover/press, base = small panels, slow = bigger entrances. */
  --dur-fast: 120ms; --dur-base: 180ms; --dur-slow: 260ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent);
  /* Media overlays stay dark in both themes (they sit on video and images). */
  --media-scrim: rgba(11, 15, 18, .75);
  --on-media: #F2F5F7;
  --on-media-2: #B9C3CA;
  --on-danger: #fff;
}

:root {
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-rail); color: var(--text); font: 15px/1.45 var(--font); touch-action: manipulation; } /* no double-tap zoom on phones */
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
[hidden] { display: none !important; }
::placeholder { color: var(--placeholder); }
::selection { background: rgba(53, 201, 181, .3); }
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.ico { flex: none; display: block; }
.verified-fill { fill: var(--teal); }
.verified-check { stroke: var(--on-teal); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Ümumi elementlər ---------- */
.mono-label {
  font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--label);
}
.mono-label.teal { color: var(--link); }
.mono-label.amber { color: var(--amber); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-xl);
  font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
  background: var(--bg-raised); color: var(--text);
  transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn.teal { background: var(--teal); color: var(--on-teal); }
.btn.amber { background: var(--amber); color: var(--on-amber); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.outline { background: transparent; border: 1px solid var(--border-2); color: var(--text); font-weight: 600; }
.btn.outline:hover { background: var(--bg-hover); filter: none; }
.btn.ghost { background: transparent; color: var(--text-2); font-weight: 600; }
.btn.ghost:hover { background: var(--bg-hover); filter: none; }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-lg); }
.btn.big { height: 50px; font-size: 15px; border-radius: var(--r-2xl); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; filter: none; }

.square-btn {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-2);
  display: grid; place-items: center;
}
.square-btn:hover { background: var(--bg-raised); color: var(--text); }
.square-btn[aria-pressed="true"] { background: var(--bg-raised); color: var(--text); }
.square-btn.filled { background: var(--bg-raised); width: 40px; height: 40px; border-radius: var(--r-lg); }
.square-btn.off { background: var(--coral); color: var(--on-coral); }
.square-btn.danger { background: var(--danger); color: #fff; }
.square-btn[disabled] { opacity: .35; cursor: default; background: transparent; }

.chip {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: var(--r-full);
  border: 1px solid var(--border-2); background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--dash); }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 700; }
.chip.soft { height: auto; padding: 7px 12px; border: 0; background: var(--bg-raised); color: var(--text-2); font-weight: 500; }
.tag { padding: 4px 9px; border-radius: var(--r-sm); background: var(--bg-raised); color: var(--text-2); font-size: 12px; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-lg);
  background: var(--coral); color: var(--on-coral);
  font: 700 11px/20px var(--font); text-align: center;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); display: inline-block; flex: none; }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(240, 178, 62, .18); }
.live-badge {
  padding: 3px 8px; border-radius: var(--r-sm); background: var(--amber); color: var(--on-amber);
  font: 700 10px var(--mono); letter-spacing: .08em;
}
.role-badge {
  padding: 1px 6px; border-radius: var(--r-xs); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: var(--bg-raised); color: var(--text-2); vertical-align: 1px;
}
.role-badge.owner { background: var(--amber-soft); color: var(--amber-text); }
/* Role colours are picked for the dark theme and darkened for the light one. */
.role-badge.custom { color: var(--role, var(--text-2)); background: color-mix(in srgb, var(--role, var(--text-2)) 16%, transparent); }
:root[data-theme="light"] .role-badge.custom {
  color: color-mix(in srgb, var(--role, var(--text-2)) 55%, #000); background: color-mix(in srgb, var(--role, var(--text-2)) 24%, transparent);
}
.role-name { color: var(--role); }
:root[data-theme="light"] .role-name { color: color-mix(in srgb, var(--role) 55%, #000); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--role, var(--label)); }
.role-dot.big { width: 16px; height: 16px; }

input.field, select.field, textarea.field, .card input:not([type="checkbox"]):not([type="file"]), .card textarea, .card select {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-xl);
  border: 1px solid var(--border-2); background: var(--bg-input); color: var(--text);
  font-size: 15px; outline: none;
}
textarea.field, .card textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input.field:focus, select.field:focus, textarea.field:focus, .card input:focus, .card textarea:focus, .card select:focus { border-color: var(--teal); }
input.field:disabled { opacity: .55; }
.field-label, .card label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { font-size: 12px; color: var(--label); }
.error { color: var(--danger-text); margin: 0; font-size: 14px; }

.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%; position: relative;
  display: grid; place-items: center; color: #fff;
  font: 700 12px var(--font); background-size: cover; background-position: center;
}
.avatar.xs { width: 22px; height: 22px; font-size: 8px; }
.avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.avatar.md { width: 32px; height: 32px; font-size: 11px; }
.avatar.lg { width: 40px; height: 40px; font-size: 13px; }
.avatar[data-status]::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--status-ring, var(--bg-side));
}
.avatar.xs[data-status]::after, .avatar.sm[data-status]::after { width: 9px; height: 9px; border-width: 2px; }
.avatar[data-status="online"]::after { background: var(--online); }
.avatar[data-status="busy"]::after { background: var(--busy); }
.avatar[data-status="away"]::after { background: var(--away); }
.avatar[data-status="offline"]::after { background: var(--offline); }
.avatar.speaking { box-shadow: 0 0 0 2px var(--online); }
.stack { display: flex; }
.stack .avatar { margin-right: -8px; border: 2px solid var(--stack-ring, var(--bg-card)); box-sizing: content-box; }

.server-icon {
  width: 48px; height: 48px; flex: none; border-radius: var(--r-2xl);
  display: grid; place-items: center; color: #F2F5F7;
  font: 700 15px var(--display); background-size: cover; background-position: center;
}

/* ---------- Giriş ---------- */
.login {
  position: fixed; inset: 0; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  background: var(--bg-main);
}
.logo {
  width: 52px; height: 52px; flex: none; border-radius: var(--r-2xl); display: grid; place-items: center;
  background: var(--teal); color: var(--on-teal); font: 800 26px var(--display);
}

/* Sol səhnə */
.login-stage {
  position: relative; overflow: hidden; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 40px; padding: 40px clamp(32px, 5vw, 72px);
  background:
    radial-gradient(60% 50% at 18% 12%, color-mix(in srgb, var(--teal) 20%, transparent), transparent 70%),
    radial-gradient(50% 45% at 88% 92%, color-mix(in srgb, var(--amber) 16%, transparent), transparent 70%),
    var(--bg-rail);
  border-right: 1px solid var(--line);
}
.login-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.login-stage > * { position: relative; }
.stage-brand { display: flex; align-items: center; gap: 12px; font: 800 20px var(--display); letter-spacing: -.01em; }
.stage-brand .logo { width: 40px; height: 40px; border-radius: var(--r-xl); font-size: 20px; }
.stage-copy { max-width: 520px; }
.login-claim { margin: 14px 0 14px; font: 800 clamp(36px, 3.6vw, 52px)/1.04 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.login-sub { margin: 0; max-width: 440px; font-size: 16px; line-height: 1.55; color: var(--muted); }

.stage-scene { position: relative; flex: 1; min-height: 300px; max-width: 560px; }
.scene-card {
  position: absolute; display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-2xl);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow); --stack-ring: var(--bg-card);
  animation: scene-float 7s ease-in-out infinite;
}
.scene-card p { margin: 0; }
.scene-room { top: 0; left: 0; width: min(340px, 78%); flex-direction: column; gap: 10px; }
.scene-msg { top: 42%; right: 0; width: min(330px, 76%); align-items: flex-start; animation-delay: -2.4s; }
.scene-event { bottom: 0; left: 8%; align-items: center; animation-delay: -4.6s; }
.scene-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scene-title { font: 700 16px var(--display); }
.scene-dim { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.scene-name { font-weight: 700; font-size: 14px; }
.scene-name span { margin-left: 6px; color: var(--label); font-size: 12px; font-weight: 500; }
.scene-text { margin-top: 2px !important; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.scene-date {
  width: 46px; height: 50px; flex: none; border-radius: var(--r-xl); display: grid; place-content: center; text-align: center;
  background: var(--amber-soft); color: var(--amber-text); font: 700 10px var(--mono); letter-spacing: .08em;
}
.scene-date b { font: 800 20px/1 var(--display); letter-spacing: 0; }
.avatar.c1 { background: #0092bc; }
.avatar.c2 { background: #8b5cf6; }
.avatar.c3 { background: #ec4899; }
.avatar.c4 { background: var(--bg-raised); color: var(--text-2); }
.scene-wave { display: flex; align-items: center; gap: 3px; height: 22px; color: var(--online); }
.scene-wave i { width: 3px; height: 100%; border-radius: var(--r-xs); background: currentColor; transform-origin: center; animation: scene-wave 1.1s ease-in-out infinite; }
.scene-wave i:nth-child(2) { animation-delay: -.2s; }
.scene-wave i:nth-child(3) { animation-delay: -.5s; }
.scene-wave i:nth-child(4) { animation-delay: -.7s; }
.scene-wave i:nth-child(5) { animation-delay: -.35s; }
@keyframes scene-float { 50% { transform: translateY(-8px); } }
@keyframes scene-wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.stage-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: 14px; }
.stage-points li { display: flex; align-items: center; gap: 8px; }
.stage-points .ico { color: var(--link); }

/* Sağ panel və forma */
.login-panel { position: relative; display: grid; place-items: center; padding: 40px 24px; }
.login-theme { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: var(--r-xl); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
.brand { display: none; align-items: center; gap: 12px; }
.brand .logo { width: 40px; height: 40px; border-radius: var(--r-xl); font-size: 20px; }
.brand-name { font: 800 20px var(--display); letter-spacing: -.01em; }
.login-head h1 { margin: 0 0 6px; font: 800 30px/1.15 var(--display); letter-spacing: -.02em; }
.login-head p { margin: 0; font-size: 15px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-2xl); background: var(--bg-input); }
.seg-btn { height: 42px; border: 0; border-radius: var(--r-lg); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 700; }
.seg-btn.active { background: var(--teal); color: var(--on-teal); }
.seg-btn.amber.active { background: var(--amber); color: var(--on-amber); }
/* The login switch slides one thumb instead of repainting both buttons. */
.login-seg { position: relative; border: 1px solid var(--border); }
.login-seg .seg-btn { position: relative; z-index: 1; transition: color .2s; }
.login-seg .seg-btn.active { background: transparent; }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: var(--r-lg);
  background: var(--teal); transition: transform .25s cubic-bezier(.3, .7, .2, 1);
}
#login-form.registering .seg-thumb { transform: translateX(calc(100% + 4px)); }
.login-seg .seg-btn:not(.active):hover { color: var(--text); }

.lf { display: flex; flex-direction: column; gap: 7px; }
.lf label, .lf-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.lf-opt { margin-left: 4px; color: var(--label); font-weight: 500; }
.lf-box {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 14px; border-radius: var(--r-xl);
  border: 1px solid var(--border-2); background: var(--bg-input); color: var(--label);
  transition: border-color .15s, box-shadow .15s;
}
.lf-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); color: var(--link); }
.lf-box input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text); font-size: 16px; outline: none; }
.lf-box input:focus-visible { outline: none; }
.lf.invalid .lf-box { border-color: var(--danger); }
.lf.invalid .lf-box:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.lf-eye { width: 38px; height: 38px; flex: none; border: 0; border-radius: var(--r-md); background: none; color: var(--muted); display: grid; place-items: center; }
.lf-eye:hover { background: var(--bg-raised); color: var(--text); }
.lf-hint, .lf-err, .lf-warn { margin: 0; font-size: 12.5px; line-height: 1.4; }
.lf-hint { color: var(--label); }
.lf-err { color: var(--danger-text); font-weight: 600; }
.lf-warn { color: var(--amber-text); font-weight: 600; }

.register-only { display: none; }
#login-form.registering .register-only { display: flex; }
#login-form.registering p.register-only { display: block; }
#login-form .lf.invalid .lf-hint { display: none; }
.color-pick { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-xl); background: var(--bg-input); border: 1px solid var(--border-2); }
.color-pick .avatar { transition: background-color .2s; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 34px; height: 34px; border-radius: var(--r-lg); border: 3px solid transparent; }
.colors button[aria-pressed="true"] { border-color: var(--text); }
.color-pick .colors { gap: 6px; }
.color-pick .colors button { width: 28px; height: 28px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); transition: transform .12s; }
.color-pick .colors button:hover { transform: scale(1.1); }
.color-pick .colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg-input), 0 0 0 4px var(--text); }

.login-error {
  margin: 0; padding: 11px 14px; border-radius: var(--r-xl); font-size: 14px; line-height: 1.45;
  background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger-text);
}
.login-submit { width: 100%; }
.login-submit .spin {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--on-teal) 30%, transparent); border-top-color: var(--on-teal);
  animation: spin .7s linear infinite;
}
.login-submit[aria-busy="true"] .spin { display: block; }
.login-submit[aria-busy="true"] { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-switch { margin: -4px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.login-switch .link-btn { padding: 4px 2px; font-size: 14px; font-weight: 700; }
.login-switch .link-btn:hover { color: var(--link-hover); }

@media (max-width: 1000px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-stage { display: none; }
  .brand { display: flex; }
  .login-panel { min-height: 100dvh; padding: 72px 16px 32px; place-items: start center; }
  .login-panel::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 320px; pointer-events: none;
    background: radial-gradient(70% 100% at 50% 0%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 70%);
  }
  .login-card { position: relative; }
  .login-theme { top: 14px; right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-card, .scene-wave i { animation: none; }
  .seg-thumb, .login-seg .seg-btn, .lf-box, .color-pick .colors button { transition: none; }
}

/* ---------- Əsas düzən ---------- */
.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 76px 256px minmax(0, 1fr) 248px;
  grid-template-areas: "rail side main right";
  background: var(--bg-main);
}
.app.right-wide { grid-template-columns: 76px 256px minmax(0, 1fr) 320px; }
.app.no-right { grid-template-columns: 76px 256px minmax(0, 1fr); }
.app.no-right .right { display: none; }
.rail { grid-area: rail; }
.side { grid-area: side; }
.chat, .friends, .discover, .settings, .inbox, .room { grid-area: main; }
.right { grid-area: right; }
.tabbar { display: none; }

/* Rail */
.rail {
  background: var(--bg-rail); padding: 14px 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.server-list { display: flex; flex-direction: column; gap: 10px; }
.rail-sep { width: 28px; height: 2px; flex: none; border-radius: var(--r-xs); background: var(--border); }
.rail-btn, .server-btn {
  position: relative; width: 48px; height: 48px; flex: none; border: 0; border-radius: var(--r-2xl);
  display: grid; place-items: center; background: var(--bg-card); color: var(--text-2);
}
.rail-btn:hover { color: var(--text); }
.rail-btn#discover { color: var(--link); }
.rail-btn.active { background: var(--teal); color: var(--on-teal); }
.rail-btn.create { background: transparent; border: 1.5px dashed var(--dash); color: var(--amber); }
.rail-btn.create:hover { border-color: var(--amber); }
.server-btn { color: #F2F5F7; font: 700 15px var(--display); background-size: cover; background-position: center; }
.server-btn.active { box-shadow: 0 0 0 2px var(--bg-rail), 0 0 0 4px var(--teal); }
.server-btn.unread:not(.active)::before {
  content: ""; position: absolute; left: -14px; top: 19px; width: 4px; height: 10px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0; background: var(--text);
}
.rail-btn .badge, .server-btn .badge {
  position: absolute; right: -5px; bottom: -5px; border: 3px solid var(--bg-rail);
  height: 20px; line-height: 14px; font-size: 10px; min-width: 20px; padding: 0 5px;
}
.server-btn .lock { position: absolute; left: -4px; top: -4px; width: 18px; height: 18px; border-radius: var(--r-sm); background: var(--bg-rail); color: var(--amber); display: grid; place-items: center; }

/* Side panel */
.side { background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.side-head { flex: none; }
.side-banner {
  position: relative; height: 92px; padding: 12px 14px; display: flex; align-items: flex-end;
}
.side-banner button {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--r-lg); background: rgba(11, 15, 18, .72); color: #F2F5F7; text-align: left;
}
.side-banner button b { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-title { padding: 24px 22px 6px; }
.side-title h2 { margin: 0; font: 800 24px/1.1 var(--display); letter-spacing: -.01em; }
.side-title p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.side-search { position: relative; padding: 14px 10px 0; }
.side-search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border: 0; border-radius: var(--r-lg);
  background: var(--bg-rail); color: var(--text); font-size: 13px; outline: none;
}
.side-search .ico { position: absolute; left: 22px; top: 26px; color: var(--label); }
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 16px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; width: 100%;
  border: 0; border-radius: var(--r-xl); background: transparent; color: var(--text-2);
  font-size: 14px; font-weight: 500; text-align: left;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--bg-raised); color: var(--text); font-weight: 600; }
.nav-link .ico { color: var(--muted); }
.nav-link[aria-current="page"] .ico { color: var(--link); }
.nav-link .count { padding: 2px 8px; border-radius: var(--r-lg); background: var(--amber); color: var(--on-amber); font: 700 11px var(--mono); }
.side-section { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.side-section .mono-label { padding: 0 8px 4px; }
.group { display: flex; flex-direction: column; gap: 1px; }
.group-title {
  display: flex; align-items: center; gap: 4px; padding: 0 6px 6px; border: 0; background: none;
  font: 700 11px var(--mono); letter-spacing: .1em; color: var(--label); text-align: left;
}
.group-title:hover { color: var(--text-2); }
.group-title .ico { transition: transform .15s; }
.group-title.collapsed .ico { transform: rotate(-90deg); }
.group-title .add { margin-left: auto; width: 22px; height: 22px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); }
.group-title .add:hover { background: var(--bg-raised); color: var(--text); }
.ch {
  position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; width: 100%;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-3);
  font-size: 14px; font-weight: 500; text-align: left;
}
.ch .ico { color: var(--label); }
.ch:hover { background: var(--bg-hover); color: var(--text); }
.ch[aria-current="page"] { background: var(--bg-raised); color: var(--text); font-weight: 600; }
.ch[aria-current="page"] .ico { color: var(--text-2); }
.ch.unread { color: var(--text); font-weight: 700; }
.ch.unread::before { content: ""; position: absolute; left: -10px; width: 4px; height: 8px; border-radius: 0 var(--r-xs) var(--r-xs) 0; background: var(--text); }
.ch .del { display: none; width: 22px; height: 22px; border-radius: var(--r-sm); place-items: center; color: var(--muted); }
.ch:hover .del { display: grid; }
.ch .del:hover { color: var(--danger-text); background: var(--bg-raised); }
.voice-people { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px 36px; }
.voice-people div { display: flex; align-items: center; gap: 8px; height: 28px; font-size: 13px; color: var(--text-2); }
.voice-people .mic-off { margin-left: auto; color: var(--coral); }
.event-card, .info-card {
  display: flex; gap: 10px; padding: 12px; border-radius: var(--r-xl); background: var(--bg-card);
  border: 1px solid var(--amber-soft); color: var(--text); font-size: 13px; line-height: 1.45;
}
.info-card { border-color: var(--border); color: var(--muted); }
.dm-row {
  display: flex; align-items: center; gap: 10px; padding: 8px; width: 100%; border: 0; border-radius: var(--r-xl);
  background: transparent; color: var(--text); text-align: left;
}
.dm-row:hover { background: var(--bg-hover); }
.dm-row[aria-current="page"] { background: var(--bg-raised); }
.dm-row .who { flex: 1; min-width: 0; }
.dm-row .who b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row.unread .who b { font-weight: 700; }
.dm-row .who small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--link); flex: none; }
.side-empty { padding: 4px 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }

.voice-panel {
  display: flex; align-items: center; gap: 8px; margin: 0 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-2xl);
  background: var(--teal-soft); border: 1px solid var(--teal-line);
}
.voice-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-info b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--online); }
.voice-info span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); }
.me {
  flex: none; display: flex; align-items: center; gap: 2px; margin: 10px; padding: 8px; border-radius: var(--r-2xl);
  background: var(--bg-input); --status-ring: var(--bg-input);
}
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; text-align: left; border-radius: var(--r-lg); }
.me-text { min-width: 0; display: flex; flex-direction: column; }
.me-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .square-btn { width: 32px; height: 32px; border-radius: var(--r-md); }

/* ---------- Söhbət ---------- */
.chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-main); }
.chat-head {
  flex: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.chat-head.wrap { flex-wrap: wrap; padding: 10px 20px; gap: 8px; }
.chat-icon { color: var(--label); display: flex; }
.channel-name { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; }
.channel-name.with-icon { display: flex; align-items: center; gap: 10px; margin-right: 12px; }
.channel-name.with-icon .ico { color: var(--muted); }
/* Name on top, topic underneath: the topic stays visible on phones too. */
.chat-title { display: flex; flex-direction: column; justify-content: center; min-width: 72px; max-width: min(560px, 100%); }
.chat-title .channel-name { font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.topic {
  min-width: 0; max-width: 100%; margin: 1px 0 0; padding: 0; border: 0; border-radius: var(--r-xs); background: none;
  font-size: 12.5px; line-height: 1.3; color: var(--muted); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur-fast);
}
.topic { cursor: default; }
.topic.clickable { cursor: pointer; }
.topic.clickable:hover { color: var(--text-2); }
.topic.placeholder { font-style: italic; }
.topic-pop { padding: 14px 16px; }
.topic-pop p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.menu { display: none !important; }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 8px; }
.messages-inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.empty-state { margin: auto; padding: 48px 20px; text-align: center; max-width: 420px; }
.empty-state .big-ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: var(--r-3xl); display: grid; place-items: center; background: var(--teal-soft); color: var(--link); }
.empty-state h3 { margin: 0 0 6px; font: 800 22px var(--display); }
.empty-state p { margin: 0; color: var(--muted); }
.older-hint { text-align: center; font-size: 12px; color: var(--label); padding: 6px; }
/* Day marker: a small mono tag on the left with a line running out to the right. */
.day {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 8px;
  font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--label);
}
.day::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent 85%); }
/* Unread marker: label first, then a coral line fading out. Text, not colour alone, says what it is. */
.new-divider {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 6px;
  font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--coral-text);
}
.new-divider span {
  order: -1; padding: 4px 9px; border-radius: var(--r-full);
  background: color-mix(in srgb, var(--coral) 14%, transparent); border: 1px solid color-mix(in srgb, var(--coral) 45%, transparent);
}
.new-divider::before { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--coral), transparent); }

.msg {
  position: relative; display: flex; gap: 14px; padding: 6px 10px; margin: 0 -10px; border-radius: var(--r-lg);
  transition: background-color var(--dur-fast);
}
.msg.pinned { background: color-mix(in srgb, var(--amber) 6%, transparent); }
.msg.open { background: var(--hover-tint); }
/* Hover reveals only on devices that really hover: touch browsers keep :hover stuck after a tap. */
@media (hover: hover) { .msg:not(.sys-row):hover { background: var(--hover-tint); } }
.msg.cont { padding-top: 1px; padding-bottom: 1px; }
.msg.cont > .avatar { visibility: hidden; height: 0; }
/* Mentions get a soft amber field with a full outline, not a side bar. */
.msg.mentioned, .msg.mentioned:hover { background: var(--mention-bg); box-shadow: inset 0 0 0 1px var(--mention-ring); }
.msg.new { animation: rise var(--dur-base) var(--ease-out); }
.msg.flash { animation: flash 1.4s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes flash { 0%, 40% { background: var(--teal-soft); } }
.msg > .avatar { width: 40px; height: 40px; font-size: 13px; cursor: pointer; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
/* --u is the member colour; mixing it with the text colour keeps every name readable in both themes. */
.msg-user {
  padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; cursor: pointer;
  color: color-mix(in srgb, var(--u, var(--text)) 50%, var(--text));
}
.msg-user:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--label); font-variant-numeric: tabular-nums; }
.gutter-time {
  position: absolute; left: 10px; top: 5px; width: 40px; text-align: center;
  font-size: 11px; color: var(--label); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity var(--dur-fast);
}
.msg.cont:focus-within .gutter-time, .msg.cont.open .gutter-time { opacity: 1; }
@media (hover: hover) { .msg.cont:hover .gutter-time { opacity: 1; } }
.reply-line {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px; max-width: 100%; padding: 0; border: 0; background: none;
  font-size: 12px; color: var(--muted); text-align: left; white-space: nowrap; overflow: hidden;
}
.reply-line b { font-weight: 600; color: color-mix(in srgb, var(--u, var(--text)) 50%, var(--text)); }
.reply-line span { overflow: hidden; text-overflow: ellipsis; }
.reply-line:hover { color: var(--text); }
.msg-text { margin-top: 3px; font-size: 15px; line-height: 1.5; color: var(--text-msg); white-space: pre-wrap; word-wrap: break-word; }
.msg-text code { padding: 1px 6px; border-radius: var(--r-sm); background: var(--bg-input); border: 1px solid var(--line); font: 500 13px var(--mono); }
.msg-text pre {
  margin: 6px 0; max-width: 620px; padding: 14px 16px; border-radius: var(--r-xl); overflow: auto; white-space: pre;
  background: var(--bg-input); border: 1px solid var(--line); font: 500 13px/1.6 var(--mono); color: var(--text-2);
}
.msg-text pre code { padding: 0; border: 0; background: none; }
.mention { padding: 0 3px; border-radius: var(--r-xs); background: var(--teal-soft); color: var(--link); font-weight: 600; }
.edited { margin-left: 4px; font-size: 11px; color: var(--label); }
.blocked-note { font-style: italic; color: var(--muted); }
.msg-image { display: block; margin-top: 8px; max-width: min(420px, 100%); max-height: 320px; border-radius: var(--r-xl); cursor: zoom-in; }
.edit-box { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--teal); border-radius: var(--r-lg); background: var(--bg-input); color: var(--text); resize: none; outline: none; }
.edit-hint { font-size: 11px; color: var(--label); margin-top: 2px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reactions:empty { display: none; }
/* Reaction pills: quiet until they are yours. */
.reaction {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-full);
  border: 1px solid transparent; background: var(--bg-card); color: var(--text-2); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}
.reaction:hover { border-color: var(--border-2); }
.reaction:active { transform: scale(.94); }
.reaction.mine { border-color: var(--teal-line); background: var(--teal-soft); color: var(--teal-text); }
.reaction.add { width: 28px; padding: 0; justify-content: center; color: var(--muted); background: transparent; border-color: var(--line-2); }
/* Message tools: a rounded pill on the overlay surface. It fades in rather than popping, and
   visibility keeps the hidden buttons out of the tab order. */
.msg-actions {
  position: absolute; right: 12px; top: -16px; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--r-full); background: var(--bg-overlay); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  visibility: hidden; opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}
.msg:focus-within .msg-actions, .msg.open .msg-actions { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
@media (hover: hover) { .msg:hover .msg-actions { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; } }
.msg-actions button {
  width: 30px; height: 30px; border: 0; border-radius: var(--r-full); background: none; color: var(--text-2);
  display: grid; place-items: center; transition: background-color var(--dur-fast), color var(--dur-fast);
}
.msg-actions button:hover { background: var(--bg-overlay-hover); color: var(--text); }
/* Destructive tools sit after a thin divider so they are never one slip away from "edit". */
.msg-actions button.danger { position: relative; margin-left: 5px; }
.msg-actions button.danger::before { content: ""; position: absolute; left: -4px; top: 7px; bottom: 7px; width: 1px; background: var(--border-2); }
.msg-actions button.danger:hover { background: var(--danger); color: var(--on-danger); }
/* Fingers need bigger targets than a mouse pointer. cursor:pointer also makes iOS deliver the tap
   that opens a message's tools (it ignores taps on plain text otherwise). */
@media (hover: none) {
  .msg-actions button { width: 38px; height: 38px; }
  .msg-actions { top: -22px; }
  .msg:not(.sys-row), .tmsg { cursor: pointer; -webkit-tap-highlight-color: transparent; }
}

/* System lines (joins, group changes): one quiet line aligned with the message text, not a card. */
.sys-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px;
  min-height: 34px; padding: 4px 10px; margin: 2px -10px; border-radius: var(--r-lg); font-size: 13.5px; color: var(--muted);
}
.sys-row > .ico { justify-self: center; color: var(--link); }
.sys-row strong { color: var(--text-2); font-weight: 600; }
.greet-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.greet-btn:hover { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal-text); }
.greet-btn .ico { color: var(--amber); }
/* Several joins in a row fold into one line; the toggle opens the full list with a greet button each. */
.join-group { display: block; padding: 0; }
.join-group > .sys-row { margin: 0 -10px; }
.join-toggle {
  height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: var(--bg-card);
  color: var(--text-2); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  transition: background-color var(--dur-fast);
}
.join-toggle:hover { background: var(--bg-raised); color: var(--text); }
.join-toggle .ico { transition: transform var(--dur-base) var(--ease-out); }
.join-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.join-list { margin: 0 0 4px 54px; border-left: 1px solid var(--line-2); }
.join-list > .sys-row { margin: 0; min-height: 32px; padding-left: 12px; }
.join-list > .sys-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.join-list > .sys-row > .ico { display: none; }
/* On narrow screens the button drops under the text instead of squeezing it. */
@media (max-width: 560px) {
  .sys-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .sys-row > .greet-btn, .sys-row > .join-toggle { grid-column: 2 / -1; justify-self: start; }
  .join-list > .sys-row { grid-template-columns: minmax(0, 1fr) auto; }
  .join-list > .sys-row > .greet-btn { grid-column: 1 / -1; }
}
.invite-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; max-width: 460px; margin-top: 8px; padding: 14px;
  border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border);
}
.invite-card .info { flex: 1; min-width: 160px; }
.invite-card .info small { display: block; font: 700 10px var(--mono); letter-spacing: .1em; color: var(--label); }
.invite-card .info b { display: block; margin-top: 2px; font-size: 15px; }
.invite-card .info span { font-size: 12px; color: var(--muted); }

.jump {
  position: absolute; left: 50%; bottom: 120px; z-index: 4; transform: translateX(-50%);
  height: 36px; padding: 0 16px; border-radius: var(--r-3xl); border: 1px solid var(--border-2);
  background: var(--bg-overlay); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-2);
}
.jump.fresh { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }

/* Messages on their way: dimmed with a small note. A failed one is at full strength, says why in
   words (not colour alone) and offers retry and delete. */
.pending { opacity: .6; transition: opacity var(--dur-base) var(--ease-out); }
.pending .msg-user { cursor: default; }
.pending .msg-user:hover { text-decoration: none; }
.pending-note { font-size: 12px; color: var(--label); }
.pending.failed { opacity: 1; background: color-mix(in srgb, var(--danger) 6%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent); }
.pending.failed .pending-note { color: var(--danger-text); font-weight: 600; }
.rc-msg.pending.failed, .tmsg.pending.failed { padding: 6px; border-radius: var(--r-lg); }
.pending-attach { margin-top: 6px; font-size: 13px; color: var(--muted); }
.pending-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Connection lost: a slim tab drops from the top edge until the site answers again. */
.net-bar {
  position: fixed; top: 0; left: 50%; z-index: 70; display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); padding: 5px 14px 6px; border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--amber-soft); color: var(--amber-text);
  box-shadow: var(--shadow-1); font-size: 12px; font-weight: 700; pointer-events: none;
  transform: translate(-50%, -110%); transition: transform var(--dur-base) var(--ease-out);
}
.net-bar:empty { visibility: hidden; }
.net-bar.on { transform: translate(-50%, 0); }
.net-bar.on::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: var(--r-full); background: var(--amber); animation: net-pulse 1.2s ease-in-out infinite; }
@keyframes net-pulse { 50% { opacity: .3; } }

.composer-area { flex: none; padding: 0 20px 18px; }
.typing { display: flex; align-items: center; gap: 6px; height: 22px; font-size: 12px; color: var(--muted); }
.typing b { color: var(--text-2); font-weight: 700; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: dots-wave 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dots-wave { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.composer-wrap {
  position: relative; border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border);
  transition: border-color var(--dur-fast), box-shadow var(--dur-base) var(--ease-out);
}
/* The composer is focused most of the time, so its frame only warms up instead of shouting. */
.composer-wrap:focus-within { border-color: color-mix(in srgb, var(--focus) 55%, var(--border)); box-shadow: var(--focus-ring); }
.composer-wrap.disabled { opacity: .5; pointer-events: none; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px; }
.composer textarea {
  flex: 1; min-width: 0; min-height: 40px; max-height: 180px; padding: 9px 2px; border: 0; background: transparent;
  color: var(--text); font-size: 15px; line-height: 1.45; resize: none; outline: none; overflow-y: hidden;
}
/* A long placeholder ("#kanal kanalına yaz") is cut with an ellipsis instead of wrapping out of sight on phones. */
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .square-btn { width: 40px; height: 40px; border-radius: var(--r-lg); }
.composer .square-btn.on { background: var(--bg-raised); color: var(--text); }
.send { width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-lg); background: var(--teal); color: var(--on-teal); display: grid; place-items: center; }
.send { transition: filter var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.send:hover { filter: brightness(1.08); }
.send:active { transform: scale(.92); }
.composer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.composer-bar button { border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.composer-bar button:hover { color: var(--danger-text); }
#attach-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-md); }
.suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 6; list-style: none; margin: 0; padding: 6px;
  border-radius: var(--r-2xl); background: var(--bg-overlay); border: 1px solid var(--border); box-shadow: var(--shadow-2);
  --status-ring: var(--bg-overlay);
}
.suggest .suggest-title { padding: 4px 8px 6px; }
.suggest li.option { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-md); cursor: pointer; }
.suggest li.option[aria-selected="true"] { background: var(--bg-overlay-hover); box-shadow: inset 3px 0 0 var(--focus); }
.suggest .uname { margin-left: auto; font-size: 12px; color: var(--muted); }
.drop {
  position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center; border-radius: var(--r-3xl);
  background: rgba(53, 201, 181, .12); border: 2px dashed var(--teal); font-size: 18px; font-weight: 700; pointer-events: none;
}

/* ---------- Sağ panel ---------- */
.right {
  background: var(--bg-side); overflow-y: auto; padding: 18px 12px; min-width: 0;
  display: flex; flex-direction: column; gap: 18px; --status-ring: var(--bg-side);
}
.member-group { display: flex; flex-direction: column; gap: 2px; }
.member-group .mono-label { padding: 0 8px 6px; letter-spacing: .1em; }
.member-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border: 0; border-radius: var(--r-lg);
  background: transparent; color: var(--text); text-align: left; width: 100%;
}
.member-row:hover { background: var(--bg-hover); }
.member-row.offline { opacity: .5; }
.member-row .who { min-width: 0; }
.member-row .who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row .who small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right h2 { margin: 0; font: 700 18px var(--display); }
.right h3 { margin: 0; font: 700 16px var(--display); }
.right .sub { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.act-card { padding: 14px; border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border); --stack-ring: var(--bg-card); }
.act-card .who-line { display: flex; align-items: center; gap: 10px; }
.act-card .who-line b { display: block; font-size: 14px; }
.act-card .who-line small { display: block; font-size: 12px; color: var(--muted); }
.act-card .room-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-xl); background: var(--bg-side); font-size: 13px; color: var(--text-2); }
.act-card .room-line .ico { color: var(--online); }
.act-card .btn { margin-top: 10px; width: 100%; }
.suggest-card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-2xl); width: 100%;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); text-align: left;
}
.suggest-card:hover { border-color: var(--border-2); }
.suggest-card .server-icon { width: 40px; height: 40px; border-radius: var(--r-xl); font-size: 13px; }
.suggest-card b { display: block; font-size: 14px; }
.suggest-card small { display: block; font-size: 12px; color: var(--muted); }
.suggest-card > .ico { color: var(--muted); }
.right-empty { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- Dostlar ---------- */
.friends { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-main); }
.friend-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.friend-tab {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-3); font-size: 14px; font-weight: 500;
}
.friend-tab:hover { background: var(--bg-hover); color: var(--text); }
.friend-tab[aria-selected="true"] { background: var(--bg-raised); color: var(--text); font-weight: 600; }
.friends-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; }
.friends-body > .mono-label { display: block; padding: 0 0 10px; letter-spacing: .1em; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 0;
  --status-ring: var(--bg-main); cursor: pointer;
}
.friend-row:hover { background: var(--bg-hover); border-radius: var(--r-xl); }
.friend-row .who { flex: 1; min-width: 0; }
.friend-row .who b { display: block; font-size: 15px; }
.friend-row .who small { display: block; font-size: 13px; color: var(--muted); }
.friend-row .acts { display: flex; gap: 6px; }
.circle-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg-card); color: var(--text-2); display: grid; place-items: center; }
.circle-btn:hover { background: var(--bg-raised); color: var(--text); }
.circle-btn.ok:hover { color: var(--link); }
.circle-btn.no:hover { color: var(--danger-text); }
.add-friend { max-width: 720px; }
.add-friend h3 { margin: 4px 0 4px; font: 700 20px var(--display); }
.add-friend p { margin: 0 0 14px; color: var(--muted); }
.add-friend-box {
  display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; margin-bottom: 18px;
  border-radius: var(--r-2xl); background: var(--bg-input); border: 1px solid var(--border-2);
}
.add-friend-box:focus-within { border-color: var(--teal); }
.add-friend-box input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; color: var(--text); outline: none; font-size: 15px; }

/* ---------- Kəşf et ---------- */
.discover { overflow-y: auto; min-height: 0; background: var(--bg-main); }
.discover-inner { max-width: 1120px; margin: 0 auto; padding: 36px 44px 72px; display: flex; flex-direction: column; gap: 48px; }
.discover-top { display: flex; flex-wrap: wrap; gap: 20px; }
.hero {
  position: relative; overflow: hidden; flex: 3 1 460px; min-width: 0;
  padding: 34px; border-radius: var(--r-3xl); background: var(--bg-card); border: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; right: -70px; top: -70px; width: 280px; height: 280px; border-radius: 50%;
  background: repeating-linear-gradient(45deg, rgba(53, 201, 181, .11) 0 2px, transparent 2px 14px); pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { margin: 14px 0 24px; max-width: 540px; font: 800 42px/1.06 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.hero form { display: flex; flex-wrap: wrap; gap: 10px; }
.search-field { position: relative; flex: 1 1 300px; min-width: 0; }
.search-field input {
  width: 100%; height: 52px; padding: 0 16px 0 46px; border-radius: var(--r-2xl); border: 1px solid var(--border-2);
  background: var(--bg-side); color: var(--text); font-size: 15px; outline: none;
}
.search-field input:focus { border-color: var(--teal); }
.search-field .ico { position: absolute; left: 16px; top: 16px; color: var(--muted); }
.hero .btn { height: 52px; padding: 0 26px; border-radius: var(--r-2xl); font-size: 15px; }
.hero-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.make {
  flex: 2 1 340px; min-width: 0; padding: 30px; border-radius: var(--r-3xl); display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-card-2); border: 1px solid var(--amber-soft);
}
.make h2 { margin: 12px 0 6px; font: 800 26px/1.15 var(--display); letter-spacing: -.01em; }
.make p { margin: 0; font-size: 14px; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tpl-mini {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: var(--r-2xl);
  background: var(--bg-side); border: 1px solid var(--border); color: var(--text); text-align: left;
}
.tpl-mini:hover { border-color: var(--amber); }
.tpl-mini .tpl-ico { width: 34px; height: 34px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.tpl-mini b { font-size: 14px; }
.tpl-mini span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.make .actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: auto; }
.make .link-btn { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 600; color: var(--amber-text); }
.sec { display: flex; flex-direction: column; gap: 18px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 24px var(--display); }
.sec-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.live-card {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-3xl);
  background: var(--bg-card); border: 1px solid var(--border); --stack-ring: var(--bg-card);
}
.live-card .top { display: flex; align-items: center; gap: 10px; }
.live-card .top .server-icon { width: 34px; height: 34px; border-radius: var(--r-lg); font-size: 12px; }
.live-card .top span.grow { font-size: 13px; color: var(--text-3); }
.live-card .title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.live-card .kind { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.live-card .bottom { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.live-card .bottom .count { flex: 1; padding-left: 8px; font-size: 12px; color: var(--text-3); }
.dash-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px; border-radius: var(--r-3xl); border: 1.5px dashed var(--dash);
}
.dash-box b { display: block; font-size: 17px; }
.dash-box span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.server-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-3xl); padding: 0; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); --stack-ring: var(--bg-card);
  transition: border-color .15s, transform .15s;
}
.server-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.server-card .banner { height: 84px; background-size: cover; background-position: center; }
.server-card .body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; }
.server-card .server-icon { width: 56px; height: 56px; margin-top: -28px; border-radius: var(--r-3xl); border: 4px solid var(--bg-card); box-sizing: border-box; font-size: 17px; font-weight: 800; }
.server-card .name { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; }
.server-card p { margin: 0; font-size: 14px; line-height: 1.5; color: #A9B4BC; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
:root[data-theme="light"] .server-card p { color: var(--muted); }
.server-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.server-card .friends-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.server-card .foot { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.server-card .foot > span:first-child { display: flex; align-items: center; gap: 6px; }
.activity { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--link); font-weight: 600; }
.activity.quiet { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; border-radius: 1px; background: currentColor; }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 12px; }
.bars i.dim { opacity: .3; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.city {
  display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 16px; border-radius: var(--r-2xl);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-size: 15px; font-weight: 600; text-align: left;
}
.city .ico { color: var(--muted); }
.city small { margin-left: auto; font-size: 12px; color: var(--label); font-weight: 500; }
.city[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal-text); font-weight: 700; }
.city[aria-pressed="true"] .ico { color: var(--link); }

/* ---------- Serverə baxış (modal) ---------- */
dialog { padding: 0; border: 0; background: transparent; color: var(--text); max-width: none; max-height: none; }
dialog::backdrop { background: var(--scrim); }
.sheet { width: min(1080px, calc(100vw - 32px)); margin: 40px auto; }
.sheet-card { border-radius: var(--r-4xl); overflow: hidden; background: var(--bg-main); border: 1px solid var(--border); box-shadow: var(--shadow); }
.sheet-banner { position: relative; height: 150px; }
.sheet-banner .close { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border: 0; border-radius: var(--r-xl); background: rgba(11, 15, 18, .7); color: #E8EDF0; display: grid; place-items: center; }
.sheet-body { display: flex; flex-wrap: wrap; gap: 28px; padding: 0 32px 32px; }
.sheet-main { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.sheet-side { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.sheet .big-icon { position: relative; z-index: 1; width: 92px; height: 92px; margin-top: -46px; border-radius: var(--r-4xl); border: 6px solid var(--bg-main); box-sizing: border-box; font-size: 30px; font-weight: 800; }
.sheet h1 { margin: 14px 0 0; display: flex; align-items: center; gap: 10px; font: 800 32px/1.1 var(--display); letter-spacing: -.01em; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-3); }
.meta-row > span:first-child { display: flex; align-items: center; gap: 6px; }
.sheet .desc { margin: 0; max-width: 620px; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.panel-box { padding: 18px; border-radius: var(--r-2xl); background: var(--bg-card-2); border: 1px solid var(--border); }
.panel-box.raised { padding: 20px; border-radius: var(--r-3xl); background: var(--bg-card); display: flex; flex-direction: column; gap: 12px; --stack-ring: var(--bg-card); }
.two-col { display: flex; flex-wrap: wrap; gap: 16px; }
.two-col > * { flex: 1 1 220px; min-width: 0; }
.ch-preview { display: flex; align-items: center; gap: 10px; height: 34px; font-size: 14px; color: var(--text-2); }
.ch-preview .ico { color: var(--label); }
.ch-preview small { margin-left: auto; font-size: 12px; color: var(--label); }
.peek { position: relative; overflow: hidden; }
.peek-msgs { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.peek-msg { display: flex; gap: 10px; }
.peek-msg .who { font-size: 13px; }
.peek-msg .who b { font-weight: 700; }
.peek-msg .who span { margin-left: 8px; font-size: 11px; color: var(--label); }
.peek-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.peek::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--bg-card-2)); pointer-events: none; }
.friends-here { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- Server yaratmaq (sehrbaz) ---------- */
.wizard { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; }
.wizard[open] { display: flex; flex-direction: column; background: var(--bg-side); }
.wiz-head { flex: none; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 16px 28px; background: var(--bg-input); border-bottom: 1px solid var(--line); }
.wiz-progress { flex: 1 1 400px; display: flex; gap: 10px; max-width: 760px; margin: 0 auto; }
.wiz-progress div { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 600; color: var(--label); }
.wiz-progress div::before { content: ""; height: 4px; border-radius: var(--r-xs); background: var(--line-2); }
.wiz-progress .done { color: var(--text-2); }
.wiz-progress .done::before, .wiz-progress .cur::before { background: var(--amber); }
.wiz-progress .cur { color: var(--text); }
.wiz-body { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; overflow-y: auto; }
.wiz-main { flex: 999 1 560px; min-width: 0; padding: 44px 56px; display: flex; flex-direction: column; }
.wiz-inner { width: 100%; max-width: 720px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.wiz-inner h1 { margin: 10px 0 8px; font: 800 34px/1.1 var(--display); letter-spacing: -.01em; }
.wiz-inner > p { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.tpl-big-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.tpl-big {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; border-radius: var(--r-2xl);
  border: 2px solid var(--line-2); background: var(--bg-card-2); color: var(--text); text-align: left;
}
.tpl-big .tpl-ico { width: 40px; height: 40px; border-radius: var(--r-xl); display: grid; place-items: center; background: var(--bg-raised); color: var(--amber); }
.tpl-big b { font-size: 16px; }
.tpl-big span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.tpl-big[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-deep); }
.tpl-big[aria-pressed="true"] .tpl-ico { background: var(--amber); color: var(--on-amber); }
.look-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.icon-drop {
  width: 96px; height: 96px; border-radius: var(--r-4xl); border: 2px dashed var(--dash); background: var(--bg-card-2) center / cover;
  color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600;
}
.swatches { display: flex; gap: 10px; margin-top: 10px; }
.swatches button { width: 40px; height: 40px; border-radius: var(--r-xl); border: 3px solid transparent; }
.swatches button[aria-pressed="true"] { border-color: var(--text); }
.form-col { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.radio-card {
  display: flex; gap: 14px; padding: 18px; border-radius: var(--r-2xl); border: 2px solid var(--line-2);
  background: var(--bg-card-2); color: var(--text); text-align: left;
}
.radio-card b { display: block; font-size: 16px; }
.radio-card span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.radio-card[aria-checked="true"].pub { border-color: var(--teal); }
.radio-card[aria-checked="true"].priv { border-color: var(--amber); }
.radio-card .ico.pub { color: var(--link); }
.radio-card .ico.priv { color: var(--amber); }
.select-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; margin-top: 24px; }
.select-grid label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.done-ico { width: 64px; height: 64px; border-radius: var(--r-3xl); display: grid; place-items: center; background: var(--teal-soft); color: var(--link); }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 260px; font: 500 15px var(--mono) !important; }
.invite-list { display: flex; flex-direction: column; margin-top: 10px; border-radius: var(--r-2xl); border: 1px solid var(--line-2); background: var(--bg-card-2); }
.invite-list > div { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); --status-ring: var(--bg-card-2); }
.invite-list > div:last-child { border-bottom: 0; }
.invite-list b { flex: 1; font-size: 14px; }
.wiz-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 32px; }
.wiz-aside { flex: 1 1 380px; min-width: 0; padding: 44px 36px; background: var(--bg-input); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.wiz-aside .server-card:hover { transform: none; }
.private-cover { position: absolute; inset: 0; background: rgba(14, 18, 21, .86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: #E8EDF0; }
.private-cover .ico { color: var(--amber); }
.preview-wrap { position: relative; border-radius: var(--r-3xl); overflow: hidden; }
.tpl-ch-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }

/* ---------- Açılan pəncərələr ---------- */
.card {
  width: min(460px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; padding: 26px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  border-radius: var(--r-3xl); background: var(--bg-main); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 2px; font: 800 22px var(--display); }
.card > p { margin: 0 0 6px; color: var(--muted); }
.card label { margin-top: 6px; }
.card label.check { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 500; color: var(--text); }
.card label.check input { width: 20px; height: 20px; accent-color: var(--teal); }
.card .row { display: flex; flex-direction: row-reverse; gap: 8px; margin-top: 12px; }
.image-field { display: flex; align-items: center; gap: 12px; }
.image-field .avatar, .image-field .server-icon { width: 64px; height: 64px; font-size: 24px; }
.manage-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.manage-list .item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-xl); background: var(--bg-card); font-size: 14px; }
.manage-list small { color: var(--muted); }
.user-pick { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin-top: 6px; --status-ring: var(--bg-main); }
.user-pick button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-lg); background: none; text-align: left; }
.user-pick button:hover { background: var(--bg-hover); }
.user-pick small { margin-left: auto; color: var(--muted); }

.picker, .popover, .emoji-panel {
  position: fixed; z-index: 30; border-radius: var(--r-2xl); background: var(--bg-overlay); border: 1px solid var(--border); box-shadow: var(--shadow-2);
  --line: var(--border-2);
}
.picker { display: flex; gap: 2px; padding: 5px; }
.picker button { width: 38px; height: 38px; border: 0; border-radius: var(--r-lg); background: none; font-size: 20px; display: grid; place-items: center; color: var(--text-2); }
.picker button:hover { background: var(--bg-overlay-hover); }
.popover { width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; --status-ring: var(--bg-overlay); }
.menu-list { display: flex; flex-direction: column; padding: 6px; width: 250px; }
.menu-list button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-2); text-align: left; font-size: 14px; }
.menu-list button:hover { background: var(--bg-overlay-hover); color: var(--text); }
.menu-list button.danger { color: var(--danger-text); }
.menu-list button.danger:hover { background: var(--danger); color: #fff; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.profile-banner { height: 72px; border-radius: var(--r-2xl) var(--r-2xl) 0 0; }
.profile-body { padding: 0 16px 16px; }
.profile-body > .avatar { width: 80px; height: 80px; margin-top: -40px; font-size: 28px; border: 5px solid var(--status-ring, var(--bg-overlay)); box-sizing: content-box; }
.profile-body > .avatar[data-status]::after { width: 16px; height: 16px; border-width: 4px; right: 2px; bottom: 2px; }
.profile-name { margin-top: 8px; font: 800 20px var(--display); }
.profile-username { font-size: 14px; color: var(--muted); }
.profile-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.profile-section h4 { margin: 0 0 6px; }
.profile-section p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-actions select { height: 36px; padding: 0 8px; border-radius: var(--r-lg); border: 1px solid var(--border-2); background: var(--bg-input); }
.right .profile { border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border); --status-ring: var(--bg-card); }

.emoji-panel { width: 344px; height: 390px; display: flex; flex-direction: column; overflow: hidden; }
.emoji-panel input { margin: 10px 10px 6px; height: 38px; padding: 0 12px; border-radius: var(--r-lg); border: 1px solid var(--border-2); background: var(--bg-input); outline: none; }
.emoji-panel input:focus { border-color: var(--teal); }
.emoji-tabs { display: flex; gap: 2px; padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.emoji-tabs button { flex: 1; height: 30px; border: 0; border-radius: var(--r-md); background: none; font-size: 17px; filter: grayscale(.6); opacity: .75; }
.emoji-tabs button:hover { background: var(--bg-overlay-hover); filter: none; opacity: 1; }
.emoji-grid { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 6px 10px; }
.emoji-grid h4 { margin: 10px 4px 4px; }
.emoji-grid .cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.emoji-grid button { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: var(--r-md); background: none; font-size: 22px; display: grid; place-items: center; }
.emoji-grid button:hover { background: var(--bg-overlay-hover); }
.emoji-grid .none { padding: 30px 0; text-align: center; font-size: 13px; color: var(--muted); }

.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: var(--r-xl); background: var(--bg-raised); border: 1px solid var(--border-2); box-shadow: var(--shadow-2); font-size: 14px; animation: rise var(--dur-base) var(--ease-out); }

/* ---------- Axtarış, bərkidilmiş mesajlar ---------- */
.mobile-only { display: none !important; }
.head-search { position: relative; width: 200px; flex: none; }
.head-search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px; border: 0; border-radius: var(--r-md);
  background: var(--bg-input); color: var(--text); font-size: 13px; outline: none;
}
.head-search input:focus { box-shadow: 0 0 0 1px var(--teal); }
.head-search .ico { position: absolute; left: 11px; top: 10px; color: var(--label); pointer-events: none; }
.pinned-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--amber-text); }
.panel-head { display: flex; align-items: center; gap: 8px; }
.panel-head .mono-label { flex: 1; }
.result {
  display: flex; gap: 10px; padding: 10px; width: 100%; border: 0; border-radius: var(--r-xl); text-align: left;
  background: var(--bg-card); color: var(--text); --status-ring: var(--bg-card);
}
.result:hover { background: var(--bg-overlay-hover); }
.result .who { font-size: 13px; }
.result .who b { font-weight: 700; }
.result .who span { margin-left: 6px; font-size: 11px; color: var(--label); }
.result p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: rgba(240, 178, 62, .35); color: inherit; border-radius: var(--r-xs); padding: 0 1px; }
.popover[data-kind="pins"], .popover[data-kind="threads"] { width: min(380px, calc(100vw - 16px)); overflow: hidden; }
.pins-pop { max-height: 70vh; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pins-pop .result { padding-right: 40px; }
.pins-pop .result { position: relative; }
.pins-pop .unpin { position: absolute; right: 6px; top: 6px; }

/* ---------- Server ayarları ---------- */
.settings { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-main); }
.settings-body { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 36px 96px; }
.settings-inner { max-width: 760px; display: flex; flex-direction: column; gap: 22px; }
.settings-inner > h2 { margin: 0; font: 800 26px var(--display); }
.settings-inner > p.lead { margin: -14px 0 0; color: var(--muted); }
.set-card { border-radius: var(--r-2xl); border: 1px solid var(--line-2); background: var(--bg-card-2); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow b { display: block; font-size: 14px; font-weight: 600; }
.set-row .grow small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.set-row .ico { color: var(--label); }
.set-row.group-row { background: var(--bg-card); border-radius: var(--r-2xl) var(--r-2xl) 0 0; }
.set-row.group-row b { font: 700 12px var(--mono); letter-spacing: .1em; color: var(--text-2); }
.set-actions { display: flex; gap: 4px; }
.set-field { display: flex; flex-direction: column; gap: 8px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.set-grid label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tag-editor {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 6px 8px;
  border-radius: var(--r-xl); border: 1px solid var(--border-2); background: var(--bg-input);
}
.tag-editor:focus-within { border-color: var(--teal); }
.tag-editor .tag { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 10px; }
.tag-editor .tag button { width: 18px; height: 18px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); display: grid; place-items: center; }
.tag-editor .tag button:hover { color: var(--danger-text); }
.tag-editor input { flex: 1; min-width: 120px; height: 34px; border: 0; background: none; color: var(--text); outline: none; font-size: 14px; }
.rule-row { display: flex; gap: 8px; align-items: center; }
.rule-row .num { width: 26px; flex: none; text-align: right; font: 700 13px var(--mono); color: var(--label); }
.rule-row input { flex: 1; min-width: 0; }
.rule-row select.field { flex: 0 0 auto; width: min(220px, 45%); }
.invite-code { font: 600 14px var(--mono); }
.expired { color: var(--danger-text); }
.save-bar {
  position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-radius: var(--r-2xl);
  background: var(--bg-overlay); border: 1px solid var(--border-2); box-shadow: var(--shadow-2); font-size: 14px; font-weight: 600;
  animation: rise .2s ease-out;
}
.settings-head { display: flex; align-items: center; gap: 10px; padding: 24px 18px 6px; }
.settings-head .server-icon { width: 40px; height: 40px; border-radius: var(--r-xl); font-size: 14px; }
.settings-head b { display: block; font-size: 15px; }
.settings-head small { display: block; font-size: 12px; color: var(--muted); }
.nav-link.danger { color: var(--danger-text); }
.nav-link.danger .ico { color: var(--danger-text); }
.channel-groups { display: flex; flex-direction: column; gap: 16px; }
.mini-btn { width: 30px; height: 30px; border: 0; border-radius: var(--r-md); background: none; color: var(--muted); display: grid; place-items: center; }
.mini-btn:hover { background: var(--bg-raised); color: var(--text); }
.mini-btn.danger:hover { background: var(--danger); color: #fff; }
.mini-btn[disabled] { opacity: .3; cursor: default; background: none; }
.member-search { max-width: 360px; }
.welcome-box { padding: 14px 16px; border-radius: var(--r-2xl); background: var(--teal-soft); border: 1px solid var(--teal-line); color: var(--teal-text); font-size: 14px; line-height: 1.5; }
.rules-list { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.box-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.box-title .ico { color: var(--link); }

/* ---------- Rollar, kanal icazələri, audit jurnalı ---------- */
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 8px; border-radius: var(--r-md);
  border: 0; background: var(--bg-raised); color: var(--text-2); font-size: 12px; font-weight: 600;
}
.role-chip button { width: 18px; height: 18px; margin-right: -4px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); display: grid; place-items: center; flex: none; }
.role-chip button:hover { color: var(--danger-text); }
.role-chip.add { gap: 4px; background: none; border: 1px dashed var(--border-2); color: var(--muted); }
.role-chip.add:hover { color: var(--text); border-color: var(--dash); }
.role-menu {
  display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 4px; max-height: 220px; overflow-y: auto;
  border-radius: var(--r-xl); background: var(--bg-raised);
}
.role-menu button { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-2); font-size: 13px; text-align: left; }
.role-menu button:hover { background: var(--bg-hover); color: var(--text); }
.set-row .role-editor-inline { margin-top: 8px; }
.member-set-row { align-items: flex-start; }
.set-actions.wrap { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ch-lock { flex: none; color: var(--label); }

.roles-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.roles-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.role-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.role-row { display: flex; align-items: center; gap: 2px; padding-right: 4px; border-radius: var(--r-lg); }
.role-row.current { background: var(--bg-raised); }
.role-row .mini-btn { width: 26px; height: 26px; flex: none; }
.role-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border: 0; border-radius: var(--r-lg); background: none; color: var(--text-2); font-size: 14px; font-weight: 600; text-align: left;
}
.role-pick:hover, .role-row.current .role-pick { color: var(--text); }
.role-pick small { font: 600 12px var(--mono); color: var(--label); }
.role-pick .ico { color: var(--label); }
.role-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.role-panel-head { display: flex; align-items: center; gap: 10px; }
.role-panel-head h3 { margin: 0; font: 800 20px var(--display); overflow-wrap: anywhere; }
.notice { margin: 0; padding: 12px 14px; border-radius: var(--r-xl); background: var(--amber-soft); color: var(--amber-text); font-size: 13px; line-height: 1.5; }
.perm-title { margin: 6px 0 -6px; }
.role-swatches { flex-wrap: wrap; margin-top: 0; }
.role-swatches button { width: 34px; height: 34px; border-radius: var(--r-lg); }
.role-swatches .no-color { display: grid; place-items: center; background: var(--bg-raised); color: var(--muted); }
.role-swatches button[disabled] { opacity: .4; cursor: default; }
.switch-row { cursor: pointer; }
.switch-row.disabled { cursor: default; }
.switch-row.disabled .grow { opacity: .55; }
.switch {
  appearance: none; flex: none; position: relative; width: 42px; height: 24px; margin: 0; border-radius: var(--r-full);
  background: var(--border-2); cursor: inherit; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch:disabled { opacity: .5; }

.access-field { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.access-block { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.access-block legend { padding: 0; margin-bottom: 8px; }
.access-block .seg-btn { height: 36px; font-size: 13px; }
.access-roles { display: flex; flex-direction: column; padding: 4px 8px; max-height: 200px; overflow-y: auto; border-radius: var(--r-xl); background: var(--bg-card); }
.card .access-roles label.check { margin-top: 0; padding: 7px 0; font-size: 14px; }
.access-field > .hint { margin: 0; }

.audit-row { align-items: flex-start; }
.audit-line { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.audit-row .audit-line b { display: inline; font-size: inherit; font-weight: 700; }
.audit-row .audit-line b:not(.role-name) { color: var(--text); }
.audit-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.audit-perms span { padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; }
.perm-add { background: var(--teal-soft); color: var(--link); }
.perm-remove { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger-text); }
.audit-reason { font-style: italic; }

/* ---------- Mövzular ---------- */
.app.thread-wide { grid-template-columns: 76px 256px minmax(0, 1fr) 380px; }
.right.thread-open { padding: 0; gap: 0; overflow: hidden; }
.thread-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.thread-head > .ico { color: var(--link); }
.thread-head b { display: block; font-size: 15px; }
.thread-head small { display: block; font-size: 12px; color: var(--muted); }
.thread-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.tmsg { position: relative; display: flex; gap: 10px; padding: 6px; border-radius: var(--r-lg); }
.tmsg.open { background: var(--bg-hover); }
@media (hover: hover) { .tmsg:hover { background: var(--bg-hover); } }
.tmsg.starter { padding-bottom: 10px; }
.tmsg > .avatar { cursor: pointer; }
.tmsg .msg-user { font-size: 14px; }
.tmsg .msg-text { font-size: 14px; }
.tmsg .msg-image { max-height: 220px; }
.tmsg .msg-actions { right: 6px; top: -12px; }
.tmsg:focus-within .msg-actions, .tmsg.open .msg-actions { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
@media (hover: hover) { .tmsg:hover .msg-actions { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; } }
.tmsg .msg-actions button { width: 28px; height: 28px; }
.thread-sep { display: flex; align-items: center; gap: 10px; margin: 2px 6px 8px; font-size: 12px; font-weight: 600; color: var(--label); }
.thread-sep::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.thread-composer {
  flex: none; display: flex; align-items: flex-end; gap: 6px; margin: 0 12px 14px; padding: 6px 6px 6px 12px;
  border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border);
}
.thread-composer textarea {
  flex: 1; min-width: 0; height: 40px; max-height: 160px; padding: 9px 0; border: 0; background: transparent;
  color: var(--text); font-size: 14px; line-height: 1.45; resize: none; outline: none;
}
.thread-composer.disabled { opacity: .5; pointer-events: none; }
.thread-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 8px; height: 32px; padding: 0 12px;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-card); color: var(--link); font-size: 12px; font-weight: 600;
}
.thread-chip:hover { border-color: var(--teal-line); }
.thread-chip b { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.thread-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; }

/* ---------- Tədbirlər ---------- */
.date-box {
  width: 48px; height: 48px; flex: none; border-radius: var(--r-lg); background: var(--bg-side);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.date-box span { font: 700 9px var(--mono); letter-spacing: .06em; color: var(--amber); }
:root[data-theme="light"] .date-box span { color: var(--amber-text); }
.date-box b { font: 800 18px/1.1 var(--display); color: var(--text); }
.ev-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 520px; margin-top: 8px; padding: 12px;
  border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border);
}
.ev-card > .grow { min-width: 160px; }
.ev-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ev-card.ended { opacity: .65; font-size: 13px; color: var(--muted); }
.ev-card.ended .ico { color: var(--label); }
.ev-title { display: block; padding: 0; border: 0; background: none; color: var(--text); font-size: 14px; font-weight: 700; text-align: left; }
.ev-title:hover { text-decoration: underline; }
.ev-title .live-badge { vertical-align: 1px; }
.next-event {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-xl);
  border: 1px solid var(--amber-soft); background: var(--amber-deep); color: var(--text); text-align: left;
}
.next-event > .ico { color: var(--amber); }
:root[data-theme="light"] .next-event > .ico { color: var(--amber-text); }
.next-event small { display: block; font: 700 11px var(--mono); letter-spacing: .04em; color: var(--amber-text); }
.next-event b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev-list .ev-card { margin: 0; max-width: none; }
.ev-detail { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ev-line { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.ev-line .ico { color: var(--label); }
.ev-desc { margin: 4px 0 0; padding: 12px 14px; border-radius: var(--r-xl); background: var(--bg-card); line-height: 1.5; white-space: pre-wrap; }
.ev-detail .stack { display: flex; --stack-ring: var(--bg-main); }
.ev-detail .stack .avatar { border: 2px solid var(--bg-main); margin-left: -6px; }
.ev-detail .stack .avatar:first-child { margin-left: 0; }
.ev-answers { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.ev-answers .seg-btn { height: 38px; font-size: 13px; }
.ev-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.week-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.week-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border); }
.week-card b { display: block; font-size: 14px; }
.week-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ev-mini { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ev-mini b { display: block; font-size: 13px; }
.ev-mini small { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Fayllar və səs mesajları ---------- */
.voice-msg {
  display: flex; align-items: center; gap: 10px; width: min(320px, 100%); margin-top: 8px; padding: 8px 12px 8px 8px;
  border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border);
}
.voice-play { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--teal); color: var(--on-teal); display: grid; place-items: center; }
.voice-bar { position: relative; flex: 1; height: 6px; border-radius: var(--r-xs); background: var(--bg-raised); cursor: pointer; }
.voice-bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--r-xs); background: var(--link); }
.voice-time { font: 600 12px var(--mono); color: var(--muted); min-width: 34px; text-align: right; }
.file-card {
  display: flex; align-items: center; gap: 12px; width: min(380px, 100%); margin-top: 8px; padding: 10px 14px 10px 10px;
  border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.file-card:hover { border-color: var(--teal-line); color: var(--text); }
.file-card > .ico { color: var(--muted); }
.file-ico { position: relative; width: 40px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--bg-side); color: var(--link); }
.file-ico small { position: absolute; bottom: 3px; font: 700 8px var(--mono); color: var(--label); }
.file-card b { display: block; font-size: 14px; }
.file-card small { display: block; font-size: 12px; color: var(--muted); }
.msg-video { display: block; margin-top: 8px; max-width: min(480px, 100%); max-height: 320px; border-radius: var(--r-xl); background: #000; }
.attach-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--bg-side); color: var(--link); }
.record-bar { font-weight: 600; color: var(--text); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.composer .square-btn#record-btn.on { background: var(--danger); color: #fff; }

/* ---------- Mesaj sorğuları, zənglər, qruplar ---------- */
.request-bar, .call-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2);
}
.request-bar { margin-bottom: 10px; padding: 10px 12px; border-radius: var(--r-xl); background: var(--amber-deep); border: 1px solid var(--amber-soft); }
.request-bar > .ico { color: var(--amber); }
.call-bar { flex: none; margin: 10px 20px 0; padding: 8px 10px 8px 14px; border-radius: var(--r-xl); background: var(--teal-soft); border: 1px solid var(--teal-line); }
.call-bar b { color: var(--text); }
.call-card {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: min(360px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-3xl);
  background: var(--bg-overlay); border: 1px solid var(--border-2); box-shadow: var(--shadow-3); animation: rise var(--dur-slow) var(--ease-out);
}
.call-card b { display: block; font-size: 15px; }
.call-card small { display: block; font-size: 12px; color: var(--muted); }
.call-accept, .call-decline { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.call-accept { background: var(--online); animation: pulse 1.4s infinite; }
.call-decline { background: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .45); } 50% { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); } }
.avatar.grp { border-radius: 30%; background: #2E6A7A; }
.dm-row > .ico { color: var(--online); }
.group-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.group-head .sub { margin: -4px 0 0; }
.group-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.group-member { display: flex; align-items: center; gap: 4px; }
.group-member .member-row { flex: 1; min-width: 0; }
.friend-pick { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; padding: 4px 8px; border-radius: var(--r-xl); background: var(--bg-card); }
.card .friend-pick label.check { margin-top: 0; padding: 6px 0; }
.ch.muted-ch { opacity: .55; }
.profile-activity { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.role-badge.bot { background: var(--teal-soft); color: var(--link); }
.menu-title { padding: 8px 10px 4px; }
.menu-list button[aria-current="true"] { color: var(--text); }
.menu-list button[aria-current="true"] .ico:last-child { color: var(--link); }

/* ---------- Səsli otaq səhifəsi ---------- */
.voice-info { padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.room { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-rail); }
.room-head { background: var(--bg-main); }
.room-title { display: flex; flex-direction: column; }
.room-title small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-live { padding: 4px 10px; border-radius: var(--r-md); background: var(--amber); color: var(--on-amber); font: 700 11px var(--mono); letter-spacing: .04em; white-space: nowrap; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.room.chat-hidden .room-body { grid-template-columns: minmax(0, 1fr); }
.room.chat-hidden .room-chat { display: none; }
.room-stage { min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.room-screen { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 9; max-height: 62vh; border-radius: var(--r-3xl); overflow: hidden; background: #000; }
.room-screen video { width: 100%; height: 100%; object-fit: contain; }
.room-screen video { touch-action: none; }
.room-screen.zoomed video { cursor: grab; }
.room-screen.zoomed video:active { cursor: grabbing; }
.zoom-badge { min-width: 52px; }
.screen-label {
  position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  border-radius: var(--r-lg); background: rgba(11, 15, 18, .75); color: #F2F5F7; font-size: 13px; font-weight: 600;
}
.screen-label b { font: 700 10px var(--mono); letter-spacing: .1em; color: var(--amber); }
.screen-label { flex-wrap: wrap; max-width: calc(100% - 24px); row-gap: 2px; }
.screen-label small { flex-basis: 100%; font-size: 11px; font-weight: 600; color: #B9C3CA; }
.screen-label small.warn { color: var(--amber); }
.screen-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #B9C3CA; font-size: 14px; }
.room-screen:fullscreen { max-height: none; aspect-ratio: auto; border-radius: 0; }
.screen-tools {
  position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 6px; padding: 4px;
  border-radius: var(--r-xl); background: rgba(11, 15, 18, .75); opacity: 0; transition: opacity .15s;
}
.room-screen:hover .screen-tools, .room-screen:focus-within .screen-tools, .room-screen:fullscreen .screen-tools { opacity: 1; }
@media (hover: none) { .screen-tools { opacity: 1; } }
.tool-btn { width: 36px; height: 36px; border: 0; border-radius: var(--r-md); background: transparent; color: #F2F5F7; display: grid; place-items: center; }
.tool-btn:hover, .tool-btn.on { background: rgba(255, 255, 255, .14); }
.stream-vol { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: #F2F5F7; }
.stream-vol input { width: 90px; accent-color: var(--teal); }
.room-streams { display: flex; gap: 10px; overflow-x: auto; flex: none; }
.stream-card {
  position: relative; flex: none; width: 220px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid var(--line-2); border-radius: var(--r-2xl);
  overflow: hidden; background: var(--bg-card); color: var(--text); display: grid; place-items: center;
}
.stream-card:hover { border-color: var(--teal); }
.stream-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stream-card-text {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-direction: column; align-items: flex-start; padding: 4px 8px;
  border-radius: var(--r-md); background: rgba(11, 15, 18, .75); color: #F2F5F7; text-align: left; font-size: 13px;
}
.stream-card-text small { font-size: 11px; color: var(--amber); font-weight: 600; }
.stream-card.idle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.stream-card.idle .stream-card-text { position: static; align-items: center; background: none; padding: 0; color: var(--text); text-align: center; }
.stream-card.idle .ico { color: var(--amber); }
.room-tile.has-video { cursor: zoom-in; }
.room-tile.on-stage { border-style: dashed; }
.tile-act.top { top: 8px; bottom: auto; opacity: 0; transition: opacity .15s; }
.room-tile:hover .tile-act.top, .tile-act.top:focus-visible { opacity: 1; }
@media (hover: none) { .tile-act.top { opacity: 1; } }
.tile-act.top:hover { background: rgba(11, 15, 18, .95); }
.q-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; margin-left: 2px; }
.q-bars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .3); }
.q-bars i:nth-child(1) { height: 5px; }
.q-bars i:nth-child(2) { height: 8px; }
.q-bars i:nth-child(3) { height: 12px; }
.q-good i { background: var(--online); }
.q-ok i:nth-child(-n+2) { background: var(--amber); }
.q-bad i:nth-child(1) { background: var(--danger); }
.peer-menu { min-width: 240px; }
.peer-vol { display: flex; flex-direction: column; gap: 6px; padding: 6px 10px 10px; }
.peer-vol-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.peer-vol input { width: 100%; accent-color: var(--teal); }
.peer-q { padding: 8px 10px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
/* Geniş görünüş: the picture takes the whole stage, people shrink to a row, chat steps aside. */
.room.theater .room-body { grid-template-columns: minmax(0, 1fr); }
.room.theater .room-chat, .room.theater .room-listeners { display: none; }
.room.theater.has-focus .room-stage { overflow: hidden; }
.room.theater.has-focus .room-screen { flex: 1; min-height: 0; max-height: none; aspect-ratio: auto; }
.room.theater.has-focus .room-tiles { flex: none; display: flex; gap: 8px; overflow-x: auto; }
.room.theater.has-focus .room-tile { flex: none; width: 160px; }
.room.theater.has-focus .room-tile { aspect-ratio: 16 / 9; align-items: start; padding-top: 12px; }
.room.theater.has-focus .room-tile > .avatar { width: 36px; height: 36px; font-size: 14px; }
.room.theater.has-focus .tile-label { left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px 8px; font-size: 12px; }
.room.theater.has-focus .stream-card { width: 160px; }
.room-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.room-tile {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-2xl); overflow: hidden; display: grid; place-items: center;
  background: var(--bg-card); border: 2px solid var(--line-2); transition: border-color .15s, box-shadow .15s;
}
.room-tile.speaking { border-color: var(--online); box-shadow: 0 0 0 3px rgba(61, 220, 132, .22); }
.room-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
video.mirror { transform: scaleX(-1); }
.room-tile > .avatar { width: 84px; height: 84px; font-size: 28px; }
.tile-label {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 60px); display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-md); background: rgba(11, 15, 18, .75); color: #F2F5F7; font-size: 13px; font-weight: 600;
}
.tile-label .ico { color: var(--coral); }
/* The label is dark in both themes, so the tag keeps the light coral. */
.tile-tag {
  flex: none; padding: 1px 6px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--coral) 22%, transparent);
  color: var(--coral); font: 700 10px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase;
}
.tile-status { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: var(--r-md); background: rgba(11, 15, 18, .75); color: #F2F5F7; font-size: 12px; font-weight: 600; }
.tile-status.bad { background: var(--danger); }
.tile-status.warn { background: var(--amber); color: var(--on-amber); }
/* Səsli otaq: bərpa, reaksiyalar, statistika, danış düyməsi */
.voice-panel.reconnecting .voice-info b { color: var(--amber); }
.voice-panel.reconnecting .live-dot { background: var(--amber); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.voice-people .vp-live {
  display: flex; align-items: center; gap: 8px; height: 28px; width: 100%; padding: 0 6px 0 0; border: 0; border-radius: var(--r-md);
  background: none; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.voice-people .vp-live:hover { background: var(--bg-raised); color: var(--text); }
.voice-people .live-badge { padding: 1px 5px; font-size: 9px; }
.voice-people .away { opacity: .5; }
.room-body { position: relative; }
.stream-stats {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: var(--r-lg); background: rgba(11, 15, 18, .8); color: #DCE3E8; font: 600 11px/1.5 var(--mono);
}
.tool-btn.text { width: auto; min-width: 36px; padding: 0 8px; font: 700 12px var(--mono); letter-spacing: .04em; }
.tool-btn:focus-visible, .q-item:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
/* Viewer's quality choice (Avto / Yüksək / Aşağı): a short list that opens inside the screen box,
   so it works in full screen too. Media overlays stay dark in both themes. */
.screen-tools.pinned { opacity: 1; }
/* The list lines up with the right edge of the tool bar, so it stays inside the screen box on phones. */
.q-pick { display: contents; }
.q-btn { display: flex; align-items: center; gap: 6px; }
.q-dot { width: 6px; height: 6px; border-radius: var(--r-full); background: var(--teal); }
.q-dot.light { background: var(--amber); }
.q-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: 250px; max-width: calc(100vw - 40px);
  display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: var(--r-xl);
  background: var(--media-scrim); color: var(--on-media); box-shadow: var(--shadow-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: q-menu-in var(--dur-base) var(--ease-out);
}
@keyframes q-menu-in { from { opacity: 0; transform: translateY(-4px); } }
.q-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 10px; border: 0;
  border-radius: var(--r-md); background: transparent; color: var(--on-media); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.q-item b { font-size: 13px; font-weight: 700; }
.q-item small { font-size: 12px; color: var(--on-media-2); }
.q-item:hover { background: rgba(255, 255, 255, .1); }
.q-item.active { background: rgba(255, 255, 255, .14); box-shadow: inset 3px 0 0 var(--teal); }
/* Our own shared tab: zoom it from here. */
.tab-zoom { display: flex; align-items: center; gap: 2px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, .16); }
@media (max-width: 760px) {
  .q-item small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .q-menu { animation: none; }
  .q-item { transition: none; }
}
.rc-btn.ptt { width: auto; padding: 0 18px; border-radius: var(--r-4xl); gap: 8px; display: flex; align-items: center; touch-action: none; user-select: none; }
.rc-btn.ptt .ptt-label { font-weight: 700; font-size: 14px; }
.rc-btn.ptt[aria-pressed="true"] { background: var(--online); color: #0B0F12; }
.reaction-pick { display: grid; grid-template-columns: repeat(4, 42px); gap: 2px; padding: 6px; }
.popover[data-kind="reactions"] { width: auto; }
.popover[data-kind="attach"] { width: auto; }
.popover[data-kind="peer"] { width: auto; }
.reaction-btn { width: 42px; height: 42px; border: 0; border-radius: var(--r-lg); background: transparent; font-size: 24px; transition: transform .1s; }
.reaction-btn:hover { background: var(--bg-overlay-hover); transform: scale(1.12); }
.reaction-fly {
  position: absolute; bottom: 16px; z-index: 6; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  transform: translateX(-50%); animation: fly-up 2.6s ease-out forwards;
}
.reaction-fly .emoji { font-size: 42px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.reaction-fly small { margin-top: 2px; padding: 1px 6px; border-radius: var(--r-sm); background: rgba(11, 15, 18, .75); color: #F2F5F7; font-size: 11px; font-weight: 600; white-space: nowrap; }
@keyframes fly-up {
  0% { opacity: 0; transform: translate(-50%, 24px) scale(.6); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -240px) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .reaction-fly { animation-duration: 1.4s; } }
.mic-set { display: flex; flex-direction: column; gap: 8px; }
.mic-set .seg-btn { height: 38px; }
.ptt-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.ptt-row .btn { flex: none; }
.ptt-row .key-btn { min-width: 64px; font-family: var(--mono); }
.room-screen .screen-label { max-width: min(62%, calc(100% - 24px)); }
.mic-set input[type="range"], .sound-vol input { width: 100%; accent-color: var(--teal); }
.mic-meter { position: relative; height: 10px; border-radius: var(--r-xs); background: var(--bg-input); overflow: hidden; }
.mic-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--muted); transition: width .06s linear; }
.mic-meter i.open { background: var(--online); }
.mic-meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--amber); }
.sound-vol { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.sound-vol span { flex: none; }
.tile-act { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border: 0; border-radius: var(--r-md); background: rgba(11, 15, 18, .75); color: #F2F5F7; display: grid; place-items: center; }
.tile-act.left { right: auto; left: 8px; top: 8px; bottom: auto; }
.tile-act:hover { background: var(--danger); }
.room-listeners { display: flex; flex-direction: column; gap: 10px; }
.listener-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.listener { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; --status-ring: var(--bg-rail); }
.mini-hand { position: absolute; right: -4px; top: -6px; font-size: 14px; }
.guest-count { margin-left: 4px; font-size: 13px; color: var(--muted); }
.hands { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--r-2xl); background: var(--amber-deep); border: 1px solid var(--amber-soft); }
.hands > b { font-size: 13px; color: var(--amber-text); }
.hand-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.hand-pos { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--amber-text); border: 1px solid var(--amber-soft); }
/* Remote sound the browser would not start on its own. */
.voice-panel { flex-wrap: wrap; }
.voice-panel .audio-on { flex-basis: 100%; }
.room-stage .audio-on { flex: none; align-self: center; }
.audio-on[hidden] { display: none; }
/* Speaking ring in the sidebar voice list. */
.voice-people .avatar { transition: box-shadow var(--dur-fast) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .voice-people .avatar { transition: none; } }
.room-chat { display: flex; flex-direction: column; min-height: 0; background: var(--bg-side); border-left: 1px solid var(--line); }
.room-chat-head { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.room-chat-head small { font-size: 11px; color: var(--label); }
.room-chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.rc-msg { display: flex; gap: 10px; }
.rc-msg .who { font-size: 13px; }
.rc-msg .who span { margin-left: 6px; font-size: 11px; color: var(--label); }
.rc-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.room-chat-form { flex: none; display: flex; gap: 6px; margin: 0 12px 12px; padding: 6px 6px 6px 12px; border-radius: var(--r-2xl); background: var(--bg-card); border: 1px solid var(--border); }
.room-chat-form input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 14px; outline: none; }
.room-controls { flex: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 14px; background: var(--bg-main); border-top: 1px solid var(--line); }
.rc-btn { width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--bg-raised); color: var(--text); display: grid; place-items: center; }
.rc-btn:hover { filter: brightness(1.12); }
.rc-btn[aria-pressed="true"] { background: var(--teal); color: var(--on-teal); }
.rc-btn.off { background: var(--coral); color: var(--on-coral); }
.rc-btn.leave { background: var(--danger); color: #fff; }
.rc-btn[aria-disabled="true"] { opacity: .4; cursor: default; filter: none; }
.screen-q { display: flex; flex-direction: column; gap: 8px; }
.screen-q .seg { grid-template-columns: repeat(3, 1fr); }
.screen-q .seg-btn { height: 40px; }
.screen-q .seg-btn small { display: block; font-size: 11px; font-weight: 600; opacity: .75; }
.screen-q .hint { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }

/* ---------- Qonaqlar, maraqlar, kolleksiyalar, şikayətlər ---------- */
.link-btn { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.danger-link { color: var(--danger-text); }
.rules-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.guest-tag { flex: none; padding: 2px 6px; border-radius: var(--r-sm); background: var(--amber); color: var(--on-amber); font: 700 10px var(--mono); }
.side-banner .ico + b, .side-banner b + svg { flex: none; }
.request-bar > .ico { color: var(--amber); }
.code-form { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; max-width: 420px; }
.mode-seg { display: none; width: 100%; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.coll-card { position: relative; border-radius: var(--r-3xl); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); }
.coll-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--text); text-align: left; }
.coll-banner { position: relative; height: 96px; display: flex; align-items: flex-end; padding: 12px; }
.coll-icons { display: flex; }
.coll-icons .server-icon { width: 40px; height: 40px; border-radius: var(--r-xl); margin-right: -8px; border: 3px solid var(--bg-card); font-size: 13px; }
.coll-text { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.coll-text b { font: 700 16px var(--display); }
.coll-text span { font-size: 13px; color: var(--muted); }
.coll-edit { position: absolute; right: 8px; top: 8px; background: rgba(11, 15, 18, .7); color: #F2F5F7; }
.coll-add {
  min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-3xl); border: 1.5px dashed var(--dash); background: transparent; color: var(--amber-text); font-weight: 700;
}
.report-row { align-items: flex-start; }
.report-row.closed { opacity: .6; }
.report-quote { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--r-lg); background: var(--bg-card); font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.report-details { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.admin-reports { max-height: 60vh; overflow-y: auto; }
.secret-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-2xl); background: var(--amber-deep); border: 1px solid var(--amber-soft); }
.bot-guide { margin: 10px 0 0; padding: 14px; border-radius: var(--r-xl); background: var(--bg-input); border: 1px solid var(--line); font: 500 12px/1.6 var(--mono); color: var(--text-2); overflow-x: auto; white-space: pre; }
.role-row[draggable="true"] { cursor: grab; }
.role-row.dragging { opacity: .4; }
.role-row.drop-target { box-shadow: inset 0 2px 0 var(--teal); }
.wiz-toggles { margin-top: 20px; }

/* ---------- Bildiriş mərkəzi ---------- */
.inbox { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-main); }
.inbox-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 4px; max-width: 820px; width: 100%; }
.inbox-day { padding: 14px 8px 6px; }
.inbox-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: var(--r-2xl);
  background: transparent; color: var(--text); text-align: left; --status-ring: var(--bg-main);
}
.inbox-row:hover { background: var(--bg-hover); }
.inbox-row.unread { background: var(--bg-card); }
.inbox-row p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.inbox-row p b { color: var(--text); }
.inbox-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.inbox-row .unread-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--link); }
.inbox-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--link); }

/* ---------- Kiçik ekranlar ---------- */
@media (max-width: 1180px) {
  .app, .app.right-wide, .app.thread-wide { grid-template-columns: 76px 256px minmax(0, 1fr); }
  .app.right-open .right.thread-open { width: min(440px, 100vw); }
  .right { display: none; }
  .app.right-open .right {
    display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 20;
    box-shadow: var(--shadow);
  }
}
@media (max-width: 760px) {
  .app, .app.right-wide, .app.no-right {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "main" "tabbar";
  }
  .rail, .side { display: none; }
  .app.nav-open { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "rail side" "tabbar tabbar"; }
  .app.nav-open .rail, .app.nav-open .side { display: flex; }
  .app.nav-open .chat, .app.nav-open .friends, .app.nav-open .discover, .app.nav-open .settings,
  .app.nav-open .inbox, .app.nav-open .room { display: none; }
  .tab-ico { position: relative; }
  .tab-ico .badge { position: absolute; right: 2px; top: -4px; height: 18px; min-width: 18px; padding: 0 5px; font-size: 10px; line-height: 18px; }
  .call-bar { margin: 8px 10px 0; }
  .mode-seg { display: grid; }
  .discover-top .make { display: none; }
  .discover-top.show-make .make { display: flex; }
  .discover-top.show-make .hero { display: none; }
  .room-head #room-invite { display: none; }
  .room-body { grid-template-columns: minmax(0, 1fr); }
  .room-chat { position: absolute; left: 0; right: 0; top: 60px; bottom: 81px; z-index: 3; border-left: 0; }
  .room-stage { padding: 12px; }
  .room-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .room-tile { aspect-ratio: 4 / 3; }
  .room-tile > .avatar { width: 52px; height: 52px; font-size: 19px; margin-bottom: 26px; }
  .rc-btn { width: 46px; height: 46px; }
  .head-search { display: none; }
  .head-search.open { display: block; position: absolute; left: 10px; right: 10px; top: 12px; width: auto; z-index: 3; }
  .mobile-only { display: grid !important; }
  .settings-body { padding: 18px 14px 96px; }
  .save-bar { left: 10px; right: 10px; bottom: 10px; }
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
  .roles-side { position: static; }
  .member-set-row { flex-wrap: wrap; }
  .member-set-row .set-actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .chat, .friends, .discover, .settings, .inbox, .room { grid-area: main; }
  .tabbar {
    grid-area: tabbar; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); background: var(--bg-input); border-top: 1px solid var(--line);
  }
  .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .tab-ico { width: 44px; height: 30px; border-radius: var(--r-lg); display: grid; place-items: center; }
  .tabbar button[aria-current="page"] { color: var(--link); }
  .tabbar button[aria-current="page"] .tab-ico { background: var(--teal-soft); }
  .menu { display: grid !important; }
  .chat-head { padding: 0 10px; gap: 8px; }
  .messages { padding: 12px 14px 8px; }
  .composer-area { padding: 0 10px 10px; }
  .discover-inner { padding: 20px 16px 48px; gap: 32px; }
  .hero, .make { padding: 22px; }
  .hero h1 { font-size: 30px; }
  .friends-body { padding: 12px; }
  .friend-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .friend-tab { flex: none; }
  .sheet { margin: 0; width: 100vw; }
  .sheet-card { border-radius: 0; min-height: 100dvh; }
  .sheet-body { padding: 0 18px 24px; }
  .wiz-main { padding: 24px 18px; }
  .wiz-aside { display: none; }
  .wiz-head { padding: 12px 14px; }
}

/* ---------- Təməl: fokus və hərəkət ---------- */
/* Text fields that draw their own frame show the same soft halo as the composer. */
.thread-composer:focus-within, .room-chat-form:focus-within { border-color: var(--focus); box-shadow: var(--focus-ring); }
.side-search input:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Light hover feedback for the most common controls, so state changes ease instead of snapping. */
.square-btn, .ch, .dm-row, .member-row, .server-icon, .btn.outline, .picker button, .suggest li.option {
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
/* People who ask the system for less motion get none of the decorative movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  .spin { animation-duration: 1s !important; animation-iteration-count: infinite !important; }
  .msg.flash { animation-duration: 1.4s !important; }
  .reaction-fly { animation: rm-fade 1.4s linear forwards !important; }
  .server-card:hover { transform: none; }
}
@keyframes rm-fade { 0% { opacity: 0; } 15%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* CANLI kartı: a shared screen's preview beside the sidebar */
.live-peek {
  position: fixed; z-index: 30; width: min(264px, calc(100vw - 16px)); overflow: hidden;
  border-radius: var(--r-xl); background: var(--bg-overlay); border: 1px solid var(--border); box-shadow: var(--shadow-2);
  animation: live-peek-in var(--dur-base) var(--ease-out);
}
.lc-shot { position: relative; aspect-ratio: 16 / 9; background: var(--media-scrim); }
.lc-shot img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lc-wait {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--on-media-2); font-size: 12px;
}
.lc-shot .live-badge { position: absolute; left: 8px; top: 8px; }
.lc-viewers {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--r-full); background: var(--media-scrim); color: var(--on-media); font: 600 11px var(--font);
}
.lc-body { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.lc-body .grow { min-width: 0; display: flex; flex-direction: column; }
.lc-body b { font-size: 13px; color: var(--text); }
.lc-body small { font-size: 11px; color: var(--muted); }
@keyframes live-peek-in { from { opacity: 0; transform: translateY(4px); } }

/* Who watches a screen */
.watch-count {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 2px;
}
.watch-count:hover { color: var(--on-media); }
.watch-count:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
.popover[data-kind="watchers"] { width: min(260px, calc(100vw - 16px)); }
.watchers { display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.watchers .mono-label { margin-bottom: 6px; }
.watchers .hint { margin: 0; }
.watcher { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; color: var(--text-2); }
.watcher small { color: var(--muted); font-size: 11px; }
.watcher-guests { padding-top: 6px; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .live-peek { animation: none; } }

/* Pointer marks on a shared screen ("Göstərici"); drawn over the video, never into it */
.room-screen.pointing video { cursor: crosshair; }
.point-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.point-mark { position: absolute; width: 0; height: 0; animation: point-fade 2.5s linear var(--age, 0ms) forwards; }
.point-mark i {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: var(--r-full);
  border: 3px solid var(--who, var(--teal)); background: color-mix(in srgb, var(--who, var(--teal)) 35%, transparent);
  box-shadow: 0 0 0 2px var(--on-media), var(--shadow-1);
}
.point-mark:not(.moving) i::after {
  content: ''; position: absolute; inset: -5px; border-radius: var(--r-full); border: 2px solid var(--who, var(--teal));
  animation: point-ping .7s var(--ease-out) var(--age, 0ms) forwards;
}
.point-mark small {
  position: absolute; left: 12px; top: 10px; padding: 1px 6px; border-left: 3px solid var(--who, var(--teal)); border-radius: var(--r-sm);
  background: var(--media-scrim); color: var(--on-media); font-size: 11px; font-weight: 600; white-space: nowrap;
}
@keyframes point-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes point-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .point-mark { animation: none; }
  .point-mark:not(.moving) i::after { display: none; }
}

/* The small room window (Document Picture-in-Picture); its document links this stylesheet */
.mini-room { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 12px; background: var(--bg-main); color: var(--text); overflow: hidden; }
.mini-head { flex: none; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.mini-head b { color: var(--text); }
.mini-head small { flex: none; color: var(--muted); font-size: 12px; }
.mini-screen { position: relative; flex: 1; min-height: 80px; border-radius: var(--r-xl); overflow: hidden; background: #000; }
.mini-screen video { display: block; width: 100%; height: 100%; object-fit: contain; }
.mini-screen-name {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: var(--r-sm);
  background: var(--media-scrim); color: var(--on-media); font-size: 11px; font-weight: 600;
}
.mini-people { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mini-person { position: relative; display: inline-flex; }
.mini-person .avatar { transition: box-shadow var(--dur-fast) var(--ease-out); }
.mini-person > svg { position: absolute; right: -3px; bottom: -3px; padding: 1px; border-radius: var(--r-full); background: var(--coral); color: var(--on-coral); }
.mini-more { color: var(--muted); font-size: 12px; font-weight: 600; }
.mini-controls { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: auto; }
.mini-btn {
  height: 40px; min-width: 40px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: var(--bg-raised); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 13px var(--font); cursor: pointer;
  transition: filter var(--dur-fast) var(--ease-out);
}
.mini-btn.wide { padding: 0 14px; }
.mini-btn:hover { filter: brightness(1.12); }
.mini-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mini-btn.off { background: var(--coral); color: var(--on-coral); }
.mini-btn.leave { background: var(--danger); color: var(--on-danger); }
.mini-btn:disabled { opacity: .4; cursor: default; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .mini-btn, .mini-person .avatar { transition: none; }
}

/* ---------- Hərəkət: pəncərələr, popover-lər, keçidlər, mobil panellər ---------- */
/* Pəncərələr böyüyərək açılır, sönərək bağlanır. @starting-style-u bilməyən brauzerdə əvvəlki kimi birdən açılır. */
dialog {
  opacity: 0; transform: translateY(8px) scale(.97);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
    overlay var(--dur-base) allow-discrete, display var(--dur-base) allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
dialog:not([open]), dialog:not([open])::backdrop { pointer-events: none; }
dialog::backdrop {
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out), overlay var(--dur-base) allow-discrete, display var(--dur-base) allow-discrete;
}
dialog[open]::backdrop { opacity: 1; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(8px) scale(.97); }
  dialog[open]::backdrop { opacity: 0; }
}

/* Popover, emoji paneli, reaksiya seçicisi: kliklənən yerdən böyüyür (--origin-i place() qoyur) */
.popover, .emoji-panel, .picker { transform-origin: var(--origin, 50% 0); animation: pop-in var(--dur-base) var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: scale(.95); } }

/* Ekran dəyişməsi: söhbət, dostlar, kəşf, ayarlar, bildirişlər, otaq görünəndə yüngül qalxır */
.chat, .friends, .discover, .settings, .inbox, .room { animation: view-in var(--dur-slow) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
/* Kanal açılanda: mesajlar gələnə qədər skelet sətirlər (200 ms-dən tez gələrsə, görünmür), sonra mesajlar sönük halından açılır */
.messages.loading:empty { display: flex; flex-direction: column; justify-content: flex-end; }
.messages.loading:empty::before {
  --skel: color-mix(in srgb, var(--text) 8%, transparent);
  content: ""; flex: none; height: 232px; margin-bottom: 12px;
  background:
    radial-gradient(circle at 20px 20px, var(--skel) 19.5px, transparent 20px) 0 0 / 40px 40px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 4px / 130px 12px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 26px / min(70%, 460px) 10px no-repeat,
    radial-gradient(circle at 20px 20px, var(--skel) 19.5px, transparent 20px) 0 96px / 40px 40px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 100px / 90px 12px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 122px / min(55%, 360px) 10px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 140px / min(40%, 260px) 10px no-repeat,
    radial-gradient(circle at 20px 20px, var(--skel) 19.5px, transparent 20px) 0 192px / 40px 40px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 196px / 110px 12px no-repeat,
    linear-gradient(var(--skel) 0 0) 56px 218px / min(62%, 400px) 10px no-repeat;
  animation: skel-in var(--dur-base) var(--ease-out) 200ms both, skel-pulse 1.1s ease-in-out 400ms infinite alternate;
}
@keyframes skel-in { from { opacity: 0; } }
@keyframes skel-pulse { to { opacity: .45; } }
.messages.entering { animation: view-in var(--dur-base) var(--ease-out); }

/* Mobil: kanal siyahısı soldan, üzvlər/mövzu paneli sağdan sürüşüb gəlir */
@media (max-width: 1180px) {
  .app.right-open .right { animation: slide-from-right var(--dur-slow) var(--ease-out); }
}
@media (max-width: 760px) {
  .app.nav-open .rail, .app.nav-open .side { animation: slide-from-left var(--dur-slow) var(--ease-out); }
}
@keyframes slide-from-left { from { opacity: 0; transform: translateX(-24px); } }
@keyframes slide-from-right { from { transform: translateX(100%); } }

/* Basma hissi: düymə basılanda azca kiçilir */
.btn { transition: filter var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.square-btn { transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.rail-btn, .server-btn { transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.mini-btn { transition: filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.btn:active:not([disabled]), .square-btn:active:not(:disabled), .mini-btn:active:not(:disabled) { transform: scale(.96); }
.rail-btn:active, .server-btn:active { transform: scale(.92); }

