/* MyMails POP3 Archive UI */
:root{
  --bg:#edf2f8;
  --sidebar:#0d2341;
  --sidebar-2:#132f58;
  --blue:#315eff;
  --blue-2:#234be0;
  --panel:#ffffff;
  --panel-soft:#f7f9fc;
  --line:#dce5f2;
  --text:#102039;
  --muted:#738197;
  --danger:#d94b4b;
  --green:#2d9c71;
  --shadow:0 20px 60px rgba(15,35,65,.12);
  --shadow-soft:0 8px 24px rgba(15,35,65,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
input,select,textarea{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--text);outline:none}
input:focus,select:focus,textarea:focus{border-color:#9ab2ff;box-shadow:0 0 0 4px rgba(49,94,255,.10)}
button{cursor:pointer}

.app-shell{display:grid;grid-template-columns:282px 1fr;min-height:100vh}
.sidebar{background:linear-gradient(180deg,var(--sidebar),var(--sidebar-2));color:#fff;padding:18px 16px;display:grid;gap:18px;align-content:start}
.brand{display:flex;align-items:center;gap:12px}
.brand-mark{width:32px;height:32px;border-radius:10px;background:#fff;color:var(--sidebar);display:grid;place-items:center;font-weight:900}
.brand-title{font-size:21px;font-weight:900;letter-spacing:-.04em}
.brand-sub{font-size:12px;color:rgba(255,255,255,.62)}
.compose-button{height:45px;border-radius:12px;background:var(--blue);display:flex;align-items:center;justify-content:center;font-weight:800;box-shadow:0 12px 28px rgba(49,94,255,.32)}
.side-section{display:grid;gap:10px}
.side-heading{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.55);font-weight:800}
.account-list,.nav-list{display:grid;gap:8px}
.account-item,.nav-item,.ghost-link{border-radius:14px;padding:11px 12px;background:rgba(255,255,255,.04);border:1px solid transparent}
.account-item.active,.nav-item.active{background:#224987;border-color:rgba(255,255,255,.10)}
.account-item:hover,.nav-item:hover,.ghost-link:hover{background:rgba(255,255,255,.09)}
.account-item{display:flex;gap:10px;justify-content:space-between;align-items:flex-start}
.account-main{min-width:0}
.account-main strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:155px}
.account-main span{display:block;font-size:12px;color:rgba(255,255,255,.62);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:155px;margin-top:3px}
.account-badges{display:grid;justify-items:end;gap:5px}
.account-badges span,.account-badges em{font-size:11px;font-style:normal;border-radius:999px;padding:3px 7px;background:rgba(255,255,255,.12)}
.account-badges em{background:var(--blue);font-weight:800}
.nav-item{display:flex;align-items:center;justify-content:space-between;gap:10px}
.nav-item span{font-weight:700}
.nav-item em{font-style:normal;color:rgba(255,255,255,.62);font-size:12px}
.ghost-link{display:block;color:rgba(255,255,255,.78);font-size:13px}
.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.10);padding-top:14px;display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center}
.avatar{width:34px;height:34px;border-radius:999px;background:#fff;color:var(--sidebar);display:grid;place-items:center;font-weight:900}
.sidebar-user{min-width:0}
.sidebar-user strong{display:block;font-size:13px}
.sidebar-user span{display:block;font-size:12px;color:rgba(255,255,255,.62);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-icon-btn{width:34px;height:34px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);display:grid;place-items:center}

.main-area{display:grid;grid-template-rows:auto 1fr;min-width:0}
.topbar{height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px;gap:14px}
.topbar-left,.topbar-actions{display:flex;align-items:center;gap:12px}
.searchbar{height:42px;border:1px solid var(--line);border-radius:14px;background:var(--panel-soft);display:flex;align-items:center;gap:10px;padding:0 14px;width:min(520px,50vw)}
.searchbar input{border:0;background:transparent;padding:0;box-shadow:none}
.topbar-btn,.tiny-btn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:0 14px;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--text);font-weight:700}
.topbar-btn.primary,.tiny-btn.primary,button.topbar-btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.tiny-btn.danger{color:#b42323;border-color:#f1c4c4}
.tiny-btn.full{width:100%;margin-bottom:8px}
button.tiny-btn{cursor:pointer}
.content-wrap{padding:18px;min-width:0}
.flash{padding:12px 14px;border-radius:12px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow-soft);margin-bottom:14px}
.flash.error{background:#fff0f0;border-color:#ffcaca;color:#991b1b}
.flash.success{background:#f1fff8;border-color:#bfead4;color:#176743}

.mail-layout{display:grid;grid-template-columns:360px 1fr;gap:18px;min-height:calc(100vh - 100px)}
.mail-list-panel,.reader-panel,.export-card,.settings-card,.account-card,.empty-box,.login-form-card,.register-card,.auth-card{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}
.mail-list-panel{display:grid;grid-template-rows:auto 1fr;overflow:hidden}
.mail-list-head{padding:18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px}
.mail-list-head h1,.reader-article h2,.page-title h1,.login-copy h1,.login-form-card h1,.register-card h1{margin:0;font-size:30px;line-height:1.05;letter-spacing:-.04em;font-weight:900}
.subline,.muted{color:var(--muted)}
.mail-head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.mail-list{overflow:auto;padding:10px;background:#fbfdff}
.mail-row{display:grid;grid-template-columns:44px 1fr;gap:12px;padding:14px;border:1px solid var(--line);border-radius:16px;background:#fff;margin-bottom:10px;transition:.15s}
.mail-row:hover{transform:translateY(-1px);box-shadow:var(--shadow-soft)}
.mail-row.active{border-color:#a8bbf4;background:#f7faff}
.mail-avatar{width:42px;height:42px;border-radius:12px;background:#365fbf;color:#fff;display:grid;place-items:center;font-weight:900}
.mail-avatar.large{width:46px;height:46px}
.mail-row-top{display:flex;justify-content:space-between;gap:10px}
.mail-row-top strong{font-size:14px}
.mail-row-top span{font-size:12px;color:var(--muted)}
.mail-subject{font-weight:800;margin-top:2px}
.mail-preview{font-size:13px;color:var(--muted);line-height:1.45;margin-top:3px}
.mail-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.tag{font-size:11px;font-weight:800;color:#587097;background:#edf3fd;border-radius:999px;padding:4px 8px}
.tag.green{background:#e6f8ef;color:#1b7d51}
.reader-panel{display:grid;grid-template-rows:auto 1fr;overflow:hidden}
.reader-toolbar{padding:14px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;align-items:center}
.reader-actions{display:flex;gap:10px;flex-wrap:wrap}
.reader-actions a{font-weight:700;color:#345174}
.reader-article{padding:30px;max-width:940px}
.reader-author{display:flex;gap:12px;align-items:center;margin-bottom:18px}
.reader-author strong{display:block}
.reader-author span{display:block;color:var(--muted);font-size:13px}
.reader-article h2{font-size:38px;margin-bottom:22px}
.mail-text{white-space:pre-wrap;font-family:inherit;font-size:15px;line-height:1.75;color:#283953;margin:0}
.reader-footer{margin-top:24px;display:flex;gap:10px;flex-wrap:wrap}
.reply-button{display:inline-flex;align-items:center;justify-content:center;height:42px;padding:0 18px;border-radius:12px;background:var(--blue);color:#fff;font-weight:800}
.empty-box{padding:26px;color:var(--muted)}
.empty-box strong{display:block;color:var(--text);font-size:16px;margin-bottom:6px}
.reader-empty{margin:18px}
.detail-layout{grid-template-columns:260px 1fr}
.export-card{padding:18px}
.export-card h3{margin:18px 0 12px}
.meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;margin-bottom:24px}
.meta-grid span{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.meta-grid strong{display:block;margin-top:4px}
.attachment-title{margin:28px 0 12px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.attachment-list{display:grid;gap:10px}
.attachment-card{display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}
.attachment-icon{width:36px;height:36px;border-radius:10px;background:#edf3fd;display:grid;place-items:center}
.attachment-card span{display:block;color:var(--muted);font-size:12px}

.page-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}
.page-title p{margin:6px 0 0;color:var(--muted)}
.account-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.account-card{padding:18px}
.account-card-top{display:flex;justify-content:space-between;gap:12px}
.account-card h3{margin:0}
.account-card p{margin:5px 0 0;color:var(--muted)}
.kbd{display:inline-flex;align-items:center;height:30px;border-radius:999px;background:#edf3fd;color:#315eff;padding:0 10px;font-size:12px;font-weight:900}
.account-details{display:grid;gap:9px;margin:16px 0}
.account-details span{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.account-details strong{display:block}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

.settings-card{padding:26px}
.settings-card h2{font-size:22px;margin:8px 0 16px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:22px}
.form-grid label span,.auth-form label span{display:block;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#6d7c92;margin-bottom:7px}
.form-grid .wide{grid-column:1/-1}
.form-grid textarea{min-height:110px}
.switch-row{display:flex!important;align-items:center;gap:10px;border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:#f7faff}
.switch-row input{width:18px;height:18px}
.switch-row span{margin:0!important;text-transform:none!important;letter-spacing:0!important;color:var(--text)!important;font-size:14px!important}
.hint-box{background:#f5f8ff;border:1px solid var(--line);padding:14px 16px;border-radius:16px;margin-bottom:22px}
.hint-box p{color:var(--muted);margin:8px 0 0}

.compose-screen{min-height:calc(100vh - 100px);display:grid;place-items:center;padding:20px}
.compose-window{width:min(820px,100%);background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);overflow:hidden}
.compose-head{padding:14px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;background:#f7faff}
.compose-row{display:grid;grid-template-columns:90px 1fr;gap:12px;border-bottom:1px solid var(--line);padding:12px 18px;align-items:center}
.compose-row label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:var(--muted)}
.compose-row input,.compose-row select{border:0;padding:0;box-shadow:none}
.compose-body{padding:18px;border-bottom:1px solid var(--line)}
.compose-body textarea{border:0;min-height:270px;padding:0;resize:vertical;box-shadow:none}
.compose-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:14px 18px}
.compose-foot button,.auth-form button{border:0;background:var(--blue);color:#fff;border-radius:12px;min-height:42px;padding:0 18px;font-weight:800}

.auth-shell{min-height:100vh;display:grid;place-items:center;padding:32px;background:linear-gradient(135deg,#edf2f8,#dfe8f5)}
.auth-card{width:min(1060px,100%);overflow:hidden}
.login-layout{display:grid;grid-template-columns:1.1fr .9fr;min-height:580px}
.login-copy{padding:48px;background:linear-gradient(180deg,var(--sidebar),var(--sidebar-2));color:#fff;display:grid;align-content:center;gap:18px}
.auth-brand .brand-title{color:#fff}
.login-copy h1{font-size:54px;max-width:470px;color:#fff}
.login-copy p{font-size:16px;color:rgba(255,255,255,.75);max-width:430px}
.login-form-card{box-shadow:none;border:0;border-radius:0;padding:48px;display:grid;align-content:center}
.auth-form{display:grid;gap:14px}
.auth-form p{color:var(--muted)}
.auth-form a{color:var(--blue);font-weight:700}
.register-card{width:min(460px,100%);padding:32px}

.mobile-menu-btn{display:none;width:42px;height:42px;border:1px solid var(--line);border-radius:12px;background:#fff;align-items:center;justify-content:center;gap:4px;flex-direction:column}
.mobile-menu-btn span{width:18px;height:2px;background:var(--text);border-radius:99px}
.mobile-overlay{display:none;position:fixed;inset:0;background:rgba(8,22,42,.35);z-index:30}

@media(max-width:1040px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:fixed;left:0;top:0;bottom:0;width:min(88vw,320px);z-index:40;transform:translateX(-102%);transition:transform .2s ease}
  body.nav-open .sidebar{transform:translateX(0)}
  .mobile-overlay{display:block;opacity:0;pointer-events:none;transition:.2s}
  body.nav-open .mobile-overlay{opacity:1;pointer-events:auto}
  .mobile-menu-btn{display:flex}
  .mail-layout,.detail-layout,.login-layout{grid-template-columns:1fr}
  .login-copy{display:none}
}
@media(max-width:720px){
  .topbar{padding:0 12px}
  .topbar-actions{display:none}
  .searchbar{width:100%;min-width:0}
  .content-wrap{padding:12px}
  .mail-list-head,.reader-toolbar,.reader-article,.settings-card,.login-form-card,.register-card{padding:18px}
  .form-grid,.meta-grid{grid-template-columns:1fr}
  .compose-row{grid-template-columns:1fr}
  .reader-article h2{font-size:28px}
  .mail-list-head h1,.page-title h1{font-size:26px}
}


/* === vNext UI polish: collapsible sidebar, flatter nav, nicer mail/reader, dashboard === */
:root{
  --sidebar-expanded:282px;
  --sidebar-collapsed:78px;
  --surface:#ffffff;
  --surface-soft:#f8fbff;
  --surface-blue:#f4f7ff;
  --soft-border:#e5ecf6;
  --text-strong:#0b1830;
  --shadow-card:0 18px 45px rgba(15,35,65,.10);
  --shadow-lite:0 8px 22px rgba(15,35,65,.06);
}

.app-shell{
  grid-template-columns:var(--sidebar-expanded) minmax(0,1fr);
  transition:grid-template-columns .18s ease;
}
body.sidebar-collapsed .app-shell{grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr)}
.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  overflow:visible;
  gap:16px;
  transition:width .18s ease,padding .18s ease;
}
.sidebar-brand-row{
  justify-content:space-between;
  gap:8px;
}
.brand-core{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.brand-text{min-width:0}
.sidebar-controls{
  display:flex;
  gap:6px;
  flex:0 0 auto;
}
.sidebar-tool-btn,
.desktop-sidebar-toggle{
  width:34px;
  height:34px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  background:rgba(255,255,255,.08);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:900;
}
.sidebar-tool-btn.active{background:rgba(49,94,255,.55)}
.desktop-sidebar-toggle{
  color:var(--text);
  background:#fff;
  border-color:var(--line);
}
.compose-icon{font-size:17px;line-height:1}
.compose-button{
  gap:8px;
  box-shadow:none;
  min-height:42px;
  height:42px;
  border-radius:11px;
}
.side-section{gap:8px}
.side-heading{margin-left:8px}
.account-list,.nav-list{gap:4px}
.account-item,.nav-item,.ghost-link{
  min-height:36px;
  padding:8px 10px;
  border-radius:10px;
  background:transparent;
  border-color:transparent;
}
.account-item.active,.nav-item.active{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.08);
  box-shadow:none;
}
.account-item:hover,.nav-item:hover,.ghost-link:hover{background:rgba(255,255,255,.075)}
.nav-item span,.account-main strong{font-weight:650}
.account-main span{margin-top:2px}
.sidebar-footer{gap:8px}

.tooltipable{position:relative}
body.sidebar-collapsed .tooltipable:hover::after{
  content:attr(data-tip);
  position:absolute;
  left:calc(100% + 12px);
  top:50%;
  transform:translateY(-50%);
  z-index:9999;
  background:#0a1830;
  color:#fff;
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
  white-space:nowrap;
  box-shadow:0 12px 28px rgba(0,0,0,.20);
  pointer-events:none;
}
body.sidebar-collapsed .tooltipable:hover::before{
  content:"";
  position:absolute;
  left:calc(100% + 6px);
  top:50%;
  transform:translateY(-50%);
  border:6px solid transparent;
  border-right-color:#0a1830;
  z-index:9999;
}

body.sidebar-collapsed:not(.sidebar-peek) .sidebar{
  padding-left:12px;
  padding-right:12px;
}
body.sidebar-collapsed:not(.sidebar-peek) .brand-text,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-tool-btn#sidebarPinBtn,
body.sidebar-collapsed:not(.sidebar-peek) .compose-text,
body.sidebar-collapsed:not(.sidebar-peek) .side-heading,
body.sidebar-collapsed:not(.sidebar-peek) .account-main,
body.sidebar-collapsed:not(.sidebar-peek) .account-badges span,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item span,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item em,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link span,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-user{
  display:none;
}
body.sidebar-collapsed:not(.sidebar-peek) .brand,
body.sidebar-collapsed:not(.sidebar-peek) .brand-core,
body.sidebar-collapsed:not(.sidebar-peek) .compose-button,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item,
body.sidebar-collapsed:not(.sidebar-peek) .account-item,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-footer{
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-controls{width:100%;justify-content:center}
body.sidebar-collapsed:not(.sidebar-peek) .account-item::before{
  content:"@";
  width:32px;
  height:32px;
  border-radius:10px;
  background:rgba(255,255,255,.10);
  display:grid;
  place-items:center;
  font-weight:900;
}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item::before{
  content:"•";
  width:32px;
  height:32px;
  border-radius:10px;
  background:rgba(255,255,255,.08);
  display:grid;
  place-items:center;
  font-size:20px;
  line-height:1;
}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="INBOX"]::before{content:"✉"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Archive"]::before{content:"▣"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Spam"]::before{content:"!"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Trash"]::before{content:"⌫"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="accounts"]::before{content:"⚙"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="mbox"]::before{content:"M"}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="zip"]::before{content:"Z"}
body.sidebar-collapsed.sidebar-peek .app-shell{grid-template-columns:var(--sidebar-expanded) minmax(0,1fr)}

.content-wrap{
  padding:20px;
}
.topbar{
  position:sticky;
  top:0;
  z-index:15;
  box-shadow:0 1px 0 rgba(11,24,48,.03);
}
.searchbar{
  background:#fff;
  box-shadow:0 6px 18px rgba(15,35,65,.04);
}
.topbar-btn,.tiny-btn{
  border-radius:10px;
  min-height:36px;
  box-shadow:0 4px 12px rgba(15,35,65,.04);
}

/* Mail and reader polish */
.mail-layout{
  grid-template-columns:minmax(330px,390px) minmax(0,1fr);
  gap:20px;
}
.mail-list-panel,.reader-panel,.export-card,.settings-card,.account-card,.empty-box,.login-form-card,.register-card,.auth-card{
  border-color:var(--soft-border);
  box-shadow:var(--shadow-card);
}
.mail-list-panel,.reader-panel{
  border-radius:24px;
  overflow:hidden;
}
.mail-list-head{
  background:linear-gradient(180deg,#fff,#f8fbff);
  padding:20px 20px 16px;
}
.mail-list-head h1{
  font-size:32px;
}
.mail-head-actions .tiny-btn{
  min-height:32px;
  padding:0 10px;
  font-size:12px;
}
.mail-list{
  padding:12px;
  background:linear-gradient(180deg,#fbfdff,#f6f9fd);
}
.mail-row{
  border-radius:18px;
  padding:14px;
  border-color:#e7eef8;
  box-shadow:0 5px 16px rgba(15,35,65,.045);
  position:relative;
}
.mail-row::after{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  border-radius:18px 0 0 18px;
  background:transparent;
}
.mail-row.active::after{background:var(--blue)}
.mail-row.active{
  background:linear-gradient(180deg,#f8fbff,#f3f7ff);
  border-color:#afc2ff;
}
.mail-avatar{
  background:linear-gradient(135deg,#315eff,#7d94ff);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
}
.mail-row-top strong{
  color:var(--text-strong);
  letter-spacing:-.01em;
}
.mail-subject{
  font-size:14px;
  line-height:1.35;
}
.mail-preview{
  color:#687a92;
}
.tag{
  letter-spacing:.04em;
}
.reader-toolbar{
  background:linear-gradient(180deg,#fff,#f8fbff);
  min-height:64px;
}
.reader-actions a{
  min-height:34px;
  display:inline-flex;
  align-items:center;
  padding:0 12px;
  border-radius:10px;
  border:1px solid var(--line);
  color:#344d72;
  background:#fff;
}
.reader-article{
  padding:36px 44px;
}
.reader-author{
  padding:12px;
  border:1px solid #e8eef8;
  border-radius:18px;
  background:#fbfdff;
  width:max-content;
  max-width:100%;
}
.reader-author .mail-avatar{
  width:48px;
  height:48px;
}
.reader-article h2{
  font-size:42px;
  line-height:1.08;
  letter-spacing:-.045em;
  color:var(--text-strong);
  margin:24px 0 22px;
  max-width:860px;
}
.mail-text{
  background:#fff;
  border:1px solid #e8eef8;
  border-radius:18px;
  padding:24px;
  font-size:15px;
  line-height:1.82;
  color:#25374f;
  box-shadow:0 6px 18px rgba(15,35,65,.035);
}
.reader-footer{
  border-top:1px solid #e9eff8;
  padding-top:20px;
}
.reply-button{
  box-shadow:0 10px 22px rgba(49,94,255,.22);
}

/* Dashboard */
.dashboard-page{display:grid;gap:20px}
.dashboard-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  padding:28px;
  border-radius:26px;
  background:linear-gradient(135deg,#0d2341,#214d8f);
  color:#fff;
  box-shadow:var(--shadow-card);
}
.dashboard-hero .eyebrow{
  display:inline-flex;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.13);
  color:#dfe9ff;
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.dashboard-hero h1{
  margin:12px 0 8px;
  font-size:42px;
  letter-spacing:-.05em;
  line-height:1.05;
}
.dashboard-hero p{
  margin:0;
  color:rgba(255,255,255,.76);
  max-width:640px;
  font-size:15px;
}
.dashboard-hero-actions{display:flex;gap:10px;flex-wrap:wrap}
.dashboard-hero-actions .topbar-btn{background:rgba(255,255,255,.95)}
.dashboard-hero-actions .topbar-btn.primary{background:#fff;color:#173a74;border-color:#fff}
.dashboard-metrics{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
}
.metric-card{
  background:#fff;
  border:1px solid var(--soft-border);
  border-radius:22px;
  padding:18px;
  box-shadow:var(--shadow-lite);
  display:grid;
  gap:7px;
}
.metric-card.primary{
  background:linear-gradient(180deg,#fff,#f6f9ff);
  border-color:#bed0ff;
}
.metric-card span{
  font-size:11px;
  font-weight:900;
  color:#6f7e93;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.metric-card strong{
  font-size:30px;
  letter-spacing:-.04em;
  color:var(--text-strong);
}
.metric-card strong.date-value{
  font-size:17px;
  line-height:1.25;
}
.metric-card em{
  font-style:normal;
  color:var(--muted);
  font-size:12px;
}
.dashboard-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:20px;
}
.dashboard-grid.lower{
  grid-template-columns:1fr .8fr;
}
.dashboard-panel{
  background:#fff;
  border:1px solid var(--soft-border);
  border-radius:24px;
  box-shadow:var(--shadow-card);
  padding:20px;
}
.panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.panel-head h2{
  margin:0;
  font-size:22px;
  line-height:1.1;
  letter-spacing:-.035em;
}
.panel-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
}
.account-stat-list,.compact-mail-list,.folder-stat-list{display:grid;gap:10px}
.account-stat-row{
  border:1px solid #e8eef8;
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:10px;
  background:#fbfdff;
}
.account-stat-main{
  display:flex;
  gap:12px;
  align-items:center;
}
.account-stat-avatar{
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(135deg,#315eff,#7d94ff);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:900;
}
.account-stat-main strong{display:block}
.account-stat-main span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}
.account-stat-numbers{
  display:flex;
  align-items:baseline;
  gap:8px;
}
.account-stat-numbers b{
  font-size:22px;
}
.account-stat-numbers span{
  color:var(--muted);
  font-size:12px;
}
.mini-progress,.folder-bar{
  height:8px;
  border-radius:999px;
  background:#ecf2fb;
  overflow:hidden;
}
.mini-progress i,.folder-bar i{
  display:block;
  height:100%;
  background:linear-gradient(90deg,#315eff,#7b95ff);
  border-radius:999px;
}
.status-pill{
  justify-self:start;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  padding:5px 9px;
  background:#edf3fd;
  color:#45648e;
}
.status-pill.green{
  color:#15754c;
  background:#e8f9f1;
}
.compact-mail-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid #e8eef8;
  border-radius:16px;
  background:#fbfdff;
}
.compact-mail-row:hover{background:#f4f8ff}
.compact-mail-row strong{
  display:block;
  font-size:14px;
}
.compact-mail-row span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}
.compact-mail-row em{
  font-style:normal;
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.mail-dot{
  width:9px;
  height:9px;
  border-radius:999px;
  background:#cbd5e5;
}
.mail-dot.active,.compact-mail-row.unread .mail-dot{background:var(--blue)}
.folder-stat-row{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid #e8eef8;
  border-radius:16px;
  background:#fbfdff;
}
.folder-stat-row strong{display:block}
.folder-stat-row span{display:block;color:var(--muted);font-size:12px;margin-top:2px}

@media(max-width:1280px){
  .dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-grid,.dashboard-grid.lower{grid-template-columns:1fr}
}
@media(max-width:1040px){
  .sidebar{position:fixed;height:auto}
  body.sidebar-collapsed .app-shell{grid-template-columns:1fr}
  body.sidebar-collapsed .tooltipable:hover::before,
  body.sidebar-collapsed .tooltipable:hover::after{display:none}
  .desktop-sidebar-toggle{display:none}
}
@media(max-width:820px){
  .mail-layout{grid-template-columns:1fr}
  .reader-article{padding:24px 18px}
  .reader-article h2{font-size:30px}
  .dashboard-hero{display:grid;padding:22px}
  .dashboard-hero h1{font-size:32px}
  .dashboard-metrics{grid-template-columns:1fr}
  .panel-head{display:grid}
  .folder-stat-row{grid-template-columns:1fr}
}
@media(max-width:720px){
  .content-wrap{padding:12px}
  .mail-text{padding:18px}
  .sidebar-controls{display:none}
}


/* === Sidebar refinement v2 === */
:root{
  --sidebar-expanded:264px;
  --sidebar-collapsed:84px;
}

.app-shell{grid-template-columns:var(--sidebar-expanded) minmax(0,1fr)}
body.sidebar-collapsed .app-shell{grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr)}

.sidebar{
  padding:14px 12px;
  gap:14px;
  border-right:1px solid rgba(255,255,255,.06);
}
.sidebar-brand-row{align-items:center}
.brand-core{min-width:0}
.brand-mark{
  width:34px;
  height:34px;
  border-radius:11px;
  font-size:16px;
  flex:0 0 34px;
}
.brand-title{font-size:20px}
.brand-sub{font-size:11px}
.sidebar-tool-btn{width:32px;height:32px;border-radius:9px}
.compose-button{
  min-height:42px;
  height:42px;
  padding:0 14px;
}
.compose-icon{font-size:16px}

.side-heading{
  margin:0 8px;
  font-size:10px;
}
.account-item,
.nav-item,
.ghost-link{
  min-height:34px;
  padding:7px 9px;
  border-radius:10px;
  position:relative;
}
.account-item{
  display:grid;
  grid-template-columns:30px 1fr auto;
  align-items:center;
  gap:10px;
}
.account-create-item{
  grid-template-columns:30px 1fr;
}
.nav-item{
  display:grid;
  grid-template-columns:30px 1fr auto;
  align-items:center;
  gap:10px;
}
.ghost-link{
  display:grid;
  grid-template-columns:30px 1fr;
  align-items:center;
  gap:10px;
}
.nav-icon{
  width:30px;
  height:30px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:13px;
  font-weight:800;
  flex:0 0 30px;
}
.nav-account-icon{
  background:rgba(255,255,255,.12);
  font-size:12px;
}
.nav-label,
.ghost-link-text{min-width:0}
.nav-item em{
  justify-self:end;
}
.account-main strong,
.account-main span,
.nav-label,
.ghost-link-text{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.account-main strong{max-width:100%}
.account-main span{max-width:100%}
.account-badges{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
}
.account-badges span,
.account-badges em{
  min-width:26px;
  text-align:center;
}

.sidebar-footer{
  padding-top:12px;
  grid-template-columns:34px 1fr auto;
}
.mini-icon-btn{
  width:32px;
  height:32px;
  border-radius:10px;
}
.desktop-sidebar-toggle{display:grid;place-items:center}

body.sidebar-collapsed:not(.sidebar-peek) .sidebar{
  padding-left:10px;
  padding-right:10px;
}
body.sidebar-collapsed:not(.sidebar-peek) .brand-text,
body.sidebar-collapsed:not(.sidebar-peek) .compose-text,
body.sidebar-collapsed:not(.sidebar-peek) .side-heading,
body.sidebar-collapsed:not(.sidebar-peek) .account-main,
body.sidebar-collapsed:not(.sidebar-peek) .account-badges,
body.sidebar-collapsed:not(.sidebar-peek) .nav-label,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item em,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link-text,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-user,
body.sidebar-collapsed:not(.sidebar-peek) .export-section{
  display:none !important;
}
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-controls{
  width:auto;
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-tool-btn#sidebarPinBtn{
  display:none;
}
body.sidebar-collapsed:not(.sidebar-peek) .brand,
body.sidebar-collapsed:not(.sidebar-peek) .compose-button,
body.sidebar-collapsed:not(.sidebar-peek) .account-item,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-footer{
  display:flex;
  align-items:center;
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .brand{
  gap:0;
}
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-brand-row{
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .compose-button{
  width:100%;
  padding:0;
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .compose-icon{
  width:32px;
  height:32px;
  border-radius:10px;
  display:grid;
  place-items:center;
  margin:0;
}
body.sidebar-collapsed:not(.sidebar-peek) .account-item .nav-icon,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item .nav-icon,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link .nav-icon{
  width:34px;
  height:34px;
  border-radius:10px;
}
body.sidebar-collapsed:not(.sidebar-peek) .account-section .ghost-link{
  display:none;
}
body.sidebar-collapsed:not(.sidebar-peek) .account-section{
  gap:6px;
}
body.sidebar-collapsed:not(.sidebar-peek) .account-list,
body.sidebar-collapsed:not(.sidebar-peek) .nav-list{
  gap:8px;
}
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-footer{
  gap:8px;
}
body.sidebar-collapsed:not(.sidebar-peek) .mini-icon-btn{
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.1);
  color:#fff;
}
body.sidebar-collapsed:not(.sidebar-peek) .avatar{
  background:#fff;
  color:var(--sidebar);
}

body.sidebar-collapsed .tooltipable:hover::after{
  left:calc(100% + 10px);
  padding:7px 10px;
}
body.sidebar-collapsed .tooltipable:hover::before{
  left:calc(100% + 4px);
}

@media(max-width:1040px){
  body.sidebar-collapsed .app-shell{grid-template-columns:1fr}
}


/* === Sidebar collapsed alignment fix v3 === */
body.sidebar-collapsed:not(.sidebar-peek) .sidebar{
  align-content:start;
  justify-items:center;
}

body.sidebar-collapsed:not(.sidebar-peek) .sidebar-brand-row,
body.sidebar-collapsed:not(.sidebar-peek) .account-section,
body.sidebar-collapsed:not(.sidebar-peek) .folder-section,
body.sidebar-collapsed:not(.sidebar-peek) .sidebar-footer{
  width:100%;
}

body.sidebar-collapsed:not(.sidebar-peek) .brand-core{
  width:100%;
  justify-content:center;
}

body.sidebar-collapsed:not(.sidebar-peek) .sidebar-controls{
  width:100%;
  display:flex;
  justify-content:center;
}

body.sidebar-collapsed:not(.sidebar-peek) .compose-button{
  width:44px;
  min-width:44px;
  max-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  margin:0 auto;
  border-radius:12px;
}

body.sidebar-collapsed:not(.sidebar-peek) .compose-icon{
  width:44px;
  height:44px;
  font-size:18px;
}

body.sidebar-collapsed:not(.sidebar-peek) .account-item,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link{
  width:44px;
  min-width:44px;
  max-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  margin:0 auto;
  border-radius:12px;
  justify-content:center;
  align-items:center;
}

body.sidebar-collapsed:not(.sidebar-peek) .account-item .nav-icon,
body.sidebar-collapsed:not(.sidebar-peek) .nav-item .nav-icon,
body.sidebar-collapsed:not(.sidebar-peek) .ghost-link .nav-icon{
  width:44px;
  height:44px;
  margin:0;
  border-radius:12px;
  background:transparent;
  font-size:16px;
}

body.sidebar-collapsed:not(.sidebar-peek) .nav-item.active .nav-icon,
body.sidebar-collapsed:not(.sidebar-peek) .account-item.active .nav-icon{
  background:rgba(255,255,255,.10);
}

body.sidebar-collapsed:not(.sidebar-peek) .folder-section .nav-list,
body.sidebar-collapsed:not(.sidebar-peek) .account-section .account-list{
  width:100%;
  display:grid;
  justify-items:center;
  gap:10px;
}

body.sidebar-collapsed:not(.sidebar-peek) .sidebar-footer{
  display:grid;
  grid-template-columns:1fr;
  justify-items:center;
  align-content:end;
  gap:10px;
  padding-top:10px;
}

body.sidebar-collapsed:not(.sidebar-peek) .avatar{
  width:38px;
  height:38px;
  margin:0 auto;
}

body.sidebar-collapsed:not(.sidebar-peek) .mini-icon-btn{
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  margin:0 auto;
}

body.sidebar-collapsed:not(.sidebar-peek) .account-section .ghost-link{
  display:none;
}

body.sidebar-collapsed:not(.sidebar-peek) .export-section{
  display:none !important;
}

@media (max-width:1040px){
  body.sidebar-collapsed:not(.sidebar-peek) .compose-button,
  body.sidebar-collapsed:not(.sidebar-peek) .account-item,
  body.sidebar-collapsed:not(.sidebar-peek) .nav-item,
  body.sidebar-collapsed:not(.sidebar-peek) .ghost-link{
    width:42px;
    min-width:42px;
    max-width:42px;
    height:42px;
    min-height:42px;
  }
}


/* === Mail frames, independent scrolling, fixed reader frame header, HTML reader === */
.mail-layout-framed,
.detail-layout-framed{
  height:calc(100vh - 104px);
  min-height:520px;
  overflow:hidden;
}
.mail-layout-framed{
  grid-template-columns:minmax(330px,390px) minmax(0,1fr);
}
.detail-layout-framed{
  grid-template-columns:260px minmax(0,1fr);
}
.mail-frame{
  min-height:0;
  overflow:hidden;
  display:grid;
  border-radius:24px;
  border:1px solid var(--soft-border, var(--line));
  background:#fff;
  box-shadow:var(--shadow-card, var(--shadow));
}
.mail-list-panel.mail-frame{
  grid-template-rows:auto minmax(0,1fr);
}
.reader-panel.mail-frame{
  grid-template-rows:auto minmax(0,1fr);
}
.export-frame{
  display:block;
  align-self:start;
}
.mail-frame-header,
.reader-fixed-header{
  z-index:3;
  background:linear-gradient(180deg,#fff,#f8fbff);
  border-bottom:1px solid #e6edf7;
}
.mail-frame-scroll{
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#b8c7dd transparent;
}
.mail-frame-scroll::-webkit-scrollbar{width:10px;height:10px}
.mail-frame-scroll::-webkit-scrollbar-thumb{background:#b8c7dd;border-radius:999px;border:3px solid transparent;background-clip:padding-box}
.mail-frame-scroll::-webkit-scrollbar-track{background:transparent}
.inbox-scroll{padding:12px}
.reader-scroll{background:linear-gradient(180deg,#fbfdff,#fff)}
.reader-fixed-header{
  padding:14px 18px;
  display:grid;
  gap:12px;
}
.reader-subject-line{
  display:grid;
  grid-template-columns:minmax(220px,310px) minmax(0,1fr);
  gap:18px;
  align-items:center;
}
.reader-author-flat{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.mail-avatar.compact{
  width:38px;
  height:38px;
  border-radius:12px;
  flex:0 0 38px;
}
.reader-address-block{min-width:0}
.reader-address-block strong,
.reader-address-block span{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.reader-address-block strong{
  font-size:14px;
  color:var(--text-strong, var(--text));
}
.reader-address-block span{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}
.reader-title-flat{min-width:0}
.reader-title-flat h2{
  margin:0;
  font-size:19px;
  line-height:1.2;
  letter-spacing:-.025em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text-strong, var(--text));
}
.reader-title-flat span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.reader-actions-flat{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.reader-actions-flat a{
  min-height:32px;
  padding:0 11px;
  border-radius:10px;
  border:1px solid #e2eaf6;
  background:#fff;
  color:#344d72;
  box-shadow:0 4px 12px rgba(15,35,65,.04);
}
.reader-article-framed{
  padding:24px;
  max-width:1060px;
}
.reader-article-framed .mail-text{
  margin:0;
  border-radius:18px;
  background:#fff;
}
.meta-grid-flat{
  background:#f8fbff;
  border:1px solid #e8eef8;
  border-radius:18px;
  padding:14px;
  margin:0 0 18px;
}
.export-card-flat{
  border:0;
  box-shadow:none;
  background:transparent;
}

/* Safe HTML mail display */
.mail-html-content{
  background:#fff;
  border:1px solid #e8eef8;
  border-radius:18px;
  padding:24px;
  color:#25374f;
  font-size:15px;
  line-height:1.65;
  box-shadow:0 6px 18px rgba(15,35,65,.035);
  overflow:auto;
}
.mail-html-content *{
  max-width:100%;
}
.mail-html-content img{
  max-width:100%;
  height:auto;
  border-radius:10px;
}
.mail-html-content table{
  max-width:100%;
  border-collapse:collapse;
  margin:12px 0;
}
.mail-html-content td,
.mail-html-content th{
  border:1px solid #e8eef8;
  padding:8px;
  vertical-align:top;
}
.mail-html-content a{
  color:#315eff;
  text-decoration:underline;
}
.mail-html-content blockquote{
  margin:14px 0;
  padding:10px 14px;
  border-left:3px solid #b8c7dd;
  background:#f8fbff;
  color:#53657d;
}
.mail-html-content p:first-child{margin-top:0}
.mail-html-content p:last-child{margin-bottom:0}

/* Global client context menu */
.global-context-menu{
  position:fixed;
  min-width:260px;
  max-width:min(320px,calc(100vw - 20px));
  z-index:10000;
  padding:8px;
  border:1px solid rgba(13,35,65,.12);
  border-radius:16px;
  background:rgba(255,255,255,.96);
  box-shadow:0 24px 70px rgba(9,23,43,.24);
  backdrop-filter:blur(14px);
}
.global-context-menu[hidden]{display:none}
.ctx-item{
  width:100%;
  min-height:36px;
  border:0;
  background:transparent;
  color:#102039;
  display:grid;
  grid-template-columns:28px 1fr;
  gap:9px;
  align-items:center;
  padding:7px 9px;
  border-radius:11px;
  text-align:left;
  font-weight:650;
  font-size:13px;
}
.ctx-item:hover,
.ctx-item:focus{
  outline:none;
  background:#f0f5ff;
  color:#173a74;
}
.ctx-icon{
  width:28px;
  height:28px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:#edf3fd;
  color:#315eff;
  font-size:12px;
  font-weight:900;
}
.ctx-separator{
  height:1px;
  margin:6px 5px;
  background:#e6edf7;
}

@media(max-width:1040px){
  .mail-layout-framed,
  .detail-layout-framed{
    height:auto;
    min-height:0;
    overflow:visible;
  }
  .mail-layout-framed,
  .detail-layout-framed{
    grid-template-columns:1fr;
  }
  .mail-frame{
    min-height:auto;
  }
  .mail-frame-scroll{
    max-height:none;
    overflow:visible;
  }
  .reader-subject-line{
    grid-template-columns:1fr;
    gap:10px;
  }
  .reader-fixed-header{
    position:sticky;
    top:64px;
  }
}
@media(max-width:720px){
  .reader-article-framed,
  .mail-html-content{
    padding:18px;
  }
  .reader-title-flat h2{
    white-space:normal;
    font-size:17px;
  }
  .reader-actions-flat a{
    flex:1 1 auto;
  }
  .global-context-menu{
    min-width:230px;
  }
}


/* === Reference-style redesign: dual sidebar tables, folder drawer, deletable mails === */
:root{
  --rail-w:76px;
  --rail-expanded-w:260px;
  --folder-drawer-w:260px;
  --dark-0:#0a0d13;
  --dark-1:#111827;
  --dark-2:#1a2332;
  --dark-line:rgba(255,255,255,.08);
  --glass:rgba(255,255,255,.07);
  --glass-active:rgba(255,255,255,.14);
  --client-bg:#f4f7fb;
  --client-card:#ffffff;
}

body{background:var(--client-bg)}
.app-shell-two-pane{grid-template-columns:auto minmax(0,1fr)}
.sidebar-two-tables{
  width:var(--rail-expanded-w);
  min-height:100vh;
  height:100vh;
  padding:0;
  display:grid;
  grid-template-columns:var(--rail-expanded-w) 0;
  gap:0;
  overflow:visible;
  background:transparent;
  border-right:1px solid #dde6f2;
  position:sticky;
  top:0;
  z-index:30;
  transition:width .2s ease,grid-template-columns .2s ease;
}
body.mail-account-selected .sidebar-two-tables{
  width:calc(var(--rail-w) + var(--folder-drawer-w));
  grid-template-columns:var(--rail-w) var(--folder-drawer-w);
}
.sidebar-table-one{
  min-width:0;
  height:100vh;
  overflow:hidden;
  padding:14px 10px;
  display:flex;
  flex-direction:column;
  gap:14px;
  color:#f8fbff;
  background:linear-gradient(180deg,#080b11,#111827 54%,#152033);
  border-right:1px solid var(--dark-line);
}
.sidebar-table-two{
  width:0;
  min-width:0;
  height:100vh;
  overflow:hidden;
  background:#ffffff;
  border-right:1px solid #dde6f2;
  color:#14213a;
  display:flex;
  flex-direction:column;
  transition:width .2s ease,opacity .2s ease;
  opacity:0;
}
body.mail-account-selected .sidebar-table-two.open{
  width:var(--folder-drawer-w);
  opacity:1;
}
.rail-brand{
  display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;min-height:40px;
}
.rail-brand-mark{
  width:40px;height:40px;border-radius:13px;background:#fff;color:#0e1727;display:grid;place-items:center;font-weight:900;font-size:18px;flex:0 0 40px;
}
.rail-brand-text{font-size:18px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.mail-account-selected .rail-brand{justify-content:center}
body.mail-account-selected .rail-brand-text{display:none}
.rail-compose{
  min-height:42px;border-radius:14px;background:#315eff;color:#fff;display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:18px;font-weight:900;box-shadow:0 14px 28px rgba(49,94,255,.32);
}
body.mail-account-selected .rail-compose{width:44px;height:44px;min-height:44px;margin:0 auto;border-radius:14px}
.rail-nav{display:grid;gap:8px}
.rail-section-label{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.12em;color:rgba(255,255,255,.48);padding:0 8px;margin-top:2px}
body.mail-account-selected .rail-section-label{display:none}
.rail-item{
  min-height:38px;border-radius:13px;color:rgba(255,255,255,.86);display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:10px;padding:5px 8px;text-decoration:none;position:relative;
}
.rail-item span{width:34px;height:34px;border-radius:11px;background:var(--glass);display:grid;place-items:center;font-weight:900;color:#fff}
.rail-item em{font-style:normal;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.rail-item b{min-width:22px;height:22px;border-radius:999px;background:#315eff;color:#fff;display:grid;place-items:center;font-size:11px}
.rail-item:hover,.rail-item.active{background:var(--glass-active)}
body.mail-account-selected .rail-item{display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;margin:0 auto;border-radius:14px}
body.mail-account-selected .rail-item span{width:44px;height:44px;background:transparent}
body.mail-account-selected .rail-item.active span{background:var(--glass-active)}
body.mail-account-selected .rail-item em,body.mail-account-selected .rail-item b{display:none}
.rail-account-nav{overflow:auto;padding-right:2px;scrollbar-width:none}
.rail-account-nav::-webkit-scrollbar{display:none}
.rail-spacer{flex:1}
.rail-footer{border-top:1px solid var(--dark-line);padding-top:12px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px}
body.mail-account-selected .rail-footer{grid-template-columns:1fr;justify-items:center;gap:10px}
.rail-user{width:36px;height:36px;border-radius:999px;background:#fff;color:#111827;display:grid;place-items:center;font-weight:900}
.rail-logout{width:34px;height:34px;border:0;border-radius:12px;background:var(--glass);color:#fff;display:grid;place-items:center}
body.mail-account-selected .rail-user{width:38px;height:38px}
body.mail-account-selected .rail-logout{width:38px;height:38px}
body.mail-account-selected .rail-footer form{margin:0}

.folder-drawer-head{padding:18px;display:flex;gap:12px;align-items:center;border-bottom:1px solid #e6edf7;background:linear-gradient(180deg,#fff,#f7faff)}
.folder-account-avatar{width:42px;height:42px;border-radius:14px;background:#edf3ff;color:#315eff;display:grid;place-items:center;font-weight:900}
.folder-drawer-head strong{display:block;font-size:15px;color:#0f2037}
.folder-drawer-head span{display:block;font-size:12px;color:#6e7d92;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:168px;margin-top:2px}
.folder-create-form{display:grid;grid-template-columns:1fr 38px;gap:8px;padding:14px 14px 10px;border-bottom:1px solid #eef3fb}
.folder-create-form input{height:38px;border-radius:12px;background:#f7faff;border-color:#dfe8f4;padding:0 12px}
.folder-create-form button{height:38px;border:0;border-radius:12px;background:#315eff;color:#fff;font-weight:900}
.folder-list-title{padding:14px 16px 8px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.12em;color:#8190a4}
.folder-drawer-list{display:grid;gap:4px;padding:0 10px}
.folder-drawer-item{min-height:38px;border-radius:12px;display:grid;grid-template-columns:34px 1fr auto;gap:8px;align-items:center;padding:4px 8px;color:#263b58;text-decoration:none;background:transparent}
.folder-drawer-item:hover,.folder-drawer-item.active{background:#f1f5ff;color:#18396f}
.folder-icon{width:30px;height:30px;border-radius:10px;background:#edf3fd;color:#315eff;display:grid;place-items:center;font-weight:900}
.folder-name{font-weight:700;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.folder-badge{min-width:25px;height:22px;border-radius:999px;background:#fff;border:1px solid #dfe8f4;color:#60718a;display:grid;place-items:center;font-size:11px;font-weight:800}
.custom-title{margin-top:8px}
.folder-empty-note{padding:10px 12px;color:#8190a4;font-size:13px}
.custom-folder-row{padding:0 4px 0 8px;grid-template-columns:1fr auto}
.custom-folder-row>a{display:grid;grid-template-columns:34px 1fr auto;gap:8px;align-items:center;color:inherit;text-decoration:none;min-width:0;padding:4px 0}
.custom-folder-row form{margin:0}
.custom-folder-row button{width:28px;height:28px;border:0;border-radius:9px;background:#fff;color:#9aa8ba;font-weight:900}
.custom-folder-row button:hover{background:#ffecec;color:#b42323}
.folder-drawer-actions{margin-top:auto;padding:14px;border-top:1px solid #e6edf7;display:grid;gap:8px}
.folder-drawer-actions a{min-height:34px;border-radius:11px;background:#f7faff;border:1px solid #e1e9f5;color:#27405f;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800}
.folder-drawer-placeholder{padding:18px;color:#7d8da3}
.folder-drawer-placeholder strong{display:block;color:#102039;margin-bottom:4px}
.folder-drawer-placeholder span{font-size:13px}

/* Tooltips for the dark rail */
.sidebar-two-tables .tooltipable:hover::after{content:attr(data-tip);position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);background:#0b1220;color:#fff;padding:7px 10px;border-radius:10px;white-space:nowrap;font-size:12px;z-index:9999;box-shadow:0 14px 34px rgba(0,0,0,.25)}
.sidebar-two-tables .tooltipable:hover::before{content:"";position:absolute;left:calc(100% + 4px);top:50%;transform:translateY(-50%);border:6px solid transparent;border-right-color:#0b1220;z-index:9999}
.rail-brand.tooltipable:hover::after,.rail-brand.tooltipable:hover::before{display:none}
body:not(.mail-account-selected) .rail-item.tooltipable:hover::after,body:not(.mail-account-selected) .rail-item.tooltipable:hover::before,body:not(.mail-account-selected) .rail-compose.tooltipable:hover::after,body:not(.mail-account-selected) .rail-compose.tooltipable:hover::before{display:none}

/* Layout / content alignment */
.content-wrap{padding:18px;background:var(--client-bg)}
.topbar{background:#fff;border-bottom:1px solid #e0e8f3;box-shadow:0 4px 18px rgba(15,35,65,.04)}
.mail-layout-reference{grid-template-columns:minmax(330px,390px) minmax(0,1fr)}
.mail-row{padding:0;grid-template-columns:1fr auto;position:relative;overflow:hidden}
.mail-row-link{display:grid;grid-template-columns:44px 1fr;gap:12px;padding:14px;color:inherit;text-decoration:none;min-width:0}
.mail-delete-form{display:flex;align-items:center;padding-right:10px;opacity:0;transition:.15s}
.mail-row:hover .mail-delete-form{opacity:1}
.mail-delete-form button{width:34px;height:34px;border:0;border-radius:11px;background:#fff0f0;color:#a72d2d;font-weight:900}
.reader-actions-flat{align-items:center}
.reader-actions-flat form{margin:0}
.reader-actions-flat button{min-height:32px;padding:0 11px;border-radius:10px;border:1px solid #fde0e0;background:#fff;color:#b42323;font-weight:700}

@media(max-width:1040px){
  .sidebar-two-tables{position:fixed;left:0;top:0;bottom:0;width:min(92vw,340px);grid-template-columns:76px 1fr;transform:translateX(-102%);transition:transform .2s ease;z-index:50}
  body.nav-open .sidebar-two-tables{transform:translateX(0)}
  body.mail-account-selected .sidebar-two-tables{width:min(92vw,340px);grid-template-columns:76px 1fr}
  .sidebar-table-two{width:auto;opacity:1}
  .rail-brand-text,.rail-item em,.rail-item b,.rail-section-label{display:none}
  .rail-item{display:flex;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;margin:0 auto}
  .rail-item span{width:44px;height:44px;background:transparent}
  .rail-compose{width:44px;height:44px;min-height:44px;margin:0 auto}
  .mail-layout-reference{grid-template-columns:1fr}
}


/* === Stable AJAX shell polish === */
#ajaxProgressBar{
  position:fixed;
  left:0;
  top:0;
  width:0;
  height:3px;
  z-index:20000;
  background:linear-gradient(90deg,#315eff,#8ca2ff);
  box-shadow:0 0 18px rgba(49,94,255,.45);
  opacity:0;
  transition:width .35s ease,opacity .18s ease;
}
#ajaxProgressBar.active{
  width:82%;
  opacity:1;
}
body.ajax-loading #contentWrap,
body.ajax-loading .content-wrap{
  opacity:.72;
  pointer-events:none;
  transition:opacity .16s ease;
}

/* Guard rail: keep the first table visually correct even if the browser restores an old intermediate DOM state. */
.sidebar-two-tables .rail-brand-text,
.sidebar-two-tables .rail-item em,
.sidebar-two-tables .rail-section-label,
.sidebar-two-tables .rail-item b{
  min-width:0;
}
body.mail-account-selected .sidebar-two-tables .rail-brand-text,
body.mail-account-selected .sidebar-two-tables .rail-item em,
body.mail-account-selected .sidebar-two-tables .rail-section-label,
body.mail-account-selected .sidebar-two-tables .rail-item b{
  display:none !important;
}
body.mail-account-selected .sidebar-two-tables .rail-brand,
body.mail-account-selected .sidebar-two-tables .rail-compose,
body.mail-account-selected .sidebar-two-tables .rail-item{
  width:44px !important;
  min-width:44px !important;
  max-width:44px !important;
  justify-content:center !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
body.mail-account-selected .sidebar-two-tables .rail-nav{
  justify-items:center;
}


/* === Screenshot-like Inbox + Reader redesign === */
.mail-layout-shot{
  grid-template-columns:minmax(320px,374px) minmax(0,1fr);
  gap:0;
  height:calc(100vh - 96px);
  min-height:560px;
  background:#fff;
  border:1px solid #e6edf7;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 18px 50px rgba(10,29,54,.08);
}
.mail-layout-shot .mail-frame{
  border:0;
  border-radius:0;
  box-shadow:none;
}
.inbox-shot-frame{
  border-right:1px solid #e7edf6 !important;
  background:#fbfcff;
}
.inbox-shot-header{
  display:grid;
  gap:12px;
  padding:16px 16px 13px;
  border-bottom:1px solid #e7edf6;
  background:#fff;
}
.inbox-shot-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.inbox-title-wrap{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}
.inbox-title-wrap h1{
  margin:0;
  font-size:22px;
  line-height:1.08;
  letter-spacing:-.035em;
  color:#0b1830;
}
.inbox-shot-header .subline{
  font-size:12px;
  margin-top:4px;
}
.inbox-check{
  position:relative;
  width:18px;
  height:18px;
  margin-top:3px;
  flex:0 0 auto;
}
.inbox-check input{
  position:absolute;
  inset:0;
  opacity:0;
}
.inbox-check span{
  width:18px;
  height:18px;
  border-radius:5px;
  border:1px solid #d8e2f0;
  background:#fff;
  display:block;
}
.inbox-filter-pill{
  min-height:30px;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  border-radius:9px;
  color:#5d6e85;
  font-weight:700;
  font-size:12px;
  background:#f6f8fc;
  border:1px solid #e5ecf6;
}
.inbox-shot-search{
  height:38px;
  border:1px solid #dfe8f5;
  background:#f8fbff;
  border-radius:12px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 10px;
}
.inbox-shot-search span{
  color:#708299;
  font-size:13px;
}
.inbox-shot-search input{
  border:0;
  background:transparent;
  padding:0;
  box-shadow:none;
  min-width:0;
  flex:1;
  font-size:13px;
}
.inbox-shot-search button{
  width:26px;
  height:26px;
  border:0;
  border-radius:8px;
  background:#eef3fb;
  color:#536a89;
  display:grid;
  place-items:center;
  font-size:12px;
}
.inbox-shot-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.inbox-shot-actions .tiny-btn{
  min-height:32px;
  border-radius:9px;
  padding:0 11px;
  font-size:12px;
}
.inbox-shot-list{
  background:#fbfcff;
  padding:0;
}
.inbox-section-label{
  padding:11px 16px 7px;
  font-size:10px;
  line-height:1;
  letter-spacing:.12em;
  color:#92a0b4;
  font-weight:900;
  text-transform:uppercase;
  background:#fbfcff;
}
.shot-mail-row{
  margin:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#fff;
  border-bottom:1px solid #edf2f8;
  display:grid;
  grid-template-columns:1fr auto;
  overflow:visible;
}
.shot-mail-row:hover{
  transform:none;
  box-shadow:none;
  background:#f8fbff;
}
.shot-mail-row.active{
  background:#f1f6ff;
  border-color:#e2ebff;
}
.shot-mail-row::after{
  display:none;
}
.shot-mail-row.active::before{
  content:"";
  position:absolute;
  left:0;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:999px;
  background:#315eff;
}
.shot-mail-link{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:12px;
  min-width:0;
  padding:13px 13px 13px 16px;
}
.shot-avatar{
  border-radius:999px;
  background:linear-gradient(135deg,#dbe4ff,#315eff);
  color:#fff;
  width:38px;
  height:38px;
  font-size:12px;
  box-shadow:none;
}
.shot-mail-row:nth-of-type(6n+1) .shot-avatar{background:#eb6d7d}
.shot-mail-row:nth-of-type(6n+2) .shot-avatar{background:#8b7cf4}
.shot-mail-row:nth-of-type(6n+3) .shot-avatar{background:#65b67f}
.shot-mail-row:nth-of-type(6n+4) .shot-avatar{background:#e2a653}
.shot-mail-row:nth-of-type(6n+5) .shot-avatar{background:#4d77c8}
.shot-mail-row:nth-of-type(6n+6) .shot-avatar{background:#9c6bca}
.shot-mail-row .mail-row-top{
  align-items:center;
}
.shot-mail-row .mail-row-top strong{
  font-size:13px;
  color:#1d2d44;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.shot-mail-row .mail-row-top span{
  font-size:11px;
  color:#8b99ad;
}
.shot-mail-row .mail-subject{
  margin-top:2px;
  font-size:13px;
  font-weight:800;
  color:#17263b;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.shot-mail-row .mail-preview{
  margin-top:2px;
  font-size:12px;
  color:#7a879b;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.shot-mail-row .mail-tags{
  margin-top:7px;
}
.shot-mail-row .tag{
  font-size:9px;
  letter-spacing:.08em;
  padding:3px 7px;
  border-radius:7px;
}
.mail-row-side-actions{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  padding:10px 10px 10px 0;
  opacity:.55;
}
.shot-mail-row:hover .mail-row-side-actions{
  opacity:1;
}
.mail-star{
  color:#c0cada;
  font-size:15px;
  line-height:1;
}
.mail-delete-form{
  position:static !important;
  opacity:1 !important;
  inset:auto !important;
}
.mail-delete-form button{
  width:26px;
  height:24px;
  border-radius:7px;
  border:1px solid #e4ebf5;
  background:#fff;
  color:#6d7d93;
  font-size:11px;
}

/* Reader like the reference screenshot */
.reader-shot-frame{
  background:#fff;
}
.reader-shot-toolbar{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 18px;
  border-bottom:1px solid #e7edf6;
  background:#fff;
}
.reader-toolbar-group{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.reader-toolbar-group a,
.reader-toolbar-group button{
  width:32px;
  height:32px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#65758d;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:13px;
}
.reader-toolbar-group a:hover,
.reader-toolbar-group button:hover{
  background:#f0f5ff;
  color:#315eff;
}
.reader-toolbar-export a{
  width:auto;
  padding:0 9px;
  font-size:12px;
  border:1px solid #e5ecf6;
  background:#fff;
}
.toolbar-delete-form,
.toolbar-delete-form button{
  margin:0;
}
.reader-shot-header{
  padding:20px 28px 17px;
  border-bottom:1px solid #edf2f8;
  background:#fff;
  display:grid;
  gap:16px;
}
.reader-shot-subject{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:start;
}
.reader-shot-subject h2{
  margin:0;
  font-size:25px;
  line-height:1.18;
  letter-spacing:-.035em;
  color:#111f36;
  white-space:normal;
  overflow:visible;
}
.reader-shot-time{
  font-size:12px;
  color:#7b899e;
  white-space:nowrap;
  padding-top:5px;
}
.reader-shot-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.reader-shot-meta .reader-author-flat{
  padding:0;
  border:0;
  background:transparent;
}
.reader-shot-meta .reader-address-block strong{
  font-size:13px;
}
.reader-shot-meta .reader-address-block span{
  font-size:12px;
}
.reader-mini-actions{
  color:#8b99ad;
  font-size:13px;
  white-space:nowrap;
}
.reader-shot-scroll{
  background:#fff;
}
.reader-shot-article{
  padding:28px 30px 40px;
  max-width:860px;
}
.shot-html-content,
.shot-mail-text{
  border:0;
  box-shadow:none;
  padding:0;
  border-radius:0;
  background:#fff;
  font-size:14px;
  line-height:1.78;
  color:#26384f;
}
.shot-html-content p,
.shot-html-content li{
  color:#26384f;
}
.shot-html-content h1,
.shot-html-content h2,
.shot-html-content h3{
  color:#111f36;
  letter-spacing:-.025em;
}
.shot-html-content img{
  border-radius:8px;
}
.shot-html-content table{
  font-size:13px;
}
.detail-shot-layout{
  grid-template-columns:240px minmax(0,1fr);
}
.detail-export-shot{
  border-right:1px solid #e7edf6 !important;
}
.detail-shot-meta{
  max-width:860px;
  margin-bottom:22px;
}

@media(max-width:1180px){
  .mail-layout-shot{
    grid-template-columns:minmax(300px,340px) minmax(0,1fr);
  }
  .reader-shot-subject{
    grid-template-columns:1fr;
    gap:5px;
  }
  .reader-shot-time{
    padding-top:0;
  }
}
@media(max-width:1040px){
  .mail-layout-shot,
  .detail-shot-layout{
    height:auto;
    min-height:0;
    grid-template-columns:1fr;
    border-radius:18px;
  }
  .inbox-shot-frame{
    border-right:0 !important;
    border-bottom:1px solid #e7edf6 !important;
  }
  .reader-shot-header{
    position:sticky;
    top:64px;
    z-index:4;
  }
}
@media(max-width:720px){
  .inbox-shot-header{
    padding:14px;
  }
  .reader-shot-toolbar{
    padding:8px 12px;
  }
  .reader-shot-header{
    padding:16px;
  }
  .reader-shot-meta{
    align-items:flex-start;
  }
  .reader-mini-actions{
    display:none;
  }
  .reader-shot-article{
    padding:20px 16px 32px;
  }
}


/* === Inline read preview behavior === */
.shot-mail-link{
  cursor:pointer;
}
.shot-mail-row.active .tag.green{
  display:none;
}
.shot-mail-row.active .mail-subject,
.shot-mail-row.active .mail-row-top strong{
  color:#0f1f38;
}
.shot-mail-row:not(.active) .tag.green + .tag,
.shot-mail-row:not(.active) .tag.green{
  box-shadow:0 2px 8px rgba(45,156,113,.14);
}


/* === Read / unread visual hierarchy === */
.shot-mail-row.mail-is-unread .mail-row-top strong,
.shot-mail-row.mail-is-unread .mail-subject{
  font-weight:850;
  color:#0b1830;
}

.shot-mail-row.mail-is-unread .mail-preview{
  font-weight:500;
  color:#52647d;
}

.shot-mail-row.mail-is-read .mail-row-top strong,
.shot-mail-row.mail-is-read .mail-subject{
  font-weight:560;
  color:#33445c;
}

.shot-mail-row.mail-is-read .mail-preview{
  font-weight:400;
  color:#8390a4;
}

.shot-mail-row.mail-is-read .mail-row-top span{
  color:#9ba7b7;
}

.shot-mail-row.mail-is-read .shot-avatar{
  opacity:.82;
}

.shot-mail-row.active.mail-is-read .mail-row-top strong,
.shot-mail-row.active.mail-is-read .mail-subject{
  font-weight:650;
  color:#17263b;
}

.shot-mail-row.active.mail-is-read .mail-preview{
  color:#6f7f96;
}


/* === Reader header consistency + smooth inline loader === */
.reader-shot-frame{
  position:relative;
  isolation:isolate;
}

.reader-content-inner{
  min-height:0;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  height:100%;
}

.reader-content-inner.reader-content-fade-out{
  opacity:.72;
}

.reader-shot-toolbar{
  height:48px;
  min-height:48px;
  max-height:48px;
  flex:0 0 48px;
  position:relative;
  z-index:12;
}

.reader-shot-header{
  min-height:118px;
  max-height:142px;
  height:auto;
  position:relative;
  z-index:11;
  overflow:hidden;
}

.reader-shot-subject{
  align-items:start;
}

.reader-shot-subject h2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  max-height:58px;
  line-height:1.16;
}

.reader-shot-meta{
  min-height:38px;
}

.reader-shot-scroll{
  position:relative;
  z-index:1;
  min-height:0;
  overflow:auto;
}

.reader-shot-article{
  padding-top:24px;
}

/* Keep HTML newsletters/mails from escaping over the frame header. */
.mail-html-content,
.shot-html-content{
  position:relative;
  z-index:1;
  isolation:isolate;
  contain:layout paint;
  overflow:auto;
}

.mail-html-content *,
.shot-html-content *{
  max-width:100%;
}

.mail-html-content [style*="position:fixed"],
.mail-html-content [style*="position: fixed"],
.mail-html-content [style*="position:absolute"],
.mail-html-content [style*="position: absolute"],
.shot-html-content [style*="position:fixed"],
.shot-html-content [style*="position: fixed"],
.shot-html-content [style*="position:absolute"],
.shot-html-content [style*="position: absolute"]{
  position:static !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
  transform:none !important;
}

.mail-html-content body,
.mail-html-content div:first-child,
.shot-html-content body,
.shot-html-content div:first-child{
  margin-top:0 !important;
}

.shot-html-content > *:first-child,
.shot-mail-text > *:first-child{
  margin-top:0 !important;
}

.shot-html-content > *:last-child{
  margin-bottom:0 !important;
}

/* Smooth reader loader */
.reader-smooth-loader{
  position:absolute;
  inset:48px 0 0 0;
  z-index:30;
  display:grid;
  place-items:start center;
  padding-top:92px;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,255,255,.42));
  backdrop-filter:blur(3px);
  opacity:0;
  transition:opacity .16s ease;
}

.reader-smooth-loader.show{
  opacity:1;
}

.reader-loader-card{
  width:min(520px,72%);
  border:1px solid #e5ecf6;
  border-radius:20px;
  background:#fff;
  padding:22px;
  box-shadow:0 22px 55px rgba(15,35,65,.12);
  display:grid;
  gap:12px;
}

.reader-loader-card span{
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(90deg,#eef3fb,#dfe9ff,#eef3fb);
  background-size:220% 100%;
  animation:mymailsSkeleton 1.15s infinite linear;
}

.reader-loader-card b,
.reader-loader-card i{
  display:block;
  height:12px;
  border-radius:999px;
  background:linear-gradient(90deg,#eef3fb,#dfe9ff,#eef3fb);
  background-size:220% 100%;
  animation:mymailsSkeleton 1.15s infinite linear;
}

.reader-loader-card b{width:72%;height:16px}
.reader-loader-card i:nth-of-type(1){width:94%}
.reader-loader-card i:nth-of-type(2){width:86%}
.reader-loader-card i:nth-of-type(3){width:62%}

@keyframes mymailsSkeleton{
  0%{background-position:220% 0}
  100%{background-position:-220% 0}
}

.reader-is-loading .reader-scroll{
  opacity:.66;
  transition:opacity .14s ease;
}

/* Prevent whole inbox from jumping while the reader is updated. */
.inbox-shot-list{
  overflow-anchor:none;
}
.shot-mail-row{
  overflow-anchor:none;
}

@media(max-width:1040px){
  .reader-content-inner{
    height:auto;
    display:block;
  }
  .reader-shot-toolbar{
    height:auto;
    min-height:48px;
    max-height:none;
  }
  .reader-shot-header{
    min-height:0;
    max-height:none;
  }
  .reader-smooth-loader{
    inset:0;
    padding-top:80px;
  }
}


/* === Improved HTML mail rendering in isolated frame === */
.mail-html-frame,
.shot-html-frame{
  display:block;
  width:100%;
  min-height:320px;
  height:620px;
  border:0;
  background:#fff;
  border-radius:0;
  overflow:hidden;
}

.reader-shot-article:has(.mail-html-frame){
  max-width:none;
}

.reader-shot-article .mail-html-frame{
  max-width:100%;
}

.shot-html-content{
  min-height:120px;
}

.reader-is-loading .mail-html-frame{
  opacity:.45;
}

/* Fallback if :has is not supported */
.reader-shot-article.html-frame-wide{
  max-width:none;
}


/* === HTML frame visual polish: no black border + larger content === */
.mail-html-frame,
.shot-html-frame,
iframe.mail-html-frame,
iframe.shot-html-frame{
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:#fff !important;
  border-radius:0 !important;
  display:block;
}

.reader-shot-article:has(.mail-html-frame){
  padding-top:26px;
  padding-left:34px;
  padding-right:34px;
  max-width:980px;
}

.reader-shot-article .mail-html-frame{
  width:100% !important;
  min-height:420px;
}

@media(max-width:720px){
  .reader-shot-article:has(.mail-html-frame){
    padding-left:18px;
    padding-right:18px;
  }
}


/* === Reader attachments === */
.reader-attachments-panel{
  margin-top:24px;
  padding-top:18px;
  border-top:1px solid #e8eef8;
}

.reader-attachments-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.reader-attachments-head h3{
  margin:0;
  font-size:15px;
  letter-spacing:-.02em;
  color:#111f36;
}

.reader-attachments-head span{
  color:#7d8da2;
  font-size:12px;
}

.reader-attachment-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:10px;
}

.reader-attachment-card{
  display:grid;
  grid-template-columns:40px minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  min-height:62px;
  padding:10px 12px;
  border:1px solid #e2eaf6;
  border-radius:15px;
  background:linear-gradient(180deg,#fff,#f9fbff);
  color:#17263b;
  box-shadow:0 8px 20px rgba(15,35,65,.045);
}

.reader-attachment-card:hover{
  border-color:#c9d8ff;
  background:#f3f7ff;
}

.reader-attachment-icon{
  width:40px;
  height:40px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:#edf3fd;
  color:#315eff;
  font-size:17px;
}

.reader-attachment-info{
  min-width:0;
}

.reader-attachment-info strong,
.reader-attachment-info em{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.reader-attachment-info strong{
  font-size:13px;
  color:#15233a;
}

.reader-attachment-info em{
  margin-top:3px;
  font-size:11px;
  font-style:normal;
  color:#7c8ba1;
}

.reader-attachment-download{
  min-height:28px;
  padding:0 9px;
  border-radius:9px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  border:1px solid #dbe5f4;
  color:#315eff;
  font-size:11px;
  font-weight:800;
}

.detail-attachments-panel{
  max-width:980px;
}

@media(max-width:720px){
  .reader-attachments-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .reader-attachment-list{
    grid-template-columns:1fr;
  }
  .reader-attachment-card{
    grid-template-columns:36px minmax(0,1fr);
  }
  .reader-attachment-download{
    grid-column:2;
    justify-self:start;
  }
}


/* === HTML frame: centered wider reader without visible frame border === */
.reader-shot-article:has(.mail-html-frame){
  max-width:1040px;
  width:100%;
  margin-left:auto;
  margin-right:auto;
  padding-left:42px;
  padding-right:42px;
}

.mail-html-frame,
.shot-html-frame,
iframe.mail-html-frame,
iframe.shot-html-frame{
  display:block;
  width:100% !important;
  max-width:980px;
  min-height:440px;
  margin:0 auto;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:#fff !important;
  border-radius:0 !important;
}

.reader-shot-scroll{
  background:#fff;
}

@media(max-width:720px){
  .reader-shot-article:has(.mail-html-frame){
    padding-left:18px;
    padding-right:18px;
  }
  .mail-html-frame,
  .shot-html-frame{
    max-width:100%;
  }
}


/* === Drag & Drop: Inbox mails to folders === */
.draggable-mail-row{
  cursor:grab;
}

.draggable-mail-row:active{
  cursor:grabbing;
}

.mail-row-dragging{
  opacity:.46;
  transform:scale(.985);
}

.mail-row-moving-out{
  opacity:0;
  transform:translateX(26px);
  transition:opacity .18s ease,transform .18s ease;
}

.folder-drop-hint{
  margin-top:10px;
  padding:9px 10px;
  border:1px dashed rgba(255,255,255,.18);
  border-radius:12px;
  color:rgba(255,255,255,.62);
  font-size:11px;
  line-height:1.35;
}

.mail-drag-active .folder-drop-hint{
  color:#d9e4ff;
  border-color:rgba(116,147,255,.55);
  background:rgba(49,94,255,.13);
}

.mail-drop-target{
  position:relative;
}

.mail-drop-target.drop-ready{
  outline:1px dashed rgba(125,153,255,.42);
  outline-offset:2px;
}

.mail-drop-target.drop-over{
  background:rgba(49,94,255,.22) !important;
  border-color:rgba(152,174,255,.72) !important;
  transform:translateX(3px);
}

.mail-drop-target.drop-over::after{
  content:"Hier ablegen";
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  background:#315eff;
  color:#fff;
  font-size:10px;
  font-weight:800;
  letter-spacing:.02em;
  pointer-events:none;
}

.mail-drop-target.drop-saving{
  opacity:.7;
  pointer-events:none;
}

.drag-drop-toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translate(-50%,16px);
  z-index:25000;
  min-width:240px;
  max-width:min(420px,calc(100vw - 32px));
  padding:12px 15px;
  border-radius:15px;
  background:#0d2341;
  color:#fff;
  box-shadow:0 18px 45px rgba(9,23,43,.28);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
  font-weight:650;
  text-align:center;
}

.drag-drop-toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

.drag-drop-toast.error{
  background:#b91c1c;
}

.drag-empty-box{
  margin:14px;
}

/* === Context menu: thinner, cleaner typography === */
.global-context-menu{
  font-size:13px;
  letter-spacing:0;
}

.ctx-item{
  font-weight:500 !important;
  font-size:13px !important;
  line-height:1.22;
  letter-spacing:0;
  color:#21324a;
}

.ctx-item span:not(.ctx-icon){
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ctx-item:hover,
.ctx-item:focus{
  color:#102039;
}

.ctx-icon{
  font-weight:650 !important;
  font-size:11px;
}

.ctx-separator{
  opacity:.75;
}

@media(max-width:1040px){
  .draggable-mail-row{
    cursor:pointer;
  }
  .folder-drop-hint{
    display:none;
  }
}


/* === Auto-Sync + Push Notification UI === */
.notify-toggle{
  min-width:38px;
  width:38px;
  padding:0 !important;
  display:inline-grid !important;
  place-items:center;
}

.notify-toggle.ok{
  color:#1d7f54;
  background:#e8f9f1;
  border-color:#c8efd9;
}

.notify-toggle.off{
  color:#a43f3f;
  background:#fff1f1;
  border-color:#ffd3d3;
}

.autosync-pill{
  min-height:34px;
  padding:0 10px;
  border:1px solid #dbe5f4;
  border-radius:12px;
  background:#fff;
  color:#60728d;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:650;
  white-space:nowrap;
}

.autosync-pill.ok{
  color:#315eff;
  background:#f3f6ff;
  border-color:#d9e3ff;
}

.autosync-pill.busy{
  color:#856404;
  background:#fff8db;
  border-color:#f1df94;
}

.autosync-pill.error{
  color:#b91c1c;
  background:#fff1f1;
  border-color:#ffd3d3;
}

@media(max-width:1040px){
  .autosync-pill{
    display:none;
  }
  .notify-toggle{
    width:36px;
    min-width:36px;
  }
}


/* === Real Web Push + account Auto-Sync settings === */
.notify-toggle.ok{
  box-shadow:0 0 0 3px rgba(45,156,113,.10);
}

.autosync-pill.off{
  color:#7a879b;
  background:#f7f9fc;
  border-color:#e2eaf6;
}

.form-grid .hint-box.wide{
  grid-column:1 / -1;
  margin:0;
}

.account-details div strong{
  line-height:1.35;
}


/* === Account quick preferences outside credential editor === */
.account-card-preferences{
  display:grid;
  gap:14px;
}

.account-preferences-form{
  margin:4px 0 2px;
  padding:14px;
  border:1px solid #e4ebf6;
  border-radius:18px;
  background:linear-gradient(180deg,#f9fbff,#fff);
  display:grid;
  gap:12px;
}

.account-pref-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  padding-bottom:4px;
}

.account-pref-head strong{
  font-size:14px;
  color:#13243b;
}

.account-pref-head span{
  color:#78889d;
  font-size:12px;
}

.pref-toggle-row,
.pref-select-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:11px 12px;
  border:1px solid #edf2f8;
  border-radius:14px;
  background:#fff;
}

.pref-toggle-row input[type="checkbox"]{
  width:20px;
  height:20px;
  accent-color:#315eff;
}

.pref-select-row select{
  width:150px;
  min-width:150px;
  padding:9px 10px;
  border-radius:10px;
}

.pref-toggle-row b,
.pref-select-row b{
  display:block;
  font-size:13px;
  color:#17263b;
}

.pref-toggle-row em,
.pref-select-row em{
  display:block;
  margin-top:2px;
  color:#7c8ba1;
  font-style:normal;
  font-size:12px;
  line-height:1.35;
}

.pref-toggle-row.danger-aware{
  border-color:#f3dede;
}

.pref-toggle-row.danger-aware b{
  color:#8f2c2c;
}

.account-pref-summary{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.account-pref-summary span{
  border-radius:999px;
  padding:5px 9px;
  font-size:11px;
  font-weight:800;
}

.account-pref-summary .on{
  background:#e8f9f1;
  color:#15754c;
}

.account-pref-summary .on.danger{
  background:#fff1f1;
  color:#b42323;
}

.account-pref-summary .off{
  background:#edf3fd;
  color:#677790;
}

.account-pref-actions{
  justify-content:flex-start;
}

@media(max-width:720px){
  .account-pref-head,
  .pref-toggle-row,
  .pref-select-row{
    grid-template-columns:1fr;
    align-items:flex-start;
  }

  .pref-select-row select{
    width:100%;
  }
}


/* === Mobile Gmail-like inbox/reader + hamburger fix === */
.mobile-reader-back{
  display:none !important;
}

.inbox-account-line{
  margin-top:3px;
  font-size:11px;
  line-height:1.25;
  color:#7a8aa0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

@media(max-width:1040px){
  .mobile-overlay{
    display:block !important;
    position:fixed !important;
    inset:0 !important;
    z-index:80 !important;
    background:rgba(8,22,42,.38) !important;
    opacity:0;
    pointer-events:none;
  }

  body.nav-open .mobile-overlay{
    opacity:1 !important;
    pointer-events:auto !important;
  }

  .sidebar-two-tables,
  body.mail-account-selected .sidebar-two-tables{
    position:fixed !important;
    left:0 !important;
    top:0 !important;
    bottom:0 !important;
    width:min(92vw,350px) !important;
    height:100svh !important;
    min-height:100svh !important;
    grid-template-columns:76px minmax(0,1fr) !important;
    transform:translateX(-106%) !important;
    transition:transform .2s ease !important;
    z-index:100 !important;
    box-shadow:24px 0 60px rgba(8,22,42,.28) !important;
  }

  body.nav-open .sidebar-two-tables,
  body.nav-open.mail-account-selected .sidebar-two-tables{
    transform:translateX(0) !important;
  }

  .sidebar-table-two,
  body.mail-account-selected .sidebar-table-two.open{
    width:auto !important;
    opacity:1 !important;
  }
}

@media(max-width:720px){
  html,
  body{
    overflow-x:hidden;
  }

  .topbar{
    height:56px;
    min-height:56px;
    padding:0 8px !important;
    gap:8px;
  }

  .topbar-left{
    gap:8px;
    min-width:0;
    width:100%;
  }

  .mobile-menu-btn{
    display:flex !important;
    width:38px;
    height:38px;
    min-width:38px;
    border-radius:11px;
  }

  .searchbar{
    height:38px;
    width:100%;
    min-width:0;
    border-radius:12px;
    padding:0 10px;
  }

  .content-wrap{
    padding:6px !important;
  }

  .flash{
    margin:0 0 6px;
    padding:10px 12px;
    border-radius:12px;
  }

  .mail-layout-shot,
  .mail-layout-reference,
  .mail-layout{
    display:grid;
    grid-template-columns:1fr !important;
    gap:0 !important;
    height:calc(100svh - 68px) !important;
    min-height:calc(100svh - 68px) !important;
    border-radius:14px !important;
    border:1px solid #e3ebf6 !important;
    overflow:hidden !important;
  }

  body:not(.mobile-reader-open) .mail-layout-shot .reader-shot-frame{
    display:none !important;
  }

  body.mobile-reader-open .mail-layout-shot .inbox-shot-frame{
    display:none !important;
  }

  .inbox-shot-frame,
  .reader-shot-frame{
    min-height:0;
    height:100%;
    overflow:hidden;
  }

  .inbox-shot-header{
    padding:10px 10px 9px !important;
    gap:8px;
  }

  .inbox-title-wrap{
    gap:8px;
  }

  .inbox-check{
    display:none;
  }

  .inbox-title-wrap h1{
    font-size:20px !important;
  }

  .inbox-shot-header .subline{
    font-size:11px;
    margin-top:2px;
  }

  .inbox-account-line{
    font-size:11px;
  }

  .inbox-filter-pill{
    min-height:26px;
    padding:0 8px;
    font-size:11px;
  }

  .inbox-shot-search{
    height:36px;
    border-radius:11px;
  }

  .inbox-shot-actions{
    gap:6px;
  }

  .inbox-shot-actions .tiny-btn{
    min-height:30px;
    padding:0 9px;
    font-size:11px;
  }

  .inbox-scroll{
    height:100%;
    overflow:auto;
  }

  .shot-mail-link{
    grid-template-columns:38px minmax(0,1fr) !important;
    gap:10px !important;
    padding:11px 10px !important;
  }

  .shot-avatar{
    width:36px !important;
    height:36px !important;
    border-radius:12px !important;
  }

  .shot-mail-row{
    min-height:72px !important;
  }

  .shot-sender{
    font-size:13px !important;
  }

  .shot-subject{
    font-size:13px !important;
    -webkit-line-clamp:1;
  }

  .shot-preview{
    font-size:12px !important;
    -webkit-line-clamp:1;
  }

  .mail-row-side-actions{
    display:none !important;
  }

  .reader-shot-frame{
    display:grid !important;
    grid-template-rows:auto auto minmax(0,1fr);
  }

  .mobile-reader-back{
    display:grid !important;
  }

  .reader-shot-toolbar{
    min-height:46px !important;
    height:46px !important;
    padding:7px 8px !important;
    gap:6px;
  }

  .reader-toolbar-group{
    gap:4px;
  }

  .reader-toolbar-group a,
  .reader-toolbar-group button{
    width:31px;
    height:31px;
    border-radius:9px;
  }

  .reader-toolbar-export a{
    width:auto;
    padding:0 7px;
    font-size:11px;
  }

  .reader-shot-header{
    min-height:auto !important;
    max-height:none !important;
    padding:12px 12px 10px !important;
    gap:10px !important;
  }

  .reader-shot-subject{
    grid-template-columns:1fr !important;
    gap:5px !important;
  }

  .reader-shot-subject h2{
    font-size:20px !important;
    line-height:1.18 !important;
    -webkit-line-clamp:2;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }

  .reader-shot-time{
    padding-top:0;
    font-size:11px;
    white-space:normal;
  }

  .reader-shot-meta{
    gap:8px;
  }

  .reader-mini-actions{
    display:none;
  }

  .reader-address-block strong{
    font-size:12px !important;
  }

  .reader-address-block span{
    font-size:11px !important;
  }

  .reader-shot-scroll{
    min-height:0;
    overflow:auto;
  }

  .reader-shot-article,
  .reader-shot-article:has(.mail-html-frame){
    padding:14px 10px 24px !important;
    max-width:none !important;
    width:100% !important;
  }

  .mail-html-frame,
  .shot-html-frame,
  iframe.mail-html-frame,
  iframe.shot-html-frame{
    max-width:100% !important;
    min-height:360px !important;
  }

  .reader-attachment-list{
    grid-template-columns:1fr;
  }

  .side-export-panel{
    display:none;
  }

  .detail-shot-layout{
    height:calc(100svh - 68px) !important;
    min-height:calc(100svh - 68px) !important;
  }
}


/* === Unified icon refresh === */
.ui-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
  vertical-align:middle;
  color:currentColor;
}
.ui-icon svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.85;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.ui-icon.small svg{width:16px;height:16px}
.ui-icon.mini svg{width:14px;height:14px;stroke-width:1.9}
.rail-compose .ui-icon svg{width:20px;height:20px}
.rail-item > span,
.folder-icon,
.reader-attachment-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.searchbar > .ui-icon,
.inbox-shot-search > .ui-icon{
  color:#91a0b4;
  flex:0 0 auto;
}
.topbar-btn.notify-toggle .ui-icon svg{width:19px;height:19px}
.rail-logout .ui-icon svg,
.folder-create-form button .ui-icon svg,
.custom-folder-row button .ui-icon svg,
.reader-toolbar-group .ui-icon svg,
.inline-delete-form button .ui-icon svg,
.mail-row-side-actions .ui-icon svg{
  width:16px;
  height:16px;
}
.reader-mini-actions{
  display:flex;
  align-items:center;
  gap:8px;
  color:#8e9cb0;
}
.folder-icon .ui-icon,
.reader-attachment-icon .ui-icon{
  color:#587191;
}
.folder-create-form button,
.custom-folder-row button,
.inline-delete-form button,
.reader-toolbar-group a,
.reader-toolbar-group button,
.mail-row-side-actions button,
.mobile-reader-back{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="INBOX"]::before{content:''}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Archive"]::before{content:''}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Spam"]::before{content:''}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="Trash"]::before{content:''}
body.sidebar-collapsed:not(.sidebar-peek) .nav-item[href*="accounts"]::before{content:''}


/* === Sidebar-only tooltips desktop + mobile === */
.sidebar-two-tables .tooltipable:hover::after,
.sidebar-two-tables .tooltipable:hover::before,
.tooltipable:hover::after,
.tooltipable:hover::before{
  content:none !important;
  display:none !important;
}

.sidebar-tooltip{
  position:relative;
}

.sidebar-floating-tooltip{
  position:fixed;
  z-index:60000;
  max-width:min(260px, calc(100vw - 24px));
  padding:8px 10px;
  border-radius:11px;
  background:#0b1220;
  color:#fff;
  font-size:12px;
  line-height:1.25;
  font-weight:750;
  letter-spacing:0;
  white-space:nowrap;
  box-shadow:0 14px 34px rgba(0,0,0,.28);
  pointer-events:none;
  animation:sidebarTooltipIn .12s ease both;
}

.sidebar-floating-tooltip::before{
  content:"";
  position:absolute;
  left:-5px;
  top:50%;
  transform:translateY(-50%) rotate(45deg);
  width:10px;
  height:10px;
  background:#0b1220;
  border-radius:2px;
}

.sidebar-floating-tooltip.left::before{
  left:auto;
  right:-5px;
}

.sidebar-tooltip.tooltip-active{
  filter:brightness(1.08);
}

@keyframes sidebarTooltipIn{
  from{opacity:0; transform:translateX(-3px)}
  to{opacity:1; transform:translateX(0)}
}

@media(max-width:720px){
  .sidebar-floating-tooltip{
    white-space:normal;
    max-width:220px;
    font-size:12px;
    padding:9px 11px;
  }
}


/* === Header icon size + mobile reader header + remember login === */
.topbar .ui-icon svg,
.searchbar > .ui-icon svg,
.topbar-btn.notify-toggle .ui-icon svg{
  width:22px;
  height:22px;
  stroke-width:2;
}
.mobile-menu-btn span{
  width:20px;
  height:2.5px;
}
.topbar-btn.notify-toggle{
  width:42px;
  min-width:42px;
  height:38px;
}
.mobile-reader-toolbar-title{
  display:none;
  min-width:0;
}
.remember-login-row{
  display:flex !important;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border:1px solid #e2eaf6;
  border-radius:13px;
  background:#f8fbff;
  margin-top:2px;
}
.remember-login-row input{
  width:18px;
  height:18px;
  accent-color:#315eff;
  flex:0 0 auto;
}
.remember-login-row span{
  margin:0 !important;
  color:#26384f !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  font-size:14px !important;
  font-weight:750 !important;
}
@media(max-width:720px){
  body.mobile-reader-open .topbar{
    display:none !important;
  }
  body.mobile-reader-open .content-wrap{
    padding:6px !important;
  }
  body.mobile-reader-open .mail-layout-shot,
  body.mobile-reader-open .mail-layout-reference,
  body.mobile-reader-open .mail-layout{
    height:calc(100svh - 12px) !important;
    min-height:calc(100svh - 12px) !important;
    border-radius:16px !important;
  }
  body.mobile-reader-open .reader-shot-toolbar{
    min-height:58px !important;
    height:58px !important;
    padding:8px 10px !important;
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:8px !important;
    background:linear-gradient(180deg,#fff,#f8fbff) !important;
    border-bottom:1px solid #e1e9f5 !important;
    box-shadow:0 8px 22px rgba(15,35,65,.06) !important;
  }
  body.mobile-reader-open .reader-toolbar-left-mobile{
    gap:5px !important;
    min-width:0;
  }
  body.mobile-reader-open .reader-toolbar-left-mobile button:nth-of-type(n+2){
    display:none !important;
  }
  body.mobile-reader-open .reader-toolbar-reply-mobile a:nth-child(2){
    display:none !important;
  }
  body.mobile-reader-open .reader-toolbar-export{
    display:none !important;
  }
  body.mobile-reader-open .mobile-reader-toolbar-title{
    display:grid;
    gap:2px;
    min-width:0;
  }
  body.mobile-reader-open .mobile-reader-toolbar-title strong,
  body.mobile-reader-open .mobile-reader-toolbar-title span{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.mobile-reader-open .mobile-reader-toolbar-title strong{
    font-size:13px;
    color:#101f35;
    font-weight:850;
  }
  body.mobile-reader-open .mobile-reader-toolbar-title span{
    font-size:12px;
    color:#78879b;
  }
  body.mobile-reader-open .reader-toolbar-group a,
  body.mobile-reader-open .reader-toolbar-group button{
    width:38px !important;
    height:38px !important;
    border-radius:12px !important;
    background:#fff !important;
    border:1px solid #e4ebf6 !important;
  }
  body.mobile-reader-open .reader-toolbar-group .ui-icon svg{
    width:20px !important;
    height:20px !important;
  }
  body.mobile-reader-open .mobile-reader-back{
    background:#eef4ff !important;
    color:#315eff !important;
    border-color:#dbe5ff !important;
  }
  body.mobile-reader-open .reader-shot-header{
    padding:11px 12px 9px !important;
  }
}


/* === Mobile Pull-to-Refresh inbox === */
.pull-refresh-indicator{
  display:none;
}

@media(max-width:720px){
  .inbox-shot-frame{
    position:relative;
  }

  .pull-refresh-indicator{
    position:absolute;
    left:50%;
    top:0;
    z-index:12;
    transform:translate(-50%,-58px);
    min-height:42px;
    max-width:calc(100% - 28px);
    padding:8px 12px;
    border-radius:999px;
    background:#fff;
    border:1px solid #dfe8f5;
    color:#60718a;
    box-shadow:0 12px 32px rgba(15,35,65,.14);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    pointer-events:none;
    transition:transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
  }

  .pull-refresh-indicator strong{
    font-size:12px;
    font-weight:850;
    white-space:nowrap;
  }

  .pull-refresh-spinner{
    width:17px;
    height:17px;
    border-radius:999px;
    border:2px solid #d5e0ef;
    border-top-color:#315eff;
    flex:0 0 17px;
  }

  .pull-refresh-indicator.ready{
    color:#204dba;
    border-color:#b9c9ff;
    background:#f4f7ff;
  }

  .pull-refresh-indicator.refreshing{
    color:#204dba;
    border-color:#b9c9ff;
    background:#f4f7ff;
  }

  .pull-refresh-indicator.refreshing .pull-refresh-spinner{
    animation:mymailsPullRefreshSpin .72s linear infinite;
  }

  .pull-refresh-indicator.done{
    color:#15754c;
    border-color:#bfead4;
    background:#effdf6;
  }

  .pull-refresh-indicator.error{
    color:#b42323;
    border-color:#ffd1d1;
    background:#fff3f3;
  }

  .inbox-scroll.pull-refresh-active{
    overscroll-behavior-y:contain;
  }

  @keyframes mymailsPullRefreshSpin{
    to{transform:rotate(360deg)}
  }
}


/* === Mobile inbox header touch stability === */
@media(max-width:720px){
  body.mobile-reader-loading .topbar{
    display:flex !important;
  }

  body.mobile-reader-loading .inbox-shot-header{
    display:grid !important;
  }

  body.mobile-reader-loading .inbox-shot-frame{
    opacity:1;
  }

  body.mobile-reader-loading .shot-mail-row.active{
    background:#f4f7ff;
  }

  body.mobile-reader-loading .reader-shot-frame{
    display:none !important;
  }
}


/* === Custom popup confirmations/alerts === */
.mymails-popup-layer{
  position:fixed;
  inset:0;
  z-index:70000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(8,22,42,.42);
  opacity:0;
  pointer-events:none;
  transition:opacity .14s ease;
}

.mymails-popup-layer.show{
  opacity:1;
  pointer-events:auto;
}

.mymails-popup-layer[hidden]{
  display:none;
}

.mymails-popup-card{
  width:min(420px, 100%);
  border-radius:22px;
  background:#fff;
  border:1px solid #dfe8f4;
  box-shadow:0 28px 70px rgba(8,22,42,.26);
  padding:18px;
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  gap:14px;
  transform:translateY(8px) scale(.98);
  transition:transform .14s ease;
}

.mymails-popup-layer.show .mymails-popup-card{
  transform:translateY(0) scale(1);
}

.mymails-popup-icon{
  width:46px;
  height:46px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#f4f7ff;
  color:#315eff;
  font-weight:950;
  font-size:22px;
}

.mymails-popup-content h3{
  margin:2px 0 6px;
  font-size:18px;
  color:#111f36;
}

.mymails-popup-content p{
  margin:0;
  color:#5f7087;
  font-size:14px;
  line-height:1.5;
}

.mymails-popup-actions{
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin-top:4px;
}

/* === Global icon tooltips === */
.global-icon-tooltip{
  position:fixed;
  z-index:65000;
  max-width:min(260px, calc(100vw - 18px));
  padding:8px 10px;
  border-radius:11px;
  background:#0b1220;
  color:#fff;
  font-size:12px;
  line-height:1.25;
  font-weight:750;
  white-space:nowrap;
  box-shadow:0 14px 34px rgba(0,0,0,.26);
  pointer-events:none;
  animation:globalIconTooltipIn .12s ease both;
}

.global-icon-tooltip::before{
  content:"";
  position:absolute;
  left:50%;
  top:-5px;
  transform:translateX(-50%) rotate(45deg);
  width:10px;
  height:10px;
  background:#0b1220;
  border-radius:2px;
}

.global-icon-tooltip.top::before{
  top:auto;
  bottom:-5px;
}

.global-icon-tooltip-active{
  filter:brightness(1.05);
}

@keyframes globalIconTooltipIn{
  from{opacity:0; transform:translateY(-2px)}
  to{opacity:1; transform:translateY(0)}
}

/* === Mobile reader full-width open state === */
@media(max-width:720px){
  body.mobile-reader-open .content-wrap{
    padding:0 !important;
  }

  body.mobile-reader-open .mail-layout-shot,
  body.mobile-reader-open .mail-layout-reference,
  body.mobile-reader-open .mail-layout{
    width:100vw !important;
    height:100svh !important;
    min-height:100svh !important;
    border-radius:0 !important;
    border:0 !important;
    box-shadow:none !important;
  }

  body.mobile-reader-open .reader-shot-frame,
  body.mobile-reader-open .reader-panel{
    width:100vw !important;
    max-width:100vw !important;
    border-radius:0 !important;
    border:0 !important;
  }

  body.mobile-reader-open .reader-shot-toolbar{
    border-radius:0 !important;
  }

  .mymails-popup-card{
    border-radius:20px;
    padding:16px;
  }

  .mymails-popup-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .global-icon-tooltip{
    white-space:normal;
    max-width:220px;
  }
}


/* === Flash messages as overlay toasts === */
.flash-toast{
  position:fixed !important;
  left:50% !important;
  top:max(12px, env(safe-area-inset-top)) !important;
  z-index:72000 !important;
  width:min(720px, calc(100vw - 28px)) !important;
  min-height:46px;
  margin:0 !important;
  padding:12px 44px 12px 15px !important;
  border-radius:16px !important;
  display:flex !important;
  align-items:center;
  gap:12px;
  transform:translate(-50%, -14px) !important;
  opacity:0;
  pointer-events:auto;
  box-shadow:0 18px 45px rgba(8,22,42,.18) !important;
  transition:opacity .18s ease, transform .18s ease;
}

.flash-toast.show{
  opacity:1;
  transform:translate(-50%, 0) !important;
}

.flash-toast.hide{
  opacity:0;
  transform:translate(-50%, -14px) !important;
}

.flash-toast span{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.35;
}

.flash-toast.success{
  background:#f1fff8 !important;
  border-color:#bfead4 !important;
  color:#176743 !important;
}

.flash-toast.error{
  background:#fff0f0 !important;
  border-color:#ffcaca !important;
  color:#991b1b !important;
}

.flash-toast.notice,
.flash-toast:not(.success):not(.error){
  background:#fff8e8 !important;
  border-color:#ffdca8 !important;
  color:#744a00 !important;
}

.flash-close{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border:0;
  border-radius:10px;
  background:rgba(255,255,255,.72);
  color:currentColor;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:900;
  line-height:1;
}

.flash-close:hover{
  background:#fff;
}

@media(max-width:720px){
  .flash-toast{
    top:max(8px, env(safe-area-inset-top)) !important;
    width:calc(100vw - 16px) !important;
    min-height:42px;
    padding:10px 40px 10px 12px !important;
    border-radius:14px !important;
    font-size:13px;
  }

  body.mobile-reader-open .flash-toast{
    top:max(8px, env(safe-area-inset-top)) !important;
  }
}


/* === Account settings accordion + signature editor === */
.accounts-page-compact .page-title{margin-bottom:14px}
.account-accordion-list{display:grid;gap:12px}
.account-collapsible{padding:0!important;overflow:hidden}
.account-collapsible summary{list-style:none}
.account-collapsible summary::-webkit-details-marker{display:none}
.account-summary{
  cursor:pointer;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:16px 18px;
  border-radius:22px;
  background:#fff;
}
.account-collapsible[open] .account-summary{
  border-bottom:1px solid #e6edf7;
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
  background:linear-gradient(180deg,#fff,#f9fbff);
}
.account-summary-main{display:flex;align-items:center;gap:12px;min-width:0}
.account-summary-avatar{
  width:42px;height:42px;border-radius:14px;display:grid;place-items:center;
  background:#edf3ff;color:#315eff;font-weight:950;flex:0 0 auto;
}
.account-summary-text{min-width:0;display:grid;gap:3px}
.account-summary-text strong{font-size:15px;color:#0f2037;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-summary-text em{font-style:normal;color:#718198;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-summary-status{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.account-summary-status span:not(.kbd){
  border-radius:999px;padding:5px 9px;font-size:11px;font-weight:850;white-space:nowrap;
}
.account-summary-status .on{background:#e8f9f1;color:#15754c}
.account-summary-status .on.danger{background:#fff1f1;color:#b42323}
.account-summary-status .off{background:#edf3fd;color:#677790}
.account-summary-chevron{
  width:30px;height:30px;border-radius:10px;display:grid;place-items:center;
  color:#718198;background:#f5f8fd;transition:transform .18s ease;
}
.account-collapsible[open] .account-summary-chevron{transform:rotate(180deg)}
.account-card-body{padding:14px;display:grid;gap:14px;background:#fff}
.account-details-clean{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.account-details-clean div{
  padding:12px;border:1px solid #e7eef8;border-radius:14px;background:#fbfdff;min-width:0;
}
.account-details-clean strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-settings-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.72fr);gap:14px;align-items:start}
.account-signature-form{
  margin:4px 0 2px;
  padding:14px;
  border:1px solid #e4ebf6;
  border-radius:18px;
  background:linear-gradient(180deg,#f9fbff,#fff);
  display:grid;
  gap:12px;
}
.account-signature-form textarea{min-height:180px}
.tox.tox-tinymce{border-radius:14px!important;border-color:#dfe8f5!important;overflow:hidden}
.tox .tox-toolbar__primary{background:#f8fbff!important}
.compose-body-rich textarea{min-height:360px}
@media(max-width:980px){
  .account-summary{grid-template-columns:1fr auto;align-items:start}
  .account-summary-status{grid-column:1 / -1;justify-content:flex-start}
  .account-settings-split{grid-template-columns:1fr}
  .account-details-clean{grid-template-columns:1fr}
}
@media(max-width:720px){
  .account-summary{padding:14px}
  .account-summary-status .kbd{display:none}
  .account-card-body{padding:10px}
  .account-preferences-form,.account-signature-form{padding:12px;border-radius:16px}
}


/* === TinyMCE reliable init polish === */
textarea.tinymce-signature,
textarea.tinymce-compose{
  min-height:220px;
}

textarea.tinymce-ready{
  visibility:hidden;
}

textarea.tinymce-failed{
  visibility:visible;
  border-color:#ffcaca !important;
  background:#fff8f8 !important;
}


/* === Inline connection form + local rich editor fallback === */
.account-connection-form{
  margin:4px 0 2px;
  padding:14px;
  border:1px solid #e4ebf6;
  border-radius:18px;
  background:linear-gradient(180deg,#f9fbff,#fff);
  display:grid;
  gap:12px;
}
.account-connection-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.account-connection-grid label{display:grid;gap:6px}
.account-connection-grid label span{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#7a899e;
  font-weight:850;
}
.account-connection-grid input,
.account-connection-grid select{
  width:100%;
  height:38px;
  border:1px solid #dfe8f5;
  border-radius:11px;
  padding:0 10px;
  background:#fff;
  color:#17263b;
}
.mymails-rich-editor{
  border:1px solid #dfe8f5;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.mymails-rich-toolbar{
  min-height:40px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
  padding:7px;
  background:#f8fbff;
  border-bottom:1px solid #e5edf8;
}
.mymails-rich-toolbar button{
  border:1px solid #dbe5f3;
  background:#fff;
  color:#253852;
  border-radius:9px;
  min-height:28px;
  padding:0 9px;
  font-weight:850;
}
.mymails-rich-area{
  min-height:180px;
  padding:12px;
  outline:none;
  color:#17263b;
  line-height:1.6;
}
.compose-body-rich .mymails-rich-area{min-height:360px}
.mymails-rich-source{display:none !important}
@media(max-width:1100px){.account-connection-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.account-connection-grid{grid-template-columns:1fr}}


/* === Credentials visual saved state === */
.account-details-clean div.complete{border-color:#bfead4;background:#f5fff9}
.account-details-clean div.incomplete{border-color:#ffd1d1;background:#fffafa}
.account-details-clean small{
  display:block;
  margin-top:4px;
  color:#718198;
  font-size:11px;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.account-details-clean div.complete small{color:#15754c}
.account-details-clean div.incomplete small{color:#9a3412}
.credential-safe-note{
  margin-top:-4px;
  padding:9px 11px;
  border-radius:12px;
  background:#f4f7ff;
  border:1px solid #dfe8ff;
  color:#5b6d87;
  font-size:12px;
  line-height:1.4;
}
.password-save-state{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  font-style:normal;
  font-size:10px;
  font-weight:900;
  text-transform:none;
  letter-spacing:0;
}
.password-save-state.saved{background:#e8f9f1;color:#15754c}
.password-save-state.missing{background:#fff1f1;color:#b42323}
.account-connection-grid input::placeholder{color:#8b9ab0}
@media(max-width:720px){
  .account-details-clean small{white-space:normal}
  .credential-safe-note{font-size:11px}
}


/* === Compose theme + always-visible local rich editor hardfix === */
.compose-shell-themed{
  min-height:calc(100vh - 98px);
  display:grid;
  place-items:start stretch;
  padding:0;
}

.compose-shell-themed .compose-card{
  width:100%;
  max-width:none;
  border-radius:22px;
  border:1px solid #dfe8f5;
  background:#f7f9fd;
  box-shadow:0 18px 50px rgba(15,35,65,.08);
  overflow:hidden;
}

.compose-shell-themed .compose-head{
  min-height:62px;
  padding:14px 18px;
  background:#fff;
  border-bottom:1px solid #e3ebf6;
}

.compose-shell-themed .compose-row{
  display:grid;
  grid-template-columns:96px minmax(0,1fr);
  align-items:center;
  gap:12px;
  padding:9px 18px;
  border-bottom:1px solid #e6edf7;
}

.compose-shell-themed .compose-row label{
  color:#6d7d94;
  font-size:12px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.compose-shell-themed input,
.compose-shell-themed select{
  height:34px;
  border:1px solid #e4ebf6;
  border-radius:12px;
  padding:0 12px;
  background:#fff;
  color:#15253d;
}

.compose-shell-themed .compose-body-rich{
  padding:18px;
  background:#f2f5fa;
}

.mymails-rich-editor{
  border:1px solid #d8e4f4;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 10px 28px rgba(15,35,65,.06);
}

.mymails-rich-toolbar{
  min-height:42px;
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
  padding:8px;
  background:linear-gradient(180deg,#fff,#f7faff);
  border-bottom:1px solid #e3ebf6;
}

.mymails-rich-toolbar button{
  border:1px solid #d8e4f4;
  background:#fff;
  color:#243851;
  border-radius:10px;
  min-height:30px;
  padding:0 10px;
  font-weight:850;
}

.mymails-rich-toolbar button:hover{
  background:#f0f5ff;
  border-color:#b9c9ff;
  color:#315eff;
}

.mymails-rich-area{
  min-height:220px;
  padding:14px;
  outline:none;
  color:#17263b;
  line-height:1.6;
  font-size:14px;
  background:#fff;
}

.compose-body-rich .mymails-rich-area{
  min-height:360px;
}

.mymails-rich-source{
  display:none !important;
}

.mymails-rich-editor.html-mode .mymails-rich-source{
  display:block !important;
  width:100%;
  min-height:220px;
  border:0;
  border-radius:0;
  padding:14px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

.compose-body-rich .mymails-rich-editor.html-mode .mymails-rich-source{
  min-height:360px;
}

.compose-shell-themed .compose-foot{
  padding:14px 18px;
  background:#fff;
  border-top:1px solid #e3ebf6;
}

@media(max-width:720px){
  .compose-shell-themed{
    min-height:auto;
  }

  .compose-shell-themed .compose-card{
    border-radius:0;
    border-left:0;
    border-right:0;
  }

  .compose-shell-themed .compose-row{
    grid-template-columns:1fr;
    gap:6px;
    padding:10px 12px;
  }

  .compose-shell-themed .compose-body-rich{
    padding:12px;
  }

  .compose-body-rich .mymails-rich-area{
    min-height:320px;
  }
}


/* === Final single editor + AJAX connection save cleanup === */
.mymails-rich-source-hidden,
textarea.mymails-rich-source[hidden]{display:none!important}
.mymails-rich-editor.html-mode textarea.mymails-rich-source{display:block!important;width:100%;min-height:220px;border:0;padding:14px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#fff;color:#17263b}
.account-connection-form [data-connection-save][disabled]{opacity:.75;cursor:wait}
.account-connection-form{position:relative}


/* === Final connection table + single editor cleanup === */
.mymails-rich-server > textarea.mymails-rich-source,
.mymails-rich-server > textarea.tinymce-signature,
.mymails-rich-server > textarea.tinymce-compose{
  display:none !important;
}

.mymails-rich-server.html-mode > textarea.mymails-rich-source,
.mymails-rich-server.html-mode > textarea.tinymce-signature,
.mymails-rich-server.html-mode > textarea.tinymce-compose{
  display:block !important;
}

.account-details-clean .complete{
  border-color:#bfead4 !important;
  background:#f4fff9 !important;
}

.account-details-clean .incomplete{
  border-color:#ffcaca !important;
  background:#fff8f8 !important;
}


/* === Connection normal submit + editor cleanup === */
.account-connection-form[data-no-ajax="1"]{
  position:relative;
}

.mymails-rich-server[data-rich-editor]{
  display:block !important;
}

.mymails-rich-server[data-rich-editor] > .mymails-rich-toolbar,
.mymails-rich-server[data-rich-editor] > .mymails-rich-area{
  display:flex;
}

.mymails-rich-server[data-rich-editor] > .mymails-rich-area{
  display:block;
}

.mymails-rich-server[data-rich-editor] > textarea.mymails-rich-source{
  display:none !important;
  visibility:hidden !important;
}

.mymails-rich-server[data-rich-editor].html-mode > textarea.mymails-rich-source{
  display:block !important;
  visibility:visible !important;
}

/* Old TinyMCE fallback classes should never create a second visible editor in this build. */
textarea.tinymce-signature:not(.mymails-rich-source),
textarea.tinymce-compose:not(.mymails-rich-source){
  min-height:220px;
}


/* === Advanced TinyMCE optional mode + status chip adjustment === */
.mymails-rich-toolbar [data-tinymce-advanced]{
  background:#eff4ff;
  border-color:#c7d6ff;
  color:#244bc8;
}

.mymails-rich-toolbar [data-tinymce-advanced]:hover{
  background:#e4ebff;
  color:#1737a0;
}

.mymails-rich-editor.tinymce-loading{
  position:relative;
  min-height:240px;
}

.mymails-rich-editor.tinymce-loading::after{
  content:"TinyMCE wird geladen …";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.78);
  color:#315eff;
  font-weight:850;
  z-index:5;
}

.mymails-rich-editor.tinymce-active{
  overflow:visible;
}

.mymails-rich-editor.tinymce-active .tox.tox-tinymce{
  border:0 !important;
  border-radius:0 0 16px 16px !important;
}

.account-summary-status .on{
  box-shadow:0 0 0 1px rgba(21,117,76,.05) inset;
}

.account-details-clean .complete{
  border-color:#bfead4 !important;
  background:#f4fff9 !important;
}

.account-details-clean .incomplete{
  border-color:#ffcaca !important;
  background:#fff8f8 !important;
}


/* === TinyMCE advanced replace-mode fix === */
.mymails-rich-editor.tinymce-active > .mymails-rich-toolbar,
.mymails-rich-editor.tinymce-active > .mymails-rich-area,
.mymails-rich-editor.tinymce-loading > .mymails-rich-toolbar,
.mymails-rich-editor.tinymce-loading > .mymails-rich-area{
  display:none !important;
}

.mymails-rich-editor.tinymce-active > textarea.mymails-rich-source,
.mymails-rich-editor.tinymce-loading > textarea.mymails-rich-source{
  visibility:hidden !important;
  position:absolute !important;
  left:-10000px !important;
  top:auto !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
}

.mymails-rich-editor.tinymce-active .tox.tox-tinymce{
  display:block !important;
  width:100% !important;
}

.mymails-rich-editor.tinymce-active{
  border-radius:16px;
  background:#fff;
}

.mymails-rich-editor.tinymce-loading{
  min-height:260px;
}


/* === Advanced TinyMCE editable target fix === */
.mymails-rich-editor.tinymce-active > .mymails-rich-toolbar,
.mymails-rich-editor.tinymce-active > .mymails-rich-area,
.mymails-rich-editor.tinymce-loading > .mymails-rich-toolbar,
.mymails-rich-editor.tinymce-loading > .mymails-rich-area{
  display:none !important;
}

.mymails-rich-editor.tinymce-active > textarea.mymails-rich-source,
.mymails-rich-editor.tinymce-loading > textarea.mymails-rich-source{
  display:none !important;
}

.mymails-tinymce-target{
  display:block;
  width:100%;
  min-height:260px;
}

.mymails-rich-editor.tinymce-active .tox.tox-tinymce{
  display:block !important;
  width:100% !important;
  border:0 !important;
  border-radius:0 0 16px 16px !important;
}

.mymails-rich-editor.tinymce-active{
  border-radius:16px;
  background:#fff;
  overflow:visible;
}

.mymails-rich-editor.tinymce-loading{
  min-height:280px;
}


/* === Rebuilt mail accounts page === */
.accounts-page-rebuild{
  display:grid;
  gap:16px;
}

.accounts-page-title{
  align-items:center;
  margin-bottom:0;
}

.rebuilt-account-list{
  display:grid;
  gap:14px;
}

.account-card-rebuilt{
  padding:0 !important;
  border-radius:24px;
  overflow:hidden;
  border:1px solid #dfe8f5;
  background:#fff;
  box-shadow:0 16px 42px rgba(15,35,65,.06);
}

.rebuilt-account-summary{
  padding:16px 18px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  border-bottom:1px solid transparent;
}

.account-card-rebuilt[open] .rebuilt-account-summary{
  border-bottom-color:#e4ebf6;
}

.rebuilt-account-body{
  padding:16px;
  display:grid;
  gap:16px;
  background:#fff;
}

.rebuilt-status-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.rebuilt-status-grid > div{
  border:1px solid #e4ebf6;
  border-radius:16px;
  padding:12px;
  min-width:0;
  background:#fbfdff;
}

.rebuilt-status-grid > div.complete{
  border-color:#bfead4 !important;
  background:#f4fff9 !important;
}

.rebuilt-status-grid > div.incomplete{
  border-color:#ffcaca !important;
  background:#fff8f8 !important;
}

.rebuilt-status-grid span{
  display:block;
  color:#7b8aa0;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-bottom:4px;
}

.rebuilt-status-grid strong{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#10223a;
}

.rebuilt-status-grid small{
  display:block;
  margin-top:5px;
  color:#7c4550;
  font-size:12px;
}

.rebuilt-panel,
.rebuilt-preferences-form,
.rebuilt-signature-form{
  border:1px solid #e4ebf6;
  border-radius:20px;
  background:linear-gradient(180deg,#fbfdff,#fff);
  padding:14px;
}

.rebuilt-connection-form{
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  background:transparent !important;
}

.rebuilt-connection-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:11px;
}

.rebuilt-connection-grid input,
.rebuilt-connection-grid select{
  min-height:40px;
}

.rebuilt-settings-split{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(380px,.8fr);
  gap:16px;
  align-items:start;
}

.rebuilt-status-chips .on{
  background:#e8f9f1 !important;
  color:#15754c !important;
}

.rebuilt-status-chips .on.danger{
  background:#fff1f1 !important;
  color:#b42323 !important;
}

.rebuilt-status-chips .off{
  background:#edf3fd !important;
  color:#677790 !important;
}

.password-save-state{
  display:inline-flex;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  font-style:normal;
  font-weight:900;
  text-transform:none;
  letter-spacing:0;
}

.password-save-state.saved{
  background:#e8f9f1;
  color:#15754c;
}

.password-save-state.missing{
  background:#fff1f1;
  color:#b42323;
}

@media(max-width:1100px){
  .rebuilt-status-grid,
  .rebuilt-connection-grid,
  .rebuilt-settings-split{
    grid-template-columns:1fr;
  }
}

@media(max-width:720px){
  .rebuilt-account-body{
    padding:10px;
  }

  .rebuilt-account-summary{
    padding:14px;
  }

  .rebuilt-panel,
  .rebuilt-preferences-form,
  .rebuilt-signature-form{
    padding:12px;
    border-radius:16px;
  }
}


/* === Mail account effective DB source display === */
.account-db-source-debug{border:1px dashed #cbd8ea;border-radius:18px;background:#fbfdff;padding:10px 12px;}
.account-db-source-debug summary{cursor:pointer;font-weight:900;color:#315eff;}
.account-db-source-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px;}
.account-db-source-grid>div{border:1px solid #e4ebf6;border-radius:14px;background:#fff;padding:10px;min-width:0;}
.account-db-source-grid strong{display:block;margin-bottom:6px;color:#10223a;}
.account-db-source-grid p,.account-db-source-grid small{display:block;margin:4px 0;color:#607086;font-size:12px;overflow-wrap:anywhere;}
.account-create-btn{position:relative;z-index:50;}
@media(max-width:980px){.account-db-source-grid{grid-template-columns:1fr;}}


/* === Clean TinyMCE rebuild === */
.mymails-tinymce-box{
  border:1px solid #d6e4f5;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}

.mymails-tinymce-field{
  display:block !important;
  width:100% !important;
  min-height:260px;
  border:0;
  padding:14px;
  font:14px/1.65 Inter, Arial, sans-serif;
  color:#17263b;
  background:#fff;
  resize:vertical;
}

.compose-tinymce-box .mymails-tinymce-field{
  min-height:420px;
}

.mymails-tinymce-box .tox.tox-tinymce{
  border:0 !important;
  border-radius:0 !important;
  width:100% !important;
}

.mymails-tinymce-box .tox .tox-edit-area,
.mymails-tinymce-box .tox .tox-edit-area iframe{
  pointer-events:auto !important;
}

.mymails-tinymce-box .tox .tox-toolbar__primary{
  background:#f8fbff !important;
}

.mymails-tinymce-field.tinymce-failed{
  border:1px dashed #ffb6b6;
  background:#fffafa;
}

.mymails-rich-editor,
.mymails-rich-toolbar,
.mymails-rich-area{
  max-width:100%;
}


/* === TinyMCE source textarea hide + toolbar top fix === */
.mymails-tinymce-box textarea.mymails-tinymce-field.tinymce-ready,
.mymails-tinymce-box textarea.mymails-tinymce-field[aria-hidden="true"]{
  display:none !important;
  visibility:hidden !important;
  min-height:0 !important;
  height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  overflow:hidden !important;
}

.mymails-tinymce-box .tox.tox-tinymce{
  display:flex !important;
  flex-direction:column !important;
}

.mymails-tinymce-box .tox .tox-editor-container{
  display:flex !important;
  flex-direction:column !important;
}

.mymails-tinymce-box .tox .tox-editor-header{
  order:0 !important;
  flex:0 0 auto !important;
  position:relative !important;
  top:auto !important;
  bottom:auto !important;
  z-index:2 !important;
}

.mymails-tinymce-box .tox .tox-sidebar-wrap{
  order:1 !important;
  flex:1 1 auto !important;
  min-height:220px !important;
}

.mymails-tinymce-box .tox .tox-statusbar{
  order:2 !important;
  flex:0 0 auto !important;
}


/* === Compose drafts === */
.compose-draft-warning{
  margin:12px 18px 0;
  padding:10px 12px;
  border:1px solid #ffd1a6;
  border-radius:13px;
  background:#fff8ed;
  color:#9a4b00;
  font-weight:800;
}

.compose-foot-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.drafts-page{
  display:grid;
  gap:16px;
}

.draft-list{
  display:grid;
  gap:12px;
}

.draft-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:stretch;
  border:1px solid #dfe8f5;
  border-radius:18px;
  background:#fff;
  box-shadow:0 12px 30px rgba(20,40,70,.06);
  padding:14px;
}

.draft-card.failed{
  border-color:#ffd1d1;
  background:linear-gradient(180deg,#fff,#fff8f8);
}

.draft-main{
  min-width:0;
  color:inherit;
  text-decoration:none;
  display:grid;
  gap:5px;
}

.draft-status{
  width:max-content;
  padding:4px 8px;
  border-radius:999px;
  background:#edf3ff;
  color:#315eff;
  font-size:11px;
  font-weight:900;
}

.draft-card.failed .draft-status{
  background:#ffecec;
  color:#b42323;
}

.draft-main strong{
  color:#10223a;
  font-size:17px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.draft-main em{
  color:#6d7d92;
  font-style:normal;
  font-size:13px;
}

.draft-main p{
  margin:0;
  color:#485d78;
  font-size:13px;
  line-height:1.45;
}

.draft-main small{
  color:#b42323;
  font-size:12px;
}

.draft-meta{
  display:flex;
  flex-direction:column;
  gap:7px;
  align-items:flex-end;
  justify-content:center;
  color:#6d7d92;
  font-size:12px;
  white-space:nowrap;
}

.draft-meta form{
  margin:0;
}

@media(max-width:760px){
  .draft-card{
    grid-template-columns:1fr;
  }
  .draft-meta{
    align-items:flex-start;
  }
}


/* === Per-account drafts, mobile FABs and mark/star option === */
.virtual-folder .folder-icon svg{
  stroke:#315eff;
}

.draft-mail-row{
  border-left:3px solid #315eff;
  background:linear-gradient(90deg,#f5f8ff,#fff);
}

.mail-row-side-actions{
  gap:6px;
}

.mail-star-form,
.reader-star-form{
  margin:0;
  display:inline-flex;
}

.mail-star,
.mail-star-form button{
  border:0;
  background:transparent;
  color:#a4afbd;
  width:32px;
  height:32px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:21px;
  line-height:1;
  cursor:pointer;
}

.mail-star:hover,
.mail-star.active,
.mail-is-starred .mail-star{
  color:#f5a400;
  background:#fff7df;
}

.tag.draft-tag{
  background:#edf3ff;
  color:#315eff;
}

.tag.starred-tag{
  background:#fff7df;
  color:#aa7100;
}

.mobile-compose-fab,
.mobile-reader-fab-actions{
  display:none;
}

@media(max-width:760px){
  .mobile-compose-fab{
    position:fixed;
    right:18px;
    bottom:calc(18px + env(safe-area-inset-bottom));
    width:58px;
    height:58px;
    border-radius:999px;
    z-index:80;
    background:#315eff;
    color:#fff;
    box-shadow:0 18px 36px rgba(49,94,255,.34);
    align-items:center;
    justify-content:center;
    text-decoration:none;
  }

  .mobile-compose-fab .ui-icon svg{
    width:25px;
    height:25px;
    stroke:#fff;
  }

  body:not(.mobile-reader-open) .mobile-compose-fab{
    display:flex;
  }

  body.mobile-reader-open .mobile-compose-fab{
    display:none;
  }

  .mobile-reader-fab-actions{
    position:fixed;
    right:14px;
    bottom:calc(16px + env(safe-area-inset-bottom));
    z-index:85;
    display:none;
    gap:9px;
    align-items:center;
  }

  body.mobile-reader-open .mobile-reader-fab-actions{
    display:flex;
  }

  .mobile-reader-fab-actions a,
  .mobile-reader-fab-actions button{
    width:48px;
    height:48px;
    border-radius:999px;
    border:0;
    background:#fff;
    color:#17263b;
    box-shadow:0 14px 30px rgba(15,35,65,.18);
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    font-weight:900;
  }

  .mobile-reader-fab-actions a:first-child{
    background:#315eff;
    color:#fff;
  }

  .mobile-reader-fab-actions a:first-child .ui-icon svg{
    stroke:#fff;
  }

  .mobile-reader-fab-actions form{
    margin:0;
  }

  .mobile-reader-fab-actions button.active{
    color:#f5a400;
  }

  .inbox-shot-actions .tiny-btn.primary[href^="/compose"]{
    display:none;
  }
}


/* === Bulk mail selection === */
.mail-bulk-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#f7faff;
}

.mail-bulk-toolbar[hidden]{
  display:none!important;
}

.mail-bulk-toolbar span{
  font-weight:850;
  color:#315eff;
  white-space:nowrap;
}

.mail-bulk-toolbar select{
  width:auto;
  min-width:160px;
  height:38px;
  padding:0 12px;
  border-radius:11px;
}

.mail-bulk-check{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  min-width:34px;
  align-self:stretch;
  cursor:pointer;
}

.mail-bulk-check input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.mail-bulk-check span,
.inbox-check span{
  width:19px;
  height:19px;
  border-radius:7px;
  border:2px solid #c7d6ea;
  background:#fff;
  display:block;
  position:relative;
}

.mail-bulk-check input:checked + span,
.inbox-check input:checked + span{
  border-color:#315eff;
  background:#315eff;
}

.mail-bulk-check input:checked + span::after,
.inbox-check input:checked + span::after{
  content:"";
  position:absolute;
  left:5px;
  top:2px;
  width:5px;
  height:9px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

.mail-row.bulk-selected{
  background:#eef4ff!important;
  box-shadow:inset 0 0 0 1px rgba(49,94,255,.18);
}

.mail-row.bulk-selected .mail-row-link{
  background:transparent!important;
}

@media(max-width:720px){
  .mail-bulk-toolbar{
    position:sticky;
    top:0;
    z-index:10;
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .mail-bulk-toolbar span,
  .mail-bulk-toolbar select{
    grid-column:1 / -1;
    width:100%;
  }

  .mail-bulk-check{
    width:40px;
    min-width:40px;
  }
}


/* === Mail list beautify pass === */
.shot-mail-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 40px;
  align-items:stretch;
  gap:0;
  min-height:96px;
  border-bottom:1px solid #edf2f8;
  background:#fff;
}
.shot-mail-row:last-child{
  border-bottom:0;
}
.shot-mail-row:hover{
  background:#f8fbff;
}
.shot-mail-row.active{
  background:#f1f6ff;
}
.shot-mail-link{
  grid-template-columns:44px minmax(0,1fr);
  gap:12px;
  padding:15px 10px 15px 6px;
  min-height:100%;
  align-items:flex-start;
}
.mail-bulk-check{
  width:34px;
  min-width:34px;
  align-self:stretch;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:18px;
}
.mail-row-side-actions{
  padding:14px 8px 12px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  opacity:1;
}
.mail-row-side-actions form{
  margin:0;
}
.mail-star,
.mail-delete-form button{
  width:28px;
  height:28px;
  border-radius:9px;
  border:1px solid #e5ecf5;
  background:#fff;
  color:#8a98ad;
  display:grid;
  place-items:center;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.mail-star:hover,
.mail-delete-form button:hover{
  background:#f4f7fc;
  color:#355dff;
  border-color:#d6e2f5;
}
.mail-star.active,
.mail-is-starred .mail-star{
  color:#f2b300;
  background:#fffaf0;
  border-color:#f5ddb1;
}
.mail-delete-form button:hover{
  color:#c94b53;
  background:#fff5f5;
  border-color:#f0d0d5;
}
.shot-avatar{
  width:42px;
  height:42px;
  font-size:12px;
}
.shot-mail-row .mail-row-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.shot-mail-row .mail-row-top strong{
  font-size:14px;
  line-height:1.15;
}
.shot-mail-row.mail-is-read .mail-row-top strong,
.shot-mail-row.mail-is-read .mail-subject{
  font-weight:700;
  color:#28384d;
}
.shot-mail-row.mail-is-unread .mail-row-top strong,
.shot-mail-row.mail-is-unread .mail-subject{
  font-weight:800;
  color:#14263e;
}
.shot-mail-row .mail-row-top span{
  flex:0 0 auto;
  margin-top:1px;
  font-size:11px;
  font-weight:700;
  color:#94a2b5;
}
.shot-mail-row .mail-subject{
  margin-top:3px;
  font-size:14px;
  line-height:1.2;
}
.shot-mail-row .mail-preview{
  margin-top:4px;
  font-size:12px;
  line-height:1.45;
  color:#7d8ca0;
}
.shot-mail-row .mail-tags{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.shot-mail-row .tag{
  font-size:10px;
  letter-spacing:.04em;
  padding:4px 8px;
  border-radius:999px;
  background:#f3f6fb;
  color:#62748a;
}
.shot-mail-row .tag.green{
  background:#eaf9f0;
  color:#1d8d57;
}
.shot-mail-row .tag.starred-tag{
  background:#fff7dd;
  color:#9a7600;
}
.inbox-shot-list{
  background:#fff;
}
.inbox-section-label{
  padding:12px 16px 10px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.14em;
  color:#97a5b7;
  background:#f7faff;
  border-top:1px solid #edf2f8;
  border-bottom:1px solid #edf2f8;
}
@media (max-width: 720px){
  .shot-mail-row{
    grid-template-columns:32px minmax(0,1fr) 34px;
    min-height:92px;
  }
  .mail-bulk-check{
    padding-top:16px;
  }
  .shot-mail-link{
    grid-template-columns:40px minmax(0,1fr);
    gap:10px;
    padding:13px 8px 13px 4px;
  }
  .shot-avatar{
    width:40px;
    height:40px;
  }
  .mail-row-side-actions{
    padding:12px 6px 10px 0;
    gap:6px;
  }
  .mail-star,
  .mail-delete-form button{
    width:26px;
    height:26px;
    border-radius:8px;
  }
}


/* === Compose signature block === */
.mymails-signature,
[data-mymails-signature="1"]{
  margin-top:18px;
  color:#34445a;
}
.mymails-signature p:last-child,
[data-mymails-signature="1"] p:last-child{
  margin-bottom:0;
}


/* === Address book and calendar module === */
.productivity-page{display:grid;gap:18px}
.productivity-title{align-items:center}
.productivity-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.productivity-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.productivity-card{padding:22px}
.productivity-card h2{margin:0 0 14px;font-size:20px}
.stack-form{display:grid;gap:12px}
.stack-form label{display:grid;gap:6px;font-weight:800;color:#24364d;font-size:13px}
.stack-form input,.stack-form textarea,.stack-form select,.mini-search-form input,.calendar-feed-box input{width:100%;border:1px solid #d9e4f2;border-radius:13px;padding:11px 12px;background:#fff;color:#14243a;font:inherit}
.stack-form textarea{resize:vertical;min-height:92px}
.inline-check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:8px!important}
.inline-check input{width:auto!important}
.form-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.productivity-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.productivity-section-head h2{margin:0}.productivity-section-head p{margin:3px 0 0;color:var(--muted)}
.mini-search-form{display:flex;gap:8px;align-items:center}.mini-search-form input{min-width:240px}.mini-search-form button,.stack-form button,.form-actions button{border:0;border-radius:13px;padding:11px 15px;background:#315eff;color:#fff;font-weight:850;cursor:pointer}
.contact-list,.source-list{display:grid;gap:10px}.contact-row,.source-row{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:12px;align-items:center;padding:13px;border:1px solid #e5ecf6;border-radius:17px;background:#fbfdff}.source-row{grid-template-columns:minmax(0,1fr) auto}.contact-avatar{width:46px;height:46px;border-radius:15px;background:linear-gradient(135deg,#dbe6ff,#315eff);color:#fff;display:grid;place-items:center;font-weight:900}.contact-main{display:grid;gap:3px;min-width:0}.contact-main strong{font-size:15px}.contact-main span,.contact-main em,.source-row span{font-style:normal;color:#66768e;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.contact-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.contact-actions form{margin:0}.recipient-book-link{font-size:12px;font-weight:800;color:#315eff;text-decoration:none;justify-self:start}.compose-row .recipient-book-link{grid-column:2 / -1;margin-top:-6px}
.calendar-feed-box{display:grid;gap:8px;margin-top:16px;padding:13px;border:1px dashed #cbd9ec;border-radius:16px;background:#f7faff}.calendar-feed-box small{color:#718098}.calendar-board{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid #e3ebf6;border-radius:18px;overflow:hidden;background:#fff}.calendar-weekday{padding:10px;background:#f4f7fc;color:#6c7c92;font-weight:900;text-align:center;font-size:12px;text-transform:uppercase;letter-spacing:.08em}.calendar-day{min-height:118px;padding:9px;border-top:1px solid #e7eef8;border-right:1px solid #e7eef8;background:#fff;display:flex;flex-direction:column;gap:6px}.calendar-day:nth-child(7n){border-right:0}.calendar-day strong{font-size:13px;color:#27394f}.calendar-day.today{background:#f3f7ff;box-shadow:inset 0 0 0 2px rgba(49,94,255,.12)}.muted-day{background:#f9fbfe}.calendar-event-chip{display:grid;gap:2px;padding:6px 7px;border-radius:10px;background:#eef4ff;color:#243b72;text-decoration:none;font-weight:800;font-size:11px;line-height:1.25;overflow:hidden}.calendar-event-chip span{color:#59729d;font-weight:900;font-size:10px}.calendar-event-chip.synced{background:#eefaf3;color:#226140}.calendar-grid-bottom{align-items:stretch}
@media(max-width:980px){.productivity-grid{grid-template-columns:1fr}.productivity-title{align-items:flex-start}.productivity-actions{justify-content:flex-start}.calendar-board{grid-template-columns:1fr}.calendar-weekday{display:none}.calendar-day{min-height:auto;border-right:0}.muted-day{display:none}.contact-row{grid-template-columns:42px minmax(0,1fr)}.contact-actions{grid-column:1/-1;justify-content:flex-start}.source-row{grid-template-columns:1fr}.mini-search-form{width:100%;flex-direction:column;align-items:stretch}.mini-search-form input{min-width:0}}


/* === Auto address sync + inbox styled calendar === */
.inline-action-form{
  display:inline-flex;
  align-items:center;
  margin:0;
}
.inline-action-form button{
  margin:0;
}
.contact-row small.contact-source,
.contact-source{
  display:inline-flex;
  align-items:center;
  width:max-content;
  margin-top:6px;
  padding:3px 8px;
  border-radius:999px;
  background:#eef4ff;
  color:#315eff;
  font-size:10px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.calendar-inbox-layout{
  grid-template-columns:minmax(340px,400px) minmax(0,1fr);
}
.calendar-control-panel,
.calendar-main-panel{
  min-height:calc(100vh - 112px);
}
.calendar-side-header{
  border-bottom:1px solid #e6edf7;
  background:linear-gradient(180deg,#fff,#f8fbff);
}
.calendar-icon-badge{
  width:38px;
  height:38px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#315eff;
  background:#eef4ff;
  border:1px solid #dbe7ff;
}
.calendar-month-nav{
  margin-top:12px;
}
.calendar-side-scroll{
  padding:12px;
  display:grid;
  gap:12px;
  align-content:start;
  background:#fbfcff;
}
.calendar-side-card{
  background:#fff;
  border:1px solid #e6edf7;
  border-radius:18px;
  padding:16px;
  box-shadow:0 10px 25px rgba(15,23,42,.04);
}
.calendar-side-card h2{
  margin:0 0 12px;
  font-size:16px;
  letter-spacing:-.02em;
}
.calendar-side-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.calendar-side-card-head h2{
  margin:0;
}
.calendar-side-card-head span{
  min-width:28px;
  height:28px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#eef4ff;
  color:#315eff;
  font-weight:900;
  font-size:12px;
}
.compact-calendar-form{
  gap:10px;
}
.compact-calendar-form label{
  font-size:12px;
  color:#5e718b;
  font-weight:800;
}
.compact-calendar-form input,
.compact-calendar-form textarea,
.compact-calendar-form select{
  margin-top:5px;
  border-radius:12px;
  min-height:38px;
  padding:9px 11px;
}
.calendar-form-row{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
.calendar-agenda-list{
  display:grid;
  gap:8px;
}
.calendar-agenda-row{
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:8px 10px;
  padding:10px;
  border-radius:14px;
  border:1px solid #e7eef8;
  text-decoration:none;
  background:#fff;
}
.calendar-agenda-row:hover{
  background:#f8fbff;
  border-color:#dbe7ff;
}
.calendar-agenda-row > span{
  grid-row:1 / 3;
  width:40px;
  height:40px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:#eef4ff;
  color:#315eff;
  font-weight:900;
  font-size:12px;
}
.calendar-agenda-row strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#17263b;
  font-size:13px;
}
.calendar-agenda-row em{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#76879f;
  font-style:normal;
  font-size:12px;
}
.inbox-feed-box{
  border-radius:14px;
  margin-top:12px;
  background:#f8fbff;
}
.inbox-source-list{
  display:grid;
  gap:8px;
}
.inbox-source-row{
  border:1px solid #e7eef8;
  border-radius:14px;
  padding:10px;
  background:#fff;
}
.calendar-main-toolbar{
  background:#fff;
}
.calendar-main-toolbar > div:first-child{
  display:grid;
  gap:2px;
}
.calendar-main-toolbar strong{
  font-size:20px;
  letter-spacing:-.03em;
  color:#17263b;
}
.calendar-main-toolbar span{
  color:#8b99ad;
  font-size:12px;
  font-weight:800;
}
.calendar-toolbar-actions a{
  text-decoration:none;
}
.calendar-main-scroll{
  padding:16px;
}
.inbox-calendar-board{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:10px;
  border:0;
  border-radius:0;
  overflow:visible;
  background:transparent;
}
.inbox-calendar-weekday{
  border:0;
  border-radius:12px;
  background:#f3f7fc;
  color:#8a98ad;
  padding:10px;
}
.inbox-calendar-day{
  min-height:128px;
  border:1px solid #e7eef8;
  border-radius:16px;
  padding:10px;
  background:#fff;
  box-shadow:0 8px 20px rgba(15,23,42,.03);
  transition:.15s;
}
.inbox-calendar-day:hover{
  transform:translateY(-1px);
  border-color:#dbe7ff;
  box-shadow:0 12px 28px rgba(49,94,255,.08);
}
.inbox-calendar-day.has-events{
  background:linear-gradient(180deg,#fff,#fbfdff);
}
.inbox-calendar-day.today{
  background:#f1f6ff;
  box-shadow:inset 0 0 0 2px rgba(49,94,255,.16), 0 10px 25px rgba(49,94,255,.08);
}
.calendar-day-number{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
}
.calendar-day-number strong{
  width:28px;
  height:28px;
  border-radius:10px;
  display:grid;
  place-items:center;
  font-size:13px;
  color:#24364e;
  background:#f6f8fc;
}
.calendar-day.today .calendar-day-number strong{
  background:#315eff;
  color:#fff;
}
.calendar-day-number span{
  font-size:10px;
  font-weight:900;
  color:#315eff;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.inbox-calendar-day .calendar-event-chip{
  border-radius:11px;
  padding:7px 8px;
  box-shadow:none;
  border:1px solid rgba(49,94,255,.08);
}
@media(max-width:980px){
  .calendar-inbox-layout{
    grid-template-columns:1fr;
  }
  .calendar-control-panel,
  .calendar-main-panel{
    min-height:auto;
  }
  .calendar-main-scroll{
    padding:12px;
  }
  .inbox-calendar-board{
    grid-template-columns:1fr;
    gap:8px;
  }
  .inbox-calendar-weekday,
  .muted-day{
    display:none;
  }
  .inbox-calendar-day{
    min-height:auto;
  }
  .productivity-actions{
    align-items:flex-start;
  }
}


/* === Unified Inbox Design Pass === */
:root{
  --inbox-bg:#f3f6fb;
  --inbox-card:#ffffff;
  --inbox-card-soft:#f8fbff;
  --inbox-line:#e7edf6;
  --inbox-line-strong:#dbe5f2;
  --inbox-text:#17263b;
  --inbox-muted:#7b8ba3;
  --inbox-blue:#315eff;
  --inbox-shadow:0 20px 46px rgba(35,55,90,.08);
  --inbox-soft-shadow:0 10px 26px rgba(35,55,90,.06);
}
body{
  background:var(--inbox-bg);
}
.main-area{
  background:var(--inbox-bg);
}
.content-wrap{
  background:var(--inbox-bg);
  padding:18px;
}
.topbar{
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--inbox-line);
}
.searchbar{
  background:#f7faff;
  border-color:var(--inbox-line);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.topbar-btn,.tiny-btn,button.tiny-btn{
  border-color:var(--inbox-line);
  background:#fff;
  border-radius:12px;
  color:#25364d;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.topbar-btn:hover,.tiny-btn:hover,button.tiny-btn:hover{
  border-color:#d6e2f5;
  background:#f7faff;
  color:var(--inbox-blue);
}
.topbar-btn.primary,.tiny-btn.primary,button.topbar-btn.primary,button.tiny-btn.primary,
.form-actions button,.compose-foot button[type="submit"],.auth-form button,.stack-form button[type="submit"]{
  background:var(--inbox-blue);
  border-color:var(--inbox-blue);
  color:#fff;
  box-shadow:0 10px 24px rgba(49,94,255,.18);
}
.dashboard-page,.accounts-page,.account-form-page,.compose-shell,
.contacts-inbox-page,.calendar-inbox-layout{
  max-width:100%;
  color:var(--inbox-text);
}
.dashboard-hero,.page-title,.accounts-page-title,.productivity-title{
  background:#fff;
  border:1px solid var(--inbox-line);
  border-radius:22px;
  box-shadow:var(--inbox-shadow);
  padding:18px 20px;
  margin-bottom:18px;
}
.dashboard-hero h1,.page-title h1,.accounts-page-title h1,.productivity-title h1,
.inbox-shot-header h1,.calendar-side-header h1,.contact-side-header h1{
  letter-spacing:-.04em;
  color:var(--inbox-text);
}
.dashboard-hero p,.page-title p,.productivity-title p,
.subline,.muted,.inbox-account-line{
  color:var(--inbox-muted);
}
.dashboard-metrics{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  margin-bottom:18px;
}
.metric-card,.dashboard-panel,.settings-card,.account-card,.export-card,
.compose-card,.calendar-control-panel,.calendar-main-panel,
.contact-control-panel,.contact-main-panel,.auth-card,.login-form-card,.register-card{
  background:#fff;
  border:1px solid var(--inbox-line);
  border-radius:22px;
  box-shadow:var(--inbox-shadow);
}
.metric-card{
  padding:18px;
  min-height:122px;
  display:grid;
  align-content:space-between;
}
.metric-card span,.metric-card em,.panel-head p,.settings-card p,
.calendar-side-card span,.calendar-main-toolbar span,.contact-main-toolbar span{
  color:var(--inbox-muted);
}
.metric-card strong{
  font-size:32px;
  color:var(--inbox-text);
  letter-spacing:-.04em;
}
.metric-card.primary{
  background:linear-gradient(135deg,#315eff,#6f8cff);
  color:#fff;
  border-color:#315eff;
}
.metric-card.primary span,.metric-card.primary em,.metric-card.primary strong{
  color:#fff;
}
.dashboard-grid,.dashboard-grid.lower{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-bottom:18px;
}
.dashboard-panel{
  padding:0;
  overflow:hidden;
}
.panel-head{
  padding:18px 20px;
  border-bottom:1px solid var(--inbox-line);
  background:#fff;
}
.account-stat-list,.compact-mail-list,.folder-stat-list{
  padding:12px;
}
.account-stat-row,.compact-mail-row,.folder-stat-row{
  border:1px solid var(--inbox-line);
  background:#fff;
  border-radius:16px;
  padding:13px;
  box-shadow:none;
}
.compact-mail-row:hover,.account-stat-row:hover,.folder-stat-row:hover{
  background:#f8fbff;
  border-color:#dce7f6;
}
.mail-frame,.mail-list-panel,.reader-panel{
  border-color:var(--inbox-line);
  box-shadow:var(--inbox-shadow);
}
.inbox-shot-header,.reader-shot-toolbar,.calendar-main-toolbar,.contact-main-toolbar{
  background:#fff;
  border-bottom:1px solid var(--inbox-line);
}
.accounts-page .account-accordion-list{
  display:grid;
  gap:14px;
}
.account-card-rebuilt{
  overflow:hidden;
  border-radius:22px;
  border-color:var(--inbox-line);
}
.rebuilt-account-summary{
  padding:16px 18px;
  background:#fff;
  border-radius:22px;
}
.account-card-rebuilt[open] .rebuilt-account-summary{
  border-bottom:1px solid var(--inbox-line);
  border-radius:22px 22px 0 0;
}
.account-summary-avatar,.account-stat-avatar,.contact-avatar,.calendar-icon-badge{
  background:linear-gradient(135deg,#dbe4ff,#315eff);
  color:#fff;
}
.rebuilt-status-chips span,.status-pill,.kbd{
  border-radius:999px;
  border:1px solid #e2eaf6;
  background:#f7faff;
}
.rebuilt-status-chips span.on,.status-pill.green{
  background:#ecfbf3;
  border-color:#c8efd9;
  color:#19754a;
}
.rebuilt-status-chips span.off{
  background:#f5f7fb;
  color:#78879d;
}
.rebuilt-status-chips span.danger{
  background:#fff5f4;
  border-color:#f1cfc9;
  color:#b83f32;
}
.rebuilt-account-body{
  background:#fbfdff;
  padding:16px;
}
.account-status-grid.rebuilt-status-grid > div,
.rebuilt-panel,.account-db-source-debug,.calendar-side-card,
.contact-form-card,.contact-sync-card,.contact-import-card{
  border:1px solid var(--inbox-line);
  background:#fff;
  border-radius:18px;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.form-grid input,.form-grid select,.form-grid textarea,
.stack-form input,.stack-form textarea,.stack-form select,
.compose-row input,.compose-row select,
.auth-form input,.inbox-shot-search input,
.folder-create-form input,.calendar-feed-box input,.mini-search-form input{
  border:1px solid #d9e4f2;
  border-radius:13px;
  background:#fff;
  color:#14243a;
  box-shadow:inset 0 1px 0 rgba(15,23,42,.02);
}
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,
.stack-form input:focus,.stack-form textarea:focus,.stack-form select:focus,
.compose-row input:focus,.compose-row select:focus,
.auth-form input:focus,.inbox-shot-search input:focus{
  border-color:#9db5ff;
  box-shadow:0 0 0 4px rgba(49,94,255,.1);
  outline:none;
}
.switch-row,.pref-toggle-row{
  border-color:var(--inbox-line);
  background:#fff;
  border-radius:16px;
}
.compose-shell{
  min-height:calc(100vh - 102px);
  display:grid;
  place-items:start center;
}
.compose-card{
  width:min(1160px,100%);
  overflow:hidden;
}
.compose-head{
  background:#fff;
  border-bottom:1px solid var(--inbox-line);
  padding:16px 18px;
}
.compose-head span{
  color:var(--inbox-muted);
}
.compose-row{
  border-bottom:1px solid var(--inbox-line);
  background:#fff;
}
.compose-body-rich{
  background:#fbfdff;
  padding:14px;
}
.compose-foot{
  background:#fff;
  border-top:1px solid var(--inbox-line);
}
.mymails-tinymce-box,.tox.tox-tinymce{
  border-radius:18px!important;
  border-color:var(--inbox-line)!important;
  overflow:hidden;
}
.contacts-inbox-page{
  grid-template-columns:390px minmax(0,1fr);
  min-height:calc(100vh - 100px);
}
.contact-control-panel,.contact-main-panel{
  overflow:hidden;
}
.contact-side-scroll,.contact-main-scroll{
  background:#fbfdff;
}
.contact-header-actions{
  align-items:center;
}
.contact-header-actions .inline-action-form{
  margin:0;
}
.contact-main-toolbar{
  min-height:64px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:12px 16px;
}
.contact-search-form{
  max-width:420px;
  width:min(420px,45vw);
  margin:0;
}
.inbox-contact-list{
  display:grid;
  gap:0;
  padding:0;
  background:#fff;
}
.inbox-contact-row{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  min-height:86px;
  border:0;
  border-bottom:1px solid var(--inbox-line);
  border-radius:0;
  padding:14px 16px;
  background:#fff;
}
.inbox-contact-row:hover{
  background:#f8fbff;
}
.inbox-contact-row .contact-main strong{
  display:block;
  font-size:14px;
  color:#17263b;
}
.inbox-contact-row .contact-main span,
.inbox-contact-row .contact-main em,
.inbox-contact-row .contact-source{
  display:block;
  color:var(--inbox-muted);
  font-size:12px;
  margin-top:2px;
}
.contact-actions{
  display:flex;
  gap:7px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.contact-actions form{margin:0;}
.calendar-inbox-layout{
  min-height:calc(100vh - 100px);
}
.calendar-control-panel,.calendar-main-panel{
  overflow:hidden;
}
.calendar-side-scroll,.calendar-main-scroll{
  background:#fbfdff;
}
.inbox-calendar-board{
  border:1px solid var(--inbox-line);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}
.inbox-calendar-weekday{
  background:#f7faff;
  color:#667992;
  border-bottom:1px solid var(--inbox-line);
}
.inbox-calendar-day{
  border-color:var(--inbox-line);
  background:#fff;
}
.inbox-calendar-day:hover{
  background:#f8fbff;
}
.inbox-calendar-day.today{
  box-shadow:inset 0 0 0 2px rgba(49,94,255,.28);
}
.inbox-calendar-day .calendar-event-chip{
  background:#eef4ff;
  color:#315eff;
  border-radius:999px;
}
.auth-shell{
  background:var(--inbox-bg);
}
.login-layout,.register-card{
  max-width:1120px;
}
.login-copy,.login-form-card,.register-card{
  border-radius:24px;
  border:1px solid var(--inbox-line);
  box-shadow:var(--inbox-shadow);
}
.login-copy{
  background:linear-gradient(135deg,#17263b,#315eff);
  color:#fff;
  padding:34px;
}
.login-copy p,.login-copy h1{color:#fff;}
.flash-toast{
  border-radius:16px;
  box-shadow:var(--inbox-soft-shadow);
}
@media(max-width:1180px){
  .dashboard-grid,.dashboard-grid.lower{
    grid-template-columns:1fr;
  }
  .contacts-inbox-page,.calendar-inbox-layout{
    grid-template-columns:1fr;
  }
}
@media(max-width:760px){
  .content-wrap{padding:12px;}
  .dashboard-hero,.page-title,.accounts-page-title,.productivity-title{
    border-radius:18px;
    padding:16px;
  }
  .dashboard-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .metric-card strong{font-size:26px;}
  .contacts-inbox-page,.calendar-inbox-layout{
    min-height:auto;
  }
  .contact-main-toolbar{
    align-items:flex-start;
    flex-direction:column;
  }
  .contact-search-form{
    width:100%;
    max-width:none;
  }
  .inbox-contact-row{
    grid-template-columns:40px minmax(0,1fr);
  }
  .inbox-contact-row .contact-actions{
    grid-column:1 / -1;
    justify-content:flex-start;
    padding-left:52px;
  }
}


/* === Inline reply field in inbox reader === */
.inline-reply-panel{
  margin:22px 0 0;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 10px 26px rgba(43,70,118,.06);
}
.inline-reply-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:#f8fbff;
}
.inline-reply-head span,
.inline-reply-fields label span,
.inline-reply-more summary{
  display:block;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#6e7f97;
}
.inline-reply-head strong{
  display:block;
  margin-top:3px;
  color:#17263b;
}
.inline-reply-form{
  display:grid;
  gap:12px;
  padding:14px 16px 16px;
}
.inline-reply-fields{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}
.inline-reply-fields input{
  width:100%;
  min-height:38px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:0 12px;
}
.inline-reply-more{
  min-width:170px;
}
.inline-reply-more summary{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:0 12px;
  color:#315eff;
}
.inline-reply-more-grid{
  position:absolute;
  z-index:8;
  right:0;
  width:min(460px,calc(100vw - 42px));
  display:grid;
  gap:10px;
  margin-top:8px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 34px rgba(31,52,87,.14);
}
.inline-reply-tinymce-box{
  min-height:260px;
}
.inline-reply-tinymce-box .tox.tox-tinymce{
  min-height:260px!important;
}
.inline-reply-tinymce-box .tox .tox-edit-area,
.inline-reply-tinymce-box .tox .tox-edit-area iframe{
  min-height:180px!important;
}
.inline-reply-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.inline-reply-actions .muted{
  font-size:12px;
}
@media(max-width:720px){
  .inline-reply-panel{
    margin:16px 0 0;
    border-radius:16px;
  }
  .inline-reply-head,
  .inline-reply-actions{
    align-items:stretch;
    flex-direction:column;
  }
  .inline-reply-fields{
    grid-template-columns:1fr;
  }
  .inline-reply-more{
    min-width:0;
  }
  .inline-reply-more-grid{
    position:static;
    width:100%;
  }
}


/* === Soft delete + sidebar animations === */
:root{
  --mm-ease-soft:cubic-bezier(.22,.8,.22,1);
  --mm-ease-snap:cubic-bezier(.2,.9,.28,1);
}
.mail-row,
.shot-mail-row,
.mail-row-link,
.mail-row-side-actions,
.mail-bulk-check{
  transition:
    opacity .22s var(--mm-ease-soft),
    transform .24s var(--mm-ease-soft),
    max-height .28s var(--mm-ease-soft),
    min-height .28s var(--mm-ease-soft),
    height .28s var(--mm-ease-soft),
    margin .28s var(--mm-ease-soft),
    padding .28s var(--mm-ease-soft),
    border-color .2s ease,
    background-color .2s ease,
    box-shadow .2s ease;
}
.mail-row.mail-delete-pending,
.shot-mail-row.mail-delete-pending{
  background:#fff5f5!important;
  border-color:#ffd9d9!important;
}
.mail-row.mail-row-deleting,
.shot-mail-row.mail-row-deleting,
.mail-row.mail-row-moving-out{
  opacity:0!important;
  transform:translateX(-18px) scale(.985)!important;
  max-height:0!important;
  min-height:0!important;
  height:0!important;
  margin-top:0!important;
  margin-bottom:0!important;
  padding-top:0!important;
  padding-bottom:0!important;
  border-width:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
}
.mail-row.mail-row-deleting .mail-row-link,
.mail-row.mail-row-deleting .mail-row-side-actions,
.mail-row.mail-row-deleting .mail-bulk-check,
.shot-mail-row.mail-row-deleting .mail-row-link,
.shot-mail-row.mail-row-deleting .mail-row-side-actions,
.shot-mail-row.mail-row-deleting .mail-bulk-check{
  opacity:0!important;
  transform:translateX(-10px)!important;
}
.reader-panel.reader-delete-pending{
  animation:mymailsReaderDeletePulse .22s var(--mm-ease-soft) both;
}
@keyframes mymailsReaderDeletePulse{
  0%{opacity:1;transform:translateY(0)}
  45%{opacity:.92;transform:translateY(2px)}
  100%{opacity:.72;transform:translateY(4px)}
}
.mail-delete-form button,
.toolbar-delete-form button,
.reader-delete-form button{
  transition:transform .16s var(--mm-ease-snap), background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mail-delete-form button:hover,
.toolbar-delete-form button:hover,
.reader-delete-form button:hover{
  transform:translateY(-1px) scale(1.04);
}
.mail-delete-form button:active,
.toolbar-delete-form button:active,
.reader-delete-form button:active{
  transform:translateY(0) scale(.96);
}
.mail-bulk-toolbar:not([hidden]){
  animation:mymailsBulkToolbarIn .22s var(--mm-ease-soft) both;
}
@keyframes mymailsBulkToolbarIn{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:translateY(0)}
}
.sidebar-two-tables,
.sidebar-table-one,
.sidebar-table-two,
.rail-item,
.rail-item span,
.rail-compose,
.folder-drawer-item,
.folder-drawer-head,
.folder-drawer-actions,
.mobile-overlay{
  transition:
    width .28s var(--mm-ease-soft),
    grid-template-columns .28s var(--mm-ease-soft),
    transform .28s var(--mm-ease-soft),
    opacity .24s ease,
    background-color .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}
.rail-item:hover,
.folder-drawer-item:hover,
.rail-compose:hover{
  transform:translateY(-1px);
}
.rail-item:active,
.folder-drawer-item:active,
.rail-compose:active{
  transform:translateY(0) scale(.985);
}
body.mail-account-selected .sidebar-table-two.open{
  animation:mymailsSidebarDrawerIn .28s var(--mm-ease-soft) both;
}
body.sidebar-soft-closing .sidebar-table-two{
  animation:mymailsSidebarDrawerOut .22s ease both;
}
@keyframes mymailsSidebarDrawerIn{
  from{opacity:0;transform:translateX(-10px)}
  to{opacity:1;transform:translateX(0)}
}
@keyframes mymailsSidebarDrawerOut{
  from{opacity:1;transform:translateX(0)}
  to{opacity:0;transform:translateX(-8px)}
}
body.sidebar-soft-opening .rail-item,
body.sidebar-soft-opening .folder-drawer-item{
  animation:mymailsSidebarItemIn .26s var(--mm-ease-soft) both;
}
body.sidebar-soft-opening .rail-item:nth-child(2){animation-delay:.02s}
body.sidebar-soft-opening .rail-item:nth-child(3){animation-delay:.04s}
body.sidebar-soft-opening .rail-item:nth-child(4){animation-delay:.06s}
body.sidebar-soft-opening .rail-item:nth-child(5){animation-delay:.08s}
body.sidebar-soft-opening .folder-drawer-item:nth-child(2){animation-delay:.02s}
body.sidebar-soft-opening .folder-drawer-item:nth-child(3){animation-delay:.04s}
body.sidebar-soft-opening .folder-drawer-item:nth-child(4){animation-delay:.06s}
@keyframes mymailsSidebarItemIn{
  from{opacity:0;transform:translateX(-6px)}
  to{opacity:1;transform:translateX(0)}
}
body.nav-open .mobile-overlay{
  backdrop-filter:blur(2px);
}
@media (prefers-reduced-motion: reduce){
  .mail-row,
  .shot-mail-row,
  .mail-row-link,
  .mail-row-side-actions,
  .mail-bulk-check,
  .sidebar-two-tables,
  .sidebar-table-one,
  .sidebar-table-two,
  .rail-item,
  .rail-item span,
  .rail-compose,
  .folder-drawer-item,
  .folder-drawer-head,
  .folder-drawer-actions,
  .mobile-overlay{
    transition:none!important;
    animation:none!important;
  }
}
