/* Finish application chrome consistently; message-authored HTML remains untouched. */
:root{--mt-header-height:72px;--mt-accent-soft:color-mix(in srgb,var(--sc-accent) 10%,var(--ws-panel));--mt-accent-line:color-mix(in srgb,var(--sc-accent) 26%,var(--ws-border))}
html[data-secmail-mode]{--sc-soft:var(--mt-accent-soft);--sc-pale:var(--mt-accent-soft);--sc-line:var(--ws-border);--sc-ink:var(--ws-strong)}
html[data-secmail-mode] :is(body.sc-shell,body.sc-message-frame){--sc-text:var(--ws-text);--sc-muted:var(--ws-muted);--sc-border:var(--ws-border);color:var(--ws-text);background:var(--ws-bg)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.popover,.popover-header,.popover-body,.popupmenu,.popup .listbox,.ui-dialog,.ui-dialog-titlebar,.ui-dialog-content,.ui-dialog-buttonpane,.dropdown-menu,.menu.listing,.listing-info,.navlist,.searchoptions){background:var(--ws-panel)!important;color:var(--ws-text)!important;border-color:var(--ws-border)!important}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.popover-header,.ui-dialog-titlebar){border-bottom:1px solid var(--ws-border);font-weight:600}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.popover,.popupmenu,.dropdown-menu,.ui-dialog){border-radius:12px;box-shadow:0 12px 40px var(--ws-shadow)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.listing li>a,.popupmenu a,.dropdown-menu a,.ui-menu-item-wrapper){color:var(--ws-text)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.listing li>a,.popupmenu a,.dropdown-menu a,.ui-menu-item-wrapper):hover{background:var(--ws-hover)!important;color:var(--ws-strong)!important}
html[data-secmail-mode] .sc-shell :is(#taskmenu a.selected,.folderlist li.selected>a,#sections-table li.selected>a){background:var(--mt-accent-soft)!important;color:var(--sc-accent)!important;box-shadow:none}
html[data-secmail-mode] .sc-shell #messagelist tr.selected td{background:var(--mt-accent-soft)!important;color:var(--ws-text)!important}
html[data-secmail-mode] .sc-shell #messagelist tr.selected td.subject{box-shadow:inset 3px 0 var(--sc-accent)}
html[data-secmail-mode] .sc-shell :is(.folderlist .unreadcount,.listing .unreadcount){background:var(--mt-accent-soft);color:var(--sc-accent);border-radius:6px;font-weight:600}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.btn-secondary,.btn-light,.btn-default,.ui-dialog-buttonpane button,.attachmentslist a.button){background:var(--ws-aside)!important;color:var(--ws-text)!important;border:1px solid var(--ws-border)!important;border-radius:8px;box-shadow:none}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.custom-select,.form-control,.recipient-input,.multi-input,.input-group-text){background:var(--ws-field)!important;color:var(--ws-text)!important;border-color:var(--ws-border)!important}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.form-control,.recipient-input input)::placeholder{color:var(--ws-muted);opacity:1}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) .custom-control-input:checked~.custom-control-label::before{background-color:var(--sc-accent);border-color:var(--sc-accent)}
html[data-secmail-mode] .sc-shell :is(.recipient,.recipient-address,.recipient-input .recipient,.multi-input .recipient){background:var(--mt-accent-soft)!important;color:var(--ws-text)!important;border-color:var(--mt-accent-line)!important;border-radius:6px}
html[data-secmail-mode] .sc-shell :is(.editor-toolbar,.tox .tox-editor-header,.tox .tox-toolbar,.tox .tox-toolbar__primary,.tox .tox-toolbar-overlord,.tox .tox-menubar,.tox .tox-statusbar){background:var(--ws-aside)!important;color:var(--ws-text)!important;border-color:var(--ws-border)!important;box-shadow:none!important}
html[data-secmail-mode] .sc-shell .tox :is(.tox-tbtn,.tox-mbtn,.tox-statusbar a){color:var(--ws-text)!important}html[data-secmail-mode] .sc-shell .tox .tox-tbtn svg{fill:var(--ws-text)!important}
html[data-secmail-mode] .sc-shell :is(#compose-attachments,#compose-options,#uploadform,#attachment-list){background:var(--ws-panel);color:var(--ws-text);border-color:var(--ws-border)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) .attachmentslist{background:var(--ws-aside)!important;color:var(--ws-text);border:1px solid var(--ws-border);border-radius:10px}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.attachmentslist li,.attachmentslist a,.upload-form .hint,.attachment-size){color:var(--ws-muted);border-color:var(--ws-border)}
html[data-secmail-mode] .sc-shell :is(.file-upload.droptarget,.file-upload.hover){background:var(--mt-accent-soft)!important;border-color:var(--sc-accent)!important}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(.toolbar a,.header .toolbar a){border-radius:8px;color:var(--ws-muted);white-space:nowrap}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) .toolbar a:hover{color:var(--sc-accent);background:var(--mt-accent-soft)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(#message-header,#message-content,.message-header,.message-content){border-color:var(--ws-border);color:var(--ws-text)}
html[data-secmail-mode] :is(.sc-shell,.sc-message-frame) :is(#message-header h2,.message-header h2){color:var(--ws-strong)}
.sc-message-frame #message-content{overflow-x:auto}.sc-message-frame #messagebody pre{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:14px;line-height:1.75}
html[data-secmail-mode] .sc-shell .column-resizer:hover{background:var(--mt-accent-soft)}
html[data-secmail-mode] .sc-shell :is(.sc-appearance-button:hover,.sc-palette-option[aria-pressed=true]){border-color:var(--mt-accent-line);background:var(--mt-accent-soft)}
.sc-shell:not(.task-login) .sc-masthead{height:var(--mt-header-height)}.sc-shell:not(.task-login) #layout{top:var(--mt-header-height)}
/* Match Elastic's actual 768px / 1024px breakpoints instead of leaving a gap. */
@media(max-width:1024px){.sc-shell:not(.task-login) #layout>div{min-width:0}.sc-shell:not(.task-login) .toolbar a{min-width:38px}.sc-shell:not(.task-login) .sc-masthead{gap:12px}}
@media(max-width:768px){
 :root{--mt-header-height:calc(56px + env(safe-area-inset-top,0px))}
 .sc-shell:not(.task-login){min-height:100dvh;overflow:hidden}
 .sc-shell:not(.task-login) .sc-masthead{padding:env(safe-area-inset-top,0px) max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));gap:10px;background:var(--ws-panel);border-bottom:1px solid var(--ws-border)}
 .sc-shell:not(.task-login) #layout{inset:var(--mt-header-height) 0 0!important;width:100%;height:auto;border:0!important;border-radius:0!important}
 .sc-shell:not(.task-login) .sc-pilot-status{display:none}.sc-shell:not(.task-login) .sc-header-actions{gap:0}.sc-shell:not(.task-login) .sc-appearance-button{width:42px;height:42px;justify-content:center;padding:0}.sc-shell:not(.task-login) .sc-appearance-button span{display:none}
 .sc-shell:not(.task-login) .sc-wordmark{min-width:0;font-size:20px;letter-spacing:-.5px;gap:8px}.sc-shell:not(.task-login) .sc-mark{width:29px;height:29px;border-radius:9px}.sc-shell:not(.task-login) .mt-company-logo{max-width:min(46vw,180px);max-height:28px}
 .sc-shell:not(.task-login) #layout>div>.header{height:56px!important;min-height:56px;padding:6px 10px!important;background:var(--ws-panel)!important;color:var(--ws-text);border-bottom:1px solid var(--ws-border)}
 .sc-shell:not(.task-login) :is(#layout-menu,.popover-header,.popover-body){background:var(--ws-aside)!important;color:var(--ws-text)!important}
 .sc-shell:not(.task-login) .header a.button{min-width:42px;min-height:42px;margin:0!important;padding:0 5px!important;border-radius:9px}.sc-shell:not(.task-login) .header a.button::before{font-size:21px!important;line-height:42px!important;height:42px!important;color:inherit}
 .sc-shell:not(.task-login) #layout-list>.searchbar{margin:10px 12px;height:42px;min-height:42px;background:var(--ws-field);border-color:var(--ws-border)}
 .sc-shell:not(.task-login) #messagelist td.subject{padding:13px 14px}.sc-shell:not(.task-login) #messagelist .subject .fromto{font-size:14px}.sc-shell:not(.task-login) #messagelist .subject .subject{font-size:13px;line-height:1.6}.sc-shell:not(.task-login) #messagelist .subject .date{font-size:11px}
 .sc-shell:not(.task-login) :is(.footer,#layout-sidebar>.footer,#layout-list>.footer){min-height:42px;padding-bottom:max(8px,env(safe-area-inset-bottom,0px));background:var(--ws-panel)!important;color:var(--ws-muted)!important}
 .sc-shell.action-compose #layout-content .content{padding:16px!important}.sc-shell.action-compose #composebody{padding:16px!important;min-height:180px}.sc-shell.action-compose #compose-headers label{font-size:12px}.sc-shell.action-compose :is(input.form-control,select.form-control,textarea.form-control){font-size:16px!important}.sc-shell.action-compose #compose-subject{font-size:16px!important}.sc-shell.action-compose :is(#compose-attachments,#compose-options){padding:16px}
 .sc-message-frame #message-header{padding:18px 16px 14px}.sc-message-frame #message-header h2{font-size:19px}.sc-message-frame #message-content{padding:18px 16px}.sc-message-frame .attachmentslist{padding:10px}
 .sc-shell .sc-appearance-panel{top:calc(var(--mt-header-height) + 6px);right:10px;width:min(310px,calc(100vw - 20px));max-height:calc(100dvh - var(--mt-header-height) - 20px);overflow-y:auto}
 .sc-shell .ui-dialog{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px);border-radius:12px}.sc-shell .ui-dialog-content{overflow:auto!important}.sc-shell .ui-dialog-buttonpane .ui-dialog-buttonset{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;float:none}.sc-shell .ui-dialog-buttonpane button{min-height:44px;margin:0!important}
}
@media(max-width:380px){.sc-shell:not(.task-login) .sc-wordmark{font-size:18px}.sc-shell:not(.task-login) .sc-mark{width:26px;height:26px}.sc-shell:not(.task-login) #messagelist .subject .date{font-size:10px}}
