/* =========================================================
   Rakushka — Design Tokens
   ========================================================= */
:root {
  --bg-0: #07070d; --bg-1: #0c0c16; --bg-2: #131322;
  --glass: rgba(20,18,36,0.55);
  --glass-strong: rgba(22,20,40,0.78);
  --glass-thin: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.07);
  --glass-border-strong: rgba(255,255,255,0.12);
  --glass-hi: rgba(255,255,255,0.06);
  --fg-1: #f4f3ff; --fg-2: #c9c7e3; --fg-3: #8e8bb1; --fg-4: #5a5878;
  --primary: #8b6cff; --primary-2: #6a8bff;
  --pink: #ff7aa8; --pink-2: #ff9ec3;
  --green: #2ed47a; --red: #ff5a5a; --amber: #ffb53e;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-2xl: 32px;
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.05) inset, 0 18px 60px rgba(0,0,0,0.55);
  --shadow-glow-p: 0 12px 40px rgba(139,108,255,0.35);
  --shadow-glow-pink: 0 12px 40px rgba(255,122,168,0.30);
  --blur: 24px;
  /* legacy compat */
  --neon: #8b6cff; --neon-soft: rgba(139,108,255,0.2);
  --panel: rgba(20,18,36,0.55); --panel-border: rgba(255,255,255,0.07);
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body.dark-gaming {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--fg-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a, a:visited { color: inherit; text-decoration: none; }
a:hover, a:active { text-decoration: none !important; }

/* =========================================================
   Background stage + grain
   ========================================================= */
.bg-stage {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(800px 600px at 12% 12%, rgba(139,108,255,0.22), transparent 60%),
    radial-gradient(700px 600px at 88% 86%, rgba(255,122,168,0.16), transparent 60%),
    radial-gradient(900px 700px at 70% 20%, rgba(106,139,255,0.10), transparent 60%),
    linear-gradient(180deg, #0a0a14 0%, #06060c 100%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* =========================================================
   Navigation (pixel-perfect to design)
   ========================================================= */
.main-nav {
  position: sticky; top: 0; z-index: 1030;
  height: 64px; display: flex; align-items: center;
  padding: 0 28px; gap: 28px;
  background: linear-gradient(180deg, rgba(12,12,22,0.85), rgba(12,12,22,0.55));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  height: 40px;
  text-decoration: none; flex-shrink: 0;
}
.nav-brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  filter: drop-shadow(0 4px 10px rgba(255,90,141,0.45));
}
.nav-brand-mark img {
  width: 40px; height: 40px; object-fit: contain;
}
.nav-brand-name {
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff, #c9c7e3);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav-links-group { display: flex; gap: 4px; }
.nav-link-item {
  padding: 7px 13px; border-radius: 10px;
  color: var(--fg-2); text-decoration: none;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.15s;
  border: 1px solid transparent;
}
.nav-link-item:hover { color: #fff; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }
.nav-link-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139,108,255,0.28), rgba(139,108,255,0.14));
  border-color: rgba(139,108,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.nav-spacer { flex: 1; }

/* auth nav items */
.nav-link-custom {
  padding: 7px 13px; border-radius: 10px;
  color: var(--fg-2); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: 0.15s;
}
.nav-link-custom:hover { color: #fff; background: rgba(255,255,255,0.05); }

.btn-logout {
  padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: transparent; color: var(--fg-2);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: 0.15s;
  margin-left: 4px;
}
.btn-logout:hover { background: rgba(255,255,255,0.07); color: #fff; }

/* Bootstrap nav overrides */
.navbar-nav { flex-direction: row !important; align-items: center; gap: 4px; margin: 0 !important; padding: 0 !important; list-style: none; }
.nav-item { list-style: none; }
.ms-3 { margin-left: 4px !important; }

/* =========================================================
   Buttons
   ========================================================= */
.btn-gaming {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff; font-weight: 600; font-size: 15px; border: none;
  cursor: pointer; transition: 0.15s; text-decoration: none; font-family: inherit;
  box-shadow: 0 10px 28px rgba(139,108,255,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-gaming:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(139,108,255,0.55); color: #fff; }

.btn-gaming-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 44px; border-radius: 14px;
  background: rgba(255,255,255,0.05); color: var(--fg-1);
  border: 1px solid var(--glass-border);
  font-size: 15px; font-weight: 500; cursor: pointer; transition: 0.15s;
  text-decoration: none; font-family: inherit; backdrop-filter: blur(16px);
}
.btn-gaming-outline:hover { background: rgba(255,255,255,0.09); border-color: var(--glass-border-strong); color: #fff; }

.btn-pink-grad {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 20px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #ff8db3, #ff5a8d);
  color: #fff; font-weight: 600; font-size: 15px; border: none;
  cursor: pointer; transition: 0.15s; font-family: inherit; text-decoration: none;
  box-shadow: 0 10px 28px rgba(255,90,141,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-pink-grad:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(255,90,141,0.55); color: #fff; }

/* =========================================================
   Main content wrapper
   ========================================================= */
main { min-height: calc(100vh - 64px); }
main.py-5 { padding: 0 !important; }
main .container { max-width: 100%; padding: 0; margin: 0; }
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 0 28px 80px; }

/* =========================================================
   Landing — wrapper + Hero
   ========================================================= */
.landing-scroll { flex: 1; overflow-y: auto; }
.landing { max-width: 1280px; margin: 0 auto; padding: 0 28px 80px; }
.main-full .landing-scroll { height: calc(100vh - 64px); }

.hero, .hero-section {
  padding: 40px 0 20px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
  align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  font-size: 12px; color: var(--fg-2); margin-bottom: 24px;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(46,212,122,0.18);
}
.hero-title {
  font-size: clamp(48px, 6vw, 80px);
  line-height: 0.95; letter-spacing: -0.035em;
  font-weight: 800; margin: 0 0 22px; color: #fff;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, #ff9ec3 0%, #b69eff 50%, #6a8bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: 19px; line-height: 1.55;
  color: var(--fg-2); max-width: 520px; margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Trust stats */
.hero-trust {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 48px; padding-bottom: 60px;
}
.trust-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); transition: 0.18s;
}
.trust-item:hover { border-color: var(--glass-border-strong); transform: translateY(-2px); }
.trust-num { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.trust-num em { font-style: normal; color: var(--pink); }
.trust-lbl { font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* Hero visual */
.hero-visual {
  position: relative; min-height: 600px;
  display: flex; align-items: center; justify-content: center;
}
.hv-glow {
  position: absolute; inset: -10% -10% -10% 0;
  background:
    radial-gradient(500px 400px at 50% 40%, rgba(255,122,168,0.08), transparent 60%),
    radial-gradient(420px 360px at 60% 70%, rgba(139,108,255,0.07), transparent 65%);
  filter: blur(24px); z-index: 0; pointer-events: none;
}
.hv-shell {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.hv-shell img {
  width: 416px; height: 416px; object-fit: contain;
  filter:
    drop-shadow(0 12px 28px rgba(255,90,141,0.14))
    drop-shadow(0 0 18px rgba(139,108,255,0.08));
}
.hv-card-msg {
  position: absolute; top: 5%; left: 5%;
  width: 210px; padding: 10px 12px;
  display: flex; gap: 9px; align-items: flex-start;
  z-index: 3;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  font-size: 12px;
}
.hv-card-msg .av {
  width: 26px; height: 26px; border-radius: 50%;
  flex-shrink: 0; background: linear-gradient(135deg, #ff9ec3, #8b6cff);
}
.hv-card-msg .nm { color: var(--pink-2); font-weight: 600; font-size: 11px; }
.hv-card-msg .tx { color: var(--fg-1); font-size: 11px; line-height: 1.4; margin-top: 2px; }
.hv-card-msg .tm { color: var(--fg-4); font-size: 10px; margin-left: 5px; }

/* Footer — 4 columns horizontal */
.footer {
  border-top: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
  padding: 48px 0 60px;
  margin-top: 60px;
  color: var(--fg-3); font-size: 13px;
}
.footer .nav-brand { margin-bottom: 8px; }
.footer-col h5 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-col a {
  display: block;
  color: var(--fg-3);
  text-decoration: none;
  padding: 4px 0;
  font-size: 13px;
  transition: 0.15s;
}
.footer-col a:hover { color: #fff; }

@media (max-width: 900px) {
  .hero, .hero-section { grid-template-columns: 1fr; }
  .hero-visual { min-height: 320px; }
  .hv-shell img { width: 280px; height: 280px; }
  .footer { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* =========================================================
   Landing — Voice Demo
   ========================================================= */
.vd-section {
  padding: 60px 0 70px;
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
}
.vd-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--fg-2);
  letter-spacing: 0.04em; width: 560px; max-width: 90vw;
}
.vd-label em { font-style: normal; color: var(--fg-3); font-weight: 400; }
.vd-count {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--fg-3);
}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255,90,90,0.2);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.vd-room {
  display: flex; gap: 20px; flex-wrap: wrap;
  justify-content: center; padding: 32px 36px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  width: 560px; max-width: 90vw; position: relative;
}
.vd-person {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: default; position: relative; user-select: none;
}
.vd-av {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: rgba(0,0,0,0.5);
  position: relative; transition: box-shadow 0.2s;
}
.vd-person.speaking .vd-av {
  box-shadow: 0 0 0 3px rgba(46,212,122,0.7), 0 0 18px rgba(46,212,122,0.35);
}
.vd-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(46,212,122,0.6);
  animation: vdPulse 1.2s ease-in-out infinite;
}
@keyframes vdPulse { 0%,100% { transform:scale(1); opacity:0.8; } 50% { transform:scale(1.12); opacity:0.3; } }
.vd-name { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.vd-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: rgba(46,212,122,0.18); border: 1px solid rgba(46,212,122,0.4);
  color: #4aeaa0; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.vd-hint { font-size: 12px; color: var(--fg-4); text-align: center; }
.vd-controls { display: flex; gap: 10px; }
.vd-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 20px; height: 42px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  font-family: inherit; transition: 0.15s;
}
.vd-btn.join {
  background: linear-gradient(135deg, #5ae0a0, #2ed47a);
  color: rgba(0,0,0,0.7);
  box-shadow: 0 8px 20px rgba(46,212,122,0.3);
}
.vd-btn.join:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(46,212,122,0.4); }

/* =========================================================
   Landing — CTA Strip
   ========================================================= */
.cta-strip {
  margin: 40px 0 0;
  padding: 56px 40px;
  background: linear-gradient(135deg, rgba(139,108,255,0.18), rgba(255,122,168,0.18));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-2xl);
  display: flex; align-items: center;
  justify-content: space-between; gap: 32px;
  position: relative; overflow: hidden;
}
.cta-strip::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(500px 300px at 0% 50%, rgba(139,108,255,0.25), transparent 60%),
    radial-gradient(500px 300px at 100% 50%, rgba(255,122,168,0.25), transparent 60%);
  pointer-events: none;
}
.cta-strip-inner { position: relative; z-index: 1; }
.cta-strip h3 { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.cta-strip p { margin: 0; color: var(--fg-2); font-size: 16px; }
.cta-strip-actions { display: flex; gap: 10px; position: relative; z-index: 1; flex-shrink: 0; }

/* =========================================================
   Landing — Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; align-items: start;
  color: var(--fg-3); font-size: 13px;
  padding: 48px 0 60px; margin-top: 60px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand-logo { display: flex; align-items: center; gap: 10px; }
.footer-brand-logo img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(255,90,141,0.35)); }
.footer-brand-logo span { font-weight: 800; font-size: 15px; background: linear-gradient(180deg,#fff,#c9c7e3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer-brand p { font-size: 13px; color: var(--fg-3); line-height: 1.55; max-width: 260px; margin: 4px 0 0; }
.footer-col h5 { margin: 0 0 12px; color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-col a { display: block; color: var(--fg-3); text-decoration: none; padding: 4px 0; font-size: 13px; }
.footer-col a:hover { color: #fff; }

/* =========================================================
   Servers page
   ========================================================= */
.servers-page { max-width: 1100px; margin: 0 auto; padding: 40px 28px 80px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.page-title { font-size: 36px; font-weight: 800; letter-spacing: -0.025em; color: #fff; margin: 0 0 6px; }
.page-sub { font-size: 15px; color: var(--fg-3); margin: 0; }
.servers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.server-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  cursor: pointer; transition: 0.18s;
}
.server-card:hover { border-color: var(--glass-border-strong); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.server-icon { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; }
.server-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.server-info h3 { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 3px; }
.server-meta { display: flex; gap: 14px; font-size: 12px; color: var(--fg-3); }

.empty-state { text-align: center; padding: 80px 20px; color: var(--fg-3); }
.empty-state h3 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.empty-state p { color: var(--fg-3); margin-bottom: 24px; }

/* =========================================================
   Forms / inputs
   ========================================================= */
.form-control {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  width: 100%;
}
.form-control:focus {
  border-color: rgba(139,108,255,0.5);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.1);
  outline: none; background: rgba(255,255,255,0.06);
}

/* =========================================================
   Chat page — full width layout
   ========================================================= */
main.main-full { padding: 0 !important; height: calc(100vh - 64px); overflow: hidden; }

.channels-page {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--glass) !important;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.chat-area {
  flex: 1;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.01);
  height: 100%; overflow: hidden;
}

.chat-header {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(12,12,22,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff; font-weight: 600;
}
.chat-header span { color: var(--fg-3); }
.chat-header h3 { margin: 0; font-size: 15px; font-weight: 700; }

.messages {
  flex: 1; overflow-y: auto; padding: 20px;
  min-height: 0; background: transparent;
}
.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.message { margin-bottom: 16px; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.username { font-weight: 600; color: #fff; font-size: 14px; }
.username-me { color: var(--primary-2); }
.timestamp { font-size: 11px; color: var(--fg-4); }
.message-content { color: var(--fg-2); font-size: 14px; line-height: 1.5; }

.chat-form {
  padding: 16px 20px; flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
  display: flex; gap: 10px;
  background: rgba(12,12,22,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.chat-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  padding: 12px 16px; border-radius: 10px;
  color: #fff; font-size: 15px; font-family: inherit;
  transition: 0.15s;
}
.chat-form input:focus {
  outline: none;
  border-color: rgba(139,108,255,0.5);
  background: rgba(255,255,255,0.07);
}

.server-header {
  padding: 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
}
.server-header h2 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #fff; }
.server-back {
  display: block; font-size: 12px; color: var(--fg-3);
  text-decoration: none; margin-bottom: 8px; transition: 0.15s;
}
.server-back:hover { color: var(--fg-1); }
.server-actions { display: flex; gap: 8px; margin-top: 8px; }
.action-icon { font-size: 18px; cursor: pointer; opacity: 0.7; transition: opacity 0.15s; }
.action-icon:hover { opacity: 1; }

.channels-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.channels-list::-webkit-scrollbar { width: 4px; }
.channels-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.channels-heading {
  padding: 12px 10px 6px;
  font-size: 11px; color: var(--fg-4);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}

.channel-item {
  display: block; padding: 8px 10px;
  color: var(--fg-3); text-decoration: none;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  transition: 0.1s;
}
.channel-item:hover { background: rgba(255,255,255,0.05); color: var(--fg-1); }
.channel-item.active { background: rgba(255,255,255,0.08); color: #fff; }

.channel-actions { padding: 8px; flex-shrink: 0; }
.channel-action {
  display: block; font-size: 13px; color: var(--fg-3);
  text-decoration: none; padding: 8px 10px;
  border-radius: 8px; transition: 0.15s;
}
.channel-action:hover { background: rgba(255,255,255,0.05); color: #fff; }

.sidebar-link {
  display: block; padding: 10px 12px;
  font-size: 13px; color: var(--fg-3);
  text-decoration: none; border-radius: 8px; transition: 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff !important; }
.sidebar-link, .sidebar-link:visited, .sidebar-link:active, .sidebar-link:hover { text-decoration: none !important; }

/* Voice channel items */
.voice-channel-item { padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.voice-info { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 14px; }
.voice-icon { width: 18px; text-align: center; }
.voice-name { flex: 1; }
.voice-users-list { margin-left: 26px; font-size: 12px; color: var(--fg-4); display: flex; flex-direction: column; gap: 2px; }
.btn-join-voice {
  background: rgba(139,108,255,0.2); color: #c8b8ff;
  border: 1px solid rgba(139,108,255,0.35);
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; cursor: pointer; align-self: flex-start; margin-top: 4px;
  transition: 0.15s;
}
.btn-join-voice:hover { background: rgba(139,108,255,0.35); }

/* Voice panel (floating) */
.voice-panel {
  position: fixed; bottom: 20px; left: 20px;
  width: 260px;
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-lg);
  padding: 14px; z-index: 1000;
  box-shadow: var(--shadow-2);
}
.voice-panel.hidden { display: none; }
.voice-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: #fff; font-size: 14px; font-weight: 600; }
.btn-leave { background: transparent; color: var(--red); border: none; cursor: pointer; font-size: 18px; }
.voice-controls { display: flex; gap: 8px; margin-bottom: 10px; }
.voice-btn { flex: 1; background: rgba(255,255,255,0.05); color: var(--fg-2); border: 1px solid var(--glass-border); padding: 8px; border-radius: 8px; cursor: pointer; font-size: 12px; transition: 0.15s; }
.voice-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.voice-panel-users { display: flex; flex-direction: column; gap: 4px; }
.panel-user { background: rgba(255,255,255,0.04); padding: 6px 10px; border-radius: 6px; font-size: 12px; color: var(--fg-2); }

/* Server link wrapper */
.server-link {
  text-decoration: none; color: inherit;
  display: flex; gap: 15px; padding: 18px;
  border-radius: 16px; transition: 0.2s;
}
.server-link:hover { background: rgba(255,255,255,0.03); }
.server-card-link { text-decoration: none; color: inherit; display: block; }

/* =========================================================
   Profile page (base overrides — page has inline styles)
   ========================================================= */
.profile-page { max-width: 1000px; margin: 0 auto; padding: 40px 28px 80px; }

/* =========================================================
   Animations / utils
   ========================================================= */
.fade-in { opacity: 0; transform: translateY(30px); transition: 0.7s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-visual { min-height: 300px; }
  .hv-shell img { width: 280px; height: 280px; }
  .hv-card-msg { display: none; }
  .hero-trust { grid-template-columns: 1fr 1fr; }
  .site-footer { grid-template-columns: 1fr 1fr; gap: 24px; }
  .servers-grid { grid-template-columns: 1fr; }
  .cta-strip { flex-direction: column; text-align: center; }
  .cta-strip-actions { justify-content: center; }
  .main-nav { padding: 0 16px; }
  .nav-links-group { display: none; }
}

/* =========================================================
   Nav: search bar + auto-match + bell + avatar (right side)
   ========================================================= */
.nav-search-bar {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--fg-3);
  font-size: 13px;
  width: 260px;
  transition: 0.15s;
  flex-shrink: 0;
}
.nav-search-bar:hover, .nav-search-bar:focus-within {
  background: rgba(255,255,255,0.07);
  border-color: rgba(139,108,255,0.45);
  color: var(--fg-2);
}
.nav-search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(139,108,255,0.15);
}
.nav-search-bar > svg { flex-shrink: 0; }
.nav-search-bar > input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  font-family: inherit; font-size: 13px; color: var(--fg-1);
  padding: 0; margin: 0; height: 100%;
}
.nav-search-bar > input::placeholder { color: var(--fg-3); }
.nav-search-bar > input::-webkit-search-cancel-button { display: none; }
.nav-search-bar kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-3);
  flex-shrink: 0;
}

.nav-match {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,122,168,0.18), rgba(139,108,255,0.18));
  border: 1px solid rgba(255,122,168,0.32);
  color: #ffd0e1;
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.15s;
  font-family: inherit;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-match svg { width: 14px; height: 14px; flex-shrink: 0; }
.nav-match:hover {
  background: linear-gradient(135deg, rgba(255,122,168,0.32), rgba(139,108,255,0.32));
  border-color: rgba(255,122,168,0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255,122,168,0.25);
}

.nav-bell {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}
.nav-bell:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: var(--glass-border-strong); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff; font-weight: 600; font-size: 13px;
  border: none; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(139,108,255,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: 0.15s;
  flex-shrink: 0;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(139,108,255,0.5); color: #fff; }

.nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9ec3, #8b6cff);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  cursor: pointer; text-decoration: none;
  border: 2px solid rgba(255,255,255,0.08);
  transition: 0.15s;
  flex-shrink: 0;
}
.nav-avatar:hover { border-color: rgba(255,255,255,0.28); transform: scale(1.06); color: #fff; }

/* =========================================================
   Rakushka icon sprite v3 (лавандовое серебро + фиолет)
   Defs/symbols в Pages/Shared/_RakushkaIcons.cshtml
   ========================================================= */
.rkic {
  width: 18px; height: 18px;
  display: inline-block; flex-shrink: 0;
  vertical-align: middle;
  filter: url(#rk-glow);
}
.rkic-sm { width: 14px; height: 14px; }
.rkic-md { width: 18px; height: 18px; }
.rkic-lg { width: 22px; height: 22px; }
.rkic-xl { width: 28px; height: 28px; }

/* =========================================================
   Shared btn classes (design system)
   ========================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; height: 44px; border-radius: 12px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: .15s; text-decoration: none; font-family: inherit; line-height: 1; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg,#a98aff,#8b6cff);
  color: #fff;
  box-shadow: 0 10px 26px rgba(139,108,255,.4), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 34px rgba(139,108,255,.5), inset 0 1px 0 rgba(255,255,255,.22); }

.btn-pink { background: linear-gradient(135deg,#ff8db3,#ff5a8d); color: #fff; box-shadow: 0 10px 28px rgba(255,90,141,.4), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-pink:hover { color: #fff; box-shadow: 0 16px 36px rgba(255,90,141,.55), inset 0 1px 0 rgba(255,255,255,.22); }

.btn-ghost { background: rgba(255,255,255,.05); color: var(--fg-1, rgba(255,255,255,.9)); border-color: rgba(255,255,255,.08); }
.btn-ghost:hover { background: rgba(255,255,255,.09); color: #fff; border-color: rgba(255,255,255,.14); }

.btn-danger { background: rgba(255,90,108,.12); color: #ff97a5; border-color: rgba(255,90,108,.32); }
.btn-danger:hover { background: rgba(255,90,108,.22); color: #fff; border-color: rgba(255,90,108,.55); }

/* =========================================================
   Page layout helpers
   ========================================================= */
.page-scroll { overflow-y: auto; padding: 40px 28px 80px; max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.page-title { font-size: 32px; font-weight: 800; letter-spacing: -.025em; color: #fff; margin: 0 0 6px; }
.page-sub { font-size: 14px; color: rgba(255,255,255,.4); margin: 0; }

/* =========================================================
   Servers page — new card style
   ========================================================= */
.servers-grid-v2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.server-card-big { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; cursor: pointer; transition: .18s; }
.server-card-big:hover { border-color: rgba(255,255,255,.14); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.scb-icon { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: rgba(0,0,0,.5); }
.scb-info { flex: 1; min-width: 0; }
.scb-name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.scb-desc { font-size: 13px; color: rgba(255,255,255,.4); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scb-meta { display: flex; gap: 14px; font-size: 12px; color: rgba(255,255,255,.4); }
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ed47a; margin-right: 4px; vertical-align: middle; }
.scb-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); cursor: pointer; transition: .15s; font-family: inherit; text-decoration: none; }
.scb-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.scb-btn.joined { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); color: #c4b5fd; }
.scb-create-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; height: 40px; border-radius: 10px; background: linear-gradient(135deg,#ff8db3,#ff5a8d); color: #fff; font-weight: 600; font-size: 13px; border: none; cursor: pointer; text-decoration: none; transition: .15s; }
.scb-create-btn:hover { transform: translateY(-1px); color: #fff; opacity: .9; }

/* =========================================================
   Nav: avatar button + logout icon
   ========================================================= */
.nav-av-btn { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#ff9ec3,#8b6cff); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; border: 2px solid rgba(255,255,255,.12); text-decoration: none; transition: .15s; flex-shrink: 0; }
.nav-av-btn:hover { border-color: rgba(255,255,255,.28); transform: scale(1.06); color: #fff; }
.nav-logout-icon { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: rgba(255,255,255,.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .12s; padding: 0; }
.nav-logout-icon:hover { background: rgba(255,90,90,.15); color: #ff7070; }

/* =========================================================
   Auto-match overlay
   ========================================================= */
.match-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(7,7,13,.88); backdrop-filter: blur(14px); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.match-overlay.visible { display: flex; }
.match-overlay img { width: 120px; height: 120px; animation: matchPulse 1.2s ease-in-out infinite; }
@keyframes matchPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.match-overlay h3 { color: #fff; font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.match-overlay p { color: rgba(255,255,255,.45); margin: 0; font-size: 14px; }

/* =========================================================
   Avatar gradients
   ========================================================= */
.av-grad-1 { background: linear-gradient(135deg,#ff9ec3,#d33d80); }
.av-grad-2 { background: linear-gradient(135deg,#7be0a9,#2ed47a); }
.av-grad-3 { background: linear-gradient(135deg,#8de4ff,#5a8dff); }
.av-grad-4 { background: linear-gradient(135deg,#c79bff,#8b6cff); }
.av-grad-5 { background: linear-gradient(135deg,#ffd28a,#ff8a5a); }
.av-grad-6 { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.av-grad-7 { background: linear-gradient(135deg,#ffd9e0,#ff7aa8); }

/* =========================================================
   4-Panel Discord-like chat layout (design v2)
   ========================================================= */
.chat-4panel {
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "rail rail" "main members";
  height: calc(100vh - 64px);
  overflow: hidden;
  background: var(--bg-1, #0c0c16);
}

/* --- Channel tabs strip (top) --- */
.ch-strip {
  grid-area: rail;
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid rgba(255,255,255,.07);
  overflow-x: auto; overflow-y: hidden;
  height: 48px; flex-shrink: 0;
}
.ch-strip::-webkit-scrollbar { display: none; }

.ch-tab-home {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4); text-decoration: none;
  border: 1px solid transparent; transition: .15s;
}
.ch-tab-home:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.1); }

.ch-strip-sep { width: 1px; height: 22px; background: rgba(255,255,255,.1); flex-shrink: 0; margin: 0 6px; }

.ch-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 34px;
  border-radius: 8px; border: 1px solid transparent;
  color: rgba(255,255,255,.38); font-size: 13px; font-weight: 500;
  text-decoration: none; flex-shrink: 0; white-space: nowrap;
  transition: .15s;
}
.ch-tab:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.75); }
.ch-tab.active { background: rgba(139,92,246,.18); color: #c4b5fd; border-color: rgba(139,92,246,.35); }
.ch-tab svg { flex-shrink: 0; }

/* Colored channel tabs by type */
.ch-tab.text-channel { color: rgba(167,139,250,.72); background: rgba(99,102,241,.09); border-color: rgba(99,102,241,.18); }
.ch-tab.text-channel:hover { background: rgba(99,102,241,.16); color: rgba(196,181,253,.9); border-color: rgba(99,102,241,.28); }
.ch-tab.text-channel.active { background: rgba(139,92,246,.22); color: #c4b5fd; border-color: rgba(139,92,246,.48); }
.ch-tab.voice-channel { color: rgba(110,231,183,.72); background: rgba(16,185,129,.09); border-color: rgba(16,185,129,.18); }
.ch-tab.voice-channel:hover { background: rgba(16,185,129,.16); color: rgba(110,231,183,.9); border-color: rgba(16,185,129,.28); }
.ch-tab.voice-channel.active { background: rgba(16,185,129,.22); color: #6ee7b7; border-color: rgba(16,185,129,.48); }

/* --- Voice room (main area when a voice channel is selected) --- */
.voice-room { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 32px 24px; overflow-y: auto; }
.voice-users-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-content: flex-start; width: 100%; }
.voice-empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; color: rgba(255,255,255,.28); font-size: 13px; text-align: center; padding: 40px 0; width: 100%; }
.voice-user-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vut-av { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg,#8b6cff,#6a8bff); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #fff; border: 3px solid rgba(139,92,246,.35); box-shadow: 0 0 24px rgba(139,92,246,.18); }
.vut-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.65); max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.voice-footer { padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: center; flex-shrink: 0; }
.voice-join-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 28px; background: rgba(16,185,129,.13); border: 1px solid rgba(16,185,129,.32); color: #6ee7b7; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.voice-join-btn:hover { background: rgba(16,185,129,.22); border-color: rgba(16,185,129,.52); color: #a7f3d0; }

/* --- Horizontal server rail (top) --- */
.srv-rail-h {
  grid-area: rail;
  background: rgba(255,255,255,.025);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; overflow-y: hidden; flex-shrink: 0;
}
.srv-rail-h::-webkit-scrollbar { display: none; }
.srv-item {
  position: relative;
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.55); font-weight: 700; font-size: 14px;
  cursor: pointer; flex-shrink: 0; text-decoration: none;
  transition: .18s;
  overflow: hidden;
}
.srv-item img { width: 100%; height: 100%; object-fit: contain; }
.srv-item:hover { border-radius: 10px; background: rgba(139,92,246,.2); color: #fff; }
.srv-item.active { border-radius: 10px; background: linear-gradient(135deg,#9b7dff,#6a8bff); color: #fff; box-shadow: 0 8px 20px rgba(139,108,255,.35); }
.srv-item-tip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #111; color: #fff; padding: 5px 9px; font-size: 11px; font-weight: 600; border-radius: 6px; opacity: 0; pointer-events: none; transition: .15s; z-index: 50; }
.srv-item:hover .srv-item-tip { opacity: 1; }
.srv-divider { width: 24px; height: 2px; background: rgba(255,255,255,.1); border-radius: 1px; flex-shrink: 0; }
.srv-add { background: rgba(46,212,122,.1) !important; color: #2ed47a !important; font-size: 20px; }
.srv-add:hover { background: #2ed47a !important; color: #fff !important; border-radius: 50% !important; }

/* --- Channels sidebar (right column) --- */
.ch-sidebar {
  grid-area: panel;
  background: rgba(255,255,255,.03);
  border-left: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; overflow: hidden;
}
.ch-sidebar-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between;
}
.ch-sidebar-head h2 {
  font-size: 15px; font-weight: 700; color: #fff; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-back-link {
  font-size: 11px; color: rgba(255,255,255,.4); text-decoration: none;
  transition: color .15s;
}
.ch-back-link:hover { color: rgba(255,255,255,.7); }

.ch-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.ch-body::-webkit-scrollbar { width: 4px; }
.ch-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.ch-category { padding: 16px 10px 4px; }
.ch-cat-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  display: flex; align-items: center; gap: 4px; cursor: default;
}

.ch-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 6px; margin: 1px 6px;
  color: rgba(255,255,255,.45); font-size: 14px;
  text-decoration: none; cursor: pointer;
  transition: background .12s, color .12s;
}
.ch-row:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.75); }
.ch-row.active { background: rgba(139,92,246,.2); color: #c4b5fd; }
.ch-row svg { flex-shrink: 0; opacity: .6; }
.ch-row.active svg { opacity: 1; }

.ch-voice-users { margin-left: 32px; }
.ch-voice-user {
  font-size: 11px; color: rgba(255,255,255,.4); padding: 2px 0;
  display: flex; align-items: center; gap: 6px;
}
.ch-voice-user::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #23a55a; border-radius: 50%; }

.ch-add-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: rgba(255,255,255,.3); padding: 8px 18px;
  text-decoration: none; transition: color .15s;
}
.ch-add-link:hover { color: rgba(255,255,255,.6); }

/* Me-bar (bottom of sidebar) */
.me-bar {
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 8px;
}
.me-bar-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#8b5cf6,#ec4899);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.me-bar-name { flex: 1; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-bar-btns { display: flex; gap: 2px; }
.me-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; color: rgba(255,255,255,.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.me-btn:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }

/* --- Chat main --- */
.chat-main-panel {
  grid-area: main;
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-top {
  padding: 0 16px;
  height: 48px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.chat-top-icon { color: rgba(255,255,255,.4); }
.chat-top-name { font-size: 15px; font-weight: 700; color: #fff; }
.chat-top-desc { font-size: 12px; color: rgba(255,255,255,.35); margin-left: 8px; }

.msgs-area {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.msgs-area::-webkit-scrollbar { width: 4px; }
.msgs-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.msg-item { padding: 4px 8px; border-radius: 4px; transition: background .1s; }
.msg-item:hover { background: rgba(255,255,255,.03); }
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-author { font-size: 14px; font-weight: 600; color: #c4b5fd; }
.msg-time { font-size: 11px; color: rgba(255,255,255,.25); }
.msg-body { font-size: 14px; color: rgba(255,255,255,.8); line-height: 1.5; word-break: break-word; }

/* Composer */
.composer-area {
  padding: 0 16px 16px;
  grid-column: 2;
}
.composer-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 10px 14px;
  transition: border-color .2s;
}
.composer-box:focus-within { border-color: rgba(139,92,246,.5); }
.composer-field {
  flex: 1; background: transparent; border: none; outline: none;
  color: rgba(255,255,255,.9); font-size: 14px; font-family: inherit;
}
.composer-field::placeholder { color: rgba(255,255,255,.3); }
.composer-send-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: linear-gradient(135deg,#8b5cf6,#ec4899);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.composer-send-btn:hover { opacity: .85; }

/* --- Composer (inside chat-main-panel) --- */
.composer-area { padding: 0 16px 16px; }

/* --- Members panel --- */
.mb-sidebar {
  grid-area: members;
  background: rgba(255,255,255,.02);
  border-left: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; overflow: hidden;
}
.mb-head {
  padding: 16px 14px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.mb-list { flex: 1; overflow-y: auto; padding: 8px 6px; }
.mb-list::-webkit-scrollbar { width: 4px; }
.mb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.mb-member {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px;
  transition: background .12s; cursor: default;
}
.mb-member:hover { background: rgba(255,255,255,.05); }
.mb-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
  position: relative;
}
.mb-av-online::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; background: #23a55a;
  border-radius: 50%; border: 2px solid var(--bg-1, #0c0c16);
}
.mb-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Voice channel — video call UI
   ========================================================= */
.vc-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; color: rgba(255,255,255,.38); font-size: 14px; text-align: center; padding: 40px;
}
.vc-empty svg { opacity: .28; }
.vc-join-btn {
  margin-top: 10px; padding: 13px 36px;
  background: linear-gradient(135deg,#8b6cff,#6a8bff);
  color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: .18s; box-shadow: 0 8px 24px rgba(139,92,246,.28);
}
.vc-join-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(139,92,246,.45); }

.vc-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  justify-content: center;
  gap: 8px; padding: 12px;
  overflow-y: auto; align-content: start;
}
.vc-grid::-webkit-scrollbar { width: 4px; }
.vc-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.vc-tile {
  position: relative; aspect-ratio: 16/9;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.vc-tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.vc-tile-av {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg,#8b6cff,#6a8bff);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; z-index: 1; flex-shrink: 0;
}
.vc-tile-name {
  position: absolute; bottom: 8px; left: 10px; z-index: 2;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.52); backdrop-filter: blur(6px);
  padding: 3px 9px; border-radius: 6px; max-width: calc(100% - 20px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-tile-muted {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(239,68,68,.75); display: none;
  align-items: center; justify-content: center;
}
.vc-tile-muted.on { display: flex; }

.vc-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 20px; flex-shrink: 0;
  background: rgba(0,0,0,.22);
  border-top: 1px solid rgba(255,255,255,.06);
}
.vc-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 16px; min-width: 68px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.75);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: .15s;
}
.vc-btn:hover { background: rgba(255,255,255,.13); color: #fff; }
.vc-btn.off { background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.vc-btn.off:hover { background: rgba(239,68,68,.26); color: #fecaca; }
.vc-btn.on { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.vc-btn.on:hover { background: rgba(16,185,129,.26); color: #a7f3d0; }
.vc-btn.leave { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.35); color: #fca5a5; }
.vc-btn.leave:hover { background: rgba(239,68,68,.32); color: #fecaca; }

/* Tile cursor */
.vc-tile { cursor: zoom-in; }
.vc-tile:hover { border-color: rgba(255,255,255,.18); }

/* Add channel button in ch-strip (admin only) */
.ch-add-channel-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px; height: 30px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.55);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s;
  text-decoration: none; margin-left: auto;
}
.ch-add-channel-btn:hover { background: rgba(255,255,255,.11); color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.2); }

/* Invite button in ch-strip */
.ch-invite-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 30px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid rgba(139,92,246,.3);
  background: rgba(139,92,246,.1); color: rgba(196,181,253,.8);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s;
}
.ch-invite-btn:hover { background: rgba(139,92,246,.2); color: #c4b5fd; border-color: rgba(139,92,246,.5); }

/* Server join (invite input) */
.srv-join-wrap {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 0 10px; height: 40px;
}
.srv-join-input {
  background: none; border: none; outline: none;
  color: #fff; font-size: 13px; font-weight: 500; width: 180px;
}
.srv-join-input::placeholder { color: rgba(255,255,255,.3); }
.srv-join-btn {
  background: rgba(139,92,246,.2); border: 1px solid rgba(139,92,246,.35);
  color: #c4b5fd; border-radius: 7px; padding: 4px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s;
}
.srv-join-btn:hover { background: rgba(139,92,246,.35); color: #fff; }

/* =========================================================
   Landing — Rakushka.html design (Index.cshtml markup)
   Hero (.hero-split) + Features (.feature-block)
   ========================================================= */
.hero-split {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 28px 32px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: center;
  position: relative;
}
.hero-split::before {
  content: '';
  position: absolute; inset: -20% -10% 0 -10%;
  background:
    radial-gradient(500px 400px at 30% 40%, rgba(255,122,168,0.10), transparent 60%),
    radial-gradient(420px 360px at 80% 60%, rgba(139,108,255,0.10), transparent 65%);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
}

.hero-left { display: flex; flex-direction: column; }
.hero-left .hero-title {
  font-size: clamp(56px, 7vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 900;
  margin: 0 0 18px;
  background: linear-gradient(120deg, #fff 0%, #ff9ec3 35%, #b69eff 65%, #6a8bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-transform: uppercase;
}

.hero-subtext {
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 540px;
  margin: 0;
}

.hero-right {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 520px;
}
.hero-right::before {
  content: '';
  position: absolute;
  width: 110%; height: 110%;
  background:
    radial-gradient(closest-side, rgba(255,122,168,0.18), transparent 70%),
    radial-gradient(closest-side at 60% 40%, rgba(139,108,255,0.16), transparent 70%);
  filter: blur(40px);
  z-index: 0;
}
.hero-image {
  position: relative; z-index: 1;
  width: clamp(280px, 36vw, 460px);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 36px rgba(255,90,141,0.22))
    drop-shadow(0 0 24px rgba(139,108,255,0.18));
  animation: shellFloat 6s ease-in-out infinite;
}
@keyframes shellFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Features stack */
.features {
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 0 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feature-block {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 32px;
  padding: 36px 40px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: 0.22s;
}
.feature-block:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-2);
}
.feature-block::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 85% -20%, rgba(139,108,255,0.18), transparent 70%);
  pointer-events: none;
}
.feature-block.reverse { grid-template-columns: 1fr 1.1fr; }
.feature-block.reverse .feature-text { order: 2; }
.feature-block.reverse .feature-image { order: 1; }
.feature-block.reverse::before {
  background: radial-gradient(600px 300px at 15% -20%, rgba(255,122,168,0.18), transparent 70%);
}

.feature-text { position: relative; z-index: 1; }
.feature-text h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 12px;
  color: #fff;
}
.feature-text p {
  font-size: 17px;
  color: var(--fg-2);
  margin: 0;
  line-height: 1.5;
}

.feature-image {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
}
.feature-image img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--r-lg);
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.35));
}

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; padding: 32px 18px 16px; }
  .hero-right { min-height: 280px; }
  .hero-image { width: 240px; }
  .feature-block, .feature-block.reverse {
    grid-template-columns: 1fr;
    padding: 26px 22px;
    gap: 18px;
  }
  .feature-block.reverse .feature-text { order: 1; }
  .feature-block.reverse .feature-image { order: 2; }
}

/* =========================================================
   Servers page polish (Pages/Servers/Index.cshtml)
   ========================================================= */
.servers-page { max-width: 1100px; margin: 0 auto; padding: 40px 28px 80px; }
.servers-page .page-header { margin-bottom: 32px; flex-direction: column; align-items: flex-start; }
.servers-page .header-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.servers-page .servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.servers-page .server-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px; align-items: center;
  padding: 18px 22px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: 0.18s;
  box-shadow: var(--shadow-1);
}
.servers-page .server-card:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  background: rgba(20,18,36,0.7);
}
.servers-page .server-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(139,108,255,0.25), rgba(255,122,168,0.15));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
}
.servers-page .server-avatar {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 16px;
}
.servers-page .server-info { min-width: 0; }
.servers-page .server-info h3 {
  font-size: 16px; font-weight: 700; color: #fff;
  margin: 0 0 6px; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.servers-page .server-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--fg-3);
}
.servers-page .badge-public {
  background: rgba(46,212,122,0.15);
  color: #4aeaa0;
  border: 1px solid rgba(46,212,122,0.32);
  font-size: 11px; padding: 2px 8px;
  border-radius: 999px; font-weight: 600;
}

.servers-page .empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--fg-3);
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border: 1px dashed var(--glass-border-strong);
  border-radius: var(--r-2xl);
}
.servers-page .empty-state h3 {
  color: #fff; font-size: 22px;
  margin: 0 0 8px; font-weight: 800; letter-spacing: -0.02em;
}
.servers-page .empty-state p { margin: 0 0 24px; }

/* =========================================================
   Channels page polish (Pages/Channels/Index.cshtml)
   Two-column layout: sidebar + chat area
   ========================================================= */
.channels-page {
  display: flex;
  height: calc(100vh - 64px);
  background:
    radial-gradient(900px 600px at 18% 8%, rgba(139,108,255,0.10), transparent 60%),
    radial-gradient(800px 600px at 90% 92%, rgba(255,122,168,0.07), transparent 60%);
}

.channels-page .sidebar {
  width: 260px; flex-shrink: 0;
  background: rgba(12,12,22,0.55);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.channels-page .server-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(139,108,255,0.10), transparent 80%);
}
.channels-page .server-header h2 {
  margin: 0 0 2px;
  font-size: 16px; font-weight: 700; color: #fff;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.channels-page .server-back {
  display: inline-block;
  font-size: 11px; color: var(--fg-3);
  text-decoration: none; margin-bottom: 8px;
  transition: 0.15s;
}
.channels-page .server-back:hover { color: var(--fg-1); }
.channels-page .server-actions { display: flex; gap: 6px; margin-top: 10px; }
.channels-page .action-icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  font-size: 14px;
  opacity: 0.85;
  transition: 0.15s;
  text-decoration: none;
}
.channels-page .action-icon:hover {
  opacity: 1; background: rgba(139,108,255,0.18);
  border-color: rgba(139,108,255,0.32);
  transform: translateY(-1px);
}

.channels-page .channels-list {
  flex: 1; overflow-y: auto;
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.channels-page .channels-heading {
  padding: 14px 10px 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-3);
  display: flex; align-items: center; gap: 6px;
}

.channels-page .channel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  color: var(--fg-3);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  margin: 1px 4px;
  transition: 0.12s;
  position: relative;
}
.channels-page .channel-item .ch-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.channels-page .channel-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--fg-1);
}
.channels-page .channel-item:hover .ch-ico { opacity: 1; }
.channels-page .channel-item.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.22), rgba(139,108,255,0.10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(139,108,255,0.32);
}
.channels-page .channel-item.active .ch-ico { opacity: 1; color: #c4b5fd; }

.channels-page .voice-channel-item {
  margin: 1px 4px;
  padding: 0;
  border-radius: 8px;
  transition: 0.12s;
}
.channels-page .voice-channel-item:hover { background: rgba(255,255,255,0.04); }
.channels-page .voice-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg-3);
  font-weight: 500;
}
.channels-page .voice-info .ch-ico { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.channels-page .voice-info:hover { color: var(--fg-1); }
.channels-page .voice-name { flex: 1; }
.channels-page .voice-users-list {
  padding: 0 12px 6px 36px;
  font-size: 12px;
  color: var(--fg-4);
  display: flex; flex-direction: column; gap: 3px;
}
.channels-page .voice-users-list:empty { display: none; }

.channels-page .channel-actions {
  padding: 8px;
  border-top: 1px solid var(--glass-border);
}
.channels-page .channel-action {
  display: block;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--fg-3);
  text-decoration: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--glass-border);
  text-align: center;
  transition: 0.15s;
}
.channels-page .channel-action:hover {
  background: rgba(139,108,255,0.12);
  border-color: rgba(139,108,255,0.3);
  color: #c4b5fd;
}

/* Voice mini status bar (bottom of sidebar) */
.voice-status-bar {
  margin: 8px;
  padding: 10px 12px;
  background: rgba(46,212,122,0.10);
  border: 1px solid rgba(46,212,122,0.28);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.voice-status-bar.hidden { display: none; }
.voice-status-info { min-width: 0; flex: 1; }
.voice-status-title {
  display: flex; align-items: center; gap: 6px;
  color: #4aeaa0;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.voice-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46,212,122,0.25);
  animation: livePulse 1.5s ease-in-out infinite;
}
.voice-status-channel {
  font-size: 12px; color: var(--fg-2); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-btn-leave-mini {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255,90,90,0.18);
  border: 1px solid rgba(255,90,90,0.32);
  color: #ff7070;
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
  flex-shrink: 0;
}
.vc-btn-leave-mini:hover { background: rgba(255,90,90,0.32); color: #fff; }
.vc-btn-leave-mini svg { width: 14px; height: 14px; }

/* Chat area in channels-page */
.channels-page .chat-area {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.005);
  overflow: hidden;
}

.channels-page .chat-header {
  height: 52px; flex-shrink: 0;
  padding: 0 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(12,12,22,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.channels-page .chat-header .ch-ico-lg { width: 22px; height: 22px; color: var(--fg-3); }
.channels-page .chat-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }

.channels-page .messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px 22px;
  background: transparent;
}
.channels-page .message { margin-bottom: 14px; padding: 4px 0; border-radius: 6px; }
.channels-page .message:hover { background: rgba(255,255,255,0.02); }
.channels-page .message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.channels-page .username { font-size: 14px; font-weight: 700; color: #c4b5fd; }
.channels-page .username-me { color: var(--pink-2); }
.channels-page .timestamp { font-size: 11px; color: var(--fg-4); }
.channels-page .message-content { color: var(--fg-1); font-size: 14px; line-height: 1.5; word-break: break-word; }

.channels-page .chat-form {
  flex-shrink: 0;
  padding: 14px 22px 18px;
  display: flex; gap: 10px; align-items: center;
  border-top: 1px solid var(--glass-border);
  background: rgba(12,12,22,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.channels-page .chat-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 11px 16px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}
.channels-page .chat-form input:focus {
  border-color: rgba(139,108,255,0.5);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.1);
  background: rgba(255,255,255,0.07);
}
.channels-page .chat-form .btn-gaming { height: 42px; padding: 0 18px; font-size: 14px; }

/* Voice stage (when voice channel is selected) */
.voice-stage { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.voice-stage.hidden { display: none; }
.voice-stage .voice-chat-header { display: flex; align-items: center; gap: 10px; }
.voice-header-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg-3);
  margin-left: 8px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}
.voice-header-count.hidden { display: none; }
.voice-header-count .ic-14 { width: 13px; height: 13px; }
.voice-header-spacer { flex: 1; }

.voice-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  color: var(--fg-3);
  text-align: center;
}
.voice-empty.hidden { display: none; }
.voice-empty-icon {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(139,108,255,0.16), rgba(255,122,168,0.10));
  border: 1px solid var(--glass-border);
  color: var(--primary);
  margin-bottom: 6px;
}
.voice-empty h3 { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.voice-empty p { margin: 0; font-size: 14px; max-width: 320px; line-height: 1.5; }

/* Video grid (when participants are present) */
.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  align-content: start;
}
.video-grid.hidden { display: none; }

/* Zoom-style control bar */
.voice-controls-bar {
  flex-shrink: 0;
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: rgba(12,12,22,0.6);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.voice-controls-bar.hidden { display: none; }
.zc-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 68px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 600;
  transition: 0.15s;
}
.zc-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.zc-btn.muted, .zc-btn.off { background: rgba(255,90,90,0.16); border-color: rgba(255,90,90,0.3); color: #ff9999; }
.zc-btn.muted:hover, .zc-btn.off:hover { background: rgba(255,90,90,0.26); color: #fff; }
.zc-btn.on { background: rgba(46,212,122,0.16); border-color: rgba(46,212,122,0.3); color: #4aeaa0; }
.zc-btn.on:hover { background: rgba(46,212,122,0.26); color: #fff; }
.zc-btn.zc-btn-leave {
  background: linear-gradient(135deg, #ff6b6b, #d33d3d);
  color: #fff; border: none;
  box-shadow: 0 6px 18px rgba(255,90,90,0.32);
}
.zc-btn.zc-btn-leave:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255,90,90,0.45); }
.zc-icon-wrap { width: 22px; height: 22px; display: grid; place-items: center; }
.zc-icon { width: 20px; height: 20px; }
.zc-icon-off { display: none; }
.zc-btn.muted .zc-icon-on, .zc-btn.off .zc-icon-on { display: none; }
.zc-btn.muted .zc-icon-off, .zc-btn.off .zc-icon-off { display: block; }
.zc-divider { width: 1px; height: 28px; background: var(--glass-border); margin: 0 4px; }
.ic-14 { width: 14px; height: 14px; }

/* Tile in video-grid */
.video-grid .video-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.video-grid .video-tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.video-grid .video-tile .vt-av {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b6cff, #6a8bff);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 26px;
  z-index: 1;
}
.video-grid .video-tile .vt-name {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  padding: 3px 9px;
  border-radius: 6px;
  color: #fff; font-size: 12px; font-weight: 600;
  z-index: 2;
  max-width: calc(100% - 20px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.video-grid .video-tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 18px rgba(46,212,122,0.35); }

/* Channels page mobile */
@media (max-width: 700px) {
  .channels-page { flex-direction: column; height: auto; min-height: calc(100vh - 64px); }
  .channels-page .sidebar { width: 100%; max-height: 240px; border-right: none; border-bottom: 1px solid var(--glass-border); }
}

/* =========================================================
   3-Panel Chat layout (Rakushka.html design)
   ========================================================= */
.chat {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px 260px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "rail rail rail"
    "main channels members";
  height: calc(100vh - 64px);
  min-height: 0;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}
.chat .servers { grid-area: rail; }
.chat .channels { grid-area: channels; min-width: 0; }
.chat .chat-main { grid-area: main; min-width: 0; min-height: 0; }
.chat .members { grid-area: members; }

/* Server rail — top */
.chat .servers {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 10px 16px;
  display: flex; flex-direction: row;
  align-items: center;
  gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  max-height: 76px;
}
.chat .servers::-webkit-scrollbar { display: none; }

.srv-pill {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: 0.18s cubic-bezier(.2,.8,.3,1.2);
  color: var(--fg-2);
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.srv-pill img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.srv-pill:hover { border-radius: 14px; background: rgba(139,108,255,0.18); color: #fff; }
.srv-pill.active {
  border-radius: 14px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff;
  box-shadow: var(--shadow-glow-p);
}
.srv-pill .srv-tip {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #111;
  color: #fff;
  padding: 5px 9px;
  font-size: 11px; font-weight: 600;
  border-radius: 6px;
  opacity: 0; pointer-events: none;
  transition: 0.15s;
  z-index: 50;
}
.srv-pill:hover .srv-tip { opacity: 1; }
.srv-add {
  width: 48px; height: 48px; border-radius: 16px;
  background: rgba(46,212,122,0.12);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(46,212,122,0.3);
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  text-decoration: none;
  font-size: 22px; font-weight: 700;
  transition: 0.18s;
}
.srv-add:hover { background: var(--green); color: #fff; }

/* Channels panel */
.chat .channels {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.channels-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
  cursor: default;
  flex-shrink: 0;
}
.channels-head .row { display: flex; align-items: center; justify-content: space-between; }
.channels-head h2 {
  margin: 0; font-size: 16px; font-weight: 700;
  color: #fff; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.channels-head .back {
  font-size: 11px; color: var(--fg-3); text-decoration: none;
  display: block; margin-bottom: 6px; transition: 0.15s;
}
.channels-head .back:hover { color: var(--fg-1); }
.channels-head .members-mini {
  font-size: 11px; color: var(--fg-3);
  margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.channels-head .members-mini .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46,212,122,0.18);
}
.channels-list {
  flex: 1; min-width: 0; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 10px 8px 12px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.channels-list::-webkit-scrollbar { width: 6px; }
.channels-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 10px 6px;
  font-size: 11px; font-weight: 700;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ch {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  margin: 1px 4px;
  border-radius: 8px;
  color: var(--fg-3);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: 0.1s;
}
.ch:hover { background: rgba(255,255,255,0.04); color: var(--fg-1); }
.ch.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.22), rgba(139,108,255,0.10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(139,108,255,0.32), inset 2px 0 0 var(--primary);
}
.ch svg { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.ch.active svg { opacity: 1; color: #c4b5fd; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ch-voice-users {
  padding: 0 12px 6px 36px;
  font-size: 12px; color: var(--fg-4);
  display: flex; flex-direction: column; gap: 3px;
}
.ch-voice-users:empty { display: none; }
.ch-voice-user {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0;
  color: var(--fg-3);
}
.ch-voice-user::before {
  content: ''; width: 6px; height: 6px;
  background: var(--green); border-radius: 50%;
}

.channels-foot {
  padding: 10px;
  border-top: 1px solid var(--glass-border);
}
.channels-foot .add-channel-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--glass-border-strong);
  border-radius: 10px;
  font-size: 12px; color: var(--fg-3);
  text-decoration: none;
  transition: 0.15s;
}
.channels-foot .add-channel-btn:hover {
  background: rgba(139,108,255,0.12);
  border-color: rgba(139,108,255,0.3);
  color: #c4b5fd;
}

/* Voice mini-status */
.voice-mini {
  margin: 8px 10px;
  padding: 10px 12px;
  background: rgba(46,212,122,0.10);
  border: 1px solid rgba(46,212,122,0.28);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.voice-mini.hidden { display: none; }
.voice-mini-title {
  display: flex; align-items: center; gap: 6px;
  color: #4aeaa0;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.voice-mini-title::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46,212,122,0.25);
  animation: livePulse 1.5s ease-in-out infinite;
}
.voice-mini-channel {
  font-size: 12px; color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voice-mini-leave {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,90,90,0.18);
  border: 1px solid rgba(255,90,90,0.32);
  color: #ff7070;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.15s;
}
.voice-mini-leave:hover { background: rgba(255,90,90,0.32); color: #fff; }
.voice-mini-leave svg { width: 14px; height: 14px; }

/* Main chat */
.chat .chat-main {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}
.chat-head {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 18px;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(139,108,255,0.06), transparent);
}
.chat-head-title { display: flex; align-items: center; gap: 10px; }
.chat-head-title svg { width: 18px; height: 18px; color: var(--fg-3); }
.chat-head-title h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.chat-head-topic { color: var(--fg-3); font-size: 13px; font-weight: 500; margin-left: 6px; }
.chat-head-spacer { flex: 1; }
.chat-head-actions { display: flex; gap: 4px; }

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 8px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.messages-area::-webkit-scrollbar { width: 8px; }
.messages-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

.msg {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 5px 18px;
  position: relative;
}
.msg:hover { background: rgba(255,255,255,0.02); }
.msg-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-author { font-size: 15px; font-weight: 600; color: var(--fg-1); }
.msg-author.me { color: var(--pink-2); }
.msg-time { font-size: 11px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.msg-body { font-size: 15px; line-height: 1.45; color: var(--fg-1); word-wrap: break-word; }

.composer-wrap {
  flex-shrink: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--glass-border);
}
.composer-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  transition: 0.15s;
}
.composer-box:focus-within {
  border-color: rgba(139,108,255,0.5);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.10);
}
.composer-box input {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: #fff; font-size: 14px; height: 32px;
  font-family: inherit;
}
.composer-box input::placeholder { color: rgba(255,255,255,0.35); }
.composer-tool {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--fg-3);
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.12s;
}
.composer-tool:hover { color: #fff; background: rgba(255,255,255,0.06); }
.composer-tool svg { width: 16px; height: 16px; }
.composer-send {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff; border: none;
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
}
.composer-send:hover { box-shadow: 0 6px 18px rgba(139,108,255,0.45); transform: translateY(-1px); }
.composer-send svg { width: 16px; height: 16px; }

/* Members panel */
.chat .members {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.members-head {
  padding: 16px 18px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-3);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
}
.members-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.members-list::-webkit-scrollbar { width: 4px; }
.members-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
.member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: default;
  transition: 0.12s;
}
.member:hover { background: rgba(255,255,255,0.04); }
.member-av {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.5); font-weight: 700; font-size: 12px;
  flex-shrink: 0;
  position: relative;
}
.member-av::after {
  content: ''; position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid #0c0c16;
}
.member-name {
  font-size: 13px; font-weight: 500;
  color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Voice stage in main */
.voice-stage {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0;
}
.voice-stage.hidden { display: none; }
.voice-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  color: var(--fg-3);
  text-align: center;
}
.voice-empty.hidden { display: none; }
.voice-empty-icon {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(139,108,255,0.16), rgba(255,122,168,0.10));
  border: 1px solid var(--glass-border);
  color: var(--primary);
  margin-bottom: 6px;
}
.voice-empty h3 { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.voice-empty p { margin: 0; font-size: 14px; max-width: 320px; line-height: 1.5; }

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  align-content: start;
}
.video-grid.hidden { display: none; }
.video-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.video-tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-tile.has-video video { opacity: 1; }
.video-tile .tile-placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2b2d40, #1e1f30);
}
.video-tile.has-video .tile-placeholder { display: none; }
.video-tile .tile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 26px;
}
.video-tile .tile-name-bar {
  position: absolute; left: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  padding: 4px 9px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  max-width: calc(100% - 20px);
  z-index: 2;
}
.video-tile .tile-mic-state svg { width: 12px; height: 12px; display: none; }
.video-tile .tile-mic-on  { color: #4aeaa0; }
.video-tile .tile-mic-off { color: #ff7070; }
.video-tile:not(.mic-off) .tile-mic-on  { display: inline-block; }
.video-tile.mic-off       .tile-mic-off { display: inline-block; }
.video-tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 18px rgba(46,212,122,0.35); }

.voice-controls-bar {
  flex-shrink: 0;
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: rgba(12,12,22,0.6);
  border-top: 1px solid var(--glass-border);
}
.voice-controls-bar.hidden { display: none; }
.zc-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 68px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 600;
  transition: 0.15s;
}
.zc-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.zc-btn.zc-off { background: rgba(255,90,90,0.16); border-color: rgba(255,90,90,0.3); color: #ff9999; }
.zc-btn.zc-off:hover { background: rgba(255,90,90,0.26); color: #fff; }
.zc-btn.zc-on { background: rgba(46,212,122,0.16); border-color: rgba(46,212,122,0.3); color: #4aeaa0; }
.zc-btn.zc-on:hover { background: rgba(46,212,122,0.26); color: #fff; }
.zc-btn.zc-btn-leave {
  background: linear-gradient(135deg, #ff6b6b, #d33d3d);
  color: #fff; border: none;
  box-shadow: 0 6px 18px rgba(255,90,90,0.32);
}
.zc-btn.zc-btn-leave:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255,90,90,0.45); }
.zc-icon-wrap { width: 22px; height: 22px; display: grid; place-items: center; }
.zc-icon { width: 20px; height: 20px; }
.zc-icon-off { display: none; }
.zc-btn.zc-off .zc-icon-on { display: none; }
.zc-btn.zc-off .zc-icon-off { display: block; }
.zc-divider { width: 1px; height: 28px; background: var(--glass-border); margin: 0 4px; }

.voice-header-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg-3);
  padding: 3px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}
.voice-header-count.hidden { display: none; }

/* Mobile fallback for chat 3-panel */
@media (max-width: 900px) {
  .chat {
    grid-template-columns: 1fr;
    grid-template-areas:
      "rail"
      "channels"
      "main"
      "members";
    height: auto;
  }
}

/* =========================================================
   DM page (V2 design — Личные сообщения)
   ========================================================= */
.dm-shell { display: flex; flex-direction: column; height: calc(100vh - 64px); overflow: hidden; }

.dm-cpanel {
  height: 60px; flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 22px; gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dm-cpanel .cp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.03);
  color: var(--fg-2);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: 0.15s;
  font-family: inherit; text-decoration: none;
}
.dm-cpanel .cp-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.dm-cpanel .cp-btn.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.25), rgba(255,122,168,0.18));
  color: #fff;
  border-color: rgba(139,108,255,0.45);
  box-shadow: 0 6px 18px rgba(139,108,255,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.dm-cpanel .cp-action {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 11px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  border: none;
  color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(139,108,255,0.35);
  font-family: inherit;
}
.dm-cpanel .cp-action:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(139,108,255,0.5); color: #fff; }
.dm-cpanel .cp-spacer { flex: 1; }
.dm-cpanel .cp-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0 12px; height: 38px;
  width: 280px;
  color: rgba(255,255,255,0.5); font-size: 13px;
}
.dm-cpanel .cp-search input {
  background: transparent; border: none; outline: none;
  color: #fff; font-size: 13px; flex: 1; min-width: 0;
  font-family: inherit;
}
.dm-cpanel .cp-search input::placeholder { color: rgba(255,255,255,0.4); }
.dm-cpanel .cp-divider { width: 1px; height: 24px; background: var(--glass-border); flex-shrink: 0; }

/* DM CTA buttons (in modal + welcome screen) */
.dm-cta-primary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 18px rgba(139,108,255,0.35); transition: 0.15s;
}
.dm-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(139,108,255,0.5); }
.dm-cta-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  color: var(--fg-2); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: 0.15s;
}
.dm-cta-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

.dm-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }

