/* CLINED — notifikasi & dialog meluncur dari ATAS (v1). Dimuat paling akhir. */

/* Toast: turun dari atas */
html body .clined-toast {
  top: calc(10px + env(safe-area-inset-top)) !important; bottom: auto !important; left: 50% !important;
  width: max-content; max-width: min(92vw, 460px); text-align: center; line-height: 1.4; font-size: 14px;
  transform: translate(-50%, -140%) !important; opacity: 0; z-index: 2147483002 !important;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.9,.3,1.1) !important;
}
html body .clined-toast.show { transform: translate(-50%, 0) !important; opacity: 1; }

/* Dialog konfirmasi: kartu meluncur dari atas, latar gelap */
.cdlg-layer { position: fixed; inset: 0; z-index: 2147483003; display: flex; justify-content: center; align-items: flex-start;
  padding: calc(14px + env(safe-area-inset-top)) 14px 14px; background: rgba(15,23,28,.55); opacity: 0; transition: opacity .2s ease; overflow-y: auto; }
.cdlg-layer.show { opacity: 1; }
.cdlg-card { width: 100%; max-width: 440px; margin-top: 0; padding: 18px 16px 16px; border-radius: 22px;
  background: var(--card, #fff); color: var(--text, #1f2d33); border: 2px solid var(--line, #e5e7eb); border-bottom-width: 5px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35); transform: translateY(-120%); transition: transform .32s cubic-bezier(.2,.9,.3,1.05); }
.cdlg-layer.show .cdlg-card { transform: none; }
.cdlg-head { display: flex; gap: 12px; align-items: center; }
.cdlg-ico { flex: 0 0 46px; height: 46px; display: grid; place-items: center; font-size: 24px; border-radius: 15px; background: rgba(255,150,0,.16); }
.cdlg-card[data-tone=danger] .cdlg-ico { background: rgba(255,75,75,.15); }
.cdlg-card[data-tone=info] .cdlg-ico { background: rgba(28,176,246,.15); }
.cdlg-title { margin: 0; font-size: 17px; font-weight: 950; line-height: 1.25; }
.cdlg-body { margin: 12px 0 0; display: grid; gap: 8px; font-size: 14px; font-weight: 700; line-height: 1.55; color: var(--muted, #5f6f76); }
.cdlg-body p { margin: 0; }
.cdlg-body ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cdlg-body b { color: var(--text, #1f2d33); }
.cdlg-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 16px; }
.cdlg-actions button { min-height: 50px; font-size: 14.5px; font-weight: 900; border-radius: 15px; white-space: normal; line-height: 1.2; }
.cdlg-actions .cdlg-ok[data-tone=danger] { background: #ff4b4b; border-color: #d33a3a; color: #fff; }
.cdlg-actions.single { grid-template-columns: 1fr; }
:root.dark .cdlg-layer { background: rgba(0,0,0,.65); }
@media (prefers-reduced-motion: reduce) { .cdlg-layer, .cdlg-card, html body .clined-toast { transition: none !important; } }

/* Dialog laporan soal */
.rq-cats { display: grid; gap: 8px; }
.rq-cat { min-height: 46px; text-align: left; padding: 0 14px; border-radius: 14px; font-size: 14px; font-weight: 800; border: 2px solid var(--line, #e5e7eb); border-bottom-width: 4px; background: var(--card, #fff); color: var(--text, #1f2d33); }
.rq-cat.on { border-color: #1cb0f6; background: rgba(28,176,246,.14); color: #0b7cb4; }
.rq-note { width: 100%; box-sizing: border-box; min-height: 84px; padding: 12px 14px; font-size: 16px; border-radius: 14px; border: 2px solid var(--line, #e5e7eb); background: var(--surface, #f4f6f7); color: inherit; font-family: inherit; resize: vertical; }
:root.dark .rq-cat.on { color: #7cd3ff; }

/* Pemberitahuan versi baru: pil kecil dari atas */
.upd-banner { position: fixed; left: 50%; top: calc(8px + env(safe-area-inset-top)); z-index: 2147483001; display: flex; align-items: center; gap: 8px; max-width: min(92vw, 380px); padding: 6px 8px 6px 14px; border-radius: 99px; background: #1186bd; color: #fff; font-size: 13.5px; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.28); transform: translate(-50%, -160%); opacity: 0; transition: transform .3s cubic-bezier(.2,.9,.3,1.1), opacity .2s; }
.upd-banner.show { transform: translate(-50%, 0); opacity: 1; }
.upd-banner .upd-tx { white-space: nowrap; }
.upd-banner .upd-btn { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 0; background: #fff; color: #0b6a99; font-size: 13px; font-weight: 950; cursor: pointer; }
.upd-banner .upd-x { min-height: 36px; width: 32px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 14px; opacity: .8; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .upd-banner { transition: none; } }

/* Notifikasi Chat Balas Cepat (Quick Reply meluncur dari atas) */
.chat-qreply {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  width: min(94vw, 430px);
  z-index: 2147483004;
  border-radius: 20px;
  border: 2px solid var(--line, #dbe4de);
  border-bottom: 5px solid var(--line, #cbd5e1);
  background: var(--card, #ffffff);
  color: var(--text, #1c282e);
  padding: 11px 12px 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 9px;
  transform: translate(-50%, -140%);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.08), opacity .2s ease;
}
.chat-qreply.show { transform: translate(-50%, 0); opacity: 1; }
:root.dark .chat-qreply {
  background: #172329;
  color: #f4fafc;
  border-color: #2d3d44;
  border-bottom-color: #0e161a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
}
.cqr-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
}
.cqr-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  flex: none;
}
.cqr-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cqr-info { min-width: 0; display: grid; gap: 2px; }
.cqr-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cqr-name b { font-size: 13.5px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cqr-name span { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: rgba(28, 176, 246, .15); color: #0b7bb3; white-space: nowrap; }
:root.dark .cqr-name span { color: #7cd3ff; }
.cqr-text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  opacity: .88;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cqr-close {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 0;
  background: var(--surface, #edf2ee);
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cqr-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 7px;
  align-items: center;
}
.cqr-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 2px solid var(--line, #dbe4de);
  background: var(--surface, #f2f5f3);
  color: inherit;
  font: inherit;
  font-size: 13.5px;
}
.cqr-input:focus {
  outline: none;
  border-color: #1cb0f6;
  background: var(--card, #fff);
}
:root.dark .cqr-input { background: #1f2e36; border-color: #2d3d44; }
:root.dark .cqr-input:focus { background: #142026; }
.cqr-send {
  width: 40px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid #0c89c7;
  border-bottom: 4px solid #096ea0;
  background: #1cb0f6;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .1s ease, border-bottom-width .1s ease;
}
.cqr-send:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.cqr-send:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .chat-qreply { transition: none; } }

/* Notifikasi Bonus Diamond dari Admin (meluncur dari atas) */
.dia-grant-banner {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  width: min(94vw, 450px);
  z-index: 2147483005;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  gap: 11px;
  align-items: center;
  padding: 12px 13px;
  border-radius: 20px;
  border: 2px solid rgba(56, 189, 248, 0.55);
  border-bottom: 5px solid #0284c7;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.36);
  transform: translate(-50%, -150%);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.08), opacity 0.22s ease;
}
.dia-grant-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.dgb-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dgb-body { min-width: 0; display: grid; gap: 2px; }
.dgb-title { font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; }
.dgb-msg { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.dgb-msg b { font-weight: 950; color: #fef08a; }
.dgb-note {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.42;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
}
.dgb-dialog-field { display: grid; gap: 6px; margin-top: 4px; }
.dgb-dialog-label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 900; color: var(--text, #1f2d33); }
.dgb-dialog-label span { font-size: 11.5px; font-weight: 800; color: var(--muted, #5f6f76); }
.dgb-dialog-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 78px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid var(--line, #dbe4de);
  background: var(--surface, #f4f7f5);
  color: var(--text, #1f2d33);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}
.dgb-dialog-input:focus {
  border-color: #1cb0f6;
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.18);
}
:root.dark .dgb-dialog-input {
  background: #101916;
  color: #eef5f1;
  border-color: #293832;
}
.dgb-x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: 900 14px/1 inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.dgb-x:hover { background: rgba(255, 255, 255, 0.3); }
@media (prefers-reduced-motion: reduce) { .dia-grant-banner { transition: none; } }

/* Notifikasi Milestone Eksklusif 100.000 All-Time XP (meluncur dari atas + tampilkan hadiah) */
.xp100k-unlock-banner {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  width: min(94vw, 480px);
  z-index: 2147483006;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border-radius: 22px;
  border: 2px solid rgba(253, 224, 71, 0.78);
  border-bottom: 5px solid #b45309;
  background: radial-gradient(120% 140% at 100% 0%, rgba(253, 224, 71, 0.25), transparent 55%),
              linear-gradient(135deg, #78350f 0%, #b45309 42%, #d97706 78%, #1e1b4b 100%);
  color: #ffffff;
  box-shadow: 0 18px 46px rgba(180, 83, 9, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  transform: translate(-50%, -155%);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.2, 0.92, 0.3, 1.08), opacity 0.24s ease;
}
.xp100k-unlock-banner.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.x100b-ico {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.32), rgba(245, 158, 11, 0.28));
  border: 1.5px solid rgba(253, 224, 71, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.x100b-body { min-width: 0; display: grid; gap: 4px; }
.x100b-kicker {
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fef08a;
}
.x100b-title {
  font-size: 14.5px;
  font-weight: 900;
  line-height: 1.3;
  color: #ffffff;
}
.x100b-sub {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}
.x100b-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}
.x100b-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(253, 224, 71, 0.55);
  color: #fef9c3;
  white-space: nowrap;
}
.x100b-pill.dia {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(125, 211, 252, 0.7);
  color: #e0f2fe;
}
.x100b-x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: 900 14px/1 inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.x100b-x:hover { background: rgba(255, 255, 255, 0.28); }
@media (prefers-reduced-motion: reduce) { .xp100k-unlock-banner { transition: none; } }

