/* Muster — "Dusk"
 * Medium-contrast dark theme on warm aubergine instead of neutral grey, with
 * an apricot accent. The one loud element is the dusk gradient (apricot to
 * rose to violet), used on the level-bars mark, the login hero and the active
 * indicator. Variable names are kept from earlier themes so components don't
 * change: --ink/--gunmetal/--slate are the three surface layers. */

:root {
  --ink: #120e17;        /* rail, deepest layer */
  --gunmetal: #19141f;   /* sidebar */
  --slate: #201a27;      /* main surface */
  --raised: #2a2233;     /* inputs, hover */
  --raised-2: #342a3e;   /* active rows */
  --line: #3a3045;

  --text: #ddd5e3;
  --strong: #f3eef6;
  --muted: #a597b0;
  --faint: #7a6c86;

  --straw: #f2a25c;      /* accent: apricot */
  --straw-hi: #f7b77e;
  --straw-ink: #2b1505;  /* text on the accent */
  --straw-soft: rgba(242, 162, 92, .13);

  --green: #6bd39a;
  --idle: #e8b84f;
  --red: #ec6f7f;

  --temper: linear-gradient(180deg, #f6b26b 0%, #ec6f7f 52%, #9a6ee0 100%);
  --temper-x: linear-gradient(90deg, #f6b26b 0%, #ec6f7f 52%, #9a6ee0 100%);

  --display: "Bahnschrift", "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--slate);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; }

:focus-visible { outline: 2px solid var(--straw); outline-offset: 2px; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Auth ────────────────────────────────────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
  background: var(--ink);
}

.auth-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 64px clamp(32px, 6vw, 96px);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 0% 100%, rgba(154, 110, 224, .16), transparent 60%),
    radial-gradient(90% 70% at 100% 0%, rgba(242, 162, 92, .10), transparent 55%),
    linear-gradient(160deg, #1d1624 0%, #120e17 75%);
}

/* Hero mark: five level bars that rise once on load and spell an M. */
.hero-bars {
  position: absolute;
  top: 72px;
  left: clamp(32px, 6vw, 96px);
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 1.4vw, 18px);
  height: clamp(150px, 22vw, 260px);
}
.hero-bars span {
  width: clamp(18px, 2.4vw, 30px);
  border-radius: 999px;
  background: var(--temper);
  background-size: 100% clamp(150px, 22vw, 260px);
  background-position: top;
  transform-origin: top;
  animation: rise-bar .8s cubic-bezier(.2, .8, .2, 1) both;
  box-shadow: 0 0 40px rgba(236, 111, 127, .18);
}
.hero-bars span:nth-child(1) { height: 100%; animation-delay: .05s; }
.hero-bars span:nth-child(2) { height: 62%; animation-delay: .12s; }
.hero-bars span:nth-child(3) { height: 38%; animation-delay: .19s; }
.hero-bars span:nth-child(4) { height: 62%; animation-delay: .26s; }
.hero-bars span:nth-child(5) { height: 100%; animation-delay: .33s; }
@keyframes rise-bar { from { transform: scaleY(.08); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.hero-copy { position: relative; max-width: 34ch; }

.wordmark {
  margin: 0 0 18px -4px;
  font-family: var(--display);
  font-stretch: condensed;
  font-weight: 700;
  font-size: clamp(56px, 8.5vw, 124px);
  line-height: .86;
  letter-spacing: -.02em;
  color: var(--strong);
}

.tagline {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--gunmetal);
  border-left: 1px solid var(--line);
}

.auth-card { width: 100%; max-width: 360px; }

.auth-mark { width: 40px; height: 40px; color: var(--text); display: none; }

.auth-title {
  margin: 0 0 28px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -.01em;
  color: var(--strong);
}

.field { margin-bottom: 18px; }
.field label,
.add-pane label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.add-row input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  color: var(--strong);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder,
.add-row input::placeholder { color: var(--faint); }
.field input:focus,
.add-row input:focus {
  border-color: var(--straw);
  box-shadow: 0 0 0 3px var(--straw-soft);
}

.auth-error {
  min-height: 20px;
  margin: -4px 0 10px;
  color: var(--red);
  font-size: 13.5px;
}

.btn-primary {
  width: 100%;
  background: var(--straw);
  color: var(--straw-ink);
  border: none;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 650;
  transition: background .15s, transform .05s;
}
.btn-primary:hover:not(:disabled) { background: var(--straw-hi); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-secondary {
  background: var(--raised);
  color: var(--strong);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
}
.btn-secondary:hover { background: var(--raised-2); }

.auth-switch { margin-top: 18px; color: var(--muted); font-size: 14px; }

.link {
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  color: var(--straw);
  font-size: 14px;
  font-weight: 600;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-hint {
  margin-top: 28px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--ink);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.auth-hint:empty { display: none; }
.auth-hint code {
  background: var(--raised);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--strong);
  font-size: 12.5px;
}

@media (max-width: 820px) {
  .auth-screen { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-hero { padding: 40px 24px 28px 44px; min-height: 0; }
  .hero-bars { top: 28px; left: 24px; height: 90px; gap: 8px; }
  .hero-bars span { width: 12px; background-size: 100% 90px; }
  .wordmark { font-size: 56px; }
  .tagline { font-size: 15px; }
  .auth-panel { border-left: none; border-top: 1px solid var(--line); align-items: start; }
}

/* ── App shell ───────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 72px 264px 1fr;
  height: 100%;
}

/* Rail */
.rail {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 10px;
}

.rail-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--text);
}
.rail-logo svg { width: 34px; height: 34px; }

.rail-sep { width: 28px; height: 1px; background: var(--line); margin: 2px 0 4px; }

.rail-item {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--gunmetal);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background .15s, color .15s, border-radius .2s;
}
.rail-item svg { width: 22px; height: 22px; }
.rail-item:hover { background: var(--raised); color: var(--strong); border-radius: 12px; }
.rail-item.active { background: var(--raised-2); color: var(--strong); border-color: transparent; }

/* Active indicator: a short bar of the dusk gradient on the rail edge. */
.rail-item::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--temper);
  transform: translateY(-50%);
  transition: height .2s ease;
}
.rail-item:hover::before { height: 18px; }
.rail-item.active::before { height: 34px; }

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-sizing: content-box;
}

