:root {
  color-scheme: dark;
  --bg: #111214;
  --server: #0f1014;
  --rail: #1e1f22;
  --rail-2: #24262b;
  --main: #313338;
  --main-2: #2b2d31;
  --elevated: #383a40;
  --hover: #3f424a;
  --border: #23252b;
  --soft-border: #3a3d45;
  --muted: #b5bac1;
  --quiet: #8b929e;
  --text: #f2f3f5;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #23a559;
  --danger: #da373c;
  --danger-soft: rgba(218, 55, 60, 0.18);
  --shadow: rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
.shell {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 72px 300px minmax(520px, 1fr) 430px;
  min-width: 1120px;
  background: var(--main);
}

.serverRail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  background: var(--server);
  border-right: 1px solid #17181d;
}

.serverIcon {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  background: var(--rail-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  transition: border-radius 140ms ease, background 140ms ease, transform 140ms ease;
}

.serverIcon.isActive,
.serverIcon:hover {
  border-radius: 14px;
  background: var(--accent);
}

.serverIcon:hover {
  transform: translateY(-1px);
}

.channelRail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--rail);
  border-right: 1px solid var(--border);
}

.workspaceHeader,
.chatHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.workspaceName,
.channelTitle {
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspaceMeta,
.channelSubtitle,
.messageMeta,
.emptyCallText {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 400;
}

.searchBox {
  padding: 14px;
}

.searchBox input,
.loginBox input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--soft-border);
  border-radius: 7px;
  background: #15171d;
  color: var(--text);
  outline: none;
}

.searchBox input:focus,
.loginBox input:focus,
.composer textarea:focus {
  border-color: rgba(88, 101, 242, 0.75);
}

.searchBox input {
  height: 38px;
  padding: 0 12px;
  color: var(--muted);
}

.navSection {
  padding: 4px 10px 10px;
}

.sectionTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.channelList {
  display: grid;
  gap: 3px;
}

.channelItem,
.memberItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}

.channelItem:hover,
.memberItem:hover {
  background: var(--hover);
  color: var(--text);
}

.channelItem.isActive {
  background: var(--elevated);
  color: var(--text);
}

.channelIcon {
  display: grid;
  place-items: center;
  width: 22px;
  color: var(--quiet);
  font-size: 18px;
  font-weight: 700;
}

.voiceUsers {
  display: grid;
  gap: 4px;
  margin: 0 0 8px 47px;
  color: var(--muted);
  font-size: 13px;
}

.voiceDock,
.userDock {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 12px 12px;
  padding: 12px;
  border-radius: 7px;
  background: var(--rail-2);
}

.voiceDock {
  justify-content: space-between;
  margin-top: auto;
  border: 1px solid rgba(35, 165, 89, 0.35);
  box-shadow: 0 12px 28px var(--shadow);
}

.voiceState {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.voiceRoomName {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dockActions,
.headerActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconButton,
.tinyButton {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  background: var(--elevated);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.wideIcon {
  min-width: 56px;
  padding: 0 10px;
}

.tinyButton {
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.iconButton:hover,
.tinyButton:hover,
.secondaryButton:hover,
.ghostButton:hover {
  background: var(--hover);
}

.danger {
  background: var(--danger-soft);
  color: #ffb0b3;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--elevated);
  color: var(--text);
  font-weight: 700;
}

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

.userDockText {
  min-width: 0;
}

.userDockText > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contentPane {
  min-width: 0;
  background: var(--main);
}

.loginPanel {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 32px;
}

.loginBox {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: var(--main-2);
  box-shadow: 0 22px 60px var(--shadow);
}

.brandMark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent);
  font-weight: 800;
}

.loginBox h1 {
  margin: 18px 0 8px;
  font-size: 26px;
  font-weight: 750;
  line-height: 1.2;
}

.loginBox p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.loginBox form,
.loginBox label {
  display: grid;
  gap: 10px;
}

.loginBox form {
  gap: 14px;
}

.loginBox label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.loginBox input {
  height: 42px;
  padding: 0 12px;
}

.primaryButton,
.secondaryButton,
.ghostButton {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.primaryButton {
  background: var(--accent);
}

.primaryButton:hover {
  background: var(--accent-hover);
}

.secondaryButton,
.ghostButton {
  background: var(--elevated);
}

.ghostButton {
  color: var(--muted);
}

.formError {
  min-height: 18px;
  color: #ffb0b3;
  font-size: 13px;
}

.chatPane {
  display: grid;
  grid-template-rows: 64px 1fr auto;
  height: 100%;
}

.messageScroller {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 22px 24px;
}

.message {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 7px;
}

.message:hover {
  background: rgba(255, 255, 255, 0.035);
}

.messageAuthor {
  font-weight: 700;
}

.messageBody {
  margin-top: 3px;
  color: #f0f1f4;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.messageBody a {
  color: #8ea1ff;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
}

.composer textarea {
  min-height: 46px;
  max-height: 160px;
  resize: none;
  padding: 12px 14px;
  background: #383a40;
}

.callPane {
  display: grid;
  grid-template-rows: 320px 1fr;
  min-width: 0;
  border-left: 1px solid var(--border);
  background: var(--rail);
}

.callStage {
  position: relative;
  min-height: 0;
  border-bottom: 1px solid var(--border);
  background: #0b0c10;
}

.emptyCall {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  padding: 28px;
  text-align: center;
}

.emptyCallTitle {
  font-size: 22px;
  font-weight: 750;
}

.jitsiContainer {
  position: absolute;
  inset: 0;
  background: #0b0c10;
}

.jitsiContainer iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
}

.memberPanel {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background: var(--rail);
}

.memberItem {
  justify-content: space-between;
}

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

.memberName {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callButton {
  min-width: 58px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: rgba(88, 101, 242, 0.18);
  color: #c4ccff;
  font-size: 13px;
  font-weight: 700;
}

.callButton:hover {
  background: rgba(88, 101, 242, 0.32);
}

@media (max-width: 1280px) {
  .shell {
    grid-template-columns: 64px 270px minmax(430px, 1fr) 390px;
    min-width: 1040px;
  }

  .callPane {
    grid-template-rows: 300px 1fr;
  }
}
