/* PaisaNow World Phase 13 — final production hardening */
:root{--pn13-a:#fff7ed;--pn13-b:#fef9c3;--pn13-c:#dcfce7;--pn13-d:#dbeafe;--pn13-e:#f3e8ff;--pn13-text:#0f172a;--pn13-muted:#475569;--pn13-border:rgba(148,163,184,.30)}
html,body{max-width:100%;overflow-x:hidden}body:not(.admin-body){color:var(--pn13-text)}body:not(.admin-body) .content,body:not(.admin-body) main,body:not(.admin-body) section,body:not(.admin-body) article{min-width:0}body:not(.admin-body) img,body:not(.admin-body) video,body:not(.admin-body) canvas{max-width:100%}
/* Global light multicolour card language. Preserve deliberate media/chat bubbles. */
body:not(.admin-body) .card:not(.message):not(.reel-card):not(.video-card),body:not(.admin-body) .dashboard-card,body:not(.admin-body) .stat-card,body:not(.admin-body) .feature-card,body:not(.admin-body) .summary-card,body:not(.admin-body) .engage-card{background:linear-gradient(135deg,#fff 0%,var(--pn13-a) 23%,var(--pn13-c) 50%,var(--pn13-d) 74%,var(--pn13-e) 100%)!important;color:var(--pn13-text)!important;border-color:var(--pn13-border)!important;background-size:180% 180%!important}
body:not(.admin-body) .card h1,body:not(.admin-body) .card h2,body:not(.admin-body) .card h3,body:not(.admin-body) .card h4,body:not(.admin-body) .card strong{color:var(--pn13-text)}body:not(.admin-body) .card p,body:not(.admin-body) .card small{color:var(--pn13-muted)}
/* Common category/filter chips */
body[data-page="home"] .timeline-category-tabs a,body:not(.admin-body) .category-tab,body:not(.admin-body) [data-category-filter]{background:linear-gradient(135deg,#fff7ed,#dcfce7,#dbeafe,#f3e8ff)!important;color:#172033!important;border:1px solid rgba(148,163,184,.28)!important;box-shadow:none!important}body[data-page="home"] .timeline-category-tabs a.active,body:not(.admin-body) .category-tab.active,body:not(.admin-body) [data-category-filter].active{outline:2px solid rgba(37,99,235,.24)!important;color:#0f172a!important;transform:none!important}
/* Engage: no heavy blue cards */
body[data-page="engage"] .content [class*="card"],body[data-page="engage"] .content article,body[data-page="engage"] .content section:not(.content){color:#0f172a}body[data-page="engage"] .content article{background:linear-gradient(135deg,#fff,#fff7ed 25%,#dcfce7 56%,#dbeafe 78%,#f3e8ff)!important;border-color:var(--pn13-border)!important}body[data-page="engage"] .content article *,body[data-page="engage"] .content [class*="card"] *{text-shadow:none!important}
/* Feedback is always visible */
.pn-feedback-toast,.pn-feedback-modal,.flash{max-width:min(420px,calc(100vw - 24px))!important;overflow-wrap:anywhere!important}.pn-feedback-toast{background:linear-gradient(135deg,#fff7ed,#dcfce7,#dbeafe,#f3e8ff)!important;color:#0f172a!important;border:1px solid rgba(100,116,139,.24)!important;box-shadow:0 14px 36px rgba(15,23,42,.16)!important}.pn-feedback-toast *{color:inherit!important}
/* Compact multicolour PWA install nudge */
.pwa-footer-banner{position:fixed!important;z-index:2147482500!important;left:auto!important;right:14px!important;bottom:14px!important;width:min(360px,calc(100vw - 28px))!important;max-width:360px!important;min-height:0!important;padding:10px 10px 10px 11px!important;gap:8px!important;border:1px solid rgba(100,116,139,.26)!important;border-radius:16px!important;background:linear-gradient(135deg,#fff7ed 0%,#fef9c3 26%,#dcfce7 52%,#dbeafe 77%,#f3e8ff 100%)!important;color:#0f172a!important;box-shadow:0 18px 46px rgba(15,23,42,.18)!important;backdrop-filter:none!important}.pwa-footer-banner .pwa-footer-icon{width:38px!important;height:38px!important;min-width:38px!important;border-radius:12px!important;background:rgba(255,255,255,.8)!important;color:#1d4ed8!important}.pwa-footer-banner .pwa-footer-text{min-width:0!important}.pwa-footer-banner .pwa-footer-text strong{font-size:12px!important;line-height:1.15!important;color:#0f172a!important}.pwa-footer-banner .pwa-footer-text span{font-size:10px!important;line-height:1.3!important;color:#334155!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}.pwa-footer-banner #pwaInstallBtn{min-height:34px!important;padding:7px 10px!important;border-radius:10px!important;background:#0f172a!important;color:#fff!important;font-size:11px!important;white-space:nowrap!important}.pwa-footer-banner #pwaInstallClose{width:30px!important;height:30px!important;min-width:30px!important;color:#334155!important;background:rgba(255,255,255,.65)!important;border-radius:10px!important}
@media(max-width:760px){.pwa-footer-banner{left:10px!important;right:10px!important;bottom:calc(72px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;padding:9px!important;border-radius:14px!important}.pwa-footer-banner .pwa-footer-text span{-webkit-line-clamp:1!important}.pwa-footer-banner #pwaInstallBtn{min-height:32px!important;padding:6px 9px!important}.content{min-width:0!important}.card{max-width:100%!important}button,a,input,select,textarea{max-width:100%}}
/* Calendar native dialog must receive clicks */
.pn7-dialog{z-index:2147482000!important;pointer-events:auto!important}.pn7-dialog[open]{pointer-events:auto!important}.pn7-dialog .pn7-event-form,.pn7-dialog input,.pn7-dialog textarea,.pn7-dialog select,.pn7-dialog button{pointer-events:auto!important}
/* Chat page breathing room and robust popups */
body[data-page="chat"] .content{padding-top:10px!important;min-width:0!important}body[data-page="chat"] .chat-shell{margin-top:0!important;min-width:0!important;max-width:100%!important}body[data-page="chat"] .chat-search-panel,body[data-page="chat"] .chat-header-search{display:none!important}
body[data-page="chat"] .chat-more-menu[open]::before,body[data-page="chat"] .chat-contact-details[open]::before{content:""!important;position:fixed!important;inset:0!important;z-index:2147481200!important;background:rgba(15,23,42,.34)!important}
body[data-page="chat"] .chat-more-menu-panel,body[data-page="chat"] .chat-info-sheet{position:fixed!important;z-index:2147481300!important;right:18px!important;top:86px!important;bottom:auto!important;width:min(420px,calc(100vw - 28px))!important;max-width:420px!important;max-height:calc(100dvh - 104px)!important;overflow:auto!important;border-radius:20px!important;background:#fff!important;color:#0f172a!important;box-shadow:0 24px 70px rgba(15,23,42,.26)!important;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
body[data-page="chat"] .chat-more-menu-panel button,body[data-page="chat"] .chat-info-actions button,body[data-page="chat"] .chat-info-actions a{min-width:0!important;width:auto!important;min-height:42px!important;height:auto!important;border-radius:12px!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;color:#0f172a!important;line-height:1.25!important}body[data-page="chat"] .chat-info-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}body[data-page="chat"] .chat-info-actions a,body[data-page="chat"] .chat-info-actions button{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;padding:9px!important;background:linear-gradient(135deg,#fff7ed,#dcfce7,#dbeafe)!important;border:1px solid rgba(148,163,184,.24)!important;font-size:12px!important;font-weight:800!important}body[data-page="chat"] .chat-info-actions i{width:32px!important;height:32px!important;min-width:32px!important;margin:0!important;border-radius:10px!important;background:rgba(255,255,255,.72)!important;font-size:14px!important}body[data-page="chat"] .chat-info-actions span{display:block!important;overflow:visible!important;white-space:normal!important}
body[data-page="chat"] .chat-action-menu{position:fixed!important;z-index:2147483000!important;min-width:220px!important;max-width:min(280px,calc(100vw - 20px))!important;max-height:min(62dvh,520px)!important;overflow:auto!important;border-radius:16px!important;background:#fff!important;color:#0f172a!important;box-shadow:0 22px 62px rgba(15,23,42,.28)!important;overscroll-behavior:contain!important}.chat-action-menu .chat-action-reactions{position:sticky!important;top:0!important;z-index:1!important;background:#fff!important;display:flex!important;gap:4px!important;justify-content:space-between!important}.chat-action-menu button{white-space:nowrap!important;min-width:0!important;overflow:visible!important}
body[data-page="chat"] form[data-ajax-message] [data-chat-send-button]{pointer-events:auto!important;opacity:1!important}body[data-page="chat"] form[data-ajax-message] [data-chat-send-button]:disabled{opacity:.65!important}
@media(max-width:800px){body[data-page="chat"] .content{padding-top:7px!important}body[data-page="chat"] .chat-more-menu-panel,body[data-page="chat"] .chat-info-sheet{left:8px!important;right:8px!important;top:auto!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:min(82dvh,720px)!important;border-radius:20px!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important}body[data-page="chat"] .chat-action-menu{left:8px!important;right:8px!important;width:auto!important;max-width:none!important;bottom:auto!important}.conversation-header{min-width:0!important}.chat-header-actions{flex-wrap:nowrap!important}.message{max-width:86%!important}}
/* QR/payment light system */
body[data-page="qrscan"] .qrpay-card,body[data-page="qrscan"] .scan-result-card,body[data-page="qrscan"] .pay-user,body[data-page="qrscan"] .txn-box{background:linear-gradient(135deg,#fff,#fff7ed,#dcfce7,#dbeafe,#f3e8ff)!important;color:#0f172a!important}body[data-page="qrscan"] .qrpay-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}@media(max-width:600px){body[data-page="qrscan"] .qrpay-actions{grid-template-columns:1fr 1fr!important}body[data-page="qrscan"] .qrpay-actions .danger{grid-column:1/-1!important}}
/* General compact responsive controls */
@media(max-width:520px){body:not(.admin-body) .card{border-radius:15px!important}body:not(.admin-body) .button,body:not(.admin-body) button{overflow-wrap:anywhere}body:not(.admin-body) h1{font-size:clamp(21px,7vw,30px)}body:not(.admin-body) h2{font-size:clamp(18px,5.5vw,25px)}}
/* Phase 13 final surface audit: custom *-card classes also follow the light multicolour system. */
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card){background:linear-gradient(135deg,#fff 0%,#fff7ed 23%,#dcfce7 50%,#dbeafe 75%,#f3e8ff 100%)!important;color:#0f172a!important;border-color:rgba(148,163,184,.30)!important;text-shadow:none!important}
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) h1,
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) h2,
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) h3,
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) strong{color:#0f172a!important;text-shadow:none!important}
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) p,
body:not(.admin-body):not([data-page="chat"]):not([data-page="reels"]) .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card) small{color:#475569!important;text-shadow:none!important}

/* Phase 13 final QA refinements */
body:not(.admin-body) input,body:not(.admin-body) textarea,body:not(.admin-body) select{touch-action:manipulation}
body[data-page="chat"] .chat-more-menu-panel form,body[data-page="chat"] .chat-info-sheet form{min-width:0!important}
body[data-page="chat"] .chat-more-menu-panel button,body[data-page="chat"] .chat-more-menu-panel .button{max-width:100%!important;overflow-wrap:anywhere!important;text-align:left!important}
body[data-page="chat"] .chat-info-sheet{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
body[data-page="chat"] .chat-action-menu{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
body[data-page="qrscan"] .qrpay-btn{background:linear-gradient(135deg,#fff7ed,#dcfce7,#dbeafe,#f3e8ff)!important;color:#0f172a!important;border:1px solid rgba(100,116,139,.22)!important;box-shadow:none!important}
body[data-page="qrscan"] .qrpay-btn.green{background:linear-gradient(135deg,#dcfce7,#dbeafe,#fef9c3)!important;color:#064e3b!important}
body[data-page="qrscan"] .qrpay-btn.danger{background:linear-gradient(135deg,#fff1f2,#fff7ed,#f3e8ff)!important;color:#881337!important}
body[data-page="qrscan"] .qrpay-status{background:linear-gradient(135deg,#fff,#fef9c3,#dbeafe)!important;color:#0f172a!important}
@media(max-width:420px){.pwa-footer-banner{gap:6px!important}.pwa-footer-banner .pwa-footer-icon{width:34px!important;height:34px!important;min-width:34px!important}.pwa-footer-banner .pwa-footer-text strong{font-size:11px!important}.pwa-footer-banner #pwaInstallBtn{font-size:10px!important;padding:6px 8px!important}.pwa-footer-banner #pwaInstallClose{width:28px!important;height:28px!important;min-width:28px!important}}


/* Live fix: home/timeline cards use a clean neutral surface.
   Preserve deliberate text-post background styles inside .post-body-bg. */
body:not(.admin-body)[data-page="home"] .content .card:not(.message):not(.reel-card):not(.video-card),
body:not(.admin-body)[data-page="home"] .content [class*="card"]:not(.story-card):not(.reel-card):not(.video-card):not(.media-card){
  background:#fff!important;
  background-image:none!important;
  background-size:auto!important;
  color:#0f172a!important;
  border-color:#e2e8f0!important;
  text-shadow:none!important;
}
