/* Mailbox module only. PMS base form controls and modal buttons are reused. */
.mailbox-layout{display:grid;grid-template-columns:minmax(150px,190px) minmax(220px,34%) minmax(300px,1fr);gap:12px;align-items:start;min-height:65vh}
.mailbox-layout>.card{margin:0!important;padding:12px!important;min-height:65vh;min-width:0}
.mailbox-folder-title{font-size:14px;font-weight:700;display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.mailbox-add{font-size:20px;line-height:1;border:none;background:transparent;cursor:pointer;color:inherit}
.mailbox-folder{width:100%;display:flex;align-items:center;gap:8px;padding:9px 8px;background:transparent;border:0;border-radius:6px;text-align:left;color:inherit;font:inherit;font-size:12px;cursor:pointer}
.mailbox-folder:hover,.mailbox-folder.selected{background:#e9f2fa}
.mailbox-folder svg{width:15px;height:15px;flex:none}
.mailbox-folder span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.mailbox-unread{font-size:11px;color:#175286}
.mailbox-message-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;font-size:13px}
.mailbox-message-head small{color:#718096}
.mailbox-items{max-height:calc(70vh - 98px);overflow:auto}
.mailbox-item{appearance:none;width:100%;display:flex;flex-direction:column;gap:4px;min-height:63px;border:0;border-bottom:1px solid #e4ebf1;background:transparent;padding:8px 6px;text-align:left;cursor:pointer;color:inherit;font-size:12px}
.mailbox-item:hover{background:#f0f6fc}.mailbox-item.unread{background:#f7faff}
.mailbox-item.unread strong,.mailbox-item.unread .mailbox-item-subject{font-weight:700}
.mailbox-item-head{display:flex;gap:8px;justify-content:space-between;width:100%;min-width:0}
.mailbox-item-head strong,.mailbox-item-subject{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.mailbox-item-head time{flex:none;color:#718096;font-size:10px}
.mailbox-pages{display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:11px;margin-top:8px}
.mailbox-pages .btn{padding:5px 7px;min-height:28px;font-size:11px}
.mailbox-read-head{padding-bottom:12px;border-bottom:1px solid #e2e8f0;font-size:12px}
.mailbox-read-head h2{margin:0 0 8px;font-size:16px;overflow-wrap:anywhere}
.mailbox-read-head>.actions{margin-top:9px;flex-wrap:wrap;gap:5px}
.mailbox-read-head .btn{min-height:30px;padding:5px 8px;font-size:12px}
.mailbox-read-head select{max-width:200px;height:30px;padding:3px;font-size:12px}
.mailbox-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:10px 0}
.mailbox-content{margin-top:10px;max-height:62vh;overflow:auto;overflow-wrap:anywhere;font-size:13px;line-height:1.55}
.mailbox-content img{max-width:100%!important;height:auto!important}
.mailbox-compose-modal{width:min(900px,calc(100vw - 20px))!important;max-width:900px!important;max-height:calc(100dvh - 30px)!important;overflow:auto!important}
.mailbox-compose-modal #mf>label{display:block;margin:6px 0 4px;font-size:13px}
.mailbox-compose-modal #mf input:not([type=file]),.mailbox-compose-modal #mf select{box-sizing:border-box;width:100%;min-height:38px}
.mailbox-compose-modal #mf>.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media(max-width:1080px){.mailbox-layout{grid-template-columns:minmax(135px,165px) minmax(220px,1fr);grid-template-areas:'folders messages' 'preview preview'}.mailbox-folders{grid-area:folders}.mailbox-messages{grid-area:messages}.mailbox-preview{grid-area:preview}.mailbox-layout>.card{min-height:0}}
@media(max-width:680px){.mailbox-layout{display:flex;flex-direction:column;gap:8px}.mailbox-layout>.card{width:100%;box-sizing:border-box;min-height:0}.mailbox-folders{display:flex;flex-wrap:wrap;gap:3px}.mailbox-folder-title{width:100%;margin:0}.mailbox-folder{flex:0 1 auto;width:auto;max-width:155px;padding:6px}.mailbox-items{max-height:40vh}.mailbox-content{max-height:65vh}.mailbox-compose-modal #mf>.two{grid-template-columns:1fr}}
/* Jansen²B mailbox adaptive workspace – shared module styling, 2026-10-16 */
body:has(.mailbox-layout) #content{max-width:none;width:100%;min-width:0;box-sizing:border-box;padding:clamp(12px,1.6vw,26px)}
body:has(.mailbox-layout) #app>main{min-width:0}
body:has(.mailbox-layout) #content>.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
body:has(.mailbox-layout) #content>.toolbar h1{margin:0 0 4px;font-size:clamp(20px,1.8vw,26px);color:var(--j2b-navy,#173d60)}
body:has(.mailbox-layout) #content>.toolbar .actions{display:flex;flex-wrap:wrap;gap:7px;width:auto}
body:has(.mailbox-layout) #content>.toolbar .btn{min-height:36px;white-space:normal}
.mailbox-layout{width:100%;box-sizing:border-box;display:grid;grid-template-columns:clamp(165px,15%,235px) minmax(260px,31%) minmax(0,1fr);gap:12px;align-items:stretch;min-height:0;height:clamp(460px,calc(100dvh - 215px),1100px)}
.mailbox-layout>.card{box-sizing:border-box;min-width:0;min-height:0;height:100%;margin:0!important;padding:14px!important;border:1px solid var(--j2b-border,#dbe5ed);border-radius:11px;background:#fff;overflow:hidden}
.mailbox-layout .mailbox-folders,.mailbox-layout .mailbox-messages,.mailbox-layout .mailbox-preview{min-width:0;min-height:0}
.mailbox-layout .mailbox-folders{overflow:auto}
.mailbox-layout .mailbox-messages{display:flex;flex-direction:column}
.mailbox-items{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.mailbox-pages{flex:none;padding-top:9px;border-top:1px solid var(--j2b-border,#dbe5ed)}
.mailbox-layout .mailbox-preview{overflow-y:auto;overscroll-behavior:contain}
.mailbox-content{max-height:none;overflow:visible;font-size:13px;line-height:1.55}
.mailbox-folder{min-height:36px;font-size:13px}
.mailbox-folder.selected{background:var(--j2b-light-blue,#d9eaf8);color:var(--j2b-navy,#173d60);font-weight:700}
.mailbox-folder:focus-visible,.mailbox-item:focus-visible{outline:2px solid var(--j2b-blue,#217cac);outline-offset:-2px}
.mailbox-item{min-height:70px;padding:10px 8px;font-size:13px}
.mailbox-item:hover{background:#edf5fb}
.mailbox-item-head{align-items:baseline}
.mailbox-item-head strong{flex:1;min-width:0}
.mailbox-item-head time{white-space:nowrap}
.mailbox-read-head h2{font-size:clamp(16px,1.4vw,21px);color:var(--j2b-navy,#173d60)}
.mailbox-read-head .actions{display:flex;flex-wrap:wrap;gap:6px}
.mailbox-placeholder{padding:14px;color:var(--muted,#687386)}
@media(max-width:1150px){
 .mailbox-layout{grid-template-columns:170px minmax(245px,38%) minmax(0,1fr);gap:9px}
 .mailbox-layout>.card{padding:11px!important}
}
@media(max-width:900px){
 .mailbox-layout{height:auto;min-height:0;grid-template-columns:minmax(155px,28%) minmax(0,1fr);grid-template-areas:"folders messages" "preview preview";align-items:stretch}
 .mailbox-folders{grid-area:folders}.mailbox-messages{grid-area:messages}.mailbox-preview{grid-area:preview}
 .mailbox-layout>.card{height:auto;min-height:0}
 .mailbox-layout .mailbox-messages{height:min(57dvh,560px);min-height:300px}
 .mailbox-layout .mailbox-preview{min-height:230px;max-height:none;overflow:visible}
}
@media(max-width:600px){
 body:has(.mailbox-layout) #content{padding:10px}
 body:has(.mailbox-layout) #content>.toolbar .actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 body:has(.mailbox-layout) #content>.toolbar .btn{min-width:0;width:100%;font-size:12px;padding:8px}
 .mailbox-layout{display:flex;flex-direction:column;height:auto;gap:9px}
 .mailbox-layout>.card{width:100%;padding:11px!important}
 .mailbox-layout .mailbox-folders{display:flex;flex-wrap:wrap;gap:3px;max-height:none}
 .mailbox-folder-title{width:100%;margin-bottom:3px}
 .mailbox-folder{width:auto;max-width:100%;flex:1 1 105px;justify-content:center;min-height:36px}
 .mailbox-folder span{flex:0 1 auto}
 .mailbox-layout .mailbox-messages{height:min(52dvh,490px);min-height:260px}
 .mailbox-layout .mailbox-preview{min-height:210px;max-height:none}
 .mailbox-items{max-height:none}
 .mailbox-item{min-height:62px}
 .mailbox-pages{flex-wrap:wrap}
 .mailbox-read-head .actions>.btn{flex:1 1 115px}
 .mailbox-read-head select{flex:1 1 145px;max-width:none}
 .mailbox-compose-modal{width:calc(100vw - 14px)!important;max-height:calc(100dvh - 18px)!important}
 .mailbox-compose-modal #mf>.two{grid-template-columns:1fr}
}
/* Workspace v3: enforce available screen width even with legacy layout rules. */
body:has(.mailbox-layout) #app > main{width:auto!important;max-width:none!important}
body:has(.mailbox-layout) #app > main > #content{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important}
body:has(.mailbox-layout) .mailbox-layout{width:100%!important;max-width:none!important;min-width:0!important;grid-template-columns:minmax(175px,19%) minmax(290px,33%) minmax(0,1fr)!important}
body:has(.mailbox-layout) .mailbox-layout>.mailbox-folders{width:auto!important;max-width:none!important}
body:has(.mailbox-layout) .mailbox-layout>.mailbox-messages{width:auto!important;max-width:none!important}
body:has(.mailbox-layout) .mailbox-layout>.mailbox-preview{width:auto!important;max-width:none!important}
.mailbox-layout .mailbox-folder-title{color:var(--j2b-navy);padding:5px 2px 10px;border-bottom:1px solid var(--j2b-border)}
.mailbox-layout .mailbox-message-head{padding:6px 3px 12px;border-bottom:1px solid var(--j2b-border);color:var(--j2b-navy)}
.mailbox-layout .mailbox-item.selected{background:var(--j2b-light-blue)!important;box-shadow:inset 3px 0 var(--j2b-blue)}
.mailbox-layout .mailbox-preview:not(:has(.mailbox-read-head)){background:linear-gradient(180deg,#fff,#f9fbfd)}
.mailbox-layout .mailbox-preview:not(:has(.mailbox-read-head)) .mailbox-placeholder{display:flex;align-items:center;justify-content:center;text-align:center;min-height:200px}
@media(max-width:1100px){body:has(.mailbox-layout) .mailbox-layout{grid-template-columns:minmax(145px,22%) minmax(240px,35%) minmax(0,1fr)!important}}
@media(max-width:900px){body:has(.mailbox-layout) .mailbox-layout{grid-template-columns:minmax(155px,28%) minmax(0,1fr)!important}}
@media(max-width:600px){body:has(.mailbox-layout) .mailbox-layout{display:flex!important;flex-direction:column!important}}

/* Prevent global PMS sidebar 'aside' rule from affecting mailbox folder pane. */
body:has(.mailbox-layout) #app > main .mailbox-layout > aside.mailbox-folders{position:static!important;inset:auto!important;transform:none!important;z-index:auto!important;box-shadow:none!important;color:var(--text)!important;display:block;overflow-y:auto!important;padding:12px!important;max-width:none!important}
@media(max-width:600px){body:has(.mailbox-layout) #app > main .mailbox-layout > aside.mailbox-folders{display:flex!important;flex-wrap:wrap;gap:4px;overflow:visible!important}}
/* During restoration never paint an intermediate communication page. */
body.pms-mailbox-restoring #content{visibility:hidden!important}

/* Shared envelope for received, outgoing and draft e-mail; navy Jansen2B palette. */
.pms-mail-envelope{margin:8px 0 12px;border:1px solid #cbd9e8;background:#f8fbff;border-radius:9px;overflow:hidden;font-size:12px;color:#213b57}
.mail-envelope-strip{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 11px;background:#e8f2fb;border-bottom:1px solid #d4e3ef;font-weight:700}
.mail-envelope-direction{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:99px;background:#d4e9fa;color:#124d7b}
.pms-mail-envelope.outgoing .mail-envelope-strip{background:#e6f3ec}
.pms-mail-envelope.outgoing .mail-envelope-direction{background:#ccebd9;color:#176c49}
.pms-mail-envelope.draft .mail-envelope-strip{background:#eef0f4}
.pms-mail-envelope.draft .mail-envelope-direction{background:#d9e1ea;color:#53677d}
.mail-envelope-strip time{color:#52687e;font-size:11px;white-space:normal;text-align:right}
.mail-envelope-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:4px 11px}
.mail-envelope-row{display:grid;grid-template-columns:54px minmax(0,1fr);gap:8px;padding:5px 0;border-bottom:1px solid #e6edf4;line-height:1.35}
.mail-envelope-row:last-child{border-bottom:none}
.mail-envelope-key{font-weight:750;color:#426582}
.mail-envelope-value{overflow-wrap:anywhere;white-space:pre-wrap}
.mail-envelope-empty{color:#8091a0;font-style:italic}
.mailbox-read-head .pms-mail-envelope{margin:7px 0 13px}
.pms-mail-compact-meta{display:flex;gap:5px 15px;flex-wrap:wrap;color:#58728d;font-size:11px;line-height:1.5;margin:4px 0 7px}
.pms-mail-compact-meta span{overflow-wrap:anywhere}
.pms-mail-compact-meta time{font-weight:700;color:#41627b}
.mail-contact-suggestions{background:#f0f7fd;border:1px solid #c6def2;border-radius:6px;padding:9px;margin:9px 0;font-size:12px;line-height:1.5}
#mail-existing-contact,#mail-existing-organization{width:100%;min-height:38px;max-width:100%;font-size:13px}
@media(max-width:600px){.mail-envelope-strip{align-items:flex-start;flex-wrap:wrap}.mail-envelope-row{grid-template-columns:40px minmax(0,1fr)}}