/* Sidebar */
.sidebar {
  background: var(--gunmetal);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid rgba(0,0,0,.25);
}

.sidebar-head {
  position: relative;
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,.28);
}
.search-icon {
  position: absolute;
  left: 23px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.sidebar-head input {
  width: 100%;
  background: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 8px 10px 8px 32px;
  color: var(--strong);
  font-size: 13.5px;
  outline: none;
}
.sidebar-head input::placeholder { color: var(--faint); }
.sidebar-head input:focus { border-color: var(--straw); }

.sidebar-section-title {
  padding: 16px 18px 6px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
}

.dm-list { flex: 1; overflow-y: auto; padding: 2px 8px 8px; }

.dm-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
}
.dm-item:hover { background: var(--raised); color: var(--text); }
.dm-item.active { background: var(--raised-2); color: var(--strong); }
.dm-item .dm-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 500;
}
.dm-item .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--straw);
  flex-shrink: 0;
}
.dm-item:has(.unread-dot) .dm-name { color: var(--strong); font-weight: 650; }

.dm-empty { padding: 20px 18px; color: var(--muted); font-size: 13.5px; }
.dm-empty p { margin: 0 0 14px; line-height: 1.5; }

/* Avatars */
.avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 34px; }

.avatar .dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid var(--gunmetal);
  background: var(--faint);
}
.dm-item:hover .avatar .dot { border-color: var(--raised); }
.dm-item.active .avatar .dot { border-color: var(--raised-2); }
.messages .avatar .dot,
.friend-row .avatar .dot,
.messages-placeholder .avatar .dot { border-color: var(--slate); }
.avatar.lg .dot { width: 22px; height: 22px; border-width: 4px; }

.dot.online { background: var(--green); }
.dot.idle { background: var(--idle); }
.dot.dnd { background: var(--red); }
.dot.offline { background: var(--faint); }