.dm-list-col {
  width: 280px; flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.dm-list-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
}
.dm-list-head h4 {
  margin: 0; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-3);
}
.dm-new-form {
  display: flex; gap: 6px; padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.dm-new-form input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 7px 10px;
  color: #fff; font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}
.dm-new-form input:focus { border-color: rgba(139,108,255,0.5); }
.dm-new-form button {
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  border: none; color: #fff;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}
.dm-new-form button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(139,108,255,0.4); }
.dm-list-scroll { flex: 1; overflow-y: auto; padding: 6px 8px 12px; }

.dm-chat-row {
  display: flex; gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  margin: 1px 0;
  cursor: pointer;
  align-items: center;
  position: relative;
  text-decoration: none;
  transition: 0.12s;
}
.dm-chat-row:hover { background: rgba(255,255,255,0.04); }
.dm-chat-row.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.22), rgba(139,108,255,0.10));
  box-shadow: inset 0 0 0 1px rgba(139,108,255,0.32);
}
.dm-chat-row.active::before {
  content: ''; position: absolute;
  left: -1px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #9b7dff, #ff7aa8);
}
.dm-chat-row.unread .dm-chat-nm { color: #fff; font-weight: 700; }
.dm-chat-av {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.5); font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.dm-chat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-chat-line1 { display: flex; align-items: baseline; gap: 8px; }
.dm-chat-nm {
  font-size: 14px; font-weight: 600; color: var(--fg-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.dm-chat-time { font-size: 11px; color: var(--fg-4); flex-shrink: 0; }
.dm-chat-line2 { display: flex; align-items: center; gap: 6px; }
.dm-chat-last {
  font-size: 12px; color: var(--fg-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; line-height: 1.3;
}
.dm-unread {
  background: var(--pink); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  flex-shrink: 0; line-height: 1.5;
  min-width: 18px; text-align: center;
}

.dm-dialog { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.dm-dialog-head {
  flex-shrink: 0; padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(139,108,255,0.10), rgba(12,12,22,0.4) 70%);
  display: flex; align-items: center; gap: 12px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.dm-dialog-head .back {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  text-decoration: none;
  transition: 0.15s;
  flex-shrink: 0;
}
.dm-dialog-head .back:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dm-dialog-head .who-av {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.5); font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.dm-dialog-head .who-info { flex: 1; min-width: 0; }
.dm-dialog-head .who-nm { font-size: 15px; font-weight: 700; color: #fff; }
.dm-dialog-head .who-st {
  font-size: 11px; color: var(--fg-3);
  display: flex; align-items: center; gap: 5px;
  margin-top: 2px;
}
.dm-dialog-head .who-st .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}
.dm-dialog-head .actions { display: flex; gap: 4px; }
.dm-dialog-head .iconbtn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  cursor: pointer; transition: 0.15s;
}
.dm-dialog-head .iconbtn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.dm-msgs {
  flex: 1; overflow-y: auto;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
.dm-day-sep {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-4); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 4px 0;
}
.dm-day-sep::before, .dm-day-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--glass-border);
}
.dm-msg {
  display: flex; gap: 10px;
  max-width: 80%; align-self: flex-start;
}
.dm-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.dm-msg-av {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.5); font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}
.dm-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 14px 14px 14px 3px;
  padding: 9px 13px;
  font-size: 13px; color: var(--fg-1);
  line-height: 1.45;
  max-width: 100%;
  word-wrap: break-word;
}
.dm-msg.me .dm-bubble {
  background: linear-gradient(135deg, rgba(139,108,255,0.35), rgba(106,139,255,0.25));
  border-color: rgba(139,108,255,0.4);
  border-radius: 14px 14px 3px 14px;
}
.dm-bubble .meta { font-size: 10px; color: var(--fg-4); margin-top: 4px; }

