:root {
  color-scheme: dark;
  --bg: #313338;
  --sidebar: #2b2d31;
  --dark: #1e1f22;
  --panel: #2b2d31;
  --elevated: #232428;
  --surface: #2b2d31;
  --surface-hover: #35373c;
  --surface-active: #3f4248;
  --menu: #111214;
  --text: #f2f3f5;
  --text-secondary: #dbdee1;
  --muted: #949ba4;
  --muted-soft: #b5bac1;
  --border: #1e1f22;
  --border-soft: #3f4147;
  --input: #383a40;
  --accent: #5865f2;
  --danger: #ed4245;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-soft: rgba(0, 0, 0, 0.2);
  --presence-ring: #232428;
  --overlay: rgba(0, 0, 0, 0.55);
  --accent-soft: rgba(88, 101, 242, 0.15);
  --danger-soft: rgba(242, 63, 67, 0.15);
  --login-glow: rgba(88, 101, 242, 0.22);
  --message-hover: #2e3035;
  --accent-hover: #4752c4;
  --header-bg: rgba(30, 31, 34, 0.92);
  --rail-bg: #1e1f22;
  --shell-bg: #1e1f22;
  --logo-blend: screen;
  --on-accent: #ffffff;
  --link: #00a8fc;
  --error-text: #f5b1b2;
  --warning-bg: rgba(237, 66, 69, 0.12);
  --warning-text: #f5b1b2;
  --warning-border: rgba(237, 66, 69, 0.22);
  --card-bg: var(--dark);
  --card-border: var(--border-soft);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --sidebar: #ebedf2;
  --dark: #dfe3ea;
  --panel: #ffffff;
  --elevated: #e4e7ee;
  --surface: #e2e5ec;
  --surface-hover: #d5dae3;
  --surface-active: #c8ced9;
  --menu: #ffffff;
  --text: #16181d;
  --text-secondary: #2b3038;
  --muted: #586070;
  --muted-soft: #6d7585;
  --border: #c5cad4;
  --border-soft: #b5bcc8;
  --input: #ffffff;
  --accent: #325fb2;
  --accent-hover: #2a5099;
  --danger: #d83c3e;
  --shadow: rgba(22, 30, 46, 0.12);
  --shadow-soft: rgba(22, 30, 46, 0.06);
  --presence-ring: #ebedf2;
  --overlay: rgba(22, 28, 40, 0.38);
  --accent-soft: rgba(50, 95, 178, 0.12);
  --danger-soft: rgba(216, 60, 62, 0.1);
  --message-hover: rgba(50, 95, 178, 0.07);
  --login-glow: rgba(50, 95, 178, 0.12);
  --login-bg-top: #eef1f7;
  --login-bg-bottom: #e2e7f0;
  --login-panel-bg: #ffffff;
  --login-panel-border: #c8d0de;
  --login-tab-bg: #e8ecf3;
  --login-tab-text: #586070;
  --login-input-bg: #f7f9fc;
  --login-input-border: #b8c2d0;
  --login-label: #434956;
  --header-bg: rgba(244, 245, 248, 0.94);
  --rail-bg: #d2d7e1;
  --shell-bg: #c6ccd8;
  --logo-blend: normal;
  --on-accent: #ffffff;
  --link: #0068c9;
  --error-text: #b42318;
  --warning-bg: #fde8e9;
  --warning-text: #8a1f23;
  --warning-border: #f0b4b6;
  --card-bg: #ffffff;
  --card-border: var(--border-soft);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body:has(#login:not(.hidden)) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(88, 101, 242, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(35, 165, 89, 0.08), transparent 50%),
    radial-gradient(ellipse 45% 35% at 0% 80%, rgba(88, 101, 242, 0.1), transparent 45%),
    linear-gradient(180deg, #1a1b1e 0%, var(--bg) 42%, #2a2d33 100%);
}

body:has(#login:not(.hidden)) #login.login-panel {
  margin: auto !important;
}

html.has-session #login {
  display: none !important;
}

html.has-session #app {
  display: grid !important;
}

html.has-session,
html.has-session body,
html.has-session body:has(#login:not(.hidden)) {
  background: var(--shell-bg);
}

.boot-splash {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(88, 101, 242, 0.22), transparent 55%),
    #1e1f22;
  color: var(--text);
}

html.is-booting .boot-splash {
  display: flex;
}

/* Desktop: nunca mostrar o boot-splash da web (logo Lula) — o Electron já fez o loading */
html.concord-desktop .boot-splash,
html.concord-desktop.is-booting .boot-splash {
  display: none !important;
}

html.concord-desktop.is-booting #login,
html.concord-desktop.is-booting #app {
  visibility: visible !important;
  pointer-events: auto !important;
}

html.is-booting #login,
html.is-booting #app {
  visibility: hidden !important;
  pointer-events: none !important;
}

.boot-splash-logo,
.lula-wrap.boot-splash-logo {
  display: block;
  width: min(112px, 32vw);
  height: 140px;
  max-height: 140px;
  color: #fff;
  border: 0;
  background: transparent;
  pointer-events: none;
  overflow: visible;
  animation: boot-logo-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lula-wrap .lula-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lula-wrap .lula-svg .lula-shape {
  fill: #ffffff;
}

.lula-bob {
  transform-box: view-box;
  transform-origin: 770px 950px;
  animation: lula-bob 2.8s ease-in-out infinite;
}

@keyframes lula-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

.boot-splash-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #5865f2;
  animation: boot-spin 0.75s linear infinite;
}

.boot-splash-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes boot-logo-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[data-theme="light"] .boot-splash {
  background:
    radial-gradient(ellipse 70% 50% at 50% 15%, rgba(50, 95, 178, 0.16), transparent 55%),
    #eef1f7;
}

[data-theme="light"] .boot-splash-spinner {
  border-color: rgba(50, 95, 178, 0.18);
  border-top-color: #325fb2;
}

[data-theme="light"] .boot-splash-text {
  color: #5b6575;
}

.hidden {
  display: none !important;
}

html.devtools-open body {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

html.devtools-open::before {
  content: "Feche as ferramentas de desenvolvedor (F12) para usar o Concord.";
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  font: 600 18px/1.45 "Segoe UI", sans-serif;
  color: #f2f3f5;
  background: rgba(10, 12, 18, 0.92);
  pointer-events: auto;
}

.banner {
  margin: 0;
  padding: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: #3a2a12;
  color: #f3d7a0;
  line-height: 1.45;
  text-align: center;
  flex-shrink: 0;
}

.banner a {
  color: #8cb4ff;
}

.panel {
  width: min(420px, calc(100% - 24px));
  margin: max(16px, 8vh) auto;
  padding: clamp(16px, 5vw, 28px);
  background: var(--dark);
  border-radius: 12px;
  box-shadow: 0 20px 50px var(--shadow);
}

#login.login-panel.panel {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  z-index: 20;
  align-self: auto;
  flex-shrink: 0;
}

