/* Gaya halaman /chat/ (fullpage)
   File: /assets/css/chat-fullpage.css
   Version: 1.2 - Kotak pilih pesanan auto-fill 150-230px + kelas kartu kepilih dibenerin
   Version: 1.1 - Dark mode judul, pesan sistem wrap, Akhiri Chat 44px, bintang <button>

   Dipisah dari chat/index.php v3.34. Isinya nol PHP, jadi nempel inline cuma bikin
   33 KB ini ditembak ulang tiap kali halaman dibuka - nol cache, dan halaman chat
   itu justru yang paling sering dibuka-tutup orang yang lagi nungguin balasan.
   Kalau nambah aturan yang butuh nilai dari PHP, JANGAN taruh di sini - taruh di
   blok config inline di chat/index.php, atau lewat custom property. */



/* ── Essential widget styles (inline fallback if extraction fails) ── */
.rv-chat-messages { overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.rv-msg { padding: 2px 16px; margin-bottom: 4px; display: flex; flex-direction: column; }
.rv-msg.customer { align-items: flex-end; }
.rv-msg.cs, .rv-msg.bot { align-items: flex-start; }
.rv-msg.system { align-items: center; }
/* v3.9: FIX bubble 1-char-per-line. `display:inline-block + width:fit-content` sebagai
   flex-item di kolom (.rv-msg{flex;column}) collapse ke min-content → tiap huruf turun baris.
   Solusi bener: biarin flex-item shrink-wrap natural (align-items flex-start/end udah handle
   posisi kiri/kanan), cukup cap pakai max-width. width:auto = content-based, gak collapse. */
.rv-msg-bubble { width: auto; max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; box-sizing: border-box; }
.rv-msg.customer .rv-msg-bubble { background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.rv-msg.cs .rv-msg-bubble, .rv-msg.bot .rv-msg-bubble { background: #fff; color: #1a1a2e; border: 1px solid #e8ecf1; border-bottom-left-radius: 4px; max-width: 75%; }
/* v3.26: CS reply = brand green di light mode juga (unify sama dark, beda dari bot yg netral) */
.rv-msg.cs .rv-msg-bubble { background: #16a34a; color: #fff; border-color: transparent; }
.rv-msg.system .rv-msg-bubble { background: transparent; color: #9ca3af; font-size: 12px; text-align: center; padding: 4px 12px; border: none; max-width: 100%; }
/* v3.9 (B2/B5): pesan dihapus = tombstone netral abu (override warna brand bubble) */
.rv-msg .rv-msg-bubble.rv-msg-deleted { background: #f1f3f5 !important; color: #9ca3af !important; border: 1px solid #e8ecf1 !important; font-style: italic; font-size: 13px; }
.rv-msg-sender { font-size: 11px; font-weight: 600; color: #6b7280; margin-bottom: 2px; padding-left: 2px; }
.rv-msg-time { font-size: 10px; color: #9ca3af; margin-top: 2px; padding: 0 2px; display: flex; align-items: center; gap: 4px; }
.rv-msg.customer .rv-msg-time { justify-content: flex-end; }
.rv-msg-product { border-radius: 12px; overflow: hidden; border: 1px solid #e8ecf1; background: #fff; max-width: 280px; }
.rv-msg-product-img { width: 100%; height: 140px; object-fit: cover; }
.rv-msg-product-body { padding: 12px; }
.rv-msg-product-title { font-size: 14px; font-weight: 600; color: #1a1a2e; margin-bottom: 4px; }
.rv-msg-product-price { font-size: 15px; font-weight: 700; color: #16a34a; margin-bottom: 8px; }
.rv-msg-product-price .compare { font-size: 12px; color: #9ca3af; text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.rv-msg-product-btn { display: block; text-align: center; background: #2563eb; color: #fff; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background 0.15s; }
.rv-msg-product-btn:hover { background: #1d4ed8; color: #fff; }

/* AI Bot Triage — kartu tap (order picker/confirm/delivered) di fullpage /chat/ */
.fp-triage-menu { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; max-width: 320px; }
.fp-triage-card { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 12px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 14px; font: inherit; }
.fp-triage-card--tap { cursor: pointer; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.fp-triage-card--tap:hover:not(:disabled) { border-color: #2563eb; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.fp-triage-card--tap:disabled { cursor: default; }
.fp-triage-card--summary { border-color: #2563eb; background: #f9fafb; }
.fp-triage-card--sel { border-color: #2563eb; background: #f9fafb; }
/* v1.2: kartu bot kayak Lab (gaya utamanya di includes/chat-widget-css.php, dipakai
   bareng widget). Di sini cuma beda lebar: layar lebar = kotak auto-fill 150-230px,
   HP = 2 kolom sama rata biar gak jatuh jadi 1 kolom di 360px. */
.fp-chat-page .rv-pk { display: flex; flex-wrap: wrap; }
.fp-chat-page .rv-pk-i { flex: 1 1 160px; min-width: 150px; max-width: 230px; }
@media (max-width: 480px) {
    .fp-chat-page .rv-pk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fp-chat-page .rv-pk-i { min-width: 0; max-width: none; }
}
.fp-chat-page .rv-stage { padding: 12px 16px 2px; }
.fp-triage-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #f5f5f5; border: 1px solid #e5e7eb; }
.fp-triage-ico { font-size: 20px; line-height: 1; flex-shrink: 0; }
.fp-triage-cbody { min-width: 0; flex: 1; }
.fp-triage-title { font-size: 14px; font-weight: 700; color: #1f2937; line-height: 1.3; }
.fp-triage-sub { font-size: 12px; color: #6b7280; font-family: monospace; margin-top: 2px; word-break: break-all; }
.fp-triage-badge { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.fp-tb-green { background: #E9FCEB; color: #16a34a; } .fp-tb-yellow { background: #FFF8E3; color: #b45309; }
.fp-tb-red { background: #FFEFEF; color: #dc2626; } .fp-tb-gray { background: #F2F2F2; color: #6b7280; }
.fp-triage-btn { width: 100%; min-height: 44px; text-align: left; padding: 10px 14px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 13px; font-weight: 600; color: #1f2937; cursor: pointer; }
.fp-triage-btn:hover:not(:disabled) { border-color: #2563eb; background: #f9fafb; }
.fp-triage-btn:disabled { cursor: default; }
.fp-triage-field { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 13px; }
.fp-triage-field span { color: #6b7280; flex-shrink: 0; min-width: 56px; }
.fp-triage-field b { flex: 1; font-family: monospace; color: #1f2937; word-break: break-all; }
.fp-triage-copy { flex-shrink: 0; padding: 4px 10px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f9fafb; color: #2563eb; font-size: 11px; font-weight: 700; cursor: pointer; }
.dark .fp-triage-card, .dark .fp-triage-btn, .dark .fp-triage-field { background: #1f1f1f; border-color: #2a2a2a; }
.dark .fp-triage-thumb { background: #f5f5f5; border-color: #2a2a2a; }
.dark .fp-triage-card--summary, .dark .fp-triage-card--sel { background: #191919; }
.dark .fp-triage-title, .dark .fp-triage-field b, .dark .fp-triage-btn { color: #fff; }
.dark .fp-triage-sub, .dark .fp-triage-field span { color: #a3a3a3; }
.dark .fp-triage-copy { background: #191919; border-color: #2a2a2a; }
.rv-chat-input-area { display: flex; align-items: flex-end; gap: 8px; background: #fff; }
.rv-chat-input-wrap { flex: 1; min-width: 0; }
.rv-chat-input { width: 100%; border: 1.5px solid #e5e7eb; border-radius: 12px; padding: 10px 14px; font-size: 14px; font-family: inherit; resize: none; outline: none; transition: border-color 0.15s; line-height: 1.5; background: #fff; }
.rv-chat-input:focus { border-color: #2563eb; }
.rv-chat-attach-btn, .rv-chat-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.15s; flex-shrink: 0; }
.rv-chat-attach-btn { background: #f3f4f6; color: #6b7280; }
.rv-chat-attach-btn:hover { background: #e5e7eb; }
.rv-chat-send-btn { background: #2563eb; color: #fff; }
.rv-chat-send-btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.rv-chat-send-btn:not(:disabled):hover { background: #1d4ed8; }
.rv-chat-connection { display: none; padding: 8px 16px; background: #fef2f2; color: #ef4444; font-size: 12px; text-align: center; align-items: center; justify-content: center; gap: 6px; }
.rv-chat-connection.show { display: flex; }
.rv-chat-prechat { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 32px 24px; text-align: center; max-width: 400px; margin: 0 auto; }
.rv-chat-prechat h3 { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.rv-chat-prechat .subtitle { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.rv-chat-field { width: 100%; margin-bottom: 14px; text-align: left; }
.rv-chat-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.rv-chat-field label .required { color: #ef4444; }
.rv-chat-field input { width: 100%; padding: 10px 14px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s; box-sizing: border-box; }
.rv-chat-field input:focus { border-color: #2563eb; }
.rv-chat-field input.error { border-color: #ef4444; }
.rv-chat-field .field-error { display: none; font-size: 12px; color: #ef4444; margin-top: 4px; }
.rv-chat-field .field-error.show { display: block; }
.rv-chat-prechat-btn { width: 100%; padding: 12px; background: #2563eb; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.rv-chat-prechat-btn:hover { background: #1d4ed8; }
.rv-chat-prechat-btn:disabled { background: #93c5fd; cursor: not-allowed; }
.rv-chat-google-divider { display: flex; align-items: center; gap: 12px; color: #9ca3af; font-size: 13px; margin: 16px 0; width: 100%; }
.rv-chat-google-divider::before, .rv-chat-google-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.rv-chat-google-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-weight: 500; color: #374151; text-decoration: none; transition: background 0.15s; }
.rv-chat-google-btn:hover { background: #f9fafb; }
.rv-chat-rating { display: none; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 32px 24px; text-align: center; }
.rv-chat-rating.show { display: flex; }
.rv-chat-rating h4 { font-size: 18px; font-weight: 700; color: #111827; margin: 8px 0 4px; }
.rv-chat-rating .subtitle { font-size: 14px; color: #6b7280; margin-bottom: 16px; }
.rv-chat-rating-stars { display: flex; gap: 8px; margin-bottom: 16px; }
.rv-chat-rating-stars .star { font-size: 32px; color: #e5e7eb; cursor: pointer; transition: color 0.15s; }
.rv-chat-rating-stars .star.active { color: #f59e0b; }
.rv-chat-rating-stars .star:hover { color: #fbbf24; }
.rv-chat-rating textarea { width: 100%; max-width: 320px; padding: 10px 14px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit; resize: none; outline: none; margin-bottom: 12px; box-sizing: border-box; }
.rv-chat-rating textarea:focus { border-color: #2563eb; }
.rv-chat-rating-submit { padding: 10px 32px; background: #2563eb; color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; margin-bottom: 8px; transition: background 0.15s; }
.rv-chat-rating-submit:disabled { background: #93c5fd; cursor: not-allowed; }
.rv-chat-rating-submit:hover:not(:disabled) { background: #1d4ed8; }
.rv-chat-rating-skip { background: none; border: none; color: #9ca3af; font-size: 13px; cursor: pointer; font-family: inherit; padding: 6px 12px; }

/* ================================================
   CHAT PAGE v3.1 — 3-Column Layout
   ================================================ */

/* Chat page: scrollable, fp-wrap takes viewport height minus header */
html.fp-chat-page body { margin: 0; }
.fp-wrap { height: calc(100vh - 180px); min-height: 500px; }
/* Footer visible on chat page */
/* Hide floating chat widget bubble on /chat/ page */
html.fp-chat-page .rv-chat-bubble,
html.fp-chat-page .rv-chat-overlay,
html.fp-chat-page .rv-chat-expanded,
html.fp-chat-page [id^="rvChat"] { display: none !important; }
/* v3.3: Hide red marquee on /chat/ — kontradiksi dgn "CS Online", customer udah commit chat di sini */
html.fp-chat-page .rv-announce-marquee { display: none !important; }

.fp-wrap {
    display: flex;
    max-width: 1680px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── LEFT PANEL ── */
.fp-left {
    width: 280px;
    border-right: 1px solid #e8ecf1;
    background: #fff;
    display: none;
    flex-direction: column;
    flex-shrink: 0;
}
.fp-ltabs {
    display: flex;
    border-bottom: 1px solid #e8ecf1;
}
.fp-ltab {
    flex: 1; padding: 13px 0; border: none; background: none;
    cursor: pointer; font-size: 13px; font-weight: 600;
    color: #9ca3af; display: flex; align-items: center;
    justify-content: center; gap: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s; font-family: inherit;
}
.fp-ltab.active { color: #2563eb; border-bottom-color: #2563eb; }
.fp-ltab:hover:not(.active) { color: #6b7280; }
.fp-lpanel { flex: 1; overflow-y: auto; display: none; }
.fp-lpanel.active { display: block; }

/* Orders */
.fp-search {
    display: flex; align-items: center; gap: 8px;
    background: #f3f4f6; border-radius: 10px; padding: 8px 12px;
    margin: 12px 14px 8px; font-size: 13px; color: #9ca3af;
}
.fp-oitem {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer; transition: all 0.15s;
    border-left: 3px solid transparent;
}
.fp-oitem:hover { background: #fafbfc; }
.fp-oitem.active { background: #eff6ff; border-left-color: #2563eb; }
.fp-oitem-row { display: flex; align-items: center; gap: 10px; }
.fp-oitem-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: #f3f4f6; display: flex; align-items: center;
    justify-content: center; font-size: 18px; flex-shrink: 0;
}
.fp-oitem.active .fp-oitem-icon { background: #dbeafe; }
.fp-oitem-name {
    font-size: 13px; font-weight: 600; color: #1a1a2e;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-oitem-ref { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.fp-oitem-price { font-size: 12px; font-weight: 600; color: #1a1a2e; text-align: right; }
.fp-oitem-date { font-size: 10px; color: #9ca3af; margin-top: 2px; text-align: right; }
/* v3.14: dropdown detail pesanan */
.fp-oitem-chev { font-size: 12px; color: #9ca3af; transition: transform 0.15s; flex-shrink: 0; }
.fp-oitem-detail { padding: 10px 0 4px; animation: fpFade 0.15s ease; }
.fp-od-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; }
.fp-od-k { color: #9ca3af; flex-shrink: 0; }
.fp-od-val { color: #374151; font-weight: 500; font-family: monospace; font-size: 11px; text-align: right; word-break: break-all; }
.fp-od-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.fp-od-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 8px; border-radius: 10px; background: #eff6ff; color: #2563eb; font-size: 12px; font-weight: 600; text-decoration: none; transition: background 0.15s; }
.fp-od-link:hover { background: #dbeafe; }
@keyframes fpFade { from { opacity: 0; } to { opacity: 1; } }

/* Quick Actions */
.fp-qalabel {
    font-size: 11px; font-weight: 600; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px; padding: 0 14px;
}
.fp-qa {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px; margin: 0 14px 5px;
    border: 1px solid #f3f4f6; cursor: pointer;
    font-size: 13px; color: #4b5563; transition: background 0.15s;
}
.fp-qa:hover { background: #fafbfc; }
.fp-qa i { font-size: 15px; }

/* Info tab */
/* v3.27: gradient+border PINDAH dari inline ke class — biar override .dark bisa nendang (inline menang dari stylesheet) */
.fp-info-online {
    background: linear-gradient(135deg,#f0fdf4 0%,#dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 14px; margin: 14px;
}
.fp-info-online-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.2);
    display: inline-block; margin-right: 6px;
}
.fp-info-stat {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-bottom: 1px solid #f3f4f6;
}
.fp-info-stat:last-child { border-bottom: none; }
.fp-info-stat .v { margin-left: auto; font-size: 13px; font-weight: 600; color: #1a1a2e; }
.fp-info-trust {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px; font-size: 13px; color: #4b5563;
}
.fp-info-trust i { color: #16a34a; font-size: 13px; }

/* ── CENTER CHAT ── */
.fp-center {
    flex: 1; display: flex; flex-direction: column;
    background: #fff; min-width: 0; min-height: 0;
    overflow: hidden;
}

/* Subheader (replaces green header) */
.fp-subhdr {
    padding: 12px 20px;
    border-bottom: 1px solid #e8ecf1;
    display: flex; align-items: center; gap: 12px;
}
.fp-subhdr-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: #2563eb; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.fp-subhdr-name { font-size: 14px; font-weight: 600; color: #1a1a2e; }
.fp-subhdr-status {
    font-size: 12px; color: #16a34a;
    display: flex; align-items: center; gap: 4px;
}
.fp-subhdr-status .dot {
    width: 6px; height: 6px; border-radius: 50%; background: #16a34a;
}
.fp-subhdr-actions { margin-left: auto; display: flex; gap: 6px; }
.fp-subhdr-btn {
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid #e8ecf1; background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #6b7280; font-size: 15px;
    transition: all 0.15s; font-family: inherit;
}
.fp-subhdr-btn:hover { background: #f9fafb; color: #1a1a2e; }
.fp-subhdr-btn.muted { color: #d1d5db; }
.fp-mobile-back { display: none; }

/* Chat body */
.fp-chat-body {
    flex: 1; display: flex; flex-direction: column;
    min-height: 0; background: #fafbfc;
}
/* v3.6: justify-content flex-end — messages stick di bottom kalau jumlahnya dikit (gak ada empty space awkward di bawah) */
.fp-chat-body .rv-chat-messages { flex: 1; background: #fafbfc; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.fp-chat-body .rv-chat-messages > .rv-msg:first-child { margin-top: auto; }

/* End chat row */
.fp-end-row {
    text-align: center; padding: 6px 0;
    border-top: 1px solid #f3f4f6; background: #fff;
}
.fp-end-row button {
    background: none; border: none; color: #d1d5db;
    font-size: 12px; cursor: pointer; padding: 4px 12px;
    transition: color 0.15s; font-family: inherit;
}
.fp-end-row button:hover { color: #ef4444; }

/* v3.19: Konfirmasi akhiri chat — full overlay backdrop + centered sheet (parity sama widget) */
.fp-confirm { display:none; position:fixed; inset:0; z-index:10001; background:rgba(15,23,42,0.45); -webkit-backdrop-filter:saturate(140%) blur(3px); backdrop-filter:saturate(140%) blur(3px); align-items:center; justify-content:center; padding:16px; box-sizing:border-box; }
.fp-confirm.show { display:flex; animation: fpFi 0.18s ease; }
.fp-confirm-card { width:100%; max-width:340px; background:#fff; border-radius:20px; box-shadow:0 16px 48px rgba(0,0,0,0.28); padding:24px 22px 20px; text-align:center; box-sizing:border-box; animation: fpConfirmIn 0.22s cubic-bezier(0.16,1,0.3,1); }
@keyframes fpConfirmIn { from { opacity:0; transform:translateY(14px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
.fp-confirm-icon { width:52px; height:52px; margin:0 auto 14px; border-radius:50%; background:#fef2f2; color:#ef4444; display:flex; align-items:center; justify-content:center; font-size:26px; }
.fp-confirm-card h4 { font-size:17px; font-weight:700; color:#111827; margin:0 0 5px; }
.fp-confirm-card p { font-size:13px; color:#6b7280; margin:0 0 20px; line-height:1.45; }
.fp-confirm-btns { display:flex; flex-direction:column; gap:9px; }
.fp-confirm-btns button { width:100%; padding:13px; border-radius:12px; font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; border:none; transition:all 0.15s; min-height:46px; }
.fp-confirm-stay { background:#2563eb; color:#fff; }
.fp-confirm-stay:hover { background:#1d4ed8; }
.fp-confirm-end { background:transparent; color:#ef4444; border:1.5px solid #fecaca; }
.fp-confirm-end:hover { background:#fef2f2; border-color:#fca5a5; }

/* Input area override */
.fp-center .rv-chat-input-area {
    padding: 12px 20px 16px;
    border-top: 1px solid #e8ecf1;
    background: #fff;
}

/* ── RIGHT PANEL ── */
.fp-right {
    width: 300px; border-left: 1px solid #e8ecf1;
    background: #fff; overflow-y: auto;
    display: none; flex-shrink: 0;
}
.fp-rprod-hero {
    background: linear-gradient(135deg, #fef2f2, #fce7f3, #ede9fe);
    padding: 24px 20px; text-align: center;
}
.fp-rprod-emoji { font-size: 48px; margin-bottom: 8px; }
.fp-rprod-title { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.fp-rprod-price { font-size: 20px; font-weight: 800; color: #16a34a; }
.fp-rprod-compare { font-size: 13px; color: #9ca3af; text-decoration: line-through; margin-left: 8px; }
.fp-rprod-disc {
    background: #fef2f2; color: #ef4444; font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 6px; margin-left: 8px;
}
.fp-rsec { padding: 14px 20px; }
.fp-rsec-label {
    font-size: 11px; font-weight: 600; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.fp-rtags { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-rtag {
    background: #f3f4f6; border-radius: 8px;
    padding: 5px 11px; font-size: 12px; color: #4b5563; font-weight: 500;
}
.fp-rbadges { display: flex; gap: 8px; padding: 0 20px 14px; }
.fp-rbadge {
    flex: 1; border-radius: 10px; padding: 10px; text-align: center;
}
.fp-rbadge i { font-size: 18px; }
.fp-rbadge p { font-size: 11px; font-weight: 600; margin-top: 4px; }
.fp-rbadge.green { background: #f0fdf4; color: #16a34a; }
.fp-rbadge.blue { background: #eff6ff; color: #2563eb; }
.fp-rcta {
    display: block; width: calc(100% - 40px); margin: 0 20px 14px;
    padding: 12px 0; background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff; border: none; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    text-align: center; text-decoration: none;
    font-family: inherit; transition: opacity 0.15s;
}
.fp-rcta:hover { opacity: 0.9; color: #fff; }
.fp-rdiv { height: 1px; background: #f3f4f6; margin: 0 20px; }
.fp-rcs-row { display: flex; align-items: center; gap: 10px; }
.fp-rcs-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: #7c3aed; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.fp-rcs-name { font-size: 14px; font-weight: 600; color: #1a1a2e; }
.fp-rcs-stars { color: #f59e0b; font-size: 12px; margin-top: 2px; }
.fp-rcs-badge {
    margin-left: auto; background: #f0fdf4; color: #16a34a;
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}
.fp-rcs-badge.off { background: #f3f4f6; color: #6b7280; }
.fp-rsess-row {
    display: flex; justify-content: space-between;
    padding: 5px 0; border-bottom: 1px solid #fafbfc;
}
.fp-rsess-row:last-child { border-bottom: none; }
.fp-rsess-k { font-size: 12px; color: #9ca3af; }
.fp-rsess-v { font-size: 12px; font-weight: 600; color: #1a1a2e; }

/* ── Right panel empty state ── */
.fp-rempty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; padding: 32px 24px; text-align: center;
}
.fp-rempty-icon { font-size: 48px; margin-bottom: 12px; }
.fp-rempty h4 { font-size: 15px; font-weight: 600; color: #1a1a2e; margin-bottom: 6px; }
.fp-rempty p { font-size: 13px; color: #9ca3af; line-height: 1.5; }

/* ── Shared ── */
.fp-topic-picker {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex: 1; padding: 32px 24px; text-align: center;
}
.fp-topic-picker h3 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.fp-topic-picker .sub { font-size: 14px; color: #6b7280; margin-bottom: 24px; }
.fp-topic-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 24px; }
.fp-topic-chip {
    padding: 10px 18px; border-radius: 24px;
    border: 1.5px solid #e5e7eb; background: #fff;
    font-size: 14px; color: #374151; cursor: pointer;
    transition: all 0.15s; user-select: none;
}
.fp-topic-chip:hover { border-color: #2563eb; color: #2563eb; }
.fp-topic-chip.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.fp-topic-start {
    background: #2563eb; color: #fff; border: none;
    padding: 12px 32px; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background 0.15s; opacity: 0.4; pointer-events: none;
    font-family: inherit;
}
.fp-topic-start.ready { opacity: 1; pointer-events: auto; }
.fp-topic-start.ready:hover { background: #1d4ed8; }

.fp-hidden { display: none !important; }

/* Lightbox */
.fp-lb-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out; animation: fpFi 0.2s ease;
}
.fp-lb-overlay img { max-width: 92vw; max-height: 92vh; border-radius: 8px; cursor: default; }
.fp-lb-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.15); border: none;
    color: #fff; width: 40px; height: 40px;
    border-radius: 50%; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
@keyframes fpFi { from { opacity: 0; } to { opacity: 1; } }

/* Date Separator */
/* v3.24: no flanking lines — date sep = teks tengah aja (ala WhatsApp) */
.fp-dsep {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 16px 0 8px; padding: 0 16px;
}
.fp-dsep::before, .fp-dsep::after { display: none; }
.fp-dsep span { font-size: 11px; color: #9ca3af; font-weight: 500; white-space: nowrap; }

/* Product Fallback */
.rv-msg-product-placeholder {
    height: 100px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fef2f2, #fce7f3, #ede9fe);
    border-radius: 12px 12px 0 0; font-size: 36px;
}

/* Loading */
.fp-ld {
    display: flex; align-items: center; justify-content: center;
    flex: 1; gap: 8px; color: #6b7280; font-size: 14px;
}
.fp-ld .sp {
    width: 24px; height: 24px;
    border: 3px solid #e5e7eb; border-top-color: #2563eb;
    border-radius: 50%; animation: fpSp 0.6s linear infinite;
}
@keyframes fpSp { to { transform: rotate(360deg); } }

/* ================================================
   DESKTOP (>=1024px): 3-column
   ================================================ */
@media (min-width: 1024px) {
    .fp-left { display: flex; }
    .fp-right { display: flex; flex-direction: column; }
    .fp-mobile-back { display: none !important; }
}

/* ── Tablet (768-1023px): chat + right panel ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .fp-right { display: flex; flex-direction: column; width: 260px; }
    .fp-mobile-back { display: none !important; }
}

/* ── Mobile (<768px): fullscreen chat ── */
@media (max-width: 767px) {
    html.fp-chat-page .sticky-header-wrapper,
    html.fp-chat-page header,
    html.fp-chat-page .site-header,
    html.fp-chat-page nav { display: none !important; }
    .fp-wrap { height: 100vh; height: 100dvh; flex: none; }
    .fp-subhdr { padding-top: max(12px, env(safe-area-inset-top, 12px)); }
    .fp-center .rv-chat-input-area {
        padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
    }
    .fp-mobile-back { display: flex !important; }
}

/* ============================================================
   DARK MODE NEUTRAL PALETTE (rule 49) — page was 100% white before.
   Activates via .dark on <html> (set by included header.php).
   base #0A0A0A / card #191919 / raised #222 / border #2a2a2a / text #fff
   ============================================================ */
.dark .fp-wrap { background:#0A0A0A; }
.dark .fp-left, .dark .fp-right { background:#191919; border-color:#2a2a2a; }
.dark .fp-center { background:#0A0A0A; }
.dark .fp-chat-body, .dark .fp-center .rv-chat-messages { background:#0A0A0A; }
.dark .fp-subhdr { background:#191919; border-color:#2a2a2a; }
.dark .fp-subhdr-name { color:#fff; }
.dark .fp-subhdr-status { color:#a3a3a3; }
.dark .fp-subhdr-btn { background:#191919; border-color:#2a2a2a; color:#bdbdbd; }
.dark .fp-subhdr-btn:hover { background:#222; color:#fff; }
.dark .fp-ltabs, .dark .fp-rsec { border-color:#2a2a2a; }
.dark .fp-ltab { color:#a3a3a3; }
.dark .fp-ltab.active { color:#5E9EFF; }
.dark .fp-search input, .dark .fp-search { background:#1f1f1f; border-color:#2a2a2a; color:#fff; }
.dark .fp-search input::placeholder { color:#737373; }
/* order list items (Pesanan / Riwayat pesanan) */
.dark .fp-oitem { border-color:#2a2a2a; }
.dark .fp-oitem:hover { background:#222; }
.dark .fp-oitem.active { background:color-mix(in srgb,#5E9EFF 13%,transparent); border-left-color:#5E9EFF; }
.dark .fp-oitem-name { color:#fff; }
.dark .fp-oitem-ref, .dark .fp-oitem-date { color:#a3a3a3; }
.dark .fp-oitem-price { color:#fff; }
.dark .fp-oitem-icon { background:#222; }
.dark .fp-oitem.active .fp-oitem-icon { background:color-mix(in srgb,#5E9EFF 22%,transparent); }
.dark .fp-oitem-detail { background:#191919; border-color:#2a2a2a; }
.dark .fp-od-k { color:#a3a3a3; }
.dark .fp-od-val { color:#fff; }
.dark .fp-od-link { background:color-mix(in srgb,#5E9EFF 13%,transparent); color:#5E9EFF; }
/* right panel: info stats, product card, CS, session */
.dark .fp-info-stat { background:#191919; border-color:#2a2a2a; color:#fff; }
.dark .fp-info-online { background:color-mix(in srgb,#34E646 13%,transparent); border-color:color-mix(in srgb,#34E646 35%,transparent); }
/* v3.27: teks dalam kartu pakai inline color hardcoded → lift ke accent terang biar kebaca di dark */
.dark .fp-info-online [style*="color:#15803d"] { color:#34E646 !important; }
.dark .fp-info-online [style*="color:#b45309"], .dark .fp-info-online [style*="color:#92400e"] { color:#F0D030 !important; }
.dark .fp-info-online [style*="color:#4b5563"] { color:#a3a3a3 !important; }
/* v3.27: badge "Online/Offline" di CS yang Melayani — was pastel pill (light) di dark */
.dark .fp-rcs-badge { background:color-mix(in srgb,#34E646 13%,transparent); color:#34E646; }
.dark .fp-rcs-badge.off { background:#222; color:#a3a3a3; }
.dark .fp-info-trust { color:#a3a3a3; }
.dark .fp-rsec-label { color:#a3a3a3; }
.dark .fp-rsess-k { color:#a3a3a3; }
.dark .fp-rsess-v, .dark .fp-rprod-title { color:#fff; }
.dark .fp-rprod-hero { background:#222; }
.dark .fp-rprod-price { color:#fff; }
.dark .fp-rprod-compare { color:#737373; }
.dark .fp-rcs-name { color:#fff; }
.dark .fp-rdiv { background:#2a2a2a; }
.dark .fp-qa { background:#191919; border-color:#2a2a2a; }
.dark .fp-qa:hover { background:#222; }
.dark .fp-qalabel { color:#e5e5e5; }
.dark .fp-topic-chip { background:#191919; border-color:#2a2a2a; color:#e5e5e5; }
.dark .fp-topic-picker { color:#fff; }
/* rule 49: greeting + subtitle + stat value + product name — was dark-on-dark (invisible) */
.dark .fp-topic-picker h3 { color:#fff; }
.dark .fp-topic-picker .sub { color:#a3a3a3; }
.dark .fp-info-stat .v { color:#fff; }
.dark .fp-rprod-litem { border-bottom-color:#2a2a2a !important; }
.dark .fp-rprod-litem-name { color:#fff !important; }
.dark .fp-rprod-litem-ic { background:#222 !important; }
/* chat surfaces */
.dark .rv-msg.cs .rv-msg-bubble { background:#16a34a; color:#fff; border-color:transparent; } /* rule 49: CS/admin reply = brand green, no white ring */
.dark .rv-msg.bot .rv-msg-bubble { background:#222; color:#fff; border-color:#2a2a2a; }
.dark .rv-msg.customer .rv-msg-bubble { background:#2563eb; color:#fff; } /* keep brand blue, readable */
.dark .rv-msg-product { background:#191919; border-color:#2a2a2a; }
.dark .rv-chat-input-area { background:#191919; border-color:#2a2a2a; }
.dark .rv-chat-input { background:#1f1f1f; border-color:#2a2a2a; color:#fff; }
.dark .rv-chat-input::placeholder { color:#737373; }
.dark .rv-chat-google-btn { background:#191919; border-color:#2a2a2a; color:#e5e5e5; }
.dark .rv-chat-google-btn:hover { background:#222; }
/* confirm/lightbox modals */
.dark .fp-confirm-card { background:#191919; color:#fff; }
.dark .fp-confirm-stay { background:#222; color:#fff; }
/* v3.22 (rule 49 c3): footer Akhiri Chat — was white seam di dark mode */
.dark .fp-end-row { background:#191919; border-top-color:#2a2a2a; }
.dark .fp-end-row button { color:#a3a3a3; }
.dark .fp-end-row button:hover { color:#ff6a56; }
/* v3.22: system event = hairline divider tipis (bukan teks+timestamp chunky) */
/* v3.24: no flanking lines — system marker = teks tengah aja */
.rv-msg-divider { display:flex; align-items:center; justify-content:center; gap:10px; margin:6px 4px; padding:0; }
.rv-msg-divider::before, .rv-msg-divider::after { display:none; }
.rv-msg-divider span { font-size:11px; font-weight:500; color:#9ca3af; white-space:nowrap; text-align:center; }
.dark .rv-msg-divider span { color:#737373; }
/* rule 49 c3: NO white hairlines — catch leftover light borders */
.dark [style*="border:1px solid #e8ecf1"],
.dark [style*="1px solid #e5e7eb"] { border-color:#2a2a2a !important; }

/* ── v1.1 (3 Okt 2026): audit /chat/ ── */
/* Dark mode: judul login + rating dulu #111827 di atas #0A0A0A, praktis gak kelihatan. */
.dark .rv-chat-prechat h3,
.dark .rv-chat-rating h4,
.dark .fp-rated-title { color: #f5f5f5; }
.fp-rated-title { color: #111827; }
/* Pesan sistem panjang (peringatan idle ~80 huruf) dulu nowrap = layar 375px geser ke samping. */
.rv-msg-divider span { white-space: normal; max-width: 90%; line-height: 1.4; }
/* Akhiri Chat: dulu #d1d5db 12px tinggi ~24px - hampir gak kelihatan & susah dipencet. */
.fp-end-row button { color: #6b7280; font-size: 13px; min-height: 44px; padding: 8px 16px; }
.dark .fp-end-row button { color: #a3a3a3; }
@media (max-width: 640px) { .fp-subhdr-btn { width: 44px; height: 44px; } }
/* Bintang rating jadi <button> biar bisa diisi pakai keyboard. */
.rv-chat-rating-stars button.star { background: none; border: 0; padding: 4px; min-width: 44px; min-height: 44px; line-height: 1; font: inherit; }
.rv-chat-rating-stars button.star:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 8px; }
.rv-chat-rating-stars button.star i { font-size: 32px; color: inherit; }