.dm-composer {
  flex-shrink: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--glass-border);
}
.dm-composer-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  transition: 0.15s;
}
.dm-composer-box:focus-within {
  border-color: rgba(139,108,255,0.5);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.10);
}
.dm-composer-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 13px; height: 32px;
  font-family: inherit;
}
.dm-composer-box input::placeholder { color: rgba(255,255,255,0.35); }
.dm-composer-box .send-btn {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  color: #fff; border: none;
  display: grid; place-items: center;
  cursor: pointer; transition: 0.15s;
}
.dm-composer-box .send-btn:hover { box-shadow: 0 4px 12px rgba(139,108,255,0.4); transform: translateY(-1px); }
.dm-composer-box .send-btn svg { width: 16px; height: 16px; }

.dm-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  color: var(--fg-3); text-align: center;
  padding: 40px;
}
.dm-welcome h3 { font-size: 22px; color: #fff; font-weight: 800; letter-spacing: -0.02em; }
.dm-welcome p { font-size: 13px; max-width: 340px; line-height: 1.5; }
.dm-welcome-art {
  position: relative; width: 140px; height: 110px;
  margin-bottom: 4px;
}
.dm-wa-bubble {
  position: absolute; border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
}
.dm-wa-bubble.b1 { left: 0; top: 8px; width: 70px; height: 28px; border-radius: 14px 14px 14px 3px; }
.dm-wa-bubble.b2 {
  right: 0; top: 38px; width: 60px; height: 28px;
  border-radius: 14px 14px 3px 14px;
  background: linear-gradient(135deg, rgba(139,108,255,0.3), rgba(106,139,255,0.2));
  border-color: rgba(139,108,255,0.35);
}
.dm-wa-bubble.b3 { left: 6px; top: 70px; width: 80px; height: 28px; border-radius: 14px 14px 14px 3px; }
.dm-wa-icon {
  position: absolute; right: -10px; bottom: -14px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #9b7dff, #6a8bff);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 14px 36px rgba(139,108,255,0.45);
}

.dm-error-banner {
  background: rgba(255,90,90,0.12);
  border: 1px solid rgba(255,90,90,0.32);
  color: #ff9999;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 12px 16px 0;
  font-size: 13px;
}

.dm-success-banner {
  background: rgba(46,212,122,0.12);
  border: 1px solid rgba(46,212,122,0.32);
  color: #4aeaa0;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 12px 16px 0;
  font-size: 13px;
}

/* =========================================================
   Online status indicator (universal)
   ========================================================= */
.dm-chat-av-wrap, .who-av-wrap, .member-av-wrap, .friend-av-wrap { position: relative; flex-shrink: 0; }
.av-status {
  position: absolute; bottom: -1px; right: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #0c0c16;
}
.av-status.s-online  { background: var(--green); }
.av-status.s-idle    { background: var(--amber); }
.av-status.s-dnd     { background: var(--red); }
.av-status.s-offline { background: var(--fg-4); }

/* CP-button badge (count of incoming friend requests etc) */
.cp-btn .cp-badge {
  background: var(--pink); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  margin-left: 4px;
}

/* =========================================================
   Friends page (within DM shell)
   ========================================================= */
.friends-page {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
.friends-subtabs {
  display: flex; gap: 4px;
  padding: 12px 22px 0;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.friends-subtabs .subtab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--fg-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: 0.15s;
}
.friends-subtabs .subtab:hover { color: var(--fg-1); }
.friends-subtabs .subtab.active {
  color: #fff;
  border-bottom-color: var(--primary);
}
.friends-subtabs .subtab .count {
  background: rgba(255,255,255,0.08);
  color: var(--fg-2);
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
}
.friends-subtabs .subtab.active .count {
  background: rgba(139,108,255,0.3);
  color: #c4b5fd;
}
.friends-subtabs .subtab .count.pink {
  background: rgba(255,122,168,0.25);
  color: var(--pink-2);
}

.friends-content {
  flex: 1; overflow-y: auto;
  padding: 12px 22px 20px;
}

.friends-add-form {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin: 8px 0 16px;
}
.friends-add-form svg { color: var(--fg-3); flex-shrink: 0; }
.friends-add-form input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 9px 12px;
  color: #fff; font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}
.friends-add-form input:focus {
  border-color: rgba(139,108,255,0.5);
  background: rgba(255,255,255,0.07);
}

.friends-section-label {
  margin: 18px 0 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}
.friends-list {
  display: flex; flex-direction: column;
  gap: 4px;
}
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: 0.12s;
}
.friend-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--glass-border);
}
.friend-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(0,0,0,0.5);
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.friend-info { flex: 1; min-width: 0; }
.friend-nm {
  font-size: 14px; font-weight: 600;
  color: var(--fg-1);
  display: flex; align-items: baseline; gap: 8px;
}
.friend-tag {
  font-size: 11px; color: var(--fg-4);
  font-weight: 500;
}
.friend-state {
  font-size: 12px; color: var(--fg-3);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friend-actions {
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.friend-actions form { margin: 0; padding: 0; }
.ficonbtn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
  padding: 0;
}
.ficonbtn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateY(-1px);
}
.ficonbtn.primary {
  background: rgba(139,108,255,0.18);
  color: #c4b5fd;
  border-color: rgba(139,108,255,0.32);
}
.ficonbtn.primary:hover {
  background: rgba(139,108,255,0.32);
  color: #fff;
}
.ficonbtn.accept {
  background: rgba(46,212,122,0.15);
  color: #4aeaa0;
  border-color: rgba(46,212,122,0.32);
}
.ficonbtn.accept:hover {
  background: rgba(46,212,122,0.28);
  color: #fff;
}
.ficonbtn.danger {
  background: rgba(255,90,90,0.10);
  color: #ff9999;
  border-color: rgba(255,90,90,0.28);
}
.ficonbtn.danger:hover {
  background: rgba(255,90,90,0.22);
  color: #fff;
}

