/* Dental-EMT E-Mail UI 2026-10-11 */
.emt-mail-fullscreen{position:fixed;inset:0;z-index:10000;background:var(--bg,#fff);color:var(--fg,#182c35);display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box}
.emt-mail-head{flex:none;padding:calc(12px + env(safe-area-inset-top)) 16px 12px;display:flex;align-items:center;gap:18px;border-bottom:1px solid #d6e0e5;background:#fff;color:#1c3645}
.emt-mail-head button{background:transparent;border:0;font-size:16px;cursor:pointer;color:#006e9b}
.emt-mail-scroll{overflow-y:auto;flex:1;min-height:0;padding:24px clamp(16px,5vw,60px);max-width:980px;width:100%;margin:auto;box-sizing:border-box}
.emt-mail-scroll h2{font-size:clamp(22px,3vw,30px);line-height:1.3;margin:0 0 18px}
.emt-mail-meta{display:flex;flex-direction:column;gap:5px;padding:0 0 18px;border-bottom:1px solid #d6e0e5}
.emt-mail-meta span,.emt-mail-meta small{overflow-wrap:anywhere;opacity:.75}
.emt-mail-content{margin:22px 0;line-height:1.65;overflow-wrap:anywhere;white-space:normal}
.emt-mail-attachments{display:flex;flex-wrap:wrap;gap:8px}
.emt-mail-actions{flex:none;display:flex;justify-content:center;gap:clamp(2px,1vw,12px);padding:8px 12px max(10px,env(safe-area-inset-bottom));border-top:1px solid #d6e0e5;background:#fff}
.emt-mail-actions button{display:flex;flex-direction:column;align-items:center;gap:3px;justify-content:center;padding:8px 10px;background:transparent;border:0;color:#165d7c;min-width:44px;cursor:pointer;font-size:22px}
.emt-mail-actions button small{font-size:11px;color:#274858}
.mail-find{display:flex;gap:8px;margin:12px 0}.mail-find input{flex:1;min-width:0;border:1px solid #aac3cd;border-radius:9px;padding:11px;font-size:16px}
.mail-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0;padding:10px;border:1px solid #bbd1da;border-radius:10px}
.mail-bulk[hidden]{display:none!important}.mail-row.selected{background:#d9f0fb!important;outline:2px solid #086f9f}
@media(max-width:570px){.emt-mail-actions{justify-content:space-around;gap:0;padding-left:2px;padding-right:2px}.emt-mail-actions button{padding:7px 3px;min-width:42px}.emt-mail-actions button small{font-size:10px}.emt-mail-scroll{padding:18px 15px}}
html[data-theme="dark"] .emt-mail-fullscreen{background:#11242b;color:#eaf3f6}
html[data-theme="dark"] .emt-mail-head,html[data-theme="dark"] .emt-mail-actions{background:#18323c;color:#eaf3f6;border-color:#3c5862}
html[data-theme="dark"] .emt-mail-actions button,html[data-theme="dark"] .emt-mail-actions button small{color:#d8ecf4}

/* 11.10.2026 – konsistente E-Mail-Piktogramme */
.emt-mail-head #mailBack{display:inline-flex;align-items:center;gap:6px;min-height:44px}
.emt-mail-head #mailBack svg{flex:none;width:24px;height:24px}
.emt-mail-actions{gap:0;justify-content:space-evenly}
.emt-mail-actions button{flex:1 1 0;min-width:0;max-width:125px;min-height:56px;padding:7px 3px;line-height:1.1}
.emt-mail-actions button svg{width:24px;height:24px;flex:none}
.emt-mail-actions button small{font-size:clamp(9px,2.5vw,11px);line-height:1.15}
.emt-mail-actions button:hover,.emt-mail-actions button:focus-visible{background:rgba(0,110,155,.10);border-radius:9px}
.emt-mail-actions button:focus-visible,.emt-mail-more button:focus-visible{outline:2px solid #006e9b;outline-offset:1px}
.emt-mail-actions button[aria-expanded="true"]{background:rgba(0,110,155,.13);border-radius:9px}
.emt-mail-more{position:absolute;right:12px;bottom:calc(82px + env(safe-area-inset-bottom));z-index:2;min-width:220px;padding:6px;border:1px solid #c8d5db;border-radius:12px;background:#fff;color:#1c3645;box-shadow:0 8px 28px rgba(0,0,0,.16)}
.emt-mail-more[hidden]{display:none!important}
.emt-mail-more button{width:100%;display:flex;align-items:center;gap:12px;text-align:left;background:transparent;color:inherit;border:0;border-radius:8px;min-height:46px;padding:10px;cursor:pointer;font-size:14px}
.emt-mail-more button:hover{background:rgba(0,110,155,.1)}
.emt-mail-more button svg,.emt-mail-attachments button svg{width:20px;height:20px;flex:none;vertical-align:middle}
.emt-mail-attachments button{display:inline-flex;align-items:center;gap:7px}
@media(max-width:380px){.emt-mail-actions button svg{width:21px;height:21px}.emt-mail-actions button small{font-size:9px}}
html[data-theme="dark"] .emt-mail-more{background:#18323c;color:#eaf3f6;border-color:#3c5862}

/* 11.10.2026 – Checkboxen, Sammelaktionen und sichtbare Auswahl */
.mail-select-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:6px 0 8px;padding:4px 7px;font-size:13px}
.mail-select-all{display:flex;align-items:center;gap:9px;min-height:42px;cursor:pointer;font-weight:600}
.mail-select-all input,.mail-checkbox{width:19px;height:19px;accent-color:#006e9b;cursor:pointer;flex:none}
.mail-page-count{font-size:12px;opacity:.68;text-align:right}
.mail-item{display:flex;align-items:stretch;min-width:0;border-bottom:1px solid #dce6ea;position:relative}
.mail-item .mail-checkbox-label{display:flex;align-items:center;justify-content:center;flex:none;width:46px;min-height:72px;cursor:pointer}
.mail-item .mail-checkbox-label:focus-within{outline:2px solid #006e9b;outline-offset:-2px;border-radius:6px}
.mail-item .mail-swipe{flex:1 1 auto;min-width:0}
.mail-item .mail-row{min-width:0;width:100%;border-bottom:0!important}
.mail-item.selected{background:rgba(0,110,155,.11)}
.mail-item.selected .mail-row{background:transparent!important}
.mail-bulk{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:10px 0;padding:10px;border:1px solid #bbd1da;border-radius:12px}
.mail-bulk[hidden]{display:none!important}
.mail-bulk-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.mail-bulk-buttons button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:40px;padding:7px 10px;border:1px solid #bdd2db;border-radius:8px;background:transparent;color:inherit;font-size:13px;cursor:pointer}
.mail-bulk-buttons button svg{width:18px;height:18px;flex:none}
.mail-bulk-buttons button:disabled{opacity:.55;cursor:wait}
.mail-bulk-buttons button:hover:not(:disabled),.mail-bulk-buttons button:focus-visible{background:rgba(0,110,155,.11)}
.mail-bulk-buttons .mail-bulk-danger{border-color:#cd9090;color:#a22a34}
#mailClearSelection{margin-left:auto}
@media(max-width:520px){.mail-bulk-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.mail-bulk-buttons button{font-size:12px;min-width:0;padding:8px 4px;flex-direction:column;gap:3px}.mail-bulk-buttons button svg{width:20px;height:20px}#mailClearSelection{margin-left:0}.mail-select-head{align-items:flex-start}.mail-page-count{max-width:110px}}
html[data-theme="dark"] .mail-item{border-bottom-color:#3b505b}
html[data-theme="dark"] .mail-item.selected{background:rgba(68,172,214,.18)}
html[data-theme="dark"] .mail-bulk-buttons button{border-color:#4b6b78}
html[data-theme="dark"] .mail-bulk-buttons .mail-bulk-danger{color:#ffabab;border-color:#a75c5c}

/* 11.10.2026 – HTML-Nachrichten sicher und isoliert im Vollbild */
.emt-mail-html-frame{display:block;width:100%;height:max(380px,62vh);border:0;border-radius:8px;background:#fff;margin:14px 0 20px}
.emt-mail-remote{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:10px 12px;margin:14px 0;background:#edf5f9;border:1px solid #c9dce5;border-radius:9px;color:#233f4d;font-size:13px}
.emt-mail-remote[hidden]{display:none!important}
.emt-mail-remote button{min-height:38px;border:1px solid #83b8ce;border-radius:8px;padding:7px 11px;background:#fff;color:#005d83;cursor:pointer}
.emt-mail-actions{padding-bottom:max(8px,env(safe-area-inset-bottom))}
.emt-mail-actions button small{overflow-wrap:normal;text-wrap:balance}
@media(max-width:520px){.emt-mail-scroll{padding:15px 12px}.emt-mail-html-frame{height:65vh}.emt-mail-actions button{min-height:64px;padding:6px 1px}.emt-mail-actions button small{font-size:9px}.emt-mail-actions button svg{width:22px;height:22px}}

/* Bilder nach Mitgliedereinstellung: blockieren, nachfragen oder sofort laden */
.emt-mail-remote-status{flex:1 1 100%;font-size:13px}
.emt-mail-remote-label{font-weight:600;font-size:13px}
.emt-mail-remote select{max-width:100%;min-height:39px;border:1px solid #91b8c8;border-radius:7px;padding:7px 8px;color:#1c3645;background:#fff;font-size:14px}
.emt-mail-remote button[hidden]{display:none!important}
.emt-mail-image-settings{border:1px solid #cbdce3;border-radius:10px;padding:12px;margin:12px 0;display:flex;flex-direction:column;gap:9px}
.emt-mail-image-settings legend{font-weight:700;padding:0 5px}
.emt-mail-image-settings label{display:flex;align-items:center;gap:9px;min-height:36px;font-size:14px}
.emt-mail-image-settings input{accent-color:#006e9b;width:18px;height:18px;flex:none}
.emt-mail-image-settings small{font-size:12px;line-height:1.5;opacity:.8}
@media(max-width:520px){.emt-mail-remote select{flex:1 1 auto;min-width:140px}.emt-mail-remote button{flex:1 1 100%}}


/* 12.10.2026 – Kompakte Bildsteuerung + responsive HTML-Mails */
.emt-mail-remote{
  display:flex;flex-flow:row wrap;align-items:center;justify-content:flex-start;
  gap:6px 8px;padding:7px 9px;margin:12px 0 6px;
  background:#edf5f9;border:1px solid #c9dce5;border-radius:9px;
  font-size:12px;line-height:1.25;min-height:42px;
}
.emt-mail-remote .emt-mail-remote-label{flex:0 0 auto;font-size:12px;font-weight:600;white-space:nowrap}
.emt-mail-remote #mailRemoteMode{
  display:inline-block;flex:0 1 136px;width:136px;min-width:0;max-width:155px!important;
  min-height:32px!important;height:32px!important;padding:4px 8px!important;
  font-size:12px!important;line-height:1.2!important;margin:0!important;
  border:1px solid #91b8c8;border-radius:7px;color:#1c3645;background-color:#fff;
}
.emt-mail-remote #mailLoadRemote{
  flex:0 0 auto;min-height:32px!important;height:32px!important;
  font-size:12px!important;padding:4px 9px!important;margin:0!important;
}
.emt-mail-remote .emt-mail-remote-status{flex:0 0 auto;font-size:11px;margin:0}
.emt-mail-remote .emt-mail-remote-status:empty{display:none}
.emt-mail-html-frame{width:100%;min-width:0;max-width:100%;margin-top:5px}
@media(max-width:520px){
  .emt-mail-scroll{overflow-x:hidden}
  .emt-mail-remote{padding:6px 8px;gap:5px 7px}
  .emt-mail-remote #mailRemoteMode{flex:0 1 118px;width:118px;min-width:0;max-width:135px!important}
  .emt-mail-remote #mailLoadRemote{flex:0 0 auto;min-width:0;width:auto;font-size:11px!important;padding:4px 7px!important}
  .emt-mail-html-frame{margin-top:5px}
}

/* 12.10.2026 - Pinch only inside isolated HTML mail, no outer zoom controls. */
.emt-mail-html-frame{touch-action:manipulation;min-height:48vh;display:block}
@media(max-width:520px){.emt-mail-html-frame{height:calc(100dvh - 340px);min-height:48vh}}


/* 12.10.2026 – Mail reading view respects manual theme selection. */
html[data-theme="light"] .emt-mail-fullscreen{background:#fff;color:#1b303a}
html[data-theme="light"] .emt-mail-head,
html[data-theme="light"] .emt-mail-actions{background:#fff;color:#1c3645;border-color:#d6e0e5}
html[data-theme="light"] .emt-mail-actions button,
html[data-theme="light"] .emt-mail-actions button small{color:#165d7c}
html[data-theme="light"] .emt-mail-more{background:#fff;color:#1c3645;border-color:#c8d5db}
html[data-theme="light"] .emt-mail-meta{border-color:#d6e0e5}
html[data-theme="dark"] .emt-mail-fullscreen{background:#0d0d0d!important;color:#ececec!important}
html[data-theme="dark"] .emt-mail-head,
html[data-theme="dark"] .emt-mail-actions{background:#171717!important;color:#f4f4f4!important;border-color:#363636!important}
html[data-theme="dark"] .emt-mail-actions button{background:transparent!important;color:#ececec!important}
html[data-theme="dark"] .emt-mail-actions button small{color:#c5c5c5!important}
html[data-theme="dark"] .emt-mail-meta{border-color:#3a3a3a}
html[data-theme="dark"] .emt-mail-more{background:#202020!important;color:#ececec!important;border-color:#404040!important}
html[data-theme="dark"] .emt-mail-remote{background:#202020!important;color:#ececec!important;border-color:#454545!important}
html[data-theme="dark"] .emt-mail-remote select,
html[data-theme="dark"] .emt-mail-remote button{background:#282828!important;color:#f1f1f1!important;border-color:#555!important}
html[data-theme="dark"] .emt-mail-html-frame{background:#fff;border-color:#404040}
/* Full-screen mail overlay: disable the underlying webpage scroll only while reading. */
html:has(>body>.emt-mail-fullscreen),
body:has(>.emt-mail-fullscreen){overflow:hidden!important;overscroll-behavior:none}

/* Wide desktop reader. The sender metadata sits beside the message, not above a narrow column. */
@media(min-width:1100px){
 .emt-mail-fullscreen{overflow:hidden}
 .emt-mail-fullscreen .emt-mail-head{padding:13px clamp(22px,3vw,56px);min-height:64px}
 .emt-mail-fullscreen .emt-mail-scroll{
   width:100%!important;max-width:none!important;min-width:0!important;
   margin:0!important;padding:24px clamp(24px,3.2vw,68px) 20px!important;
   display:grid;grid-template-columns:minmax(225px,310px) minmax(0,1fr);
   grid-template-rows:auto auto minmax(0,1fr) auto;
   column-gap:clamp(22px,2.6vw,46px);row-gap:14px;
   align-items:start;align-content:stretch;overflow-y:auto;
 }
 .emt-mail-fullscreen .emt-mail-scroll>h2{grid-column:1/-1;grid-row:1;margin:0 0 5px;font-size:clamp(23px,2vw,32px)}
 .emt-mail-fullscreen .emt-mail-meta{
   grid-column:1;grid-row:2/5;align-self:stretch;min-width:0;
   padding:6px clamp(12px,1.4vw,25px) 0 0;
   border-right:1px solid #d6e0e5;border-bottom:0;overflow-wrap:anywhere;
 }
 .emt-mail-fullscreen .emt-mail-remote{grid-column:2;grid-row:2;margin:0;max-width:100%}
 .emt-mail-fullscreen .emt-mail-html-frame{
   grid-column:2;grid-row:3;width:100%;height:clamp(365px,61dvh,900px);
   min-height:0!important;margin:0;border:1px solid #dce4e7;
   border-radius:12px;overflow:auto;
 }
 .emt-mail-fullscreen .emt-mail-attachments{grid-column:2;grid-row:4;min-height:0}
 .emt-mail-fullscreen .emt-mail-actions{margin:0;padding:5px clamp(24px,3vw,58px) 8px;justify-content:space-around}
 .emt-mail-fullscreen .emt-mail-actions button{max-width:175px}
}
@media(min-width:1100px) and (max-height:750px){
 .emt-mail-fullscreen .emt-mail-scroll{padding-top:15px!important;padding-bottom:12px!important;row-gap:9px}
 .emt-mail-fullscreen .emt-mail-html-frame{height:clamp(270px,53dvh,640px)}
}

/* 12.10.2026 – Desktop mail actions beside message; mobile retains bottom action bar. */
@media (min-width:1100px){
 .emt-mail-fullscreen .emt-mail-scroll{grid-template-rows:auto auto minmax(0,1fr) auto;}
 .emt-mail-fullscreen .emt-mail-meta{grid-column:1;grid-row:2;align-self:start;border-bottom:0;padding-bottom:12px;}
 .emt-mail-fullscreen .emt-mail-actions{
   grid-column:1;grid-row:3/5;align-self:start;position:sticky;top:8px;z-index:1;
   display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
   min-width:0;width:100%;margin:0;padding:10px 18px 10px 0;
   border:0;border-right:1px solid #d6e0e5;background:transparent;
 }
 .emt-mail-fullscreen .emt-mail-actions button{
   display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:7px;
   padding:10px 8px!important;min-height:45px;width:100%;max-width:none;min-width:0;
   background:#f2f6f8;color:#155b7b;border:1px solid #cad8df;border-radius:9px;
   font-size:13px;cursor:pointer;
 }
 .emt-mail-fullscreen .emt-mail-actions button svg{width:19px;height:19px;flex:none}
 .emt-mail-fullscreen .emt-mail-actions button small{font-size:12px;line-height:1.15;text-align:left;overflow-wrap:anywhere}
 html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-actions{background:transparent!important;border-color:#363636!important}
 html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-actions button{background:#242424!important;border:1px solid #3b3b3b!important;color:#ececec!important}
 html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-actions button:hover{background:#303030!important}
}
@media (max-width:1099px){
 .emt-mail-fullscreen .emt-mail-scroll{padding-bottom:95px!important}
 .emt-mail-fullscreen .emt-mail-actions{
   position:fixed;bottom:0;left:0;right:0;z-index:3;
   width:100%;margin:0;padding-bottom:max(10px,env(safe-area-inset-bottom));
   border-top:1px solid #d6e0e5;
 }
}
/* Mail pagination and mailbox selector */
#mailMailbox{min-width:0;max-width:100%}
.mail-pager-control{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0 6px;font-size:13px}
.mail-pager-control select{width:auto!important;min-width:70px;height:38px;border-radius:8px;padding:6px 8px}
.mail-pager-control .mail-range{margin-left:auto;opacity:.7;font-size:12px}
.mail-pages{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;margin:17px 0 10px}
.mail-pages button{min-width:36px;min-height:38px;padding:6px 10px;border:1px solid #b8cbd3;border-radius:8px;background:transparent;color:inherit;cursor:pointer}
.mail-pages button:hover:not(:disabled),.mail-pages button:focus-visible{background:rgba(0,110,155,.12)}
.mail-pages button[aria-current="page"]{background:#006e9b;color:#fff!important;font-weight:700;opacity:1}
.mail-pages .mail-page-ellipsis{opacity:.65;padding:0 3px}
html[data-theme="dark"] .mail-pages button,html[data-theme="dark"] .mail-pager-control select{border-color:#474747;background:#202020;color:#f2f2f2}
html[data-theme="dark"] .mail-pages button[aria-current="page"]{background:#006e9b;color:white}
@media(max-width:520px){.mail-pages{gap:4px}.mail-pages button{min-width:32px;min-height:38px;padding:5px 7px}}


/* 2026-10-12: Compact mail workspace, desktop and mobile.
   Page-size selection is combined with page numbers at the list footer. */
#mailView .mail-compact-top{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:3px 0 7px;min-width:0}
#mailView .mail-account-line{display:flex;align-items:center;gap:7px;flex:1 1 530px;min-width:0}
#mailView .mail-account-line label{font-size:13px;font-weight:600;white-space:nowrap;margin:0}
#mailView .mail-account-line select{flex:1 1 auto;min-width:0;width:100%;max-width:100%;height:39px;min-height:39px;padding:5px 10px;border-radius:8px}
#mailView .mail-account-line button{flex:none;white-space:nowrap}
#mailView .mail-quick-actions{display:flex;align-items:center;flex:0 1 auto;gap:6px;flex-wrap:wrap}
#mailView .mail-compact-top button{height:39px;min-height:39px;padding:6px 11px;margin:0;white-space:nowrap;border-radius:8px;font-size:13px}
#mailView .mail-filter-strip{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,320px);gap:9px;margin:4px 0 8px;align-items:center}
#mailView .mail-filter-strip .mail-find{min-width:0;margin:0}
#mailView .mail-filter-strip .mail-find input{width:100%;min-width:0;height:40px;min-height:40px;padding:7px 11px;margin:0}
#mailView .mail-folder-control{min-width:0}
#mailView .mail-folder-control select{width:100%;min-width:0;height:40px;min-height:40px;margin:0;padding:6px 10px;border-radius:8px}
#mailView .mail-select-head{margin:4px 0 5px;padding:2px 4px}
#mailView .mail-select-all{min-height:32px}
#mailView .mail-footer-pager{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:12px 0 8px;padding:11px 0 0;border-top:1px solid #d6e0e5}
#mailView .mail-footer-pager .mail-pages{display:flex;flex:1 1 380px;justify-content:flex-start;align-items:center;flex-wrap:wrap;margin:0;gap:5px;min-width:0}
#mailView .mail-footer-pager .mail-pages button{min-height:36px;min-width:34px;padding:5px 9px}
#mailView .mail-footer-pager .mail-pager-control{display:flex;flex:0 0 auto;align-items:center;flex-wrap:nowrap;gap:7px;margin:0;white-space:nowrap;font-size:13px}
#mailView .mail-footer-pager .mail-pager-control select{height:36px;min-height:36px;min-width:65px}
#mailView .mail-footer-pager .mail-pager-control .mail-range{margin:0 0 0 4px;font-variant-numeric:tabular-nums}
html[data-theme="dark"] #mailView .mail-footer-pager{border-top-color:#393939}
@media(max-width:950px){
 #mailView .mail-compact-top{align-items:stretch}
 #mailView .mail-account-line{flex:1 1 100%}
 #mailView .mail-quick-actions{flex:1 1 100%}
 #mailView .mail-footer-pager .mail-pages{flex-basis:100%;justify-content:center}
 #mailView .mail-footer-pager .mail-pager-control{margin-left:auto}
}
@media(max-width:590px){
 #mailView .mail-compact-top{gap:6px;margin-top:3px}
 #mailView .mail-account-line{flex-wrap:wrap;gap:5px}
 #mailView .mail-account-line label{flex:0 0 auto}
 #mailView .mail-account-line select{flex:1 1 70%;max-width:calc(100% - 72px)}
 #mailView .mail-account-line button{font-size:12px}
 #mailView .mail-quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
 #mailView .mail-quick-actions button{min-width:0;padding:6px 4px;font-size:12px}
 #mailView .mail-filter-strip{grid-template-columns:minmax(0,1fr);gap:6px}
 #mailView .mail-footer-pager{gap:10px}
 #mailView .mail-footer-pager .mail-pager-control{margin:0 auto;justify-content:center;white-space:normal}
 #mailView .mail-footer-pager .mail-pages{gap:4px}
}


/* Dental-EMT 12.10.2026: compact mail reader with explicit field labels and inline editing */
.emt-mail-fullscreen .emt-mail-scroll{box-sizing:border-box;max-width:none;width:100%;padding:12px 18px;min-height:0}
.emt-mail-fullscreen .emt-mail-sidebar,.emt-mail-fullscreen .emt-mail-message-area{min-width:0}
.emt-mail-fullscreen .emt-mail-meta{gap:9px;padding:0;border:0}
.emt-mail-fullscreen .emt-mail-field{display:flex;flex-direction:column;gap:2px;min-width:0;overflow-wrap:anywhere}
.emt-mail-fullscreen .emt-mail-field-label{font-size:11px;letter-spacing:.025em;font-weight:600;opacity:.66;line-height:1.25}
.emt-mail-fullscreen .emt-mail-field h2{font-size:clamp(20px,1.65vw,27px);line-height:1.25;margin:0 0 1px;overflow-wrap:anywhere}
.emt-mail-fullscreen .emt-mail-field>span:not(.emt-mail-field-label){font-size:12px;line-height:1.4;opacity:.82}
.emt-mail-fullscreen .emt-mail-field strong{line-height:1.35}
.emt-mail-fullscreen .emt-mail-message-area{display:flex;flex-direction:column;min-height:0}
.emt-mail-fullscreen .emt-mail-reader{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}
.emt-mail-fullscreen .emt-mail-reader[hidden],.emt-mail-fullscreen .emt-mail-compose[hidden]{display:none!important}
.emt-mail-fullscreen .emt-mail-remote{padding:4px 8px;gap:5px;margin:0 0 6px;font-size:12px;min-height:34px}
.emt-mail-fullscreen .emt-mail-remote #mailRemoteMode{min-height:29px;padding:4px 7px;font-size:12px}
.emt-mail-fullscreen .emt-mail-html-frame{display:block;width:100%;min-width:0;flex:1 1 auto;margin:0 0 7px;border:1px solid #dce4e7;border-radius:8px;background:#fff}
.emt-mail-fullscreen .emt-mail-attachments{flex:0 0 auto;margin:3px 0;max-height:80px;overflow:auto}
.emt-mail-fullscreen .emt-mail-compose{display:flex;flex:1 1 auto;min-width:0;min-height:0}
.emt-mail-fullscreen .emt-mail-editor-form{display:flex;flex:1 1 auto;flex-direction:column;gap:12px;min-width:0;min-height:0;padding:14px;border:1px solid #d5dfe3;border-radius:10px;background:var(--surface,#fff)}
.emt-mail-fullscreen .emt-mail-compose-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:8px;border-bottom:1px solid #d7e0e5}
.emt-mail-fullscreen .emt-mail-compose-heading h3{margin:0;font-size:20px}
.emt-mail-fullscreen .emt-mail-compose-heading span{font-size:12px;opacity:.8;overflow-wrap:anywhere}
.emt-mail-fullscreen .emt-mail-compose-field{display:flex;flex-direction:column;gap:5px;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
.emt-mail-fullscreen .emt-mail-compose-field input{box-sizing:border-box;width:100%;border:1px solid #aabdc5;background:#fff;color:#202b30;border-radius:7px;padding:10px;font-size:14px}
.emt-mail-fullscreen .emt-mail-compose-message{flex:1 1 auto;min-height:125px}
.emt-mail-fullscreen .emt-mail-compose-message textarea{box-sizing:border-box;width:100%;flex:1 1 auto;min-height:125px;resize:vertical;border:1px solid #aabdc5;background:#fff;color:#202b30;border-radius:8px;padding:12px;font-size:15px;line-height:1.5;font-family:inherit}
.emt-mail-fullscreen .emt-mail-compose-controls{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.emt-mail-fullscreen .emt-mail-compose-controls button{padding:9px 16px;min-height:39px;border-radius:7px;border:1px solid #aabdc5;background:#f0f4f6;color:#182c35;cursor:pointer}
.emt-mail-fullscreen .emt-mail-compose-controls .emt-mail-send{background:#006e9b;color:#fff;border-color:#006e9b}
.emt-mail-fullscreen .emt-mail-compose-controls button:disabled{opacity:.6;cursor:wait}
.emt-mail-fullscreen .emt-mail-compose-controls #mailInlineStatus{font-size:12px;opacity:.8}
.emt-mail-fullscreen .emt-mail-compose-warning{font-size:12px;margin:0;color:#a45c00}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-editor-form{background:#181818!important;border-color:#363636!important}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-compose-heading{border-color:#373737}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-compose-field input,
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-compose-message textarea{background:#222!important;color:#f4f4f4!important;border-color:#484848!important}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-compose-controls button{background:#282828!important;color:#f4f4f4!important;border-color:#454545!important}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-compose-controls .emt-mail-send{background:#006e9b!important;border-color:#006e9b!important}
@media(min-width:1100px){
 .emt-mail-fullscreen .emt-mail-head{min-height:50px;padding:8px clamp(16px,2.5vw,42px)}
 .emt-mail-fullscreen .emt-mail-scroll{display:grid!important;grid-template-columns:minmax(220px,275px) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:clamp(16px,2vw,32px)!important;align-items:stretch!important;overflow:hidden!important;padding:12px clamp(16px,2.5vw,42px) 14px!important;}
 .emt-mail-fullscreen .emt-mail-sidebar{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:12px;min-height:0;overflow-y:auto;padding-right:14px;border-right:1px solid #d5dfe3}
 .emt-mail-fullscreen .emt-mail-meta{display:flex;flex-direction:column;align-self:auto;grid-column:auto;grid-row:auto;flex:none;padding:0;border:0}
 .emt-mail-fullscreen .emt-mail-actions{position:static!important;grid-column:auto;grid-row:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;padding:8px 0 0!important;border:0;border-top:1px solid #d5dfe3;border-right:0;background:transparent;top:auto}
 .emt-mail-fullscreen .emt-mail-actions button{min-height:38px;padding:6px!important;gap:5px;font-size:12px;max-width:none}
 .emt-mail-fullscreen .emt-mail-actions button svg{width:17px;height:17px}
 .emt-mail-fullscreen .emt-mail-actions button small{font-size:11px}
 .emt-mail-fullscreen .emt-mail-message-area{grid-column:2;grid-row:1;height:100%;min-height:0}
 .emt-mail-fullscreen .emt-mail-html-frame{height:auto!important;min-height:0!important}
 .emt-mail-fullscreen .emt-mail-remote{grid-column:auto;grid-row:auto}
 .emt-mail-fullscreen .emt-mail-attachments{grid-column:auto;grid-row:auto}
 html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-sidebar{border-color:#363636}
 html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-actions{border-color:#363636!important}
}
@media(max-width:1099px){
 .emt-mail-fullscreen .emt-mail-scroll{display:block!important;overflow-y:auto!important;padding:12px 12px 90px!important}
 .emt-mail-fullscreen .emt-mail-sidebar{display:contents}
 .emt-mail-fullscreen .emt-mail-meta{margin:0 0 12px;padding:0 0 10px;border-bottom:1px solid #dce4e7}
 .emt-mail-fullscreen .emt-mail-html-frame{height:clamp(330px,60dvh,900px);min-height:300px}
 .emt-mail-fullscreen .emt-mail-compose{min-height:55dvh}
 .emt-mail-fullscreen .emt-mail-compose-message textarea{min-height:260px}
 .emt-mail-fullscreen .emt-mail-actions{display:flex;position:fixed!important;bottom:0;left:0;right:0;z-index:3}
 .emt-mail-fullscreen.is-composing .emt-mail-actions{display:none!important}
 .emt-mail-fullscreen.is-composing .emt-mail-scroll{padding-bottom:16px!important}
}


/* Dental-EMT 2026-10-12 – Leseansicht Desktop: header left, message full width.
   Works with both the original mail-head and the sidebar header from the last patch. */
@media (min-width:1100px) {
  .emt-mail-fullscreen {
    height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  /* The older JS still renders a top-level header. Position it inside the
     left information column without taking a full-width row of height. */
  .emt-mail-fullscreen > .emt-mail-head {
    position:absolute!important;
    inset:9px auto auto 14px!important;
    z-index:4;
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    box-sizing:border-box;
    width:calc(292px - 12px);
    max-width:calc(100% - 30px);
    min-height:40px!important;
    height:44px!important;
    margin:0!important;
    padding:0 10px 8px 0!important;
    border:0!important;
    border-bottom:1px solid #d5dfe3!important;
    background:transparent!important;
    color:inherit!important;
  }
  .emt-mail-fullscreen > .emt-mail-head #mailBack {
    min-height:36px!important;
    padding:5px 9px!important;
    border:1px solid #cad8df!important;
    border-radius:9px;
    background:#f2f6f8;
    gap:6px;
    font-size:13px;
  }
  .emt-mail-fullscreen > .emt-mail-head #mailBack svg {width:18px;height:18px}
  .emt-mail-fullscreen > .emt-mail-head > strong {font-size:14px}
  html[data-theme="dark"] .emt-mail-fullscreen > .emt-mail-head {border-bottom-color:#363636!important}
  html[data-theme="dark"] .emt-mail-fullscreen > .emt-mail-head #mailBack {
    color:#ececec!important;
    background:#242424!important;
    border-color:#3b3b3b!important;
  }
  .emt-mail-fullscreen > .emt-mail-scroll {
    display:grid!important;
    grid-template-columns:292px minmax(0,1fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:12px!important;
    align-items:stretch!important;
    align-content:stretch!important;
    box-sizing:border-box!important;
    flex:1 1 auto!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:6px 14px 10px!important;
    overflow:hidden!important;
  }
  .emt-mail-fullscreen .emt-mail-sidebar {
    grid-column:1!important;
    grid-row:1!important;
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column;
    width:100%;
    min-height:0;
    max-width:none!important;
    overflow-y:auto;
    padding:0 12px 0 0!important;
    margin:0!important;
    border-right:1px solid #d5dfe3;
  }
  .emt-mail-fullscreen:has(> .emt-mail-head) .emt-mail-sidebar {padding-top:56px!important}
  .emt-mail-fullscreen .emt-mail-side-top {display:flex!important}
  .emt-mail-fullscreen .emt-mail-message-area {
    grid-column:2!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
  }
  .emt-mail-fullscreen .emt-mail-reader,
  .emt-mail-fullscreen .emt-mail-compose {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    min-width:0!important;
    flex:1 1 auto!important;
    align-self:stretch!important;
  }
  .emt-mail-fullscreen .emt-mail-reader {display:flex!important;flex-direction:column!important}
  .emt-mail-fullscreen .emt-mail-reader[hidden],
  .emt-mail-fullscreen .emt-mail-compose[hidden]{display:none!important}
  .emt-mail-fullscreen .emt-mail-remote {flex:0 0 auto;min-height:31px!important;margin:0 0 5px!important;padding:4px 7px!important}
  .emt-mail-fullscreen .emt-mail-html-frame {
    display:block!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    flex:1 1 auto!important;
    align-self:stretch!important;
    margin:0!important;
  }
  .emt-mail-fullscreen .emt-mail-editor-form {height:100%!important;min-height:0!important;max-width:none!important}
  .emt-mail-fullscreen .emt-mail-attachments {flex:0 0 auto;max-height:85px}
}
@media (max-width:1099px) {
  /* On phones keep the normal accessible full-width back navigation. The
     side-header variant is shown if an older JS version has no mail-head. */
  .emt-mail-fullscreen:not(:has(> .emt-mail-head)) .emt-mail-side-top {
    display:flex!important;
    position:sticky;
    top:0;
    z-index:2;
    padding:5px 0 9px;
    background:var(--bg,#fff);
  }
  html[data-theme="dark"] .emt-mail-fullscreen:not(:has(> .emt-mail-head)) .emt-mail-side-top {background:#0d0d0d!important}
}


/* Dental-EMT 12.10.2026 – Dark-Reader nur für die E-Mail-Nachricht */
.emt-mail-fullscreen .emt-mail-appearance-row{
 display:flex;align-items:center;justify-content:flex-end;gap:7px;
 flex:none;min-height:28px;margin:0 0 3px;padding:0;
 font-size:11px;color:inherit;
}
.emt-mail-fullscreen .emt-mail-appearance-row label{font-size:11px;opacity:.72;white-space:nowrap}
.emt-mail-fullscreen .emt-mail-appearance-row select{
 box-sizing:border-box;min-width:0;max-width:195px;height:27px;min-height:27px;
 padding:2px 21px 2px 8px;border-radius:7px;border:1px solid #c4d3d9;
 background:#fff;color:#18343e;font-size:11px;cursor:pointer;
}
.emt-mail-fullscreen .emt-mail-html-frame.emt-mail-dark-content{
 background:#202020!important;border-color:#3a3a3a!important;
}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-appearance-row select{
 background:#252525!important;color:#ececec!important;border-color:#484848!important;
}
@media(max-width:520px){
 .emt-mail-fullscreen .emt-mail-appearance-row{margin-bottom:3px}
 .emt-mail-fullscreen .emt-mail-appearance-row select{max-width:174px}
}


/* 2026-10-12: Back aligned left inside the metadata sidebar; the reader display
   mode is immediately below action buttons rather than taking reading width. */
.emt-mail-fullscreen .emt-mail-side-top{
  display:flex;flex:none;align-items:center;justify-content:space-between;
  min-width:0;gap:8px;margin:0 0 10px;padding:0 0 9px;
  border-bottom:1px solid #d5dfe3;
}
.emt-mail-fullscreen .emt-mail-side-top #mailBack{
  display:inline-flex;align-items:center;justify-content:flex-start;gap:6px;
  flex:none;margin:0 auto 0 0;padding:6px 10px;min-height:38px;
  border:1px solid #cad8df;border-radius:9px;
  background:#f2f6f8;color:#155b7b;font:inherit;font-size:13px;font-weight:600;
  cursor:pointer;
}
.emt-mail-fullscreen .emt-mail-side-top #mailBack svg{flex:none;width:18px;height:18px}
.emt-mail-fullscreen .emt-mail-side-top strong{font-size:14px;white-space:nowrap}
.emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row{
  box-sizing:border-box;display:flex;flex:none;align-items:center;
  justify-content:flex-start;gap:8px;width:100%;min-height:36px;
  margin:10px 0 0;padding:10px 0 0;border-top:1px solid #d5dfe3;
}
.emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row label{font-size:12px;white-space:nowrap}
.emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row select{
  flex:1 1 auto;min-width:0;max-width:none;height:32px;min-height:32px;
  font-size:12px;
}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-side-top,
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row{border-color:#363636}
html[data-theme="dark"] .emt-mail-fullscreen .emt-mail-side-top #mailBack{
  background:#242424;color:#ececec;border-color:#3b3b3b;
}
@media(min-width:1100px){
  /* The sidebar is now the sole header owner; no reserved header space. */
  .emt-mail-fullscreen .emt-mail-sidebar{padding-top:0!important}
  .emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row{margin-top:9px}
  .emt-mail-fullscreen.is-composing .emt-mail-appearance-row{display:none!important}
}
@media(max-width:1099px){
  /* The actions stay pinned to the bottom; reader settings remain above the mail. */
  .emt-mail-fullscreen .emt-mail-side-top{box-sizing:border-box;position:relative;z-index:2;
    width:100%;margin:0 0 12px;padding:4px 0 9px}
  .emt-mail-fullscreen .emt-mail-sidebar>.emt-mail-appearance-row{
    border-top:0;justify-content:flex-start;margin:4px 0 10px;padding:0;
  }
  .emt-mail-fullscreen.is-composing .emt-mail-appearance-row{display:none!important}
}

/* 12.10.2026 – Desktop: two-stage sidebar for Exchange folders.
   Only on wide desktops; mobile/tablet retain the familiar folder selector. */
.dental-mail-folder-sidebar{display:none}
@media(min-width:1200px){
 :root{--dental-mail-rail:70px;--dental-mail-folders:238px}
 body[data-active-tab="mail"] #tabs.admin-nav,
 body[data-active-tab="mail"] #tabs.member-nav{
  box-sizing:border-box!important;width:var(--dental-mail-rail)!important;
  padding:14px 7px!important;align-items:center!important;
  transition:width .22s ease, padding .22s ease;
 }
 body[data-active-tab="mail"] #tabs.admin-nav>button:nth-child(n),
 body[data-active-tab="mail"] #tabs.member-nav>button:nth-child(n){
  position:relative!important;box-sizing:border-box!important;
  display:flex!important;justify-content:center!important;align-items:center!important;
  width:54px!important;height:48px!important;min-height:48px!important;max-width:54px!important;
  padding:8px!important;gap:0!important;overflow:visible!important;
 }
 /* Keep the label accessible to screen readers despite collapsing the visual text. */
 body[data-active-tab="mail"] #tabs.admin-nav .nav-label,
 body[data-active-tab="mail"] #tabs.member-nav .nav-label{
  position:absolute!important;width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;overflow:hidden!important;
  white-space:nowrap!important;clip-path:inset(50%)!important;border:0!important;
 }
 body[data-active-tab="mail"] #tabs.admin-nav .nav-badge,
 body[data-active-tab="mail"] #tabs.member-nav .nav-badge{
  top:0!important;right:-3px!important;transform:none!important;
  font-size:10px!important;min-width:20px!important;
 }
 body[data-active-tab="mail"] main{
  margin-left:calc(var(--dental-mail-rail) + var(--dental-mail-folders))!important;
  padding:18px clamp(18px,2.2vw,34px) 32px!important;
  transition:margin-left .22s ease;
 }
 body[data-active-tab="mail"] .dental-mail-folder-sidebar{
  position:fixed;box-sizing:border-box;top:78px;bottom:0;
  left:var(--dental-mail-rail);width:var(--dental-mail-folders);z-index:18;
  display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;
  padding:22px 10px 16px;
  border-right:1px solid #dae2e7;background:#f5f8f9;color:#162f3b;
  box-shadow:3px 0 12px rgba(0,0,0,.025);
  animation:dental-mail-folders-slide-in .22s ease-out both;
  scrollbar-width:thin;
 }
 @keyframes dental-mail-folders-slide-in{
  from{opacity:.6;transform:translateX(-14px)}
  to{opacity:1;transform:translateX(0)}
 }
 body[data-active-tab="mail"] .mail-filter-strip{grid-template-columns:minmax(0,1fr)!important}
 body[data-active-tab="mail"] .mail-filter-strip .mail-folder-control{display:none!important}
}
.dental-mail-folder-title{padding:0 12px 3px;font-size:16px;font-weight:700;line-height:1.2}
.dental-mail-folder-account{margin:0 12px 12px;color:#667983;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dental-mail-folder-group{display:flex;flex-direction:column;gap:3px}
.dental-mail-folder-subhead{padding:18px 12px 6px;font-size:11px;letter-spacing:.07em;text-transform:uppercase;font-weight:700;color:#71818b}
.dental-mail-folder-link{
 display:flex;align-items:center;gap:10px;min-height:43px;width:100%;
 text-align:left;padding:9px 10px;border:0;border-radius:9px;
 background:transparent;color:inherit;font-size:13px;line-height:1.25;cursor:pointer;
}
.dental-mail-folder-link>svg{flex:0 0 19px}
.dental-mail-folder-name{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.dental-mail-folder-link:hover{background:#e5eef2}
.dental-mail-folder-link.is-active{background:#dceaf0;color:#085e80;font-weight:700;box-shadow:inset 3px 0 #1684ae}
.dental-mail-folder-link:focus-visible{outline:2px solid #2388b0;outline-offset:2px}
.dental-mail-folder-count{flex:none;min-width:22px;padding:2px 6px;border-radius:999px;background:#006e9b;color:#fff;font-size:11px;font-weight:700;text-align:center}
html[data-theme="dark"] body[data-active-tab="mail"] .dental-mail-folder-sidebar{background:#171717!important;color:#ededed!important;border-color:#363636!important;box-shadow:none}
html[data-theme="dark"] .dental-mail-folder-account,
html[data-theme="dark"] .dental-mail-folder-subhead{color:#adadad!important}
html[data-theme="dark"] .dental-mail-folder-link{background:transparent!important;color:#e6e6e6!important;border:0!important}
html[data-theme="dark"] .dental-mail-folder-link:hover{background:#292929!important}
html[data-theme="dark"] .dental-mail-folder-link.is-active{background:#303030!important;color:#fff!important;box-shadow:inset 3px 0 #2494b8}
@media(prefers-reduced-motion:reduce){
 body[data-active-tab="mail"] .dental-mail-folder-sidebar{animation:none!important}
 body[data-active-tab="mail"] #tabs,body[data-active-tab="mail"] main{transition:none!important}
}
/* Final priority: the app's generic button/nav rules must not turn each folder into a card. */
@media(min-width:1200px){
 body[data-active-tab="mail"] #mailFolderSidebar.dental-mail-folder-sidebar{margin:0!important;top:78px!important;bottom:0!important}
 html[data-theme="dark"] body[data-active-tab="mail"] #mailFolderSidebar .dental-mail-folder-link{background:transparent!important;border:0!important;color:#e6e6e6!important;box-shadow:none!important}
 html[data-theme="dark"] body[data-active-tab="mail"] #mailFolderSidebar .dental-mail-folder-link:hover{background:#292929!important}
 html[data-theme="dark"] body[data-active-tab="mail"] #mailFolderSidebar .dental-mail-folder-link.is-active{background:#303030!important;box-shadow:inset 3px 0 #2494b8!important;color:#fff!important}
}
