/* Lunar: Konvo laid out like Discord, as in the approved photo. Servers on
   the left rail, the channel list under the server's banner, the chat, and
   the member list by role. The top strip is the window's title bar (Windows
   draws minimize / maximize / close at its right end). "Voz conectada" is a
   card at the bottom left with the people in the call and big buttons.
   Loaded after the older sheets, before lite. */

:root {
  --bg-rail: #0e0c1a; /* window, rail, title bar */
  --bg-sidebar: #15122a; /* channel list and members */
  --bg-main: #131024; /* chat */
  --bg-elevated: #221d40;
  --bg-input: #1c1835;
  --bg-hover: rgba(140, 110, 255, 0.08);
  --bg-active: rgba(140, 110, 255, 0.16);
  --panel: #15122a;
  --card: #1c1835;
  --card-hover: #221d40;
  --raised: #262046;
  --picture: #1b1538;
  --line: #241f42;
  --line-strong: #302a58;
  --text: #ece8ff;
  --text-soft: #c9c2e8;
  --text-muted: #9b93c4;
  --text-faint: #6f679b;
  --accent: #7c5cff;
  --accent-hover: #9b7bff;
  --accent-soft: #b9a6ff;
  --accent-grad: linear-gradient(135deg, #8d6dff, #6a4cff);
  --on-accent: #ffffff;
  --selected-bg: linear-gradient(90deg, rgba(124, 92, 255, 0.3), rgba(124, 92, 255, 0.1));
  --selected-line: rgba(150, 120, 255, 0.5);
  --selected-text: #d9cfff;
  --channel-active: #2a2448;
  --channel-hover: #1f1a38;
  --ok: #3ddc84;
  --danger: #f04461;
  --danger-strong: #e23a57;
  --stop-bg: #3a1f35;
  --stop-text: #ff9db0;
  --warn: #f5b545;
  --radius: 12px;
  --gap: 10px;
  --top-h: 52px;
  --rail-w: 76px;
  --side-w: clamp(260px, 21vw, 320px);
  --panel-w: clamp(240px, 19vw, 300px);
}

html {
  overflow: hidden;
}

body {
  background: var(--bg-rail);
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: var(--line-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.login {
  background:
    radial-gradient(circle at 18% 20%, #3b2a9a 0, transparent 45%),
    radial-gradient(circle at 82% 82%, #4a1f7a 0, transparent 42%),
    var(--bg-rail);
}

.login-card {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(21, 18, 42, 0.94);
}

.login::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  -webkit-app-region: drag;
}

.modal-backdrop {
  z-index: 40;
}

.toast-root {
  z-index: 60;
}

/* ---------- buttons, links, menus, modals ---------- */

.btn {
  border-radius: 10px;
  background: var(--raised);
}

.btn:hover {
  background: var(--line-strong);
}

.btn.primary {
  background: var(--accent-grad);
  color: var(--on-accent);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #9b7bff, #7a5cff);
}

.btn.danger {
  background: var(--danger-strong);
  color: #fff;
}

.link {
  color: var(--accent-soft);
}

.badge {
  background: var(--danger);
}

.modal-backdrop {
  background: rgba(6, 4, 16, 0.72);
}

.modal {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--card);
}

.ctx-menu,
.stream-preview,
.server-hover {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #100c20;
}

.sp-image {
  background: var(--picture);
}

/* ---------- grid ---------- */

.app {
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) auto;
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  padding: 0 var(--gap) var(--gap) 0;
  overflow: hidden;
  background: var(--bg-rail);
}

.app.no-sidebar {
  grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) auto;
}

.app > .rail {
  grid-column: 1;
  grid-row: 1 / -1;
}

.app > .topbar {
  grid-column: 2 / -1;
  grid-row: 1;
}

.app > .sidebar {
  grid-column: 2;
  grid-row: 2;
}

.app > .main {
  grid-column: 3;
  grid-row: 2;
}

.app > #members {
  grid-column: 4;
  grid-row: 2;
}

/* The chat and the member list share one rounded panel. */
.app > .sidebar,
.app > .main,
.app > #members {
  min-height: 0;
  border: 1px solid var(--line);
}

.app > .sidebar {
  border-radius: 16px;
  background: var(--panel);
}

.app > .main {
  margin-left: var(--gap);
  border-radius: 16px 0 0 16px;
  background: var(--bg-main);
}

.app > #members {
  border-left: 0;
  border-radius: 0 16px 16px 0;
  background: var(--panel);
}

.app.no-members > .main,
.app:not(.members-view) > .main {
  border-radius: 16px;
}

.app.no-sidebar > .main {
  margin-left: 0;
}

/* ---------- title bar ---------- */

.topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: calc(var(--gap) * -1);
  padding: 0 8px 0 4px;
  padding-right: max(10px, calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 8px));
  background: var(--bg-rail);
  -webkit-app-region: drag;
}

.topbar button {
  -webkit-app-region: no-drag;
}

.topbar-spacer {
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
}

.brand:hover {
  background: var(--card);
}

.brand-logo {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.title-tool {
  display: flex;
}

.title-btn {
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-soft);
}

.title-btn:hover {
  background: var(--card);
  color: var(--text);
}

/* ---------- server rail ---------- */

.rail {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--bg-rail);
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail-item {
  position: relative;
  flex: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

.rail-label,
.rail-chevron {
  display: none;
}

.rail-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--accent-soft);
  transform: translateY(-50%);
  transition: height 0.15s;
}

.rail-item.unread .rail-pill {
  height: 8px;
}

.rail-item:hover .rail-pill {
  height: 20px;
}

.rail-item.active .rail-pill {
  height: 40px;
  background: var(--accent);
}