.login-panel {
  text-align: center;
  padding-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(165deg, rgba(47, 49, 54, 0.98) 0%, rgba(30, 31, 34, 0.98) 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(88, 101, 242, 0.08);
  animation: login-panel-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes login-panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.login-brand {
  margin-bottom: 4px;
}

.login-logo,
.lula-wrap.login-logo {
  display: block;
  width: min(138px, 42%);
  height: 168px;
  max-height: 168px;
  margin: 0 auto 6px;
  color: #fff;
  border: 0;
  background: transparent !important;
  pointer-events: none;
  user-select: none;
  overflow: visible;
  animation: login-logo-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

@keyframes login-logo-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-wordmark {
  margin: 0 0 6px;
  font-family: Syne, "DM Sans", sans-serif;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  animation: login-logo-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.login-welcome {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
}

.login-sub {
  margin: 0 auto 2px;
  max-width: 36ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.login-panel .tabs,
.login-panel form,
.login-panel #conn,
.login-panel .auth-error {
  text-align: left;
}

.login-panel .tabs {
  margin: 14px 0 8px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  gap: 4px;
}

.login-panel .tab {
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.login-panel .tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04);
}

.login-panel .tab.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.login-panel label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 10px 0;
}

.login-panel input {
  display: block;
  box-sizing: border-box;
  background: var(--input);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-panel input:focus,
.login-panel input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-panel input:-webkit-autofill,
.login-panel input:-webkit-autofill:hover,
.login-panel input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--input) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.login-panel #auth-submit {
  margin-top: 8px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.28);
}

.login-panel #auth-submit:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.login-panel #auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 8px;
}

.tab {
  background: var(--dark);
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  color: white;
}

label {
  display: block;
  margin: 14px 0;
  font-size: 0.9rem;
}

input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: var(--text);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

button.secondary {
  background: var(--surface-active);
}

button.ghost {
  background: transparent;
  color: var(--muted);
}

button.tiny {
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted,
.hint {
  color: var(--muted);
  line-height: 1.4;
}

.auth-error {
  color: var(--danger);
  margin: 0 0 12px;
}

.auth-error.ok {
  color: #23a559;
}

#conn.ok {
  color: #23a559;
}

#conn.bad {
  color: var(--danger);
}

#auth-form button {
  width: 100%;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.auth-remember input[type="checkbox"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent, #5865f2);
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  background: transparent;
  border: none;
}

.auth-remember span {
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 0.9rem;
}

.auth-forgot {
  margin-top: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.auth-forgot:hover {
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, 220px);
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.nav-shell {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 100%;
  max-height: 100%;
  background: var(--rail-bg);
}

.nav-upper {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
}

button.sidebar-toggle,
button.sidebar-close {
  display: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.header-copy {
  min-width: 0;
}

.header-copy strong,
.header-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar,
.members-panel {
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
  max-height: none;
  height: auto;
  align-self: stretch;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.18);
}

.main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  background: var(--bg);
}

.members-panel {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
}

.guild-rail {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  background: var(--rail-bg);
  min-height: 0;
  max-height: none;
  overflow: hidden;
  align-self: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.server-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
  padding: 0 0 8px;
}

.guild-sep {
  width: 32px;
  height: 2px;
  margin: 4px 0 8px;
  background: linear-gradient(90deg, transparent, var(--border-soft), transparent);
  border-radius: 1px;
  flex-shrink: 0;
}

.guild-btn {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.guild-btn::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), height 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.guild-btn:hover::before {
  transform: scaleY(1);
  height: 20px;
}

.guild-btn.active::before {
  transform: scaleY(1);
  height: 40px;
  background: var(--accent);
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: background 0.15s ease, border-radius 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.guild-btn:hover .guild-icon,
.guild-btn.active .guild-icon {
  border-radius: 16px;
}

.guild-btn:hover .guild-icon {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

.guild-btn.home .home-icon {
  background: #3b6cff;
}

.guild-btn.home.active .home-icon,
.guild-btn.home:hover .home-icon {
  background: #3b6cff;
}

.home-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.server-icon {
  font-weight: 700;
  font-size: 1.1rem;
}

.guild-btn.active .server-icon {
  background: var(--accent);
}

.guild-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger);
  border: 3px solid var(--dark);
  border-radius: 8px;
  font-size: 0.65rem;
  line-height: 10px;
  display: grid;
  place-items: center;
  z-index: 1;
}

.sidebar-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dm-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 8px;
  padding: 0 10px;
  background: var(--dark);
  border-radius: 4px;
  color: var(--muted);
}

.dm-search-wrap input {
  margin: 0;
  padding: 8px 0;
  background: transparent;
  font-size: 0.85rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 0 8px 4px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
}

.nav-link i {
  font-size: 1.15rem;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-active);
  color: var(--text);
}

.dm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dm-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 8px;
}

.dm-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
}

.dm-person:hover,
.dm-person.active {
  background: var(--surface-active);
  color: var(--text);
}

.dm-person.has-unread .dm-person-name {
  font-weight: 700;
  color: var(--text);
}

.dm-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-list-empty {
  margin: 8px 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.brand,
.members-panel h2 {
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 56px;
  position: relative;
  overflow: hidden;
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.brand.has-banner {
  min-height: 135px;
  align-items: flex-end;
  padding: 14px 16px;
  border-bottom: none;
  background-color: #1e1f22;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.brand.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

.brand.has-banner > * {
  position: relative;
  z-index: 1;
}

.brand.has-banner #brand-title,
.brand.has-banner .brand-text strong {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.brand.has-banner #brand-sub,
.brand.has-banner .brand-text .muted {
  display: none;
}

.brand.has-banner .guild-settings-btn,
.brand.has-banner .sidebar-close {
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
}

.brand.has-banner .guild-settings-btn:hover,
.brand.has-banner .sidebar-close:hover {
  background: rgba(0, 0, 0, 0.42);
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 86px;
  height: 72px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: var(--logo-blend);
  flex-shrink: 0;
  pointer-events: none;
  border-radius: 16px;
}

.brand-text strong,
#brand-title {
  font-family: Syne, "DM Sans", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand-text .muted,
#brand-sub {
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.brand.is-home {
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand-text span,
.members-panel h2 {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.members-panel h2 {
  margin: 0;
}

.create-room {
  display: flex;
  padding: 0 12px 12px;
}

.create-room-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.create-room-btn:hover {
  transform: translateY(-1px);
}

.create-room-btn i {
  font-size: 1.05rem;
}

.room-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 500;
  border-radius: 8px;
}

.room-item > .room-item-name {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.room-item > .room-item-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-item > .room-item-count {
  flex-shrink: 0;
}

.room-icon {
  flex: none;
  margin-right: 6px;
  opacity: 0.75;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
}

.modal-backdrop.hidden {
  display: none;
}

.room-modal {
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.room-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 4px;
}

.room-modal-head-copy strong {
  font-size: 1.05rem;
}

.room-modal-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.room-modal-body {
  padding: 4px 16px 16px;
  overflow: auto;
}

.room-modal-label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.room-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.room-type {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.room-type:not(.is-selected) .room-type-check {
  opacity: 0;
}

.room-type.is-selected {
  background: var(--surface-active);
}

.room-type-icon {
  flex: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.room-type-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-type-copy span {
  color: var(--muted);
  font-size: 0.76rem;
}

.room-type-check {
  flex: none;
  font-size: 1.15rem;
  color: var(--accent);
}

.room-section-head {
  margin: 10px 0 4px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.room-item.text-room .room-item-count {
  display: none;
}

.room-icon.text {
  font-size: 1rem;
  font-weight: 700;
}

.text-channel-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.text-channel-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.text-channel-inner {
  width: 100%;
  padding: 16px 16px 8px;
}

.text-channel-messages {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.text-channel-welcome {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 16px;
  margin-bottom: 16px;
}

.text-channel-welcome-icon {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  color: var(--text-secondary);
  display: block;
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 4px;
}

.text-channel-welcome h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.text-channel-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 100%;
}

.text-channel-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.channel-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--role-color) 28%, transparent);
  background: color-mix(in srgb, var(--role-color) 16%, var(--card-bg));
  color: color-mix(in srgb, var(--role-color) 62%, var(--text));
  font-size: 0.78rem;
  font-weight: 600;
}

.channel-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--role-color);
  flex-shrink: 0;
}

.channel-date-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.channel-date-divider::before,
.channel-date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.text-channel-composer {
  flex: none;
  padding: 0 16px 24px;
  background: var(--bg);
}

.text-channel-composer-inner {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
}

.text-channel-compose-box {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0 8px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--input);
  border: none;
}

.text-channel-compose-box:focus-within {
  border: none;
  box-shadow: none;
}

.text-channel-compose-box.is-dragover {
  outline: 2px dashed #5865f2;
  outline-offset: 2px;
}

.compose-plus {
  flex: none;
  width: 40px;
  height: 44px;
  color: var(--muted-soft) !important;
}

.compose-plus:hover {
  color: var(--text-secondary) !important;
}

.text-channel-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 8px;
}

.text-channel-attach-preview {
  position: relative;
  align-self: flex-start;
  max-width: 280px;
}

.text-channel-attach-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid var(--dark);
}

.text-channel-attach-preview .icon-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65) !important;
  color: #fff !important;
}

