:root{
  --black:#0a0a0a;
  --white:#ffffff;
  --cream:#FFF8E7;
  --yellow:#FFD93D;
  --pink:#FF5DA2;
  --blue:#4D96FF;
  --green:#6BCB77;
  --orange:#FF8C42;
  --purple:#9B5DE5;
  --red:#FF4545;
  --cyan:#3DDBD9;

  --accent: var(--purple);
  --accent2: var(--pink);
  --bubble-me: var(--yellow);
  --bubble-other: var(--white);
  --danger: var(--red);
  --success: var(--green);

  --border-w: 3px;
  --border-w-lg: 4px;
  --shadow-off: 5px;
  --shadow-off-lg: 7px;
  --radius: 14px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%; overflow-x:hidden; max-width:100vw;}
body{
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle, rgba(10,10,10,0.06) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--black);
  overflow: hidden;
  padding-top: 0;
  padding-bottom: var(--safe-bottom);
  font-weight: 500;
}
.hidden{ display:none !important; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
input, textarea{ font-family:inherit; }
/* Sembunyikan scrollbar hitam di seluruh elemen agar tampilan bersih (clean) */
*, *::before, *::after{
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
::-webkit-scrollbar,
*::-webkit-scrollbar{
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb{
  background: transparent !important;
  border: none !important;
}
::-webkit-scrollbar-track,
*::-webkit-scrollbar-track{
  background: transparent !important;
}

/* ---- shared "brutal card" look (keeps .glass class name used in HTML) ---- */
.glass{
  background: var(--white);
  border: var(--border-w-lg) solid var(--black);
  box-shadow: var(--shadow-off-lg) var(--shadow-off-lg) 0 var(--black);
  backdrop-filter: none;
}

/* ============ AUTH SCREEN ============ */
.auth-screen{
  height:100%;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  background:
    linear-gradient(135deg, var(--purple) 0%, var(--purple) 30%, var(--pink) 60%, var(--yellow) 100%);
  background-size: 200% 200%;
}
.auth-card{
  width:100%; max-width:400px;
  border-radius: var(--radius);
  padding: 34px 26px;
  background: var(--white);
}
.auth-logo{ text-align:center; margin-bottom:22px; }
.logo-badge{
  width:60px;height:60px;border-radius:14px;
  background: var(--yellow);
  border: var(--border-w-lg) solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  display:flex;align-items:center;justify-content:center;
  font-weight:900;font-size:28px;margin:0 auto 14px;
  transform: rotate(-4deg);
  color: var(--black);
}
.auth-logo h1{ font-size:28px; font-weight:900; letter-spacing:-0.5px; }
.auth-logo h1 span{ color:var(--pink); -webkit-text-stroke: 0.5px var(--black); }
.auth-tag{ color:#555; font-size:13px; margin-top:6px; font-weight:600; }
.auth-tabs{
  display:flex; gap:8px; margin-bottom:18px; background: var(--cream);
  border: var(--border-w) solid var(--black); border-radius:12px; padding:4px;
}
.auth-tab{
  flex:1; padding:10px; border-radius:8px; font-weight:800; color:#555; font-size:14px;
  transition:.12s;
}
.auth-tab.active{ background: var(--blue); color:var(--black); border: 2px solid var(--black); }
.auth-form{ display:flex; flex-direction:column; gap:14px; }
.auth-form input, .modal-search{
  padding:13px 16px; border-radius:10px; border: var(--border-w) solid var(--black);
  background: var(--white); color: var(--black); font-size:14px; outline:none; font-weight:600;
  box-shadow: 3px 3px 0 var(--black);
}
.auth-form input::placeholder, .modal-search::placeholder{ color:#888; font-weight:500; }
.auth-form input:focus, .modal-search:focus{ background: var(--yellow); }
.btn-primary{
  padding:13px; border-radius:10px; font-weight:900; font-size:14px; text-transform:uppercase; letter-spacing:.4px;
  background: var(--pink); color:var(--black); border: var(--border-w) solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  transition: transform .1s, box-shadow .1s;
}
.btn-primary:hover{ background: var(--yellow); }
.btn-primary:active{ transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--black); }
.btn-secondary{
  padding:12px; border-radius:10px; font-weight:800; font-size:14px;
  background: var(--cyan); color:var(--black); border: var(--border-w) solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  transition: transform .1s, box-shadow .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover{ background: var(--blue); }
.btn-secondary:active{ transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--black); }
.auth-error{ color:#B8003A; font-size:13px; min-height:16px; text-align:center; font-weight:700; }
.auth-field-label{ font-size:12px; opacity:.75; margin:-4px 2px 0; }
.auth-hint{ font-size:12px; line-height:1.4; color:#B8003A; background:rgba(184,0,58,.08); border-radius:8px; padding:8px 10px; margin:0 0 2px; }

/* ============ APP LAYOUT ============ */
.app{
  height:100vh; height:100dvh; height: var(--app-height, 100dvh);
  overscroll-behavior:none;
  display:flex;
  background: var(--cream);
}
.sidebar{
  position:relative;
  width:340px; min-width:300px; flex-shrink:0;
  display:flex; flex-direction:column;
  border-radius:0; border-right: var(--border-w-lg) solid var(--black); border-left:none; border-top:none; border-bottom:none;
  box-shadow:none;
  background: var(--white);
}

/* Desktop: sidebar jadi kolom menu */
html:not(.is-mobile) .sidebar{
  width: 240px;
  min-width: 64px;
  border-right: var(--border-w, 2px) solid var(--black);
  background: var(--white);
  border-radius: 0;
  transition: width .28s cubic-bezier(.4,0,.2,1), background .2s, border-color .2s;
  overflow: hidden;
}
/* Collapsed: hanya ikon navigasi (logo Xyzora disembunyikan) */
html:not(.is-mobile) .sidebar.collapsed{
  width: 72px;
}
html:not(.is-mobile) .sidebar.collapsed .desktop-brand{
  display: none !important;
}
html:not(.is-mobile) .sidebar.collapsed .nav-text,
html:not(.is-mobile) .sidebar.collapsed .nav-section-title{
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}
html:not(.is-mobile) .sidebar.collapsed .desktop-nav-item{
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}
html:not(.is-mobile) .sidebar.collapsed .desktop-nav-item i{
  margin: 0;
  font-size: 18px;
}
html:not(.is-mobile) .sidebar.collapsed .sidebar-header{
  justify-content: center;
  padding: 16px 8px;
}
html:not(.is-mobile) .sidebar.collapsed .sidebar-toggle{
  margin: 0 auto;
}
html:not(.is-mobile) .sidebar.collapsed .sidebar-toggle i{
  transform: rotate(180deg);
}
html:not(.is-mobile) .sidebar.collapsed .nav-dot{
  right: 10px;
  top: 10px;
  transform: none;
}

/* List panel (chat list / story / log) */
.list-panel{
  position: relative;
  width: 340px;
  min-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: var(--border-w-lg) solid var(--black);
}
html:not(.is-mobile) .list-panel{
  border-right: 1px solid #e5e7eb;
}
.list-panel-header{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 0;
}
.list-panel-header .search-box{
  flex: 1;
  padding: 0;
}
.list-panel-actions{
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.mobile-list-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 8px;
  border-bottom: var(--border-w) solid var(--black);
  background: var(--yellow);
}
html.is-mobile .mobile-list-header{
  display: flex !important;
}

/* ============ FLOATING "+" BUTTON ============
   Satu tombol serba-guna di kanan bawah. Aksinya berubah tergantung tab
   yang sedang aktif (Home / Story / Saluran) — lihat app.js. */
.fab-main{
  position:absolute; z-index:8;
  right:18px; bottom: calc(88px + var(--safe-bottom));
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; color: var(--black);
  background: var(--yellow);
  border: var(--border-w) solid var(--black);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--black);
  transition: transform .12s, box-shadow .12s;
}
.fab-main:hover{ background: var(--cyan); }
.fab-main:active{ transform: translate(3px,3px); box-shadow: 0 0 0 var(--black); }
.fab-main.hidden{ display:none !important; }
.sidebar-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px; gap:8px; border-bottom: var(--border-w) solid var(--black);
  background: var(--yellow);
}
.my-profile{ display:flex; align-items:center; gap:10px; cursor:pointer; overflow:hidden; }
.my-name{ font-weight:800; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:140px; }
.my-sub{ font-size:11px; color:#1a7a1a; font-weight:700; }
.sidebar-actions{ display:flex; gap:5px; flex-shrink:0; }
.icon-btn{
  width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center;
  font-size:16px; transition:.1s; background: var(--white); color: var(--black); border: 2px solid var(--black);
  box-shadow: 2px 2px 0 var(--black);
}
.icon-btn i, .icon-btn svg{
  font-size: 16px;
  line-height: 1;
  color: inherit;
  display: inline-block;
}
.icon-btn:hover{ background: var(--cyan); }
.icon-btn:active{ transform: translate(2px,2px); box-shadow: 0 0 0 var(--black); }
.icon-btn.small{ width:28px; height:28px; font-size:13px; border-width:2px; box-shadow:1px 1px 0 var(--black); }
.icon-btn.small i{ font-size: 12px; }

.avatar{
  width:44px;height:44px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--black);font-size:16px;
  border: 2.5px solid var(--black); flex-shrink:0;
  text-transform:uppercase;
  box-shadow: 2px 2px 0 var(--black);
}
.avatar.big{ width:76px;height:76px;font-size:28px; margin:0 auto 10px; border-width:3px; box-shadow:3px 3px 0 var(--black); }
.avatar img{ width:100%; height:100%; border-radius:50%; object-fit:cover; }

.avatar-edit-row{ display:flex; flex-direction:column; align-items:center; margin-bottom:6px; }
.avatar-edit-actions{ display:flex; gap:8px; margin-bottom:6px; }
.btn-secondary.small{ padding:7px 12px; font-size:12px; box-shadow:2px 2px 0 var(--black); }
.info-avatar-row .btn-secondary.small{ margin:2px auto 10px; }
.info-field-label{ font-size:11px; font-weight:800; text-transform:uppercase; color:#666; margin:8px 0 4px; }

.invite-link-row{ display:flex; gap:8px; align-items:center; }
.invite-link-row input{ flex:1; font-size:12px; padding:10px 12px; }
.invite-qr-wrap{ display:flex; flex-direction:column; align-items:center; margin-top:14px; }
#invite-qr{ background:#fff; padding:10px; border-radius:10px; border:2.5px solid var(--black); box-shadow:3px 3px 0 var(--black); line-height:0; }

.search-box{ padding:12px 16px; }
.search-box input{
  width:100%; padding:10px 14px; border-radius:10px; border: 2.5px solid var(--black);
  background: var(--cream); color: var(--black); outline:none; font-size:13px; font-weight:600;
}
html:not(.is-mobile) .search-box input{
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 12px;
  box-shadow: none;
  font-weight: 500;
}
html:not(.is-mobile) .search-box input:focus{
  border-color: var(--purple);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 15%, transparent);
}
.chat-filter-tabs{
  display:flex; gap:6px; padding:0 14px 10px; overflow-x:auto; overflow-y:hidden;
  scrollbar-width:none; -ms-overflow-style:none;
}
.chat-filter-tabs::-webkit-scrollbar{ display:none; width:0; height:0; }
.filter-tab{
  padding:6px 12px; border-radius:20px; font-size:12px; font-weight:800; white-space:nowrap;
  background: var(--white); color:#555; border: 2px solid var(--black); flex-shrink:0;
}
.filter-tab.active{ background: var(--purple); color:var(--white); }
.chat-list{ flex:1; overflow-y:auto; padding-bottom: 8px; }


/* ============ SIDEBAR BOTTOM NAV — modern floating pill (mobile) ============
   Gaya bersih seperti screenshot: bar putih membulat, soft shadow, ikon + label,
   tombol Create di tengah lebih besar & ungu menonjol ke atas. */
.sidebar-bottom-nav{
  position: relative;
  z-index: 5;
  display: flex;
  flex-shrink: 0;
  align-items: flex-end;
  justify-content: space-around;
  margin: 0 12px 12px;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: visible;
}
.bottom-nav-btn{
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .2s;
  min-width: 0;
}
.bottom-nav-btn .nav-icon-wrap{
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background-color .2s, color .2s;
}
.bottom-nav-btn .nav-icon-wrap i{
  font-size: 18px;
  color: #9ca3af;
  transition: color .2s;
}
.bottom-nav-btn .nav-label{
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  transition: color .2s;
  white-space: nowrap;
}
/* Active state — mengikuti tema */
.bottom-nav-btn.active .nav-icon-wrap i{ color: var(--purple); }
.bottom-nav-btn.active .nav-label{ color: var(--purple); }
.bottom-nav-btn.active .nav-icon-wrap{ background: color-mix(in srgb, var(--purple) 12%, transparent); }

/* Create button — elevated, warna mengikuti tema */
.bottom-nav-btn.create-btn{
  flex: 0 0 auto;
  margin: 0 4px;
  padding: 0;
  transform: translateY(-18px);
}
.bottom-nav-btn.create-btn .nav-icon-wrap.create-icon,
.bottom-nav-btn.create-btn .create-icon{
  width: 52px;
  height: 52px;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--purple) 40%, transparent);
  border: 3px solid var(--white);
}
.bottom-nav-btn.create-btn .nav-icon-wrap.create-icon i,
.bottom-nav-btn.create-btn .create-icon i{
  font-size: 22px;
  color: #ffffff;
}
.bottom-nav-btn.create-btn .nav-label{
  display: none; /* label Create disembunyikan agar mirip screenshot */
}
.bottom-nav-btn.create-btn:active .nav-icon-wrap{
  transform: scale(0.94);
}
.bottom-nav-btn:not(.create-btn):active .nav-icon-wrap{
  transform: scale(0.92);
}
.bottom-nav-btn:hover:not(.active):not(.create-btn) .nav-icon-wrap i,
.bottom-nav-btn:hover:not(.active):not(.create-btn) .nav-label{
  color: #6b7280;
}

/* Story notification dot */
.nav-dot{
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #fff;
}
.nav-dot.hidden{ display: none; }

/* item pada tab "Log" (riwayat panggilan) - meniru gaya .chat-item */
.call-log-item .chat-item-preview i{ margin-right:4px; }
.call-log-item .chat-item-preview.missed{ color: var(--red); font-weight:700; }

/* ============ RESPONSIVE VISIBILITY ============ */
.only-mobile{ display: none !important; }
.only-desktop{ display: none !important; }
html:not(.is-mobile) .only-desktop{ display: flex !important; }
html.is-mobile .only-mobile{ display: flex !important; }
html.is-mobile .only-desktop{ display: none !important; }
html:not(.is-mobile) .only-mobile{ display: none !important; }

/* ============ DESKTOP SIDE NAV (gaya Storeify + collapsible) ============ */
.desktop-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.brand-logo{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--purple) 30%, transparent);
  flex-shrink: 0;
}
.brand-name{
  font-weight: 800;
  font-size: 18px;
  color: var(--black);
  letter-spacing: -0.3px;
  white-space: nowrap;
  transition: opacity .2s, width .25s;
}
html:not(.is-mobile) .sidebar-header{
  background: var(--white);
  border-bottom: 1px solid color-mix(in srgb, var(--black) 8%, transparent);
  padding: 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* Tombol buka/tutup sidebar */
.sidebar-toggle{
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--cream);
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sidebar-toggle i{
  font-size: 13px;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-toggle:hover{
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  color: var(--purple);
}
html:not(.is-mobile) .sidebar.collapsed .sidebar-toggle{
  margin: 0 auto;
}
.desktop-side-nav{
  display: none;
  flex-direction: column;
  padding: 12px 10px 16px;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
html:not(.is-mobile) .desktop-side-nav{
  display: flex !important;
}
.nav-section{
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.nav-section:last-child{ margin-bottom: 0; }
.nav-section-title{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  padding: 8px 12px 6px;
  white-space: nowrap;
  transition: opacity .2s, width .25s;
  overflow: hidden;
}
.desktop-nav-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--black);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s, padding .2s, gap .2s;
  text-align: left;
  width: 100%;
  position: relative;
  opacity: .78;
}
.desktop-nav-item i{
  width: 22px;
  text-align: center;
  font-size: 16px;
  color: inherit;
  flex-shrink: 0;
  transition: color .15s, font-size .2s;
}
.desktop-nav-item.active{ opacity: 1; }
.desktop-nav-item .nav-text{
  white-space: nowrap;
  transition: opacity .2s, width .25s;
  overflow: hidden;
}
.desktop-nav-item:hover{
  background: var(--cream);
  color: var(--black);
}
.desktop-nav-item:hover i{ color: var(--black); }
.desktop-nav-item.active{
  background: color-mix(in srgb, var(--purple) 14%, transparent);
  color: var(--purple);
}
.desktop-nav-item.active i{ color: var(--purple); }
.desktop-nav-item .nav-dot{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--red, #ef4444);
  border-radius: 50%;
  border: none;
}


.chat-item{
  display:flex; align-items:center; gap:12px; padding:12px 16px; cursor:pointer; border-bottom: 1.5px solid #f0f0f0;
  transition:.1s; position:relative;
}
.chat-item:hover{ background: var(--cream); }
.chat-item.active{ background: var(--yellow); border-left: 4px solid var(--purple); }
.chat-item-body{ flex:1; min-width:0; }
.chat-item-top{
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px;
}
.chat-item-name{ font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }

/* ===== Xyzora Verified — centang oranye ===== */
.verified-badge{ color:var(--orange); font-size:0.82em; margin-left:4px; vertical-align:middle; filter:drop-shadow(0 0 2px rgba(255,140,66,.5)); flex-shrink:0; }
.verify-box{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:14px; background:rgba(255,140,66,.08); border:1px solid rgba(255,140,66,.25); }
.verify-box.is-verified{ background:rgba(107,203,119,.1); border-color:rgba(107,203,119,.3); }
.verify-box.is-rejected{ background:rgba(255,69,69,.08); border-color:rgba(255,69,69,.25); }
.verify-box i.fa-circle-check{ color:var(--orange); font-size:20px; flex-shrink:0; }
.verify-box.is-verified i.fa-circle-check{ color:var(--green); }
.verify-box.is-rejected i.fa-circle-check{ color:var(--red); }
.verify-box-text{ font-size:12.5px; font-weight:600; line-height:1.4; flex:1; }
.verify-box-text small{ display:block; font-weight:500; opacity:.75; margin-top:2px; }
.chat-type-tag{
  font-size:10px; font-weight:700; background: var(--cyan); color:var(--black);
  padding:2px 6px; border-radius:6px; white-space:nowrap; flex-shrink:0;
}
.chat-item-time{ font-size:11px; color:#999; white-space:nowrap; flex-shrink:0; }
.chat-item-bottom{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.chat-item-preview{ font-size:12px; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
.unread-badge{ 
  font-size:11px; font-weight:800; background: var(--red); color:var(--white); 
  border-radius:50%; width:22px; height:22px; display:flex; align-items:center; 
  justify-content:center; flex-shrink:0; border:2px solid var(--black);
}
.online-dot{
  position:absolute; bottom:0; right:-2px; width:12px; height:12px; 
  background: var(--green); border-radius:50%; border:2px solid var(--white);
  box-shadow: 0 0 0 1px var(--black);
}

/* ============ SWIPE-TO-REVEAL pada item chat (geser ke kanan) ============
   Struktur: .chat-swipe-wrap membungkus panel aksi (di belakang, rata kiri)
   dan .chat-item (di depan). .chat-item digeser lewat transform translateX
   ke kanan lewat drag pointer, memperlihatkan panel aksi di baliknya. */
.chat-swipe-wrap{ position:relative; overflow:hidden; border-bottom: 1.5px solid #f0f0f0; }
.chat-swipe-wrap .chat-item{ border-bottom:none; background:var(--white); touch-action: pan-y; }
.chat-swipe-wrap.active .chat-item{ background: var(--yellow); }
.chat-swipe-actions{
  position:absolute; top:0; bottom:0; left:0; display:flex; width:210px;
}
.swipe-action-btn{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; font-size:10px; font-weight:800; color:var(--white); border:none; cursor:pointer;
}
.swipe-action-btn i{ font-size:16px; }
.swipe-action-btn.archive-btn{ background: var(--purple); }
.swipe-action-btn.unarchive-btn{ background: var(--cyan); color:var(--black); }
.swipe-action-btn.delete-btn{ background: var(--red); }
.swipe-action-btn.pin-btn{ background: var(--orange); color:var(--black); }
.chat-swipe-actions.single{ width:90px; }
.call-detail-head{ display:flex; flex-direction:column; align-items:center; gap:8px; margin-bottom:12px; }
.call-detail-head .avatar{ width:64px; height:64px; font-size:24px; }
.call-detail-name{ font-weight:800; font-size:18px; text-align:center; }
.call-detail-rows{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.call-detail-rows > div{
  display:flex; justify-content:space-between; gap:12px; padding:8px 12px;
  border:2px solid var(--black); border-radius:10px; background: var(--cream); font-size:13px;
}
.call-detail-rows span{ opacity:.65; font-weight:700; }
.call-detail-rows b.missed{ color: var(--red); }
.call-detail-actions{ display:flex; gap:8px; margin-bottom:10px; }
.call-detail-actions .btn-secondary{ flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 4px; font-size:12px; }
.call-detail-actions .btn-secondary i{ font-size:17px; }

.archived-banner{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:10px 16px; background: var(--cream); border-bottom: 1.5px solid #f0f0f0;
  font-size:12px; font-weight:700; cursor:pointer; color:#555;
}
.archived-banner i{ color: var(--purple); }
.archived-back{
  display:flex; align-items:center; gap:8px; padding:12px 16px; font-size:13px; font-weight:800;
  border-bottom: 1.5px solid #f0f0f0; cursor:pointer; color: var(--purple);
}

.empty-state{
  display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; gap:16px; color:#999;
}
.empty-icon{ font-size:64px; color:#ddd; line-height:1; }
.system-bubble{
  align-self:center; padding:8px 12px; border-radius:12px; background: var(--cream);
  border: 2px solid var(--black); font-size:12px; color:#666; font-weight:600;
  margin:4px 0; box-shadow: 2px 2px 0 var(--black);
}
.call-log-bubble{
  align-self:center; display:flex; align-items:center; gap:8px; padding:8px 14px; border-radius:14px;
  background: var(--cream); border: 2px solid var(--black); font-size:12.5px; color:#333; font-weight:700;
  margin:4px 0; box-shadow: 2px 2px 0 var(--black);
}
.call-log-bubble i{ font-size:13px; }
.call-log-bubble.missed, .call-log-bubble.rejected{ color:#B8003A; }
.call-log-bubble.missed i, .call-log-bubble.rejected i{ color:#B8003A; }
.call-log-duration{ opacity:.7; font-weight:600; }

/* ============ CHAT AREA ============ */
.chat-area{
  flex:1; display:flex; flex-direction:column;
}
.chat-window{
  display:flex; flex-direction:column; height:100%; width:100%; position:relative;
}
.chat-header{
  flex-shrink:0; display:flex; align-items:center; gap:12px; padding:12px 20px; border-bottom: var(--border-w) solid var(--black);
  background: var(--white);
}
.chat-header-info{ display:flex; align-items:center; gap:10px; flex:1; cursor:pointer; min-width:0; }
.chat-header-text{ min-width:0; flex:1; }
.chat-header-info .avatar{ flex-shrink:0; }
.chat-title{ font-weight:800; font-size:15px; display:flex; align-items:center; gap:4px; min-width:0; }
.chat-title-text{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.chat-subtitle{ font-size:12px; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:relative; }
/* Marquee untuk subtitle chat (mis. "Terakhir dilihat hari ini pukul 14:30") saat
   teksnya kepanjangan buat muat di header - berjalan pelan lalu berhenti agak
   lama di bagian akhir supaya jam-nya sempat terbaca, baru geser balik ke awal. */
.chat-subtitle-text{ display:inline-block; white-space:nowrap; will-change:transform; }
.chat-subtitle-text.marquee{
  animation-name: chat-subtitle-marquee;
  animation-duration: var(--marquee-duration, 6s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes chat-subtitle-marquee{
  0%   { transform: translateX(0); }
  8%   { transform: translateX(0); }              /* jeda sebentar di awal */
  35%  { transform: translateX(var(--marquee-distance, 0)); }
  80%  { transform: translateX(var(--marquee-distance, 0)); }  /* berhenti agak lama di akhir (kelihatan jamnya) */
  95%  { transform: translateX(0); }
  100% { transform: translateX(0); }
}
.chat-header-actions{ display:flex; gap:6px; flex-shrink:0; }

.messages{
  flex:1; padding:16px 20px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; min-height:0;
}
.msg-row{
  display:flex; gap:8px; margin-bottom:4px; align-items:flex-end;
}
.msg-row.me{ justify-content:flex-end; }
.msg-row.me .bubble{ background: var(--bubble-me); color:var(--black); }
.msg-row.system{
  display:flex; justify-content:center; margin:8px 0;
}
/* Pemisah tanggal ala WhatsApp: Hari ini / Kemarin / Senin, 14 Oktober 2026 */
/* Jangan pakai position:sticky — saat scroll banyak hari, label menumpuk di atas */
.msg-row.msg-day-sep{
  display:flex; justify-content:center;
  margin:14px 0 10px;
  position:relative;
  z-index:0;
}
.day-sep-bubble{
  background: rgba(0,0,0,.1);
  color: var(--black);
  font-size:12px;
  font-weight:700;
  padding:5px 14px;
  border-radius:8px;
  border:1.5px solid var(--black);
  box-shadow: 1px 1px 0 var(--black);
  opacity:.95;
  user-select:none;
  pointer-events:none;
  white-space:nowrap;
}
html.dark .day-sep-bubble,
body.theme-dark .day-sep-bubble{
  background: rgba(255,255,255,.14);
}
.bubble{
  max-width:60%; word-wrap:break-word; padding:12px 16px; border-radius:12px;
  background: var(--bubble-other); border: 2px solid var(--black); box-shadow: 2px 2px 0 var(--black);
  color:var(--black); font-size:14px; line-height:1.4;
}
/* bubble lebih lembut: sudut membulat + "ekor" kecil di sisi pengirim */
.bubble{ padding:10px 14px; border-radius:18px 18px 18px 5px; }
.msg-row.me .bubble{ border-radius:18px 18px 5px 18px; }
.msg-row.system .bubble{ border-radius:18px; }
/* foto profil pengirim di chat grup */
.msg-avatar{
  width:32px; height:32px; font-size:12px; border-width:2px; box-shadow:none;
  align-self:flex-end; margin-bottom:2px; overflow:hidden;
}
.msg-avatar img{ border-radius:50%; }
.msg-row.has-avatar .bubble{ max-width:calc(60% - 40px); }
.msg-ticks{ margin-left:3px; color:#8f8f8f; font-size:11px; filter: drop-shadow(0 0 .6px rgba(10,10,10,.55)); transition: color .2s; }
.msg-ticks.read{ color: var(--orange); }
.msg-text{ white-space:pre-wrap; overflow-wrap:anywhere; }
.bot-btn-wrap{ margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.bot-btn-row{ display:flex; flex-direction:row; flex-wrap:wrap; gap:6px; }
.bot-btn{
  flex:1 1 calc(50% - 6px); min-width:0; box-sizing:border-box; border:2px solid var(--black);
  background:var(--cream); color:var(--black); border-radius:12px;
  padding:8px 6px; font-size:13px; font-weight:700; cursor:pointer;
  text-align:center; line-height:1.2;
  white-space:normal; overflow-wrap:normal; word-break:normal; hyphens:none;
  max-width:100%;
}
.bot-btn:active{ transform:scale(.98); opacity:.9; }
.msg-row.me .bot-btn{ background:#fff; }
.bubble-time{ font-size:10px; opacity:.7; margin-top:4px; text-align:right; font-weight:700; }
.bubble-deleted{ font-style:italic; opacity:.7; font-size:13px; }
.bubble-sender{ font-size:11px; color:var(--purple); font-weight:800; margin-bottom:4px; }
.bubble-reply{
  background: var(--cream); border-left: 3px solid var(--purple); padding:5px 8px; border-radius:8px;
  margin-bottom:6px; font-size:12px; border:2px solid var(--black); border-left-width:4px;
}
.bubble-reply-name{ font-weight:800; font-size:11.5px; color:var(--purple); }
.bubble img.msg-image{ max-width:190px; max-height:240px; object-fit:cover; border-radius:10px; display:block; margin-top:2px; cursor:pointer; border:2px solid var(--black); }

/* ---- Album (2+ foto sekaligus dalam satu bubble) ---- */
.msg-album{
  display:grid; gap:3px; margin-top:2px; border-radius:10px; overflow:hidden;
  border:2px solid var(--black); width:190px;
}
.msg-album .album-item{ position:relative; cursor:pointer; overflow:hidden; background:var(--cream); }
.msg-album .album-item img{ width:100%; height:100%; object-fit:cover; display:block; }
.msg-album.count-1{ grid-template-columns:1fr; }
.msg-album.count-1 .album-item{ height:220px; }
.msg-album.count-2{ grid-template-columns:1fr 1fr; }
.msg-album.count-2 .album-item{ height:120px; }
.msg-album.count-3{ grid-template-columns:1fr 1fr; }
.msg-album.count-3 .album-item{ height:94px; }
.msg-album.count-4plus{ grid-template-columns:1fr 1fr; }
.msg-album.count-4plus .album-item{ height:94px; }
.msg-album-more{
  position:absolute; inset:0; background:rgba(10,10,10,.55); color:#fff;
  font-weight:800; font-size:18px; display:flex; align-items:center; justify-content:center;
}
.msg-album-caption{ margin-top:6px; font-size:14px; }
.bubble .doc-chip{
  display:flex; align-items:center; gap:8px; background: var(--cream); padding:8px 10px; border-radius:10px; margin-top:2px;
  border: 2px solid var(--black); font-weight:700; cursor:pointer;
}
.bubble .doc-chip{ max-width:230px; min-width:0; }
.bubble .doc-chip i{
  font-size: 14px; flex-shrink:0;
}
/* nama file panjang dipotong "..." supaya tidak keluar dari bubble */
.bubble .doc-chip span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg-video{
  position:relative; width:230px; max-width:100%; aspect-ratio:16/10; background:#000;
  border:2px solid var(--black); border-radius:10px; overflow:hidden; cursor:pointer;
}
.msg-video video{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.msg-video-play{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:26px;
  background:rgba(10,10,10,.28);
}
.msg-video-name{
  margin-top:4px; max-width:230px; font-size:12px; font-weight:700;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.bubble audio{ margin-top:2px; max-width:220px; }
.msg-actions{
  display:flex; gap:4px; align-self:center; opacity:0; transition:.15s; margin:0 6px;
}
.msg-row:hover .msg-actions{ opacity:1; }
.msg-actions button{ 
  font-size:12px; width:32px; height:32px; border-radius:8px; background: var(--white); 
  border:2px solid var(--black); cursor: pointer; display: flex; align-items: center; 
  justify-content: center; transition:.1s; box-shadow: 1px 1px 0 var(--black);
}
.msg-actions button i{ font-size: 13px; line-height: 1; }
.msg-actions button:hover{ background: var(--yellow); }
.msg-actions button:active{ transform: translate(1px,1px); box-shadow: 0 0 0 var(--black); }

.reply-preview, .recording-bar{
  flex-shrink:0; display:flex; align-items:center; gap:10px; padding:9px 16px; border-top: var(--border-w) solid var(--black);
  background: var(--cyan);
}
.reply-preview-bar{ width:4px; align-self:stretch; background: var(--purple); border-radius:4px; border:1px solid var(--black); }
.reply-preview-body{ flex:1; min-width:0; }
.reply-preview-name{ font-size:12px; font-weight:800; color:var(--purple); }
.reply-preview-text{ font-size:12.5px; color:#222; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }

.channel-readonly-note{
  flex-shrink:0; text-align:center; font-size:12px; color:#333; padding:9px; border-top: var(--border-w) solid var(--black);
  background: var(--yellow); font-weight:700;
}

.chat-input-bar{
  flex-shrink:0; display:flex; align-items:flex-end; gap:8px; padding:12px 16px; border-top: var(--border-w-lg) solid var(--black);
  position:relative; background: var(--white);
}
.message-input{
  flex:1; padding:12px 16px; border-radius:16px; border: var(--border-w) solid var(--black);
  background: var(--cream); color: var(--black); outline:none; font-size:14px; font-weight:600;
  /* textarea: teks turun ke bawah (bukan memanjang ke kanan), tinggi menyesuaikan, maksimal 120px */
  resize:none; min-height:46px; max-height:120px; line-height:1.4; font-family:inherit;
  overflow-y:auto; overflow-wrap:anywhere; white-space:pre-wrap; display:block; min-width:0;
}
.message-input:focus{ background: var(--white); }
/* tombol tetap rata bawah saat kolom pesan membesar */
.chat-input-bar > .icon-btn{ margin-bottom:5px; }
.send-btn{ background: var(--green); border:2.5px solid var(--black); box-shadow:2px 2px 0 var(--black); }
.send-btn i{ font-size: 14px; }
.send-btn:hover{ background: var(--yellow); }
.attach-menu{
  position:absolute; bottom:60px; left:16px; display:flex; flex-direction:column; gap:5px;
  background: var(--white); border: var(--border-w) solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  padding:8px; border-radius:12px; z-index:5;
}
.attach-menu button{ padding:9px 16px; border-radius:8px; font-size:13.5px; text-align:left; font-weight:700; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.attach-menu button i{ font-size: 13px; }
.attach-menu button:hover{ background: var(--yellow); }

.recording-bar{ align-items:center; background: var(--red); color:var(--white); }
/* ikon tombol di atas kotak putih harus hitam, bukan putih (sebelumnya batal tidak terlihat) */
.recording-bar .icon-btn{ flex-shrink:0; color:var(--black); }
.recording-bar .icon-btn.small{ width:32px; height:32px; }
.recording-bar .once-toggle{ flex-shrink:0; }
.recording-bar #recording-time{ flex-shrink:0; }
.rec-dot{ width:11px; height:11px; border-radius:50%; background: var(--black); animation:pulse 1s infinite; }
@keyframes pulse{ 0%,100%{opacity:1;} 50%{opacity:.25;} }
.rec-hint{ flex:1; min-width:0; font-size:13px; color:var(--white); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ============ INFO PANEL ============ */
.info-panel{
  width:320px; flex-shrink:0; display:flex; flex-direction:column; border-radius:0;
  border-left: var(--border-w-lg) solid var(--black); box-shadow:none;
  background: var(--white);
}
.info-header{ display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom: var(--border-w) solid var(--black); background: var(--pink); }
.info-header h3{ font-weight:900; }
.info-header button{ display: flex; align-items: center; }
.info-body{ padding:20px; overflow-y:auto; }
.info-avatar-row{ text-align:center; margin-bottom:20px; }
.info-name{ font-weight:900; font-size:17px; }
.info-sub{ font-size:12.5px; color:#555; margin-top:2px; font-weight:700; }
.info-section{ margin-top:16px; }
.info-section h4{ font-size:12.5px; color:#555; margin-bottom:8px; text-transform:uppercase; letter-spacing:.5px; font-weight:800; }
.members-list{ display:flex; flex-direction:column; gap:8px; }
.member-row{ display:flex; align-items:center; gap:10px; padding:7px; border-radius:10px; border:2px solid transparent; }
.member-row:hover{ border-color: var(--black); background: var(--cream); }
.member-name{ font-size:13.5px; font-weight:700; }
.member-tag{ font-size:10.5px; color:var(--purple); font-weight:800; }
.member-info{ flex:1; min-width:0; }
.member-actions{ display:flex; gap:6px; flex-shrink:0; }
.member-actions .icon-btn{ width:32px; height:32px; font-size:13px; }
.member-actions .icon-btn.danger{ color:var(--danger); }

.settings-toggle-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 0; }
.settings-toggle-row + .settings-toggle-row{ border-top:1px solid rgba(0,0,0,0.08); }
.settings-toggle-text{ flex:1; min-width:0; }
.settings-toggle-title{ font-size:13.5px; font-weight:700; }
.settings-toggle-desc{ font-size:11.5px; color:#666; margin-top:1px; }
.settings-toggle-select{ max-width:150px; margin:0; padding:6px 8px; font-size:12.5px; }

/* ============ NAV DOT (indikator ada story baru) ============ */
.nav-dot{
  position:absolute; top:1px; right:1px; width:9px; height:9px; border-radius:50%;
  background: var(--red); border: 1.5px solid var(--black); z-index:3;
  animation: navDotPulse 1.6s ease-in-out infinite;
}
.nav-dot.hidden{ display:none; }
@keyframes navDotPulse{
  0%, 100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(255,69,69,.55); }
  50%{ transform:scale(1.15); box-shadow:0 0 0 4px rgba(255,69,69,0); }
}

/* ============ STORY (Status) - strip & daftar di sidebar ============ */
.story-view{ flex:1; overflow-y:auto; display:flex; flex-direction:column; }
.story-strip{
  display:flex; gap:14px; padding:14px 16px; overflow-x:auto; flex-shrink:0;
  border-bottom: 1.5px solid #f0f0f0;
}
.story-bubble{
  display:flex; flex-direction:column; align-items:center; gap:6px; width:64px; flex-shrink:0; cursor:pointer;
}
.story-ring{
  width:58px; height:58px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  padding:3px; background:#ccc; position:relative;
}
.story-ring.unviewed{ background: linear-gradient(135deg, var(--purple), var(--pink) 50%, var(--yellow)); }
.story-ring.viewed{ background:#ccc; }
.story-ring .avatar{ width:100%; height:100%; border:2.5px solid var(--white); box-shadow:none; }
.story-ring.sm{ width:42px; height:42px; padding:2px; flex-shrink:0; }
.story-ring.add{ background: var(--white); border:2.5px dashed #bbb; }
.story-add-badge{
  position:absolute; bottom:-2px; right:-2px; width:20px; height:20px; border-radius:50%;
  background: var(--purple); color:var(--white); border:2.5px solid var(--white);
  display:flex; align-items:center; justify-content:center; font-size:10px;
}
.story-bubble-label{
  font-size:11px; font-weight:700; text-align:center; max-width:64px; overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; color:#444;
}
.story-vertical-list{ flex:1; overflow-y:auto; }

/* ---- kartu status gaya WhatsApp (thumbnail story terakhir) ---- */
.story-strip{ gap:10px; align-items:flex-start; scrollbar-width:none; -ms-overflow-style:none; }
.story-strip::-webkit-scrollbar, .story-vertical-list::-webkit-scrollbar{ display:none; width:0; height:0; }
.story-vertical-list{ scrollbar-width:none; -ms-overflow-style:none; }
.story-card{
  position:relative; width:94px; height:146px; border-radius:16px; overflow:hidden; flex-shrink:0;
  cursor:pointer; background: linear-gradient(160deg, #3a3f6b 0%, var(--purple) 55%, var(--orange) 100%);
  color:var(--white); box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.story-card.add-card{ background: linear-gradient(160deg, #e9ebf7 0%, #cfd4ee 100%); color:#222; }
.story-card-thumb{ position:absolute; inset:0; }
.story-card-thumb img, .story-card-thumb video{ width:100%; height:100%; object-fit:cover; display:block; }
.story-card-shade{
  position:absolute; inset:0; z-index:1; pointer-events:none;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,0) 50%, rgba(0,0,0,.72) 100%);
}
.story-card.no-media .story-card-shade{ background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.3)); }
.story-card .story-ring{
  position:absolute; z-index:2; top:12px; left:50%; transform:translateX(-50%);
  width:40px; height:40px; padding:2px;
}
.story-card.add-card .story-ring{ background:var(--white); border:2.5px dashed #aaa; }
.story-card .story-add-badge{ z-index:3; }
.story-card-name{
  position:absolute; z-index:2; left:10px; right:10px; bottom:10px;
  font-size:12px; font-weight:700; line-height:1.2; color:inherit;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  text-shadow:0 1px 3px rgba(0,0,0,.55); word-break:break-word;
}
.story-card.add-card .story-card-name{ text-shadow:none; color:#222; }
.story-list-title{
  font-size:11px; font-weight:800; text-transform:uppercase; color:#999; padding:12px 16px 4px;
}
.story-vertical-list .chat-item{ cursor:pointer; }

/* ============ STORY COMPOSER (buat story baru) ============ */
.story-composer{
  position:fixed; inset:0; z-index:120; display:flex; flex-direction:column; background: var(--black);
}
.story-composer-header{
  display:flex; align-items:center; gap:12px; padding: calc(14px + var(--safe-top)) 16px 14px; flex-shrink:0;
}
.story-composer-title{ flex:1; text-align:center; color:var(--white); font-weight:800; font-size:14px; }
.story-composer-body{
  flex:1; display:flex; align-items:stretch; justify-content:center; overflow:hidden; padding:0 16px 16px;
}
.story-text-canvas{
  width:100%; border-radius:16px; display:flex; align-items:center; justify-content:center; padding:24px;
  background: var(--purple);
}
.story-text-canvas textarea{
  width:100%; max-height:100%; background:transparent; border:none; outline:none; resize:none;
  color:var(--white); font-size:28px; font-weight:800; text-align:center; line-height:1.35;
}
.story-text-canvas textarea::placeholder{ color:rgba(255,255,255,.7); }
.story-media-preview{
  width:100%; border-radius:16px; overflow:hidden; background:#111; display:flex; align-items:center; justify-content:center;
}
.story-media-preview img, .story-media-preview video{ max-width:100%; max-height:100%; object-fit:contain; }
.story-composer-colors{
  display:flex; gap:10px; padding:0 16px 14px; overflow-x:auto; flex-shrink:0;
}
.story-color-swatch{
  width:34px; height:34px; border-radius:50%; flex-shrink:0; border:2.5px solid rgba(255,255,255,.5);
}
.story-color-swatch.active{ border-color: var(--white); box-shadow:0 0 0 2.5px var(--purple); }
.story-composer-footer{
  padding: 12px 16px calc(16px + var(--safe-bottom)); flex-shrink:0;
}
.story-composer-footer input{
  width:100%; padding:12px 16px; border-radius:24px; border:2.5px solid var(--white); background:rgba(255,255,255,.12);
  color:var(--white); font-size:14px; font-weight:600; outline:none;
}
.story-composer-footer input::placeholder{ color:rgba(255,255,255,.65); }
.story-composer-header .icon-btn.send-btn{ background: var(--yellow); }
.story-composer-header .icon-btn.send-btn[disabled]{ opacity:.55; pointer-events:none; }

/* ============ STORY UPLOAD PROGRESS (overlay saat foto/video sedang dikirim) ============ */
.story-upload-overlay{
  position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; background:rgba(10,10,10,.82); border-radius:16px; padding:24px;
}
.story-upload-percent{ color:var(--white); font-weight:800; font-size:26px; }
.story-upload-bar-track{
  width:100%; max-width:260px; height:12px; border-radius:8px; background:rgba(255,255,255,.18);
  border:2px solid var(--white); overflow:hidden;
}
.story-upload-bar-fill{
  height:100%; width:0%; background: var(--green); border-radius:6px; transition: width .15s ease-out;
}
.story-upload-label{ color:rgba(255,255,255,.8); font-size:13px; font-weight:600; text-align:center; }
.story-upload-cancel-btn{
  padding:10px 22px; border-radius:24px; border:2.5px solid var(--white); background:transparent;
  color:var(--white); font-weight:800; font-size:13px; cursor:pointer;
}
.story-upload-cancel-btn:hover{ background: var(--red); border-color: var(--red); }
.story-media-preview{ position:relative; }

/* ============ STORY VIEWER (lihat story) ============ */
.story-viewer{
  position:fixed; inset:0; z-index:130; background:#000; display:flex; flex-direction:column;
}
.story-viewer-bars{
  display:flex; gap:4px; padding: calc(10px + var(--safe-top)) 12px 0; flex-shrink:0;
}
.story-bar{ flex:1; height:3px; border-radius:3px; background:rgba(255,255,255,.3); overflow:hidden; }
.story-bar-fill{ width:0; height:100%; background: var(--white); }
.story-viewer-header{
  display:flex; align-items:center; gap:10px; padding:10px 12px; flex-shrink:0;
  /* harus di atas .story-viewer-nav (zona tap prev/next yang inset:0) supaya
     tombol hapus & tutup benar-benar bisa diklik, tidak "ketutupan" nav */
  position:relative; z-index:10;
}
.story-viewer-header .avatar{ width:36px; height:36px; font-size:13px; border-color: rgba(255,255,255,.6); }
.story-viewer-meta{ flex:1; min-width:0; }
.story-viewer-name{ color:var(--white); font-weight:800; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.story-viewer-time{ color:rgba(255,255,255,.65); font-size:11px; font-weight:600; }
.story-viewer-header .icon-btn{ background:rgba(255,255,255,.15); border-color:rgba(255,255,255,.4); color:var(--white); box-shadow:none; }
.story-viewer-header .icon-btn:hover{ background:rgba(255,255,255,.28); }
.story-viewer-content{
  flex:1; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; min-height:0;
  /* ruang di bawah untuk footer, sehingga media sedikit lebih ke atas dan tidak turun */
  padding: 8px 0 calc(110px + var(--safe-bottom));
}
/* foto & video story memenuhi lebar layar (kiri-kanan penuh), dipotong secukupnya di atas/bawah */
.story-viewer-content img, .story-viewer-content video{ width:100%; height:100%; max-width:none; max-height:none; object-fit:cover; display:block; }
.story-view-text{
  width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:32px;
  color:var(--white); font-size:26px; font-weight:800; text-align:center; line-height:1.35; overflow-y:auto;
}
.story-viewer-nav{ position:absolute; inset:0; display:flex; z-index:5; touch-action:manipulation; }
.story-nav-zone{ flex:1; touch-action:manipulation; -webkit-user-select:none; user-select:none; }
/* Caption diposisikan absolute (bukan in-flow lagi) supaya tidak bertumpuk dengan
   badge "X dilihat" yang juga absolute di bawah — caption diletakkan lebih ke atas,
   di luar area badge tersebut. */
.story-viewer-caption{
  position:absolute; left:16px; right:16px; z-index:6;
  bottom: calc(72px + var(--safe-bottom));
  color:var(--white); font-size:13.5px; font-weight:600; text-align:center;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  padding:0 4px;
}
.story-viewer-views{
  position:absolute; bottom: calc(14px + var(--safe-bottom)); left:50%; transform:translateX(-50%);
  color:var(--white); font-size:13px; font-weight:700; background:rgba(255,255,255,.18); padding:8px 16px; border-radius:22px;
  display:flex; align-items:center; gap:14px; z-index:10; border:1px solid rgba(255,255,255,.3); cursor:pointer; font-family:inherit;
}
.story-viewer-views.hidden{ display:none; }
.story-viewer-views:hover{ background:rgba(255,255,255,.28); }
.story-viewer-views .sv-stat{ display:flex; align-items:center; gap:5px; }
.story-viewer-views .fa-heart{ color:#ff5d7a; }
.story-viewer-views .sv-chevron{ font-size:10px; opacity:.7; }

/* ---- footer penonton: komentar + suka ---- */
.story-viewer-footer{
  position:absolute; left:0; right:0; bottom:0; z-index:10;
  display:flex; align-items:center; gap:8px; padding:10px 12px calc(10px + var(--safe-bottom));
  background:linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
}
.story-viewer-footer.hidden{ display:none; }
.story-viewer-footer input{
  flex:1; min-width:0; background:rgba(255,255,255,.14); border:1.5px solid rgba(255,255,255,.55); color:var(--white);
  border-radius:24px; padding:11px 16px; font-size:14px; font-family:inherit; outline:none;
}
.story-viewer-footer input::placeholder{ color:rgba(255,255,255,.7); }
.story-viewer-footer input:focus{ border-color:var(--white); background:rgba(255,255,255,.22); }
.story-footer-btn{
  width:42px; height:42px; flex-shrink:0; border-radius:50%; border:1.5px solid rgba(255,255,255,.55);
  background:rgba(255,255,255,.14); color:var(--white); font-size:18px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.story-footer-btn.hidden{ display:none; }
.story-footer-btn.send{ background:var(--yellow); color:var(--black); border-color:var(--black); font-size:15px; }
.story-footer-btn.like.liked{ color:#ff3b5c; border-color:#ff3b5c; background:rgba(255,59,92,.18); }
.story-footer-btn.like.pop i{ animation: storyHeartPop .35s ease; }
.story-footer-btn.comment{ font-size:17px; }
@keyframes storyHeartPop{ 0%{transform:scale(1)} 40%{transform:scale(1.5)} 100%{transform:scale(1)} }

/* floating comment bubbles on story (Instagram style) */
.story-comment-bubbles{
  position:absolute; left:10px; right:56px; bottom: calc(78px + var(--safe-bottom)); z-index:9;
  display:flex; flex-direction:column; justify-content:flex-end; gap:7px;
  pointer-events:none; max-height:38%; overflow:hidden;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
}
.story-cmt-bubble{
  display:flex; align-items:flex-end; gap:7px; max-width:100%;
  animation: storyBubbleIn .38s cubic-bezier(.2,.8,.2,1) both;
  pointer-events:auto; cursor:pointer;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
@keyframes storyBubbleIn{
  from{ opacity:0; transform:translateY(14px) scale(.94); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
.story-cmt-bubble .scb-avs{
  flex-shrink:0; display:flex; align-items:center;
}
.story-cmt-bubble .scb-avs .avatar{
  width:32px; height:32px; font-size:12px;
  border:2px solid rgba(255,255,255,.92);
  box-shadow:0 1px 3px rgba(0,0,0,.35);
}
.story-cmt-bubble .scb-body{
  background: rgba(0,0,0,.55);
  color:#fff;
  border-radius:18px;
  padding:8px 12px 9px;
  font-size:13.5px;
  font-weight:500;
  line-height:1.28;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.12);
  word-break:break-word;
  max-width: min(280px, 78vw);
}
.story-cmt-bubble .scb-meta{
  display:flex; align-items:baseline; gap:6px; flex-wrap:wrap;
  margin-bottom:2px;
}
.story-cmt-bubble .scb-name{
  font-size:12px; font-weight:700; color:rgba(255,255,255,.95);
  letter-spacing:.01em;
}
.story-cmt-bubble .scb-reply{
  font-size:11px; font-weight:500; color:rgba(255,255,255,.55);
}
.story-cmt-bubble .scb-reply b{ color:rgba(255,255,255,.75); font-weight:600; }
.story-cmt-bubble .scb-text{
  font-size:13.5px; font-weight:500; color:#fff;
  white-space:pre-wrap;
}
.story-cmt-bubble:active .scb-body{
  background: rgba(0,0,0,.68);
}

/* comments sheet (public) */
.story-comments-panel{ max-height:78%; min-height:48%; }
.story-comments-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 12px 10px; font-weight:800; font-size:15px; border-bottom:1.5px solid #eee;
}
.story-comments-header .icon-btn{ width:34px; height:34px; font-size:14px; }
.story-comments-list{ flex:1; overflow-y:auto; min-height:0; padding:4px 0 8px; }
.story-cmt-row{
  display:flex; gap:10px; padding:10px 14px; align-items:flex-start;
}
.story-cmt-row.is-reply{ padding-left:48px; }
.story-cmt-row .avatar{ width:36px; height:36px; font-size:13px; flex-shrink:0; }
.story-cmt-main{ flex:1; min-width:0; }
.story-cmt-top{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.story-cmt-uname{ font-weight:800; font-size:13.5px; }
.story-cmt-time{ font-size:11px; color:#999; font-weight:600; }
.story-cmt-text{ font-size:13.5px; margin-top:2px; word-break:break-word; white-space:pre-wrap; line-height:1.35; }
.story-cmt-reply-to{ font-size:12px; color:#888; margin-top:2px; font-weight:600; }
.story-cmt-actions{ display:flex; gap:14px; margin-top:6px; }
.story-cmt-actions button{
  background:none; border:none; color:#888; font-size:12px; font-weight:700;
  font-family:inherit; cursor:pointer; padding:0;
}
.story-cmt-actions button:hover{ color:var(--pink); }
.story-cmt-actions .cmt-del:hover{ color:var(--red); }
.story-comments-reply-bar{
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 14px; background:#f6f6f8; border-top:1px solid #eee;
  font-size:12.5px; color:#555; font-weight:600;
}
.story-comments-reply-bar.hidden{ display:none; }
.story-comments-reply-bar b{ color:var(--black); }
.story-comments-reply-bar button{
  background:none; border:none; color:#888; cursor:pointer; font-size:14px; padding:4px 6px;
}
.story-comments-composer{
  display:flex; align-items:center; gap:8px; padding:10px 12px calc(10px + var(--safe-bottom));
  border-top:1.5px solid #eee; background:var(--white);
}
.story-comments-composer input{
  flex:1; min-width:0; border:1.5px solid #ddd; border-radius:22px;
  padding:10px 14px; font-size:14px; font-family:inherit; outline:none; background:#fafafa;
}
.story-comments-composer input:focus{ border-color:var(--purple); background:#fff; }
.story-comments-composer .story-footer-btn.send{
  width:40px; height:40px; background:var(--purple); color:#fff; border-color:var(--black);
}

/* ---- bottom sheet aktivitas story (pemilik) ---- */
.story-sheet{ position:fixed; inset:0; z-index:140; display:flex; align-items:flex-end; }
.story-sheet.hidden{ display:none; }
.story-sheet-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.55); }
.story-sheet-panel{
  position:relative; width:100%; max-width:560px; margin:0 auto; max-height:72%; min-height:40%;
  background:var(--white); border:2.5px solid var(--black); border-bottom:none; border-radius:18px 18px 0 0;
  display:flex; flex-direction:column; padding-bottom:var(--safe-bottom);
}
.story-sheet-handle{ width:40px; height:4px; border-radius:4px; background:#ccc; margin:8px auto 4px; flex-shrink:0; }
.story-sheet-tabs{ display:flex; border-bottom:2px solid var(--black); flex-shrink:0; }
.story-sheet-tab{
  flex:1; padding:11px 4px; font-size:12.5px; font-weight:800; font-family:inherit; background:transparent; border:none;
  cursor:pointer; color:#777; border-bottom:3px solid transparent; margin-bottom:-2px;
}
.story-sheet-tab b{ margin-left:2px; }
.story-sheet-tab.active{ color:var(--black); border-bottom-color:var(--pink); background:var(--yellow); }
.story-sheet-body{ flex:1; overflow-y:auto; min-height:0; }
.story-sheet-empty{ text-align:center; color:#888; font-size:13px; padding:34px 16px; font-weight:600; }
.story-sheet-row{ display:flex; align-items:flex-start; gap:10px; padding:10px 14px; border-bottom:1px solid #eee; }
.story-sheet-row .avatar{ width:38px; height:38px; font-size:13px; flex-shrink:0; }
.story-sheet-info{ flex:1; min-width:0; }
.story-sheet-name{ font-weight:800; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.story-sheet-sub{ font-size:11.5px; color:#888; font-weight:600; }
.story-sheet-text{ font-size:13.5px; margin-top:3px; word-break:break-word; white-space:pre-wrap; }
.story-sheet-row .row-heart{ color:#ff3b5c; align-self:center; }
.story-sheet-row .row-del{ background:none; border:none; color:#aaa; cursor:pointer; font-size:14px; padding:6px; align-self:center; }
.story-sheet-row .row-del:hover{ color:var(--red); }
.story-delete-confirm{
  position:absolute; left:16px; right:16px; bottom: calc(20px + var(--safe-bottom)); z-index:10;
  background: var(--white); border:2.5px solid var(--black); border-radius:12px; box-shadow:4px 4px 0 var(--black);
  padding:12px 14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.story-delete-confirm span{ flex:1; font-size:13px; font-weight:700; min-width:120px; }
.story-delete-confirm .btn-secondary, .story-delete-confirm .btn-primary{ padding:7px 12px; font-size:12px; box-shadow:2px 2px 0 var(--black); }
.story-delete-confirm .btn-primary.danger{ background: var(--red); color:var(--white); }

/* ============ MODALS ============ */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,10,10,0.55);
  display:flex; align-items:center; justify-content:center; z-index:50; padding:16px;
}
.modal{
  display:none; width:100%; max-width:420px; border-radius:16px; padding:24px; flex-direction:column; gap:12px;
  max-height:85vh; max-height:85dvh; background: var(--white);
  /* isi lebih tinggi dari layar -> popup yang di-scroll, bukan isi yang menyusut / meluber keluar kotak */
  overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
.modal.show{ display:flex; }
.modal > *{ flex-shrink:0; }
.modal textarea.modal-search{ resize:vertical; min-height:72px; }
.modal h3{ font-size:18px; font-weight:900; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal h3 i{ font-size: 18px; line-height: 1; }
.modal-search{
  width:100%;
}
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }
/* ============ POPUP DARI TOMBOL "+" (Buat Baru & Tambah Story) ============
   Animasi buka/tutup dijalankan lewat JS (Web Animations API) supaya popup
   terlihat tumbuh dari posisi tombol "+" dan menyusut kembali ke sana. */
.fab-main i{ transition: transform .32s cubic-bezier(.34,1.56,.64,1); }
.fab-main.open i{ transform: rotate(135deg); }
.modal-overlay.fab-mode{ align-items:flex-end; justify-content:center; padding-bottom: calc(100px + var(--safe-bottom)); }
.modal-overlay.fab-mode .modal.fab-pop{ margin: 0 auto; max-width:360px; width: calc(100% - 24px); }
.fab-pop{ gap:14px; padding:20px; overflow:hidden; will-change:transform,opacity; }
.pop-head{ display:flex; align-items:center; gap:12px; }
.pop-head-icon{
  width:42px; height:42px; flex-shrink:0; border-radius:14px; display:flex; align-items:center; justify-content:center;
  font-size:17px; background: var(--accent); color: var(--white); border: 2.5px solid var(--black);
}
.pop-head-text h3{ margin:0; font-size:19px; line-height:1.15; }
.pop-head-text p{ margin:2px 0 0; font-size:12.5px; font-weight:600; opacity:.6; }
.pop-list{ display:flex; flex-direction:column; gap:9px; }
.pop-ico{
  width:42px; height:42px; flex-shrink:0; border-radius:13px; display:flex; align-items:center; justify-content:center;
  font-size:18px; color:#fff; background: var(--c, var(--accent)); border: 2.5px solid var(--black);
}
.pop-item{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left; padding:10px 12px;
  border-radius:14px; border:2.5px solid var(--black); background: var(--cream); color: inherit;
  box-shadow:3px 3px 0 var(--black); transition: transform .12s, box-shadow .12s, background .12s;
}
.pop-txt{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.pop-txt b{ font-size:14.5px; font-weight:800; }
.pop-txt small{ font-size:11.5px; font-weight:600; opacity:.6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pop-arrow{ font-size:12px; opacity:.45; transition: transform .15s, opacity .15s; }
.pop-item:hover{ background: color-mix(in srgb, var(--c) 22%, var(--cream)); }
.pop-item:hover .pop-arrow{ transform: translateX(3px); opacity:.9; }
.pop-item:active{ transform:translate(2px,2px); box-shadow:1px 1px 0 var(--black); }
.pop-cancel{
  align-self:stretch; padding:11px; border-radius:14px; font-weight:800; font-size:14px; color: inherit;
  background: transparent; border:2.5px dashed color-mix(in srgb, var(--black) 35%, transparent);
  transition: background .12s, transform .12s;
}
.pop-cancel:hover{ background: color-mix(in srgb, var(--black) 6%, transparent); }
.pop-cancel:active{ transform: scale(.97); }

.story-source-options{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.story-source-btn{
  display:flex; flex-direction:column; align-items:center; gap:8px; padding:12px 4px 10px;
  border-radius:14px; border:2.5px solid var(--black); background: var(--cream); color: inherit;
  font-weight:800; font-size:12.5px; box-shadow:3px 3px 0 var(--black);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.story-source-btn .pop-ico{ width:44px; height:44px; border-radius:50%; font-size:19px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.story-source-btn:hover{ background: color-mix(in srgb, var(--c) 22%, var(--cream)); }
.story-source-btn:hover .pop-ico{ transform: scale(1.12) rotate(-6deg); }
.story-source-btn:active{ transform:translate(2px,2px); box-shadow:1px 1px 0 var(--black); }

@media (prefers-reduced-motion: reduce){
  .fab-main i, .pop-arrow, .story-source-btn .pop-ico{ transition:none; }
}

.user-pick-list{ display:flex; flex-direction:column; gap:6px; overflow-y:auto; max-height:280px; }
.user-pick-item{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; cursor:pointer; transition:.1s;
  border: 2px solid transparent;
}
.user-pick-item:hover{ border-color: var(--black); background: var(--cream); }
.user-pick-item.selected{ background: var(--yellow); border-color: var(--black); box-shadow:2px 2px 0 var(--black); }
.user-pick-item .avatar{ width:36px; height:36px; font-size:14px; }
.user-pick-name{ font-size:13.5px; font-weight:700; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.muted{ color:#666; font-size:13px; font-weight:600; }

/* ============ CROP FOTO (avatar) ============ */
.crop-viewport{
  position:relative; width:260px; height:260px; margin:0 auto; border-radius:16px; overflow:hidden;
  background:#111; border:3px solid var(--black); box-shadow:4px 4px 0 var(--black); touch-action:none; cursor:grab;
}
.crop-viewport.dragging{ cursor:grabbing; }
.crop-viewport img{
  position:absolute; top:50%; left:50%; max-width:none; max-height:none; user-select:none; pointer-events:none;
  will-change:transform;
}
.crop-circle-guide{
  position:absolute; inset:0; pointer-events:none; border-radius:50%;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.45); border:2px dashed rgba(255,255,255,.85);
}
.crop-zoom-row{ display:flex; align-items:center; gap:10px; padding:0 4px; color:#666; }
.crop-zoom-row input[type="range"]{ flex:1; }

/* ============ CALL OVERLAY ============ */
.call-overlay{
  position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
  background: #0b141a; /* gelap mirip WhatsApp, bukan ungu/biru */
}
.call-bg{ position:absolute; inset:0; border-radius:0; border:none; box-shadow:none; background: #0b141a; }
.call-content{
  position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; gap:10px;
  width:100%; height:100%; justify-content:center; padding:20px; color: #fff;
}
.call-identity{
  display:flex; flex-direction:column; align-items:center; gap:10px; z-index:2;
  transition: opacity .25s ease, transform .25s ease;
}
.call-avatar{
  width:114px;height:114px;border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:42px; font-weight:900; color:var(--black);
  border: 4px solid var(--black); box-shadow: 5px 5px 0 var(--black);
}
.call-name{ font-size:23px; font-weight:900; }
.call-status{ font-size:14px; color:var(--yellow); font-weight:700; }
.remote-video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; border-radius:0; background:#000; }
.local-video{
  position:absolute; bottom:120px; right:20px; width:120px; height:160px; object-fit:cover; border-radius:12px;
  border:3px solid var(--black); box-shadow:4px 4px 0 var(--black); background:#000; z-index:3;
}
.local-video.camera-off{ opacity:0; }
/* Sebelumnya .call-controls cuma diberi margin-top di dalam .call-content yang
   justify-content:center. Selama panggilan suara itu cukup (identity + controls
   sama-sama ada di flow, jadi keduanya kebawa ke tengah bareng). TAPI begitu
   video-connected: elemen .call-identity dipindah jadi position:absolute (lihat
   bawah), sehingga .call-controls jadi satu-satunya elemen yang tersisa di flow
   flex-nya .call-content -> otomatis diseret ke tengah layar oleh justify-content:
   center, bukan menempel di bawah seperti tombol panggilan pada umumnya.
   Fix: lepaskan .call-controls dari flow, kunci posisinya sendiri di bawah,
   supaya tetap di bawah baik saat voice call maupun video call. */
.call-controls{
  display:flex; gap:14px; z-index:3;
  position:absolute; left:0; right:0; bottom: calc(36px + var(--safe-bottom, 0px));
  justify-content:center;
}

/* Saat video call sudah tersambung: lingkaran avatar disembunyikan, nama & timer
   pindah jadi bar kecil di atas supaya video remote terlihat penuh dan tombol
   kontrol tetap bisa dijangkau di bawah. */
.call-content.video-connected .call-avatar{ display:none; }
.call-content.video-connected .call-identity{
  position:absolute; top:0; left:0; right:0; flex-direction:row; justify-content:center; gap:8px;
  padding:14px 16px; pointer-events:none; z-index:5;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.call-content.video-connected .call-name{
  font-size:15px; font-weight:600; background:transparent; padding:0; border-radius:0;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.call-content.video-connected .call-status{
  font-size:13px; background:transparent; padding:0; border-radius:0; color:#b0bec5;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.call-btn{
  width:56px; height:56px; border-radius:50%; background: rgba(255,255,255,.15); display:flex; align-items:center;
  justify-content:center; font-size:21px; transition:.15s; border: none;
  color: #fff; cursor: pointer; backdrop-filter: blur(8px);
}
.call-btn i{ font-size: 21px; line-height: 1; }
.call-btn:hover{ background: rgba(255,255,255,.28); }
.call-btn:active{ transform: scale(.94); }
.call-btn.hangup{ background: #ea4335; color:#fff; }
.call-btn.hangup:hover{ background:#d93025; }
.call-btn.accept{ background: #25d366; }
.call-btn.muted{ background: #ea4335; color:#fff; }

.incoming-call{
  position:fixed; top:20px; right:20px; z-index:110; border-radius:14px; padding:14px 18px;
  display:flex; align-items:center; gap:14px; animation: slideIn .3s ease;
  background: var(--yellow);
}
@keyframes slideIn{ from{ transform:translateX(120%); } to{ transform:translateX(0); } }
.incoming-name{ font-weight:900; font-size:14px; }
.incoming-type{ font-size:12px; color:#333; font-weight:700; }
.incoming-actions{ display:flex; gap:8px; }
.incoming-actions .call-btn{ width:44px; height:44px; font-size:17px; }
.incoming-actions .call-btn i{ font-size: 17px; }

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:200;
  background: var(--black); color: var(--white); padding:12px 22px; border-radius:12px; font-size:13.5px;
  border: 3px solid var(--black); box-shadow: 4px 4px 0 var(--yellow); font-weight:700;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 860px){
  .info-panel{
    position:fixed; right:0; top:0; bottom:0; z-index:40; border-radius:0; width:85%; max-width:340px;
  }
}
/* Mode mobile ditentukan lewat class html.is-mobile (diatur JS di <head>, berdasarkan ukuran layar asli),
   bukan lebar viewport, supaya tidak "meloncat" ke tampilan desktop saat viewport WebView melebar sesaat. */
  html.is-mobile .app{ position:relative; overflow:hidden; }

  /* Di mobile: sembunyikan sidebar menu desktop, list-panel jadi panel utama */
  html.is-mobile .sidebar{
    display: none !important;
  }
  html.is-mobile .list-panel{
    position:absolute; inset:0; width:100%; min-width:0; border-radius:0; border-right:none;
    z-index:2; transition:transform .25s ease;
  }
  html.is-mobile .chat-area{ position:absolute; inset:0; z-index:3; transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
  html.is-mobile .chat-window{ display:flex; flex-direction:column; height:100%; width:100%; }
  html.is-mobile .chat-input-bar,
  html.is-mobile .recording-bar{ padding-bottom: calc(12px + var(--safe-bottom)); }
  html.is-mobile .app.show-chat .list-panel{ transform:translateX(-100%); }
  html.is-mobile .app.show-chat .chat-area{ transform:translateX(0); }
  html.is-mobile .only-mobile{ display:flex !important; }
  html.is-mobile .bubble{ max-width:82%; }
  html.is-mobile .msg-row.has-avatar .bubble{ max-width:calc(82% - 40px); }
  html.is-mobile .local-video{ width:90px; height:120px; bottom:110px; right:14px; }
  html.is-mobile .call-controls{ gap:10px; }
  html.is-mobile .call-btn{ width:48px; height:48px; font-size:18px; }
  html.is-mobile .call-btn i{ font-size:18px; }
  html.is-mobile .logo-badge{ transform:none; }

  /* Mobile: tampilkan search di bawah profile header */
  html.is-mobile .list-panel-header{
    display: flex !important;
    padding: 10px 12px 4px;
  }
  html.is-mobile .list-panel-header .list-panel-actions{
    display: none !important;
  }
  html.is-mobile .list-panel-header .search-box{
    flex: 1;
    padding: 0;
  }
  html.is-mobile .chat-filter-tabs{
    padding: 6px 16px 10px;
  }
  /* Sembunyikan FAB samping di mobile — pakai Create di bottom nav */
  html.is-mobile .fab-main{
    display: none !important;
  }
/* ============ SPLASH SCREEN ============
   Ditampilkan sebelum auth-screen, isinya diatur owner lewat bot Telegram
   (/splash). Foto: latar putih, foto di tengah, 2 detik. Video: full layar,
   mengikuti durasi videonya. Default (belum ada config): pakai warna latar
   app supaya tidak ada flash putih/hitam saat menunggu fetch config. */
.splash-screen{
  position:fixed; inset:0; z-index:999;
  display:flex; align-items:center; justify-content:center;
  background: var(--cream);
  transition: opacity .25s ease;
}
.splash-screen.hidden{ display:none !important; }
.splash-screen.fade-out{ opacity:0; pointer-events:none; }
.splash-screen.mode-photo{ background: var(--white); }
.splash-screen.mode-video{ background: #000; }
.splash-photo{ display:none; max-width:80%; max-height:80%; object-fit:contain; }
.splash-video{ display:none; position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.splash-screen.mode-photo .splash-photo{ display:block; }
.splash-screen.mode-video .splash-video{ display:block; }
.splash-mute-toggle{
  position:absolute; right:18px; bottom: calc(18px + var(--safe-bottom));
  z-index:2; width:46px; height:46px; border-radius:50%;
  background: rgba(10,10,10,0.55); color:#fff; font-size:18px;
  display:flex; align-items:center; justify-content:center;
  border:2px solid rgba(255,255,255,0.5);
}
.splash-mute-toggle.hidden{ display:none !important; }
.splash-skip{
  position:absolute; top: calc(14px + var(--safe-top, env(safe-area-inset-top, 0px))); right:16px;
  z-index:3; padding:8px 14px; border-radius:999px;
  background: rgba(10,10,10,0.55); color:#fff; font-size:13px; font-weight:700;
  display:flex; align-items:center; gap:6px;
  border:2px solid rgba(255,255,255,0.5);
  -webkit-tap-highlight-color: transparent; cursor:pointer;
}
.splash-skip:active{ transform:scale(.96); }
.splash-skip.hidden{ display:none !important; }

/* ============ ALBUM COMPOSER ============
   Muncul saat user pilih 1+ foto dari tombol lampiran - preview dulu,
   bisa nambah/hapus foto & isi keterangan, sebelum benar-benar dikirim. */
.album-composer{
  position:fixed; inset:0; z-index:140; background: var(--white);
  display:flex; flex-direction:column;
}
.album-composer.hidden{ display:none !important; }
.album-composer-header{
  display:flex; align-items:center; gap:10px; padding:14px 16px;
  border-bottom: var(--border-w) solid var(--black); flex-shrink:0;
  padding-top: calc(14px + var(--safe-top));
}
.album-composer-title{ font-weight:800; font-size:16px; }
.album-composer-count{ margin-left:auto; font-size:12px; font-weight:700; opacity:.65; }
.album-composer-thumbs{
  flex:1; overflow-y:auto; display:flex; flex-wrap:wrap; gap:10px;
  padding:16px; align-content:flex-start;
}
.album-thumb{
  position:relative; width:88px; height:88px; border-radius:12px; overflow:hidden;
  border: 2px solid var(--black); flex-shrink:0;
}
.album-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.album-thumb video{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; background:#000; }
.album-thumb .thumb-play{ position:absolute; left:6px; bottom:6px; color:#fff; font-size:12px; text-shadow:0 0 4px rgba(0,0,0,.8); }
.album-thumb.file{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  background: var(--cream); padding:6px; text-align:center;
}
.album-thumb.file i{ font-size:22px; }
.album-thumb.file span{
  font-size:10px; font-weight:700; line-height:1.15; max-width:100%; word-break:break-all;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.msg-attachments{ display:flex; flex-direction:column; gap:6px; }
.album-thumb-remove{
  position:absolute; top:3px; right:3px; width:22px; height:22px; border-radius:50%;
  background: rgba(10,10,10,.7); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:11px; border:1.5px solid rgba(255,255,255,.7);
}
.album-thumb-add{
  width:88px; height:88px; border-radius:12px; border:2px dashed var(--black);
  display:flex; align-items:center; justify-content:center; font-size:24px; color:var(--black);
  opacity:.55; background: var(--cream); flex-shrink:0;
}
.album-composer-footer{
  display:flex; align-items:center; gap:10px; padding:12px 14px; flex-shrink:0;
  border-top: var(--border-w) solid var(--black); padding-bottom: calc(12px + var(--safe-bottom));
}
.album-composer-footer input{
  flex:1; padding:12px 16px; border-radius:20px; border:2px solid var(--black);
  background: var(--cream); font-family:inherit; font-size:14px; font-weight:500; color:var(--black);
}
.album-composer-footer input:focus{ background:var(--white); }
.btn-send-album{
  width:46px; height:46px; border-radius:50%; background: var(--accent); color:#fff;
  border:2px solid var(--black); box-shadow:2px 2px 0 var(--black);
  display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0;
}
.btn-send-album:disabled{ opacity:.45; }

/* ============ IMAGE VIEWER (lightbox) ============
   Overlay in-app biasa (bukan tab/window baru) supaya menutupnya tidak
   memicu navigasi apapun - jadi kembali ke room chat, bukan reload app. */
.image-viewer{
  position:fixed; inset:0; z-index:150; background: rgba(10,10,10,.94);
  display:flex; align-items:center; justify-content:center;
}
.image-viewer.hidden{ display:none !important; }
.image-viewer-img{ max-width:92%; max-height:88%; object-fit:contain; border-radius:6px; }
.image-viewer-close{
  position:absolute; top: calc(16px + var(--safe-top)); right:16px; z-index:2;
  width:42px; height:42px; border-radius:50%; background: rgba(255,255,255,.15); color:#fff; font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.image-viewer-save{
  position:absolute; top: calc(16px + var(--safe-top)); right:66px; z-index:2;
  width:42px; height:42px; border-radius:50%; background: rgba(255,255,255,.15); color:#fff; font-size:16px;
  display:flex; align-items:center; justify-content:center; border:none; cursor:pointer;
}
.image-viewer-save:active, .image-viewer-close:active{ background: rgba(255,255,255,.28); }
.image-viewer-save.busy{ opacity:.55; pointer-events:none; }
.image-viewer-counter{
  position:absolute; top: calc(20px + var(--safe-top)); left:50%; transform:translateX(-50%);
  color:#fff; font-size:13px; font-weight:700; background:rgba(255,255,255,.15); padding:5px 12px; border-radius:14px;
}
.image-viewer-nav{
  position:absolute; top:50%; transform:translateY(-50%); z-index:2;
  width:44px; height:44px; border-radius:50%; background: rgba(255,255,255,.15); color:#fff; font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.image-viewer-nav.prev{ left:12px; }
.image-viewer-nav.next{ right:12px; }
.image-viewer-nav.hidden{ display:none !important; }


/* ============ TERUSKAN PESAN ============ */
.msg-forwarded{
  font-size:11px; font-weight:700; font-style:italic; opacity:.7; margin-bottom:3px;
  display:flex; align-items:center; gap:4px;
}
.forward-search{
  width:100%; padding:10px 14px; border-radius:16px; border:2px solid var(--black);
  background: var(--cream); font-family:inherit; font-size:14px; margin-bottom:10px; color:var(--black);
}
.forward-list{ max-height:45vh; overflow-y:auto; display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.forward-item{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border:2px solid var(--black);
  border-radius:12px; background: var(--white); cursor:pointer;
}
.forward-item.selected{ background: var(--yellow); }
.forward-item .avatar{ width:38px; height:38px; font-size:14px; flex-shrink:0; }
.forward-item-name{ flex:1; min-width:0; font-weight:700; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.forward-item-type{ font-size:10px; font-weight:700; opacity:.55; }
.forward-check{
  width:22px; height:22px; border-radius:50%; border:2px solid var(--black); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:11px; color:transparent; background:var(--white);
}
.forward-item.selected .forward-check{ background: var(--black); color:#fff; }

.pin-icon{ font-size:11px; color:#999; transform: rotate(35deg); flex-shrink:0; }
.chat-item-preview .msg-ticks{ margin-left:0; margin-right:2px; }
.chat-item-preview .fa-ban{ font-size:11px; opacity:.7; }

.settings-open-btn{ width:100%; margin-top:10px; display:flex; align-items:center; justify-content:center; gap:8px; }
.settings-overlay{ position:fixed; inset:0; z-index:9600; background: var(--cream); }
.settings-overlay iframe{ width:100%; height:100%; border:0; display:block; }
body[data-fs="small"] .bubble{ font-size:12.5px; }
body[data-fs="large"] .bubble{ font-size:16.5px; }

/* indikator status koneksi panggilan */
.call-debug{ position:absolute; top:calc(env(safe-area-inset-top,0px) + 10px); left:0; right:0; text-align:center; z-index:4; font-size:12px; font-weight:700; color:#fff; text-shadow:0 1px 3px #000; pointer-events:none; }


/* ============ UNDANGAN GRUP ============ */
.group-invite-banner{
  display:flex; align-items:center; gap:10px; width:calc(100% - 32px); margin:0 16px 10px;
  padding:10px 14px; font:inherit; font-weight:700; font-size:13.5px; text-align:left; cursor:pointer;
  background: var(--yellow); color: var(--black);
  border:3px solid var(--black); border-radius:12px; box-shadow:3px 3px 0 var(--black);
}
.group-invite-banner span{ flex:1; }
.group-invite-banner:active{ transform:translate(2px,2px); box-shadow:1px 1px 0 var(--black); }
.group-invite-item{ display:flex; align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid rgba(0,0,0,.1); }
.group-invite-item:last-child{ border-bottom:none; }
.group-invite-info{ flex:1; min-width:0; }
.group-invite-name{ font-weight:800; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.group-invite-from{ font-size:12px; opacity:.65; }
.group-invite-actions{ display:flex; gap:6px; }
.group-invite-actions button{ padding:6px 10px; font-size:12.5px; }

/* ============ MODE PILIH BANYAK (hapus / keluar dari banyak chat sekaligus) ============ */
.chat-swipe-wrap{ -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

.select-bar{
  display:flex; align-items:center; gap:8px; padding:8px 12px; margin:0 16px 10px;
  background: var(--yellow); border: 2.5px solid var(--black); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--black);
}
.select-bar.hidden{ display:none !important; }
.select-bar .select-count{ flex:1; font-size:13px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.select-all-btn, .select-delete-btn{
  padding:6px 10px; border-radius:10px; font-size:12px; font-weight:800; white-space:nowrap;
  border: 2px solid var(--black); background: var(--white); color: var(--black); cursor:pointer;
}
.select-delete-btn{ background: var(--red); color: var(--white); }
.select-delete-btn:disabled{ opacity:.45; cursor:not-allowed; }

.select-check{
  width:24px; height:24px; flex-shrink:0; border-radius:8px; border: 2.5px solid var(--black);
  background: var(--white); display:flex; align-items:center; justify-content:center;
  font-size:12px; color:transparent; transition:.1s;
}
.chat-item.selected{ background: rgba(155,93,229,.14); }
.chat-item.selected .select-check{ background: var(--purple); color: var(--white); }
.chat-list.select-mode .chat-item{ cursor:pointer; }

.bulk-leave-info{
  display:flex; gap:8px; align-items:flex-start; padding:10px 12px; margin:4px 0 12px;
  background: rgba(255,140,66,.12); border: 2px solid var(--orange); border-radius: 12px;
  font-size:12.5px; font-weight:600; line-height:1.45;
}
.bulk-leave-info.hidden{ display:none !important; }
.bulk-leave-info i{ color: var(--orange); margin-top:2px; }

/* ============ LINK DI DALAM PESAN ============ */
.bubble a.msg-link{
  color:#1a56db; text-decoration:underline; text-underline-offset:2px;
  word-break:break-all; overflow-wrap:anywhere; cursor:pointer; -webkit-tap-highlight-color:rgba(26,86,219,.2);
}
html[data-theme="dark"] .bubble a.msg-link{ color:#8ab4ff; }

/* ============ ROOM CHAT: KUNCI GESER KIRI-KANAN ============
   Di dalam room hanya scroll vertikal yang jalan. Isi chat (bubble, foto,
   link panjang) menyesuaikan lebar layar, tidak melebar keluar. */
.chat-area, .chat-window{ max-width:100%; min-width:0; overflow-x:clip; }
.chat-header{ touch-action:pan-y; }
.messages{
  overflow-x:hidden; overflow-y:auto; min-width:0;
  touch-action:pan-y; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
.msg-row{ min-width:0; max-width:100%; }
.bubble{ min-width:0; overflow-wrap:anywhere; word-break:break-word; touch-action:pan-y; }
.bubble img, .bubble video{ max-width:100%; }
.bubble img.msg-image{ max-width:min(190px,100%); }
.bubble audio{ max-width:min(220px,100%); }
.bubble .doc-chip{ max-width:min(230px,100%); }
.msg-video-name{ max-width:min(230px,100%); }
.msg-album{ max-width:100%; }
.bubble-reply{ overflow-wrap:anywhere; }
/* di HP: tombol hover disembunyikan (sebelumnya ikut memakan lebar & memicu geser samping),
   diganti tahan-lama pada bubble untuk buka menu reaksi */
html.is-mobile .msg-actions{ display:none; }
html.is-mobile .bubble{ -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

/* ============ REAKSI PESAN ============ */
.msg-reactions{ display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.react-chip{
  display:inline-flex; align-items:center; gap:3px; padding:1px 7px;
  font-size:clamp(12px,3.5vw,13px); line-height:1.5; font-family:inherit; cursor:pointer;
  background:var(--white); color:var(--black);
  border:2px solid var(--black); border-radius:999px;
}
.react-chip span{ font-size:11px; font-weight:800; }
.react-chip.mine{ background:var(--yellow); color:#0a0a0a; }
.msg-actions .act-react i{ font-size:14px; }

.msg-menu{
  position:fixed; z-index:300; max-width:calc(100vw - 16px); max-height:calc(100vh - 16px);
  overflow-y:auto; box-sizing:border-box;
  background:var(--white); color:var(--black);
  border:2px solid var(--black); border-radius:16px; box-shadow:3px 3px 0 var(--black);
  padding:6px; animation:msgMenuIn .12s ease;
}
@keyframes msgMenuIn{ from{ opacity:0; transform:scale(.92); } to{ opacity:1; transform:scale(1); } }
.msg-menu-emojis{
  display:flex; flex-wrap:wrap; justify-content:center; gap:2px;
  padding:2px 2px 6px; border-bottom:2px solid var(--black); margin-bottom:4px;
}
.msg-menu-emoji{
  width:clamp(30px,9vw,34px); height:clamp(30px,9vw,34px); font-size:clamp(18px,5.5vw,22px);
  line-height:1; border:0; border-radius:10px; flex:0 0 auto;
  background:transparent; cursor:pointer; transition:transform .1s;
}
.msg-menu-emoji:hover, .msg-menu-emoji:active{ transform:scale(1.25); }
.msg-menu-emoji.picked{ background:var(--yellow); }
.msg-menu-list button{
  display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px;
  background:none; border:0; border-radius:10px; cursor:pointer;
  font:inherit; font-weight:700; font-size:14px; color:inherit; text-align:left;
}
.msg-menu-list button i{ width:16px; text-align:center; }

@media (max-width: 360px){
  .msg-menu{ max-width:calc(100vw - 10px); padding:5px; }
  .msg-menu-emoji{ width:28px; height:28px; font-size:17px; }
  .msg-menu-list button{ padding:8px; font-size:13px; }
}
.msg-menu-list button:hover{ background:var(--yellow); color:#0a0a0a; }
.msg-menu-list button.danger{ color:#d62828; }

/* ============ XYZORA AI ============ */
.ai-screen{ position:fixed; top:0; left:0; right:0; height:var(--app-height, 100vh); z-index:120; background: var(--cream); display:flex; flex-direction:column; }
.ai-screen.hidden{ display:none; }
.ai-header{ flex-shrink:0; display:flex; align-items:center; gap:10px; padding:calc(10px + var(--safe-top)) 14px 10px; background: var(--white); border-bottom: var(--border-w-lg) solid var(--black); }
.ai-header-title{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.2; }
.ai-header-title strong{ font-size:16px; }
.ai-sub{ font-size:11.5px; font-weight:700; opacity:.65; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-messages{ flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px; -webkit-overflow-scrolling:touch; }
.ai-empty{ margin:auto; text-align:center; max-width:280px; font-weight:700; opacity:.7; }
.ai-empty i{ font-size:38px; color: var(--purple); margin-bottom:10px; display:block; }
.ai-msg{ max-width:86%; padding:10px 14px; border-radius:16px; border: var(--border-w) solid var(--black); font-size:14px; line-height:1.5; word-wrap:break-word; overflow-wrap:anywhere; }
.ai-msg.me{ align-self:flex-end; background: var(--bubble-me); color: var(--black); box-shadow:3px 3px 0 var(--black); }
.ai-msg.bot{ align-self:flex-start; min-width:0; max-width:94%; background: var(--white); color: var(--black); box-shadow:3px 3px 0 var(--black); }
.ai-msg.err{ align-self:flex-start; background: var(--red); color:#fff; }
.ai-msg code{ font-family: ui-monospace, Menlo, Consolas, monospace; font-size:12.5px; background:rgba(0,0,0,.08); padding:1px 5px; border-radius:5px; }
.ai-typing{ display:inline-flex; gap:4px; }
.ai-typing i{ width:7px; height:7px; border-radius:50%; background: var(--black); opacity:.35; animation: aiDot 1s infinite; }
.ai-typing i:nth-child(2){ animation-delay:.15s; } .ai-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes aiDot{ 0%,80%,100%{ opacity:.25; transform:translateY(0);} 40%{ opacity:1; transform:translateY(-3px);} }
.ai-input-bar{ flex-shrink:0; display:flex; align-items:flex-end; gap:8px; padding:10px 14px calc(10px + var(--safe-bottom)); background: var(--white); border-top: var(--border-w-lg) solid var(--black); }
.ai-input{ resize:none; max-height:120px; line-height:1.4; font-family:inherit; }

/* ---- blok kode Xyzora AI: gaya terminal macOS ---- */
.ai-code{ margin:8px 0; max-width:100%; min-width:0; border-radius:12px; overflow:hidden; background:#1e1e1e; border: var(--border-w) solid var(--black); box-shadow:3px 3px 0 var(--black); }
.ai-code-bar{ display:flex; align-items:center; gap:10px; padding:8px 10px; background:#323232; border-bottom:1px solid #000; }
.ai-dots{ display:flex; gap:6px; flex-shrink:0; }
.ai-dots i{ width:11px; height:11px; border-radius:50%; display:block; }
.ai-dots i:nth-child(1){ background:#ff5f57; } .ai-dots i:nth-child(2){ background:#febc2e; } .ai-dots i:nth-child(3){ background:#28c840; }
.ai-code-lang{ flex:1; min-width:0; text-align:center; color:#b8b8b8; font-size:11.5px; font-weight:700; font-family: ui-monospace, Menlo, Consolas, monospace; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-copy{ flex-shrink:0; display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border:1px solid #5a5a5a; border-radius:7px; background:#3d3d3d; color:#e8e8e8; font-size:11.5px; font-weight:700; cursor:pointer; font-family:inherit; }
.ai-copy:active{ background:#505050; }
.ai-copy.done{ color:#28c840; border-color:#28c840; }
.ai-msg .ai-code pre{ margin:0; padding:12px 14px; background:transparent; color:#e6e6e6; overflow-x:auto; -webkit-overflow-scrolling:touch; font-size:12.5px; line-height:1.55; white-space:pre; overflow-wrap:normal; word-break:normal; }
.ai-msg .ai-code pre code{ background:none; padding:0; color:inherit; font-size:inherit; white-space:pre; overflow-wrap:normal; }


/* ============ STIKER ============ */
.sticker-tray{
  flex-shrink:0; border-top: var(--border-w-lg) solid var(--black); background: var(--white);
  display:flex; flex-direction:column; height:min(290px, 42vh);
}
.sticker-tray.hidden{ display:none !important; }
.sticker-tray-head{ display:flex; align-items:center; gap:6px; padding:8px 12px 4px; }
.sticker-tray-title{ flex:1; font-weight:800; font-size:13px; display:flex; align-items:center; gap:6px; }
.sticker-grid{
  flex:1; overflow-y:auto; padding:8px 12px 12px; display:grid;
  grid-template-columns:repeat(auto-fill, minmax(72px, 1fr)); gap:10px; align-content:start;
}
.sticker-cell{
  position:relative; aspect-ratio:1/1; border-radius:12px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:4px; background:transparent; border:2px solid transparent;
}
.sticker-cell:hover{ background: var(--cream); border-color: var(--black); }
.sticker-cell img{ width:100%; height:100%; object-fit:contain; display:block; pointer-events:none; }
.sticker-cell.create{
  flex-direction:column; gap:4px; border:2px dashed var(--black); background: var(--cream);
  font-size:11px; font-weight:800; text-align:center; line-height:1.15;
}
.sticker-cell.create i{
  width:30px; height:30px; border-radius:50%; background: var(--black); color:var(--white);
  display:flex; align-items:center; justify-content:center; font-size:13px;
}
.sticker-del{
  position:absolute; top:-4px; right:-4px; width:22px; height:22px; border-radius:50%;
  background: var(--red); color:#fff; border:2px solid var(--black); font-size:10px;
  display:flex; align-items:center; justify-content:center; z-index:1;
}
.sticker-empty{ grid-column:1/-1; text-align:center; font-size:12.5px; font-weight:600; opacity:.65; padding:14px 8px; }

/* stiker di dalam chat: tanpa bubble, latar transparan */
.bubble.bubble-sticker,
html[data-theme] .bubble.bubble-sticker{
  background:transparent !important; border:none !important; box-shadow:none !important;
  backdrop-filter:none !important; -webkit-backdrop-filter:none !important; padding:2px 4px;
}
.bubble img.msg-sticker{ width:150px; height:150px; max-width:100%; object-fit:contain; display:block; cursor:pointer; }
.bubble.bubble-sticker .bubble-time{ display:inline-block; background:rgba(10,10,10,.55); color:#fff; padding:1px 8px; border-radius:10px; margin-top:2px; }
.bubble.bubble-sticker .msg-ticks{ color:#d0d0d0; filter:none; }
.bubble.bubble-sticker .msg-ticks.read{ color: var(--orange); }

/* ============ EDITOR STIKER ============ */
.sticker-maker{
  position:fixed; inset:0; z-index:145; background: var(--white);
  display:flex; flex-direction:column;
}
.sticker-maker.hidden{ display:none !important; }
.sm-header{
  display:flex; align-items:center; gap:6px; padding:12px 14px; flex-shrink:0;
  padding-top: calc(12px + var(--safe-top)); border-bottom: var(--border-w) solid var(--black);
}
.sm-title{ flex:1; font-weight:800; font-size:16px; }
.sm-stage{
  flex:1; min-height:0; position:relative; display:flex; align-items:center; justify-content:center;
  overflow:hidden; touch-action:none; padding:12px;
  background-color:#e9e9ee;
  background-image:
    linear-gradient(45deg,#cfcfd6 25%,transparent 25%,transparent 75%,#cfcfd6 75%),
    linear-gradient(45deg,#cfcfd6 25%,transparent 25%,transparent 75%,#cfcfd6 75%);
  background-size:20px 20px; background-position:0 0,10px 10px;
}
#sm-canvas{ max-width:100%; max-height:100%; display:block; touch-action:none; cursor:crosshair; }
.sm-brush{
  position:absolute; pointer-events:none; border-radius:50%; border:2px solid #fff;
  box-shadow:0 0 0 1.5px rgba(0,0,0,.7); transform:translate(-50%,-50%); z-index:2;
}
.sm-brush.hidden{ display:none; }
.sm-tools{ flex-shrink:0; padding:10px 14px 4px; border-top: var(--border-w) solid var(--black); display:flex; flex-direction:column; gap:8px; }
.sm-modes{ display:flex; gap:8px; }
.sm-mode{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:8px 4px; border-radius:12px;
  border:2px solid var(--black); background: var(--white); font-size:11px; font-weight:800; cursor:pointer; color:var(--black);
}
.sm-mode i{ font-size:16px; }
.sm-mode.active{ background: var(--yellow); box-shadow:2px 2px 0 var(--black); }
.sm-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.sm-row.hidden{ display:none; }
.sm-check{ display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700; cursor:pointer; }
.sm-slider{ flex:1; min-width:150px; display:flex; flex-direction:column; gap:2px; font-size:12px; font-weight:700; }
.sm-slider.hidden{ display:none; }
.sm-slider input{ width:100%; }
.sm-hint{ font-size:11.5px; font-weight:600; opacity:.7; line-height:1.3; }
.sm-footer{
  display:flex; gap:8px; padding:10px 14px; flex-shrink:0; padding-bottom: calc(10px + var(--safe-bottom));
}
.sm-footer button{ flex:1; padding:11px 8px; font-size:13px; white-space:nowrap; }
.sm-footer button:disabled{ opacity:.5; }
#sm-undo:disabled{ opacity:.35; }
#sticker-manage.active{ background: var(--yellow); border-radius:8px; }


/* ---------- LAPORAN (report) & PENANGGUHAN ---------- */
.report-open-btn{ color:var(--danger); width:100%; }
.report-count{ text-align:right; font-size:11px; font-weight:700; opacity:.6; margin:2px 2px 8px; }
.report-photo-preview{ position:relative; display:inline-block; margin-top:10px; border:var(--border-w) solid var(--black); border-radius:12px; overflow:hidden; background:var(--cream); }
.report-photo-preview img{ display:block; max-width:100%; max-height:180px; }
.report-photo-preview .icon-btn{ position:absolute; top:6px; right:6px; background:var(--white); border:var(--border-w) solid var(--black); }
.report-note{ font-size:11.5px; margin:10px 0 0; }
.suspended-tag{ display:inline-block; margin-left:6px; padding:1px 7px; border-radius:8px; font-size:10px; font-weight:800; background:var(--red); color:var(--white); vertical-align:middle; }
.member-actions .icon-btn.report{ color:var(--danger); }


/* ===== Mention @username / @semua di grup ===== */
.mention-popup{
  position:absolute; left:16px; right:16px; bottom:calc(100% - 4px); max-height:240px; overflow-y:auto;
  display:flex; flex-direction:column; gap:2px; padding:6px; z-index:6;
  background: var(--white); border: var(--border-w) solid var(--black);
  box-shadow: 4px 4px 0 var(--black); border-radius:12px;
}
.mention-popup.hidden{ display:none !important; }
.mention-item{ display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:8px; cursor:pointer; font-size:13.5px; font-weight:700; min-width:0; }
.mention-item > div:last-child{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mention-item.active, .mention-item:hover{ background: var(--yellow); }
.mention-item-sub{ font-size:11.5px; color:#666; font-weight:600; }
.mention-all-avatar{ background: var(--orange); color: var(--white); font-weight:800; display:flex; align-items:center; justify-content:center; }
.msg-mention{ color: var(--purple); font-weight:800; cursor:pointer; border-radius:4px; padding:0 2px; }
.msg-mention:hover{ text-decoration:underline; }
.msg-mention.mention-me{ background: rgba(255,140,66,.35); }
.msg-mention.mention-all{ cursor:default; pointer-events:none; text-decoration:none; color: var(--orange); }
html[data-theme="dark"] .msg-mention{ color:#c9a3ff; }
html[data-theme="dark"] .msg-mention.mention-all{ color:#ffb27a; }
.mention-badge{
  font-size:12px; font-weight:800; background: var(--orange); color: var(--white);
  border-radius:50%; width:22px; height:22px; display:flex; align-items:center;
  justify-content:center; flex-shrink:0; border:2px solid var(--black); margin-right:4px;
}

.system-bubble i.fa-lock{ font-size:11px; margin-right:4px; }
.bubble-locked{ display:flex; align-items:flex-start; gap:8px; font-style:italic; font-size:13.5px; opacity:.7; }
.bubble-locked i{ font-size:12px; margin-top:3px; }

.msg-menu-emoji{ display:inline-flex; align-items:center; justify-content:center; color:var(--black); }
.chat-item-preview .pv-ico{ font-size:11px; margin-right:3px; opacity:.75; }
.toast i{ margin-right:8px; }
#channel-readonly-note i{ margin-right:6px; }


/* ---- Kutipan reply: bisa diklik + efek kedip pesan asal ---- */
.bubble-reply[data-reply-id]{ cursor:pointer; }
.bubble-reply.missing{ opacity:.65; font-style:italic; }
.bubble-reply-text{ overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.msg-row.flash-highlight {
  animation: rowReplyFlash 2.1s ease-out;
  border-radius: 14px;
}
.msg-row.flash-highlight .bubble {
  animation: replyFlash 2.1s ease-out;
}
@keyframes rowReplyFlash {
  0%, 35% { background-color: rgba(255, 196, 0, 0.24); }
  100% { background-color: transparent; }
}
@keyframes replyFlash{
  0%,35%{
    box-shadow: 0 0 0 4px rgba(255,180,0,.9) !important;
    outline: 3px solid #f59e0b !important;
    outline-offset: 1px;
    filter: brightness(1.08);
    transform: scale(1.015);
  }
  100%{
    box-shadow: 0 0 0 0 rgba(255,180,0,0);
    outline: 0px solid transparent;
    filter: none;
    transform: scale(1);
  }
}

/* ---- Tombol Melayang Auto-Scroll ke Paling Bawah ala WhatsApp ---- */
.scroll-bottom-fab {
  position: absolute;
  right: 18px;
  bottom: 76px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white, #ffffff) !important;
  color: var(--black, #111111) !important;
  border: 2px solid var(--black, #111111) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22), 2px 2px 0 var(--black, #111111);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 28;
  padding: 0;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.scroll-bottom-fab.hidden {
  display: flex !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) scale(0.82) !important;
}
.scroll-bottom-fab:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.scroll-bottom-fab:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--yellow, #ffd23f) !important;
}
.scroll-bottom-fab:active {
  transform: translateY(1px) scale(0.94);
}
.scroll-bottom-fab i {
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
}
.scroll-bottom-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green, #22c55e) !important;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white, #ffffff) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.scroll-bottom-badge.hidden {
  display: none !important;
}
html.is-mobile .scroll-bottom-fab {
  right: 14px;
  width: 40px;
  height: 40px;
}

/* ---- Pemisah "N pesan belum dibaca" ---- */
.unread-divider .system-bubble{ background: var(--yellow); font-weight:800; }

/* ============ LIVE STORY (siaran langsung) ============ */
.story-ring.live{ background: linear-gradient(135deg, #ff2d55, #ff8c42); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(255,45,85,.55); } 50%{ box-shadow:0 0 0 7px rgba(255,45,85,0); } }
.live-tag{
  position:absolute; bottom:-5px; left:50%; transform:translateX(-50%); background:var(--red); color:#fff;
  font-size:9px; font-weight:900; letter-spacing:.5px; padding:1px 6px; border-radius:6px; border:2px solid #fff;
}

.live-screen{
  position:fixed; inset:0; z-index:150; background:#000; color:#fff; overflow:hidden;
  height:100vh; height:100dvh; display:flex; align-items:center; justify-content:center;
  -webkit-user-select:none; user-select:none;
}
.live-video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#000; }
.live-screen.is-landscape .live-video{ object-fit:contain; }
.live-video.mirror{ transform:scaleX(-1); }

.live-top{
  position:absolute; top:0; left:0; right:0; z-index:3; display:flex; align-items:center; gap:8px;
  padding:calc(10px + env(safe-area-inset-top,0px)) 12px 24px;
  background:linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
}
.live-spacer{ flex:1; }
.live-badge{
  background:var(--red); color:#fff; font-weight:900; font-size:12px; letter-spacing:.6px;
  padding:4px 10px; border-radius:8px; border:2px solid #fff;
}
.live-badge.sm{ font-size:9.5px; padding:1px 6px; border-width:1.5px; }
.live-badge.preview{ background:#555; }
.live-pill{
  background:rgba(0,0,0,.45); border-radius:999px; padding:4px 10px; font-size:12.5px; font-weight:700;
  display:inline-flex; align-items:center; gap:5px; backdrop-filter:blur(6px);
}
.live-icon-btn{
  width:42px; height:42px; border-radius:50%; border:2px solid rgba(255,255,255,.85); background:rgba(0,0,0,.45);
  color:#fff; font-size:16px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  cursor:pointer; backdrop-filter:blur(6px); touch-action:manipulation;
}
.live-icon-btn:active{ transform:scale(.92); }
.live-icon-btn.off{ background:var(--red); border-color:#fff; }
.live-side{
  position:absolute; right:12px; top:calc(70px + env(safe-area-inset-top,0px)); z-index:3;
  display:flex; flex-direction:column; gap:12px;
}
.live-ratio-wrap{ position:relative; }
.live-ratio-label{ font-size:11px; font-weight:900; letter-spacing:.2px; }
.live-ratio-pop{
  position:absolute; right:calc(100% + 10px); top:50%; transform:translateY(-50%); z-index:4;
  display:flex; flex-direction:column; gap:6px; padding:8px; border-radius:14px;
  background:rgba(0,0,0,.65); border:2px solid rgba(255,255,255,.85); backdrop-filter:blur(8px);
}
.live-ratio-pop.hidden{ display:none; }
.live-ratio-pop button{
  min-width:64px; padding:8px 12px; border-radius:10px; border:0; background:transparent; color:#fff;
  font-size:13px; font-weight:800; cursor:pointer; touch-action:manipulation;
}
.live-ratio-pop button.on{ background:#fff; color:#000; }
.live-avatar{ width:40px; height:40px; flex-shrink:0; border:2px solid #fff; box-shadow:none; }
.live-meta{ flex:1; min-width:0; }
.live-name{ font-weight:800; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 3px rgba(0,0,0,.6); }
.live-sub{ font-size:12px; display:flex; align-items:center; gap:4px; opacity:.95; }

.live-bottom{
  position:absolute; left:0; right:0; bottom:0; z-index:3;
  padding:24px 12px calc(12px + env(safe-area-inset-bottom,0px));
  background:linear-gradient(to top, rgba(0,0,0,.65), transparent);
  display:flex; flex-direction:column; gap:10px; align-items:stretch;
}
.live-go{ width:100%; font-size:16px; padding:14px; }
.live-input-row{ display:flex; gap:8px; align-items:center; }
.live-input-row input{
  flex:1; min-width:0; height:42px; border-radius:999px; border:2px solid rgba(255,255,255,.85);
  background:rgba(0,0,0,.45); color:#fff; padding:0 16px; font-size:14px; outline:none; backdrop-filter:blur(6px);
}
.live-input-row input::placeholder{ color:rgba(255,255,255,.7); }
.live-like-btn{ background:var(--pink); border-color:#fff; }

/* lapisan tap (paling bawah, di atas video) & lapisan hati mengambang */
.live-tap-layer{ position:absolute; inset:0; z-index:1; touch-action:none; }
.live-hearts-layer{ position:absolute; inset:0; z-index:2; pointer-events:none; overflow:hidden; }
#live-host-hearts{ pointer-events:none; z-index:2; overflow:hidden; }
.live-heart{
  position:absolute; pointer-events:none; transform:translate(-50%,-50%); opacity:0;
  animation:liveHeartFloat 1.7s ease-out forwards; text-shadow:0 2px 6px rgba(0,0,0,.35);
}
@keyframes liveHeartFloat{
  0%{ opacity:0; transform:translate(-50%,-50%) scale(.3) rotate(0); }
  12%{ opacity:1; transform:translate(-50%,-70%) scale(1.15) rotate(var(--rot,0deg)); }
  100%{ opacity:0; transform:translate(calc(-50% + var(--dx,0px)), -320px) scale(.9) rotate(var(--rot,0deg)); }
}

.live-comments{
  position:absolute; left:12px; right:76px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); z-index:3;
  max-height:32%; overflow:hidden; display:flex; flex-direction:column; justify-content:flex-end; gap:6px;
  pointer-events:none;
  -webkit-mask-image:linear-gradient(to bottom, transparent, #000 35%); mask-image:linear-gradient(to bottom, transparent, #000 35%);
}
.live-comment{
  align-self:flex-start; max-width:100%; background:rgba(0,0,0,.42); border-radius:14px; padding:5px 11px;
  font-size:13.5px; line-height:1.3; word-break:break-word; backdrop-filter:blur(4px);
}
.live-comment b{ margin-right:5px; color:var(--yellow); }
.live-status{
  position:absolute; left:50%; top:45%; transform:translate(-50%,-50%); z-index:3; background:rgba(0,0,0,.65);
  padding:10px 18px; border-radius:12px; font-weight:700; text-align:center; max-width:80%;
}
.live-confirm{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:5; background:#fff; color:#000;
  border:3px solid #000; border-radius:14px; padding:16px; display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  justify-content:center; box-shadow:5px 5px 0 #000; font-weight:800; max-width:86%;
}
.live-confirm span{ width:100%; text-align:center; }
.live-status{ pointer-events:none; }

/* bordir merah: pemilik avatar sedang live (ketuk = tonton) */
.avatar.is-live{
  position:relative; cursor:pointer; border-color:var(--red);
  box-shadow:0 0 0 2px #fff, 0 0 0 4.5px var(--red);
  animation:liveAvatarPulse 1.6s ease-in-out infinite;
}
.avatar.is-live::after{
  content:'LIVE'; position:absolute; left:50%; bottom:-9px; transform:translateX(-50%);
  background:var(--red); color:#fff; font-size:8px; font-weight:900; letter-spacing:.4px; line-height:1;
  padding:2px 5px; border-radius:6px; border:1.5px solid #fff; pointer-events:none; white-space:nowrap;
}
.avatar.msg-avatar.is-live::after{ display:none; } /* bubble grup terlalu kecil untuk label */
@keyframes liveAvatarPulse{
  0%,100%{ box-shadow:0 0 0 2px #fff, 0 0 0 4.5px var(--red), 0 0 0 4.5px rgba(255,69,69,.55); }
  50%{ box-shadow:0 0 0 2px #fff, 0 0 0 4.5px var(--red), 0 0 0 9px rgba(255,69,69,0); }
}

/* ---- kerangka media saat gambar/video terenkripsi masih diunduh ---- */
.media-skeleton {
  width: min(240px, 60vw);
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(128,128,128,.14) 25%, rgba(128,128,128,.26) 50%, rgba(128,128,128,.14) 75%);
  background-size: 200% 100%;
  animation: media-skeleton-shimmer 1.2s linear infinite;
}
@keyframes media-skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .media-skeleton { animation: none; } }

/* ==========================================================================
   PLAY MUSIC - disk melayang + panel pencarian (js/music.js)
   ========================================================================== */
.xzm-root.xzm-off{ display:none !important; }
.xzm-fab{
  position:fixed; z-index:9500; display:flex; align-items:center; gap:0;
  height:46px; min-width:46px; max-width:min(170px, calc(100vw - 16px));
  background: var(--white); border:var(--border-w) solid var(--black); border-radius:999px;
  box-shadow:3px 3px 0 var(--black); cursor:grab; user-select:none; -webkit-user-select:none;
  touch-action:none; -webkit-tap-highlight-color:transparent;
  transition: box-shadow .15s, transform .15s, gap .2s;
}
.xzm-fab:active{ box-shadow:2px 2px 0 var(--black); transform:translate(2px,2px); }
.xzm-fab.dragging{ cursor:grabbing; transform:scale(1.06); box-shadow:7px 7px 0 var(--black); transition:none; }
.xzm-fab:focus-visible{ outline:3px solid var(--accent2); outline-offset:3px; }
.xzm-fab-text{ display:none; flex-direction:column; justify-content:center; gap:3px; min-width:0; padding:0 11px 0 7px; }
.xzm-has-track .xzm-fab, .xzm-busy .xzm-fab{ gap:0; }
.xzm-has-track .xzm-fab-text, .xzm-busy .xzm-fab-text{ display:flex; }
.xzm-fab-title{ font-size:11px; font-weight:800; }
.xzm-eq-mini{ width:56px; height:16px; display:block; }

/* teks berjalan */
.xzm-marquee{ overflow:hidden; white-space:nowrap; max-width:96px; }
.xzm-marquee-big{ max-width:100%; }
.xzm-marquee > span{ display:inline-block; }
.xzm-marquee > span.scroll{ animation: xzm-marq var(--xzm-dur,8s) linear infinite alternate; }
@keyframes xzm-marq{ 0%,12%{ transform:translateX(0); } 88%,100%{ transform:translateX(var(--xzm-shift,0)); } }

/* piringan hitam */
.xzm-vinyl{
  position:relative; flex:none; border-radius:50%; border:var(--border-w) solid var(--black);
  background:
    radial-gradient(circle, transparent 0 46%, rgba(255,255,255,.10) 47%, transparent 49%, rgba(255,255,255,.07) 58%, transparent 60%, rgba(255,255,255,.08) 72%, transparent 74%),
    conic-gradient(from 20deg, #1b1b1b, #3a3a3a 18%, #161616 34%, #3a3a3a 52%, #161616 70%, #3a3a3a 86%, #1b1b1b);
  display:flex; align-items:center; justify-content:center;
}
.xzm-vinyl.xzm-mini{ width:38px; height:38px; margin:0; }
.xzm-vinyl.xzm-big{ width:50px; height:50px; box-shadow:2px 2px 0 var(--black); }
.xzm-label{
  position:relative; width:52%; height:52%; border-radius:50%; overflow:hidden;
  background: var(--accent2); border:2px solid var(--black);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px;
}
.xzm-vinyl.xzm-big .xzm-label{ font-size:12px; }
.xzm-label::after{ content:''; position:absolute; left:50%; top:50%; width:16%; height:16%; transform:translate(-50%,-50%); border-radius:50%; background:var(--cream); border:1.5px solid var(--black); }
.xzm-art{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.xzm-note{ position:relative; z-index:0; }
.xzm-vinyl.spin{ animation: xzm-spin 2.6s linear infinite; }
.xzm-vinyl.spin.fast{ animation-duration: .9s; }
@keyframes xzm-spin{ to{ transform:rotate(360deg); } }
.xzm-playing .xzm-fab{ background: color-mix(in srgb, var(--accent) 12%, var(--white)); }
.xzm-busy .xzm-fab{ animation: xzm-pulse 1s ease-in-out infinite; }
@keyframes xzm-pulse{ 50%{ box-shadow:4px 4px 0 var(--accent2), 0 0 0 5px color-mix(in srgb, var(--accent2) 35%, transparent); } }

/* panel */
.xzm-panel{
  position:fixed; z-index:9501; padding:10px; display:flex; flex-direction:column; gap:7px;
  background: var(--cream); border:var(--border-w-lg) solid var(--black); border-radius:var(--radius);
  box-shadow:var(--shadow-off) var(--shadow-off) 0 var(--black); color:var(--black);
}
.xzm-head{ display:flex; align-items:center; justify-content:space-between; font-size:13px; }
.xzm-head b{ display:flex; align-items:center; gap:8px; font-weight:900; }
.xzm-head b i{ color:var(--accent); }
.xzm-x{
  width:32px; height:32px; border-radius:50%; background:var(--white); border:2.5px solid var(--black);
  box-shadow:2px 2px 0 var(--black); display:flex; align-items:center; justify-content:center; font-size:14px;
}
.xzm-x:active{ transform:translate(2px,2px); box-shadow:none; }
.xzm-search{ display:flex; gap:8px; }
.xzm-search input{
  flex:1; min-width:0; padding:10px 12px; font-size:14px; font-weight:700; color:var(--black);
  background:var(--white); border:2.5px solid var(--black); border-radius:var(--radius-sm); outline:none;
}
.xzm-search input:focus{ box-shadow:3px 3px 0 var(--accent); }
.xzm-search button{
  width:44px; flex:none; border-radius:var(--radius-sm); background:var(--yellow); color:var(--black);
  border:2.5px solid var(--black); box-shadow:3px 3px 0 var(--black); font-size:15px;
}
.xzm-search button:active{ transform:translate(2px,2px); box-shadow:1px 1px 0 var(--black); }
.xzm-search button:disabled{ opacity:.55; }
.xzm-stage{ display:flex; align-items:center; gap:10px; padding:0 2px; }
.xzm-info{ flex:1; min-width:0; }
.xzm-info .xzm-marquee > span{ font-size:12.5px; font-weight:900; line-height:1.3; }
.xzm-sub{ margin-top:2px; font-size:10.5px; font-weight:700; opacity:.65; }
.xzm-marquee > span.dots::after{ content:''; display:inline-block; width:1.2em; text-align:left; animation: xzm-dots 1.2s steps(4,end) infinite; }
@keyframes xzm-dots{ 0%{content:'';} 25%{content:'.';} 50%{content:'..';} 75%{content:'...';} }
.xzm-eq{
  width:100%; height:26px; display:block; padding:3px; background:var(--white);
  border:2.5px solid var(--black); border-radius:var(--radius-sm);
}
.xzm-seek{ display:flex; align-items:center; gap:6px; font-size:10.5px; font-weight:800; font-variant-numeric:tabular-nums; }
.xzm-seek input[type=range]{ flex:1; min-width:0; height:16px; accent-color:var(--accent); cursor:pointer; }
.xzm-ctrl{ display:flex; align-items:center; justify-content:center; gap:10px; }
.xzm-cbtn{
  width:32px; height:32px; border-radius:50%; background:var(--white); border:2.5px solid var(--black);
  box-shadow:2px 2px 0 var(--black); font-size:12px; display:flex; align-items:center; justify-content:center;
}
.xzm-cbtn:active:not(:disabled){ transform:translate(2px,2px); box-shadow:1px 1px 0 var(--black); }
.xzm-cbtn:disabled{ opacity:.4; box-shadow:none; }
.xzm-cbtn.on{ background:var(--accent); color:#fff; }
.xzm-cbtn-main{ width:40px; height:40px; font-size:15px; background:var(--accent2); color:#fff; }
.xzm-msg{ min-height:0; font-size:11px; font-weight:800; text-align:center; }
.xzm-msg:empty{ display:none; }
.xzm-msg.err{ color:#fff; background:var(--red); border:2.5px solid var(--black); border-radius:var(--radius-sm); padding:7px 10px; }
/* kolom cari dibuat ramping */
.xzm-search{ gap:6px; }
.xzm-search input{ min-width:0; padding:6px 9px !important; font-size:13px !important; }
.xzm-search button{ width:34px !important; height:auto !important; min-height:0 !important; font-size:13px !important; }
@media (prefers-reduced-motion: reduce){
  .xzm-vinyl.spin, .xzm-busy .xzm-fab, .xzm-marquee > span.scroll{ animation:none !important; }
}

/* ========== Xyzora Pro modal ========== */
#modal-pro-upgrade.pro-modal{
  display:none; /* tampil hanya lewat .show (jangan display:flex langsung: menimpa .modal{display:none}) */
  flex-direction:column;
  gap:0;
  width:min(100%, 380px);
  max-height:min(92vh, 92dvh, 700px);
  padding:0;
  overflow:hidden;
  animation: proModalIn .22s ease-out;
}
#modal-pro-upgrade.pro-modal.show{ display:flex; }
@keyframes proModalIn{
  from{ opacity:0; transform:translateY(12px); }
  to{ opacity:1; transform:none; }
}
#modal-pro-upgrade *{ min-width:0; }
.pro-modal-scroll{
  flex:1 1 auto; min-height:0;
  overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding:20px 20px 14px;
  scrollbar-width:none;
}
.pro-modal-scroll::-webkit-scrollbar{ display:none; }

/* kepala: logo X (sama seperti sidebar desktop) + judul + tag PRO */
.pro-head{ display:flex; align-items:center; gap:14px; margin-bottom:16px; }
.pro-logo{
  flex:0 0 auto;
  width:48px; height:48px; border-radius:12px;
  background:var(--purple); color:#fff;
  border:var(--border-w) solid var(--black);
  box-shadow:3px 3px 0 var(--black);
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:22px; line-height:1;
}
.pro-head-text{ flex:1 1 auto; }
#modal-pro-upgrade .pro-title{
  margin:0; font-size:22px; font-weight:900; letter-spacing:-.3px; line-height:1.1;
  display:flex; align-items:center; gap:8px;
}
.pro-tag{
  display:inline-block;
  padding:2px 7px 1px; border-radius:6px;
  background:var(--yellow); color:var(--black);
  border:2px solid var(--black);
  font-size:11px; font-weight:900; letter-spacing:.6px; text-transform:uppercase;
}
.pro-head-text .muted{ margin:5px 0 0; font-size:13px; line-height:1.35; }

/* manfaat: daftar biasa, bukan kapsul */
.pro-benefits{ list-style:none; margin:0 0 18px; padding:0; }
.pro-benefits li{
  display:flex; align-items:flex-start; gap:10px;
  padding:9px 0;
  font-size:13.5px; font-weight:700; line-height:1.35;
  border-top:2px solid color-mix(in srgb, var(--black) 10%, transparent);
  overflow-wrap:anywhere;
}
.pro-benefits li:first-child{ border-top:0; padding-top:2px; }
.pro-benefits li i{
  flex:0 0 auto; width:18px; height:18px; margin-top:1px;
  border-radius:5px; background:var(--green); color:var(--black);
  border:2px solid var(--black);
  display:flex; align-items:center; justify-content:center;
  font-size:9px;
}

.pro-section-label{
  font-size:11px; font-weight:900; letter-spacing:.08em;
  text-transform:uppercase; margin:0 0 8px; opacity:.6;
}

/* paket */
.pro-plans{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0 4px 18px 0; }
.pro-plan-card{
  position:relative;
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  padding:14px 12px 12px;
  background:var(--white); color:var(--black);
  border:var(--border-w) solid var(--black); border-radius:12px;
  text-align:left; font:inherit; cursor:pointer;
  box-shadow:0 0 0 var(--black);
  transition:transform .1s, box-shadow .1s, background .1s;
}
.pro-plan-card.active{
  background:var(--yellow);
  transform:translate(-2px,-2px);
  box-shadow:4px 4px 0 var(--black);
}
.pro-plan-card .pro-plan-name{ font-weight:800; font-size:13px; }
.pro-plan-card .pro-plan-price{ font-weight:900; font-size:19px; letter-spacing:-.3px; margin-top:2px; }
.pro-plan-card .pro-plan-sub{ font-size:11.5px; font-weight:700; opacity:.65; }
.pro-plan-card .pro-plan-badge{
  position:absolute; top:-11px; right:8px;
  background:var(--pink); color:var(--black);
  border:2px solid var(--black); border-radius:6px;
  font-size:10px; font-weight:900; padding:1px 6px; white-space:nowrap;
}

/* metode bayar */
.pro-pay-type{
  display:flex; gap:4px; padding:4px; margin-bottom:10px;
  background:var(--cream);
  border:var(--border-w) solid var(--black); border-radius:12px;
}
.pro-chip{
  flex:1; display:flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 6px; border-radius:8px;
  border:2px solid transparent; background:transparent;
  font-weight:800; font-size:13px; color:#555; cursor:pointer; white-space:nowrap;
}
.pro-chip.active{ background:var(--blue); color:var(--black); border-color:var(--black); }
.pro-methods{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 6px; }
.pro-methods:empty{ display:none; }
.pro-method-btn{
  padding:7px 11px; border-radius:8px;
  border:2px solid var(--black); background:var(--white); color:var(--black);
  font-size:12.5px; font-weight:800; cursor:pointer;
}
.pro-method-btn.active{ background:var(--yellow); }

/* panel QR / VA */
.pro-pay-panel{
  margin-top:12px; padding:14px;
  background:var(--cream);
  border:var(--border-w) solid var(--black); border-radius:12px;
  text-align:center; overflow:hidden;
}
.pro-pay-hint{ margin:0 0 8px; font-size:12px; font-weight:700; }
.pro-qr-box{
  display:inline-block; padding:8px; line-height:0; max-width:100%;
  background:#fff; border:2px solid var(--black); border-radius:10px;
}
.pro-qr-box img, .pro-qr-box canvas{ max-width:100% !important; height:auto !important; }
.pro-va-number{
  font-size:18px; font-weight:900; letter-spacing:.5px;
  overflow-wrap:anywhere; word-break:break-all; margin:6px 0;
}
.pro-pay-amount{ margin-top:8px; font-size:15px; font-weight:900; }
.pro-pay-status{ margin:10px 0 0; font-size:12.5px; font-weight:800; opacity:.7; }

/* footer tombol: ruang ekstra di kanan/bawah supaya bayangan tidak keluar kotak */
.pro-modal-footer{
  flex:0 0 auto;
  padding:14px 24px calc(16px + env(safe-area-inset-bottom, 0px)) 20px;
  border-top:var(--border-w) solid var(--black);
  display:flex; flex-direction:column; gap:10px;
  background:var(--white);
}
.pro-modal-footer .btn-primary,
.pro-modal-footer .btn-secondary{
  width:100%; margin:0; min-height:48px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.pro-modal-footer .pro-btn-later{
  min-height:36px; padding:6px;
  background:transparent; border:0; box-shadow:none;
  font-size:13px; font-weight:800; color:var(--black); opacity:.65;
  text-decoration:underline; text-underline-offset:3px;
}
.pro-modal-footer .pro-btn-later:hover{ background:transparent; opacity:1; }
.pro-modal-footer .pro-btn-later:active{ transform:none; box-shadow:none; }
@media (prefers-reduced-motion: reduce){
  #modal-pro-upgrade.pro-modal{ animation:none; }
  .pro-plan-card{ transition:none; }
}


/* ============ FORMAT TEKS PESAN ============ */
.msg-text b{ font-weight:800; }
.msg-text s{ opacity:.8; }
.msg-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.9em;
  background: rgba(0,0,0,.09); border-radius:5px; padding:1px 5px; white-space:pre-wrap; overflow-wrap:anywhere;
}
.msg-pre{
  margin:4px 0; padding:8px 10px; border-radius:10px; background: rgba(0,0,0,.09);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.88em; line-height:1.45;
  white-space:pre; overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch;
}
.msg-pre code{ font:inherit; background:none; padding:0; }
.msg-quote{
  margin:4px 0; padding:4px 10px; border-left:4px solid var(--purple, #8b5cf6);
  background: rgba(0,0,0,.06); border-radius:0 8px 8px 0; white-space:pre-wrap; overflow-wrap:anywhere;
}
.msg-li{ display:flex; gap:6px; margin:1px 0; }
.msg-li-mark{ flex-shrink:0; min-width:1.1em; text-align:right; font-weight:800; }
.msg-li-body{ min-width:0; white-space:pre-wrap; overflow-wrap:anywhere; }
html[data-theme="dark"] .msg-code,
html[data-theme="dark"] .msg-pre{ background: rgba(255,255,255,.12); }
html[data-theme="dark"] .msg-quote{ background: rgba(255,255,255,.08); }


/* ============ BATAS 1 AKUN PER PERANGKAT ============ */
.auth-form.device-blocked > *:not(.device-gate){ display:none !important; }
.device-gate{ display:flex; flex-direction:column; gap:10px; }
.device-gate.hidden{ display:none; }
.device-gate-note{
  width:100%; resize:vertical; min-height:56px; padding:12px 14px; border-radius:10px; border: var(--border-w) solid var(--black);
  background: var(--white); color: var(--black); font-size:14px; font-weight:600; font-family:inherit; outline:none;
}
.device-gate-note.hidden, #btn-device-request.hidden{ display:none; }

/* Uji coba Xyzora Pro 24 jam */
.pro-modal-footer .pro-trial-info{
  margin:0; font-size:12.5px; font-weight:800; text-align:center; line-height:1.4;
}
.pro-modal-footer .pro-btn-trial{ font-weight:900; }

/* progres upload story di lingkaran profil */
.story-ring{ position:relative; }
.story-upload-ring{ position:absolute; left:-5px; top:-5px; width:calc(100% + 10px); height:calc(100% + 10px); pointer-events:none; z-index:4; }
.story-upload-ring circle{ fill:none; stroke-width:2.8; }
.story-upload-ring .bg{ stroke:rgba(0,0,0,.15); }
.story-upload-ring .fg{ stroke:#2f6bff; stroke-linecap:round; transform:rotate(-90deg); transform-origin:50% 50%; transition:stroke-dasharray .25s linear; }

/* skeleton loading saat pertama dibuka */
.skel{ background:linear-gradient(90deg,#e4edf8 25%,#f6f9ff 37%,#e4edf8 63%); background-size:400% 100%; animation:skel-shimmer 1.3s ease infinite; border-radius:8px; }
@keyframes skel-shimmer { 0% { background-position:100% 50%; } 100% { background-position:0 50%; } }
.skel-row{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid rgba(11,42,111,.08); }
.skel-avatar{ width:52px; height:52px; border-radius:50%; flex:0 0 52px; }
.skel-lines{ flex:1; display:flex; flex-direction:column; gap:9px; }
.skel-line{ height:12px; }
.skel-story{ display:flex; flex-direction:column; align-items:center; gap:6px; min-width:68px; }
.skel-story .skel-avatar{ width:60px; height:60px; flex-basis:60px; }
.skel-story .skel-line{ width:48px; height:9px; }
@media (prefers-reduced-motion: reduce) { .skel { animation:none; } }

/* blokir & laporkan dipindah ke menu titik tiga di header chat */
#info-block-wrap, #info-report-wrap { display:none !important; }

.chat-more-menu{
  position:fixed; z-index:9000; min-width:210px; background:#fff; color:var(--black, #111);
  border:3px solid var(--black, #111); border-radius:14px; box-shadow:4px 4px 0 var(--black, #111);
  padding:6px; display:flex; flex-direction:column; gap:4px;
  animation: chat-more-in .12s ease-out;
}
@keyframes chat-more-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
.chat-more-item{
  display:flex; align-items:center; gap:10px; width:100%; padding:10px 12px; border:0; background:none;
  border-radius:10px; font-size:14px; font-weight:700; color:var(--black, #111); cursor:pointer; text-align:left;
}
.chat-more-item:hover{ background:#f0f6ff; }
.chat-more-item:active{ transform:translate(1px,1px); }
.chat-more-item i{ width:18px; text-align:center; }
.chat-more-item.danger{ color:var(--danger, #e5484d); }
.chat-more-note{ padding:10px 12px; font-size:12.5px; color:#555; line-height:1.4; }

/* header chat ala WhatsApp: telepon + panah (suara/video), info dipindah ke klik header */
#btn-voice-call, #btn-video-call, #btn-chat-info { display:none !important; }
.call-menu-btn{ display:flex; align-items:center; justify-content:center; gap:3px; }
.call-menu-btn .call-caret{ font-size:10px; }

/* ===== Full layar: konten naik sampai atas, header yang memberi jarak status bar ===== */
.chat-header{ padding-top: calc(12px + var(--safe-top)); }
.info-header{ padding-top: calc(14px + var(--safe-top)); }
.list-panel-header{ padding-top: calc(14px + var(--safe-top)); }
.mobile-list-header{ padding-top: calc(14px + var(--safe-top)); }
.sidebar-header{ padding-top: calc(16px + var(--safe-top)); }


/* ============ SEKALI LIHAT (view once) ============ */
.once-toggle{
  width:30px; height:30px; border-radius:50%; flex-shrink:0; padding:0; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; color:inherit; border:2px solid currentColor;
  font-weight:800; font-size:14px; line-height:1;
}
.once-toggle.active{ background:var(--white); color:var(--red); border-color:var(--white); }
.recording-bar .once-toggle{ color:var(--white); }
.album-composer-header .once-toggle{ color:var(--black); }

.vo-row{ display:flex; align-items:center; gap:10px; min-width:200px; padding:2px 0; }
.vo-row b{ display:block; font-weight:800; }
.vo-row small{ display:block; font-size:11px; opacity:.7; font-weight:600; }
.vo-text{ display:block; min-width:0; }
.vo-icon{
  position:relative; width:40px; height:40px; border-radius:50%; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--black); color:var(--white); font-size:15px;
}
.vo-once{
  position:absolute; right:-3px; bottom:-3px; width:17px; height:17px; border-radius:50%;
  background:var(--yellow); color:var(--black); font-size:10px; font-weight:800;
  display:flex; align-items:center; justify-content:center; border:2px solid var(--black);
}
.vo-open{ background:none; border:0; padding:0; color:inherit; font:inherit; cursor:pointer; text-align:left; width:100%; }
.vo-open:hover .vo-icon{ transform:scale(1.05); }
.vo-opened{ font-style:italic; opacity:.75; font-weight:600; }
.vo-opened i{ margin-right:2px; }
.vo-spinner{
  width:18px; height:18px; border-radius:50%; flex-shrink:0;
  border:2.5px solid currentColor; border-right-color:transparent;
  animation:voSpin .8s linear infinite;
}
@keyframes voSpin{ to{ transform:rotate(360deg); } }

/* ============ VOICE NOTE GAYA WHATSAPP ============ */
.wa-voice{ display:flex; align-items:center; gap:8px; width:250px; max-width:100%; min-width:0; padding-top:2px; box-sizing:border-box; }
.wa-voice-av{
  position:relative; width:44px; height:44px; border-radius:50%; flex-shrink:0;
  overflow:hidden; display:flex; align-items:center; justify-content:center;
  border:2px solid var(--black);
}
.wa-voice-av img{ width:100%; height:100%; object-fit:cover; }
.wa-voice-mic{
  position:absolute; right:-3px; bottom:-3px; width:19px; height:19px; border-radius:50%;
  background:var(--green); color:var(--black); font-size:9px;
  display:flex; align-items:center; justify-content:center; border:2px solid var(--black);
}
.wa-voice-play{
  width:38px; height:38px; border-radius:50%; flex-shrink:0; padding:0; cursor:pointer;
  border:0; background:var(--black); color:var(--white); font-size:14px;
  display:flex; align-items:center; justify-content:center;
}
.wa-voice-play i{ margin-left:2px; }
.wa-voice-wave{ flex:1 1 0; min-width:0; height:32px; display:flex; align-items:center; justify-content:space-between; overflow:hidden; }
.wa-voice-wave i{ flex:1 1 0; min-width:1px; max-width:3px; display:block; border-radius:2px; background:rgba(10,10,10,.28); transition:background .15s; }
.wa-voice-wave i.on{ background:var(--black); }
.wa-voice-time{ flex-shrink:0; font-size:11px; font-weight:700; min-width:34px; text-align:right; align-self:flex-end; opacity:.8; font-variant-numeric:tabular-nums; }

/* ---- kartu siaran live di strip story ---- */
.story-card-live{ position:absolute; z-index:3; top:6px; left:6px; }
.story-card.live-card .story-ring{ top:12px; }

/* cover profil lawan bicara di panel info */
.info-cover{ position:relative; isolation:isolate; overflow:hidden; height:170px; margin:-20px -20px 0; background:#111; border-bottom: var(--border-w) solid var(--black); }
.info-cover::before{ content:""; position:absolute; inset:-20px; background:var(--cover) center/cover no-repeat; filter:blur(16px) brightness(.7); z-index:0; }
.info-cover::after{ content:""; position:absolute; inset:0; background:var(--cover) center/contain no-repeat; z-index:1; }
.info-cover:not(.hidden) + .info-avatar-row{ margin-top:-52px; position:relative; }
.info-cover:not(.hidden) + .info-avatar-row .avatar.big{ border:var(--border-w) solid var(--black); background-color:#fff; box-shadow:0 0 0 4px #fff; }


/* ===== story di desktop: tampil dengan proporsi asli di tengah, tidak melebar/terpotong ===== */
html:not(.is-mobile) .story-viewer-content img,
html:not(.is-mobile) .story-viewer-content video{
  width:auto !important; height:auto !important;
  max-width:100% !important; max-height:100% !important;
  object-fit:contain !important;
  margin:0 auto;
}

/* ===== Group / ongoing call message (WhatsApp-like) ===== */
.call-log-bubble.ongoing {
  background: linear-gradient(135deg, #e8f5e9, #e3f2fd);
  border: 1px solid #81c784;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
.call-log-bubble.ongoing .call-join-btn {
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.call-log-bubble.ongoing .call-join-btn:hover { background: #1da851; }
.call-log-bubble.ongoing .call-in-call-badge {
  background: #fff3e0;
  color: #e65100;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

/* Group call grid – layout adaptif */
#group-call-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 56px 12px 120px;
  box-sizing: border-box;
  background: #0b141a;
  z-index: 1;
  overflow: hidden;
  align-content: center;
  justify-content: center;
  justify-items: center;
}
.group-call-tile {
  position: relative;
  background: #1a242d;
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.group-call-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b141a;
  display: block;
}
.group-call-tile .tile-name {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-call-tile.local-tile {
  border: 2px solid #25d366;
}

/* 1 orang (hanya kita): full layar */
#group-call-grid.gc-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  padding: 0 0 100px;
  justify-items: stretch;
}
#group-call-grid.gc-1 .group-call-tile {
  border-radius: 0;
  border: none;
  width: 100%;
  height: 100%;
}

/* 1 remote (+ kita PiP): satu kotak proporsional di tengah, TIDAK full stretch */
#group-call-grid.gc-2 {
  grid-template-columns: minmax(200px, min(92vw, 420px));
  grid-template-rows: minmax(240px, min(62vh, 560px));
  padding: 64px 16px 130px;
}
#group-call-grid.gc-2 .group-call-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(62vh, 560px);
}

/* 2 remote: dua kotak proporsional berdampingan */
#group-call-grid.gc-3 {
  grid-template-columns: repeat(2, minmax(140px, min(44vw, 280px)));
  grid-template-rows: minmax(200px, min(50vh, 420px));
  gap: 10px;
  padding: 64px 12px 130px;
}
#group-call-grid.gc-3 .group-call-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
}

/* 3+ remote: grid kotak, bisa scroll */
#group-call-grid.gc-many {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  grid-auto-rows: minmax(160px, 38vw);
  align-content: start;
  justify-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 56px 10px 130px;
  gap: 8px;
}
#group-call-grid.gc-many .group-call-tile {
  aspect-ratio: 3 / 4;
  width: 100%;
}
@media (min-width: 600px) {
  #group-call-grid.gc-many {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    grid-auto-rows: minmax(180px, 26vw);
  }
}

/* Local PiP di atas grid saat group 2+; remote private di atas background */
.call-overlay .local-video { z-index: 4; }
.remote-video { z-index: 1 !important; }

/* Info pesan */
.msg-info-section{ font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:.04em; opacity:.7; margin:10px 0 6px; }
.msg-info-person{ display:flex; align-items:center; gap:10px; padding:8px 12px; margin-bottom:6px;
  border:2px solid var(--black); border-radius:10px; background: var(--cream); font-size:13px; }
.msg-info-person-text{ min-width:0; overflow:hidden; }
.msg-info-person-text > div:first-child{ font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg-info-sub{ font-size:12px; opacity:.7; }
.msg-info-empty{ font-size:13px; opacity:.65; padding:8px 0; }

/* Popup info user (dari grup) */
.clickable{ cursor:pointer; }
.bubble-sender.clickable:active{ opacity:.7; }
.user-info-bio{ font-size:13px; text-align:center; padding:4px 10px 14px; white-space:pre-wrap; overflow-wrap:anywhere; opacity:.85; }

/* token bot & command yang bisa diklik */
.copy-token{ font-family: ui-monospace, Menlo, Consolas, monospace; font-size:12px; word-break:break-all;
  background: rgba(0,0,0,.07); border:1.5px dashed currentColor; border-radius:8px; padding:1px 5px; cursor:pointer; }
.cmd-chip{ font-weight:800; color: var(--purple, #7C4DFF); background: rgba(124,77,255,.12); border-radius:6px; padding:0 4px; cursor:pointer; }
.copy-token:active, .cmd-chip:active{ opacity:.6; }

/* caption gambar (thumbnail + deskripsi dalam satu bubble) */
.msg-image-caption{ padding:8px 2px 0; white-space:pre-wrap; overflow-wrap:anywhere; }

/* VN: spinner saat audio dimuat */
.wa-voice-spin{ display:inline-block; width:18px; height:18px; border-radius:50%;
  border:3px solid rgba(255,255,255,.35); border-top-color:#fff; animation: wa-voice-spin .8s linear infinite; }
@keyframes wa-voice-spin{ to { transform: rotate(360deg); } }
.wa-voice[data-state="error"] .wa-voice-play{ background:#e5484d; }

/* ================= LOKASI & LOKASI LANGSUNG (location.js) ================= */

/* ============ LOKASI & LOKASI LANGSUNG (tampilan v2: tenang, modern) ============
   Mengikuti variabel tema. Hairline tipis + bayangan lembut, bukan blok tebal. */
.live-loc-bar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 14px; background:var(--white); color:var(--black);
  border-bottom:1px solid color-mix(in srgb, var(--black) 10%, transparent);
  font-weight:600; font-size:13px; letter-spacing:-0.01em;
}
.live-loc-bar > span{ flex:1 1 140px; min-width:0; }
.loc-live-dot{
  width:8px; height:8px; flex-shrink:0; border-radius:50%; background:var(--red);
  animation:locDot 1.8s ease-out infinite;
}
@keyframes locDot{
  0%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); }
  70%,100%{ box-shadow:0 0 0 7px transparent; }
}

.loc-btn{
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  border:1px solid color-mix(in srgb, var(--black) 14%, transparent);
  background:color-mix(in srgb, var(--black) 4%, var(--white)); color:var(--black);
  font-weight:600; font-size:12px; font-family:inherit; cursor:pointer;
  transition:transform .12s ease, background .15s ease;
}
.loc-btn:active{ transform:scale(.96); }
.loc-btn.danger{ background:color-mix(in srgb, var(--red) 12%, var(--white)); color:var(--red); border-color:transparent; }

/* kartu di bubble chat */
.loc-card{
  width:min(260px,100%); cursor:pointer; display:flex; flex-direction:column;
  background:var(--white); border-radius:var(--radius); overflow:hidden;
  border:1px solid color-mix(in srgb, var(--black) 8%, transparent);
  box-shadow:0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.06);
}
.loc-card .loc-map{ width:100%; height:148px; background:var(--cream); border:none; border-radius:0; overflow:hidden; }
.loc-card .loc-empty{ height:100%; display:flex; align-items:center; justify-content:center; text-align:center; padding:0 10px; font-size:12px; opacity:.6; }
.loc-meta{ display:flex; flex-direction:column; gap:2px; padding:10px 12px 0; }
.loc-title{ font-weight:650; font-size:13.5px; letter-spacing:-0.01em; display:flex; align-items:center; gap:7px; color:var(--black); }
.loc-title i{ color:var(--accent); font-size:12px; }
.loc-card.live .loc-title i{ color:var(--red); }
.loc-sub{ font-size:12px; font-weight:500; opacity:.6; font-variant-numeric:tabular-nums; }
.loc-actions{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; padding:10px 12px 12px; }
.loc-card .loc-actions .loc-btn:first-child{ background:var(--accent); color:#fff; border-color:transparent; }

/* pin peta */
.loc-pin-wrap{ background:none; border:none; }
.loc-pin{
  width:30px; height:30px; margin:2px auto 0; border-radius:50% 50% 50% 0; transform:rotate(-45deg);
  border:2.5px solid #fff; box-shadow:0 3px 8px rgba(0,0,0,.28);
  display:flex; align-items:center; justify-content:center;
}
.loc-pin span{ transform:rotate(45deg); font-weight:700; font-size:12px; line-height:1; color:#fff; text-shadow:0 1px 1px rgba(0,0,0,.3); }
.loc-pin.live{ animation:locPulse 1.8s ease-out infinite; }
@keyframes locPulse{
  0%,100%{ box-shadow:0 3px 8px rgba(0,0,0,.28), 0 0 0 0 rgba(0,0,0,.22); }
  60%{ box-shadow:0 3px 8px rgba(0,0,0,.28), 0 0 0 10px rgba(0,0,0,0); }
}

/* ---- sheet layar penuh (mobile) ---- */
.loc-sheet{
  position:fixed; inset:0; z-index:1200; background:var(--cream);
  display:flex; flex-direction:column;
  padding-top:var(--safe-top); padding-bottom:var(--safe-bottom);
}
.loc-head{
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  background:var(--white); border-bottom:1px solid color-mix(in srgb, var(--black) 9%, transparent);
}
.loc-head .icon-btn{ border:none; box-shadow:none; width:36px; height:36px; border-radius:50%; background:color-mix(in srgb, var(--black) 6%, transparent); }
.loc-head-title{ font-weight:650; font-size:16px; letter-spacing:-0.015em; }
.loc-map-wrap{ position:relative; flex:1 1 auto; min-height:240px; background:var(--cream); }
.loc-map-full{ position:absolute; inset:0; }
.loc-map-full .leaflet-bar{ border:none; border-radius:12px; overflow:hidden; box-shadow:0 4px 16px rgba(0,0,0,.16); }
.loc-map-full .leaflet-bar a{ width:38px; height:38px; line-height:38px; color:var(--black); background:var(--white); border-bottom:1px solid color-mix(in srgb, var(--black) 8%, transparent); }
.loc-map-full .leaflet-bar a:last-child{ border-bottom:none; }
.loc-map-full .leaflet-control-attribution{ font-size:10px; background:color-mix(in srgb, var(--white) 75%, transparent) !important; border-radius:6px 0 0 0; }

.loc-center-pin{ position:absolute; left:50%; top:50%; width:34px; height:42px; transform:translate(-17px,-40px); pointer-events:none; z-index:900; filter:drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
.loc-center-pin svg{ display:block; }
.loc-center-pin svg path{ fill:var(--accent); stroke:#fff; stroke-width:2.5; }
.loc-center-pin svg circle{ fill:#fff; stroke:none; }

.loc-recenter,
.loc-layer{
  position:absolute; top:12px; z-index:900; background:var(--white); color:var(--black);
  border:1px solid color-mix(in srgb, var(--black) 8%, transparent);
  box-shadow:0 4px 16px rgba(0,0,0,.16); cursor:pointer;
}
.loc-recenter{ right:12px; width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; }
.loc-layer{
  left:12px; height:38px; padding:0 14px 0 12px; border-radius:999px;
  display:inline-flex; align-items:center; gap:7px; font-family:inherit; font-size:12.5px; font-weight:600;
}
.loc-layer i{ font-size:13px; color:var(--accent); }
.loc-layer:active,.loc-recenter:active{ transform:scale(.96); }

.loc-panel{
  display:flex; flex-direction:column; gap:12px; padding:14px 16px 16px;
  background:var(--white); border-top:1px solid color-mix(in srgb, var(--black) 9%, transparent);
  max-height:46vh; overflow:auto; border-radius:20px 20px 0 0; margin-top:-12px; position:relative;
}
.loc-hint{ font-size:13px; font-weight:500; line-height:1.45; opacity:.8; }

/* durasi: segmented control */
.loc-durations{
  display:flex; gap:3px; padding:3px; border-radius:12px;
  background:color-mix(in srgb, var(--black) 6%, var(--white));
}
.loc-dur{
  flex:1; padding:8px 6px; border-radius:9px; border:none; background:transparent; color:var(--black);
  font-weight:600; font-size:13px; font-family:inherit; opacity:.6; transition:background .15s, opacity .15s;
}
.loc-dur.active{ background:var(--white); opacity:1; color:var(--accent); box-shadow:0 1px 3px rgba(0,0,0,.14); }

.loc-panel #loc-send{
  width:100%; padding:13px 16px; border:none; border-radius:13px; box-shadow:none;
  background:var(--accent); color:#fff; font-weight:650; font-size:15px; letter-spacing:-0.01em;
}
.loc-panel #loc-send:disabled{ opacity:.45; }

.loc-people{ display:flex; flex-direction:column; gap:6px; }
.loc-row{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left; padding:9px 10px;
  border:none; border-radius:13px; background:color-mix(in srgb, var(--black) 4%, var(--white)); color:var(--black); font-family:inherit;
}
.loc-row-text{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.loc-row-text > b{ font-size:14px; font-weight:600; }
.loc-av{
  width:36px; height:36px; flex-shrink:0; border-radius:50%; border:none;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; color:#fff; text-shadow:0 1px 1px rgba(0,0,0,.25);
}
.loc-empty{ font-size:13px; font-weight:500; opacity:.6; padding:12px 0; text-align:center; }
#loc-stop-own.btn-secondary{
  width:100%; padding:12px; border-radius:13px; border:1px solid color-mix(in srgb, var(--red) 30%, transparent);
  background:transparent; color:var(--red); font-weight:600; font-size:14px; box-shadow:none;
}

/* ---- desktop: kartu melayang di tengah, peta kiri + panel kanan ---- */
@media (min-width: 760px){
  .loc-sheet{
    inset:auto; top:50%; left:50%; transform:translate(-50%,-50%);
    width:min(960px, calc(100vw - 64px)); height:min(640px, calc(100vh - 64px));
    border-radius:20px; overflow:hidden; background:var(--cream);
    box-shadow:0 0 0 100vmax rgba(10,12,20,.42), 0 24px 60px rgba(0,0,0,.25);
    display:grid; grid-template-columns:1fr 320px; grid-template-rows:auto 1fr;
    padding:0;
  }
  .loc-head{ grid-column:1 / -1; grid-row:1; padding:14px 18px; }
  .loc-map-wrap{ grid-column:1; grid-row:2; min-height:0; }
  .loc-panel{
    grid-column:2; grid-row:2; max-height:none; margin-top:0; border-radius:0;
    border-top:none; border-left:1px solid color-mix(in srgb, var(--black) 9%, transparent);
    padding:18px; overflow:auto;
  }
  .loc-layer{ top:14px; left:14px; }
  .loc-recenter{ top:14px; right:14px; }
  .loc-head .icon-btn:hover{ background:color-mix(in srgb, var(--black) 12%, transparent); }
}


/* ============ FITUR PIN PESAN & FITUR ALA WHATSAPP ============ */
.pinned-msg-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--cream);
  border-bottom: var(--border-w) solid var(--black);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  z-index: 4;
}
.pinned-msg-bar:hover {
  background: color-mix(in srgb, var(--yellow) 35%, var(--cream));
}
.pinned-msg-indicators {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-self: stretch;
  justify-content: center;
}
.pinned-msg-ind {
  width: 3.5px;
  flex: 1;
  min-height: 6px;
  max-height: 14px;
  border-radius: 3px;
  background: rgba(0,0,0,0.22);
  transition: background .15s, transform .15s;
}
.pinned-msg-ind.active {
  background: var(--purple);
}
.pinned-msg-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--yellow);
  border: 2px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--black);
  flex-shrink: 0;
  box-shadow: 1.5px 1.5px 0 var(--black);
}
.pinned-msg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pinned-msg-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pinned-msg-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* In-chat search bar */
.chat-search-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--white);
  border-bottom: var(--border-w) solid var(--black);
  z-index: 4;
}
.chat-search-ico {
  font-size: 13px;
  color: #666;
}
.chat-search-bar input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--black);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--cream);
  color: var(--black);
  outline: none;
}
.chat-search-bar input:focus {
  background: var(--white);
}
.chat-search-count {
  font-size: 11.5px;
  font-weight: 800;
  color: #555;
  min-width: 34px;
  text-align: center;
}

/* Badges di dalam bubble pesan (pin, star, edited, disappearing) */
.msg-meta-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}
.msg-pin-badge {
  color: var(--purple);
  font-size: 10px;
  transform: rotate(35deg);
}
.msg-star-badge {
  color: #f59e0b;
  font-size: 10px;
}
.msg-edited-label {
  font-style: italic;
  font-size: 10px;
  opacity: 0.78;
}
.msg-expire-badge {
  font-size: 9.5px;
  opacity: 0.75;
}

/* Edit message preview bar */
.reply-preview.edit-preview {
  background: var(--yellow);
}
.reply-preview-bar.edit-bar {
  background: var(--orange);
}

/* Modal pilihan durasi pin & bisukan */
.pin-duration-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pin-dur-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--black);
  background: var(--cream);
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.pin-dur-option.selected,
.pin-dur-option:has(input:checked) {
  background: var(--yellow);
  box-shadow: 2px 2px 0 var(--black);
}
.pin-dur-option input[type="radio"] {
  accent-color: var(--purple);
  width: 17px;
  height: 17px;
  margin: 0;
}
.pin-dur-option span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pin-dur-option b {
  font-size: 13.5px;
  font-weight: 800;
}
.pin-dur-option small {
  font-size: 11.5px;
  color: #555;
  font-weight: 600;
}

/* Daftar pesan tersemat & pesan berbintang */
.pinned-modal-list,
.starred-list,
.poll-votes-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.pinned-modal-item,
.starred-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--black);
  background: var(--cream);
  cursor: pointer;
  transition: transform .1s, background .12s;
}
.pinned-modal-item:hover,
.starred-item:hover {
  background: color-mix(in srgb, var(--yellow) 30%, var(--cream));
}
.pinned-modal-top,
.starred-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--purple);
}
.pinned-modal-text,
.starred-item-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  word-break: break-word;
}
.pinned-modal-meta,
.starred-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  font-weight: 600;
}

/* Polling (Buat Polling & Bubble Polling ala WhatsApp) */
.poll-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.poll-opt-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.poll-opt-input-row input {
  flex: 1;
  margin: 0;
}
.msg-poll {
  min-width: 230px;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0;
}
.msg-poll-q {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}
.msg-poll-hint {
  font-size: 11px;
  color: #555;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.msg-poll-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-poll-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 2px solid var(--black);
  background: var(--cream);
  cursor: pointer;
  text-align: left;
  transition: transform .08s, background .12s;
}
.msg-poll-opt.voted {
  background: color-mix(in srgb, var(--green) 26%, var(--cream));
  box-shadow: 1.5px 1.5px 0 var(--black);
}
.msg-poll-opt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.msg-poll-check {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--black);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.msg-poll-opt.voted .msg-poll-check {
  background: var(--green);
  color: var(--black);
}
.msg-poll-opt-label {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.msg-poll-opt-count {
  font-size: 11.5px;
  font-weight: 800;
  color: #333;
}
.msg-poll-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.12);
  overflow: hidden;
}
.msg-poll-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--purple);
  transition: width .22s ease;
}
.msg-poll-footer {
  border-top: 1.5px dashed rgba(0,0,0,0.2);
  padding-top: 6px;
  text-align: center;
}
.msg-poll-view-btn {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 8px;
}
.msg-poll-view-btn:hover {
  text-decoration: underline;
}
.poll-vote-group {
  border: 2px solid var(--black);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--cream);
}
.poll-vote-group-head {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}
.poll-voter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  font-weight: 700;
}

/* Mute & Unread indicators in chat list */
.mute-icon {
  font-size: 11.5px;
  color: #777;
  margin-left: 4px;
}
.unread-dot-badge {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 1.5px solid var(--black);
  display: inline-block;
  flex-shrink: 0;
}


/* ============ SWIPE KANAN UNTUK BALAS PESAN (ALA WHATSAPP) ============ */
.msg-row {
  position: relative;
  touch-action: pan-y;
}
.msg-row .bubble,
.msg-row .msg-avatar {
  will-change: transform;
}
.msg-swipe-reply-ico {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 20, 28, 0.28);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.35);
  z-index: 3;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s ease;
}
.msg-swipe-reply-ico.ready {
  background: var(--purple);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

/* ============================================================================
   FITUR SUPERAPP V3.8 (GABUNGAN INSTAGRAM + TELEGRAM + WHATSAPP)
   ============================================================================ */

/* 1. Instagram Notes Strip di Beranda (Desain Cloud Bubble Modern + Pemutar Audio) */
.ig-notes-strip {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 14px 12px;
  overflow-x: auto;
  overflow-y: visible;
  border-bottom: 1.5px solid color-mix(in srgb, var(--black, #111) 10%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cream, #fff8e7) 45%, transparent) 0%, transparent 100%);
  flex-shrink: 0;
  scrollbar-width: none;
}
.ig-notes-strip.hidden {
  display: none !important;
}
.ig-note-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 82px;
  padding-top: 42px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.ig-note-item:hover {
  transform: translateY(-2px);
}
.ig-note-bubble {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: max-content;
  max-width: 92px;
  min-width: 52px;
  padding: 5px 9px 6px;
  border-radius: 16px;
  background: var(--white, #ffffff);
  color: var(--black, #111111);
  border: 1.8px solid var(--black, #111111);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 1.5px 2px 0 var(--black, #111111);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.22;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ig-note-bubble.empty {
  color: #777;
  font-weight: 600;
  background: var(--cream, #fffdf7);
  opacity: 0.92;
}
/* Ekor gelembung pikiran bertingkat ala Instagram Notes */
.ig-note-bubble::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 34%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white, #ffffff);
  border: 1.6px solid var(--black, #111111);
}
.ig-note-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 42%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white, #ffffff);
  border: 1.4px solid var(--black, #111111);
}
.ig-note-text-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 80px;
}
/* Pil pemutar musik langsung di gelembung Beranda */
.ig-note-music-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 80px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.14), rgba(236, 72, 153, 0.14));
  color: var(--purple, #6c5ce7);
  font-size: 9.5px;
  font-weight: 800;
  border: 1px solid rgba(108, 92, 231, 0.28);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.ig-note-music-pill:hover {
  background: var(--purple, #6c5ce7);
  color: #ffffff !important;
  transform: scale(1.04);
}
.ig-note-item.is-playing .ig-note-music-pill {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  border-color: #059669;
}
.ig-note-music-pill-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52px;
}
/* Animasi 3 batang equalizer bergerak saat lagu diputar */
.ig-note-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 9px;
  flex-shrink: 0;
}
.ig-note-eq i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  animation: igNoteEqBar 0.75s ease-in-out infinite alternate;
}
.ig-note-eq i:nth-child(2) {
  height: 8px;
  animation-delay: 0.18s;
}
.ig-note-eq i:nth-child(3) {
  height: 5px;
  animation-delay: 0.34s;
}
.ig-note-item:not(.is-playing) .ig-note-eq i {
  animation-play-state: paused;
  height: 5px;
}
@keyframes igNoteEqBar {
  0%   { height: 2px; }
  100% { height: 9px; }
}
.ig-note-av-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ig-note-av-wrap.has-note {
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b);
}
.ig-note-item.is-playing .ig-note-av-wrap {
  background: linear-gradient(135deg, #10b981, #06b6d4, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}
.ig-note-av-wrap .avatar {
  width: 50px;
  height: 50px;
  font-size: 16px;
  border: 2px solid var(--white, #ffffff);
}
.ig-note-plus {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green, #22c55e);
  color: #fff;
  border: 2px solid var(--white, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.ig-note-name {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--black, #111111);
  max-width: 78px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.ig-note-emoji-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ig-emoji-chip {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--black, #111111);
  background: var(--cream, #fff5d6);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
.ig-emoji-chip.active {
  background: var(--yellow, #ffd23f);
  transform: scale(1.1);
  box-shadow: 2px 2px 0 var(--black, #111111);
}

/* Kotak Pencarian & Pemilih Musik di Modal Catatan */
.ig-note-music-picker-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cream, #fff5d6) 65%, var(--white, #fff));
  border: 1.8px solid var(--black, #111111);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-note-music-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--black, #111111);
}
.ig-note-music-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ig-note-music-results {
  max-height: 175px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}
.ig-note-music-results.hidden,
.ig-note-selected-music.hidden,
.reply-note-player.hidden {
  display: none !important;
}
.ig-music-result-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 11px;
  background: var(--white, #ffffff);
  border: 1.5px solid color-mix(in srgb, var(--black, #111) 15%, transparent);
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}
.ig-music-result-item:hover {
  background: color-mix(in srgb, var(--yellow, #ffd23f) 28%, var(--white, #ffffff));
}
.ig-music-cover {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, #6c5ce7, #ec4899);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  overflow: hidden;
  border: 1.5px solid var(--black, #111111);
}
.ig-music-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ig-music-cover.spinning {
  border-radius: 50%;
  animation: xzm-spin 3.2s linear infinite;
}
.ig-music-meta {
  flex: 1;
  min-width: 0;
}
.ig-music-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--black, #111111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-music-artist {
  font-size: 11px;
  color: #666;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ig-music-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.8px solid var(--black, #111111);
  background: var(--yellow, #ffd23f);
  color: var(--black, #111111);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
}
.ig-note-selected-music,
.reply-note-player {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(236, 72, 153, 0.12));
  border: 2px solid var(--black, #111111);
  margin-bottom: 10px;
}
.ig-player-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ig-player-seek-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}
.ig-player-seek-row input[type="range"] {
  flex: 1;
  accent-color: var(--purple, #6c5ce7);
  cursor: pointer;
}
.reply-note-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.reply-note-bubble-preview {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--cream, #fff5d6);
  border: 2px solid var(--black, #111111);
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: 2px 2px 0 var(--black, #111111);
}

/* 2. Teks Spoiler Rahasia ||teks|| ala Telegram */
.msg-spoiler {
  display: inline;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(30, 30, 46, 0.78);
  color: transparent !important;
  cursor: pointer;
  user-select: none;
  filter: blur(4px);
  transition: filter 0.22s ease, background 0.22s ease, color 0.22s ease;
  position: relative;
}
.msg-spoiler * {
  opacity: 0;
  transition: opacity 0.22s ease;
}
.msg-spoiler.revealed {
  background: rgba(108, 92, 231, 0.15);
  color: inherit !important;
  filter: none;
  user-select: text;
}
.msg-spoiler.revealed * {
  opacity: 1;
}

/* 3. Efek Pesan Animasi & Ketuk 2x Like Hati (Instagram DM + Telegram) */
.msg-effect-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  padding: 0 3px;
  border-radius: 6px;
  transition: transform 0.15s ease;
}
.msg-effect-badge:hover {
  transform: scale(1.25);
}
.msg-silent-badge,
.msg-scheduled-badge {
  font-size: 10px;
  opacity: 0.75;
}
.dbltap-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 46px;
  pointer-events: none;
  z-index: 35;
  filter: drop-shadow(0 4px 10px rgba(225, 29, 72, 0.45));
  animation: dblTapHeartPop 0.85s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes dblTapHeartPop {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(-12deg); opacity: 0; }
  30%  { transform: translate(-50%, -60%) scale(1.25) rotate(8deg); opacity: 1; }
  65%  { transform: translate(-50%, -75%) scale(1.05) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -110%) scale(0.75) rotate(0deg); opacity: 0; }
}
.xz-effect-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  overflow: hidden;
}
.xz-burst-particle {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  animation: xzBurstFly 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes xzBurstFly {
  0%   { transform: translate(0, 0) scale(0.4) rotate(0deg); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, -140px)) scale(1.25) rotate(var(--rot, 180deg)); opacity: 0; }
}

/* 4. Menu Opsi Kirim (#send-options-menu) & Modal Jadwalkan Pesan */
.send-options-menu {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 10px);
  width: min(300px, calc(100vw - 24px));
  background: var(--white, #ffffff);
  color: var(--black, #111111);
  border: 2.5px solid var(--black, #111111);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 3px 3px 0 var(--black, #111111);
  padding: 12px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.send-opt-section-title {
  font-size: 11px;
  font-weight: 800;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.send-opt-effects-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.send-effect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1.8px solid var(--black, #111111);
  background: var(--cream, #fff5d6);
  color: var(--black, #111111);
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.send-effect-btn small {
  font-size: 10px;
  font-weight: 700;
}
.send-effect-btn:hover,
.send-effect-btn.active {
  background: var(--yellow, #ffd23f);
  transform: translateY(-1px);
}
.send-opt-fmt-row {
  display: flex;
  gap: 5px;
}
.send-opt-fmt-row button {
  flex: 1;
  padding: 6px 6px;
  border-radius: 9px;
  border: 1.5px solid var(--black, #111111);
  background: var(--cream, #fff5d6);
  color: var(--black, #111111);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.send-opt-fmt-row button:hover {
  background: var(--yellow, #ffd23f);
}
.send-opt-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}
.send-opt-actions button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.8px solid var(--black, #111111);
  background: var(--white, #ffffff);
  color: var(--black, #111111);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.send-opt-actions button:hover {
  background: var(--yellow, #ffd23f);
}
.schedule-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.scheduled-msg-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.scheduled-msg-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--black, #111111);
  background: var(--cream, #fff5d6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.scheduled-msg-item-info {
  min-width: 0;
  flex: 1;
}
.scheduled-msg-item-time {
  font-size: 11px;
  font-weight: 800;
  color: var(--purple, #6c5ce7);
}
.scheduled-msg-item-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.scheduled-msg-item-btns {
  display: flex;
  gap: 4px;
}

/* 5. Kotak Terjemahan Pesan Instan di Dalam Bubble (.msg-translation-box) */
.msg-translation-box {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(108, 92, 231, 0.12);
  border-left: 3px solid var(--purple, #6c5ce7);
  font-size: 12.5px;
  line-height: 1.38;
}
.msg-translation-head {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--purple, #6c5ce7);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* 6. Avatar Khusus Ruang "Pesan Tersimpan" (Saved Messages) */
.avatar.saved-messages-av {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
  color: #ffffff !important;
  font-size: 17px;
}


/* ============================================================================
   V3.8.3 UI REFINEMENT: WA FILTER TOGGLE FOR NOTES & SIMPLIFIED CHAT INPUT BAR
   ============================================================================ */
.chat-filter-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 14px 10px;
  overflow: hidden;
}
.chat-filter-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 10px;
  mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
}
.chat-filter-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.16s ease, color 0.16s ease;
}
.filter-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.9;
}
.filter-tab-count.hidden {
  display: none !important;
}
.filter-notes-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--white, #fff);
  color: var(--black, #111);
  border: 2px solid var(--black, #111);
  box-shadow: 2px 2px 0 var(--black, #111);
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
.filter-notes-toggle-btn.active {
  background: color-mix(in srgb, var(--green, #10b981) 22%, var(--white, #fff));
  color: var(--black, #111);
}
html.dark .filter-notes-toggle-btn,
body.theme-dark .filter-notes-toggle-btn {
  background: #141c24;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html.dark .filter-notes-toggle-btn.active,
body.theme-dark .filter-notes-toggle-btn.active {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
.filter-notes-toggle-btn:active {
  transform: scale(0.95);
}
.wa-filter-bars-ico {
  display: block;
  flex-shrink: 0;
}

/* Sembunyikan tombol lama yang sudah digabung ke menu titik 3 & tombol kirim utama */
.hidden-input-tool {
  display: none !important;
}

/* Menu Titik 3 (#attach-menu.chat-more-menu) yang lebih rapi & ringkas */
.attach-menu.chat-more-menu {
  /* relatif ke footer (.chat-input-bar, position:relative), jadi selalu tepat di atas kolom pesan */
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px;
  width: min(290px, calc(100vw - 28px));
  padding: 12px;
  border-radius: 18px;
  gap: 10px;
  z-index: 25;
}
.chat-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.chat-more-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--black, #111) 14%, transparent);
  background: color-mix(in srgb, var(--cream, #fff8e7) 55%, var(--white, #fff));
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.chat-more-grid button i {
  font-size: 18px;
}
.chat-more-grid button:hover {
  background: var(--yellow);
  transform: translateY(-1px);
}
.chat-more-divider {
  height: 1.5px;
  background: color-mix(in srgb, var(--black, #111) 12%, transparent);
  margin: 2px 0;
}
.chat-more-extra-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-more-extra-actions button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
  border: 1.5px solid color-mix(in srgb, var(--black, #111) 14%, transparent);
  background: var(--white, #fff);
  cursor: pointer;
}
.chat-more-extra-actions button:hover {
  background: var(--yellow);
}

/* Animasi & Indikator Mode Kirim vs Mode Voice Note (Tap 2x) */
#btn-send {
  position: relative;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#btn-send.vn-mode {
  background: #10b981;
  color: #052e16;
}
#btn-send.mode-switching {
  animation: btnSendModeFlip 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes btnSendModeFlip {
  0% { transform: scale(1); }
  45% { transform: scale(0.82) rotate(-12deg); }
  100% { transform: scale(1) rotate(0deg); }
}