.rail-btn,
.rail-btn.has-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 700;
  transition:
    border-radius 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.rail-item:hover .rail-btn,
.rail-item:hover .rail-btn.has-icon {
  border-radius: 15px;
  background: var(--card-hover);
  color: var(--text);
}

.rail-item.active .rail-btn,
.rail-item.active .rail-btn.has-icon {
  border-radius: 16px;
  background: var(--card-hover);
  color: #fff;
  box-shadow:
    0 0 0 2px #8b6cff,
    0 0 18px rgba(124, 92, 255, 0.45);
}

.rail-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  background: none;
}

.rail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Início: the real logo, a bit faded and grayish; full color on hover or when open. */
.rail-btn.home {
  background: var(--card);
}

.rail-btn.home .rail-icon img,
.rail-btn.home .home-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: grayscale(0.65) opacity(0.6);
  transition: filter 0.15s;
}

.rail-item:hover .rail-btn.home,
.rail-item.active .rail-btn.home {
  background: var(--card-hover);
}

.rail-item:hover .rail-btn.home .home-logo,
.rail-item.active .rail-btn.home .home-logo {
  filter: none;
}

.rail-separator {
  flex: none;
  width: 36px;
  height: 2px;
  border-radius: 1px;
  background: var(--line-strong);
}

.rail-btn.action {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: var(--text-soft);
}

.rail-item:hover .rail-btn.action {
  border-radius: 50%;
  background: var(--card-hover);
  color: var(--accent-soft);
}

.rail-btn.owner {
  border: 1px solid rgba(242, 193, 78, 0.5);
}

.rail-item.muted .rail-btn {
  opacity: 0.55;
}

.rail-badge {
  position: absolute;
  right: 6px;
  bottom: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 3px solid var(--bg-rail);
  box-sizing: content-box;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.rail-voice {
  position: absolute;
  left: 52px;
  top: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-rail);
  border-radius: 50%;
  background: var(--ok);
  pointer-events: none;
}

.rail-item.drop-before::before,
.rail-item.drop-after::after {
  left: 12px;
  right: 12px;
  width: auto;
  height: 3px;
}

.rail-item.drop-before::before {
  top: -6px;
  bottom: auto;
}

.rail-item.drop-after::after {
  top: auto;
  bottom: -6px;
}

/* ---------- channel list ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.side-nav {
  flex: none;
  display: grid;
  gap: 2px;
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.nav-item {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

.nav-item:hover {
  background: var(--channel-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--channel-active);
  color: #fff;
}

.nav-icon {
  display: inline-flex;
  color: var(--text-muted);
}

.nav-item.active .nav-icon {
  color: var(--accent-soft);
}

.nav-label {
  flex: 1;
}

.nav-chevron {
  display: none;
}

.nav-live {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(61, 220, 132, 0.16);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.sidebar-header {
  height: auto;
  flex: none;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 0;
}

.sidebar-header:empty {
  display: none;
}

/* The server's banner with its icon and name. */
.server-banner {
  position: relative;
  height: 150px;
  display: flex;
  align-items: flex-end;
  padding: 0 16px 14px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #120f28;
  color: var(--text);
  text-align: left;
}

.server-banner-art {
  --banner-hue: 262;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 10%, hsl(var(--banner-hue) 70% 45% / 0.55), transparent 60%),
    radial-gradient(ellipse at 15% 90%, hsl(calc(var(--banner-hue) + 30) 60% 35% / 0.6), transparent 55%),
    linear-gradient(160deg, hsl(var(--banner-hue) 45% 22%), #120f28);
  background-position: center;
  background-size: cover;
  transition: transform 0.4s ease;
}

.server-banner-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(12, 9, 28, 0.88) 92%);
}

.server-banner:hover .server-banner-art {
  transform: scale(1.03);
}

.server-banner-info {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-banner-icon {
  flex: none;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: var(--raised);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.server-banner-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-banner-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.server-banner-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 700;
}

.server-banner-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-banner-sub {
  color: var(--text-soft);
  font-size: 13px;
}

.sidebar-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 10px;
}

.section-title {
  margin: 16px 6px 6px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.channel-group:first-child .section-title,
.sidebar-body > .side-item:first-child + .channel-group .section-title {
  margin-top: 8px;
}

.section-title-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.section-title-text .icon {
  color: var(--text-soft);
}

.section-title .icon-btn.tiny {
  color: var(--text-soft);
}

.side-item {
  min-height: 42px;
  gap: 12px;
  margin: 0 0 2px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 16px;
}

.side-item:hover {
  background: var(--channel-hover);
  color: var(--text);
}

.side-item.active {
  background: var(--channel-active);
  color: #fff;
  font-weight: 600;
}

.side-item .hash {
  width: 22px;
  color: var(--text-faint);
  font-size: 22px;
  font-weight: 400;
}

.side-item.active .hash {
  color: var(--text-soft);
}

.side-item.unread {
  color: var(--text);
  font-weight: 600;
}

.unread-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--text);
}

.side-item > .icon {
  color: var(--text-faint);
}

.voice-channel.has-people > .side-item > .icon,
.voice-channel.mine > .side-item > .icon {
  color: var(--ok);
}

.voice-faces {
  flex: none;
  display: inline-flex;
  margin-left: auto;
  border-radius: 10px;
  cursor: pointer;
}

.voice-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--raised);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.voice-faces:hover .voice-count {
  background: var(--line-strong);
}

.voice-count.live-count {
  background: var(--danger);
  color: #fff;
}

