/**
 * Developed by Mohammad Rameez Imdad (Rameez Scripts)
 * WhatsApp: https://wa.me/923435347417 (For Custom Projects)
 * YouTube: https://www.youtube.com/@rameezimdad (Subscribe for more!)
 *
 * Report a problem / suggest an app — labelled pill (bottom left, above the back-to-top + chat
 * buttons) and a two-mode panel. Public header tokens (--c-*) with literal fallbacks.
 */
.rp-fab { position:fixed; left:18px; bottom:96px; z-index:989; height:44px; padding:0 16px 0 14px; border:0; border-radius:999px; display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-family:inherit; font-size:14px; font-weight:700; line-height:1; color:var(--c-on-accent, #fff); background:var(--c-accent, #FF5A4A); box-shadow:0 8px 24px rgba(var(--c-accent-rgb, 255,90,74), .38), 0 2px 6px rgba(0,0,0,.14); transition:transform .2s, box-shadow .2s; touch-action:manipulation; }
.rp-fab:hover, .rp-fab[aria-expanded="true"] { transform:translateY(-2px); box-shadow:0 12px 28px rgba(var(--c-accent-rgb, 255,90,74), .45), 0 2px 6px rgba(0,0,0,.14); }
.rp-fab:focus-visible { outline:3px solid var(--c-primary, #1A0A0C); outline-offset:3px; }
.rp-fab i { font-size:17px; animation:rpWiggle 3.6s ease-in-out 1.5s infinite; transform-origin:50% 60%; }
.rp-fab::after { content:''; position:absolute; inset:0; border-radius:inherit; border:2px solid var(--c-accent, #FF5A4A); animation:rpPing 2.4s ease-out infinite; pointer-events:none; }
.rp-fab[aria-expanded="true"]::after, .rp-fab[aria-expanded="true"] i { animation:none; }
@keyframes rpPing { 0% { transform:scale(1); opacity:.7; } 80%, 100% { transform:scale(1.35, 1.6); opacity:0; } }
@keyframes rpWiggle { 0%, 82%, 100% { transform:rotate(0); } 86% { transform:rotate(-14deg) scale(1.12); } 90% { transform:rotate(12deg) scale(1.12); } 94% { transform:rotate(-6deg); } }

.rp-panel { position:fixed; left:18px; bottom:152px; z-index:996; width:min(400px, calc(100vw - 32px)); max-height:calc(100vh - 176px); display:flex; flex-direction:column; border-radius:16px; overflow:hidden; background:var(--c-card, #fff); color:var(--c-ink, #1a1a1a); border:1px solid var(--c-line, rgba(0,0,0,.1)); box-shadow:0 18px 50px rgba(0,0,0,.24); }
.rp-panel[hidden] { display:none; }
.rp-head { display:flex; align-items:flex-start; gap:12px; padding:16px 16px 14px; background:var(--c-accent, #FF5A4A); color:var(--c-on-accent, #fff); }
.rp-head b { display:block; font-size:17px; }
.rp-head small { display:block; margin-top:4px; font-size:13px; line-height:1.4; opacity:.92; }
.rp-x { margin-left:auto; flex:0 0 36px; height:36px; border:0; border-radius:8px; background:rgba(255,255,255,.16); color:inherit; cursor:pointer; font-size:17px; }
.rp-x:hover { background:rgba(255,255,255,.28); }

.rp-body, .rp-done { display:flex; flex-direction:column; gap:14px; padding:16px; overflow:auto; }
.rp-body[hidden], .rp-done[hidden], .rp-guest[hidden], .rp-me[hidden], .rp-err[hidden], .rp-set[hidden] { display:none; }
.rp-set { display:flex; flex-direction:column; gap:14px; margin:0; padding:0; border:0; min-width:0; }
.rp-guest { display:flex; flex-direction:column; gap:14px; padding-top:14px; border-top:1px solid var(--c-line, rgba(0,0,0,.1)); }

.rp-modes { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.rp-mode { position:relative; cursor:pointer; }
.rp-mode input, .rp-chip input { position:absolute; opacity:0; pointer-events:none; }
.rp-mode span { display:flex; align-items:center; justify-content:center; gap:8px; height:100%; min-height:44px; box-sizing:border-box; padding:8px 10px; border:1.5px solid var(--c-line, #d5d9e0); border-radius:999px; transition:border-color .15s, background .15s, color .15s; }
.rp-mode i { font-size:15px; color:var(--c-accent-strong, #CC483B); }
.rp-mode b { font-size:14px; white-space:nowrap; }
.rp-mode input:checked + span i { color:inherit; }
.rp-mode small { font-size:12px; line-height:1.35; opacity:.7; }
.rp-mode input:checked + span { border-color:var(--c-accent, #FF5A4A); background:var(--c-accent, #FF5A4A); color:var(--c-on-accent, #fff); }
.rp-mode input:focus-visible + span, .rp-chip input:focus-visible + span { outline:2px solid var(--c-accent, #FF5A4A); outline-offset:2px; }

.rp-q { display:flex; flex-direction:column; gap:6px; margin:0; }
.rp-l { font-size:13px; font-weight:600; }
.rp-l i { width:16px; margin-right:2px; opacity:.65; }
.rp-l em { font-style:normal; font-weight:400; opacity:.6; margin-left:4px; }
.rp-body input[type="text"], .rp-body input[type="email"], .rp-body textarea { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid var(--c-line, #d5d9e0); border-radius:10px; background:var(--c-bg, #fff); color:inherit; font-family:inherit; font-size:16px !important; font-weight:400; line-height:1.4; resize:vertical; touch-action:manipulation; -webkit-text-size-adjust:100%; }
.rp-body input[type="text"]:focus, .rp-body input[type="email"]:focus, .rp-body textarea:focus { outline:0; border-color:var(--c-accent, #FF5A4A); box-shadow:0 0 0 3px rgba(var(--c-accent-rgb, 255,90,74), .15); }
.rp-chips { display:flex; flex-wrap:wrap; gap:6px; }
.rp-chip { position:relative; cursor:pointer; }
.rp-chip span { display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border:1px solid var(--c-line, #d5d9e0); border-radius:999px; font-size:13px; transition:background .15s, border-color .15s; }
.rp-chip input:checked + span { border-color:var(--c-accent, #FF5A4A); background:var(--c-accent, #FF5A4A); color:var(--c-on-accent, #fff); }

.rp-trap { position:absolute !important; left:-9999px !important; width:1px !important; height:1px !important; opacity:0 !important; }
.rp-me { margin:0; font-size:13px; opacity:.8; }
.rp-err { margin:0; padding:8px 10px; border-radius:8px; font-size:13px; background:rgba(220,53,69,.1); color:#b02a37; }
.rp-send { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:46px; border:0; border-radius:10px; cursor:pointer; font-family:inherit; font-size:15px; font-weight:700; line-height:1; color:var(--c-on-accent, #fff); background:var(--c-accent, #FF5A4A); }
.rp-send:disabled { opacity:.7; cursor:wait; }
.rp-done { align-items:center; text-align:center; padding:32px 20px 24px; }
.rp-done > i { font-size:44px; color:#1f9d55; }
.rp-done b { font-size:17px; }
.rp-done small { font-size:13px; line-height:1.45; opacity:.75; }

@media (max-width: 900px) {
    .rp-fab { left:14px; height:44px; width:44px; padding:0; justify-content:center; bottom:calc(max(var(--ph-bottom-nav-h, 66px), 78px) + env(safe-area-inset-bottom, 0px) + 80px); }
    .rp-fab-txt { display:none; }
    /* phone = full-screen sheet above the site header + bottom nav; only the form scrolls */
    .rp-panel { inset:0; width:auto; max-height:none; height:100%; height:100dvh; border-radius:0; border:0; z-index:100000; padding-top:env(safe-area-inset-top, 0px); }
    .rp-body { padding-bottom:calc(20px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
    .rp-chip span { min-height:40px; }
    .rp-x { flex-basis:44px; height:44px; }
    html.rp-open, html.rp-open body { overflow:hidden; }
    html.lc-open .rp-fab, html.rp-open .lc-fab { display:none; }
}
@media (prefers-reduced-motion: reduce) { .rp-fab, .rp-mode span, .rp-chip span { transition:none; } .rp-fab i, .rp-fab::after { animation:none; } }
.rp-panel a, .rp-panel button { text-decoration:none; }
@media (max-width: 400px) { .rp-mode b { font-size:13px; } .rp-mode span { gap:6px; padding:8px 6px; } }
/* portal (signed in): stacked right above the Help Center button, panel opens on the right */
.rp-fab.rp-portal { left:auto; right:24px; bottom:92px; }
.rp-panel.rp-portal { left:auto; right:24px; bottom:148px; }
body.page-help .rp-fab.rp-portal { bottom:24px; }   /* help button hidden there */
@media (max-width: 900px) {
    .rp-fab.rp-portal { left:auto; right:20px; bottom:calc(var(--ph-bottom-nav-h, 80px) + 78px + env(safe-area-inset-bottom, 0px)); }
    body.page-help .rp-fab.rp-portal { bottom:calc(var(--ph-bottom-nav-h, 80px) + 14px + env(safe-area-inset-bottom, 0px)); }
    .rp-panel.rp-portal { right:0; }
}
/* compact chat-widget size (360 x up to 560, like standard live-chat boxes) — overrides above */
@media (min-width: 901px) {
    .rp-panel { width:360px; max-height:min(560px, calc(100vh - 176px)); border-radius:14px; }
    .rp-head { padding:12px 14px; gap:10px; }
    .rp-head b { font-size:15px; }
    .rp-head small { font-size:12px; margin-top:2px; }
    .rp-x { flex-basis:30px; height:30px; font-size:15px; }
    .rp-body { gap:10px; padding:12px 14px 14px; }
    .rp-set, .rp-guest { gap:10px; }
    .rp-guest { padding-top:10px; }
    .rp-modes { gap:6px; }
    .rp-mode span { min-height:36px; padding:6px 8px; gap:6px; }
    .rp-mode b { font-size:13px; }
    .rp-mode i { font-size:13px; }
    .rp-q { gap:4px; }
    .rp-l { font-size:12px; }
    .rp-chips { gap:4px; }
    .rp-chip span { min-height:28px; padding:0 10px; font-size:12px; }
    .rp-body input[type="text"], .rp-body input[type="email"], .rp-body textarea { padding:7px 10px; border-radius:8px; font-size:14px !important; }
    .rp-me { font-size:12px; }
    .rp-send { min-height:40px; font-size:14px; border-radius:8px; }
    .rp-done { padding:24px 16px 18px; gap:10px; }
    .rp-done > i { font-size:36px; }
}
@media (max-width: 900px) {
    .rp-head { padding:12px 14px; }
    .rp-body { gap:12px; padding:14px; }
    .rp-set, .rp-guest { gap:12px; }
}
/* stay above the sticky site header and never slide under it on short windows */
@media (min-width: 901px) {
    .rp-panel { z-index:1101; max-height:min(560px, calc(100vh - 152px - 96px)); }
    .rp-panel.rp-portal { max-height:min(560px, calc(100vh - 148px - 80px)); }
}
.rp-modes.rp-modes-3 { grid-template-columns:repeat(3, 1fr); }
/* success screen */
.rp-done { padding:28px 18px 20px; gap:8px; }
.rp-done-ic { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; margin-bottom:6px; background:rgba(31,157,85,.12); color:#1f9d55; font-size:24px; animation:rpPop .45s cubic-bezier(.34,1.56,.64,1) both; }
.rp-done-ic i { animation:rpPop .45s .15s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes rpPop { from { transform:scale(.3); opacity:0; } to { transform:scale(1); opacity:1; } }
.rp-done b { font-size:16px; }
.rp-done small { max-width:280px; font-size:13px; line-height:1.5; opacity:.75; }
.rp-ref { font-style:normal; font-size:12px; font-weight:600; padding:3px 10px; border-radius:999px; background:rgba(0,0,0,.05); opacity:.8; }
.rp-ref[hidden] { display:none; }
html[data-theme="dark"] .rp-ref { background:rgba(255,255,255,.08); }
.rp-done-acts { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; margin-top:10px; }
.rp-done-acts .rp-send, .rp-btn2 { min-height:40px; padding:0 14px; border-radius:8px; font-family:inherit; font-size:14px; font-weight:700; line-height:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; white-space:nowrap; }
.rp-btn2 { border:1.5px solid var(--c-line, #d5d9e0); background:transparent; color:inherit; }
.rp-btn2:hover { border-color:var(--c-accent, #FF5A4A); color:var(--c-accent-strong, #CC483B); }
@media (max-width: 900px) { .rp-done { padding-top:40px; } .rp-done-acts .rp-send, .rp-btn2 { min-height:46px; } }
@media (prefers-reduced-motion: reduce) { .rp-done-ic, .rp-done-ic i { animation:none; } }
.rp-board { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; font-size:13px; font-weight:600; color:var(--c-accent-strong, #CC483B); background:rgba(var(--c-accent-rgb, 255,90,74), .08); }
.rp-board .fa-arrow-right { margin-left:auto; font-size:11px; }
