:root {
  --bg:#f0f2f5; 
  --sidebar:#ffffff; 
  --accent:#25D366; 
  --muted:#8a8f98;
  --msg-in:#dcf8c6; 
  --msg-out:#ffffff; 
  --primary-text:#111;
  --shadow: 0 2px 8px rgba(16,24,40,0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
* { box-sizing: border-box; }
body {
  margin: 0; 
  background: var(--bg);
  color: var(--primary-text);
  height: 80vh; 
  align-items: stretch;
}

.app { 
  width:100%; 
  max-width:1100px; 
  margin:auto;
  display:grid; 
  grid-template-columns:320px 1fr; 
  gap:18px; 
  padding:18px;
}

.card { 
  background:var(--sidebar); 
  border-radius:12px;
  box-shadow:var(--shadow); 
  overflow:hidden;
  display:flex; 
  flex-direction:column;
}

/* Sidebar */
.sidebar { 
  height:calc(90vh - 36px);
}

.sidebar .top { 
  display:flex; 
  align-items:center; 
  justify-content:space-between;
  padding:14px 12px; 
  border-bottom:1px solid #eef2f5;
}

.brand { 
  display:flex; 
  gap:12px; 
  align-items:center; }
.brand .logo {
  height:44px; 
  width:44px; 
  border-radius:50%;
  background:linear-gradient(135deg,var(--accent),#66bb6a);
  display:flex; 
  align-items:center; 
  justify-content:center;
  color:#fff; 
  font-weight:700;
}

.search { 
  padding:10px; 
  border-bottom:1px solid #eef2f5; 
}

.search input { 
  width:100%; 
  padding:10px; 
  border-radius:8px;
  border:1px solid #e6e9ee; 
  background:#f8fafb;
}

.contacts { 
  overflow:auto; 
  flex:1; 
}

.contact { 
  display:flex; 
  gap:12px; 
  align-items:center;
  padding:12px; 
  border-bottom:1px solid #f2f4f7; 
  cursor:pointer;
}

.contact:hover { 
  background:#f7fafc; 
}
.contact.active { 
  background:#eef7ee; 
}

.avatar {
  height:48px; 
  width:48px; 
  border-radius:50%;
  display:flex; 
  align-items:center; 
  justify-content:center;
  font-weight:600; 
  color:#fff;
}
.meta { 
  flex:1; 
}
.meta .name { 
  font-weight:600; 
}
.meta .last { 
  font-size:13px; 
  color:var(--muted); 
  margin-top:4px; 
}
.time { 
  font-size:12px; 
  color:var(--muted); 
}

/* Chat area */
.chat { 
  height:calc(90vh - 36px); 
  display:flex; 
  flex-direction:column;
}

.chat .header { 
  display:flex; 
  align-items:center; 
  gap:12px;
  padding:14px 16px; 
  border-bottom:1px solid #eef2f5;
}

.chat .header .title { 
  font-weight:700; 
}
.messages { 
  flex:1; 
  padding:20px; 
  overflow:auto;
  background:linear-gradient(180deg,#f6fbf7,transparent);
}
.daybreak { 
  display:flex; 
  align-items:center; 
  gap:12px;
  margin:8px auto; 
  color:var(--muted); 
  font-size:13px;
}

.message {
  max-width:70%; 
  padding:10px 12px; 
  border-radius:12px;
  margin:8px 0; 
  display:inline-block; 
  line-height:1.35;
}

.out { 
  background:var(--msg-out); 
  margin-left:auto; 
  border-bottom-right-radius:4px; 
}
.in { 
  background:var(--msg-in); 
  margin-right:auto; 
  border-bottom-left-radius:4px; 
}

.message .metaSmall {
  font-size:12px; 
  color:var(--muted); 
  margin-top:6px;
  text-align:right;
}

.composer { 
  padding:12px; 
  border-top:1px solid #eef2f5;
  display:flex; 
  gap:10px; 
  align-items:center;
}

.composer input { 
  flex:1; 
  padding:12px; 
  border-radius:999px;
  border:1px solid #e6e9ee;
  background:#fff;
}

.btn { 
  background:var(--accent); 
  border:none; color:#fff;
  padding:9px 14px; 
  border-radius:999px; 
  cursor:pointer;
}

/* Responsive */
@media (max-width:820px) {
  .app { 
    grid-template-columns:1fr; 
  }
  .sidebar { 
    display:none; 
  }
}

.muted { 
  color:var(--muted); 
  font-size:13px; 
}
.custom-link {
    margin-right: auto;
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(38, 50, 56, 0.3);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-family: Arial, sans-serif;
  }

  .custom-link:hover {
    background: linear-gradient(45deg, #2575fc, #6a11cb);
    box-shadow: 0 6px 20px rgba(38, 50, 56, 0.5);
    text-decoration: none;
  }