:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #e8e9ed;
  background: #111214;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; height: 100%; }

body {
  background: #111214;
  overflow: hidden;
}

button, input { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.app {
  height: 100vh;
  display: flex;
  background: #111214;
}

/* Sidebar */

.sidebar {
  width: 228px;
  flex: 0 0 228px;
  background: #18191c;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #101113;
}

.sidebar-top {
  height: 54px;
  padding: 0 13px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #242529;
}

.wordmark {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #f0f1f3;
}

.icon-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #9699a1;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.icon-button:hover { background: #2a2c30; color: #e5e6e9; }

.room-label {
  padding: 21px 12px 7px 18px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #777a82;
}

.room {
  margin: 0 8px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: #9699a1;
  cursor: pointer;
  text-align: left;
}

.room:hover { background: #222428; color: #d5d7db; }

.room.active {
  background: #303236;
  color: #f0f1f3;
}

.room-hash {
  font-size: 20px;
  line-height: 0;
  color: #7d8088;
}

.sidebar-spacer { flex: 1; }

.user-bar {
  margin: 8px;
  padding: 7px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e8e9ed;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
}

.user-bar:hover { background: #25272b; }

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

.user-copy strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  font-size: 10px;
  color: #777b84;
}

.user-menu {
  color: #777b84;
  letter-spacing: 2px;
  font-size: 11px;
}

.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
  background: #303238;
  flex: 0 0 auto;
}

/* Main */

.main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #111214;
}

.channel-header {
  height: 54px;
  flex: 0 0 54px;
  padding: 0 16px;
  border-bottom: 1px solid #242529;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.channel-title .hash {
  font-size: 23px;
  color: #777a82;
}

.channel-title strong {
  font-size: 14px;
  color: #e9eaed;
}

.channel-title .divider {
  height: 18px;
  width: 1px;
  background: #34363b;
  margin: 0 5px;
}

.channel-title .topic {
  font-size: 12px;
  color: #777b83;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #cfd1d6;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 5px;
}

.header-user:hover { background: #24262a; }

.header-user span { font-size: 12px; }

/* Chat */

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: #292b30 transparent;
}

.chat-intro {
  margin: 16px 0 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid #242529;
}

.intro-hash {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25272c;
  display: grid;
  place-items: center;
  color: #9a9da5;
  font-size: 30px;
  margin-bottom: 12px;
}

.chat-intro h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #eceef1;
}

.chat-intro p {
  margin: 0;
  color: #777b84;
  font-size: 13px;
}

.message-row {
  display: flex;
  gap: 11px;
  padding: 3px 8px;
  margin: 0 -8px;
  border-radius: 4px;
}

.message-row:hover { background: #16181b; }

.message-avatar {
  width: 36px;
  height: 36px;
  margin-top: 1px;
}

.message-content { min-width: 0; }

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 18px;
}

.message-name {
  font-size: 13px;
  font-weight: 650;
  color: #e5e7ea;
}

.message-time {
  font-size: 10px;
  color: #696d76;
}

.message-body {
  color: #c7c9ce;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Composer */

.composer-wrap {
  padding: 0 18px 18px;
}

.composer {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  background: #1e2024;
  border-radius: 7px;
}

.composer-plus {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 0;
  border-radius: 50%;
  background: #34373d;
  color: #c6c8cd;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.composer-plus:hover { background: #41444b; color: white; }

.composer input {
  min-width: 0;
  flex: 1;
  height: 35px;
  padding: 0 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e7e8eb;
  font-size: 13px;
}

.composer input::placeholder { color: #70747d; }

.send-button {
  border: 0;
  border-radius: 5px;
  background: #303238;
  color: #aeb1b8;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.send-button:hover { background: #3b3e45; color: #e9eaed; }

/* Profile */

.profile-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.68);
  padding: 20px;
}

.hidden { display: none; }

.profile-card {
  width: min(100%, 390px);
  background: #1e2024;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}

.profile-banner {
  height: 94px;
  background: #30343b;
}

.profile-content { padding: 0 20px 20px; }

.profile-photo-wrap {
  width: 86px;
  height: 86px;
  margin-top: -43px;
  position: relative;
  margin-bottom: 12px;
}

.profile-photo {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #1e2024;
  background: #303238;
}

.photo-edit {
  position: absolute;
  right: -1px;
  bottom: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid #1e2024;
  background: #4b4f57;
  color: #f1f2f4;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
}

.profile-name-large {
  font-size: 17px;
  font-weight: 700;
  color: #f0f1f3;
  margin-bottom: 18px;
}

.profile-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  color: #8c9098;
  margin-bottom: 7px;
}

.profile-input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid #101114;
  background: #111214;
  color: #e8e9ed;
  outline: 0;
  font-size: 13px;
}

.profile-input:focus { border-color: #5865f2; }

.profile-note {
  color: #858991;
  font-size: 11px;
  line-height: 1.45;
  margin: 9px 0 17px;
}

.profile-save {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: #5865f2;
  color: white;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.profile-save:hover { background: #6875f4; }

.profile-status {
  min-height: 15px;
  margin-top: 8px;
  font-size: 11px;
  color: #8e929b;
}

.close-button {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.25);
  color: #dddfe3;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile */

@media (max-width: 650px) {
  .sidebar { width: 60px; flex-basis: 60px; }
  .wordmark { font-size: 11px; letter-spacing: .06em; }
  .sidebar-top { padding: 0; justify-content: center; }
  .sidebar-top .icon-button,
  .room-label,
  .room span:not(.room-hash),
  .user-copy,
  .user-menu { display: none; }
  .room { margin: 5px; justify-content: center; padding: 0; }
  .room-hash { font-size: 22px; }
  .user-bar { justify-content: center; margin: 6px 4px; padding: 6px 0; }
  .channel-title .topic,
  .channel-title .divider { display: none; }
  .header-user span { display: none; }
  .chat { padding-left: 12px; padding-right: 12px; }
  .composer-wrap { padding: 0 10px 10px; }
}

@media (max-width: 420px) {
  .sidebar { display: none; }
  .channel-header { padding: 0 12px; }
  .chat-intro h1 { font-size: 19px; }
}