/* User panel */
.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  background: #150f1a;
  border-top: 1px solid rgba(0,0,0,.3);
}
.user-meta { flex: 1; min-width: 0; }
.user-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-tag {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-wrap { position: relative; }
.status-dot {
  position: relative;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
}
.status-dot:hover { background: var(--raised); }
.status-dot::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--green);
}
.status-dot[data-status="idle"]::after { background: var(--idle); }
.status-dot[data-status="dnd"]::after { background: var(--red); }
.status-dot[data-status="offline"]::after,
.status-dot[data-status="invisible"]::after { background: transparent; box-shadow: inset 0 0 0 3px var(--faint); }

.status-menu {
  position: absolute;
  bottom: 44px;
  right: 0;
  min-width: 190px;
  padding: 6px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 50;
}
.status-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.status-menu button:hover { background: var(--raised); color: var(--strong); }
.status-menu button.danger { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ── Main ────────────────────────────────────────────────────── */
.main { background: var(--slate); display: flex; flex-direction: column; min-width: 0; }

.channel-head {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0,0,0,.28);
  box-shadow: 0 1px 0 rgba(255,255,255,.02);
}
.channel-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--strong);
  white-space: nowrap;
}
.channel-sub {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-sub:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 14px;
  margin-right: 11px;
  vertical-align: -2px;
  background: var(--line);
}

.channel-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* Messages */
.messages { flex: 1; overflow-y: auto; padding: 12px 0 10px; }

.msg-group {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 2px 20px;
}
.msg-group.new-section { margin-top: 14px; padding-top: 4px; }
.msg-group:hover { background: rgba(0,0,0,.1); }

.msg-avatar { width: 40px; flex-shrink: 0; }
.msg-avatar .avatar { width: 40px; height: 40px; font-size: 16px; }
.msg-avatar .avatar .dot { display: none; }

.msg-body { flex: 1; min-width: 0; max-width: 78ch; }
.msg-meta { display: flex; align-items: baseline; gap: 9px; margin-bottom: 1px; }
.msg-author { font-weight: 650; color: var(--strong); font-size: 15px; }
.bot-tag {
  align-self: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--straw-soft);
  color: var(--straw);
  font-size: 11px;
  font-weight: 700;
}
.msg-time { font-size: 12px; color: var(--faint); }
.msg-content {
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg-content .edited { color: var(--faint); font-size: 11.5px; margin-left: 5px; }

.msg-hover-actions {
  position: absolute;
  top: -14px;
  right: 20px;
  display: none;
  gap: 2px;
  padding: 3px;
  background: var(--gunmetal);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.msg-group:hover .msg-hover-actions,
.msg-group:focus-within .msg-hover-actions { display: flex; }
.msg-hover-actions button {
  padding: 4px 9px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font-size: 13px;
}
.msg-hover-actions button:hover { background: var(--raised); color: var(--strong); }
.msg-hover-actions button.danger:hover { color: var(--red); }

.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 20px 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}
.date-divider::before,
.date-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.messages-placeholder {
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 32px 20px;
  color: var(--muted);
}
.messages-placeholder h2 {
  margin: 16px 0 6px;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  color: var(--strong);
}
.messages-placeholder p { margin: 0; font-size: 15px; }

/* Typing + composer */
.typing {
  height: 22px;
  padding: 0 22px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.typing:not(:empty)::before {
  content: "";
  width: 22px;
  height: 6px;
  margin-right: 8px;
  background: radial-gradient(circle, var(--straw) 2.5px, transparent 3px) 0 0 / 8px 6px repeat-x;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.composer { padding: 0 20px 20px; }
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s;
}
.composer-box:focus-within { border-color: #55486a; }
.composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 200px;
  padding: 9px 0;
  border: none;
  background: none;
  color: var(--strong);
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  outline: none;
}
.composer textarea:disabled { opacity: .5; }
.composer textarea::placeholder { color: var(--faint); }

.send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--r-sm);
  background: var(--straw);
  color: var(--straw-ink);
  display: grid;
  place-items: center;
  transition: background .15s, opacity .15s;
}
.send svg { width: 18px; height: 18px; }
.send:hover:not(:disabled) { background: var(--straw-hi); }
.send:disabled { background: transparent; color: var(--faint); }

