.friends-shell {
  min-height: calc(100vh - var(--topbar-height));
}

.friends-layout {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  gap: 28px;
  min-height: calc(100vh - var(--topbar-height) - 72px);
}

.friends-panel,
.chat-panel {
  border: 1px solid #9eb0c8;
  background: var(--bg);
  --cut: 20px;
}

.friends-panel {
  display: flex;
  flex-direction: column;
  min-height: 680px;
  padding: 18px;
}

.friend-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  min-height: 48px;
}

.friend-add input,
.message-composer input {
  width: 100%;
  min-width: 0;
  border: 1px solid #9eb0c8;
  background: #dedede;
  color: var(--ink);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 950;
}

.friend-add button,
.message-composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-dark);
  background: #e8e8e8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.friend-add button .ui-icon {
  width: 18px;
  height: 18px;
}

.friend-tabs {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin: 26px 0 18px;
}

.friend-tabs button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.friend-tabs span {
  color: #747c87;
}

.friend-tabs .active {
  text-decoration: underline;
  text-underline-offset: 9px;
  text-decoration-thickness: 2px;
}

.friend-row {
  position: relative;
  display: grid;
  grid-template-columns: 5px 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
}

.friend-selected {
  width: 5px;
  height: 50px;
  background: var(--ink);
}

.friend-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #d3a526;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.friend-avatar > span {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: #20242b;
}

.friend-summary {
  min-width: 0;
}

.friend-summary h2,
.chat-header h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 950;
  text-transform: uppercase;
}

.friend-summary p {
  margin: 5px 0 0;
  color: #4a515c;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.friend-row time {
  align-self: start;
  margin-top: 10px;
  color: #5d6672;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.chat-panel {
  display: grid;
  grid-template-rows: 74px minmax(430px, 1fr) 78px;
  min-height: 680px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #10131a;
  color: #fff;
  padding: 0 24px;
}

.chat-header p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0 0;
  color: #a8b2c2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-header p span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d3a526;
}

.chat-messages {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 28px;
}

.sent-message {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.sent-message p {
  margin: 0;
  border: 1px solid var(--line-dark);
  background: var(--blue);
  color: #fff;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 950;
  text-transform: lowercase;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.sent-message time {
  color: #4f5966;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 14px;
  align-items: center;
  border-top: 1px solid #9eb0c8;
  padding: 12px 16px;
}

.message-composer input {
  height: 48px;
}

.message-composer button {
  height: 48px;
}

@media (max-width: 1120px) {
  .friends-layout {
    grid-template-columns: 1fr;
  }

  .friends-panel,
  .chat-panel {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .friends-layout {
    gap: 18px;
  }

  .friends-panel {
    padding: 14px;
  }

  .friend-add {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .friend-tabs {
    gap: 16px;
  }

  .chat-panel {
    grid-template-rows: 68px minmax(360px, 1fr) auto;
  }

  .chat-messages {
    padding: 20px;
  }

  .message-composer {
    grid-template-columns: 1fr 48px;
    gap: 10px;
    padding: 10px;
  }
}

.friend-add input::placeholder,
.message-composer input::placeholder {
  color: #6f7886;
}

.chat-header {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
