:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #26344a;
  background: #eef2f7;
  font-size: 14px;
  --accent: #5967d8;
  --border: #e7ebf2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  font-weight: 600;
  transition: background 0.15s;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px #5967d815;
}
.topbar {
  height: 70px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
  color: #26344a;
}
.brand-icon {
  color: var(--accent);
}
.badge {
  font-size: 10px;
  background: #eef0ff;
  color: var(--accent);
  letter-spacing: 1.3px;
  border-radius: 5px;
  padding: 6px 9px;
  margin-left: 16px;
}
.topbar #connection {
  font-size: 12px;
  color: #6b7891;
}
main {
  height: calc(100dvh - 70px);
  display: grid;
  grid-template-columns: 330px 1fr;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  max-width: 1600px;
  margin: auto;
}
aside {
  background: white;
  border-right: 1px solid var(--border);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.sidebar-heading h1 {
  font-size: 19px;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.sidebar-heading p {
  font-size: 12px;
  color: #8790a1;
  margin: 0 0 28px;
}
aside > label,
#new-conversation label {
  font-size: 11px;
  font-weight: 650;
  color: #748099;
  display: block;
  margin-bottom: 8px;
}
select,
input:not([type="checkbox"]):not([type="file"]) {
  width: 100%;
  border: 1px solid #dfe5ef;
  background: #fff;
  border-radius: 8px;
  padding: 11px 12px;
  color: #344157;
}
select {
  font-size: 12px;
}
.hint {
  color: #8790a1;
  font-size: 11px;
  line-height: 1.6;
}
.primary {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: white;
}
.primary:hover,
.send:hover {
  background: #4655c4;
}
#new-conversation {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 8px;
}
#new-conversation input {
  margin-bottom: 10px;
}
.list-heading {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8a94a7;
  padding: 25px 0 12px;
}
.list-heading span {
  background: #f1f3f8;
  border-radius: 4px;
  padding: 1px 6px;
}
#conversations {
  flex: 1;
  min-height: 80px;
}
.conversation {
  display: flex;
  gap: 11px;
  padding: 13px 10px;
  border-radius: 10px;
  width: 100%;
  background: transparent;
  text-align: left;
  margin-bottom: 5px;
  color: #344157;
}
.conversation.selected {
  background: #eff1ff;
}
.conversation:hover {
  background: #f4f6fb;
}
.avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  background: #e9edff;
  color: var(--accent);
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}
.conversation-details {
  overflow: hidden;
  flex: 1;
}
.conversation strong {
  display: block;
  font-size: 12px;
  margin: 1px 0 5px;
}
.conversation small {
  font-size: 11px;
  color: #929aab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.sidebar-footer {
  font-size: 11px;
  color: #748099;
  border-top: 1px solid var(--border);
  padding-top: 17px;
  margin-top: 20px;
  line-height: 1.9;
}
.sidebar-footer small {
  font-size: 10px;
  color: #9aa3b3;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55bca7;
  margin-right: 4px;
}
.chat {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f7f8fc;
}
#empty {
  margin: auto;
  text-align: center;
  padding: 40px;
  color: #8790a1;
}
.empty-icon {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: #e9edff;
  color: var(--accent);
  font-size: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
}
#empty h2 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.6px;
  color: #344157;
}
#empty p {
  font-size: 13px;
  line-height: 1.8;
}
.empty-features {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 27px;
}
.empty-features span {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 10px;
}
#conversation-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.chat-header {
  height: 82px;
  padding: 16px 30px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: white;
  border-bottom: 1px solid var(--border);
}
.chat-person {
  flex: 1;
}
.chat-person h2 {
  font-size: 15px;
  margin: 0 0 5px;
}
.chat-person p {
  font-size: 11px;
  margin: 0;
  color: #929aab;
}
.receipt-toggle {
  font-size: 11px;
  color: #748099;
  display: flex;
  align-items: center;
  gap: 6px;
}
.receipt-toggle input {
  accent-color: var(--accent);
}
.simulation-banner {
  font-size: 11px;
  text-align: center;
  color: #929aab;
  padding: 13px 15px;
  border-bottom: 1px solid #edf0f5;
}
#messages {
  overflow-y: auto;
  padding: 22px 35px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.message {
  max-width: min(75%, 650px);
  align-self: flex-end;
  min-width: 160px;
  flex-shrink: 0;
}
.message.outbound {
  align-self: flex-start;
}
.message-author {
  font-size: 10px;
  color: #99a2b3;
  margin: 0 5px 5px;
}
.bubble {
  padding: 12px 15px;
  background: #e9edff;
  border-radius: 13px 13px 3px 13px;
  line-height: 1.6;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.outbound .bubble {
  background: white;
  border: 1px solid var(--border);
  border-radius: 13px 13px 13px 3px;
}
.message-body {
  white-space: pre-wrap;
}
.quoted {
  border-left: 3px solid #a5afe7;
  background: #ffffff65;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: #748099;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.message img,
.message video {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  margin: 6px 0;
}
.message audio {
  max-width: 100%;
  width: 290px;
  height: 38px;
}
.file-link {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin: 6px 0;
}
.message-meta {
  font-size: 10px;
  color: #929aab;
  margin-top: 6px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.message-actions {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.message-actions button {
  font-size: 10px;
  color: #929aab;
  background: transparent;
  padding: 3px 5px;
}
.message-actions button:hover {
  background: #e9edff;
  color: var(--accent);
}
.reactions {
  font-size: 12px;
  display: flex;
  gap: 5px;
  margin-top: 5px;
}
.reactions span {
  padding: 1px 6px;
  background: white;
  border: 1px solid #e1e5ef;
  border-radius: 10px;
}
#composer {
  padding: 17px 28px 12px;
  background: white;
  border-top: 1px solid var(--border);
}
.compose-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
textarea {
  flex: 1;
  resize: none;
  border: 1px solid #e4e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #fafbfe;
  min-height: 44px;
  max-height: 140px;
  line-height: 1.5;
}
.attach {
  color: #8790a1;
  font-size: 23px;
  padding: 7px 3px;
  cursor: pointer;
}
.send {
  background: var(--accent);
  color: white;
  padding: 13px 18px;
  font-size: 12px;
  white-space: nowrap;
}
.compose-hint {
  font-size: 10px;
  color: #a1a9b7;
  text-align: center;
  margin: 10px 0 0;
}
#quote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #748099;
  border-left: 3px solid var(--accent);
  padding: 7px 10px;
  background: #f5f6fc;
  margin-bottom: 10px;
}
#quote button {
  background: transparent;
  color: #929aab;
}
#file-label {
  font-size: 11px;
  color: var(--accent);
  padding-top: 7px;
}
#event-alerts {
  font-size: 11px;
  color: #b77a29;
  background: #fff7e9;
  padding: 0 28px;
  max-height: 100px;
  overflow: auto;
}
#event-alerts p {
  display: flex;
  gap: 10px;
  align-items: center;
}
#event-alerts button {
  padding: 5px 8px;
  background: #f9e9cd;
  color: #94601d;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #344157;
  color: white;
  box-shadow: 0 6px 24px #26344a22;
  padding: 12px 20px;
  border-radius: 10px;
  max-width: 90%;
  font-size: 12px;
  z-index: 10;
}
@media (max-width: 850px) {
  main {
    grid-template-columns: 260px 1fr;
  }
  aside {
    padding: 20px 16px;
  }
  .chat-header {
    padding: 15px;
  }
  .receipt-toggle {
    max-width: 125px;
  }
  #messages {
    padding: 18px 15px;
  }
  .message {
    max-width: 90%;
  }
  #composer {
    padding: 15px;
  }
  .empty-features {
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 0 16px;
    height: 60px;
  }
  .badge {
    margin-left: 8px;
  }
  main {
    height: auto;
    min-height: calc(100dvh - 60px);
    display: flex;
    flex-direction: column;
  }
  aside {
    border-right: 0;
    padding: 16px;
  }
  .sidebar-heading p,
  .sidebar-footer {
    display: none;
  }
  .sidebar-heading h1 {
    margin-bottom: 15px;
  }
  #new-conversation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #new-conversation label {
    grid-column: 1/-1;
  }
  #new-conversation button {
    grid-column: 1/-1;
  }
  #new-conversation input {
    margin: 0;
  }
  #conversations {
    display: flex;
    overflow: auto;
    min-height: 0;
  }
  .conversation {
    min-width: 180px;
    width: auto;
  }
  .chat {
    min-height: 65dvh;
  }
  #conversation-panel {
    height: 65dvh;
  }
  .chat-header {
    height: 72px;
  }
  .empty-features {
    display: none;
  }
  .message {
    max-width: 92%;
  }
}