/* ── People view ─────────────────────────────────────────────── */
.home-view { height: 100%; overflow-y: auto; }
.home-inner { max-width: 760px; padding: 36px 40px; }
.home-inner h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--strong);
}

.home-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 7px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.tab:hover { background: var(--raised); color: var(--text); }
.tab.active { background: var(--raised-2); color: var(--strong); }
.tab.accent { color: var(--straw); }
.tab.accent.active { background: var(--straw); color: var(--straw-ink); }
.tab-sep { flex: 1; }

.add-pane { padding: 28px 0 8px; }
.add-row { display: flex; gap: 10px; }
.add-row input { flex: 1; }
.add-row .btn-primary { width: auto; white-space: nowrap; padding: 11px 20px; }
.add-hint { color: var(--faint); font-size: 13px; margin-top: 8px; }
.add-msg { margin-top: 12px; font-size: 14px; }
.add-msg.ok { color: var(--green); }
.add-msg.err { color: var(--red); }

.friend-list { margin-top: 6px; }
.friend-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--line);
}
.friend-row:hover { background: var(--raised); border-bottom-color: transparent; }
.friend-row .info { flex: 1; min-width: 0; }
.friend-row .name { color: var(--strong); font-weight: 650; font-size: 15px; }
.friend-row .sub { color: var(--muted); font-size: 13px; }
.friend-row .actions { display: flex; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--gunmetal);
  color: var(--text);
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: var(--straw); border-color: var(--straw); color: var(--straw-ink); }
.icon-btn svg { width: 17px; height: 17px; }

.home-empty { color: var(--muted); padding: 48px 0; font-size: 15px; max-width: 46ch; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 18px;
  background: var(--ink);
  color: var(--strong);
  border: 1px solid var(--line);
  border-left: 3px solid var(--straw);
  border-radius: var(--r-sm);
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 100;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #43374f transparent; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #43374f; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Small screens: narrower rail and sidebar. */
@media (max-width: 760px) {
  .app { grid-template-columns: 60px 200px 1fr; }
  .home-inner { padding: 24px 20px; }
  .channel-head, .composer { padding-left: 14px; padding-right: 14px; }
  .msg-group { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Message formatting */
.msg-content strong { color: var(--strong); font-weight: 650; }
.msg-content a { color: var(--straw); text-decoration: none; }
.msg-content a:hover { text-decoration: underline; text-underline-offset: 3px; }
.md-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ink);
  border: 1px solid var(--line);
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 13.5px;
}
.md-pre {
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--ink);
  border: 1px solid var(--line);
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 13.5px;
  white-space: pre-wrap;
}
.md-quote { display: block; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.md-spoiler { background: var(--raised-2); color: transparent; border-radius: 4px; cursor: pointer; transition: color .1s; }
.md-spoiler:hover, .md-spoiler:focus { color: var(--text); }
.mention { padding: 0 3px; border-radius: 4px; background: var(--straw-soft); color: var(--straw-hi); font-weight: 600; }
.msg-group.mentions-me { background: rgba(242, 162, 92, .07); box-shadow: inset 3px 0 0 var(--straw); }

/* ── Rooms ───────────────────────────────────────────────────── */
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pane .dm-list { flex: 1; }

.rail-item.home svg.rail-mark { width: 30px; height: 30px; color: var(--text); }
.room-list { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.room-list:empty { display: none; }
.rail-item.room { padding: 0; overflow: visible; border: none; background: none; }
.rail-item.room .room-icon { width: 46px; height: 46px; border-radius: 14px; transition: border-radius .2s; }
.rail-item.room:hover .room-icon,
.rail-item.room.active .room-icon { border-radius: 12px; }
.rail-item.room.active .room-icon { box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px rgba(255,255,255,.18); }
.pip {
  position: absolute;
  left: -13px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 0 4px 4px 0;
  background: var(--strong);
}

.room-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: rgba(255,255,255,.94);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
  border-radius: 12px;
}
.room-icon.md { width: 44px; height: 44px; font-size: 16px; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 10px 8px 0;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.nav-row svg { width: 20px; height: 20px; }
.nav-row:hover { background: var(--raised); color: var(--text); }
.nav-row.active { background: var(--raised-2); color: var(--strong); }

.room-head-wrap { position: relative; }
.room-head {
  width: 100%;
  height: 59px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,.28);
  background: none;
  color: var(--strong);
  text-align: left;
}
.room-head:hover, .room-head.open { background: var(--raised); }
.room-name {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-head svg { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.room-head.open svg { transform: rotate(180deg); }

.menu {
  position: absolute;
  z-index: 60;
  min-width: 210px;
  padding: 6px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.room-menu { top: 62px; left: 8px; right: 8px; }
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu button:hover { background: var(--raised); color: var(--strong); }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: rgba(236, 111, 127, .12); }

.invite-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 10px 2px;
  padding: 9px 12px;
  border: 1px dashed #55486a;
  border-radius: var(--r-sm);
  background: none;
  color: var(--straw);
  font-size: 14px;
  font-weight: 600;
}
.invite-cta svg { width: 17px; height: 17px; }
.invite-cta:hover { background: var(--straw-soft); border-color: var(--straw); }

.sidebar-section-title.with-action { display: flex; align-items: center; justify-content: space-between; padding-right: 12px; }
.mini-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--muted);
}
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn:hover { background: var(--raised); color: var(--strong); }