.friend-req-tag {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.friend-req-tag.inc {
  background: rgba(255,122,168,0.15);
  color: var(--pink-2);
  border: 1px solid rgba(255,122,168,0.3);
}
.friend-req-tag.out {
  background: rgba(255,255,255,0.05);
  color: var(--fg-3);
  border: 1px solid var(--glass-border);
}

.friends-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--fg-3);
}
.friends-empty h3 {
  color: #fff; font-size: 18px; font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.friends-empty p {
  font-size: 13px; max-width: 320px;
  line-height: 1.5;
  margin: 0 auto;
}
.friends-empty-mini {
  font-size: 12px; color: var(--fg-4);
  padding: 8px 12px;
  font-style: italic;
}

/* =========================================================
   Server chat layout (top channel bar + main + members)
   ========================================================= */
.srv-chat {
  display: flex; flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.srv-topbar {
  flex-shrink: 0;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
}
.srv-topbar-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--glass-border);
}
.srv-back {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  text-decoration: none;
  transition: 0.15s;
  flex-shrink: 0;
}
.srv-back:hover {
  background: rgba(139,108,255,0.18);
  border-color: rgba(139,108,255,0.32);
  color: #fff;
}
.srv-title { flex: 1; min-width: 0; }
.srv-title h2 {
  margin: 0; font-size: 18px; font-weight: 800;
  color: #fff; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srv-meta {
  font-size: 12px; color: var(--fg-3);
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.srv-meta .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(46,212,122,0.18);
  animation: livePulse 1.5s ease-in-out infinite;
}
.srv-topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.srv-action {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 10px;
  background: rgba(139,108,255,0.16);
  border: 1px solid rgba(139,108,255,0.3);
  color: #c4b5fd;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: 0.15s;
  font-family: inherit;
}
.srv-action:hover {
  background: rgba(139,108,255,0.28);
  border-color: rgba(139,108,255,0.5);
  color: #fff;
}