#text-channel-input {
  width: 100%;
  min-height: 22px;
  max-height: 160px;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1.375;
  padding: 0;
  outline: none;
  box-shadow: none;
}

#text-channel-input:focus,
#text-channel-input:focus-visible {
  outline: none;
  box-shadow: none;
  border: none;
}

#text-channel-input::placeholder {
  color: var(--muted);
}

.text-channel-compose-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex: none;
}

.text-channel-compose-actions .icon-btn {
  width: 32px;
  height: 44px;
  color: var(--muted-soft) !important;
}

.text-channel-compose-actions .icon-btn:hover {
  color: var(--text-secondary) !important;
}

.compose-send:hover {
  color: var(--accent) !important;
}

.channel-emoji-picker {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% + 8px);
  z-index: 5;
}

.channel-message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 2px 48px 2px 16px;
  margin: 0;
  border-radius: 0;
  position: relative;
  z-index: 0;
}

.channel-message:hover,
.channel-message.is-menu-open,
.channel-message:has(.channel-message-toolbar:hover) {
  z-index: 6;
}

.channel-message-toolbar {
  position: absolute;
  top: -14px;
  right: 0;
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 8;
  pointer-events: auto;
}

.channel-message:hover .channel-message-toolbar,
.channel-message-toolbar:hover {
  display: inline-flex;
}

.channel-message-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  margin: 0;
  font-weight: normal;
  line-height: 1;
}

.channel-toolbar-emoji {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
}

.channel-toolbar-emoji:hover {
  background: var(--surface-active);
}

.channel-toolbar-more {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--muted-soft) !important;
}

.channel-toolbar-more:hover {
  background: var(--surface-active) !important;
  color: var(--text) !important;
}

.channel-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.channel-reactions.hidden {
  display: none;
}

.channel-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

.channel-reaction-chip.is-self {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.channel-reaction-chip:hover {
  background: var(--surface-hover);
}

.channel-msg-menu {
  position: fixed;
  z-index: 100;
  min-width: 220px;
  padding: 6px;
  border-radius: 4px;
  background: var(--menu);
  border: 1px solid var(--dark);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.channel-msg-menu.hidden {
  display: none;
}

.channel-msg-menu-quick {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--surface);
  margin-bottom: 4px;
}

.channel-msg-menu-quick button {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: normal;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.channel-msg-menu-quick button:hover {
  background: var(--surface-active);
}

.channel-msg-menu button[role="menuitem"] {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: normal;
  text-align: left;
  cursor: pointer;
}

.channel-msg-menu button[role="menuitem"] i {
  flex: none;
  width: 16px;
  text-align: center;
}

.channel-msg-menu button[role="menuitem"]:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.channel-msg-menu button[role="menuitem"].danger-item {
  color: #f23f43;
}

.channel-msg-menu button[role="menuitem"].danger-item:hover {
  background: #f23f43;
  color: var(--on-accent);
}

.channel-msg-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--surface);
}

.channel-message:not(.is-compact) {
  margin-top: 17px;
}

.channel-message:not(.is-compact):first-child {
  margin-top: 0;
}

.channel-message:hover {
  background: var(--message-hover);
}

.channel-message.is-compact {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.channel-message.is-compact .channel-message-avatar {
  visibility: hidden;
}

.channel-message.is-compact .channel-message-head {
  display: none;
}

.channel-message.is-compact::before {
  content: attr(data-hover-time);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  text-align: center;
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
}

.channel-message.is-compact:hover::before {
  opacity: 1;
}

.channel-message-avatar {
  padding-top: 2px;
}

.channel-message-avatar .avatar.small {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  cursor: pointer;
}

.channel-message-body {
  position: relative;
  min-width: 0;
  padding: 0 0 2px;
}

.channel-message-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 0;
  line-height: 1.375;
}

.channel-message-head strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.channel-message-head strong:hover {
  text-decoration: underline;
}

.channel-message-head time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.channel-message-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.375;
  word-break: break-word;
  white-space: pre-wrap;
}

.channel-message-text a {
  color: var(--link);
  text-decoration: none;
}

.channel-message-text a:hover {
  text-decoration: underline;
}

.channel-message-embeds {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.channel-youtube-embed {
  position: relative;
  width: min(430px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}

.channel-youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.channel-link-embed {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(430px, 100%);
  padding: 12px;
  border-radius: 4px;
  background: var(--surface);
  border-left: 4px solid #5865f2;
  color: var(--text-secondary);
  text-decoration: none;
}

.channel-link-embed:hover {
  background: var(--surface-hover);
}

.channel-link-embed strong {
  display: block;
  color: #00a8fc;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.channel-link-embed span {
  color: var(--muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.channel-message-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.channel-attachment-image {
  display: block;
  max-width: min(400px, 100%);
  max-height: 300px;
  border-radius: 8px;
  cursor: zoom-in;
  object-fit: contain;
  background: var(--surface);
}

.channel-attachment-image:hover {
  filter: brightness(1.04);
}

.channel-attachment-broken {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px dashed var(--border-soft);
  color: var(--muted);
  font-size: 0.82rem;
}

.main:has(.text-channel-view:not(.hidden)) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main:has(.text-channel-view:not(.hidden)) .actions {
  display: none;
}

.main:has(.text-channel-view:not(.hidden)) #grid,
.main:has(.text-channel-view:not(.hidden)) #empty-hint,
.main:has(.text-channel-view:not(.hidden)) #cursor-tip {
  display: none;
}

.main:has(.text-channel-view:not(.hidden)) header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.room-name-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 12px;
  border-radius: 8px;
  background: var(--dark);
}

.room-name-field > i {
  flex: none;
  color: var(--muted);
}

.room-name-field input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 11px 0;
  background: transparent;
}

.emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 2px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface);
}

.emoji-picker.hidden {
  display: none;
}

.emoji-option {
  padding: 5px 0;
  border-radius: 6px;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1.2;
}

.emoji-option:hover {
  background: var(--surface-active);
}

.room-modal-error {
  margin: 12px 0 0;
  color: var(--error-text);
  font-size: 0.8rem;
}

.room-modal-error.hidden {
  display: none;
}

.room-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
}

.stream-request-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding-top: 8px;
}

.stream-request-body .avatar {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
}

.stream-request-text {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.stream-request-text strong {
  color: var(--text);
}

.guild-settings-btn {
  margin-right: 4px;
}

.guild-btn.add:hover .add-icon {
  background: #23a559;
  color: #fff;
}

.guild-btn.add .add-icon {
  background: var(--bg);
  color: #23a559;
  font-size: 1.4rem;
}

.guild-icon.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.guild-settings-modal {
  width: min(520px, 100%);
}

.guild-settings-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: min(70dvh, 620px);
  overflow: auto;
}