.channel-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
}
.channel-row .hash { width: 17px; height: 17px; flex-shrink: 0; color: var(--faint); }
.channel-row:hover { background: var(--raised); color: var(--text); }
.channel-row.active { background: var(--raised-2); color: var(--strong); }
.channel-row.unread { color: var(--strong); }
.channel-row.unread .dm-name { font-weight: 650; }
.channel-row.unread::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 4px;
  height: 8px;
  margin-top: -4px;
  border-radius: 0 4px 4px 0;
  background: var(--strong);
}
.channel-row .dm-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-action {
  width: 24px;
  height: 24px;
  display: none;
  place-items: center;
  flex-shrink: 0;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--faint);
}
.row-action svg { width: 14px; height: 14px; }
.row-action:hover { background: rgba(236, 111, 127, .15); color: var(--red); }
.channel-row:hover .row-action,
.member-row:hover .row-action,
.row-action:focus-visible { display: grid; }

/* Channel header + members */
.ch-hash { width: 22px; height: 22px; color: var(--faint); flex-shrink: 0; }
.head-btn { margin-left: auto; width: 34px; height: 34px; border: none; background: none; color: var(--muted); }
.head-btn:hover { background: var(--raised); color: var(--strong); }
.head-btn.active { color: var(--strong); }

.channel-body { flex: 1; min-height: 0; display: flex; }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.members {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 14px 10px;
  background: var(--gunmetal);
  border-left: 1px solid rgba(0,0,0,.25);
}
.members-title { padding: 12px 8px 6px; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--muted); }
.members-title:first-child { padding-top: 2px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); }
.member-row:hover { background: var(--raised); }
.member-row.off { opacity: .55; }
.member-row .avatar .dot { border-color: var(--gunmetal); }
.member-row:hover .avatar .dot { border-color: var(--raised); }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-role { font-size: 12px; color: var(--straw); }

.placeholder-hash {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--raised);
  color: var(--strong);
}
.placeholder-hash svg { width: 36px; height: 36px; }
.placeholder-cta { margin-top: 16px; }

.edit-box {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  resize: none;
  outline: none;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 6, 14, .7);
  animation: fade .15s ease both;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--gunmetal);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: rise .18s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal:has(.add-room-grid) { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 650; color: var(--strong); }
.modal-sub { margin: 6px 0 20px; color: var(--muted); font-size: 14.5px; max-width: 52ch; }
.modal-head + form, .modal-head + .add-room-grid { margin-top: 20px; }
.icon-plain { width: 32px; height: 32px; display: grid; place-items: center; border: none; border-radius: var(--r-sm); background: none; color: var(--muted); flex-shrink: 0; }
.icon-plain svg { width: 18px; height: 18px; }
.icon-plain:hover { background: var(--raised); color: var(--strong); }

