* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  color: #262626;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #dbdbdb;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { font-size: 18px; font-weight: 600; }
.brand small { color: #8e8e8e; font-size: 12px; }
.session { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.session label { color: #8e8e8e; }
.session input {
  padding: 6px 10px;
  border: 1px solid #dbdbdb;
  border-radius: 8px;
  font-size: 13px;
  width: 140px;
}
.session button {
  padding: 6px 12px;
  background: #fafafa;
  border: 1px solid #dbdbdb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.session button:hover { background: #f0f0f0; }

.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #dbdbdb;
  padding: 0 22px;
}
.tab {
  flex: 0 0 auto;
  padding: 14px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  cursor: pointer;
  color: #8e8e8e;
  font-weight: 500;
}
.tab.active {
  color: #262626;
  border-bottom-color: #262626;
}

main {
  flex: 1;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.view { display: none; width: 100%; max-width: 540px; }
.view.active { display: block; }

/* Chat (DM) */
.chat {
  background: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 240px);
  min-height: 480px;
}
.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid #efefef;
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.avatar.helena { background: linear-gradient(135deg, #833ab4, #fd1d1d); }
.avatar.hazzin { background: #262626; font-size: 12px; }
.avatar.user { background: #0095f6; font-size: 13px; }
.chat-header strong { display: block; font-size: 14px; }
.chat-header .status { color: #8e8e8e; font-size: 12px; }

.messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 22px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg.user {
  background: #0095f6;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.msg.helena {
  background: #efefef;
  color: #262626;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.msg.system {
  align-self: center;
  background: #fff8e1;
  color: #a67c00;
  font-size: 12px;
  border-radius: 12px;
  padding: 6px 12px;
}
.msg-meta {
  font-size: 10px;
  color: #8e8e8e;
  margin-top: 2px;
  padding: 0 6px;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #efefef;
}
.composer input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #dbdbdb;
  border-radius: 22px;
  font-size: 14px;
  outline: none;
}
.composer input:focus { border-color: #0095f6; }
.composer button {
  padding: 10px 18px;
  background: #0095f6;
  color: #fff;
  border: none;
  border-radius: 22px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.composer button:hover { background: #0081d6; }
.composer button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Post (comments) */
.post {
  background: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 16px;
  overflow: hidden;
}
.post-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #efefef;
}
.post-image {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #a8c5e0 0%, #d4b9db 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.post-actions {
  padding: 12px 16px 8px;
  font-size: 22px;
  letter-spacing: 8px;
}
.post-caption {
  padding: 0 16px 12px;
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px solid #efefef;
}
.comments {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}
.comment {
  font-size: 14px;
  line-height: 1.4;
}
.comment strong { margin-right: 6px; }
.comment.helena strong { color: #833ab4; }

.statusbar {
  background: #fff;
  border-top: 1px solid #dbdbdb;
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8e8e8e;
}
.pill {
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #efefef;
  border-radius: 22px;
  align-self: flex-start;
  width: fit-content;
}
.typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #8e8e8e;
  animation: bounce 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-6px); opacity: 1; }
}