.guild-settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guild-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guild-settings-icon-preview {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 1.8rem;
  background: #5865f2;
}

.guild-banner-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guild-settings-banner-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 140px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #3a3c45 0%, #2b2d31 55%, #1e1f22 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0;
  cursor: pointer;
  display: block;
  box-sizing: border-box;
}

.guild-settings-banner-preview.is-disabled,
.guild-banner-upload.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.guild-settings-banner-preview.has-image {
  background-color: #1e1f22;
}

.guild-banner-status[data-kind="error"] {
  color: #f23f43;
}

.guild-banner-status[data-kind="ok"] {
  color: #3ba55d;
}

.guild-banner-status[data-kind="info"] {
  color: var(--muted);
}

.guild-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.guild-invite-actions {
  display: flex;
  gap: 8px;
}

.guild-invite-link {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

.invite-join-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.invite-card {
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.invite-banner {
  height: 120px;
  background: linear-gradient(135deg, #5865f2 0%, #3c45a5 55%, var(--surface) 100%);
}

.invite-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.35) !important;
  color: #fff !important;
}

.invite-close:hover {
  background: rgba(0, 0, 0, 0.55) !important;
}

.invite-card-body {
  padding: 0 24px 20px;
  margin-top: -42px;
  text-align: center;
}

.invite-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.invite-guild-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: #5865f2;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  border: 6px solid var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.invite-guild-icon.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invite-kicker {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.invite-guild-name {
  margin: 0 0 16px;
  font-size: 1.65rem;
  line-height: 1.15;
  color: var(--text);
}

.invite-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
  margin-bottom: 16px;
}

.invite-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted-soft);
}

.invite-stat strong {
  color: var(--text);
  font-size: 0.95rem;
}

.invite-stat i {
  color: var(--muted);
  font-size: 0.8rem;
}

.invite-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.invite-dot.online {
  background: #23a559;
  box-shadow: 0 0 0 3px rgba(35, 165, 89, 0.2);
}

.invite-dot.member {
  background: var(--muted);
}

.invite-creator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.invite-creator .avatar.small {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.invite-creator strong {
  color: var(--text);
}

.invite-rooms-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.invite-room-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-soft);
  font-size: 0.78rem;
}

.invite-room-chip i {
  color: var(--muted);
}

.invite-members-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 8px;
}

.invite-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.invite-member-chip .avatar.small {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.invite-already {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(35, 165, 89, 0.12);
  color: #57f287;
  font-size: 0.85rem;
}

.invite-card-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  background: var(--surface);
}

.invite-card-foot button:last-child {
  min-width: 148px;
}

.guild-settings-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.danger-label {
  color: #ed4245;
}

#guild-delete-btn {
  margin-top: 8px;
  background: #ed4245;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

#guild-delete-btn:hover {
  background: #c93437;
}

.guild-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guild-admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
}

.guild-admin-row .avatar.small {
  flex-shrink: 0;
}

.guild-admin-main {
  flex: 1;
  min-width: 0;
}

.guild-admin-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.guild-admin-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.guild-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.guild-admin-actions select {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.guild-admin-actions button {
  padding: 4px 8px;
  font-size: 0.78rem;
}

.user-menu-role select {
  width: 100%;
  margin-top: 6px;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 8px;
}

.user-menu button.danger-item {
  color: #f47b7b;
}

.user-menu button.danger-item:hover {
  background: rgba(240, 71, 71, 0.12);
}

.guild-icon.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.room-item:hover,
.room-item.active {
  background: var(--surface-active);
  color: var(--text);
}

.room-block {
  margin-bottom: 8px;
}

.room-people {
  padding: 6px 10px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-person {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 6px 8px;
  min-width: 0;
  border-radius: 6px;
  cursor: pointer;
}

.room-person:hover,
#members li:hover {
  background: var(--surface-active);
}

.room-person.has-unread .room-person-name,
#members li.has-unread span {
  font-weight: 700;
  color: var(--text);
}

.room-person.is-muted,
#members li.is-muted {
  opacity: 0.72;
}

.room-person > div {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.room-person > div .room-person-name,
.game-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.person-name-row .room-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-flags {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
  color: #f23f43;
  font-size: 0.85rem;
  line-height: 1;
}

.voice-deafen {
  position: relative;
}

.voice-deafen::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 115%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-42deg);
}

.discord-panel {
  background: var(--elevated);
  border-top: 1px solid var(--menu);
  flex-shrink: 0;
  width: 100%;
}

.game-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--menu);
  font-size: 0.9rem;
  min-width: 0;
}

.game-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.voice-box {
  padding: 10px 12px;
  border-bottom: 1px solid var(--menu);
}

.voice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.voice-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.voice-ok {
  color: #23a559;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-channel {
  color: var(--muted);
  font-size: 0.8rem;
}

.voice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.icon-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px;
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  overflow: visible;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-chip:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.icon-chip i,
.icon-chip .dc-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.icon-chip .dc-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.icon-chip .ic-off {
  display: none;
}

.icon-chip.muted .ic-on,
.icon-chip.swap-active.active .ic-on {
  display: none;
}

.icon-chip.muted .ic-off,
.icon-chip.swap-active.active .ic-off {
  display: grid;
}

.icon-chip small {
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.icon-chip.active {
  background: #3ba55d;
  color: var(--on-accent);
}

.icon-chip.active:hover:not(:disabled) {
  background: #2d8748;
}

.icon-chip.muted {
  background: #ed4245;
  color: var(--on-accent);
}

.icon-chip.muted:hover:not(:disabled) {
  background: #c03537;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  overflow: visible;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover:not(:disabled):not(.danger) {
  background: var(--surface-hover);
  color: var(--text);
}

.icon-btn i {
  font-size: 1rem;
}

.icon-btn .dc-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

.icon-btn.danger:hover:not(:disabled) {
  background: #ed4245;
  color: var(--on-accent);
}

.icon-btn.active {
  background: #3ba55d;
  color: var(--on-accent);
}

.icon-btn.active:hover:not(:disabled) {
  background: #2d8748;
}

.dc-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.dc-icon svg * {
  transform-box: fill-box;
  transform-origin: center;
}

.dc-eq-bar {
  transform-origin: center bottom;
}

#share:hover:not(:disabled) .dc-screen {
  animation: dc-screen 0.45s cubic-bezier(0.34, 1.45, 0.64, 1);
}

#mic:hover:not(:disabled) .dc-mic-body {
  animation: dc-mic 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#mic:hover:not(:disabled) .dc-slash {
  animation: dc-slash 0.4s ease;
}

#deafen:hover:not(:disabled) .dc-cup-l {
  animation: dc-hop 0.38s ease;
}

#deafen:hover:not(:disabled) .dc-cup-r {
  animation: dc-hop 0.38s ease 0.08s;
}

#deafen:hover:not(:disabled) .dc-band {
  animation: dc-hop 0.38s ease 0.04s;
}

#deafen:hover:not(:disabled) .dc-phones,
#deafen:hover:not(:disabled) .dc-slash {
  animation: dc-wiggle 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#self-preview:hover:not(:disabled) .dc-screen {
  animation: dc-screen 0.45s cubic-bezier(0.34, 1.45, 0.64, 1);
}

#leave:hover:not(:disabled) .dc-handset {
  animation: dc-hangup 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#sfx:hover:not(:disabled) .dc-eq-bar:nth-child(1) {
  animation: dc-eq 0.32s ease 0s 2 alternate;
}

#sfx:hover:not(:disabled) .dc-eq-bar:nth-child(2) {
  animation: dc-eq 0.28s ease 0.06s 2 alternate;
}