.modal .field input,
.modal select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--strong);
  font-size: 15px;
  outline: none;
}
.modal select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.modal select:focus { border-color: var(--straw); }
.field-hint { margin-top: 6px; color: var(--faint); font-size: 12.5px; }
.form-error { min-height: 18px; margin: -6px 0 10px; color: var(--red); font-size: 13.5px; }
.form-error:empty { min-height: 0; margin: 0; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-actions .btn-primary, .modal-actions .btn-danger { width: auto; padding: 10px 18px; }
.btn-ghost { padding: 10px 16px; border: none; border-radius: var(--r-sm); background: none; color: var(--text); font-size: 14.5px; font-weight: 600; }
.btn-ghost:hover { background: var(--raised); }
.btn-danger { padding: 10px 18px; border: none; border-radius: var(--r-sm); background: var(--red); color: #2a0a10; font-size: 15px; font-weight: 650; }
.btn-danger:hover { background: #f28894; }
.btn-block { width: 100%; }

.add-room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.add-room-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--slate);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.add-room-card h3 { margin: 0 0 14px; font-family: var(--display); font-size: 18px; font-weight: 650; color: var(--strong); }
.add-room-card .field { flex: 1; }
.add-room-card .btn-primary, .add-room-card .btn-secondary { margin-top: auto; padding: 11px 16px; }
@media (max-width: 640px) { .add-room-grid { grid-template-columns: 1fr; } }

.join-preview, .invite-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.invite-banner { margin-bottom: 24px; padding: 14px; border-color: rgba(242,162,92,.35); background: linear-gradient(0deg, var(--straw-soft), var(--straw-soft)), var(--ink); }
.invite-kicker { color: var(--muted); font-size: 13px; }
.invite-room { color: var(--strong); font-family: var(--display); font-size: 18px; font-weight: 650; line-height: 1.2; }
.invite-meta { color: var(--muted); font-size: 13px; }

.invite-box { display: flex; gap: 8px; padding: 6px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); }
.invite-box .invite-link {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: none;
  background: none;
  color: var(--strong);
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 13.5px;
  outline: none;
}
.invite-box .btn-copy { width: auto; padding: 9px 16px; }
.invite-code-line { margin: 10px 2px 18px; color: var(--muted); font-size: 13.5px; }
.invite-code-line code {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--raised);
  color: var(--straw-hi);
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: .04em;
  user-select: all;
}
.invite-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 1100px) { .members { display: none; } }
.rail-item.home .badge { top: auto; bottom: -5px; }

