/* Social → Messages: the Realm messenger (chat list + conversation). Loaded after mobile.css; selectors start with
   "html body #messagesView" and use !important where older inbox rules do, so these rules win. */
:root{--msgr-bg:#0d1f22;--msgr-panel:#10262a;--msgr-line:#ffffff14;--msgr-gold:#d8b76c;--msgr-gold-soft:#d8b76c33;--msgr-text:#eef2ec;--msgr-muted:#9fb0a8;--msgr-mine:#1f6a4a;--msgr-mine-hi:#237a55;--msgr-theirs:#22323a;--msgr-green:#3ccf7e;--msgr-danger:#e06c5a}

/* Frame: keep the fixed-height panel; the messenger fills it edge to edge. */
html body #messagesView>#inboxContent.msgr-host{padding:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:linear-gradient(180deg,#10262af7,#0c1d20f7)!important;border:1px solid #b79b5899!important;border-radius:16px!important;box-shadow:0 18px 50px #0007,inset 0 1px #ffffff0d!important;color:var(--msgr-text)}
html body .msgr-mount .msgr{position:relative;display:grid;grid-template-columns:340px minmax(0,1fr);flex:1;min-height:0;height:100%;overflow:hidden}
html body .msgr-mount .msgr :is(h1,h2,h3,p){margin:0}
html body .msgr-mount .msgr button{margin:0;min-height:0;width:auto;font:inherit;letter-spacing:0;text-transform:none;box-shadow:none}
html body .msgr-mount .msgr-icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html body .msgr-mount .msgr-icon.msgr-fill{fill:currentColor;stroke:none}

/* Sidebar */
html body .msgr-mount .msgr-side{position:relative;display:flex;flex-direction:column;min-height:0;min-width:0;border-right:1px solid var(--msgr-line);background:#0b1b1ecc}
html body .msgr-mount .msgr-side-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 16px 10px}
html body .msgr-mount .msgr-title{font:700 22px/1.2 Georgia,serif;color:#f6e7c1;min-height:0}
html body .msgr-mount .msgr-new{display:inline-flex;align-items:center;gap:6px;padding:8px 12px!important;border-radius:999px!important;border:1px solid #d8b76c88!important;background:#d8b76c1a!important;color:#f3dc9f!important;font-size:13px!important;font-weight:600;cursor:pointer;transition:background .15s,transform .15s}
html body .msgr-mount .msgr-new:hover{background:#d8b76c33!important}
html body .msgr-mount .msgr-new .msgr-icon{width:18px;height:18px}
html body .msgr-mount .msgr-search{display:flex;align-items:center;gap:8px;margin:0 14px 10px;padding:0 12px;height:40px;border-radius:999px;background:#ffffff0f;border:1px solid #ffffff12;color:var(--msgr-muted);font-size:0}
html body .msgr-mount .msgr-search:focus-within{border-color:#d8b76c88;background:#ffffff16}
html body .msgr-mount .msgr-search .msgr-icon{width:17px;height:17px}
html body .msgr-mount .msgr-search input{flex:1;min-width:0;height:38px;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:var(--msgr-text)!important;font-size:15px!important;outline:none;box-shadow:none!important}
html body .msgr-mount .msgr-side-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 8px 12px;scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}
html body .msgr-mount .msgr-section-title{display:flex;align-items:center;gap:8px;padding:10px 8px 6px;font:700 11px/1.2 system-ui,sans-serif!important;letter-spacing:.08em;text-transform:uppercase;color:#cdb47a}
html body .msgr-mount .msgr-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--msgr-green);color:#05261a;font-size:11px;letter-spacing:0}
html body .msgr-mount :is(.msgr-chats,.msgr-request-list,.msgr-results){list-style:none;margin:0;padding:0}

/* Chat rows */
html body .msgr-mount .msgr-row{display:flex!important;align-items:center;gap:12px;width:100%!important;padding:10px 10px!important;border:0!important;border-radius:12px!important;background:transparent!important;color:inherit!important;text-align:left;cursor:pointer;transition:background .15s}
html body .msgr-mount .msgr-row:hover{background:#ffffff0d!important}
html body .msgr-mount .msgr-row.msgr-active{background:linear-gradient(90deg,#1f6a4a55,#1f6a4a22)!important;box-shadow:inset 3px 0 var(--msgr-gold)!important}
html body .msgr-mount :is(.msgr-row-avatar,.msgr-head-avatar){position:relative;flex:none;display:inline-block}
html body .msgr-mount .msgr-avatar{width:48px!important;height:48px!important;min-width:48px;border-radius:50%!important;overflow:hidden;display:grid;place-items:center;background:#20363a;border:2px solid #d8b76c55;box-sizing:border-box}
html body .msgr-mount .msgr-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
html body .msgr-mount .msgr-avatar .portrait-initials{font:700 15px/1 system-ui,sans-serif;color:#f3dc9f}
html body .msgr-mount .msgr-dot{position:absolute;right:1px;bottom:1px;width:13px;height:13px;border-radius:50%;background:var(--msgr-green);border:2.5px solid #0f2427;transform:scale(0);transition:transform .2s ease}
html body .msgr-mount .msgr-online>.msgr-dot{transform:scale(1)}
html body .msgr-mount .msgr-row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
html body .msgr-mount :is(.msgr-row-top,.msgr-row-bottom){display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
html body .msgr-mount .msgr-row-name{font-size:15.5px;font-weight:650;color:#f4efe0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .msgr-mount .msgr-row-time{flex:none;font-size:12px;color:var(--msgr-muted)}
html body .msgr-mount .msgr-has-unread .msgr-row-time{color:var(--msgr-green);font-weight:600}
html body .msgr-mount .msgr-row-preview{min-width:0;font-size:13.5px;color:var(--msgr-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .msgr-mount .msgr-has-unread .msgr-row-preview{color:#dfe7e1}
html body .msgr-mount .msgr-row-you{color:#b9c7c0}
html body .msgr-mount .msgr-badge{flex:none;display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:var(--msgr-green);color:#04261a;font-size:12px;font-weight:700;box-sizing:border-box}
html body .msgr-mount .msgr-badge[hidden]{display:none}

/* Requests and search results */
html body .msgr-mount :is(.msgr-request,.msgr-result){display:flex;align-items:center;gap:12px;padding:10px;border-radius:12px;background:#ffffff08;margin-bottom:6px}
html body .msgr-mount .msgr-requests{margin-bottom:6px}
html body .msgr-mount .msgr-requests[hidden]{display:none}
html body .msgr-mount :is(.msgr-request-info,.msgr-result-info){flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
html body .msgr-mount :is(.msgr-request-info,.msgr-result-info) strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .msgr-mount :is(.msgr-request-info,.msgr-result-info) small{font-size:12px;color:var(--msgr-muted)}
html body .msgr-mount :is(.msgr-request-actions,.msgr-result-actions){display:flex;align-items:center;gap:6px;flex:none}
html body .msgr-mount .msgr-request .msgr-avatar,html body .msgr-mount .msgr-result .msgr-avatar{width:42px!important;height:42px!important;min-width:42px}
html body .msgr-mount .msgr-chip{font-size:12px;color:#cdb47a;padding:4px 8px;border-radius:999px;background:#d8b76c1a}
html body .msgr-mount .msgr-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 16px!important;border-radius:999px!important;border:0!important;background:linear-gradient(180deg,#2b8a5f,#1f6a4a)!important;color:#f3fff8!important;font-weight:650;cursor:pointer;transition:filter .15s,transform .1s}
html body .msgr-mount .msgr-primary:hover{filter:brightness(1.12)}
html body .msgr-mount .msgr-primary:active{transform:scale(.97)}
html body .msgr-mount .msgr-ghost{display:inline-flex;align-items:center;justify-content:center;padding:9px 14px!important;border-radius:999px!important;border:1px solid #ffffff2a!important;background:transparent!important;color:#dfe6e0!important;cursor:pointer}
html body .msgr-mount .msgr-ghost:hover{background:#ffffff10!important}
html body .msgr-mount .msgr-small{padding:6px 12px!important;font-size:13px!important}
html body .msgr-mount .msgr-small .msgr-icon{width:16px;height:16px}
html body .msgr-mount :is(.msgr-primary,.msgr-ghost,.msgr-send,.msgr-challenge):disabled{opacity:.5;cursor:default;filter:none}
html body .msgr-mount .msgr-finder{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;background:#0c1d20;animation:msgr-slide-in .24s cubic-bezier(.2,.8,.2,1)}
html body .msgr-mount .msgr-finder[hidden]{display:none}
html body .msgr-mount .msgr-finder-head{display:flex;align-items:center;gap:8px;padding:14px 12px 10px}
html body .msgr-mount .msgr-finder-head h2{font:700 19px/1.2 Georgia,serif;color:#f6e7c1}
html body .msgr-mount .msgr-finder-status{padding:4px 18px 10px;font-size:13px;color:var(--msgr-muted)}
html body .msgr-mount .msgr-finder-status:empty{display:none}
html body .msgr-mount .msgr-results{flex:1;min-height:0;overflow-y:auto;padding:0 10px 12px}
html body .msgr-mount .msgr-error-text{color:#f2a99c!important}

/* Empty / loading states */
html body .msgr-mount .msgr-empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:34px 18px}
html body .msgr-mount .msgr-empty h2{font:700 18px/1.3 Georgia,serif;color:#f6e7c1}
html body .msgr-mount .msgr-empty p{font-size:13.5px;line-height:1.5;color:var(--msgr-muted)}
html body .msgr-mount .msgr-empty-icon{width:46px;height:46px;color:#d8b76c;stroke-width:1.5}
html body .msgr-mount .msgr-muted{color:var(--msgr-muted);font-size:13px;line-height:1.5}
html body .msgr-mount .msgr-list-state>p{padding:14px 10px}
html body .msgr-mount .msgr-skeleton{display:flex;align-items:center;gap:12px;padding:10px}
html body .msgr-mount .msgr-skeleton span:first-child{width:48px;height:48px;border-radius:50%;background:#ffffff10}
html body .msgr-mount .msgr-skeleton span:last-child{flex:1;height:12px;border-radius:6px;background:#ffffff10}

/* Conversation pane */
html body .msgr-mount .msgr-chat{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:radial-gradient(circle at 20% 0,#1f6a4a1f,transparent 55%),radial-gradient(circle at 100% 100%,#d8b76c12,transparent 50%),#0c1c1f}
html body .msgr-mount .msgr-chat-body{position:relative;display:flex;flex-direction:column;flex:1;min-height:0}
html body .msgr-mount .msgr-placeholder{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:30px;max-width:440px;margin:0 auto}
html body .msgr-mount .msgr-crest{display:grid;place-items:center;width:84px;height:84px;border-radius:50%;background:radial-gradient(circle,#1f6a4a66,#0c1c1f);border:1px solid #d8b76c66;color:#e9cf8f;box-shadow:0 0 40px #1f6a4a55}
html body .msgr-mount .msgr-crest .msgr-icon{width:42px;height:42px;stroke-width:1.6}
html body .msgr-mount .msgr-placeholder h2{font:700 22px/1.3 Georgia,serif;color:#f6e7c1}
html body .msgr-mount .msgr-placeholder>p{font-size:14px;line-height:1.55;color:#c3cfc9}
html body .msgr-mount .msgr-placeholder-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:6px 0}
html body .msgr-mount .msgr-chat-head{display:flex;align-items:center;gap:12px;padding:10px 14px;min-height:64px;box-sizing:border-box;border-bottom:1px solid var(--msgr-line);background:#0f2326e6;backdrop-filter:blur(6px);z-index:3}
html body .msgr-mount .msgr-head-avatar .msgr-avatar{width:42px!important;height:42px!important;min-width:42px}
html body .msgr-mount .msgr-head-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
html body .msgr-mount .msgr-head-name{font-size:16.5px;font-weight:700;color:#f6efe0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .msgr-mount .msgr-head-status{font-size:12.5px;color:var(--msgr-muted)}
html body .msgr-mount .msgr-head-status.msgr-online-text{color:var(--msgr-green)}
html body .msgr-mount .msgr-icon-btn{display:inline-grid;place-items:center;width:40px;height:40px;padding:0!important;border-radius:50%!important;border:0!important;background:transparent!important;color:#dfe6e0!important;cursor:pointer}
html body .msgr-mount .msgr-icon-btn:hover{background:#ffffff12!important}
html body .msgr-mount .msgr-back{display:none}
html body .msgr-mount .msgr-challenge{display:inline-flex;align-items:center;gap:7px;padding:8px 14px!important;border-radius:999px!important;border:1px solid #d8b76c99!important;background:linear-gradient(180deg,#e2c47c,#c9a55a)!important;color:#241a08!important;font-weight:700;font-size:13.5px!important;cursor:pointer;transition:filter .15s,transform .1s}
html body .msgr-mount .msgr-challenge:hover{filter:brightness(1.08)}
html body .msgr-mount .msgr-challenge .msgr-icon{width:17px;height:17px}
html body .msgr-mount .msgr-challenge.msgr-busy .msgr-icon{animation:msgr-spin 1s linear infinite}
html body .msgr-mount .msgr-menu-wrap{position:relative}
html body .msgr-mount .msgr-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:6;min-width:210px;padding:6px;border-radius:12px;background:#152c30;border:1px solid #ffffff1c;box-shadow:0 14px 40px #000a;animation:msgr-pop-in .14s ease-out}
html body .msgr-mount .msgr-menu[hidden]{display:none}
html body .msgr-mount .msgr-menu-item{display:flex!important;align-items:center;gap:10px;width:100%!important;padding:10px 12px!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#e8eee9!important;text-align:left;font-size:14px!important;cursor:pointer}
html body .msgr-mount .msgr-menu-item:hover{background:#ffffff10!important}
html body .msgr-mount .msgr-menu-item.msgr-danger{color:#f2a99c!important}
html body .msgr-mount .msgr-menu-item .msgr-icon{width:18px;height:18px}

/* Messages */
html body .msgr-mount .msgr-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 4% 10px;scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}
html body .msgr-mount .msgr-log{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;max-height:none!important;overflow:visible!important}
html body .msgr-mount .msgr-older{display:block;margin:4px auto 10px!important;padding:6px 14px!important;border-radius:999px!important;border:1px solid #ffffff22!important;background:#ffffff0c!important;color:#cfd9d3!important;font-size:12.5px!important;cursor:pointer}
html body .msgr-mount .msgr-older[hidden]{display:none}
html body .msgr-mount .msgr-day{align-self:center;margin:12px 0 8px;padding:0;border:0;background:none;max-width:none}
html body .msgr-mount .msgr-day span{display:inline-block;padding:5px 12px;border-radius:8px;background:#1b2f33e6;color:#c9d4ce;font-size:12px;font-weight:600;box-shadow:0 1px 2px #0005}
html body .msgr-mount .msgr-msg{display:flex;margin:6px 0 0;padding:0;border:0;background:none;max-width:none}
html body .msgr-mount .msgr-msg.msgr-cont{margin-top:2px}
html body .msgr-mount .msgr-mine{justify-content:flex-end}
html body .msgr-mount .msgr-bubble{position:relative;max-width:min(76%,560px);padding:7px 10px 8px;border-radius:12px;box-shadow:0 1px 1.5px #0006;font-size:15px;line-height:1.42;color:#eef4f0;overflow-wrap:anywhere;word-break:break-word}
html body .msgr-mount .msgr-mine .msgr-bubble{background:linear-gradient(180deg,var(--msgr-mine-hi),var(--msgr-mine));color:#f1fff7;border-top-right-radius:4px}
html body .msgr-mount .msgr-theirs .msgr-bubble{background:var(--msgr-theirs);border-top-left-radius:4px}
html body .msgr-mount .msgr-cont .msgr-bubble{border-radius:12px}
html body .msgr-mount .msgr-msg:not(.msgr-cont) .msgr-bubble::before{content:"";position:absolute;top:0;width:10px;height:13px}
html body .msgr-mount .msgr-mine:not(.msgr-cont) .msgr-bubble::before{right:-8px;background:var(--msgr-mine-hi);clip-path:polygon(0 0,100% 0,0 100%)}
html body .msgr-mount .msgr-theirs:not(.msgr-cont) .msgr-bubble::before{left:-8px;background:var(--msgr-theirs);clip-path:polygon(0 0,100% 0,100% 100%)}
html body .msgr-mount .msgr-text{white-space:pre-wrap}
html body .msgr-mount .msgr-spacer{display:inline-block;width:46px;height:10px}
html body .msgr-mount .msgr-mine .msgr-spacer{width:62px}
html body .msgr-mount .msgr-meta{position:absolute;right:9px;bottom:5px;display:inline-flex;align-items:center;gap:3px;font-size:11px;line-height:1;color:#ffffffa0}
html body .msgr-mount .msgr-mine .msgr-meta{color:#d6f5e4c0}
html body .msgr-mount .msgr-time{font-size:11px;color:inherit}
html body .msgr-mount .msgr-tick{display:inline-flex}
html body .msgr-mount .msgr-tick .msgr-icon{width:16px;height:16px;stroke-width:2.2}
html body .msgr-mount .msgr-tick[data-state=seen]{color:#7fd8ff}
html body .msgr-mount .msgr-tick[data-state=failed]{color:#ffb4a6}
html body .msgr-mount .msgr-link{color:#9fe3ff;text-decoration:underline;text-underline-offset:2px}
html body .msgr-mount .msgr-mine .msgr-link{color:#d4f7ff}
html body .msgr-mount .msgr-invite{display:flex;align-items:center;gap:10px;margin:8px 0 14px;padding:9px 10px;border-radius:10px;background:#0000002e;border:1px solid #d8b76c55;color:inherit;text-decoration:none;transition:background .15s}
html body .msgr-mount .msgr-invite:hover{background:#00000045}
html body .msgr-mount .msgr-invite-art{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:linear-gradient(180deg,#e2c47c,#b88f45);color:#241a08;flex:none}
html body .msgr-mount .msgr-invite-words{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
html body .msgr-mount .msgr-invite-words strong{font-size:14px}
html body .msgr-mount .msgr-invite-words small{font-size:12px;opacity:.8}
html body .msgr-mount .msgr-invite-go{padding:5px 12px;border-radius:999px;background:#d8b76c;color:#241a08;font-size:12.5px;font-weight:700}
html body .msgr-mount .msgr-failed .msgr-bubble{opacity:.8}
html body .msgr-mount .msgr-chat-loading{display:flex;justify-content:center;gap:6px;padding:30px}
html body .msgr-mount .msgr-chat-loading[hidden]{display:none}
html body .msgr-mount .msgr-chat-loading span{width:8px;height:8px;border-radius:50%;background:#d8b76c99;animation:msgr-blink 1s infinite ease-in-out}
html body .msgr-mount .msgr-chat-loading span:nth-child(2){animation-delay:.15s}
html body .msgr-mount .msgr-chat-loading span:nth-child(3){animation-delay:.3s}
html body .msgr-mount .msgr-hello span{background:#d8b76c1f;color:#e9d39c}
html body .msgr-mount .msgr-jump{position:absolute;left:50%;bottom:92px;transform:translateX(-50%);z-index:4;display:inline-flex;align-items:center;gap:6px;padding:7px 14px!important;border-radius:999px!important;border:0!important;background:var(--msgr-green)!important;color:#04261a!important;font-size:13px!important;font-weight:700;box-shadow:0 6px 18px #0008;cursor:pointer}
html body .msgr-mount .msgr-jump[hidden]{display:none}
html body .msgr-mount .msgr-jump .msgr-icon{width:16px;height:16px}

/* Banner + composer */
html body .msgr-mount .msgr-banner{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 14px 0;font-size:13px}
html body .msgr-mount .msgr-banner[hidden]{display:none}
html body .msgr-mount .msgr-banner-floating{padding:4px 0 0;justify-content:center}
html body .msgr-mount .msgr-banner p{flex:1;min-width:160px;padding:7px 12px;border-radius:10px;line-height:1.4}
html body .msgr-mount .msgr-error{background:#5a221b88;color:#ffd4cb;border:1px solid #e06c5a55}
html body .msgr-mount .msgr-notice{background:#1f6a4a55;color:#d5f7e5;border:1px solid #3ccf7e44;animation:msgr-fade .25s ease}
html body .msgr-mount .msgr-pending{flex-basis:100%;display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:10px;background:#d8b76c1a;color:#f3dc9f}
html body .msgr-mount .msgr-pending span{flex:1}
html body .msgr-mount .msgr-composer{display:flex!important;align-items:flex-end;gap:10px;padding:10px 14px 12px!important;margin:0!important;border:0!important;background:transparent!important}
html body .msgr-mount .msgr-field{position:relative;flex:1;min-width:0;display:flex;align-items:flex-end;padding:8px 16px;border-radius:24px;background:#1b2f33;border:1px solid #ffffff14;transition:border-color .15s}
html body .msgr-mount .msgr-field:focus-within{border-color:#d8b76c88}
html body .msgr-mount .msgr-input{flex:1;width:100%;min-height:22px!important;height:22px;max-height:140px!important;margin:0!important;padding:0!important;border:0!important;outline:none;background:transparent!important;color:#eef4f0!important;font:15.5px/1.45 system-ui,sans-serif!important;resize:none!important;box-shadow:none!important;overflow-y:auto}
html body .msgr-mount .msgr-input::placeholder{color:#8a9c95}
html body .msgr-mount .msgr-counter{position:absolute;right:14px;top:-18px;font-size:11px;color:var(--msgr-muted)}
html body .msgr-mount .msgr-counter[hidden]{display:none}
html body .msgr-mount .msgr-send{display:grid!important;place-items:center;flex:none;width:46px!important;height:46px!important;min-height:46px!important;padding:0!important;border-radius:50%!important;border:0!important;background:linear-gradient(180deg,#2e9466,#1f6a4a)!important;color:#fff!important;cursor:pointer;box-shadow:0 4px 14px #1f6a4a66!important;transition:transform .12s,filter .15s}
html body .msgr-mount .msgr-send:not(:disabled):hover{filter:brightness(1.12)}
html body .msgr-mount .msgr-send:not(:disabled):active{transform:scale(.92)}
html body .msgr-mount .msgr-send .msgr-icon{width:21px;height:21px;margin-left:2px}
html body .msgr-mount .msgr-sending .msgr-send .msgr-icon{animation:msgr-fly .6s ease-in-out infinite alternate}

/* Sheets (report / confirm) */
html body .msgr-mount .msgr-sheet-host{position:absolute;inset:0;z-index:8;display:grid;place-items:center;padding:16px;background:#0009;animation:msgr-fade .18s ease}
html body .msgr-mount .msgr-sheet-host[hidden]{display:none}
html body .msgr-mount .msgr-sheet{width:min(100%,420px);padding:20px;border-radius:16px;background:#142a2e;border:1px solid #d8b76c55;box-shadow:0 20px 50px #000b;display:flex;flex-direction:column;gap:12px;animation:msgr-pop-in .18s ease-out}
html body .msgr-mount .msgr-sheet h3{font:700 18px/1.3 Georgia,serif;color:#f6e7c1}
html body .msgr-mount .msgr-sheet p{font-size:14px;line-height:1.5;color:#cbd6d0}
html body .msgr-mount .msgr-sheet-form{display:flex;flex-direction:column;gap:10px}
html body .msgr-mount .msgr-sheet-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#cdb47a}
html body .msgr-mount .msgr-sheet :is(select,textarea){width:100%;box-sizing:border-box;margin:0!important;padding:9px 10px!important;border-radius:10px!important;border:1px solid #ffffff22!important;background:#0e2023!important;color:#eef4f0!important;font-size:14px!important}
html body .msgr-mount .msgr-sheet-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}
html body .msgr-mount .msgr-danger-btn{padding:9px 16px!important;border-radius:999px!important;border:0!important;background:#c2503f!important;color:#fff!important;font-weight:650;cursor:pointer}

/* Motion: short and subtle, off under reduced motion */
html body .msgr-mount .msgr-enter-first{animation:msgr-fade .32s ease both}
html body .msgr-mount .msgr-enter-first:nth-child(2){animation-delay:.04s}
html body .msgr-mount .msgr-enter-first:nth-child(3){animation-delay:.08s}
html body .msgr-mount .msgr-enter-first:nth-child(4){animation-delay:.12s}
html body .msgr-mount .msgr-enter-first:nth-child(n+5){animation-delay:.16s}
html body .msgr-mount .msgr-enter{animation:msgr-fade .3s ease both}
html body .msgr-mount .msgr-in-mine{animation:msgr-in-right .26s cubic-bezier(.2,.8,.2,1) both}
html body .msgr-mount .msgr-in-theirs{animation:msgr-in-left .26s cubic-bezier(.2,.8,.2,1) both}
html body .msgr-mount .msgr-pop{animation:msgr-pop .32s cubic-bezier(.3,1.6,.5,1)}
@keyframes msgr-fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes msgr-in-right{from{opacity:0;transform:translate(14px,6px) scale(.96)}to{opacity:1;transform:none}}
@keyframes msgr-in-left{from{opacity:0;transform:translate(-14px,6px) scale(.96)}to{opacity:1;transform:none}}
@keyframes msgr-pop{0%{transform:scale(.6)}100%{transform:scale(1)}}
@keyframes msgr-pop-in{from{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:none}}
@keyframes msgr-slide-in{from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:none}}
@keyframes msgr-blink{0%,100%{opacity:.25;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}
@keyframes msgr-spin{to{transform:rotate(360deg)}}
@keyframes msgr-fly{to{transform:translate(2px,-2px)}}

/* Unread badge on the Social menu item: desktop rail, phone drawer row and the phone menu button. */
html body #navMessages[data-unread]{position:relative}
html body #navMessages[data-unread]::after{content:attr(data-unread)!important;position:absolute!important;left:auto!important;right:10px!important;top:50%!important;bottom:auto!important;width:auto!important;transform:translateY(-50%)!important;display:inline-grid!important;place-items:center;min-width:20px;height:20px;margin:0!important;padding:0 6px;box-sizing:border-box;border-radius:999px!important;background:#3ccf7e!important;color:#04261a!important;font:700 11px/1 system-ui,sans-serif!important;box-shadow:0 0 0 2px #0d1f22;mask:none!important;-webkit-mask:none!important}
html body[data-unread-messages] .mobile-drawer-row[href="#messages"] .mobile-drawer-label::after{content:var(--realm-unread-label,"");display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:8px;padding:0 5px;box-sizing:border-box;border-radius:999px;background:#3ccf7e;color:#04261a;font:700 11px/1 system-ui,sans-serif;vertical-align:middle}
html body[data-unread-messages] .mobile-menu-button{position:relative}
html body[data-unread-messages] .mobile-menu-button::after{content:"";position:absolute;top:6px;right:6px;width:9px;height:9px;border-radius:50%;background:#3ccf7e;box-shadow:0 0 0 2px #0d1f22}

/* Compact layout (phones, the floating panel, the game side panel): the list fills the frame and a chat slides in
   over it full-size with a back arrow. inbox.js sets .msgr-compact. */
html body .msgr-mount.msgr-compact .msgr{display:block}
html body .msgr-mount.msgr-compact .msgr-side{position:absolute;inset:0;border-right:0;transition:transform .3s cubic-bezier(.2,.8,.2,1),opacity .3s}
html body .msgr-mount.msgr-compact .msgr[data-chat=open] .msgr-side{transform:translateX(-22%);opacity:.4;pointer-events:none}
html body .msgr-mount.msgr-compact .msgr-chat{position:absolute;inset:0;z-index:5;transform:translateX(102%);transition:transform .3s cubic-bezier(.2,.8,.2,1);box-shadow:-10px 0 30px #0008}
html body .msgr-mount.msgr-compact .msgr[data-chat=open] .msgr-chat{transform:none}
html body .msgr-mount.msgr-compact .msgr-back{display:inline-grid}
html body .msgr-mount.msgr-compact .msgr-chat-head{gap:8px;padding:8px 8px 8px 4px}
html body .msgr-mount.msgr-compact .msgr-challenge span{display:none}
html body .msgr-mount.msgr-compact .msgr-challenge{padding:8px 10px!important}
html body .msgr-mount.msgr-compact .msgr-bubble{max-width:84%}
html body .msgr-mount.msgr-compact .msgr-scroll{padding:10px 10px 8px}
html body .msgr-mount.msgr-compact .msgr-composer{padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important}
html body .msgr-mount.msgr-compact .msgr-input{font-size:16px!important}
@media (max-width:760px){
 html body #messagesView>#inboxContent.msgr-host{height:calc(100dvh - 172px - env(safe-area-inset-bottom))!important;min-height:380px!important;flex:none!important;border-radius:14px!important;margin:0!important}
}
/* The mount fills whichever host holds it. */
html body .msgr-mount{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;width:100%;color:var(--msgr-text)}
html body .msgr-mount>.msgr{flex:1}
html body .msgr-mount .msgr-guest-title{font:700 20px/1.3 Georgia,serif;color:#f6e7c1;padding:18px 18px 4px}
html body .msgr-mount>p{padding:0 18px;color:var(--msgr-muted);font-size:14px;line-height:1.5}
html body .msgr-mount>.empty-state-card{margin:12px 18px;padding:16px;border-radius:14px;background:#ffffff0a;border:1px solid #d8b76c44}
html body .msgr-mount>.empty-state-card a{display:inline-flex;margin-top:10px;padding:9px 16px;border-radius:999px;background:linear-gradient(180deg,#2b8a5f,#1f6a4a);color:#f3fff8;font-weight:650;text-decoration:none}
html body .msgr-mount .msgr-paused{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:28px}
html body .msgr-mount .msgr-paused h2{font:700 19px/1.3 Georgia,serif;color:#f6e7c1;margin:0}
html body .msgr-mount .msgr-paused p{font-size:14px;line-height:1.55;color:#c3cfc9;margin:0;max-width:320px}

/* Game side panel while playing the computer: the messenger sized to the panel. */
html body .social-controls.social-has-messenger>h2{display:none}
html body .msgr-game-host{display:flex;flex-direction:column;flex:1 1 auto;height:100%;max-height:calc(100dvh - 32px);min-height:360px;border-radius:14px;overflow:hidden;border:1px solid #b79b5866;background:linear-gradient(180deg,#10262a,#0c1d20)}

/* Floating chat button (bottom-right on every screen) and its panel. */
html body .msgr-fab{position:fixed;right:22px;bottom:22px;z-index:950;display:grid;place-items:center;width:60px;height:60px;margin:0;padding:0;border-radius:50%;border:1.5px solid #f3dc9faa;background:radial-gradient(circle at 32% 26%,#38a873,#1f6a4a 58%,#123f2c);color:#fbefc8;box-shadow:0 12px 30px #000b,0 0 0 4px #d8b76c33;cursor:pointer;transition:transform .2s cubic-bezier(.3,1.4,.5,1),box-shadow .2s}
html body .msgr-fab:hover{transform:scale(1.07);box-shadow:0 14px 34px #000c,0 0 0 5px #d8b76c55}
html body .msgr-fab[hidden]{display:none}
html body .msgr-fab .msgr-icon{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;transition:transform .25s}
html body .msgr-fab.msgr-fab-open .msgr-icon{transform:scale(.88) rotate(-8deg)}
html body .msgr-fab-badge{position:absolute;top:-3px;right:-3px;display:grid;place-items:center;min-width:22px;height:22px;padding:0 6px;box-sizing:border-box;border-radius:999px;background:#3ccf7e;color:#04261a;font:700 12px/1 system-ui,sans-serif;box-shadow:0 0 0 2.5px #0d1f22}
html body .msgr-fab-badge[hidden]{display:none}
html body .msgr-fab-badge.msgr-pop{animation:msgr-pop .32s cubic-bezier(.3,1.6,.5,1)}
html body .msgr-float{position:fixed;right:22px;bottom:94px;z-index:951;display:flex;flex-direction:column;width:380px;height:min(560px,calc(100dvh - 120px));border-radius:18px;overflow:hidden;background:linear-gradient(180deg,#10262a,#0b1b1e);border:1px solid #b79b58aa;box-shadow:0 24px 60px #000c;transform-origin:calc(100% - 30px) calc(100% + 40px)}
html body .msgr-float[hidden]{display:none}
html body .msgr-float.msgr-float-opening{animation:msgr-float-in .22s cubic-bezier(.2,.9,.3,1.1) both}
html body .msgr-float.msgr-float-closing{animation:msgr-float-out .18s ease-in both}
html body .msgr-float-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 8px 8px 16px;border-bottom:1px solid #ffffff14;background:#0d2124}
html body .msgr-float-title{font:700 14px/1.2 system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#d8b76c}
html body .msgr-float-close{display:grid;place-items:center;width:36px;height:36px;min-height:0;margin:0;padding:0;border-radius:50%;border:0;background:transparent;color:#dfe6e0;cursor:pointer}
html body .msgr-float-close:hover{background:#ffffff14}
html body .msgr-float-close .msgr-icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
html body .msgr-float-body{flex:1;min-height:0;display:flex;flex-direction:column}
@keyframes msgr-float-in{from{opacity:0;transform:translateY(16px) scale(.86)}to{opacity:1;transform:none}}
@keyframes msgr-float-out{to{opacity:0;transform:translateY(12px) scale(.9)}}
/* On the game screen the button stays clear of the board, clocks and move list: bottom-left beside the rail on
   desktop, top-right in the bar on phones. */
@media (min-width:1001px){html body.msgr-fab-game .msgr-fab{right:auto;left:calc(var(--rail-width,190px) + 18px);bottom:18px;width:52px;height:52px}
 html body.msgr-fab-game .msgr-float{right:auto;left:calc(var(--rail-width,190px) + 18px);bottom:82px;transform-origin:30px calc(100% + 40px)}}
@media (max-width:760px){
 html body .msgr-fab{right:14px;bottom:calc(14px + env(safe-area-inset-bottom));width:54px;height:54px}
 html body.msgr-fab-game .msgr-fab{top:8px;bottom:auto;right:10px;width:42px;height:42px;box-shadow:0 6px 16px #000a}
 html body.msgr-fab-game .msgr-fab .msgr-icon{width:22px;height:22px}
 html body .msgr-float,html body.msgr-fab-game .msgr-float{inset:0;width:auto;height:auto;border-radius:0;border:0;transform-origin:calc(100% - 40px) calc(100% - 40px)}
 html body .msgr-float-head{padding-top:calc(8px + env(safe-area-inset-top))}
}
@media (prefers-reduced-motion:reduce){html body .msgr-fab,html body .msgr-float,html body .msgr-fab *{animation:none!important;transition:none!important}}
@media (prefers-reduced-motion:reduce) and (scripting:none){
 html body .msgr-mount *,html body .msgr-mount{animation:none!important;transition:none!important}
}