.srv-channel-bar {
  display: flex; align-items: center;
  padding: 10px 14px;
  gap: 10px;
}
.srv-channel-tabs {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.srv-channel-tabs::-webkit-scrollbar { height: 6px; }
.srv-channel-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.srv-ch-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: 0.15s;
  font-family: inherit;
}
.srv-ch-tab svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.9; }

/* Text channels — purple */
.srv-ch-tab.text {
  background: rgba(139,108,255,0.10);
  border: 1px solid rgba(139,108,255,0.28);
  color: #c4b5fd;
}
.srv-ch-tab.text:hover {
  background: rgba(139,108,255,0.18);
  border-color: rgba(139,108,255,0.45);
  color: #fff;
  transform: translateY(-1px);
}
.srv-ch-tab.text.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.42), rgba(139,108,255,0.22));
  color: #fff;
  border-color: rgba(139,108,255,0.7);
  box-shadow: 0 6px 18px rgba(139,108,255,0.32), inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Voice channels — green */
.srv-ch-tab.voice {
  background: rgba(46,212,122,0.10);
  border: 1px solid rgba(46,212,122,0.28);
  color: #4aeaa0;
}
.srv-ch-tab.voice:hover {
  background: rgba(46,212,122,0.18);
  border-color: rgba(46,212,122,0.45);
  color: #fff;
  transform: translateY(-1px);
}
.srv-ch-tab.voice.active {
  background: linear-gradient(135deg, rgba(46,212,122,0.42), rgba(46,212,122,0.22));
  color: #fff;
  border-color: rgba(46,212,122,0.7);
  box-shadow: 0 6px 18px rgba(46,212,122,0.32), inset 0 1px 0 rgba(255,255,255,0.10);
}