#sfx:hover:not(:disabled) .dc-eq-bar:nth-child(3) {
  animation: dc-eq 0.36s ease 0.1s 2 alternate;
}

@keyframes dc-mic {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-14deg) translateY(-2px); }
  50% { transform: rotate(10deg) translateY(1px); }
  75% { transform: rotate(-6deg) translateY(-1px); }
}

@keyframes dc-hop {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-2.5px); }
}

@keyframes dc-screen {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.16, 0.88); }
  65% { transform: scale(0.94, 1.1); }
}

@keyframes dc-hangup {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(18deg) translateY(-1px); }
  40% { transform: rotate(-16deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-6deg); }
}

@keyframes dc-wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-10deg); }
  60% { transform: rotate(8deg); }
}

@keyframes dc-slash {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}

@keyframes dc-eq {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  #share:hover:not(:disabled) .dc-screen,
  #mic:hover:not(:disabled) .dc-mic-body,
  #mic:hover:not(:disabled) .dc-slash,
  #deafen:hover:not(:disabled) .dc-cup-l,
  #deafen:hover:not(:disabled) .dc-cup-r,
  #deafen:hover:not(:disabled) .dc-band,
  #deafen:hover:not(:disabled) .dc-phones,
  #deafen:hover:not(:disabled) .dc-slash,
  #self-preview:hover:not(:disabled) .dc-screen,
  #leave:hover:not(:disabled) .dc-handset,
  #sfx:hover:not(:disabled) .dc-eq-bar {
    animation: none;
  }
}

.user-bar {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--elevated);
  padding: 10px 12px;
  min-width: 0;
}

.avatar-wrap {
  position: relative;
  padding: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font: inherit;
}

.avatar-wrap:hover .avatar {
  filter: brightness(1.08);
}

.presence-dot,
.online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  background: #23a559;
  border: 3px solid var(--presence-ring);
  border-radius: 50%;
}

.presence-dot.idle {
  background: #f0b232;
}

.presence-dot.dnd {
  background: #f23f43;
}

.presence-dot.offline,
.presence-dot.invisible {
  background: #80848e;
}

.presence-dot.invisible {
  box-shadow: inset 0 0 0 2px var(--presence-ring);
}

.presence-dot.inline {
  position: static;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-width: 0;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: none;
}

.presence-dot.inline.invisible {
  background: transparent;
  box-shadow: inset 0 0 0 2px #80848e;
}

.avatar-presence {
  position: relative;
  flex-shrink: 0;
}

.avatar-presence .presence-dot {
  width: 14px;
  height: 14px;
  border-color: var(--sidebar);
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.user-meta strong {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px 0;
  font-size: 0.9rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-status {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px;
  background: var(--dark);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-pop {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 10px);
  z-index: 90;
  width: min(340px, calc(100vw - 24px));
  max-height: min(72vh, 560px);
  overflow: visible;
  background: var(--menu);
  border: 1px solid var(--surface);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.profile-banner {
  height: 60px;
  background: #5865f2;
  border-radius: 11px 11px 0 0;
}

.profile-head {
  position: relative;
  z-index: 2;
  min-height: 48px;
  padding: 0 16px;
}

.profile-avatar-wrap {
  position: absolute;
  left: 16px;
  top: -40px;
}

.profile-avatar-wrap .avatar.profile {
  width: 80px;
  height: 80px;
  font-size: 1.7rem;
  border: 6px solid var(--menu);
  box-shadow: none;
  overflow: hidden;
}

.profile-avatar-wrap .presence-dot {
  width: 22px;
  height: 22px;
  right: 2px;
  bottom: 2px;
  border-width: 4px;
  border-color: var(--menu);
}

.profile-bubble {
  position: absolute;
  left: 108px;
  top: 8px;
  max-width: calc(100% - 124px);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px 7px 8px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 500;
  text-align: left;
  overflow: visible;
  cursor: pointer;
}

.profile-bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-left: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  transform: rotate(45deg);
}

.profile-bubble-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-style: normal;
}

.profile-bubble-plus i {
  font-size: 0.75rem;
}

.profile-bubble.has-status .profile-bubble-plus {
  display: none;
}

#profile-bubble-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profile-bubble-text.is-placeholder {
  color: var(--muted);
}

.custom-status-pop {
  position: absolute;
  left: 108px;
  right: 12px;
  top: 52px;
  z-index: 8;
  width: auto;
  padding: 12px;
  background: var(--dark);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.custom-status-pop strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.custom-status-pop input {
  margin: 0;
  background: var(--menu);
}

.custom-status-emojis {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.custom-status-emojis button {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface);
  font-size: 1rem;
}

.custom-status-emojis button:hover {
  background: var(--surface-hover);
}

.custom-status-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.custom-status-actions button {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.profile-body {
  position: relative;
  padding: 12px 16px 16px;
}

.profile-body > strong {
  display: block;
  font-size: 1.25rem;
}

.profile-handle {
  display: block;
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-card {
  margin-top: 8px;
  padding: 4px;
  background: var(--surface);
  border-radius: 8px;
}

.profile-card-head {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-voice-room {
  padding: 4px 10px 10px;
  font-weight: 600;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  border-radius: 4px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

.profile-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.profile-row.danger {
  color: #f23f43;
}

.profile-row.danger:hover {
  background: #3d1f21;
}

.profile-row i {
  margin-right: 8px;
}

.profile-row .bi-chevron-right {
  margin-right: 0;
  margin-left: 8px;
  color: var(--muted);
}

.profile-password {
  display: grid;
  gap: 8px;
  padding: 4px 10px 10px;
}

.profile-password input {
  margin: 0;
}

.profile-password-msg {
  margin: 0;
  font-size: 0.8rem;
}

.profile-password-msg.ok {
  color: #23a559;
}

.profile-password-msg.bad {
  color: var(--danger);
}

.profile-status-wrap {
  position: relative;
}

.status-menu {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  bottom: auto;
  z-index: 5;
  width: 260px;
  padding: 6px;
  background: var(--menu);
  border: 1px solid var(--surface);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.status-option {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  border-radius: 4px;
}

.status-option:hover,
.status-option.active {
  background: var(--surface);
  color: var(--text);
}

.status-option span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.status-option small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .status-menu {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: auto;
    top: calc(100% + 8px);
  }
}

.profile-game-label {
  display: block;
  margin: 4px 10px 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-game-label input {
  margin-top: 6px;
  background: var(--dark);
}

.game-line {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

.avatar {
  width: 56px;
  height: 56px;
  aspect-ratio: 1;
  font-size: 1.2rem;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: visible;
  flex-shrink: 0;
  box-shadow: 0 0 0 var(--speak, 0px) rgba(35, 165, 89, 0.9);
  transition: box-shadow 0.12s linear;
}

.avatar.speaking {
  animation: speak-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes speak-pulse {
  from {
    box-shadow:
      0 0 0 var(--speak, 2px) rgba(35, 165, 89, 0.5),
      0 0 3px 1px rgba(35, 165, 89, 0.22);
  }
  to {
    box-shadow:
      0 0 0 calc(var(--speak, 2px) + 1px) rgba(35, 165, 89, 0.95),
      0 0 6px 1px rgba(35, 165, 89, 0.4);
  }
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar.small {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.empty {
  margin: clamp(12px, 3vw, 24px) clamp(12px, 3vw, 20px);
  padding: clamp(12px, 3vw, 16px) clamp(12px, 3vw, 18px);
  border-radius: 12px;
  background: var(--dark);
  color: var(--muted);
  line-height: 1.45;
}

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr));
  gap: 8px;
  padding: 12px 16px;
  align-content: start;
}

#grid[data-layout="auto"] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr));
}

#grid[data-layout="1"] {
  grid-template-columns: minmax(0, 1fr);
}

#grid[data-layout="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#grid[data-layout="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#grid[data-layout="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#grid[data-layout="compact"] {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.stream-layout-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 16px 4px;
  flex-wrap: wrap;
}

.stream-layout-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.stream-layout-options {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stream-layout-options button {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stream-layout-options button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.stream-layout-options button.active {
  color: #fff;
  background: #5865f2;
}

.main:has(.text-channel-view:not(.hidden)) .stream-layout-bar {
  display: none !important;
}

.tile {
  position: relative;
  background: var(--dark);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 0;
  cursor: pointer;
}

.tile:hover,
.tile.is-focus {
  outline: 3px solid #5865f2;
}

.tile.is-popout {
  outline: 3px solid #3ba55d;
}

.tile.is-popout::after {
  content: "Em nova janela";
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 165, 93, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  pointer-events: none;
}

.tile:fullscreen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  outline: 4px solid #5865f2;
  background: #000;
  cursor: zoom-out;
}

.tile:fullscreen video {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: contain;
}

#grid.focus-mode .tile.is-focus {
  grid-column: 1 / -1;
  order: -1;
  aspect-ratio: auto;
  min-height: 52vh;
  cursor: zoom-out;
}

.main:fullscreen {
  background: #000;
  width: 100%;
  height: 100%;
}

.main:fullscreen #grid {
  height: calc(100% - 72px);
}

.main:fullscreen #grid[data-layout="auto"] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 540px), 1fr));
}

.main:fullscreen #grid.focus-mode .tile.is-focus,
.tile:fullscreen {
  min-height: calc(100vh - 210px);
  border-radius: 8px;
}

.main:fullscreen .tile video,
.tile:fullscreen video {
  height: 100%;
  min-height: 0;
}

.tile-full {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 5;
  padding: 6px 10px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
}

.tile-full i {
  font-size: 0.9rem;
}

.tile video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: black;
  display: block;
}

.tile span.tile-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.tile.is-idle video {
  opacity: 0;
}

.tile.is-idle .tile-label {
  inset: 0;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  max-width: none;
  margin: 0;
  padding: 16px;
  border-radius: 0;
  background: var(--menu);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
}

.tile.is-idle .avatar.small {
  width: 84px;
  height: 84px;
  font-size: 1.8rem;
}

.tile.is-streaming .tile-label {
  inset: auto;
  left: 10px;
  bottom: 10px;
  top: auto;
  right: auto;
  flex-direction: row;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
  font-size: 0.8rem;
  font-weight: 500;
  max-width: calc(100% - 20px);
}

.tile.is-streaming .avatar.small {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  outline-offset: 3px;
}

.tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  z-index: 4;
  pointer-events: none;
  transform: translate(-2px, -2px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpolygon points='1,1 1,16 5,12 10,17 12,15 7,10 13,10' fill='white' stroke='black' stroke-width='1'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 2px #000);
}

#members {
  list-style: none;
  margin: 0;
  padding: 0 16px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

#members li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  min-width: 0;
  cursor: pointer;
}