.voice-participants {
  padding: 2px 0 4px 34px;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack > .avatar {
  box-shadow: 0 0 0 2px var(--card);
}

.avatar-stack > .avatar + .avatar,
.avatar-stack > .stack-more {
  margin-left: -8px;
}

.stack-more {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 13px;
  background: var(--raised);
  box-shadow: 0 0 0 2px var(--card);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- bottom left: "Voz conectada" / you ---------- */

#voice-bar.voice-bar,
#user-panel.user-panel {
  flex: none;
  margin: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1a1631;
}

#voice-bar.voice-bar {
  display: grid;
  gap: 14px;
  padding: 14px 14px 16px;
}

.app.voice-on #user-panel {
  display: none;
}

.vc-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.vc-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}

.vc-title .vc-status {
  font-size: 16px;
}

.vc-title:hover .vc-place-name {
  text-decoration: underline;
}

.vc-place {
  display: flex;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.vc-place-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-ping {
  flex: none;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.vc-signal.vc-open {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--raised);
}

.vc-signal.vc-open:hover {
  background: var(--line-strong);
}

.vc-signal.good,
.vc-status.good {
  color: var(--ok);
}

.vc-signal.ok,
.vc-status.ok,
.vc-signal.connecting,
.vc-status.connecting {
  color: var(--warn);
}

.vc-signal.bad,
.vc-status.bad {
  color: var(--danger);
}

.vc-people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vc-person {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}

.vc-person .avatar {
  transition: box-shadow 0.12s;
}

.vc-person.speaking .avatar {
  box-shadow:
    0 0 0 2px #1a1631,
    0 0 0 4px var(--ok);
}

.vc-person-off {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid #1a1631;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
}

.vc-person-live {
  position: absolute;
  left: 50%;
  bottom: -6px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  transform: translateX(-50%);
}

.vc-more {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.vc-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  justify-items: center;
  gap: 8px;
}

.vc-action {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--raised);
  color: var(--text);
  transition: background 0.12s;
}

.vc-action:hover {
  background: var(--line-strong);
}

.vc-action.on {
  background: var(--accent-grad);
  color: #fff;
}

.vc-action.off {
  background: var(--stop-bg);
  color: var(--stop-text);
}

.vc-action.hangup {
  width: 58px;
  height: 58px;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 6px 18px rgba(240, 68, 97, 0.35);
}

.vc-action.hangup:hover {
  background: #ff5873;
}

#user-panel.user-panel {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 8px 10px;
}

.me-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  text-align: left;
}

.me-chip:hover {
  background: var(--channel-hover);
}

.me-names {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}

.me-names > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-names > :first-child {
  font-weight: 700;
}

.me-status {
  color: var(--text-muted);
  font-size: 12px;
}

.me-btn {
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--text-soft);
}

.me-btn:hover {
  background: var(--channel-hover);
  color: var(--text);
}

.me-btn.off {
  color: var(--danger);
}

#user-panel .status,
#user-panel .status.idle {
  border-color: #1a1631;
}

/* ---------- chat ---------- */

.main {
  overflow: hidden;
}

.main-header {
  height: 64px;
  flex: none;
  gap: 12px;
  margin: 0;
  padding: 0 14px 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  font-size: 16px;
}

.main-header #main-title {
  font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.main-header .hash.big {
  width: auto;
  color: var(--text-faint);
  font-size: 28px;
  font-weight: 300;
}

.channel-topic {
  min-width: 0;
  overflow: hidden;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-note {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}

.header-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: none;
  color: var(--text-soft);
}

.header-btn:hover,
.header-btn.on {
  background: var(--channel-hover);
  color: var(--text);
}

.header-bell .bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--bg-main);
  border-radius: 50%;
  background: #b38cff;
  box-sizing: content-box;
}

.header-search {
  width: 230px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f0c1f;
  color: var(--text-muted);
}

.header-search:focus-within {
  border-color: var(--selected-line);
}

.header-search-input,
.header-search-input:focus {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
}

.header-search-go {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
}

.header-search > .icon {
  display: none;
}

.header-help span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text-soft);
  color: var(--bg-main);
  font-size: 15px;
  font-weight: 800;
}

.message-list {
  padding: 16px 0 8px;
}

.message {
  padding-top: 4px;
  padding-bottom: 4px;
}

.message:hover {
  background: rgba(140, 110, 255, 0.05);
}

.message.flash {
  animation: flash 2.4s ease-out;
}

@keyframes flash {
  0%,
  30% {
    background: rgba(124, 92, 255, 0.28);
  }
  100% {
    background: transparent;
  }
}

.composer {
  padding: 0 16px 16px;
}

.composer-row {
  min-height: 58px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.composer-row:focus-within {
  border-color: var(--selected-line);
}

.composer-row .attach-btn {
  width: 36px;
  height: 36px;
  margin-top: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-soft);
  box-shadow: inset 0 0 0 2px var(--text-soft);
}

.composer-row .attach-btn:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}

.composer-row textarea {
  padding: 18px 0;
  font-size: 16px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.composer-tool {
  width: 42px;
  height: 42px;
  color: var(--text-soft);
}

.composer-tool:hover {
  color: var(--text);
}

.gif-btn span {
  padding: 1px 4px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

/* ---------- right: members ---------- */

.members.side-panel {
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.side-tabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 6px 18px;
}

.side-tabs:empty {
  display: none;
}

.act-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.act-tune {
  color: var(--text-soft);
}

.side-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 14px;
}

.member-group {
  margin: 18px 10px 6px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 600;
}

.member-group:first-child {
  margin-top: 8px;
}

.side-body .act-member .act-more {
  opacity: 0;
}

.side-body .act-member:hover .act-more,
.side-body .act-member .act-more:focus-visible {
  opacity: 1;
}

/* Home pages and the call screen live inside the chat panel. */
.home-page .main-header {
  margin: 0;
}

/* ---------- "Ativo agora" (home) and the shared rows ---------- */

.act-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* The room with people. */
.act-room {
  border: 1px solid var(--selected-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(124, 92, 255, 0.05));
}

.act-room-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px 14px;
  border: 0;
  background: none;
  color: var(--accent-soft);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.act-room.closed .act-room-head {
  padding-bottom: 12px;
}

.act-room-icon {
  display: inline-flex;
}

.act-room-label {
  flex: 1;
}

.act-room-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.act-room-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.act-room-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--raised);
  font-weight: 700;
}