.srv-ch-create {
  display: flex; gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.srv-ch-add {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed var(--glass-border-strong);
  color: var(--fg-3);
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}
.srv-ch-add svg { width: 14px; height: 14px; }
.srv-ch-add .plus-mini {
  position: absolute; bottom: 4px; right: 4px;
  width: 9px; height: 9px;
  color: var(--green);
}
.srv-ch-add:hover {
  background: rgba(46,212,122,0.12);
  border-color: rgba(46,212,122,0.4);
  border-style: solid;
  color: #4aeaa0;
  transform: translateY(-1px);
}

.srv-body {
  flex: 1; display: flex; overflow: hidden; min-height: 0;
}
.srv-body .chat-main {
  flex: 1; min-width: 0; min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.srv-body .chat-main > #sectionText,
.srv-body .chat-main > #sectionEmpty,
.srv-body .chat-main > .voice-stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.srv-body .chat-main .messages-area {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.srv-body .chat-main .composer-wrap {
  flex-shrink: 0;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-top: 1px solid var(--glass-border);
}
.srv-body .members {
  width: 240px; flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border-left: 1px solid var(--glass-border);
  border-right: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.srv-body .member.offline {
  opacity: 0.55;
}
.srv-body .member-av::after { display: none; }

/* =========================================================
   Modal (create channel)
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 9000;
  background: rgba(7,7,13,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.18s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: linear-gradient(180deg, rgba(28,24,52,0.95), rgba(18,16,36,0.95));
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  padding: 28px 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-2);
  animation: modalPop 0.2s ease;
}
@keyframes modalPop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  margin-bottom: 8px;
}
.modal-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
  margin-bottom: 18px;
}
.modal-input:focus {
  border-color: rgba(139,108,255,0.5);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.1);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-actions .btn { height: 38px; padding: 0 16px; font-size: 13px; }

/* =========================================================
   Nav: hover + active polish (request: "не быть прозрачной")
   ========================================================= */
.nav-link-item {
  position: relative;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.nav-link-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.10);
  color: #fff;
  transform: translateY(-1px);
}
.nav-link-item.active {
  background: linear-gradient(135deg, rgba(139,108,255,0.28), rgba(139,108,255,0.14));
  color: #fff;
  border-color: rgba(139,108,255,0.55);
  box-shadow: 0 4px 14px rgba(139,108,255,0.25), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.nav-link-item.active:hover {
  background: linear-gradient(135deg, rgba(139,108,255,0.36), rgba(139,108,255,0.18));
  border-color: rgba(139,108,255,0.7);
}

/* Avatar button polish */
.nav-av-btn {
  transition: 0.18s;
}
.nav-av-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(139,108,255,0.45);
  border-color: rgba(255,255,255,0.3);
}

/* =========================================================
   Server card: compact "Открытый" badge
   ========================================================= */
.scb-meta {
  display: flex; align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--fg-3);
  overflow: hidden;
}
.badge-public {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(46,212,122,0.14);
  color: #4aeaa0;
  border: 1px solid rgba(46,212,122,0.32);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.scb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile fallback for new server-chat */
@media (max-width: 900px) {
  .srv-body { flex-direction: column; }
  .srv-body .members { width: 100%; max-height: 200px; border-left: none; border-top: 1px solid var(--glass-border); }
  .srv-topbar-head { flex-wrap: wrap; }
}

/* =========================================================
   Account session banner (multi-account warning)
   ========================================================= */
.account-banner {
  position: fixed;
  top: 76px; left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: rgba(28, 24, 52, 0.96);
  border: 1px solid rgba(255, 181, 62, 0.45);
  border-left: 3px solid var(--amber);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--fg-1);
  font-size: 13px;
  max-width: 640px;
  width: calc(100% - 32px);
  animation: bannerSlide 0.25s ease;
}
@keyframes bannerSlide {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}
.account-banner .ab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid rgba(139, 108, 255, 0.45);
  background: rgba(139, 108, 255, 0.18);
  color: #c4b5fd;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}
.account-banner .ab-btn:hover {
  background: rgba(139, 108, 255, 0.32);
  color: #fff;
}

/* button form-reset for .nav-match (was <a>, now <button>) */
button.nav-match {
  border: 1px solid rgba(255,122,168,0.32);
  font-family: inherit;
}

/* =========================================================
   Ideas page (Pages/Ideas/Index.cshtml + Details.cshtml)
   ========================================================= */
.ideas-page { max-width: 1140px; margin: 0 auto; padding: 40px 28px 80px; }

/* --- Page header --- */
.ip-head { margin-bottom: 20px; }
.ip-week-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(139,108,255,0.12);
  border: 1px solid rgba(139,108,255,0.3);
  font-size: 12px; font-weight: 600; color: #c4b5fd;
  margin-bottom: 12px;
}
.ip-week-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,108,255,0.25);
  animation: livePulse 1.5s ease-in-out infinite;
}
.ip-title {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800;
  letter-spacing: -0.025em; color: #fff; margin: 0 0 8px;
}
.ip-sub { font-size: 15px; color: var(--fg-3); margin: 0; max-width: 560px; }

/* --- Cycle banner --- */
.ip-cycle-banner {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: center;
  padding: 18px 24px; border-radius: 18px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(139,108,255,0.16), rgba(255,122,168,0.12));
  border: 1px solid rgba(139,108,255,0.28);
  position: relative; overflow: hidden;
}
.ip-cycle-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(500px 200px at 100% 50%, rgba(255,122,168,0.18), transparent 60%);
  pointer-events: none;
}
.ipcb-stat { display: flex; flex-direction: column; gap: 2px; position: relative; }
.ipcb-num {
  font-size: 26px; font-weight: 800; color: #fff;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.ipcb-lbl { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.ipcb-mid { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ipcb-t1 { font-size: 14px; font-weight: 600; color: #fff; }
.ipcb-t2 { font-size: 12px; color: var(--fg-3); line-height: 1.5; }
.ipcb-countdown { display: flex; gap: 6px; position: relative; }
.ipcb-cell {
  background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 8px 10px; text-align: center; min-width: 54px;
}
.ipcb-v {
  font-size: 20px; font-weight: 700; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ipcb-u { font-size: 9px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* --- You-strip (vote + propose status) --- */
.ip-you-strip {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
.ip-you-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  transition: 0.15s;
}
.ip-you-card.done { border-color: rgba(46,212,122,0.28); background: rgba(46,212,122,0.05); }
.ip-you-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04); color: var(--fg-2);
}
.ip-you-card.done .ip-you-icon { background: rgba(46,212,122,0.15); color: #4aeaa0; }
.ip-you-body { flex: 1; min-width: 0; }
.ip-you-t1 { font-size: 13px; font-weight: 600; color: #fff; }
.ip-you-t2 { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.ip-you-link {
  flex-shrink: 0;
  font-size: 12px; color: var(--primary-2); font-weight: 600;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(139,108,255,0.12); border: 1px solid rgba(139,108,255,0.2);
  cursor: pointer; text-decoration: none; font-family: inherit;
  white-space: nowrap; transition: 0.15s;
}
.ip-you-link:hover { background: rgba(139,108,255,0.22); color: #c4b5fd; }
.ip-you-link.done-lbl {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--green); background: rgba(46,212,122,0.10);
  border-color: rgba(46,212,122,0.25); cursor: default;
}
.ip-you-link.done-lbl:hover { background: rgba(46,212,122,0.10); color: var(--green); }

/* --- Actions bar --- */
.ip-propose-btn { height: 36px; padding: 0 14px; font-size: 13px; gap: 6px; }
.ip-already-proposed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--green);
  padding: 6px 12px; border-radius: 8px;
  background: rgba(46,212,122,0.08); border: 1px solid rgba(46,212,122,0.22);
}

/* --- Tags --- */
.ip-tag {
  display: inline-flex; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--fg-2);
}
.ip-tag.winner { background: rgba(255,181,62,0.14); border-color: rgba(255,181,62,0.35); color: var(--amber); }
.ip-tag.progress { background: rgba(46,212,122,0.10); border-color: rgba(46,212,122,0.28); color: var(--green); }
.ip-tag.mine { background: rgba(139,108,255,0.12); border-color: rgba(139,108,255,0.3); color: #c4b5fd; }
.ip-tag-week { font-size: 10px; color: var(--fg-4); background: rgba(255,255,255,0.03); }

/* --- Rank badges --- */
.ip-rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
}
.ip-rank-badge.gold   { background: rgba(255,181,62,0.18); color: #ffd166; border: 1px solid rgba(255,181,62,0.35); }
.ip-rank-badge.silver { background: rgba(200,200,220,0.12); color: #d0cfec; border: 1px solid rgba(200,200,220,0.25); }
.ip-rank-badge.bronze { background: rgba(180,130,80,0.14); color: #d4a26a; border: 1px solid rgba(180,130,80,0.28); }
.ip-rank-num { font-size: 13px; font-weight: 700; color: var(--fg-4); width: 36px; text-align: center; }

/* --- Idea card (list) --- */
.ip-list { display: flex; flex-direction: column; gap: 10px; }
.ip-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  transition: 0.18s;
}
.ip-card:hover { border-color: var(--glass-border-strong); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.ip-card.voted { border-color: rgba(139,108,255,0.4); background: rgba(139,108,255,0.06); }
.ip-card.is-winner { border-color: rgba(255,181,62,0.35); }
.ip-card.is-progress { border-color: rgba(46,212,122,0.25); }

.ip-card-rank { flex-shrink: 0; width: 36px; display: flex; justify-content: center; }
.ip-card-body { flex: 1; min-width: 0; }
.ip-card-top { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.ip-card-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ip-card-title {
  font-size: 15px; font-weight: 700; color: #fff;
  text-decoration: none; line-height: 1.3;
}
.ip-card-title:hover { color: #c4b5fd; }
.ip-lead-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 8px; border-radius: 999px; color: #0a0a14;
  background: linear-gradient(135deg,#ffd28a,#ff8a5a);
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
}
.ip-voted-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(139,108,255,0.22); color: #c4b5fd;
  border: 1px solid rgba(139,108,255,0.32); flex-shrink: 0;
}
.ip-card-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ip-card-desc { font-size: 13px; color: var(--fg-3); margin: 2px 0 5px; line-height: 1.4; }
.ip-card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-4); }
.ip-card-author { color: var(--fg-4); }
.ip-card-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-4); flex-shrink: 0; }

.ip-card-vote { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 72px; }
.ip-side-pct { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.ip-side-pct-num { font-size: 11px; color: var(--fg-4); font-weight: 600; font-variant-numeric: tabular-nums; }
.ip-side-bar { width: 100%; height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden; }
.ip-side-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--pink)); border-radius: 2px; transition: width 0.4s; min-width: 2px; }
.ip-vote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--fg-3);
  cursor: pointer; font-family: inherit;
  transition: 0.15s; text-decoration: none;
}
.ip-vote-btn:hover { background: rgba(255,90,141,0.12); border-color: rgba(255,90,141,0.3); color: var(--pink); }
.ip-vote-btn.active { background: rgba(255,90,141,0.15); border-color: rgba(255,90,141,0.4); color: var(--pink); }
.ip-vote-count { font-size: 13px; font-weight: 700; color: inherit; }
.ip-details-link { font-size: 11px; color: var(--fg-4); text-decoration: none; white-space: nowrap; transition: 0.15s; }
.ip-details-link:hover { color: var(--fg-2); }