#members li > div {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

body:has(#insecure:not(.hidden)) .app:not(.hidden),
body:has(#insecure:not(.hidden)) .app:not(.hidden) .main {
  height: calc(100vh - 4.75rem);
  height: calc(100dvh - 4.75rem);
}

@media (min-width: 1280px) {
  .app {
    grid-template-columns: auto minmax(0, 1fr) minmax(200px, 240px);
  }

  .sidebar {
    width: 260px;
  }

  .voice-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .app {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .main {
    grid-column: 2;
  }

  .members-panel {
    display: none;
  }
}

@media (max-width: 1024px) {
  .app {
    display: block;
    height: 100vh;
    height: 100dvh;
  }

  button.sidebar-toggle,
  button.sidebar-close {
    display: grid;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.55);
  }

  .app.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    position: static;
    width: 240px;
    transform: none;
    box-shadow: none;
    padding-top: 0;
    padding-bottom: 0;
  }

  .nav-shell {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(312px, 96vw);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app.sidebar-open .nav-shell {
    transform: translateX(0);
  }

  .main {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
  }

  .members-panel {
    display: none;
  }

  header {
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 8px;
  }

  #fullscreen {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  #fullscreen span {
    display: none;
  }

  .user-tools {
    flex-direction: row;
  }

  .avatar {
    width: 44px;
    height: 44px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  #grid {
    padding: 8px;
    gap: 6px;
  }

  #grid[data-layout="3"],
  #grid[data-layout="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-layout-bar {
    justify-content: center;
    padding: 0 8px 6px;
  }

  .empty {
    margin: 12px;
  }

  .discord-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.35rem;
  }

  .panel {
    margin: 12px auto 24px;
    padding: 16px;
  }

  input {
    font-size: 16px;
  }

  header {
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .actions #fullscreen {
    width: 36px;
    height: 36px;
  }

  .tile-full {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .tile-full span {
    display: none;
  }

  .tile.is-streaming span.tile-label,
  .tile span.tile-label {
    left: 6px;
    bottom: 6px;
    font-size: 0.72rem;
    max-width: calc(100% - 48px);
  }

  .tile.is-idle .tile-label {
    inset: 0;
    left: 0;
    top: 0;
    max-width: none;
    font-size: 1rem;
  }

  .tile.is-idle .avatar.small {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
  }

  .tile-full {
    right: 6px;
    top: 6px;
  }

  #grid.focus-mode .tile.is-focus {
    min-height: 42vh;
  }

  .icon-chip {
    padding: 10px 4px;
    min-height: 52px;
  }

  .create-room {
    padding: 0 10px 10px;
  }

  .voice-box,
  .user-bar {
    padding: 8px 10px;
  }
}

@media (max-width: 380px) {
  .sidebar {
    width: 100vw;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }

  .icon-chip small {
    font-size: 0.58rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .panel {
    margin: 8px auto;
    padding: 14px;
  }

  header {
    padding: 6px 10px;
  }

  .avatar {
    width: 36px;
    height: 36px;
  }

  .icon-chip {
    padding: 6px 2px;
    min-height: 0;
  }

  .icon-chip small {
    display: none;
  }

  .voice-box {
    padding: 6px 8px;
  }

  .user-bar {
    padding: 6px 8px;
  }

  #grid.focus-mode .tile.is-focus {
    min-height: 70vh;
  }
}

.user-menu {
  position: fixed;
  z-index: 80;
  width: min(248px, calc(100vw - 16px));
  padding: 8px;
  background: var(--menu);
  border: 1px solid var(--dark);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
}

.user-menu-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu button[role="menuitem"] {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: left;
  border-radius: 4px;
}

.user-menu button[role="menuitem"]:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.user-menu-sep {
  height: 1px;
  margin: 8px 4px;
  background: var(--border-soft);
}

.user-menu-volume {
  display: block;
  padding: 4px 8px 8px;
  color: var(--muted-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.user-menu-volume input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: #5865f2;
}

.user-menu-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}

.user-menu-check:hover {
  background: var(--surface);
}

.user-menu-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #5865f2;
  flex-shrink: 0;
}

.user-menu-self {
  margin: 0;
  padding: 6px 10px 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.dm-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  width: min(360px, calc(100vw - 16px));
  height: min(420px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--menu);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow);
  overflow: hidden;
}

.dm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dm-head-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dm-head-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dm-empty {
  margin: auto;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.dm-bubble {
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.dm-bubble.self {
  margin-left: auto;
  background: var(--accent);
  color: var(--on-accent);
}

.dm-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--dark);
}

