/* PAM Recharge Help & Support. Brand: navy #071949, blue #1464f4, cyan, amber. AI = navy/cyan; human = white/amber. */
.sp-top { display: grid; gap: 16px; grid-template-columns: 1.1fr 1fr; margin-bottom: 20px; }
.sp-ai { background: linear-gradient(150deg, var(--navy), var(--navy-2)); border-radius: 14px; color: #fff; padding: 22px; }
.sp-ai h2, .sp-human h2 { font-size: 20px; margin: 0; }
.sp-ai p { color: #cfdcf7; font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
.sp-ai-head { align-items: center; display: flex; gap: 14px; }
.sp-ai-icon { align-items: center; background: rgba(29,184,255,.18); border-radius: 12px; color: var(--cyan); display: grid; height: 44px; place-items: center; width: 44px; }
.sp-live { align-items: center; color: #7fe3c0; display: inline-flex; font-size: 12px; font-weight: 700; gap: 6px; }
.sp-live i { background: #3ad29f; border-radius: 50%; height: 7px; width: 7px; }
.sp-fine { color: var(--muted); font-size: 12px; line-height: 1.5; }
.sp-ai .sp-fine { color: #a9bce6; }
.sp-human { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 14px; padding: 22px; }
.sp-human p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 10px 0 0; }
.sp-email-label { font-size: 11px !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sp-email { color: var(--blue); display: inline-block; font-size: 17px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sp-btn { align-items: center; border: 0; border-radius: 10px; cursor: pointer; display: inline-flex; font: inherit; font-size: 14px; font-weight: 700; justify-content: center; min-height: 46px; padding: 0 18px; text-align: center; text-decoration: none; }
.sp-btn:disabled { cursor: not-allowed; opacity: .55; }
.sp-btn-primary { background: var(--blue); color: #fff; }
.sp-btn-quiet { background: var(--soft); color: var(--blue); }
.sp-btn-light { background: #fff; color: var(--navy); margin-top: 18px; }
.sp-card { margin-bottom: 20px; }
.sp-card h2 { margin-top: 0; }
.sp-form { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 16px; }
.sp-form .field { min-width: 0; }
.sp-form input, .sp-form select, .sp-form textarea { font-size: 16px; max-width: 100%; min-height: 46px; width: 100%; }
.sp-form textarea { min-height: 120px; }
.sp-full { grid-column: 1 / -1; }
.sp-opt { color: #a3afbf; font-weight: 400; }
.sp-error { color: var(--red); font-size: 13px; font-weight: 600; margin: 0; }
.sp-list-head { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.sp-list-head h2 { margin: 0; }
.sp-role { background: #fff4d6; border-radius: 99px; color: #8a5d00; font-size: 11px; font-weight: 700; padding: 4px 10px; }
.sp-sub { margin: 6px 0 0; }
.sp-rows { list-style: none; margin: 14px 0 0; padding: 0; }
.sp-row { align-items: center; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; font: inherit; gap: 12px; justify-content: space-between; min-height: 60px; padding: 10px 2px; text-align: left; width: 100%; }
.sp-row-main { display: grid; gap: 3px; min-width: 0; }
.sp-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row-main small { color: var(--muted); font-size: 12px; }
.sp-pill { background: var(--soft); border-radius: 99px; color: var(--blue); flex: none; font-size: 11px; font-weight: 700; padding: 4px 10px; }
.sp-pill.sp-in_progress { background: #fff4d6; color: #8a5d00; }
.sp-pill.sp-resolved, .sp-pill.sp-closed { background: #e2f6ee; color: var(--green); }
.sp-empty { color: var(--muted); padding: 22px 0 6px; text-align: center; }
.sp-empty-mark { border: 2px dashed var(--line); border-radius: 12px; display: block; height: 38px; margin: 0 auto 10px; width: 54px; }
.sp-skel { display: grid; gap: 10px; margin-top: 16px; }
.sp-skel i { animation: sp-pulse 1.2s ease-in-out infinite; background: var(--soft); border-radius: 8px; height: 54px; }
@keyframes sp-pulse { 50% { opacity: .45; } }
.sp-link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; font-weight: 700; min-height: 44px; padding: 0; }
.sp-detail-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.sp-detail-head h3 { margin: 0; overflow-wrap: anywhere; }
.sp-meta { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sp-summary { background: var(--soft); border-radius: 10px; font-size: 13px; padding: 10px 14px; }
.sp-summary p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sp-thread { display: grid; gap: 10px; margin: 14px 0; }
.sp-bubble { border-radius: 12px; max-width: 92%; padding: 10px 14px; }
.sp-bubble b { font-size: 12px; }
.sp-bubble p { font-size: 14px; line-height: 1.5; margin: 4px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sp-bubble small { color: var(--muted); font-size: 11px; }
.sp-b-customer { background: var(--soft); justify-self: start; }
.sp-b-team { background: #fff4d6; justify-self: end; }
.sp-reply { display: grid; gap: 12px; }
.sp-reply textarea, .sp-reply select { font-size: 16px; min-height: 46px; width: 100%; }
.sp-reply textarea { min-height: 90px; }
.sp-legal { display: flex; gap: 18px; justify-content: center; margin: 4px 0 24px; }
.sp-legal a { color: var(--blue); font-size: 13px; font-weight: 700; padding: 10px 0; }

/* chat overlay */
body.sp-lock { overflow: hidden; }
.sp-overlay { background: rgba(7,25,73,.55); bottom: auto; height: var(--sp-vh, 100dvh); left: 0; position: fixed; right: 0; top: var(--sp-top, 0); z-index: 1000; }
.sp-chat { background: #f5f8fd; display: flex; flex-direction: column; height: 100%; margin: 0 auto; max-width: 760px; width: 100%; }
.sp-chat-head { align-items: center; background: var(--navy); color: #fff; display: flex; gap: 8px; padding: 8px 10px; }
.sp-chat-title { flex: 1; min-width: 0; }
.sp-chat-title h2 { font-size: 16px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-icon-btn { align-items: center; background: rgba(255,255,255,.1); border: 0; border-radius: 10px; color: #fff; cursor: pointer; display: grid; height: 44px; place-items: center; width: 44px; }
.sp-chat-banner { background: #e3f1ff; color: var(--navy); font-size: 12px; font-weight: 600; line-height: 1.4; padding: 8px 14px; }
.sp-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 14px 0; }
.sp-tools label { color: var(--muted); display: grid; font-size: 11px; font-weight: 700; gap: 3px; min-width: 0; }
.sp-tools select { background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; max-width: 100%; min-height: 40px; padding: 0 8px; }
.sp-msgs { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; }
.sp-intro { color: var(--muted); font-size: 14px; line-height: 1.55; }
.sp-msg { display: grid; gap: 3px; max-width: 88%; }
.sp-who { color: var(--muted); font-size: 11px; font-weight: 700; }
.sp-text { border-radius: 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; padding: 10px 14px; white-space: pre-wrap; }
.sp-msg-user { align-self: flex-end; justify-items: end; }
.sp-msg-user .sp-text { background: var(--blue); border-bottom-right-radius: 4px; color: #fff; }
.sp-msg-ai { align-self: flex-start; }
.sp-msg-ai .sp-text { background: #fff; border: 1px solid #cfe0f7; border-bottom-left-radius: 4px; border-left: 3px solid var(--cyan); }
.sp-msg-err { align-self: stretch; max-width: 100%; }
.sp-msg-err .sp-text { background: #fdecef; color: #8f2434; white-space: normal; }
.sp-typing i { animation: sp-pulse 1s infinite; background: var(--cyan); border-radius: 50%; display: inline-block; height: 5px; margin-left: 3px; width: 5px; }
.sp-foot { background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 30dvh; overflow-y: auto; }
.sp-chips[hidden] { display: none; }
.sp-chip { max-width: 100%; white-space: normal; text-align: left; line-height: 1.25; background: var(--soft); border: 1px solid #cfe0f7; border-radius: 99px; color: var(--navy); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; min-height: 44px; padding: 6px 12px; }
.sp-escalate { background: #fff8e5; border-left: 4px solid var(--amber); border-radius: 10px; margin-bottom: 8px; padding: 10px 12px; }
.sp-escalate .sp-actions { margin-top: 8px; }
.sp-escalate .sp-btn { min-height: 44px; }
.sp-composer { align-items: flex-end; display: flex; gap: 8px; }
.sp-composer textarea { border: 1px solid var(--line); border-radius: 12px; flex: 1; font: inherit; font-size: 16px; line-height: 1.4; max-height: 132px; min-height: 46px; padding: 11px 12px; resize: none; }
.sp-send { align-items: center; background: var(--blue); border: 0; border-radius: 12px; color: #fff; cursor: pointer; display: grid; flex: none; height: 46px; place-items: center; width: 46px; }
.sp-send:disabled { opacity: .45; }
.sp-count { color: var(--muted); font-size: 11px; min-height: 0; text-align: right; }

@media (max-width: 768px) {
  .sp-top, .sp-form { grid-template-columns: 1fr; }
  .sp-actions .sp-btn { flex: 1 1 100%; }
  .sp-bubble { max-width: 100%; }
}
@media (min-width: 769px) {
  .sp-overlay { align-items: center; display: flex; justify-content: center; }
  .sp-chat { border-radius: 16px; height: min(720px, 92%); overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sp-skel i, .sp-typing i { animation: none; } }

.sp-overlay, .sp-chat, .sp-msgs, .sp-foot, .sp-tools { max-width: 100%; overflow-x: hidden; }
.sp-escalate b { overflow-wrap: anywhere; }
@media (max-height: 520px) { .sp-chips, .sp-chat-banner, .sp-tools { display: none; } .sp-escalate { display: none; } .sp-msgs { padding: 8px 12px; } }
