/* Keep the existing toolbar bell footprint and unread treatment. */
#mcsInboxBell{display:inline-flex;align-items:center;justify-content:center;position:relative;gap:0;background:transparent;color:#294b68;border:1px solid transparent;border-radius:8px;padding:0;width:38px;height:36px;min-height:36px;font:600 12px/1.2 'Segoe UI',Arial,sans-serif;cursor:pointer;white-space:nowrap;box-sizing:border-box;z-index:50;flex-shrink:0;opacity:.9}
#mcsInboxBell[hidden],.mcs-inbox-count[hidden]{display:none!important}
#mcsInboxBell svg{width:18px;height:18px;flex-shrink:0}
#mcsInboxBell img{display:block;width:34px;height:34px;filter:grayscale(.75);opacity:.9}
#mcsInboxBell.has-unread{opacity:1;background:#fff8e6;border-color:#f3cf88}
#mcsInboxBell.has-unread img{filter:none;opacity:1}
#mcsInboxBell:hover{opacity:1;background:#e8f1f6;border-color:#b4ccdd}
#mcsInboxBell:focus-visible{outline:3px solid #7fb4e1;outline-offset:2px}
#mcsInboxBell.mcs-inbox-at-help{margin:0;vertical-align:middle}
.mcs-inbox-inline{margin:4px 8px;flex-shrink:0}
.mcs-inbox-floating{top:94px;right:18px;box-shadow:0 3px 15px #26476125}
#mcsInboxBell .mcs-inbox-count{position:absolute;top:-5px;right:-5px;border-radius:20px;min-width:16px;height:16px;padding:1px 4px;background:#a62d45;color:#fff;font-size:10px;line-height:14px}
#mapToolbar #mcsInboxBell.mcs-inbox-at-help img{width:40px;height:40px;max-width:none}
#mapToolbar #mcsInboxBell.mcs-inbox-at-help{width:40px}

/* System messages use the same charcoal, green and raised controls as the map. */
#mcsInbox{
    --inbox-green:#76963f;
    --inbox-red:#ac4837;
    position:fixed;inset:0;margin:auto;box-sizing:border-box;
    width:min(600px,calc(100vw - 32px));height:fit-content;
    max-height:calc(100vh - 32px);max-height:min(780px,calc(100dvh - 32px));
    padding:20px;border:1px solid #484b44;border-radius:18px;
    background:#565853;color:#fff;font:16px/1.5 Arial,Helvetica,sans-serif;
    box-shadow:0 14px 55px #18243180;overflow:hidden;text-align:left;
}
#mcsInbox *{box-sizing:border-box}
#mcsInbox[open]{display:flex;flex-direction:column}
#mcsInbox::backdrop{background:#30435b73;backdrop-filter:blur(2px)}
#mcsInbox>header,#mcsInbox>footer,#mcsInbox>.mcs-inbox-status,#mcsInbox>.mcs-inbox-refresh{flex-shrink:0}
#mcsInbox>header{display:flex;align-items:center;justify-content:space-between;gap:14px;position:static;margin:0;padding:0 0 2px;background:none;color:inherit}
#mcsInbox .mcs-inbox-heading{display:flex;align-items:center;gap:10px;min-width:0}
#mcsInbox .mcs-inbox-heading img{display:block;flex:0 0 42px;width:42px;height:42px}
#mcsInbox h2{margin:0;padding:0;color:#fff;font:700 30px/1.15 Arial,Helvetica,sans-serif;overflow-wrap:anywhere}
#mcsInbox button{font:700 15px/1.2 Arial,Helvetica,sans-serif;min-height:40px;padding:10px 15px;border:2px solid #40443c;border-radius:8px;background:#4b4e47;color:#fff;box-shadow:0 3px 4px #252a2550,inset 0 1px #ffffff12;cursor:pointer}
#mcsInbox button:hover:not(:disabled){filter:brightness(1.12)}
#mcsInbox button:disabled{opacity:.42;cursor:default;box-shadow:none}
#mcsInbox .mcs-inbox-close,#mcsInbox .mcs-inbox-remove{display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;min-height:40px;margin:0;padding:0;border:1px solid #903c2e;border-radius:50%;background:var(--inbox-red);color:#fff;font:400 32px/1 Arial,Helvetica,sans-serif;box-shadow:inset 0 1px #ffffff20,0 2px 3px #17231730}
#mcsInbox .mcs-inbox-status{display:flex;align-items:center;gap:10px;margin:18px 0 14px;padding:12px 14px;border-radius:10px;background:#eff0ec;color:#343a31;font-size:16px;line-height:1.4}
#mcsInbox .mcs-inbox-status:empty{display:none}
#mcsInbox .mcs-inbox-status::before{content:'';display:block;flex:0 0 23px;width:23px;height:23px;border-radius:4px;background:#719544 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4 10-10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat}
#mcsInbox .mcs-inbox-status[data-state=unread]::before{background:transparent url('/mcs/images/notification-bell-read.svg') center/contain no-repeat}
#mcsInbox .mcs-inbox-status[data-state=error]::before{background:#ac4837;content:'!';text-align:center;color:#fff;font-weight:bold}
#mcsInbox .mcs-inbox-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 4px 4px 0;scrollbar-width:thin;scrollbar-color:#a9b1a0 #454a40}
#mcsInbox .mcs-inbox-item{margin:0 0 12px;border:1px solid #43473e;border-radius:12px;background:#4a4d46;box-shadow:0 4px 5px #242a2450;overflow:hidden}
#mcsInbox .mcs-inbox-item:last-child{margin-bottom:0}
#mcsInbox .mcs-inbox-item.is-unread{border-color:#a8c86d}
#mcsInbox .mcs-inbox-item summary{display:grid;grid-template-columns:30px minmax(0,1fr) 20px;align-items:center;column-gap:12px;row-gap:3px;padding:16px;list-style:none;cursor:pointer}
#mcsInbox .mcs-inbox-item summary::-webkit-details-marker{display:none}
#mcsInbox .mcs-inbox-item summary strong{grid-column:2;grid-row:1;display:block;color:#fff;font-size:21px;font-weight:700;line-height:1.25;overflow-wrap:anywhere}
#mcsInbox .mcs-inbox-item summary small{grid-column:2;grid-row:2;display:block;color:#d1d7c9;font-size:13px;line-height:1.4}
#mcsInbox .mcs-inbox-message-icon{grid-column:1;grid-row:1 / span 2;display:block;width:30px;height:30px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='2' y='5' width='28' height='22' rx='2' fill='%23e1dfe9'/%3E%3Cpath d='m3 7 13 11L29 7M3 26l9-9m17 9-9-9' fill='none' stroke='%23b5b0c1' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
#mcsInbox .mcs-inbox-disclosure{grid-column:3;grid-row:1 / span 2;display:block;width:20px;height:18px;background:linear-gradient(#e5e9e0,#e5e9e0) top/20px 3px,linear-gradient(#e5e9e0,#e5e9e0) center/20px 3px,linear-gradient(#e5e9e0,#e5e9e0) bottom/20px 3px;background-repeat:no-repeat}
#mcsInbox .mcs-inbox-item[open]{border:3px solid #98b960;background:var(--inbox-green)}
#mcsInbox .mcs-inbox-item[open] summary{grid-template-columns:30px minmax(0,1fr) auto 16px;column-gap:10px;row-gap:0;padding:15px 12px 17px}
#mcsInbox .mcs-inbox-item[open] summary strong{text-shadow:0 1px 1px #2c421d50}
#mcsInbox .mcs-inbox-item[open] summary small{grid-column:3;grid-row:1;color:#172510;white-space:nowrap}
#mcsInbox .mcs-inbox-item[open] .mcs-inbox-message-icon{grid-row:1;background-image:url('/mcs/images/notification-bell-read.svg');width:32px;height:32px}
#mcsInbox .mcs-inbox-item[open] .mcs-inbox-disclosure{grid-column:4;grid-row:1;width:16px;height:3px;background:#e7f0db}
#mcsInbox .mcs-inbox-body{margin:0 6px 6px;padding:18px;border:0;border-radius:9px;background:#fff;color:#283128}
#mcsInbox .mcs-inbox-kind{display:inline-block;padding:4px 10px;border-radius:20px;background:#565853;color:#fff;font-size:11px;line-height:1.5;font-weight:700;text-transform:uppercase;letter-spacing:.3px}
#mcsInbox .mcs-inbox-body p{margin:16px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font:16px/1.6 Arial,Helvetica,sans-serif;color:inherit}
#mcsInbox .mcs-inbox-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:22px}
#mcsInbox .mcs-inbox-open{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:42px;padding:8px 17px;border:2px solid #527629;border-radius:9px;background:#5d7f2e;color:#fff;box-shadow:0 3px 4px #23361a40,inset 0 1px #ffffff35;font-size:18px;font-weight:700;line-height:1.2;text-decoration:none}
#mcsInbox .mcs-inbox-open>span:first-child{font:400 27px/1 Arial,Helvetica,sans-serif;color:#e4eccf}
#mcsInbox .mcs-inbox-open:hover{background:#52752a}
#mcsInbox .mcs-inbox-remove{margin-left:auto;flex-basis:38px;width:38px;height:38px;min-height:38px;font-size:30px}
#mcsInbox>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 0;padding:0;background:none;color:#fff;font-size:16px;font-weight:700}
#mcsInbox .mcs-inbox-refresh{display:flex;align-items:center;justify-content:center;align-self:center;gap:8px;margin:12px 0 0;padding:5px 8px;border:0;background:transparent;box-shadow:none;color:#e0e4d9;font-size:14px;font-weight:400;min-height:32px}
#mcsInbox .mcs-inbox-refresh>span:first-child{font-size:22px;color:#b9d2e8;line-height:1}
#mcsInbox :focus-visible{outline:3px solid #cce8fa;outline-offset:-3px}
#mcsInbox .mcs-inbox-body :focus-visible{outline-color:#28689d;outline-offset:3px}
@media(max-width:600px){.mcs-inbox-inline{margin:3px 4px}.mcs-inbox-floating{right:10px}}
@media(max-width:480px){
    #mcsInbox{width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px);padding:14px;border-radius:14px}
    #mcsInbox>header{gap:8px}
    #mcsInbox .mcs-inbox-heading{gap:6px}
    #mcsInbox .mcs-inbox-heading img{flex-basis:34px;width:34px;height:34px}
    #mcsInbox h2{font-size:24px}
    #mcsInbox .mcs-inbox-close{flex-basis:36px;width:36px;height:36px;min-height:36px}
    #mcsInbox .mcs-inbox-status{margin:14px 0 12px;font-size:14px;padding:10px}
    #mcsInbox .mcs-inbox-item summary,#mcsInbox .mcs-inbox-item[open] summary{grid-template-columns:26px minmax(0,1fr) 16px;column-gap:9px;row-gap:4px;padding:12px}
    #mcsInbox .mcs-inbox-item summary strong{font-size:19px}
    #mcsInbox .mcs-inbox-item[open] summary small{grid-column:2;grid-row:2;font-size:12px}
    #mcsInbox .mcs-inbox-item[open] .mcs-inbox-disclosure{grid-column:3;grid-row:1 / span 2}
    #mcsInbox .mcs-inbox-message-icon,#mcsInbox .mcs-inbox-item[open] .mcs-inbox-message-icon{width:26px;height:26px;grid-row:1 / span 2}
    #mcsInbox .mcs-inbox-body{padding:14px}
    #mcsInbox .mcs-inbox-body p{font-size:15px}
    #mcsInbox>footer{font-size:14px;gap:6px;margin-top:12px}
    #mcsInbox>footer button{font-size:13px;padding:9px 12px}
}
@media(max-height:500px){#mcsInbox{padding:12px}#mcsInbox h2{font-size:23px}#mcsInbox .mcs-inbox-status{margin:8px 0;padding:8px 12px}#mcsInbox>footer{margin-top:8px}#mcsInbox .mcs-inbox-refresh{margin-top:4px}}
@media print{#mcsInboxBell,#mcsInbox{display:none!important}}