.dm-form input {
  margin: 0;
  background: var(--dark);
}

.dm-form button {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tile-label {
  cursor: pointer;
}

@media (max-width: 640px) {
  .dm-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: min(52dvh, 380px);
  }

  .sfx-panel {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }
}

.sfx-panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 68;
  width: min(420px, calc(100vw - 16px));
  max-height: min(460px, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  background: var(--menu);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px var(--shadow);
  overflow: hidden;
}

.sfx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sfx-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sfx-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sfx-head-actions .icon-btn.muted {
  background: #ed4245;
  color: white;
}

.sfx-muted-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 0.78rem;
  font-weight: 600;
}

.sfx-muted-note span {
  flex: 1;
  min-width: 0;
}

.sfx-muted-note button {
  flex: none;
  margin: 0;
  padding: 4px 10px;
  width: auto;
  border-radius: 6px;
  background: var(--danger);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.sfx-list {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  padding: 10px 12px 12px;
}

.sfx-group {
  margin-bottom: 14px;
}

.sfx-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sfx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.sfx-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 56px;
  padding: 8px 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 8px;
  box-shadow: 0 1px 2px var(--shadow-soft);
}

.sfx-btn:hover {
  background: var(--surface-active);
}

.sfx-btn.playing {
  background: #3ba55d;
  border-color: #2d8748;
  color: var(--on-accent);
}

.sfx-btn small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
}

.sfx-btn.playing small {
  color: rgba(255, 255, 255, 0.85);
}

.sfx-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.sfx-del:hover {
  color: #ed4245;
}

.sfx-upload {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.sfx-upload input[type="text"] {
  margin: 0;
  background: var(--input);
  border: 1px solid var(--border-soft);
}

.sfx-file-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.sfx-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 76;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 14px;
  background: var(--menu);
  border: 1px solid var(--surface-active);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.sfx-toast-copy {
  min-width: 0;
}

.sfx-toast-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sfx-toast-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-toast {
  left: auto;
  right: 16px;
  bottom: 24px;
  transform: none;
  cursor: pointer;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  z-index: 78;
}

.dm-toast:hover {
  background: var(--dark);
}

.dm-toast.is-raised {
  bottom: calc(min(420px, 100dvh - 24px) + 28px);
}

.dm-toast-icon {
  color: #5865f2;
  font-size: 1.15rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .dm-toast.is-raised {
    bottom: calc(min(52dvh, 380px) + 20px);
  }
}

.profile-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.profile-theme-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.profile-theme-label i {
  width: 16px;
  text-align: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--dark);
  border: 1px solid var(--border);
}

.theme-toggle-btn {
  width: 34px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  cursor: pointer;
}

.theme-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.theme-toggle-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px var(--shadow-soft);
}

[data-theme="light"] .login-logo,
[data-theme="light"] .brand-logo {
  background: transparent;
  padding: 0;
  box-shadow: none;
  mix-blend-mode: normal;
}

[data-theme="light"] .login-logo,
[data-theme="light"] .boot-splash-logo,
[data-theme="light"] .lula-wrap.login-logo,
[data-theme="light"] .lula-wrap.boot-splash-logo {
  width: min(130px, 40%);
  height: 158px;
  max-height: 158px;
  margin-bottom: 16px;
  color: #1a1b1e;
  filter: none;
}

[data-theme="light"] .lula-wrap .lula-svg .lula-shape {
  fill: #1a1b1e;
}

[data-theme="light"] .brand-logo {
  width: 86px;
  height: 72px;
  object-fit: contain;
}

[data-theme="light"] body:has(#login:not(.hidden)) {
  background:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(50, 95, 178, 0.13), transparent 58%),
    radial-gradient(ellipse 70% 45% at 85% 95%, rgba(50, 95, 178, 0.08), transparent 52%),
    linear-gradient(180deg, var(--login-bg-top) 0%, var(--login-bg-bottom) 100%);
}

[data-theme="light"] .login-panel.panel {
  background: var(--login-panel-bg);
  border: 1px solid var(--login-panel-border);
  box-shadow:
    0 2px 4px rgba(50, 95, 178, 0.04),
    0 16px 40px rgba(50, 95, 178, 0.1);
}

[data-theme="light"] .login-panel .login-wordmark {
  color: #162033;
}

[data-theme="light"] .login-panel .login-welcome {
  color: #2b3038;
}

[data-theme="light"] .login-panel .login-sub {
  color: #5e6772;
}

[data-theme="light"] .login-panel .tabs {
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--login-tab-bg);
  border: 1px solid var(--login-panel-border);
}

[data-theme="light"] .login-panel .tab {
  background: transparent;
  color: var(--login-tab-text);
  border: none;
  border-radius: 8px;
  font-weight: 600;
}

[data-theme="light"] .login-panel .tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.65);
  color: #313338;
}

[data-theme="light"] .login-panel .tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(50, 95, 178, 0.28);
}

[data-theme="light"] .login-panel label {
  color: var(--login-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="light"] .login-panel input {
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

[data-theme="light"] .login-panel input:focus,
[data-theme="light"] .login-panel input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(50, 95, 178, 0.16);
}

[data-theme="light"] .login-panel #auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(50, 95, 178, 0.28);
}

[data-theme="light"] .login-panel #auth-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

[data-theme="light"] .login-panel .auth-forgot {
  color: var(--accent);
  font-weight: 600;
}

[data-theme="light"] .login-panel .auth-remember {
  color: #5b6575;
}

[data-theme="light"] .login-panel .auth-forgot:hover {
  color: var(--accent-hover);
}

[data-theme="light"] .login-panel .auth-error {
  background: var(--danger-soft);
  border: 1px solid rgba(216, 60, 62, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
}

[data-theme="light"] .login-panel .auth-error.ok {
  background: rgba(35, 165, 89, 0.1);
  border-color: rgba(35, 165, 89, 0.22);
  color: #1a7a42;
}

[data-theme="light"] .login-panel .hint,
[data-theme="light"] .login-panel #conn {
  color: var(--muted);
}

[data-theme="light"] .brand-text strong {
  color: var(--text);
}

[data-theme="light"] header {
  color: var(--text);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

[data-theme="light"] .header-copy span {
  color: var(--muted);
}

[data-theme="light"] .sidebar {
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.55);
}

[data-theme="light"] .guild-rail {
  border-right: 1px solid var(--border);
  background: var(--rail-bg);
}

[data-theme="light"] .nav-shell {
  background: var(--rail-bg);
}

[data-theme="light"] .members-panel {
  border-left: 1px solid var(--border);
  background: var(--sidebar);
}

[data-theme="light"] .main {
  background: var(--bg);
}

[data-theme="light"] .text-channel-view {
  background: var(--bg);
}

[data-theme="light"] .voice-box {
  background: var(--sidebar);
  border-bottom-color: var(--border);
}

[data-theme="light"] .empty {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}

[data-theme="light"] .channel-message-toolbar {
  background: var(--menu);
  border-color: var(--border-soft);
  box-shadow: 0 4px 14px var(--shadow-soft);
}

