
/* RELIK V1.5.1 Chat UI Safe Patch — no global overwrite */
:root{
  --relik-chat-ink:#111318;
  --relik-chat-muted:#6f7480;
  --relik-chat-blue:#4965ff;
  --relik-chat-blue2:#6f86ff;
  --relik-chat-panel:rgba(255,255,255,.82);
  --relik-chat-panel-strong:rgba(255,255,255,.94);
  --relik-chat-line:rgba(18,22,32,.075);
  --relik-chat-shadow:0 24px 80px rgba(34,44,84,.14);
  --relik-chat-soft-shadow:0 12px 34px rgba(34,44,84,.09);
}

.relik-chat-page{
  min-height:100vh;
  padding:26px;
  color:var(--relik-chat-ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",Inter,"Segoe UI",Arial,sans-serif;
  background:
    radial-gradient(circle at 18% 14%,rgba(140,188,255,.34),transparent 30%),
    radial-gradient(circle at 78% 18%,rgba(255,198,226,.34),transparent 28%),
    radial-gradient(circle at 45% 92%,rgba(125,105,255,.22),transparent 36%),
    linear-gradient(135deg,#f8faff,#fff8fb 50%,#f7f8ff);
  overflow:hidden;
}

.relik-chat-layout{
  height:calc(100vh - 52px);
  display:grid;
  grid-template-columns:98px 460px minmax(520px,1fr);
}

.relik-chat-glass{
  background:var(--relik-chat-panel);
  border:1px solid rgba(255,255,255,.72);
  box-shadow:var(--relik-chat-shadow);
  backdrop-filter:blur(34px) saturate(170%);
  -webkit-backdrop-filter:blur(34px) saturate(170%);
}

.relik-chat-rail{
  border-radius:30px;
  padding:28px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:20px;
  z-index:2;
}

.relik-chat-brand{
  font-size:27px;
  font-weight:840;
  letter-spacing:-.08em;
  margin-bottom:18px;
}
.relik-chat-brand span{color:var(--relik-chat-blue)}

.relik-chat-rail-btn{
  position:relative;
  width:56px;
  height:56px;
  border:0;
  border-radius:18px;
  background:transparent;
  color:#15171c;
  font-size:22px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:.28s cubic-bezier(.2,.8,.2,1);
}
.relik-chat-rail-btn:hover,.relik-chat-rail-btn.active{
  background:rgba(255,255,255,.94);
  color:var(--relik-chat-blue);
  box-shadow:0 12px 34px rgba(34,44,84,.10);
  transform:translateY(-1px);
}
.relik-chat-rail-dot{
  position:absolute;
  right:11px;
  top:11px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--relik-chat-blue);
  box-shadow:0 0 0 4px rgba(73,101,255,.12);
}
.relik-chat-profile-mini{
  margin-top:auto;
  width:48px;
  height:48px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 10px 26px rgba(0,0,0,.10);
}

.relik-messages-shell{
  margin-left:26px;
  border-radius:30px 0 0 30px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  z-index:3;
  border-right:1px solid rgba(18,22,32,.045);
}

.relik-messages-head{
  padding:28px 26px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.relik-messages-title{
  margin:0;
  font-size:30px;
  line-height:1;
  letter-spacing:-.04em;
  font-weight:780;
  display:flex;
  align-items:center;
  gap:10px;
}
.relik-chat-count{
  min-width:28px;
  height:28px;
  padding:0 9px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  font-size:14px;
  color:#fff;
  background:linear-gradient(135deg,var(--relik-chat-blue),var(--relik-chat-blue2));
  box-shadow:0 10px 25px rgba(73,101,255,.25);
  letter-spacing:0;
}

.relik-messages-head-actions{display:flex;gap:10px}
.relik-chat-round-icon{
  width:46px;
  height:46px;
  border:1px solid rgba(18,22,32,.055);
  background:rgba(255,255,255,.82);
  border-radius:16px;
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:20px;
  transition:.22s ease;
  box-shadow:var(--relik-chat-soft-shadow);
}
.relik-chat-round-icon:hover{transform:translateY(-1px);background:#fff}

.relik-chat-search{
  margin:8px 24px 16px;
  height:52px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 16px;
  background:rgba(255,255,255,.82);
  border:1px solid var(--relik-chat-line);
  border-radius:18px;
  color:var(--relik-chat-muted);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.relik-chat-search input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:#20242b;
  font-size:15px;
}

.relik-chat-tabs{
  display:flex;
  gap:10px;
  padding:0 24px 16px;
}
.relik-chat-tab{
  border:0;
  height:42px;
  padding:0 22px;
  border-radius:999px;
  font-weight:720;
  background:rgba(18,22,32,.055);
  color:#171a21;
  cursor:pointer;
  transition:.24s ease;
}
.relik-chat-tab.active{
  color:#fff;
  background:linear-gradient(135deg,var(--relik-chat-blue),var(--relik-chat-blue2));
  box-shadow:0 14px 30px rgba(73,101,255,.24);
}

.relik-chat-list{
  overflow:auto;
  padding:0 18px 20px;
  flex:1;
  scrollbar-width:thin;
}

.relik-conversation{
  display:grid;
  grid-template-columns:58px minmax(0,1fr) 42px;
  gap:14px;
  align-items:center;
  padding:13px 14px;
  border-radius:22px;
  cursor:pointer;
  transition:.25s cubic-bezier(.2,.8,.2,1);
  position:relative;
  margin-bottom:4px;
}
.relik-conversation:hover,.relik-conversation.active{
  background:rgba(255,255,255,.88);
  box-shadow:0 12px 34px rgba(34,44,84,.075);
  transform:translateY(-1px);
}
.relik-conversation img{
  width:58px;
  height:58px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}
.relik-conv-name{
  font-weight:780;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.relik-conv-preview{
  margin-top:5px;
  color:var(--relik-chat-muted);
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.relik-conv-time{
  color:var(--relik-chat-muted);
  font-size:13px;
  text-align:right;
}
.relik-unread-dot{
  margin:8px 0 0 auto;
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--relik-chat-blue);
  box-shadow:0 0 0 5px rgba(73,101,255,.12);
}

.relik-chat-content{
  border-radius:0 30px 30px 0;
  overflow:hidden;
  z-index:1;
  display:grid;
  place-items:center;
  position:relative;
  min-width:0;
}
.relik-chat-content:before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 84% 14%,rgba(255,255,255,.75),transparent 20%),
    radial-gradient(circle at 52% 50%,rgba(73,101,255,.10),transparent 28%);
  pointer-events:none;
}
.relik-chat-empty{
  position:relative;
  text-align:center;
  max-width:420px;
  color:var(--relik-chat-muted);
}
.relik-chat-empty-icon{
  width:102px;
  height:102px;
  border-radius:32px;
  background:rgba(255,255,255,.80);
  border:1px solid rgba(255,255,255,.75);
  display:grid;
  place-items:center;
  margin:0 auto 24px;
  font-size:44px;
  color:var(--relik-chat-blue);
  box-shadow:0 22px 60px rgba(73,101,255,.14);
  backdrop-filter:blur(20px);
}
.relik-chat-empty h2{
  color:#111318;
  margin:0 0 10px;
  font-size:27px;
  letter-spacing:-.035em;
}
.relik-chat-empty p{margin:0;line-height:1.55;font-size:16px}

.relik-mini-chat{
  position:absolute;
  right:34px;
  bottom:34px;
  width:390px;
  border-radius:30px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(255,255,255,.75);
  box-shadow:0 30px 90px rgba(34,44,84,.18);
  backdrop-filter:blur(30px) saturate(170%);
  overflow:hidden;
  transform-origin:bottom right;
  animation:relikMiniIn .55s cubic-bezier(.2,.82,.2,1) both;
}
@keyframes relikMiniIn{
  from{opacity:0;transform:translate(18px,22px) scale(.92);filter:blur(10px)}
  to{opacity:1;transform:none;filter:blur(0)}
}
.relik-mini-head{
  height:76px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(18,22,32,.055);
  background:rgba(255,255,255,.58);
}
.relik-mini-head img{width:48px;height:48px;border-radius:50%;object-fit:cover}
.relik-mini-head b{display:block;font-size:17px}
.relik-mini-head span{font-size:13px;color:#2eaa58}
.relik-mini-actions{margin-left:auto;display:flex;gap:8px}
.relik-mini-actions button{
  width:36px;
  height:36px;
  border:0;
  border-radius:50%;
  background:rgba(18,22,32,.055);
  font-size:18px;
  cursor:pointer;
}
.relik-mini-body{
  padding:18px;
  min-height:290px;
  background:
    radial-gradient(circle at 70% 16%,rgba(73,101,255,.08),transparent 24%),
    rgba(247,248,252,.72);
}
.relik-msg{
  max-width:76%;
  padding:12px 14px;
  border-radius:18px;
  margin-bottom:12px;
  line-height:1.35;
  font-size:15px;
  box-shadow:0 8px 18px rgba(34,44,84,.055);
}
.relik-msg small{opacity:.75;margin-left:6px;font-size:11px}
.relik-msg.in{background:#fff;color:#111318;border-bottom-left-radius:7px}
.relik-msg.out{background:linear-gradient(135deg,var(--relik-chat-blue),var(--relik-chat-blue2));color:#fff;margin-left:auto;border-bottom-right-radius:7px}
.relik-typing{
  width:64px;
  padding:10px 14px;
  border-radius:18px;
  background:#fff;
  color:#9aa1ad;
  box-shadow:0 8px 18px rgba(34,44,84,.055);
}
.relik-mini-input{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px;
  background:rgba(255,255,255,.82);
  border-top:1px solid rgba(18,22,32,.055);
}
.relik-mini-input input{
  flex:1;
  height:46px;
  border:1px solid var(--relik-chat-line);
  border-radius:999px;
  padding:0 16px;
  outline:0;
  font-size:15px;
  background:#fff;
}
.relik-mini-input button{
  width:46px;
  height:46px;
  border:0;
  border-radius:50%;
  background:linear-gradient(135deg,var(--relik-chat-blue),var(--relik-chat-blue2));
  color:#fff;
  font-size:19px;
  cursor:pointer;
  box-shadow:0 12px 28px rgba(73,101,255,.26);
}

.relik-floating-chat{
  position:fixed;
  right:28px;
  bottom:28px;
  width:66px;
  height:66px;
  border:0;
  border-radius:24px;
  background:linear-gradient(135deg,var(--relik-chat-blue),var(--relik-chat-blue2));
  color:#fff;
  font-size:26px;
  cursor:pointer;
  box-shadow:0 24px 60px rgba(73,101,255,.32);
  z-index:1000;
  transition:.25s ease;
}
.relik-floating-chat:hover{transform:translateY(-2px) scale(1.03)}
.relik-floating-chat .float-badge{
  position:absolute;
  top:-7px;
  right:-7px;
  min-width:26px;
  height:26px;
  display:grid;
  place-items:center;
  background:#fff;
  color:var(--relik-chat-blue);
  font-size:13px;
  font-weight:850;
  border-radius:999px;
  box-shadow:0 8px 18px rgba(34,44,84,.16);
}

@media(max-width:900px){
  .relik-chat-page{overflow:auto;padding:12px}
  .relik-chat-layout{height:auto;min-height:100vh;display:block}
  .relik-chat-rail{display:none}
  .relik-messages-shell{margin:0;border-radius:28px;min-height:70vh}
  .relik-chat-content{display:none}
  .relik-floating-chat{right:18px;bottom:18px}
  .relik-mini-chat{position:fixed;left:12px;right:12px;bottom:92px;width:auto}
}
