:root {
  color-scheme: dark;
  font:
    14px Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
  background: #080b13;
  color: #edf1ff;
  --panel: #101522;
  --panel2: #151c2d;
  --line: #252e43;
  --muted: #8d98b5;
  --accent: #7181ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.1);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid #aab4ff;
  outline-offset: 2px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button.icon,
.secondary {
  background: transparent;
  color: var(--muted);
}
#shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 72px 250px minmax(300px, 1fr);
  background: #0b0f19;
}
.servers {
  background: #080b13;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  overflow: auto;
}
#server-list {
  display: contents;
}
.brand,
.server {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #192138;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: white;
  font-size: 20px;
  padding: 0;
  transition: 0.15s;
}
.brand {
  background: var(--accent);
  font-size: 25px;
}
.server:hover,
.server.selected {
  border-radius: 12px;
  background: var(--accent);
}
.server.add {
  color: #75dba8;
  background: #15251f;
}
.sidebar {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar header,
.top,
.members header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.sidebar header {
  justify-content: space-between;
}
.nav-list {
  padding: 10px;
  overflow: auto;
  flex: 1;
}
.nav-item,
.channel-label {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin: 2px 0;
  border-radius: 7px;
  color: var(--muted);
  background: none;
  text-align: left;
  font-weight: 550;
}
.nav-item:hover,
.nav-item.selected {
  background: #20283a;
  color: white;
}
.nav-item {
  min-height: 38px;
}
.channel-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-top: 12px;
}
.sidebar footer {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: #0c111c;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #5465d7;
  font-weight: 800;
}
.sidebar footer #profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.connection {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e3a94b;
}
.connection.online { background: #55d895; }
.connection.offline { background: #ef6674; }
main {
  display: grid;
  grid-template-rows: 60px 1fr auto;
  min-width: 0;
}
.top {
  justify-content: space-between;
  background: #111623;
}
.top span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.empty {
  place-self: center;
  text-align: center;
  color: var(--muted);
}
.empty .mark {
  margin: auto;
}
.empty h2 {
  color: white;
}
.messages {
  overflow-y: auto;
  padding: 20px max(20px, 5vw);
}
.messages:focus-visible { outline: none; }
.message {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  padding: 9px 0;
}
.message:hover { background: #ffffff05; }
.message .avatar {
  grid-row: 1/3;
  width: 38px;
  height: 38px;
}
.meta {
  font-weight: 700;
}
.meta time {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
  margin-left: 7px;
}
.content {
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.content a {
  color: #8ea3ff;
}
.attachment {
  display: block;
  max-width: min(520px, 100%);
  max-height: 420px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.attachment { cursor: zoom-in; }
.file-link {
  display: inline-block;
  margin-top: 8px;
  color: #a9b6ff;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 max(16px, 4vw) 20px;
  background: #1b2335;
  border: 1px solid #29344d;
  border-radius: 12px;
  padding: 7px;
}
.composer textarea {
  resize: none;
  max-height: 160px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  padding: 9px;
}
.file-preview {
  display: flex;
  max-width: min(45vw, 420px);
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}
.file-preview-item {
  display: grid;
  grid-template-columns: auto minmax(48px, 100px) auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px;
  color: var(--muted);
  background: #111827;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
}
.file-preview-item img {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
}
.file-preview-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-preview-item button {
  min-width: 24px;
  padding: 2px;
  color: var(--muted);
  background: transparent;
}
.character-count {
  align-self: center;
  min-width: 30px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.character-count.near-limit { color: #f0b75c; }
.attach {
  font-size: 22px;
  color: var(--muted);
  padding: 6px;
  cursor: pointer;
}
.members {
  width: 220px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow: auto;
}
.member {
  padding: 9px 14px;
  color: #cbd2e7;
}
.member small {
  display: block;
  color: var(--muted);
}
body.members-open #shell {
  grid-template-columns: 72px 250px minmax(300px, 1fr) 220px;
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #192959, #080b13 60%);
  z-index: 5;
}
.card {
  width: min(430px, calc(100% - 32px));
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 28px;
}
.card p {
  color: var(--muted);
  line-height: 1.55;
}
.card label,
#dialog label {
  display: grid;
  gap: 7px;
  color: #b5bfd8;
  margin: 18px 0;
}
.card input,
#dialog input,
#dialog select {
  background: #080c15;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
  padding: 11px;
}
.card button {
  width: 100%;
}
dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  color: white;
  padding: 24px;
}
dialog::backdrop {
  background: #000a;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #202942;
  padding: 12px 16px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 20;
  max-width: min(420px, calc(100% - 40px));
  box-shadow: 0 8px 30px #0008;
}
#toast.show {
  opacity: 1;
}
#unsupported {
  padding: 20px;
  background: #5b2730;
  color: white;
}
.unread {
  margin-left: auto;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 10px;
  color: white;
  font-size: 11px;
}
.voice-panel {
  place-self: center;
  width: min(560px, calc(100% - 32px));
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.voice-panel h2 {
  margin-top: 0;
}
.voice-actions,
.soundboard {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.voice-person {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.voice-note {
  color: var(--muted);
  line-height: 1.5;
}
.member {
  cursor: pointer;
  border-radius: 8px;
}
.member:hover {
  background: var(--panel2);
}
.member button {
  float: right;
  padding: 6px 9px;
}
.composer.busy {
  opacity: 0.65;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 760px) {
  #shell {
    grid-template-columns: 60px 210px minmax(280px, 1fr);
  }
  .servers {
    padding-inline: 6px;
  }
  .brand,
  .server {
    width: 44px;
    height: 44px;
  }
  body.members-open #shell {
    grid-template-columns: 60px 210px minmax(280px, 1fr);
  }
  .members {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    z-index: 4;
    box-shadow: -12px 0 30px #0008;
  }
}
@media (max-width: 560px) {
  #shell {
    grid-template-columns: 56px 1fr;
  }
  .sidebar {
    display: flex;
  }
  main {
    display: none;
  }
  body.chat-open #shell {
    grid-template-columns: 1fr;
  }
  body.chat-open .servers,
  body.chat-open .sidebar {
    display: none;
  }
  body.chat-open main {
    display: grid;
  }
  .top:before {
    content: "‹";
    font-size: 28px;
    cursor: pointer;
    margin-right: 8px;
  }
  .top > div {
    flex: 1;
  }
  .messages { padding: 14px; }
  .composer { margin: 0 10px 10px; }
  .character-count { display: none; }
  .file-name { max-width: 90px; }
}
