* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(circle at top, rgba(165, 60, 255, 0.22), rgba(10, 10, 18, 1));
  color: #eaeefc;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(10, 10, 18, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.3px;
}
.brand img {
  width: 38px;
  height: 38px;
}

.search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}

.btn {
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #a53cff, #2ee9ff);
  color: #061018;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 35px rgba(46,233,255,0.12);
}
.btn.small { padding: 8px 10px; border-radius: 12px; font-size: 14px; }
.btn.ghost {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: none;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 14px;
  height: calc(100vh - 90px);
  position: sticky;
  top: 78px;
  overflow: auto;
}

.sidebar-title {
  font-weight: 900;
  margin-bottom: 10px;
  opacity: 0.9;
}

.contact {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.contact:hover { transform: translateY(-1px); transition: 0.2s; }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(255,255,255,0.08);
}

.avatar.big { width: 54px; height: 54px; border-radius: 18px; }

.meta .name { font-weight: 800; }
.status { font-size: 13px; opacity: 0.85; }
.status.online { color: #7CFFB2; }
.status.away { color: #ffd37a; }

.sidebar-note {
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.85;
}

.feed { display: flex; flex-direction: column; gap: 18px; }

.hero {
  padding: 22px;
  border-radius: 22px;
  background: radial-gradient(circle at top left, rgba(165, 60, 255, 0.30), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
}
.hero h1 { margin: 0 0 8px; font-size: 34px; }
.hero h1 span { color: #2ee9ff; }
.hero p { margin: 0 0 14px; opacity: 0.9; line-height: 1.5; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; opacity: 0.85; }

.post {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.post-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.time { font-size: 13px; opacity: 0.7; }
.post-body { line-height: 1.5; opacity: 0.92; }
.post-actions { display: flex; gap: 10px; margin-top: 12px; }

.page { padding: 18px; }
.telegram-box {
  margin-top: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

/* CHAT DOCK */
.chat-dock {
  position: fixed;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  z-index: 999;
}

/* CHAT WINDOW */
.chat-window {
  width: 320px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(12, 12, 22, 0.98);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  animation: popIn .22s ease-out;
}
@keyframes popIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0px); opacity: 1; }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-title { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 10px; height: 10px; border-radius: 99px;
  background: #2ee9ff;
  box-shadow: 0 0 14px rgba(46,233,255,0.7);
}

.chat-actions { display: flex; gap: 6px; }
.chat-btn {
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-weight: 900;
}
.chat-btn.danger { background: rgba(255, 90, 90, 0.20); }

.chat-body {
  height: 240px;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; }
.msg.other { justify-content: flex-start; }
.msg.me { justify-content: flex-end; }

.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.35;
  font-size: 14px;
}
.msg.other .bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
}
.msg.me .bubble {
  background: linear-gradient(135deg, #a53cff, #2ee9ff);
  color: #061018;
  font-weight: 800;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input input {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}
.send {
  border: 0;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.chat-window.minimized .chat-body,
.chat-window.minimized .chat-input {
  display: none;
}

.chat-window.shake {
  animation: shake .35s ease-in-out;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* Responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; height: auto; }
  .cards { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 1fr; }
}