.act-room-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.act-room-names {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}

.act-room-names strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-room-names span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A small wave; it moves only while someone there is talking. */
.wave {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}

.wave i {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.wave i:nth-child(2n) {
  height: 60%;
}

.wave i:nth-child(3n) {
  height: 90%;
}

.wave i:nth-child(5) {
  height: 100%;
}

.wave.live i {
  animation: wave 0.9s ease-in-out infinite alternate;
}

.wave.live i:nth-child(2n) {
  animation-delay: -0.3s;
}

.wave.live i:nth-child(3n) {
  animation-delay: -0.6s;
}

@keyframes wave {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}

.act-room-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-room-foot .avatar-stack > .avatar,
.act-room-foot .stack-more {
  box-shadow: 0 0 0 2px #1b1540;
}

.act-room-count {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-room-btn {
  height: 38px;
  padding: 0 22px;
  font-weight: 700;
}

/* Streams in your room ("Assistir" / "Parar de assistir"). */
.call-stream {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
}

.call-stream.watching {
  border-color: var(--accent);
}

.cs-picture {
  position: relative;
  height: 150px;
  display: grid;
  place-items: center;
  background: var(--picture);
}

.cs-wait {
  padding: 0 12px;
  color: var(--text-muted);
  text-align: center;
}

.cs-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-image:not([src]) {
  visibility: hidden;
}

.cs-live {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.cs-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.cs-names {
  flex: 1 1 120px;
  min-width: 0;
  line-height: 1.3;
}

.cs-sub {
  color: var(--text-muted);
}

.cs-btn {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.cs-btn.stop {
  background: var(--stop-bg);
  color: var(--stop-text);
}

/* Sections: people online, feed. */
.act-section {
  margin-top: 18px;
}

.act-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 8px;
}

.act-section-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-see-all {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
}

.act-see-all:hover {
  color: var(--text);
}

.act-subtitle {
  margin: 12px 6px 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.act-member {
  display: flex;
  align-items: center;
  border-radius: 12px;
}

.act-member:hover {
  background: var(--card);
}

.act-member.faded {
  opacity: 0.5;
}

.act-member-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 6px 6px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
}

.act-member-names {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}

.act-member-names > :first-child {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act-member-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.act-member-sub span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-tag {
  flex: none;
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
}

.act-more {
  flex: none;
  color: var(--text-muted);
}

.act-more:hover {
  color: var(--text);
}

.act-more-link {
  margin: 4px 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
}

.act-empty {
  margin: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.act-feed {
  padding: 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.act-feed .act-section-head {
  margin-bottom: 6px;
}

.act-feed-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
  text-align: left;
}

.act-feed-item:hover {
  background: var(--card-hover);
}

.act-feed-text {
  flex: 1;
  min-width: 0;
  display: grid;
  font-size: 14px;
  line-height: 1.3;
}

.act-feed-time {
  color: var(--text-muted);
  font-size: 12px;
}

.act-feed-kind {
  display: inline-flex;
  color: var(--text-muted);
}

.act-feed-kind.stream {
  color: var(--danger);
}

.act-feed-kind.game {
  color: var(--accent-soft);
}


/* ---------- home pages: Salas, Explorar ---------- */

.home-page {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

.room-grid,
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.room-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.room-card.mine {
  border-color: rgba(61, 220, 132, 0.45);
}

.room-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-card-icon,
.server-tile-icon {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--raised);
  font-weight: 700;
}

.room-card-icon img,
.server-tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-card-names {
  flex: 1;
  min-width: 0;
  display: grid;
}

.room-card-names strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
}

.room-card-names span {
  color: var(--text-muted);
  font-size: 13px;
}

.room-card-people {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.room-card-people > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 12vh;
  color: var(--text-muted);
  text-align: center;
}

.home-empty h2 {
  margin: 0;
  color: var(--text);
}

.explore-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.explore-action {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  text-align: left;
}

.explore-action:hover,
.server-tile:hover {
  border-color: var(--selected-line);
  background: var(--card-hover);
}

.explore-action strong {
  font-size: 17px;
}

.explore-action-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 14px;
  background: var(--accent-grad);
  color: #fff;
}

.server-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  text-align: center;
}

.server-tile .server-tile-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}


/* ---------- call screen ---------- */

.stage,
.call-stage {
  background: #0a0717;
}

.call-stage .round-btn {
  background: var(--raised);
}

.call-stage .round-btn:not(.on):not(.off):not(.danger):hover {
  background: var(--line-strong);
}

/* ---------- quick search (Ctrl+K) ---------- */

.quick-search-modal {
  width: min(560px, calc(100% - 32px));
  align-self: start;
  margin-top: 12vh;
}

.qs-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.qs-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text-faint);
}

.qs-field .qs-input,
.qs-field .qs-input:focus {
  flex: 1;
  height: 46px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
}

.qs-list {
  max-height: 360px;
  display: grid;
  gap: 2px;
  overflow-y: auto;
}

.qs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--text);
  text-align: left;
}

.qs-item.active {
  border-color: var(--selected-line);
  background: var(--selected-bg);
}

