/* New business controls and state handling only; original page styles live in reference/. */
[hidden]{display:none!important}
[data-customer-service-enabled="0"] [data-customer-service-entry]{display:none!important}
[data-action="toggle-bill"] .lucide-chevron-up{transform:rotate(180deg);transition:transform .2s ease;transform-origin:center}
[data-action="toggle-bill"][aria-expanded="true"] .lucide-chevron-up{transform:rotate(0deg)}
@media(prefers-reduced-motion:reduce){[data-action="toggle-bill"] .lucide-chevron-up{transition:none}}
.xf-state{position:fixed;bottom:calc(80px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:calc(100% - 32px);max-width:418px;padding:14px;text-align:center;color:#6b7280;background:#fff;box-shadow:0 2px 12px #00000014;border-radius:8px;z-index:60}
.xf-state button{margin-left:12px;color:#2563eb}
.xf-toast{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);max-width:calc(100% - 32px);padding:12px 18px;border-radius:8px;background:#111827eb;color:#fff;text-align:center;font-size:14px;z-index:11000}
.xf-confirm{position:fixed;inset:0;margin:auto;width:calc(100% - 48px);max-width:360px;max-height:calc(100dvh - 48px);overflow:auto;border:0;border-radius:16px;padding:24px;box-shadow:0 20px 40px #0003}
.xf-confirm::backdrop{background:#0008}
#xf-home-summary[data-home-state="loading"],#xf-home-summary[data-home-state="empty"],#xf-home-summary[data-home-state="normal"]{background:#eff6ff;border-color:#bfdbfe}
#xf-home-summary[data-home-state="loading"] p,#xf-home-summary[data-home-state="loading"] h1,#xf-home-summary[data-home-state="empty"] p,#xf-home-summary[data-home-state="empty"] h1,#xf-home-summary[data-home-state="normal"] p,#xf-home-summary[data-home-state="normal"] h1{color:#2563eb}
#xf-home-summary[data-home-state="settled"]{background:#f0fdf4;border-color:#bbf7d0}
#xf-home-summary[data-home-state="settled"] p,#xf-home-summary[data-home-state="settled"] h1{color:#16a34a}
[data-action="repayment"]:not([data-home-state="overdue"]){animation:none;--tw-ring-color:transparent;background:#2563eb}
[data-action="repayment"][data-home-state="loading"]{background:#9ca3af}
[data-action="repayment"][data-home-state="settled"]{background:#16a34a}
.user-popup-blocked{overflow:hidden}
dialog.xf-reference-notice{border:0;padding:0;width:calc(100% - 32px);max-width:384px;max-height:calc(100dvh - 32px);overflow:auto;background:transparent;color:inherit;margin:auto}
dialog.xf-reference-notice::backdrop{background:#0009}
dialog.xf-reference-notice #user-popup-message{max-height:45dvh;overflow:auto;overflow-wrap:anywhere}
[data-frontend-page="profile_info"] [data-bind]{min-width:0;overflow-wrap:anywhere;text-align:right;margin-left:12px}
.xf-payment-card{padding:16px;background:#fff;border-radius:12px;box-shadow:0 2px 12px #00000014;margin-bottom:16px}
.xf-payment-card label{display:block;margin-bottom:10px;font-weight:600;color:#1f2937}
.xf-payment-card select{width:100%;padding:10px;border:1px solid #e5e7eb;border-radius:8px;background:#fff}
.xf-payment-row{display:flex;justify-content:space-between;gap:16px;font-size:14px;margin-top:12px;color:#6b7280}
.xf-payment-row span:last-child{color:#1f2937;text-align:right;overflow-wrap:anywhere;min-width:0}
.xf-payment-button{padding:11px 16px;border-radius:8px;background:#2563eb;color:#fff;font-size:14px}
.xf-payment-button:disabled{opacity:.5}
#xf-receipt-preview{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
#xf-receipt-preview img{width:80px;height:80px;object-fit:cover}
#xf-upload-result{font-size:13px;margin-top:12px;color:#6b7280;overflow-wrap:anywhere}
#xf-upload-progress{width:100%;height:8px;accent-color:#2563eb}
#xf-qr{max-width:180px;margin:20px auto}
#img-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:#000c;z-index:9999;padding:20px}
#img-modal img{max-width:92vw;max-height:88dvh;object-fit:contain}
#img-modal button{position:absolute;right:16px;top:16px;color:#fff;font-size:30px}
.xf-proof{max-width:450px;margin:auto;min-height:100dvh;background:#f9fafb}
.xf-proof-paper{margin:16px;padding:24px 20px;background:white;border-radius:12px;box-shadow:0 2px 12px #00000014;font-size:14px;line-height:2}
.xf-proof-paper p{margin:12px 0;overflow-wrap:anywhere}
.xf-proof-stamp{position:relative;min-height:150px;text-align:right;padding-top:50px}
.xf-proof-stamp img{position:absolute;right:0;top:0;width:130px}
/* Native chat retains chat-static.html's appearance with existing transport controls. */
[data-frontend-page="customer_service"] #root>div{height:100dvh;min-height:0}
[data-native-chat]{display:flex;flex:1;min-height:0;flex-direction:column;background:#f5f7fa;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.xf-chat{display:flex;flex-direction:column;flex:1;min-height:0}
.xf-chat .agent{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid #e5e7eb;background:#fff}
.xf-chat .avatar{display:grid;width:38px;height:38px;flex:0 0 38px;place-items:center;border-radius:50%;background:#dbeafe;color:#2563eb;font-size:18px;font-weight:700}
.xf-chat .agent-name{font-size:15px;font-weight:700}
.xf-chat .agent-status{margin-top:3px;color:#16a34a;font-size:12px}
.xf-chat .messages{display:flex;flex:1;min-height:0;flex-direction:column;gap:14px;overflow-y:auto;overflow-anchor:none;padding:18px 14px 24px}
.xf-chat .msg{display:flex;align-items:flex-start;gap:8px;flex-shrink:0}
.xf-chat .msg.user{justify-content:flex-end}
.xf-chat .msg.admin:before{content:'客';display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border-radius:50%;background:#dbeafe;color:#2563eb;font-size:13px;font-weight:700}
.xf-chat .bubble{max-width:min(78%,360px);padding:10px 12px;border-radius:4px 12px 12px;background:#fff;color:#374151;font-size:14px;line-height:1.6;box-shadow:0 1px 3px #00000014;word-break:break-word}
.xf-chat .msg.system{justify-content:center}
.xf-chat .msg.system .bubble{max-width:90%;border-radius:6px;background:#e9edf2;color:#6b7280;font-size:12px;text-align:center;box-shadow:none}
.xf-chat .user .bubble{border-radius:12px 4px 12px 12px;background:#2563eb;color:#fff}
.xf-chat .bubble img{max-width:180px;max-height:180px}
.xf-chat .sender,.xf-chat .time{font-size:11px;opacity:.65}
.xf-chat .composer{display:flex;align-items:flex-end;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #e5e7eb;background:#fff}
.xf-chat textarea{min-width:0;height:42px;min-height:42px;max-height:96px;flex:1;resize:none;border:1px solid #d1d5db;border-radius:8px;outline:none;padding:10px 11px;font:inherit;font-size:14px}
.xf-chat textarea:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1a}
.xf-chat .composer button{width:44px;height:42px;flex:0 0 44px;border:0;border-radius:8px;background:#2563eb;color:#fff;cursor:pointer;font-size:18px}
.xf-chat .composer #imageBtn{width:32px;flex-basis:32px;background:#eff6ff;color:#2563eb}
.xf-chat .composer button:disabled{opacity:.5}
.xf-chat .timeline-state,.xf-chat .new-messages,.xf-chat .blocked-notice{font-size:12px;padding:5px;text-align:center;color:#6b7280}
@media print{nav,#xf-state,#xf-toast,#xf-confirm,button{display:none!important}}