/* SVG sprite holder (kept out of layout without inline styles, for the CSP) */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Account settings */
.settings-block { padding: 18px 0; border-top: 1px solid var(--line); }
.settings-block:first-of-type { border-top: none; padding-top: 4px; }
.settings-block h3 { margin: 0 0 12px; font-family: var(--display); font-size: 17px; font-weight: 650; color: var(--strong); }
.settings-block .btn-primary, .settings-block .btn-secondary { width: auto; padding: 10px 18px; }
.settings-note { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.danger-text { color: var(--red); }
.danger-text:hover { background: rgba(236, 111, 127, .12); }

/* ── Server icons ────────────────────────────────────────────── */
.room-icon.has-image { background: var(--raised); overflow: hidden; }
.room-icon img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.room-icon.xl { width: 96px; height: 96px; border-radius: 26px; font-size: 32px; }
.invite-desc, .placeholder-desc { margin-top: 4px; color: var(--text); font-size: 13.5px; max-width: 48ch; }
.placeholder-desc { margin-top: 10px; font-size: 15px; color: var(--muted); }
.menu button.accent-item { color: var(--straw); }
.menu button.accent-item svg { color: var(--straw); }

/* ── Server settings ─────────────────────────────────────────── */
.modal.modal-wide { max-width: 860px; padding: 0; position: relative; overflow: hidden; display: flex; }
.settings-shell { display: grid; grid-template-columns: 210px 1fr; width: 100%; min-height: 520px; max-height: calc(100vh - 32px); }
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 24px 10px;
  background: var(--ink);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.settings-nav-title {
  padding: 0 10px 10px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-nav button {
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.settings-nav button:hover { background: var(--raised); color: var(--text); }
.settings-nav button.active { background: var(--raised-2); color: var(--strong); }
.settings-nav button.danger { margin-top: auto; color: var(--red); }
.settings-nav button.danger.active { background: rgba(236, 111, 127, .14); }
.settings-body { padding: 28px 32px; overflow-y: auto; }
.settings-title { margin: 0 0 6px; font-family: var(--display); font-size: 24px; font-weight: 650; color: var(--strong); }
.settings-body .modal-sub { margin-bottom: 22px; }
.settings-close { position: absolute; top: 14px; right: 14px; }

.icon-editor { display: flex; gap: 20px; align-items: center; margin: 18px 0 24px; }
.icon-side { flex: 1; min-width: 0; }
.icon-help { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; max-width: 46ch; }
.btn-icon { width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.settings-textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--strong);
  font: inherit;
  font-size: 15px;
  resize: vertical;
  outline: none;
}
.settings-textarea:focus { border-color: var(--straw); }
.settings-body .btn-primary, .settings-body .btn-secondary, .settings-body .btn-danger { width: auto; padding: 10px 18px; }
.btn-ghost.small { padding: 6px 10px; font-size: 13.5px; }

.invite-table { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.invite-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr .7fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.invite-row:first-child { border-top: none; }
.invite-row.head { background: var(--ink); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.invite-row code { color: var(--straw-hi); font-family: "Cascadia Code", Consolas, ui-monospace, monospace; }
.muted-line { padding: 16px; color: var(--muted); font-size: 14px; }

.settings-members { display: flex; flex-direction: column; gap: 2px; }
.settings-member { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.settings-member:hover { background: var(--raised); }
.settings-member .avatar .dot { border-color: var(--gunmetal); }
.settings-member:hover .avatar .dot { border-color: var(--raised); }
.member-sub { color: var(--muted); font-size: 12.5px; }

@media (max-width: 700px) {
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; padding: 12px; border-right: none; border-bottom: 1px solid var(--line); }
  .settings-nav-title { width: 100%; }
  .settings-nav button.danger { margin-top: 0; }
  .invite-row { grid-template-columns: 1fr 1fr auto; }
  .invite-row > :nth-child(2), .invite-row > :nth-child(4) { display: none; }
}

/* ── End-to-end encryption ───────────────────────────────────── */
#btn-e2ee.active { color: var(--green); }
#btn-e2ee:not(.hidden) + .head-btn { margin-left: 0; }
.e2ee-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  background: var(--gunmetal);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}
.e2ee-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.e2ee-banner.warn { color: var(--straw-hi); background: rgba(242, 162, 92, .09); }
.e2ee-banner .link { margin-left: auto; }
.msg-locked { display: flex; align-items: center; gap: 7px; color: var(--faint); font-style: italic; font-size: 14px; }
.msg-locked svg { width: 14px; height: 14px; flex-shrink: 0; }
.e2ee-points { margin: 4px 0 16px; padding-left: 20px; color: var(--text); line-height: 1.55; }
.e2ee-points li { margin-bottom: 8px; }
.safety-code {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 14px;
  margin: 8px 0 16px;
  padding: 18px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 18px;
  letter-spacing: .06em;
  color: var(--strong);
  text-align: center;
}
.verify-status { margin: 4px 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.verify-status.ok { color: var(--green); }
.device-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.device-row:hover { background: var(--raised); }
.device-row > svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

/* ── Sign-up providers + email verification ──────────────────── */
.auth-providers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--raised);
  color: var(--strong);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.provider-btn:hover { background: var(--raised-2); border-color: #55486a; }
.auth-or { display: flex; align-items: center; gap: 12px; margin-top: 6px; color: var(--faint); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
input.locked { color: var(--muted); background: var(--gunmetal) !important; cursor: default; }

.verify-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(242, 162, 92, .10), transparent 60%),
    var(--ink);
}
.verify-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--gunmetal);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.verify-mark { width: 44px; height: 44px; margin-bottom: 14px; }
.verify-card .auth-title { margin-bottom: 8px; }
.verify-text { margin: 0 0 22px; color: var(--muted); }
.verify-text strong { color: var(--strong); font-weight: 600; overflow-wrap: anywhere; }
#in-code { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: "Cascadia Code", Consolas, ui-monospace, monospace; }
.verify-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; }
.verify-actions .link { margin-left: 0; }
.muted-link { color: var(--muted); }
#verify-change-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
#verify-change-form .btn-secondary { width: 100%; padding: 11px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { background: rgba(107, 211, 154, .14); color: var(--green); }
.pending-note { margin-top: 6px; color: var(--straw-hi); font-size: 13.5px; }

/* ── Voice channels ─────────────────────────────────────────────── */
#room-pane { overflow-y: auto; }
#room-pane .dm-list { flex: none; overflow: visible; }
#room-pane #voice-list { flex: 1; }

.voice-row .voice-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  text-align: center;
}
.voice-row.active .hash { color: var(--green); }
.voice-row.active .voice-count { background: rgba(107, 211, 154, .14); color: var(--green); }