/* --- Empty state --- */
.ip-empty {
  text-align: center; padding: 80px 20px;
  color: var(--fg-3);
}
.ip-empty-icon { font-size: 48px; margin-bottom: 16px; }
.ip-empty h3 { color: #fff; font-size: 22px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.ip-empty p { margin: 0 0 20px; font-size: 15px; }

/* --- Propose modal --- */
.ip-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(7,7,13,0.75);
  backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.ip-modal-overlay.visible { display: flex; }
.ip-modal {
  background: var(--bg-1);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-2xl);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.ip-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--glass-border);
}
.ip-modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.ip-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.06); color: var(--fg-3);
  display: grid; place-items: center; cursor: pointer; transition: 0.15s;
}
.ip-modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.ip-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.ip-form-group { display: flex; flex-direction: column; gap: 6px; }
.ip-form-label { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.ip-form-hint { font-weight: 400; color: var(--fg-4); font-size: 12px; }
.ip-form-input { font-size: 14px; }
.ip-form-error { font-size: 13px; color: var(--red); padding: 8px 12px; background: rgba(255,90,90,0.1); border: 1px solid rgba(255,90,90,0.25); border-radius: 8px; }
.ip-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--glass-border);
}
.hidden { display: none !important; }

/* =========================================================
   Ideas Details page
   ========================================================= */
.ideas-details-page { max-width: 1040px; margin: 0 auto; padding: 36px 28px 80px; }

/* Breadcrumb */
.idd-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-3); margin-bottom: 24px; }
.idd-back {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--fg-3); text-decoration: none; transition: 0.15s;
}
.idd-back:hover { color: #fff; }
.idd-bc-sep { color: var(--fg-4); }
.idd-bc-current { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }

/* Layout */
.idd-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }

/* Hero card */
.idd-hero {
  padding: 28px 32px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-1);
  margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.idd-hero.is-winner { border-color: rgba(255,181,62,0.35); }
.idd-hero.is-progress { border-color: rgba(46,212,122,0.28); }
.idd-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 100% 0%, rgba(139,108,255,0.12), transparent 60%);
  pointer-events: none;
}

.idd-hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.idd-hero-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.idd-rank-badge {
  font-size: 20px; font-weight: 800; color: var(--fg-3);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.idd-hero-title {
  font-size: clamp(22px, 3vw, 32px); font-weight: 800;
  letter-spacing: -0.025em; color: #fff; margin: 0 0 12px;
  position: relative; z-index: 1;
}
.idd-hero-desc { font-size: 15px; color: var(--fg-2); line-height: 1.55; margin: 0 0 18px; position: relative; z-index: 1; }
.idd-hero-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; position: relative; z-index: 1; }
.idd-meta-author { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); font-weight: 500; }
.idd-meta-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#ff9ec3,#8b6cff);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.idd-meta-date { font-size: 12px; color: var(--fg-4); }

/* Vote bar */
.idd-vote-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; margin-bottom: 16px; }
.idd-vote-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px;
  border: 1px solid rgba(255,90,141,0.3);
  background: rgba(255,90,141,0.08);
  color: var(--pink); cursor: pointer;
  font-size: 14px; font-weight: 600;
  font-family: inherit; text-decoration: none; transition: 0.15s;
}
.idd-vote-btn:hover { background: rgba(255,90,141,0.16); border-color: rgba(255,90,141,0.5); color: var(--pink); }
.idd-vote-btn.active { background: rgba(255,90,141,0.20); border-color: rgba(255,90,141,0.55); }
.idd-vote-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.idd-vote-closed { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-4); }
.idd-vote-pct { flex: 1; }
.idd-pct-bar {
  height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden; margin-bottom: 4px;
}
.idd-pct-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--primary)); border-radius: 2px; transition: width 0.4s; }
.idd-vote-pct span { font-size: 11px; color: var(--fg-4); }

/* Top voters */
.idd-voters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.idd-voters-lbl { font-size: 12px; color: var(--fg-4); }
.idd-voter-av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,108,255,0.55), rgba(255,122,168,0.55));
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff;
  border: 2px solid var(--bg-1);
}

/* Comments section */
.idd-comments-section {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.idd-section-title {
  font-size: 16px; font-weight: 700; color: #fff;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 8px;
  margin: 0;
}
.idd-comment-count {
  font-size: 12px; font-weight: 600; color: var(--fg-4);
  background: rgba(255,255,255,0.06); border-radius: 999px;
  padding: 2px 8px;
}
.idd-comment-form {
  display: flex; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.idd-cf-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #ff9ec3, #8b6cff);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; margin-top: 2px;
}
.idd-cf-right { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.idd-cf-input { resize: none; font-size: 14px; }
.idd-cf-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.idd-cf-error { font-size: 12px; color: var(--red); flex: 1; }
.idd-cf-btn { height: 36px; padding: 0 16px; font-size: 13px; }

.idd-comments-list { padding: 8px 0 4px; }
.idd-no-comments { padding: 24px 24px; font-size: 14px; color: var(--fg-4); text-align: center; }
.idd-comment {
  display: flex; gap: 12px;
  padding: 12px 20px;
  transition: background 0.12s;
}
.idd-comment:hover { background: rgba(255,255,255,0.02); }
.idd-comment.is-own { background: rgba(139,108,255,0.04); }
.idd-comment-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,108,255,0.55), rgba(106,139,255,0.55));
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.idd-comment-av.team-av { background: linear-gradient(135deg, var(--pink), var(--primary)); }
.idd-comment-body { flex: 1; min-width: 0; }
.idd-comment-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.idd-comment-author { font-size: 13px; font-weight: 600; color: #fff; }
.idd-team-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  background: rgba(255,122,168,0.15); border: 1px solid rgba(255,122,168,0.3);
  color: var(--pink); border-radius: 999px;
}
.idd-comment-time { font-size: 11px; color: var(--fg-4); }
.idd-comment-text { font-size: 14px; color: var(--fg-1); line-height: 1.5; word-break: break-word; }

/* Sidebar */
.idd-sidebar { display: flex; flex-direction: column; gap: 14px; }
.idd-side-card {
  padding: 20px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
}
.idd-side-title { font-size: 13px; font-weight: 700; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 14px; }
.idd-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.idd-stat-item { padding: 10px 12px; background: rgba(255,255,255,0.03); border-radius: 10px; }
.idd-stat-val { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.idd-stat-lbl { font-size: 11px; color: var(--fg-4); margin-top: 2px; }

.idd-related-list { display: flex; flex-direction: column; gap: 2px; }
.idd-related-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: background 0.12s;
}
.idd-related-item:hover { background: rgba(255,255,255,0.05); }
.idd-related-body { flex: 1; min-width: 0; }
.idd-related-title { font-size: 13px; font-weight: 600; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idd-related-meta { font-size: 11px; color: var(--fg-4); margin-top: 2px; }
.idd-related-arrow { color: var(--fg-4); flex-shrink: 0; }

.idd-week-card { text-align: center; }
.idd-week-label { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--fg-3); margin-bottom: 8px; }
.idd-week-num { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.idd-week-year { font-size: 13px; color: var(--fg-4); margin-top: 2px; }

/* --- Tab bar --- */
.ip-tabs {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ip-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  color: var(--fg-3); text-decoration: none;
  border: 1px solid transparent;
  transition: 0.15s;
  white-space: nowrap;
}
.ip-tab:hover { color: var(--fg-1); background: rgba(255,255,255,0.05); border-color: var(--glass-border); }
.ip-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139,108,255,0.22), rgba(139,108,255,0.10));
  border-color: rgba(139,108,255,0.45);
}
.ip-tab-count {
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.08); border-radius: 999px;
  padding: 1px 7px; color: var(--fg-3);
}
.ip-tab.active .ip-tab-count { background: rgba(139,108,255,0.22); color: #c4b5fd; }
.ip-tabs-spacer { flex: 1; }

/* --- Modal tip + char counter --- */
.ip-modal-tip {
  padding: 10px 14px;
  background: rgba(139,108,255,0.08);
  border: 1px solid rgba(139,108,255,0.22);
  border-radius: 10px;
  font-size: 13px; color: var(--fg-2); line-height: 1.5;
}
.ip-char-counter { font-size: 11px; color: var(--fg-4); text-align: right; margin-top: 3px; }
.ip-propose-submit { height: 40px; padding: 0 20px; font-size: 14px; }

/* --- Toast --- */
.ip-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px);
  z-index: 9999; padding: 12px 22px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: 12px;
  font-size: 14px; font-weight: 500; color: #fff;
  opacity: 0; transition: 0.25s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-2);
}
.ip-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.ip-toast-error { border-color: rgba(255,90,90,0.35); color: #ff9999; }

/* --- Two-column layout --- */
.ip-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.ip-main { min-width: 0; }

/* --- Sidebar cards --- */
.ip-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.ip-sb-card {
  padding: 18px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
}
.ip-sb-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--fg-2);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 12px;
}
.ip-sb-hint { font-size: 13px; color: var(--fg-1); font-weight: 600; margin: 0 0 4px; }
.ip-sb-sub  { font-size: 12px; color: var(--fg-4); margin: 0 0 12px; line-height: 1.45; }
.ip-sb-action-btn {
  display: block; width: 100%;
  padding: 9px 14px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(139,108,255,0.20), rgba(139,108,255,0.10));
  border: 1px solid rgba(139,108,255,0.35);
  color: var(--primary); font-size: 13px; font-weight: 600;
  text-align: center; text-decoration: none; cursor: pointer;
  font-family: inherit; transition: 0.15s;
}
.ip-sb-action-btn:hover { background: linear-gradient(135deg, rgba(139,108,255,0.32), rgba(139,108,255,0.18)); border-color: rgba(139,108,255,0.55); color: #c4b5fd; }
.ip-sb-voted {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--green);
  margin-bottom: 6px;
}
.ip-sb-voted-title { font-size: 13px; color: var(--fg-2); line-height: 1.4; margin: 0; font-style: italic; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* How it works */
.ip-how-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ip-how-list li { display: flex; gap: 10px; align-items: flex-start; }
.ip-how-num {
  min-width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,108,255,0.3), rgba(106,139,255,0.3));
  border: 1px solid rgba(139,108,255,0.35);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #c4b5fd;
  flex-shrink: 0; margin-top: 1px;
}
.ip-how-list li div { display: flex; flex-direction: column; gap: 2px; }
.ip-how-list li strong { font-size: 13px; font-weight: 700; color: var(--fg-1); }
.ip-how-list li span  { font-size: 12px; color: var(--fg-4); line-height: 1.4; }

