/* Pilgrim Support: same visual language as Social Hub; no Citizen DM access. */
.pbsup-toggle{position:fixed;z-index:999890;bottom:calc(18px + env(safe-area-inset-bottom));right:calc(15px + env(safe-area-inset-right));border:1px solid #4dd5ed!important;border-radius:24px!important;background:#10152b!important;color:#d7faff!important;font:700 12px system-ui,sans-serif!important;letter-spacing:.04em;padding:12px 16px!important;cursor:pointer;box-shadow:0 8px 28px #0009}
.pbsup-toggle [data-pbsup-count]{display:inline-grid;place-items:center;background:#f05270;color:#fff;border-radius:20px;min-width:20px;height:20px;margin-left:6px}
.pbsup-panel{position:fixed;z-index:999899;bottom:calc(68px + env(safe-area-inset-bottom));right:calc(15px + env(safe-area-inset-right));width:min(390px,calc(100vw - 24px));max-height:min(690px,calc(100dvh - 85px));display:flex;flex-direction:column;border-radius:15px;border:1px solid #365875;box-shadow:0 18px 65px #000e;background:linear-gradient(140deg,#0b1223,#160f2c);color:#eaf7ff;font:13px system-ui,sans-serif;overflow:hidden}
.pbsup-panel[hidden],.pbsup-panel [hidden],.pbsup-toggle [hidden]{display:none!important}
.pbsup-panel *{box-sizing:border-box}
.pbsup-panel header{display:flex;justify-content:space-between;align-items:center;padding:14px 17px;background:#080b1a;border-bottom:1px solid #23415e}
.pbsup-panel header strong{display:block;font-size:12px;letter-spacing:.12em;color:#47dce8}
.pbsup-panel header small{font-size:10px;color:#a4abc4;display:block;margin-top:3px}
.pbsup-panel header button{color:#fff;background:transparent;border:0;font-size:24px;cursor:pointer}
.pbsup-main{overflow:auto;padding:13px 17px;min-height:170px;overscroll-behavior:contain}
.pbsup-main p{font-size:12px;line-height:1.5;color:#bacbdf;margin:6px 0 13px}
.pbsup-main h3{font-size:12px;color:#49d5e7;margin:13px 0 7px}
.pbsup-main label{display:block;font-size:11px;color:#d0e1ef;margin-top:10px}
.pbsup-main label input:not([type=checkbox]),.pbsup-main textarea{display:block;min-width:0;width:100%;padding:9px;background:#0c1429!important;color:#fff!important;border:1px solid #45627d!important;border-radius:8px;font:13px system-ui,sans-serif!important;margin-top:5px}
.pbsup-main textarea{resize:vertical}
.pbsup-main button[type=submit],.pbsup-main button[data-pbsup-back]{border:1px solid #4cbfd6!important;background:#15547c!important;color:#fff!important;border-radius:8px!important;padding:9px 12px!important;font:700 12px system-ui!important;margin-top:11px;cursor:pointer}
.pbsup-main button:disabled{opacity:.55;cursor:wait}
.pbsup-main .pbsup-consent{display:flex;gap:9px;align-items:flex-start;line-height:1.45;color:#b4ccdf}
.pbsup-main .pbsup-consent input{margin-top:2px}
.pbsup-honey{position:absolute;left:-10000px;opacity:0;pointer-events:none}
.pbsup-ticket{width:100%;display:flex;justify-content:space-between;gap:10px;text-align:left;color:#e5f8ff;background:#14203a;border:1px solid #31536c;border-radius:8px;padding:10px;margin:6px 0;cursor:pointer}
.pbsup-ticket small{font-size:10px;color:#76dfff}
.pbsup-messages{max-height:320px;overflow:auto;display:grid;gap:8px}
.pbsup-messages article{padding:10px;border-radius:10px;background:#17253a;white-space:pre-wrap;overflow-wrap:anywhere}
.pbsup-messages article.pbsup-guest{background:#123c59}
.pbsup-messages strong{font-size:10px;color:#6adee7}
.pbsup-messages p{color:#e2effc;white-space:pre-wrap;margin:4px 0}
.pbsup-messages small{color:#b9c5d9;font-size:9px}
.pbsup-panel footer{font-size:10px;padding:11px 16px;text-align:center;color:#8ea5bd;border-top:1px solid #2e405f}
.pbsup-panel [data-pbsup-status]{font-size:11px;color:#8be1ea;margin:10px 0}
@media(max-width:600px){.pbsup-panel{right:0;bottom:0;width:100vw;height:100dvh;max-height:100dvh;border-radius:0}.pbsup-toggle{right:12px;bottom:calc(12px + env(safe-area-inset-bottom))}}

/* M2.0: one-time Pilgrim welcome transmission; compact readable guest inbox. */
.pbsup-system-item{display:flex;align-items:center;gap:10px;width:100%;padding:13px 10px;text-align:left;border:1px solid #3f83a1!important;border-radius:11px;background:linear-gradient(120deg,#14283e,#16213b)!important;color:#e8faff!important;cursor:pointer;margin:7px 0 12px;box-shadow:inset 0 1px 0 #ffffff12}
.pbsup-system-item:hover,.pbsup-system-item:focus-visible{border-color:#58dded!important;outline-offset:3px}
.pbsup-system-seal{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:50%;color:#74e8f1;background:#14455a;border:1px solid #31879a;font-size:19px}
.pbsup-system-text{display:grid;gap:3px;flex:1;min-width:0}
.pbsup-system-text strong,.pbsup-official-heading strong{font-size:10px;letter-spacing:.07em;color:#6de4ed}
.pbsup-system-text span{font-size:13px;font-weight:650;overflow-wrap:anywhere}
.pbsup-system-text small{font-size:10px;color:#a9bfd1}
.pbsup-unread-label{font-size:10px;font-weight:700;letter-spacing:.04em;border-radius:999px;color:#fff;background:#bd365e;padding:4px 7px}
.pbsup-unread-label.pbsup-is-read{background:transparent;color:#95a6b6;border:1px solid #4b5a70}
.pbsup-panel .pbsup-contact-intro{margin-top:3px}
.pbsup-panel .pbsup-official-heading{display:flex;gap:10px;align-items:center;margin-top:15px}
.pbsup-official-heading>span:last-child{display:grid;gap:4px}
.pbsup-official-heading small{font-size:9px;color:#a9bccc;letter-spacing:.06em}
.pbsup-panel .pbsup-welcome-message h2{font-size:19px;color:#f1fbff;line-height:1.2;margin:22px 0 12px}
.pbsup-panel .pbsup-welcome-message p{font-size:13px;line-height:1.65;margin-bottom:13px;color:#d0dfec}
.pbsup-panel .pbsup-primary-action{display:block;width:100%;margin:20px 0 12px;border:1px solid #54d6e8!important;border-radius:9px!important;background:#155174!important;color:white!important;padding:12px!important;font-size:13px;font-weight:700;cursor:pointer}
.pbsup-panel .pbsup-delete-action{display:block;margin:5px auto 0;border:0!important;background:transparent!important;color:#afc2d0!important;text-decoration:underline;font-size:11px;cursor:pointer;padding:9px}
.pbsup-panel .pbsup-back{background:transparent!important;border:0!important;color:#77dbe7!important;padding:7px 3px;cursor:pointer}
.pbsup-panel button:focus-visible{outline:2px solid #65eaf2;outline-offset:3px}

/* M2.0.2: guest messages use the server-owned PB-Core account launcher. */
.pbsup-toggle--profile-replaced{display:none!important}
.pb-shell__account--guest[data-pbsup-profile-launcher]{position:relative;cursor:pointer}
.pbsup-profile-count{position:absolute;top:-6px;right:-6px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#f05270;color:#fff;font:700 10px/1 system-ui,sans-serif;letter-spacing:0;box-shadow:0 0 0 2px #0a0b17;pointer-events:none}
.pbsup-profile-count[hidden]{display:none!important}
.pbsup-panel .pbsup-login-action{display:inline-flex;justify-content:center;margin-top:8px;padding:6px 10px;color:#7ee5f2!important;text-decoration:underline;font:600 11px system-ui,sans-serif}

/* Account badge must escape the Core account icon's original overflow clipping. */
.pb-shell__account--guest[data-pbsup-profile-launcher]{overflow:visible!important}
.pbsup-toggle{text-decoration:none!important;display:inline-flex;align-items:center;justify-content:center}
.pbsup-toggle:focus-visible{outline:2px solid #65eaf2;outline-offset:3px}

/* M2.0.4 // Pilgrim-first conversation layout; one history scrollbar. */
.pbsup-panel{width:min(420px,calc(100vw - 24px));height:min(720px,calc(100dvh - 94px));max-height:calc(100dvh - 84px)}
.pbsup-panel header{gap:10px;flex:0 0 auto;padding:11px 14px}
.pbsup-panel header>div{flex:1;min-width:0}
.pbsup-panel .pbsup-header-avatar{width:39px;height:39px;flex:0 0 auto;object-fit:cover;border-radius:50%;border:1px solid #54c9ed}
.pbsup-main{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.pbsup-panel[data-pbsup-screen="thread"] .pbsup-main{display:flex;flex-direction:column;overflow:hidden;padding:10px 13px 5px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-thread]{display:flex;flex:1;flex-direction:column;min-height:0}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-back]{align-self:flex-start;flex:0 0 auto;margin:0 0 4px!important;padding:5px 2px!important}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-subject]{flex:0 0 auto;margin:3px 0 9px;font-size:13px;overflow-wrap:anywhere}
.pbsup-panel[data-pbsup-screen="thread"] .pbsup-messages{display:flex;flex-direction:column;flex:1;min-height:85px;max-height:none;overflow-y:auto;overscroll-behavior:contain;gap:10px;padding:8px 5px 12px 1px;scrollbar-gutter:stable}
.pbsup-panel .pbsup-messages article{position:relative;flex:0 0 auto;align-self:flex-start;max-width:91%;padding:9px 11px;min-width:70px;border:1px solid #ffffff13;box-shadow:0 2px 12px #0003}
.pbsup-panel .pbsup-messages article.pbsup-guest{align-self:flex-end;border-color:#4dc2e33d}
.pbsup-bubble-avatar{width:25px;height:25px;object-fit:cover;border-radius:50%;vertical-align:middle;border:1px solid #67cde5;float:left;margin:0 7px 2px 0}
.pbsup-panel .pbsup-messages article strong{font-size:10px;display:inline-block;line-height:25px;color:#a7eafa}
.pbsup-panel .pbsup-messages article p{clear:both;margin:5px 0 4px;line-height:1.5;color:#f2f9ff}
.pbsup-panel .pbsup-messages article small{display:block;opacity:.86;font-size:10px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply]{flex:0 0 auto;display:grid;gap:6px;padding-top:9px;border-top:1px solid #ffffff18}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply] label{margin:0;font-size:11px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply] textarea{resize:none;min-height:56px;max-height:100px;margin-top:6px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply] button{width:100%;margin:0!important;min-height:36px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-status]{flex:0 0 auto;margin:3px 0 5px;line-height:1.35}
.pbsup-panel footer{flex:0 0 auto;display:grid;justify-items:center;gap:3px;padding:7px 11px 8px;line-height:1.3}
.pbsup-panel footer .pbsup-login-action{margin:0;padding:4px 8px}
@media(max-width:600px){.pbsup-panel{width:100vw;height:100dvh;max-height:100dvh}.pbsup-panel[data-pbsup-screen="thread"] .pbsup-main{padding:10px 12px 3px}.pbsup-panel .pbsup-messages article{max-width:94%}}

/* M2.0.5 — guest unread thread dot and own avatar aligned with right-hand bubble. */
.pbsup-ticket.is-unread{border-color:rgba(240,82,112,.6)}
.pbsup-ticket-unread{flex:0 0 9px;width:9px;height:9px;align-self:center;margin-left:auto;border-radius:50%;background:#f05270;box-shadow:0 0 10px rgba(240,82,112,.65)}
.pbsup-panel .pbsup-messages article.pbsup-guest>.pbsup-bubble-avatar{float:right;margin:0 0 2px 7px}
.pbsup-panel .pbsup-messages article.pbsup-guest>strong{float:right;text-align:right}
.pbsup-panel .pbsup-messages article.pbsup-guest>p,.pbsup-panel .pbsup-messages article.pbsup-guest>small{text-align:right}

.pbsup-panel .pbsup-system-seal:has(img){display:inline-grid;place-items:center;background:transparent!important;padding:0!important;overflow:visible}
.pbsup-panel .pbsup-system-seal img{width:30px;height:30px;display:block;object-fit:cover;border-radius:50%;border:1px solid rgba(98,222,245,.55)}

/* M2.0.6 — Pilgrim Messenger visual parity with Core M1.9.7A staff chat.
   Message direction is based on reader's perspective, not identity type. */
.pbsup-panel{box-sizing:border-box;border-color:rgba(77,185,219,.55);box-shadow:0 18px 65px rgba(0,0,0,.88);background:linear-gradient(160deg,#0a1123,#17102c)}
.pbsup-panel header{padding:12px 14px;background:#090d1c}
.pbsup-panel .pbsup-header-avatar{width:44px;height:44px;flex-basis:44px}
.pbsup-panel .pbsup-main{font-size:13px}
.pbsup-panel[data-pbsup-screen="thread"] .pbsup-messages{gap:12px;padding:10px 5px 14px;scrollbar-gutter:stable}
.pbsup-panel .pbsup-chat-row{display:flex;gap:10px;width:100%;min-width:0;align-items:flex-start;justify-content:flex-start;flex:0 0 auto}
.pbsup-panel .pbsup-chat-row.is-mine{justify-content:flex-end}
.pbsup-panel .pbsup-chat-row>.pbsup-bubble-avatar{display:block;float:none;flex:0 0 48px;width:48px;height:48px;max-width:none;margin:0;object-fit:cover;border-radius:50%;border:1px solid rgba(98,225,245,.75)}
.pbsup-panel .pbsup-chat-row.is-mine>.pbsup-bubble-avatar{order:2}
.pbsup-panel .pbsup-messages .pbsup-chat-row>.pbsup-chat-bubble{display:block;flex:0 1 auto;min-width:0;max-width:calc(100% - 58px);padding:10px 12px;line-height:1.45;background:rgba(255,255,255,.085);border:1px solid rgba(255,255,255,.09);border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.2);overflow-wrap:anywhere}
.pbsup-panel .pbsup-chat-row.is-mine .pbsup-chat-bubble{background:rgba(33,137,181,.35);border-color:rgba(84,216,248,.25)}
.pbsup-panel .pbsup-chat-bubble strong{display:block;line-height:1.35;font-size:10px;letter-spacing:.045em;color:#a7eafa}
.pbsup-panel .pbsup-chat-bubble p{display:block;clear:none;margin:5px 0 5px;font-size:13px;line-height:1.5;color:#f2f9ff;white-space:pre-wrap;overflow-wrap:anywhere;text-align:left}
.pbsup-panel .pbsup-chat-bubble small{display:block;clear:none;padding:0;font-size:10px;line-height:1.4;opacity:.78;color:#b9c5d9;text-align:left}
.pbsup-panel .pbsup-chat-row.is-mine .pbsup-chat-bubble strong,.pbsup-panel .pbsup-chat-row.is-mine .pbsup-chat-bubble small{text-align:right}
.pbsup-panel .pbsup-chat-row.is-system .pbsup-chat-bubble{background:rgba(78,58,128,.22);border:1px solid rgba(119,172,235,.36)}
.pbsup-panel .pbsup-chat-row.is-system .pbsup-chat-bubble strong{color:#93dff8}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply]{background:linear-gradient(180deg,transparent,rgba(13,23,46,.45));padding:10px 1px 2px}
.pbsup-panel[data-pbsup-screen="thread"] [data-pbsup-reply] textarea{border-radius:10px!important;padding:10px!important}
.pbsup-panel .pbsup-ticket:focus-visible{outline:2px solid #65eaf2;outline-offset:3px}
@media(max-width:600px){
 .pbsup-panel .pbsup-chat-row>.pbsup-bubble-avatar{flex-basis:42px;width:42px;height:42px}
 .pbsup-panel .pbsup-messages .pbsup-chat-row>.pbsup-chat-bubble{max-width:calc(100% - 52px)}
 .pbsup-panel .pbsup-chat-row{gap:10px}
 .pbsup-panel[data-pbsup-screen="thread"] .pbsup-messages{padding-left:3px;padding-right:3px}
}
@media(prefers-reduced-motion:reduce){.pbsup-panel *{scroll-behavior:auto!important}}

/* M2.1 STAGING: same safe-area / fixed viewport contract as Citizen Messenger. */
@media(max-width:600px){
 .pbsup-panel{position:fixed!important;left:0!important;right:0!important;top:var(--pb-msg-vtop,0px)!important;bottom:auto!important;margin:0!important;width:100%!important;height:var(--pb-msg-vheight,100dvh)!important;min-height:0!important;max-height:none!important;border:0!important;border-radius:0!important;transform:none!important;animation:none!important;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)!important;overflow:hidden!important}
 .pbsup-panel[hidden]{display:none!important}
 .pbsup-panel>header{position:relative;z-index:2;flex:0 0 auto;min-height:60px;padding:9px max(14px,env(safe-area-inset-right)) 9px max(14px,env(safe-area-inset-left))!important}
 .pbsup-panel>.pbsup-main{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
 .pbsup-panel>footer{flex:0 0 auto;padding-bottom:max(10px,env(safe-area-inset-bottom))}
 body.pbsup-open{overflow:hidden!important}
}
/* Inbox-first: System notices and support tickets are ordinary thread rows. */
.pbsup-panel .pbsup-system-item,.pbsup-panel .pbsup-ticket{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:66px;margin:0;border:0!important;border-bottom:1px solid rgba(255,255,255,.1)!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;padding:12px 5px!important;text-align:left;color:#eaf7ff}
.pbsup-panel .pbsup-system-item:hover,.pbsup-panel .pbsup-ticket:hover{background:rgba(60,170,220,.1)!important}
.pbsup-panel .pbsup-system-seal{width:44px;height:44px;flex:0 0 44px}
.pbsup-panel .pbsup-system-seal img{width:44px;height:44px}
.pbsup-panel .pbsup-ticket .pbsup-bubble-avatar{width:44px;height:44px;flex:0 0 44px;float:none;margin:0}
.pbsup-panel .pbsup-ticket .pbsup-ticket-text{display:grid;min-width:0;flex:1;gap:4px}
.pbsup-panel .pbsup-ticket strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pbsup-panel .pbsup-ticket .pbsup-ticket-preview{font-size:11px;color:#a8bccc}
.pbsup-panel .pbsup-ticket small{font-size:10px;color:#a8bccc;white-space:nowrap}
.pbsup-panel .pbsup-system-item .pbsup-system-text strong{color:#dffaff;font-size:12px}
.pbsup-panel .pbsup-unread-label:not(.pbsup-is-read){font-size:0;width:10px;min-width:10px;height:10px;padding:0;border-radius:50%;background:#ee536f;box-shadow:0 0 8px rgba(240,80,111,.6)}
.pbsup-panel .pbsup-unread-label.pbsup-is-read{display:none}
.pbsup-panel .pbsup-intro{margin:0 0 8px;color:#9ebad2;font-size:11px}
.pbsup-contact-details{border-top:1px solid rgba(255,255,255,.12);margin:14px 0 0;padding:8px 0}
.pbsup-contact-details>summary{cursor:pointer;padding:11px;border:1px solid rgba(75,199,230,.35);border-radius:10px;font-size:12px;font-weight:700;color:#9ce9f7;list-style-position:inside}
.pbsup-contact-details[open]>summary{margin-bottom:12px}
.pbsup-panel .pbsup-welcome-message{display:grid;gap:8px}
.pbsup-panel .pbsup-welcome-message .pbsup-official-heading{margin-top:6px}
.pbsup-panel .pbsup-welcome-message h2,.pbsup-panel .pbsup-welcome-message p{margin:0}
.pbsup-panel .pbsup-welcome-message p{padding:11px 12px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.08);border-radius:12px}
.pbsup-panel .pbsup-welcome-message .pbsup-primary-action{margin:14px 0 0}