[data-theme="light"] .channel-reaction-chip {
  background: var(--menu);
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

[data-theme="light"] .channel-reaction-chip.is-self {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

[data-theme="light"] .modal-backdrop {
  background: var(--overlay);
}

[data-theme="light"] .room-modal,
[data-theme="light"] .guild-settings-modal {
  background: var(--menu);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 95, 178, 0.14);
}

[data-theme="light"] .guild-icon:not(.home-icon):not(.add-icon) {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

[data-theme="light"] .guild-btn.add .add-icon {
  background: var(--surface);
  border: 1px dashed var(--border-soft);
  color: #23a559;
}

[data-theme="light"] .guild-btn::before {
  background: var(--accent);
}

[data-theme="light"] .dm-search-wrap,
[data-theme="light"] .empty,
[data-theme="light"] .user-status {
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .dm-search-wrap input {
  color: var(--text);
}

[data-theme="light"] .tile,
[data-theme="light"] .channel-youtube-embed {
  background: #0f0f10;
}

[data-theme="light"] .tile span.tile-label,
[data-theme="light"] .tile.is-idle .tile-label {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

[data-theme="light"] .sidebar-backdrop {
  background: var(--overlay);
}

[data-theme="light"] .channel-message-toolbar,
[data-theme="light"] .channel-msg-menu,
[data-theme="light"] .user-menu,
[data-theme="light"] .profile-pop,
[data-theme="light"] .sfx-panel,
[data-theme="light"] .dm-panel,
[data-theme="light"] .room-modal,
[data-theme="light"] .emoji-picker {
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 24px var(--shadow);
}

[data-theme="light"] .icon-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] button.secondary {
  background: var(--surface-active);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .tabs .tab:not(.active) {
  color: var(--muted);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .channel-toolbar-more {
  background: transparent !important;
  border: none !important;
}

[data-theme="light"] .dm-toast,
[data-theme="light"] .sfx-toast {
  background: var(--menu);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 28px var(--shadow);
}

[data-theme="light"] .dm-toast:hover,
[data-theme="light"] .sfx-toast:hover {
  background: var(--surface-hover);
}

[data-theme="light"] .text-channel-compose-box {
  background: var(--input);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .panel {
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 50px var(--shadow);
}

[data-theme="light"] .panel:not(.login-panel) {
  background: var(--panel);
}

[data-theme="light"] .user-bar {
  background: var(--elevated);
  border-top: 1px solid var(--border);
}

[data-theme="light"] .user-status {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border-soft);
}

[data-theme="light"] .room-section-head {
  color: var(--muted-soft);
}

[data-theme="light"] .create-room-btn {
  box-shadow: 0 2px 8px rgba(50, 95, 178, 0.2);
}

[data-theme="light"] .profile-pop,
[data-theme="light"] .status-menu,
[data-theme="light"] .custom-status-pop {
  background: var(--menu);
  border-color: var(--border-soft);
}

[data-theme="light"] .profile-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}

[data-theme="light"] .main:has(.text-channel-view:not(.hidden)) header {
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="light"] .text-channel-welcome-icon {
  color: var(--accent);
}

[data-theme="light"] .text-channel-welcome h2 {
  color: var(--text);
}

[data-theme="light"] .text-channel-welcome p {
  color: var(--muted);
}

[data-theme="light"] .channel-role-badge {
  background: color-mix(in srgb, var(--role-color) 10%, #fff);
  border-color: color-mix(in srgb, var(--role-color) 34%, var(--border-soft));
  color: color-mix(in srgb, var(--role-color) 58%, #16181d);
}

[data-theme="light"] .sfx-panel,
[data-theme="light"] .dm-panel {
  background: var(--menu);
  border-color: var(--border);
}

[data-theme="light"] .sfx-head,
[data-theme="light"] .dm-head {
  background: var(--surface);
  border-bottom-color: var(--border);
}

[data-theme="light"] .sfx-list {
  background: var(--bg);
}

[data-theme="light"] .sfx-btn {
  background: var(--menu);
  border-color: var(--border-soft);
}

[data-theme="light"] .sfx-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

[data-theme="light"] .sfx-btn small {
  color: var(--muted);
}

[data-theme="light"] .sfx-upload {
  background: var(--surface);
  border-top-color: var(--border);
}

[data-theme="light"] .room-modal-foot {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

[data-theme="light"] .room-modal {
  background: var(--menu);
  border: 1px solid var(--border);
}

[data-theme="light"] .emoji-picker {
  background: var(--menu);
  border-color: var(--border-soft);
}

[data-theme="light"] .emoji-option:hover {
  background: var(--surface-hover);
}

[data-theme="light"] .dm-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .dm-bubble.self {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

[data-theme="light"] .dm-form {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

[data-theme="light"] .room-modal-label,
[data-theme="light"] .guild-settings-hint {
  color: var(--muted);
}

[data-theme="light"] .invite-card {
  background: var(--menu);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .user-menu-check:hover {
  background: var(--surface-hover);
}

[data-theme="light"] .channel-link-embed,
[data-theme="light"] .channel-youtube-embed + .channel-link-embed {
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

[data-theme="light"] .channel-attachment-broken {
  background: var(--surface);
  border-color: var(--border-soft);
  color: var(--muted);
}

[data-theme="light"] .text-channel-compose-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 95, 178, 0.12);
}

[data-theme="light"] .guild-settings-btn {
  background: var(--menu);
  border: 1px solid var(--border-soft);
}


/* Desktop Electron — topbar + layout sem cortar o rodapé */
html.concord-desktop {
  --titlebar-height: 36px;
  height: 100%;
}

html.concord-desktop body {
  height: 100%;
  overflow: hidden !important;
}

html.concord-desktop .app {
  box-sizing: border-box !important;
  height: calc(100vh - var(--titlebar-height)) !important;
  height: calc(100dvh - var(--titlebar-height)) !important;
  max-height: calc(100vh - var(--titlebar-height)) !important;
  max-height: calc(100dvh - var(--titlebar-height)) !important;
  margin-top: var(--titlebar-height) !important;
  overflow: hidden !important;
}

html.concord-desktop .nav-shell,
html.concord-desktop .main,
html.concord-desktop .members-panel,
html.concord-desktop .sidebar {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
}

html.concord-desktop .nav-upper {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: hidden;
}

html.concord-desktop .discord-panel {
  flex-shrink: 0 !important;
}

html.concord-desktop .concord-drag-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 140px;
  height: var(--titlebar-height);
  z-index: 100000;
  -webkit-app-region: drag;
  app-region: drag;
  pointer-events: auto;
}

html.concord-desktop .guild-rail,
html.concord-desktop .sidebar > header,
html.concord-desktop .main > header,
html.concord-desktop .members-panel > h2,
html.concord-desktop .login-brand {
  -webkit-app-region: drag;
  app-region: drag;
}

html.concord-desktop button,
html.concord-desktop a,
html.concord-desktop input,
html.concord-desktop textarea,
html.concord-desktop select,
html.concord-desktop label,
html.concord-desktop .icon-btn,
html.concord-desktop .guild-btn,
html.concord-desktop .tab,
html.concord-desktop .chip,
html.concord-desktop .actions,
html.concord-desktop .tile,
html.concord-desktop .modal-backdrop,
html.concord-desktop [role="button"],
html.concord-desktop [role="menuitem"],
html.concord-desktop .stream-layout-bar {
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

html.concord-desktop .main > header {
  padding-right: 148px;
}

html.concord-desktop #login.panel,
html.concord-desktop.is-auth-screen #login.login-panel,
html.concord-desktop.is-auth-screen #login.panel {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  z-index: 20;
  align-self: auto;
  flex-shrink: 0;
}

html.concord-desktop.is-auth-screen,
html.concord-desktop.is-auth-screen body {
  height: 100%;
}

html.concord-desktop.is-auth-screen body {
  display: block !important;
  min-height: 100dvh !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html.concord-desktop.is-auth-screen #concord-titlebar {
  border-bottom: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.concord-desktop.is-auth-screen .concord-titlebar-center,
html.concord-desktop.is-auth-screen #concord-titlebar-icon,
html.concord-desktop.is-auth-screen #concord-titlebar-name {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Botao "Tela cheia" do header removido da UI */
#fullscreen {
  display: none !important;
}