/* Past winners list */
.ip-winners-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ip-winners-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; transition: background 0.12s; }
.ip-winners-list li + li { border-top: 1px solid var(--glass-border); }
.ip-winners-list li:hover { background: rgba(255,255,255,0.04); }
.ip-winner-week {
  font-size: 10px; font-weight: 700; color: var(--fg-3);
  font-variant-numeric: tabular-nums; min-width: 32px; flex-shrink: 0;
}
.ip-winner-link { font-size: 12px; font-weight: 600; color: var(--fg-1); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ip-winner-link:hover { color: #fff; }
.ip-sb-no-winners { font-size: 13px; color: var(--fg-4); margin: 0; line-height: 1.45; }

/* --- Leader card (gold highlight for #1) --- */
.ip-card.leader {
  border-color: rgba(255,181,62,0.45) !important;
  background: linear-gradient(135deg, rgba(255,181,62,0.07), var(--glass)) !important;
  box-shadow: 0 0 0 1px rgba(255,181,62,0.18), var(--shadow-1) !important;
}
.ip-card.leader .ip-rank-badge.gold { color: #ffc23a; text-shadow: 0 0 12px rgba(255,181,62,0.6); }

/* --- Card date --- */
.ip-card-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.ip-card-date { font-size: 11px; color: var(--fg-4); }

/* Responsive */
@media (max-width: 1100px) {
  .ip-layout { grid-template-columns: 1fr 260px; }
}
/* На планшетах сжимаем сайдбар, но layout остаётся десктопным */
@media (max-width: 900px) {
  .ideas-page, .ideas-details-page { padding: 20px 14px 60px; }
  .ip-layout { grid-template-columns: 1fr 220px; gap: 14px; }
  .ip-sidebar { position: static; }
  .ip-cycle-banner { padding: 14px 16px; gap: 14px; }
  .ip-you-strip { gap: 8px; margin-bottom: 14px; }
  .ip-you-card { padding: 10px 12px; gap: 10px; }
  .ip-you-t1 { font-size: 12px; }
  .ip-you-t2 { font-size: 11px; }
  .ip-tabs { gap: 2px; flex-wrap: wrap; }
  .ip-tabs-spacer { display: none; }
  .ip-head h1.ip-title { font-size: 28px; }
  .ip-sub { font-size: 13px; }
}
/* На телефоне — сайдбар уходит вниз, дальше сжимаем точечно */
@media (max-width: 640px) {
  .ip-layout { grid-template-columns: 1fr; }

  /* Таймер: компактный, остаётся справа от текста */
  .ip-cycle-banner {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .ipcb-stat { display: none; } /* убираем "номер недели" — оставляем только текст + таймер */
  .ipcb-t1 { font-size: 13px; }
  .ipcb-t2 { font-size: 11px; line-height: 1.4; }
  .ipcb-countdown { justify-content: flex-end; gap: 4px; }
  .ipcb-cell { padding: 5px 6px; min-width: 32px; border-radius: 7px; }
  .ipcb-v { font-size: 14px; }
  .ipcb-u { font-size: 8px; margin-top: 2px; }

  /* You-strip: жёстко 2 в строку, секондари-текст и стрелки уходят */
  .ip-you-strip { grid-template-columns: 1fr 1fr; gap: 6px; }
  .ip-you-card { padding: 8px 10px; gap: 8px; border-radius: 11px; align-items: center; }
  .ip-you-icon { display: none; } /* иконка на мобиле освобождает место под текст */
  .ip-you-body { min-width: 0; overflow: hidden; }
  .ip-you-t1 {
    font-size: 11px; line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ip-you-t2 { display: none; } /* скрываем подпись — на мобиле она лишняя */
  .ip-you-link { font-size: 10px; padding: 3px 7px; border-radius: 6px; }

  /* Сайдбар: "Как это работает" + "Прошлые победители" — рядом, а не друг под другом */
  .ip-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: static;
  }
  .ip-sb-card { padding: 12px 14px; border-radius: 12px; }
  .ip-sb-title { font-size: 12px; margin-bottom: 8px; }
  .ip-how-list { gap: 8px; }
  .ip-how-list li { gap: 8px; }
  .ip-how-num { width: 22px; height: 22px; font-size: 11px; }
  .ip-how-list li strong { font-size: 12px; }
  .ip-how-list li span  { font-size: 11px; }
}
@media (max-width: 420px) {
  /* На совсем узких сайдбар-карточки складываются в столбик */
  .ip-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .idd-layout { grid-template-columns: 1fr; }
  .idd-sidebar { order: -1; }
  .idd-stats-grid { grid-template-columns: repeat(4, 1fr); }
  .ip-propose-btn { margin-top: 8px; }
}

/* =========================================================
   Mobile adaptation (≤900px) — hamburger drawer + chat sidebar
   ========================================================= */

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-hamb {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--fg-1);
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
  padding: 0;
  flex-shrink: 0;
}
.nav-hamb:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--glass-border-strong);
  color: #fff;
}
.nav-hamb:active { transform: scale(0.96); }

/* Drawer overlay + panel */
.nav-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(7,7,13,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1098;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.nav-drawer {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  height: 100dvh;
  width: min(86vw, 340px);
  background: linear-gradient(180deg, rgba(14,12,28,0.96), rgba(10,9,20,0.96));
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-right: 1px solid var(--glass-border-strong);
  box-shadow: 24px 0 60px rgba(0,0,0,0.55);
  z-index: 1099;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
}
body.nav-drawer-open .nav-drawer-overlay { opacity: 1; pointer-events: auto; }
body.nav-drawer-open .nav-drawer { transform: translateX(0); }
body.nav-drawer-open { overflow: hidden; }

.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.nav-drawer-title {
  font-size: 14px; font-weight: 700; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.nav-drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--fg-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: 0.15s;
  padding: 0;
  font-family: inherit;
}
.nav-drawer-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 10px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
}

/* Drawer item adaptations: stack vertically, full-width, larger touch targets */
.nav-drawer-body .nav-links-group,
.nav-drawer-body .navbar-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
.nav-drawer-body .nav-link-item,
.nav-drawer-body .nav-link-custom {
  display: flex; align-items: center;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  min-height: 44px;
}
.nav-drawer-body .nav-search-bar {
  width: 100% !important;
  height: 44px;
}
.nav-drawer-body .nav-match,
.nav-drawer-body .nav-cta {
  width: 100%;
  justify-content: center;
  height: 44px;
}
.nav-drawer-body .btn-logout {
  width: 100%;
  justify-content: center;
  padding: 12px 14px;
  margin-left: 0 !important;
  min-height: 44px;
}
.nav-drawer-body .nav-logout-icon {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,90,90,0.08);
  color: #ff97a5;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav-hamb { display: inline-flex; }
  .main-nav {
    gap: 12px;
    padding: 0 14px;
    padding-left: max(14px, env(safe-area-inset-left, 0));
    padding-right: max(14px, env(safe-area-inset-right, 0));
  }
  /* Brand stays visible but compact */
  .nav-brand-name { font-size: 15px; }
  .nav-spacer { flex: 1; }
  /* Bell + avatar always visible */
  .nav-bell, .nav-avatar, .nav-av-btn { flex-shrink: 0; }
  /* Page padding tighter */
  .page-wrap, .landing, .servers-page, .profile-page, .page-scroll {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  /* Bigger tap targets globally */
  .btn, .btn-gaming, .btn-gaming-outline, .btn-pink-grad, .scb-btn, .scb-create-btn {
    min-height: 44px;
  }
}

/* =========================================================
   Mobile chat sidebar overlay (≤900px)
   ========================================================= */
.mobile-sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--fg-1);
  align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-right: 4px;
  flex-shrink: 0;
  font-family: inherit;
}
.mobile-sidebar-toggle:hover { background: rgba(255,255,255,0.08); }

.mobile-sidebar-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}

@media (max-width: 900px) {
  .mobile-sidebar-toggle { display: inline-flex; }

  .channels-page {
    position: relative;
  }
  .channels-page .sidebar.mobile-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: min(82vw, 280px);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: 12px 0 40px rgba(0,0,0,0.5);
  }
  .channels-page.sidebar-open .sidebar.mobile-sidebar { transform: translateX(0); }
  .channels-page.sidebar-open .mobile-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .channels-page .chat-area { width: 100%; }

  /* 4-panel chat: hide members on mobile, single column */
  .chat-4panel {
    grid-template-columns: 1fr !important;
    grid-template-areas: "rail" "main" !important;
  }
  .ch-members, .members-panel, .mb-sidebar, .members { display: none !important; }

  /* Voice panel becomes full-width at bottom */
  .voice-panel {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0)) !important;
  }

  /* Hero / landing tweaks */
  .hero-title { font-size: clamp(36px, 9vw, 56px) !important; }
  .hero-sub { font-size: 16px; }
  .hero-trust { grid-template-columns: 1fr !important; gap: 10px; margin-top: 32px; }
  .trust-item { padding: 16px 18px; }

  /* Servers grid full-width */
  .servers-grid, .servers-grid-v2 { grid-template-columns: 1fr !important; }

  /* CTA strip stacked */
  .cta-strip { padding: 36px 22px; }
  .cta-strip h3 { font-size: 24px; }

  /* Footer single column on very small */
  .site-footer, .footer { grid-template-columns: 1fr 1fr !important; gap: 20px; padding: 36px 0 48px; }
}

@media (max-width: 540px) {
  .site-footer, .footer { grid-template-columns: 1fr !important; }
  .nav-search-bar { display: none; } /* if user wants to keep, drawer still has one */
}

/* iOS-friendly: prevent input zoom on focus */
@media (max-width: 900px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="number"], input[type="tel"],
  input[type="url"], textarea, select, .form-control, .chat-form input,
  .nav-search-bar input {
    font-size: 16px !important;
  }
}

/* =========================================================
   Mobile adaptation (≤900px) — DM, Friends, Voice, Channels
   ========================================================= */
@media (max-width: 900px) {

  /* ---- A. DM /Index (список + welcome) ----
     На мобиле показываем только список во всю ширину,
     "выбери диалог" скрываем — на /DM/Chat показывается уже сам диалог,
     и список там не отрисовывается на бэкенде, так что dm-dialog там
     единственный — займёт весь экран автоматически. */
  .dm-shell { height: calc(100vh - 64px); height: calc(100dvh - 64px); }

  .dm-cpanel {
    padding: 8px 12px;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .dm-cpanel::-webkit-scrollbar { display: none; }
  .dm-cpanel .cp-btn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .dm-cpanel .cp-spacer { display: none; }
  .dm-cpanel .cp-search {
    flex: 1; min-width: 140px;
    height: 36px;
  }
  .dm-cpanel .cp-search input { font-size: 16px; }

  .dm-body { flex-direction: column; }

  .dm-list-col {
    width: 100% !important;
    flex: 1; min-height: 0;
    border-right: none !important;
  }
  /* Welcome-панель на /DM/Index — не нужна на мобиле */
  .dm-dialog:has(.dm-welcome) { display: none !important; }

  .dm-list-head { padding: 12px 14px 8px; }
  .dm-new-form { padding: 8px 12px; }
  .dm-chat-row { padding: 10px 12px; gap: 12px; min-height: 56px; }
  .dm-chat-av { width: 44px; height: 44px; }

  /* ---- DM /Chat (сам диалог) ---- */
  .dm-dialog { width: 100%; }
  .dm-dialog-head {
    padding: 10px 14px;
    gap: 10px;
  }
  .dm-dialog-head .back {
    width: 36px; height: 36px;
    display: grid !important; place-items: center;
  }
  .dm-dialog-head .who-av { width: 36px; height: 36px; }
  .dm-dialog-head .who-nm { font-size: 14px; }
  .dm-dialog-head .actions .iconbtn {
    width: 36px; height: 36px;
  }
  /* Поле ввода и safe-area внизу */
  .dm-dialog .chat-form,
  .dm-dialog form[id*="send"],
  .dm-dialog .composer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  }

  /* ---- B. Friends ---- */
  .friends-subtabs {
    padding: 8px 10px 0;
    gap: 2px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .friends-subtabs::-webkit-scrollbar { display: none; }
  .friends-subtabs .subtab {
    padding: 8px 10px 10px;
    font-size: 12px;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .friends-subtabs .subtab .count {
    font-size: 10px;
    padding: 0 6px;
    line-height: 16px;
  }
  .friends-content { padding: 12px 14px 24px; }

  /* Форма добавления друга — кнопка под input'ом */
  .friends-add-form {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  .friends-add-form input {
    min-width: 0;
    width: 100%;
    flex-basis: 100%;
    font-size: 16px;
  }
  .friends-add-form button,
  .friends-add-form .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Карточка друга — компактнее */
  .friend-row { padding: 10px; gap: 10px; }
  .friend-av { width: 40px; height: 40px; }
  .friend-nm { font-size: 14px; gap: 6px; flex-wrap: wrap; }
  .friend-tag { font-size: 11px; }
  .friend-state { font-size: 12px; }
  .friend-actions { gap: 4px; }
  .ficonbtn { width: 40px; height: 40px; }

  /* ---- C. Voice chat ---- */
  .voice-stage { height: 100%; }
  .voice-stage .chat-head {
    padding: 10px 14px;
    gap: 8px;
  }
  .voice-stage .chat-head h1 { font-size: 16px; }

  .video-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    padding: 10px;
  }
  /* Если в комнате один — занимает всю ширину */
  .video-grid > *:only-child { grid-column: 1 / -1; }

  .voice-empty { padding: 32px 16px; }
  .voice-empty-icon svg { width: 40px; height: 40px; }
  .voice-empty h3 { font-size: 17px; }

  /* Нижняя панель управления голосом — фиксируем, safe-area */
  .voice-controls-bar {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .zc-btn {
    min-width: 56px;
    min-height: 44px;
    padding: 6px 10px;
    font-size: 10px;
  }
  .zc-divider { display: none; }
  .zc-btn.zc-btn-leave {
    /* Кнопка "выйти" на всю ширину снизу для предотвращения промахов */
    flex-basis: 100%;
    flex-direction: row;
    gap: 8px;
    margin-top: 4px;
    min-height: 48px;
  }

  /* ---- D. Channels /Index (текстовый чат) ---- */
  .channels-page .chat-header {
    padding: 0 14px;
    gap: 8px;
  }
  .channels-page .chat-header h3 { font-size: 14px; }
  .channels-page .messages {
    padding: 14px 12px;
  }
  .channels-page .chat-form {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    gap: 8px;
  }
  .channels-page .chat-form input {
    font-size: 16px;
    padding: 10px 12px;
  }
  /* Сообщения — компактнее */
  .channels-page .message { margin-bottom: 12px; }
  .channels-page .message-header { gap: 6px; }
  .channels-page .username { font-size: 13px; }
  .channels-page .timestamp { font-size: 10px; }
  .channels-page .message-content { font-size: 14px; }
}