.qs-icon {
  flex: none;
  width: 24px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}

.qs-server {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--raised);
  color: var(--text);
  font-size: 9px;
  font-weight: 800;
}

.qs-server img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qs-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qs-hint {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
}

.qs-tip {
  margin: 2px 4px 0;
  color: var(--text-faint);
  font-size: 12px;
}


/* ---------- chat extras: reactions, Konvo Bot cards, pins, emoji ---------- */

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.reaction {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--text-soft);
  font-weight: 600;
}

.reaction:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--card-hover);
}

.reaction.mine {
  border-color: var(--selected-line);
  background: rgba(124, 92, 255, 0.2);
  color: #fff;
}

.reaction:disabled {
  cursor: default;
  opacity: 0.8;
}

.reaction-emoji {
  font-size: 16px;
  line-height: 1;
}

.reaction-count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.reaction.add {
  padding: 0 8px;
  color: var(--text-muted);
  opacity: 0;
}

.message:hover .reaction.add,
.reaction.add:focus-visible {
  opacity: 1;
}

.bot-tag {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.bot-avatar {
  padding: 3px;
  background: #1a1440;
}

.pin-mark {
  display: inline-flex;
  color: var(--accent-soft);
}

.embed {
  --embed-color: var(--accent);
  max-width: 520px;
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 10px 14px 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--embed-color);
  border-radius: 10px;
  background: var(--card);
}

.embed-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.embed-title {
  font-size: 15px;
}

