
* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #090811;
  --panel: #13121e;
  --line: rgba(255,255,255,.09);
  --text: #f7f5ff;
  --muted: #9995ad;
  --purple: #a78bfa;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, #38206b55, transparent 40%),
    radial-gradient(ellipse at 90% 100%, #39206b44, transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
}

.brand-mark, .avatar {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  margin-right: 9px;
  background: linear-gradient(135deg, #b69cff, #7042dc);
  color: white;
  font-weight: 800;
}

.muted, .hint {
  color: var(--muted);
}

.shell {
  width: min(1100px, 94%);
  margin: 40px auto;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 60px;
  align-items: center;
  min-height: 65vh;
}

.intro h1 {
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -3px;
  max-width: 550px;
}

.intro h1 span {
  color: var(--purple);
}

.intro p, .heading p, .dm-start p {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #171525;
  box-shadow: 0 25px 80px #0005;
}

.tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 10px;
  background: #0b0a13;
  margin-bottom: 25px;
}

.tab, .ghost, .nav {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 11px;
  border-radius: 8px;
}

.tab {
  flex: 1;
}

.tab.active, .nav.active {
  background: #8b5cf626;
  color: #d9ccff;
}

label {
  display: block;
  margin: 16px 0 8px;
  font-size: 12px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: #0c0b14;
  color: white;
  outline: none;
}

input:focus {
  border-color: var(--purple);
}

.primary {
  border: 0;
  border-radius: 10px;
  padding: 13px 17px;
  background: linear-gradient(110deg, #a78bfa, #8058ed);
  color: white;
  font-weight: 700;
}

.full {
  width: 100%;
}

.error {
  color: #fda4af;
  font-size: 12px;
  min-height: 18px;
}

.auth-card .hint {
  font-size: 11px;
  line-height: 1.5;
}

.app-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  height: min(760px, calc(100vh - 130px));
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #11101b;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 13px;
  border-right: 1px solid var(--line);
  background: #141320;
  min-height: 0;
}

.side-label {
  color: #777287;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin: 12px 8px;
}

.nav {
  text-align: left;
  font-size: 13px;
  margin-bottom: 4px;
}

.conversation-list {
  overflow: auto;
}

.conversation {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #ddd8eb;
  text-align: left;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
}

.conversation:hover {
  background: #ffffff0c;
}

.conversation small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.sidebar-user .avatar {
  flex-shrink: 0;
  margin: 0;
}

.sidebar-user strong {
  flex: 1;
}

.chat-panel, .chat-view {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.heading {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.heading h2 {
  margin: 7px 0 4px;
  font-size: 21px;
}

.heading p {
  margin: 0;
  font-size: 12px;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.message {
  display: flex;
  gap: 11px;
  margin-bottom: 18px;
  font-size: 13px;
}

.message .avatar {
  flex-shrink: 0;
  margin: 0;
}

.meta {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 5px;
}

.meta time {
  color: var(--muted);
  font-size: 10px;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  color: #d4d0e0;
}

.composer {
  display: flex;
  gap: 8px;
  margin: 0 17px 17px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0a13;
}

.composer input {
  border: 0;
  background: transparent;
}

.send {
  width: 40px;
  border: 0;
  border-radius: 9px;
  background: #8b5cf6;
  color: white;
  font-size: 20px;
}

.dm-start {
  margin: auto;
  padding: 25px;
  text-align: center;
  max-width: 430px;
}

.dm-start h3 {
  font-size: 21px;
}

.dm-start p {
  font-size: 12px;
}

#dm-start-form {
  display: flex;
  gap: 8px;
}

#dm-start-form input {
  min-width: 0;
}

.thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #27213a;
  border: 1px solid #a78bfa55;
  border-radius: 10px;
  padding: 12px 17px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  font-size: 12px;
}

.toast.show {
  opacity: 1;
}

@media(max-width:750px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .auth-card {
    width: 100%;
  }

  .app-layout {
    grid-template-columns: 60px 1fr;
  }

  .sidebar {
    padding: 12px 5px;
  }

  .side-label, .conversation-list, .sidebar-user strong {
    display: none;
  }

  .nav {
    font-size: 0;
    text-align: center;
  }

  .sidebar-user {
    justify-content: center;
  }

  .sidebar-user .avatar {
    margin: 0;
  }

  .heading {
    padding: 17px;
  }

  .messages {
    padding: 15px;
  }
}
