/* CLINED — Chat (v98). Kartu hero, bubble bergradasi, kolom tulis melayang. Mobile-first. */
.chat-card, .chat-pad, .chat-list { min-width: 0; }
.chat-card { padding: 0 !important; gap: 0 !important; overflow: hidden; border-radius: 22px; }
.chat-hero { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.22), transparent 55%), linear-gradient(135deg, #1cb0f6 0%, #6c5ce7 100%); }
.chat-hero-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.2); font-size: 22px; }
.chat-hero h3 { margin: 0; font-size: 19px; color: #fff; }
.chat-hero p { margin: 2px 0 0; font-size: 12px; font-weight: 700; opacity: .88; line-height: 1.35; }
.chat-hero > div { min-width: 0; flex: 1; }
.chat-bell { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 2px solid rgba(255,255,255,.45); background: rgba(255,255,255,.16); color: #fff; font-size: 20px; cursor: pointer; }
.chat-bell.on { background: #fff; color: #6c5ce7; border-color: #fff; }
.chat-bell:disabled { opacity: .6; }
.chat-pad { display: grid; gap: 14px; padding: 14px; }
.chat-searchbox { position: relative; }
.chat-searchbox::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; pointer-events: none; }
.chat-search { width: 100%; box-sizing: border-box; min-height: 48px; border-radius: 16px; border: 2px solid var(--line, #e5e7eb); padding: 0 14px 0 40px; font: inherit; font-size: 16px; background: var(--surface, #f4f6f7); color: inherit; }
.chat-search:focus { outline: none; border-color: #1cb0f6; background: var(--card, #fff); box-shadow: 0 0 0 4px rgba(28,176,246,.15); }
.chat-list { display: grid; gap: 16px; }
.chat-grp { display: grid; gap: 8px; }
.chat-grp h4 { display: flex; align-items: center; gap: 8px; margin: 0 2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.chat-grp h4 small { font-weight: 900; padding: 1px 8px; border-radius: 99px; background: var(--surface, #eef1f2); }
.chat-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 8px 12px 8px 10px; border-radius: 18px; border: 2px solid var(--line, #e5e7eb); background: var(--card, #fff); transition: transform .12s, box-shadow .12s, border-color .12s; }
.chat-row.open { cursor: pointer; border-bottom-width: 3px; }
.chat-row.open:hover { border-color: rgba(28,176,246,.55); }
.chat-row.open:active { transform: translateY(1px) scale(.995); }
.chat-row.has-unread { border-color: rgba(28,176,246,.6); background: linear-gradient(90deg, rgba(28,176,246,.10), transparent 70%), var(--card, #fff); }
.chat-row:not(.open) { opacity: .92; }
.chat-row .soc-av { width: 48px; height: 48px; font-size: 16px; }
.chat-who { min-width: 0; display: grid; gap: 2px; }
.chat-who-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chat-who b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small { font-size: 12.5px; font-weight: 700; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.has-unread .chat-who small { opacity: 1; font-weight: 800; }
.chat-meta { display: grid; justify-items: end; gap: 6px; }
.chat-meta time { font-size: 11px; font-weight: 800; opacity: .6; }
.chat-badge { font-style: normal; font-size: 10.5px; font-weight: 900; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.chat-badge.b-admin { background: rgba(255,150,0,.18); color: #b86a00; }
.chat-badge.b-helper { background: rgba(28,176,246,.16); color: #0b7cb4; }
.chat-badge.b-mentor { background: rgba(88,204,2,.18); color: #3d8a00; }
:root.dark .chat-badge.b-admin { color: #ffc266; } :root.dark .chat-badge.b-helper { color: #7cd3ff; } :root.dark .chat-badge.b-mentor { color: #9be15a; }
.chat-mini { min-height: 40px !important; padding: 0 14px !important; font-size: 13px !important; white-space: nowrap; border-radius: 12px !important; }
.chat-wait { font-size: 12px; font-weight: 800; opacity: .7; white-space: nowrap; }
.chat-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 12px; opacity: .85; }
.chat-empty span { font-size: 40px; }
.chat-empty b { font-size: 15px; } .chat-empty small { font-size: 12.5px; font-weight: 700; opacity: .75; }
.chat-pushnote { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(108,92,231,.10); border: 2px dashed rgba(108,92,231,.4); font-size: 12.5px; font-weight: 800; line-height: 1.4; }
.chat-pushnote button { margin-left: auto; flex: none; min-height: 38px; padding: 0 14px; border-radius: 12px; border: 0; background: #6c5ce7; color: #fff; font: inherit; font-weight: 900; font-size: 13px; cursor: pointer; }
.chat-hint { margin: 0; font-size: 12px; font-weight: 700; opacity: .7; line-height: 1.45; }

/* Percakapan */
.chat-thread { display: flex; flex-direction: column; }
.chat-head { display: grid; grid-template-columns: 40px 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; color: #fff; background: linear-gradient(135deg, #1cb0f6, #6c5ce7); }
.chat-head .chat-who b { color: #fff; font-size: 16px; }
.chat-head .chat-who small { color: #fff; opacity: .9; }
.chat-head .soc-av { width: 44px; height: 44px; background: rgba(255,255,255,.25); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.chat-head .soc-av.on::after { border-color: #4b5fe0; }
.chat-head .chat-badge { background: rgba(255,255,255,.22) !important; color: #fff !important; }
.chat-back { width: 40px; height: 40px; min-height: 40px !important; padding: 0 !important; border-radius: 12px !important; font-size: 24px; line-height: 1; border: 0 !important; background: rgba(255,255,255,.2) !important; color: #fff !important; cursor: pointer; }
.chat-ttl { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 6px 12px; font-size: 11.5px; font-weight: 800; opacity: .75; background: var(--surface, #f4f6f7); }
.chat-msgs { display: flex; flex-direction: column; gap: 3px; height: min(56vh, 520px); min-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px; background: radial-gradient(rgba(28,176,246,.07) 1.5px, transparent 1.5px) 0 0 / 22px 22px, var(--surface, #f4f6f7); scroll-behavior: smooth; }
.chat-day { align-self: center; font-size: 11px; font-weight: 900; padding: 3px 12px; margin: 10px 0 6px; border-radius: 99px; background: var(--card, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.08); opacity: .9; }
.chat-msg { max-width: 80%; padding: 8px 12px 6px; border-radius: 18px; display: grid; gap: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.10); animation: chat-pop .18s ease-out; }
.chat-msg p { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg small { font-size: 10.5px; font-weight: 800; opacity: .65; justify-self: end; }
.chat-msg.me { align-self: flex-end; background: linear-gradient(135deg, #1cb0f6, #4b7bec); color: #fff; border-bottom-right-radius: 6px; }
.chat-msg.them { align-self: flex-start; background: var(--card, #fff); border-bottom-left-radius: 6px; }
.chat-msg.me.cont { border-top-right-radius: 6px; } .chat-msg.them.cont { border-top-left-radius: 6px; }
.chat-msg.gap { margin-top: 8px; }
@keyframes chat-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; align-items: end; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--card, #fff); border-top: 2px solid var(--line, #e5e7eb); }
.chat-compose textarea { min-height: 48px; max-height: 120px; box-sizing: border-box; resize: none; border-radius: 24px; border: 2px solid var(--line, #e5e7eb); padding: 12px 16px; font: inherit; font-size: 16px; line-height: 1.3; background: var(--surface, #f4f6f7); color: inherit; }
.chat-compose textarea:focus { outline: none; border-color: #1cb0f6; background: var(--card, #fff); }
.chat-send { width: 48px; height: 48px; min-height: 48px !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important; background: linear-gradient(135deg, #1cb0f6, #6c5ce7) !important; color: #fff !important; font-size: 20px; cursor: pointer; box-shadow: 0 3px 0 rgba(75,60,170,.45); display: grid; place-items: center; }
.chat-send:active { transform: translateY(2px); box-shadow: none; }
.chat-send:disabled { opacity: .45; box-shadow: none; }
.chat-locked { margin: 0; padding: 14px; text-align: center; font-size: 13px; font-weight: 800; background: var(--card, #fff); border-top: 2px solid var(--line, #e5e7eb); }
@media (prefers-reduced-motion: reduce) { .chat-msg { animation: none; } .chat-msgs { scroll-behavior: auto; } }

/* Total akun online — badge hijau di kanan jumlah pengguna */
.chat-grp h4 .chat-online-total {
  margin-left: auto;
  color: #16a34a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
  white-space: nowrap;
}