.embed-text {
  color: var(--text-soft);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-field {
  display: grid;
  gap: 1px;
}

.embed-field-name {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.embed-field-value {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-time {
  color: var(--text-faint);
  font-size: 12px;
}

.channel-topic {
  min-width: 0;
  overflow: hidden;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-hint {
  margin: 0 6px 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.composer.read-only .composer-row {
  opacity: 0.7;
}

/* Names in the person's own colors (one, or a gradient of two). */
.styled-name {
  background: linear-gradient(90deg, var(--name-a), var(--name-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pins-list {
  display: grid;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.pin-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.pin-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pin-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}

.pin-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.small-empty {
  margin: 12px 0;
}

/* Emoji picker */
.emoji-picker {
  position: fixed;
  z-index: 55;
  width: 352px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #100c20;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.emoji-quick {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.emoji-search,
.emoji-search:focus {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.emoji-tabs {
  display: flex;
  justify-content: space-between;
}

.emoji-tab {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 16px;
  opacity: 0.6;
}

.emoji-tab:hover,
.emoji-tab.active {
  background: var(--raised);
  opacity: 1;
}

.emoji-grid {
  height: 248px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 40px;
  align-content: start;
  overflow-y: auto;
}

.emoji-cell {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 24px;
  line-height: 1;
}

.emoji-cell:hover,
.emoji-cell:focus-visible {
  background: var(--raised);
}

.emoji-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- profile extras ---------- */

.custom-status-line {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-status {
  justify-self: start;
  margin: 2px 0 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 14px 4px;
  background: var(--card);
  color: var(--text-soft);
  font-size: 14px;
}

.profile-links {
  display: grid;
  gap: 6px;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}

.profile-link:hover {
  border-color: var(--selected-line);
}

.profile-link .muted {
  margin-left: auto;
}

.links-editor {
  display: grid;
  gap: 8px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 6px;
}

.name-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.name-preset {
  width: 42px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.status-row {
  display: flex;
  gap: 8px;
}

.status-row input {
  flex: 1;
}

.status-emoji-btn {
  flex: none;
  width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text-muted);
  font-size: 22px;
}

/* ---------- moderation screens ---------- */

.warn-list {
  display: grid;
  gap: 8px;
}

.warn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.warn-number {
  flex: none;
  color: var(--warn);
  font-weight: 800;
}

.warn-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cm-section {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.cm-section h4 {
  margin: 0;
  font-size: 15px;
}

.cm-section > .muted {
  margin: -4px 0 0;
}

.cm-bot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--selected-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(124, 92, 255, 0.05));
}

.cm-bot-card p {
  margin: 4px 0 0;
}

.cm-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cm-placeholders {
  margin: 8px 2px 0;
}

.audit-filter {
  max-width: 280px;
}

.audit-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.audit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.audit-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--raised);
  color: var(--accent-soft);
}

.audit-icon.member {
  color: var(--danger);
}

.audit-icon.messages {
  color: var(--warn);
}

.audit-icon.channels {
  color: var(--ok);
}

.audit-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

/* ---------- polls ---------- */

.poll {
  max-width: 520px;
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card);
}

.poll-question {
  font-size: 16px;
}

.poll-hint {
  margin-top: -4px;
  color: var(--text-muted);
  font-size: 12px;
}

.poll-answers {
  display: grid;
  gap: 6px;
}

.poll-answer {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.poll-answer:hover:not(:disabled) {
  border-color: var(--selected-line);
}

.poll-answer:disabled {
  cursor: default;
}

.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--percent, 0%);
  background: rgba(124, 92, 255, 0.18);
  transition: width 0.3s ease;
  pointer-events: none;
}

.poll-answer.mine {
  border-color: var(--selected-line);
}

.poll-answer.mine .poll-bar {
  background: rgba(124, 92, 255, 0.34);
}

.poll-answer.winner {
  border-color: rgba(61, 220, 132, 0.6);
}

.poll-answer.winner .poll-bar {
  background: rgba(61, 220, 132, 0.2);
}

.poll-answer > :not(.poll-bar) {
  position: relative;
}

.poll-check {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: #fff;
}

.poll-check.square {
  border-radius: 5px;
}

.poll-answer.mine .poll-check {
  border-color: var(--accent);
  background: var(--accent);
}

.poll-emoji {
  font-size: 18px;
}

.poll-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.poll-percent {
  flex: none;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.poll-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.poll-editor {
  display: grid;
  gap: 6px;
}

.poll-editor-answers {
  display: grid;
  gap: 8px;
}

.form-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.poll-multi {
  align-self: end;
  min-height: 40px;
}

/* ---------- levels ---------- */

.level-bar {
  position: relative;
  height: 8px;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--raised);
}

.level-bar::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--percent, 0%);
  border-radius: 4px;
  background: var(--accent-grad);
}

.level-block {
  display: grid;
  gap: 6px;
  margin: 10px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ranking {
  display: grid;
  gap: 6px;
  max-height: 64vh;
  overflow-y: auto;
}

.rank-me {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 12px;
  border: 1px solid var(--selected-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(124, 92, 255, 0.05));
}

.rank-me-text {
  flex: 1;
  display: grid;
  gap: 6px;
}

.rank-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.rank-reward {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.rank-row:hover {
  border-color: var(--line-strong);
}

.rank-row.me {
  border-color: var(--selected-line);
}

.rank-pos {
  flex: none;
  width: 34px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.rank-name {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.rank-level {
  flex: none;
  display: grid;
  justify-items: end;
}

.reward-row {
  display: grid;
  grid-template-columns: auto 80px auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.btn.danger-outline {
  justify-self: start;
  border: 1px solid rgba(240, 68, 97, 0.5);
  background: none;
  color: var(--stop-text);
}


/* ---------- events ---------- */

.events-list {
  display: grid;
  gap: 10px;
  max-height: 66vh;
  overflow-y: auto;
}

.event-new {
  justify-self: start;
}

.event-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.act-event .event-card {
  background: var(--card);
}

.event-card.live {
  border-color: rgba(240, 68, 97, 0.55);
}

.event-top {
  display: flex;
  gap: 12px;
}

.event-date {
  flex: none;
  width: 52px;
  height: 56px;
  display: grid;
  place-content: center;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  line-height: 1.1;
  text-align: center;
}

.event-date span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-date strong {
  font-size: 22px;
}

.event-names {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.event-names .live {
  justify-self: start;
}

.event-when {
  color: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
}

.event-title {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.event-where {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.event-desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.event-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-count {
  flex: 1;
  min-width: 0;
}

.event-foot .btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 13px;
}

.btn.event-going {
  border: 1px solid rgba(61, 220, 132, 0.5);
  background: rgba(61, 220, 132, 0.12);
  color: var(--ok);
}

.event-manage {
  display: flex;
  gap: 14px;
}

.event-card.compact .event-date {
  width: 44px;
  height: 48px;
}

/* Not so tall windows: the channel list keeps room between the card and the voice panel. */

/* ---------- edge tabs (‹ ›) at the panel borders ---------- */

.edge-tab {
  background: var(--raised);
}

.edge-tab:hover {
  background: var(--accent);
  color: #fff;
}

.edge-tab.left {
  left: calc(var(--rail-w) + var(--side-w) + 1px);
  border-radius: 0 8px 8px 0;
}

.app.no-sidebar .edge-tab.left {
  left: var(--rail-w);
}

.edge-tab.right {
  right: calc(var(--gap) + var(--panel-w) - 1px);
}

.app.no-members .edge-tab.right {
  right: var(--gap);
}

.app .members.side-panel:not(.hidden) {
  display: flex !important;
}

.app.members-view .edge-tab.right {
  display: block;
}

/* ---------- smaller windows ---------- */

@media (max-width: 1280px) {
  .header-search {
    width: 170px;
  }
}

@media (max-width: 1100px) {
  .channel-topic {
    display: none;
  }

  .header-search {
    width: 140px;
  }
}

/* Up to 1000 px: the member list is a drawer over the chat (‹ on the right). */
@media (max-width: 1000px) {
  :root {
    --panel-w: min(300px, calc(100vw - 120px));
  }

  .app {
    grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) 0;
  }

  .app.no-sidebar {
    grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) 0;
  }

  .app > .main {
    border-radius: 16px;
  }

  .app:not(.no-members) > #members.side-panel:not(.hidden) {
    position: fixed;
    top: var(--top-h);
    right: var(--gap);
    bottom: var(--gap);
    z-index: 30;
    border-left: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: -16px 0 40px rgba(4, 2, 12, 0.7);
  }
}

/* Up to 760 px: the channel list is a drawer too (› on the left); the rail stays. */
@media (max-width: 760px) {
  :root {
    --rail-w: 64px;
    --side-w: min(300px, calc(100vw - 120px));
  }

  .app,
  .app.no-sidebar {
    grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) 0;
  }

  .app > .main {
    margin-left: 0;
  }

  .app > .sidebar {
    position: fixed;
    top: var(--top-h);
    left: var(--rail-w);
    bottom: var(--gap);
    z-index: 30;
    width: var(--side-w);
    box-shadow: 16px 0 40px rgba(4, 2, 12, 0.7);
  }

  .rail-btn,
  .rail-btn.has-icon {
    width: 46px;
    height: 46px;
  }

  .header-search {
    display: none;
  }

  .brand-name {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .main-header .header-actions .header-btn:not(.header-help):not(.header-bell) {
    display: none;
  }
}

/* Not so tall windows: the channel list keeps room. */
@media (max-height: 860px) {
  .server-banner {
    height: 120px;
  }

  .server-banner-icon {
    width: 48px;
    height: 48px;
  }

  .vc-action {
    width: 46px;
    height: 46px;
  }

  .vc-action.hangup {
    width: 50px;
    height: 50px;
  }

  #voice-bar.voice-bar {
    gap: 10px;
    padding: 12px;
  }

  .side-item {
    min-height: 38px;
  }
}

@media (max-height: 680px) {
  .vc-people {
    display: none;
  }

  .server-banner {
    height: 96px;
  }
}

/* ---------- server settings: banner ---------- */

.server-banner-edit {
  display: grid;
  gap: 8px;
}

.server-banner-preview {
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--picture) center / cover no-repeat;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- search results and help ---------- */

.search-results {
  display: grid;
  gap: 6px;
  max-height: 64vh;
  overflow-y: auto;
}

.search-hit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.search-hit:hover {
  border-color: var(--selected-line);
}

.search-hit-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.search-hit-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}

.search-hit-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.search-hit-text mark {
  border-radius: 4px;
  background: rgba(124, 92, 255, 0.4);
  color: #fff;
}

.help h4 {
  margin: 4px 0 8px;
}

.help-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.help-keys {
  min-width: 120px;
  display: flex;
  gap: 4px;
}

.help-keys kbd {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  font: 600 12px/1.6 inherit;
}

.help-tips {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

/* ---------- phone (Android app and small screens) ---------- */

/* The call bar only exists on phones. */
.call-pill {
  display: none;
}

@media (max-width: 600px) {
  :root {
    --top-h: 0px;
    --gap: 0px;
    --rail-w: 68px;
    --side-w: min(300px, calc(100vw - 68px - 36px));
    --panel-w: min(320px, calc(100vw - 48px));
  }

  /* The chat takes the whole screen; the rail + channels and the members slide in. */
  .app,
  .app.no-sidebar {
    grid-template-columns: 0 0 minmax(0, 1fr) 0;
    grid-template-rows: 0 minmax(0, 1fr);
    padding: 0;
  }

  .topbar {
    display: none;
  }

  .app > .main {
    margin: 0;
    padding-top: env(safe-area-inset-top);
    border: 0;
    border-radius: 0;
  }

  .app.no-sidebar > .rail {
    display: none;
  }

  .app:not(.no-sidebar) > .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 31;
    width: var(--rail-w);
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .app > .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--rail-w);
    z-index: 31;
    width: var(--side-w);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 0 18px 18px 0;
    box-shadow: 16px 0 40px rgba(4, 2, 12, 0.7);
  }

  .app:not(.no-members) > #members.side-panel:not(.hidden) {
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 31;
    padding-top: env(safe-area-inset-top);
    border-radius: 18px 0 0 18px;
  }

  /* Dim the chat while a drawer is open (tapping it closes the drawer). */
  .app:not(.no-sidebar)::after,
  .app.members-view:not(.no-members)::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(4, 2, 12, 0.6);
  }

  /* ☰ at the top left opens the servers and channels. */
  .edge-tab.right {
    display: none !important;
  }

  .edge-tab.left,
  .app.no-sidebar .edge-tab.left {
    top: calc(env(safe-area-inset-top) + 10px);
    left: 10px;
    z-index: 25;
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 12px;
    background: var(--card);
    font-size: 0;
    line-height: 42px;
    box-shadow: none;
  }

  .edge-tab.left::before {
    content: '☰';
    color: var(--text);
    font-size: 20px;
  }

  .app:not(.no-sidebar) .edge-tab.left {
    display: none;
  }

  /* Chat header: room for ☰, fewer tools. */
  .main-header {
    height: 62px;
    gap: 6px;
    padding: 0 8px 0 62px;
  }

  .main-header #main-title {
    min-width: 0;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-header .hash.big {
    font-size: 24px;
  }

  .channel-topic,
  .header-help {
    display: none;
  }

  /* Friends: the tabs scroll sideways. */
  .main-header:has(> .tab) {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-header > .tab,
  .main-header > .divider,
  .main-header > svg {
    flex: none;
  }

  .header-actions {
    gap: 0;
  }

  .header-btn {
    width: 38px;
  }

  .main-header .header-actions .header-btn:not(.header-help):not(.header-bell) {
    display: grid;
  }

  .header-search {
    display: flex;
    width: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  .header-search-input {
    display: none;
  }

  .header-search-go {
    width: 38px;
    height: 40px;
    color: var(--text-soft);
  }

  /* Messages and the message box. */
  .message-list {
    padding-top: 8px;
  }

  .composer {
    padding: 0 8px calc(8px + env(safe-area-inset-bottom));
  }

  .composer-row {
    min-height: 52px;
    gap: 4px;
    padding: 0 6px 0 8px;
  }

  .composer-tool[title='Criar enquete'],
  .composer-tool.gif-btn,
  .composer-tool[aria-label='Enviar arquivo'] {
    display: none;
  }

  .message .message-tools {
    right: 8px;
  }

  /* The call on top of the chat. */
  .app.voice-on .call-pill:not(.hidden) {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 68px);
    left: 8px;
    right: 8px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 12px;
    border: 1px solid rgba(61, 220, 132, 0.4);
    border-radius: 16px;
    background: rgba(26, 22, 49, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .app.voice-on .main .message-list {
    padding-top: 64px;
  }

  .call-pill-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
  }

  .call-pill-main strong {
    color: var(--ok);
    white-space: nowrap;
  }

  .call-pill-place {
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .call-pill-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.2);
  }

  .call-pill-btn {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--raised);
    color: var(--text);
  }

  .call-pill-btn.off {
    background: var(--stop-bg);
    color: var(--stop-text);
  }

  .call-pill-btn.hangup {
    background: var(--danger);
    color: #fff;
  }

  /* Windows, menus and the emoji picker fit the screen. */
  .modal,
  .modal.wide {
    width: calc(100% - 16px);
    max-height: calc(100% - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .settings-layout {
    height: calc(100dvh - 140px);
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr);
  }

  /* The tabs become one row that scrolls sideways. */
  .settings-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .settings-content {
    padding: 12px 12px 16px;
  }

  .settings-nav .side-item {
    flex: none;
    width: auto;
  }

  .emoji-picker {
    width: calc(100vw - 16px);
  }

  .emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .ctx-menu {
    max-width: calc(100vw - 16px);
  }

  .server-hover,
  .stream-preview {
    display: none;
  }

  .cm-two,
  .link-row,
  .reward-row {
    grid-template-columns: 1fr;
  }

  .room-grid,
  .server-grid,
  .explore-actions {
    grid-template-columns: 1fr;
  }

  .home-page-body {
    padding: 12px;
  }

  /* "Nova versão" sits above the message box, not over the call bar. */
  .update-pill {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    transform: none;
  }

  .update-pill > span {
    flex: 1;
  }
}

/* ---------- phone: calls and touch ---------- */

@media (max-width: 600px) {
  /* Bigger targets for fingers, no blue flash on tap. */
  html {
    -webkit-tap-highlight-color: transparent;
  }

  .side-item {
    min-height: 44px;
  }

  .ctx-item {
    min-height: 44px;
  }

  .header-btn,
  .header-search-go {
    height: 44px;
  }

  /* Long press opens the message menu (it has "Copiar texto") instead of selecting. */
  .message {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* The call screen already has its own buttons. */
  .app:has(#main .call-stage) .call-pill {
    display: none !important;
  }

  .app.voice-on:has(#main .call-stage) .main .message-list {
    padding-top: 8px;
  }

  /* Buttons spread out, hang up apart from the rest, nothing on top of it. */
  .call-stage .stage-controls {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  }

  .call-stage .round-btn {
    width: 54px;
    height: 54px;
  }

  .call-stage .round-btn.danger {
    width: 72px;
    height: 54px;
    margin-left: 10px;
    border-radius: 27px;
  }

  .call-stage {
    position: relative;
  }

  .stage-corner {
    top: 10px;
    right: 10px;
    z-index: 3;
    transform: none;
  }

  .stage-corner-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(14, 12, 26, 0.7);
  }

  .stage-corner-btn.popout {
    display: none;
  }

  /* Tiles: one per row for two people, two per row for more. */
  .call-stage .stage-grid:not(.strip) {
    align-content: flex-start;
    padding: 64px 10px 8px;
  }

  .call-stage .stage-grid:not(.strip) > *,
  .call-stage .stage-grid:not(.strip):is([data-count='1'], [data-count='2']) > * {
    width: 100%;
    max-width: none;
  }

  .call-stage .stage-grid:not(.strip):is([data-count='3'], [data-count='4']) > *,
  .call-stage .stage-grid:not(.strip):not([data-count='1']):not([data-count='2']) > * {
    width: calc(50% - 4px);
    aspect-ratio: 1;
  }

  /* Watching a stream: the bar's buttons fit. */
  .viewer-bar {
    flex-wrap: wrap;
    gap: 4px;
  }

  .viewer-volume input[type='range'] {
    display: none;
  }

  .viewer-icon {
    width: 40px;
    height: 40px;
  }
}

/* ---------- "Konvo no celular" ---------- */

.nav-new {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(61, 220, 132, 0.16);
  color: var(--ok);
  font-size: 11px;
  font-weight: 700;
}

.mobile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.28), transparent 55%),
    var(--card);
}

.mobile-qr {
  flex: none;
  width: 196px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}

.qr-code {
  display: block;
  width: 100%;
  height: auto;
}

.mobile-text {
  flex: 1;
  min-width: 240px;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.mobile-text h2 {
  margin: 0;
  font-size: 26px;
}

.mobile-text p {
  margin: 0;
}

.mobile-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(61, 220, 132, 0.16);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mobile-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.mobile-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.mobile-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.mobile-step > div {
  display: grid;
  gap: 2px;
}

.mobile-step-n {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 600px) {
  .update-banner {
    top: calc(env(safe-area-inset-top) + 8px);
    left: 8px;
    right: 8px;
    transform: none;
    flex-wrap: wrap;
  }

  .update-banner > span {
    flex: 1;
    min-width: 160px;
  }
}

/* ---------- phone: swiping the drawers ---------- */

@media (max-width: 600px) {
  /* A sideways swipe is ours: the phone browser must not take it as "back". */
  html,
  body {
    overscroll-behavior-x: none;
  }

  /* Opening with ☰ (or the members button) slides in too. */
  .app > .rail,
  .app > .sidebar,
  .app > #members.side-panel {
    transition: transform 0.2s ease-out;
  }

  @starting-style {
    .app:not(.no-sidebar) > .rail {
      transform: translateX(-100%);
    }

    .app:not(.no-sidebar) > .sidebar {
      transform: translateX(calc(-100% - var(--rail-w)));
    }

    .app.members-view:not(.no-members) > #members.side-panel {
      transform: translateX(100%);
    }
  }

  /* While the finger moves the drawer (no transition: it follows the finger). */
  .app.swipe-sidebar > .rail,
  .app.swipe-sidebar > .sidebar,
  .app.swipe-members > #members.side-panel {
    transform: translateX(var(--swipe-x, 0px));
  }

  .app.swiping > .rail,
  .app.swiping > .sidebar,
  .app.swiping > #members.side-panel,
  .app.swiping::after {
    transition: none;
  }

  .app.swipe-sidebar::after,
  .app.swipe-members::after {
    opacity: var(--swipe-p, 1);
  }

  .app.swipe-settle::after {
    transition: opacity 0.2s ease-out;
  }
}