.voice-occupants { padding: 2px 0 6px 30px; }
.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 4px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13.5px;
}
.voice-user .avatar.sm { width: 24px; height: 24px; font-size: 11px; transition: box-shadow .12s; }
.voice-user.speaking .avatar.sm { box-shadow: 0 0 0 2px var(--gunmetal), 0 0 0 4px var(--green); }
.voice-user.speaking .voice-user-name { color: var(--strong); }
.voice-user-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-flag { width: 15px; height: 15px; color: var(--red); flex-shrink: 0; }

/* Connection panel above the user panel */
.voice-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  background: #150f1a;
  border-top: 1px solid rgba(0,0,0,.3);
}
.voice-status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.voice-signal { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex-shrink: 0; }
.voice-signal i { width: 4px; border-radius: 2px; background: var(--green); }
.voice-signal i:nth-child(1) { height: 6px; }
.voice-signal i:nth-child(2) { height: 11px; }
.voice-signal i:nth-child(3) { height: 16px; }
.voice-panel.linking .voice-signal i { background: var(--idle); animation: vc-pulse 1s ease-in-out infinite; }
.voice-panel.linking .voice-signal i:nth-child(2) { animation-delay: .15s; }
.voice-panel.linking .voice-signal i:nth-child(3) { animation-delay: .3s; }
.voice-panel.trouble .voice-signal i { background: var(--red); }
@keyframes vc-pulse { 50% { opacity: .3; } }
.voice-meta { min-width: 0; }
.voice-state { font-size: 13.5px; font-weight: 650; color: var(--green); white-space: nowrap; }
.voice-panel.linking .voice-state { color: var(--idle); }
.voice-panel.trouble .voice-state { color: var(--red); }
.voice-where {
  display: block;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.voice-where:hover { color: var(--text); text-decoration: underline; }
.voice-actions { display: flex; gap: 2px; flex-shrink: 0; }
.vc-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
}
.vc-btn svg { width: 18px; height: 18px; }
.vc-btn:hover { background: var(--raised); color: var(--strong); }
.vc-btn.on { color: var(--red); }
.vc-btn.leave:hover { background: rgba(236, 111, 127, .16); color: var(--red); }

/* Create-channel type picker */
.type-picker { display: grid; gap: 8px; }
.type-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--raised);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.type-option:hover { border-color: var(--faint); }
.type-option.selected { border-color: var(--straw); background: var(--straw-soft); }
.type-icon { width: 22px; height: 22px; color: var(--muted); flex-shrink: 0; }
.type-option.selected .type-icon { color: var(--straw); }
.type-text { display: flex; flex-direction: column; gap: 2px; }
.type-label { font-weight: 650; color: var(--strong); }
.type-hint { font-size: 12.5px; color: var(--muted); }
